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

import com.fasterxml.jackson.annotation.JsonTypeName;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import java.time.Instant;

@JsonTypeName("api-key")
public class ApiKeyData {
   @NotNull
   @Schema(description = "The creation date of the API key.")
   private Instant creationDate;
   @Schema(description = "Description of the API key.")
   private String description;
   @NotNull
   @Schema(description = "The actual API key secret.")
   private String secret;
   @Schema(description = "The validity start date.")
   private Instant validFrom;
   @Schema(description = "The validity end date.")
   private Instant validTo;
   @NotNull
   @Schema(description = "The lock information.")
   private boolean locked;

   @SuppressFBWarnings(justification = "generated code")
   public Instant getCreationDate() {
      return this.creationDate;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public String getSecret() {
      return this.secret;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   public boolean isLocked() {
      return this.locked;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setCreationDate(Instant creationDate) {
      this.creationDate = creationDate;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public void setSecret(String secret) {
      this.secret = secret;
   }

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

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

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

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

         if (this.locked != other.locked) {
            return false;
         }

         Object this$creationDate = this.creationDate;
         Object other$creationDate = other.creationDate;
         if (this$creationDate == null ? other$creationDate == null : this$creationDate.equals(other$creationDate)) {
            Object this$description = this.description;
            Object other$description = other.description;
            if (this$description == null ? other$description == null : this$description.equals(other$description)) {
               Object this$secret = this.secret;
               Object other$secret = other.secret;
               if (this$secret == null ? other$secret == null : this$secret.equals(other$secret)) {
                  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;
            }
         } else {
            return false;
         }
      }
   }

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.locked ? 79 : 97);
      Object $creationDate = this.creationDate;
      result = result * 59 + ($creationDate == null ? 43 : $creationDate.hashCode());
      Object $description = this.description;
      result = result * 59 + ($description == null ? 43 : $description.hashCode());
      Object $secret = this.secret;
      result = result * 59 + ($secret == null ? 43 : $secret.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 "ApiKeyData(creationDate="
         + this.getCreationDate()
         + ", description="
         + this.getDescription()
         + ", secret="
         + this.getSecret()
         + ", validFrom="
         + this.getValidFrom()
         + ", validTo="
         + this.getValidTo()
         + ", locked="
         + this.isLocked()
         + ")";
   }
}
