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.validation.constraints.NotNull;

@JsonTypeName("authentication.airlock-2fa.activation.challenge")
public final class AuthenticationAirlock2FAActivationChallengeData {
   public static final String AIRLOCK_2FA_ACTIVATION_CHALLENGE_TYPE = "authentication.airlock-2fa.activation.challenge";
   @NotNull
   @Schema(description = "The URL to trigger the activation on the Airlock 2FA app device.")
   private final String appDeviceActivationUrl;
   @NotNull
   @Schema(description = "The base64 encoded PNG representing the QR code needed to activate the device.")
   private final String activationQrCode;

   @SuppressFBWarnings(justification = "generated code")
   public AuthenticationAirlock2FAActivationChallengeData(String appDeviceActivationUrl, String activationQrCode) {
      this.appDeviceActivationUrl = appDeviceActivationUrl;
      this.activationQrCode = activationQrCode;
   }

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

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "AuthenticationAirlock2FAActivationChallengeData(appDeviceActivationUrl="
         + this.getAppDeviceActivationUrl()
         + ", activationQrCode="
         + this.getActivationQrCode()
         + ")";
   }
}
