package com.airlock.iam.admin.infrastructure.transfer.request.techclient;

import com.fasterxml.jackson.annotation.JsonTypeName;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.Size;
import java.util.Date;

@JsonTypeName("api-key")
public class ApiKeyCreateRequest {
   @Nullable
   @Schema(description = "Description of the API key.", minLength = 1, maxLength = 100)
   @Size(min = 1, max = 100)
   private String description;
   @Nullable
   @Schema(type = "string", description = "The validity start date.")
   private Date validFrom;
   @Nullable
   @Schema(type = "string", description = "The validity end date.")
   private Date validTo;
   @Nullable
   @Schema(description = "The lock information.")
   private Boolean locked;

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public String getDescription() {
      return this.description;
   }

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public Date getValidFrom() {
      return this.validFrom;
   }

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public Date getValidTo() {
      return this.validTo;
   }

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public Boolean getLocked() {
      return this.locked;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setDescription(@Nullable String description) {
      this.description = description;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setValidFrom(@Nullable Date validFrom) {
      this.validFrom = validFrom;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setValidTo(@Nullable Date validTo) {
      this.validTo = validTo;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setLocked(@Nullable Boolean locked) {
      this.locked = locked;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof ApiKeyCreateRequest other)) {
         return false;
      } else {
         if (!other.canEqual(this)) {
            return false;
         }

         Object this$locked = this.locked;
         Object other$locked = other.locked;
         if (this$locked == null ? other$locked == null : this$locked.equals(other$locked)) {
            Object this$description = this.description;
            Object other$description = other.description;
            if (this$description == null ? other$description == null : this$description.equals(other$description)) {
               Object this$validFrom = this.validFrom;
               Object other$validFrom = other.validFrom;
               if (this$validFrom == null ? other$validFrom == null : this$validFrom.equals(other$validFrom)) {
                  Object this$validTo = this.validTo;
                  Object other$validTo = other.validTo;
                  return this$validTo == null ? other$validTo == null : this$validTo.equals(other$validTo);
               } else {
                  return false;
               }
            } else {
               return false;
            }
         } else {
            return false;
         }
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   protected boolean canEqual(Object other) {
      return other instanceof ApiKeyCreateRequest;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $locked = this.locked;
      result = result * 59 + ($locked == null ? 43 : $locked.hashCode());
      Object $description = this.description;
      result = result * 59 + ($description == null ? 43 : $description.hashCode());
      Object $validFrom = this.validFrom;
      result = result * 59 + ($validFrom == null ? 43 : $validFrom.hashCode());
      Object $validTo = this.validTo;
      return result * 59 + ($validTo == null ? 43 : $validTo.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "ApiKeyCreateRequest(description="
         + this.getDescription()
         + ", validFrom="
         + this.getValidFrom()
         + ", validTo="
         + this.getValidTo()
         + ", locked="
         + this.getLocked()
         + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public ApiKeyCreateRequest() {
   }

   @SuppressFBWarnings(justification = "generated code")
   public ApiKeyCreateRequest(@Nullable String description, @Nullable Date validFrom, @Nullable Date validTo, @Nullable Boolean locked) {
      this.description = description;
      this.validFrom = validFrom;
      this.validTo = validTo;
      this.locked = locked;
   }
}
