package com.airlock.iam.transactionapproval.infrastructure.transfer.request;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.HashMap;
import java.util.Map;

public class TransactionApprovalParameterRequest {
   @Nullable
   @Schema(
      nullable = true,
      description = "The id that will be used to determine which devices can or can not be used for the further transaction approval process.",
      maxLength = 100000
   )
   @Size(max = 100000)
   private String authTokenId;
   @NotNull
   @Schema(ref = "#/components/schemas/TransactionApprovalParameterRequestMessageParametersOverride")
   @Size(min = 1)
   private Map<@Size(min = 1, max = 100) String, @Size(min = 1, max = 10000) String> messageParameters = new HashMap<>();

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

   @SuppressFBWarnings(justification = "generated code")
   public Map<@Size(min = 1, max = 100) String, @Size(min = 1, max = 10000) String> getMessageParameters() {
      return this.messageParameters;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public void setMessageParameters(Map<@Size(min = 1, max = 100) String, @Size(min = 1, max = 10000) String> messageParameters) {
      this.messageParameters = messageParameters;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof TransactionApprovalParameterRequest other)) {
         return false;
      } else if (!other.canEqual(this)) {
         return false;
      } else {
         Object this$authTokenId = this.authTokenId;
         Object other$authTokenId = other.authTokenId;
         if (this$authTokenId == null ? other$authTokenId == null : this$authTokenId.equals(other$authTokenId)) {
            Object this$messageParameters = this.messageParameters;
            Object other$messageParameters = other.messageParameters;
            return this$messageParameters == null ? other$messageParameters == null : this$messageParameters.equals(other$messageParameters);
         } else {
            return false;
         }
      }
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "TransactionApprovalParameterRequest(authTokenId=" + this.getAuthTokenId() + ", messageParameters=" + this.getMessageParameters() + ")";
   }
}
