package com.airlock.iam.authentication.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.annotation.Nullable;
import jakarta.validation.constraints.NotNull;

@JsonTypeName("authentication.cronto.device.activation-challenge")
public class CrontoActivationChallengeData {
   public static final String CRONTO_ACTIVATION_CHALLENGE_TYPE = "authentication.cronto.device.activation-challenge";
   @NotNull
   @Schema(description = "Challenge image (cryptogram) in format \"image/png\" encoded into a base64 string.")
   private String challengeImage;
   @Nullable
   @Schema(description = "The secure channel challenge (for use in app-to-app scenarios).")
   private String secureChannelChallenge;

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

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

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

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

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "CrontoActivationChallengeData(challengeImage=" + this.getChallengeImage() + ", secureChannelChallenge=" + this.getSecureChannelChallenge() + ")";
   }
}
