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.zero-touch.information")
public final class Airlock2FAZeroTouchInformationData {
   public static final String AIRLOCK_2FA_ZERO_TOUCH_INFORMATION_TYPE = "authentication.airlock-2fa.zero-touch.information";
   @NotNull
   @Schema(description = "Flag to determine if either Zero-Touch or One-Touch is enabled.")
   private final boolean zeroTouchEnabled;
   @Schema(description = "The external base URL of the Futurae server. Only available if Zero-Touch is enabled.")
   private final String frontEndBaseUrl;
   @Schema(description = "The token that is to be supplied to the client executing Zero-Touch. Only available if Zero-Touch is enabled.")
   private final String sessionToken;
   @Schema(
      description = "The login ID is used to correlate the authentication on the client (login form) with the One-Touch push notification on the 2FA device."
   )
   private final String loginId;

   @SuppressFBWarnings(justification = "generated code")
   public Airlock2FAZeroTouchInformationData(boolean zeroTouchEnabled, String frontEndBaseUrl, String sessionToken, String loginId) {
      this.zeroTouchEnabled = zeroTouchEnabled;
      this.frontEndBaseUrl = frontEndBaseUrl;
      this.sessionToken = sessionToken;
      this.loginId = loginId;
   }

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

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

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

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

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

         Object this$frontEndBaseUrl = this.frontEndBaseUrl;
         Object other$frontEndBaseUrl = other.frontEndBaseUrl;
         if (this$frontEndBaseUrl == null ? other$frontEndBaseUrl == null : this$frontEndBaseUrl.equals(other$frontEndBaseUrl)) {
            Object this$sessionToken = this.sessionToken;
            Object other$sessionToken = other.sessionToken;
            if (this$sessionToken == null ? other$sessionToken == null : this$sessionToken.equals(other$sessionToken)) {
               Object this$loginId = this.loginId;
               Object other$loginId = other.loginId;
               return this$loginId == null ? other$loginId == null : this$loginId.equals(other$loginId);
            } else {
               return false;
            }
         } else {
            return false;
         }
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.zeroTouchEnabled ? 79 : 97);
      Object $frontEndBaseUrl = this.frontEndBaseUrl;
      result = result * 59 + ($frontEndBaseUrl == null ? 43 : $frontEndBaseUrl.hashCode());
      Object $sessionToken = this.sessionToken;
      result = result * 59 + ($sessionToken == null ? 43 : $sessionToken.hashCode());
      Object $loginId = this.loginId;
      return result * 59 + ($loginId == null ? 43 : $loginId.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "Airlock2FAZeroTouchInformationData(zeroTouchEnabled="
         + this.isZeroTouchEnabled()
         + ", frontEndBaseUrl="
         + this.getFrontEndBaseUrl()
         + ", sessionToken="
         + this.getSessionToken()
         + ", loginId="
         + this.getLoginId()
         + ")";
   }
}
