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

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

@JsonInclude(Include.NON_EMPTY)
public class CrontoCompleteDeviceActivationFlowRequest {
   @NotNull
   @Schema(description = "The OTP obtained by scanning the challenge cryptogram.", minLength = 1, maxLength = 200)
   @Size(min = 1, max = 200)
   private String secondOtp;
   @Pattern(regexp = "^(?![^\\p{L}\\d-_]*$).+$")
   @Schema(description = "The name of the new Cronto device, consisting of letters, digits, _, - and spaces.", minLength = 1, maxLength = 100)
   @NotNull
   @Size(min = 1, max = 100)
   private String label;

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

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

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

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

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "CrontoCompleteDeviceActivationFlowRequest(secondOtp=" + this.getSecondOtp() + ", label=" + this.getLabel() + ")";
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public CrontoCompleteDeviceActivationFlowRequest(String secondOtp, String label) {
      this.secondOtp = secondOtp;
      this.label = label;
   }
}
