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

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;

@JsonTypeName("transaction-approval.mtan.otp.resend.information")
public final class TransactionApprovalResendMtanOtpPossibleData {
   public static final String TRANSACTION_APPROVAL_MTAN_OTP_RESEND_INFORMATION_TYPE = "transaction-approval.mtan.otp.resend.information";
   @NotNull
   @Schema(
      description = "Indicates whether an OTP resend may be requested by the client. An OTP resend is not possible, if the maximum amount of resends has already been exceeded."
   )
   private final boolean otpResendPossible;

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      return result * 59 + (this.otpResendPossible ? 79 : 97);
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "TransactionApprovalResendMtanOtpPossibleData(otpResendPossible=" + this.isOtpResendPossible() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public TransactionApprovalResendMtanOtpPossibleData(boolean otpResendPossible) {
      this.otpResendPossible = otpResendPossible;
   }
}
