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.push-device.activation-challenge")
public final class CrontoPushActivationChallengeData {
   public static final String CRONTO_PUSH_ACTIVATION_CHALLENGE_TYPE = "authentication.cronto.push-device.activation-challenge";
   @NotNull
   @Schema(description = "Challenge image (cryptogram) in format \"image/png\" encoded into a base64 string.")
   private final String challengeImage;
   @Nullable
   @Schema(description = "The secure channel challenge (for use in app-to-app scenarios).")
   private final String secureChannelChallenge;

   @SuppressFBWarnings(justification = "generated code")
   public CrontoPushActivationChallengeData(String challengeImage, @Nullable String secureChannelChallenge) {
      this.challengeImage = challengeImage;
      this.secureChannelChallenge = 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")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof CrontoPushActivationChallengeData other)) {
         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")
   @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 "CrontoPushActivationChallengeData(challengeImage="
         + this.getChallengeImage()
         + ", secureChannelChallenge="
         + this.getSecureChannelChallenge()
         + ")";
   }
}
