package com.airlock.iam.publicselfservice.infrastructure.transfer;

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("public-self-service.airlock-2fa.device")
public final class PublicSelfServiceAirlock2FADeviceData {
   public static final String PASSWORD_RESET_AIRLOCK_2FA_DEVICE_TYPE = "public-self-service.airlock-2fa.device";
   @NotNull
   @Schema(description = "A short string which can be used to identify the device in a prompt.")
   private final String displayName;
   @NotNull
   @Schema(description = "Type of the device.")
   private final PublicSelfServiceAirlock2FADeviceData.DeviceTypeData deviceType;

   @SuppressFBWarnings(justification = "generated code")
   public PublicSelfServiceAirlock2FADeviceData(String displayName, PublicSelfServiceAirlock2FADeviceData.DeviceTypeData deviceType) {
      this.displayName = displayName;
      this.deviceType = deviceType;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public PublicSelfServiceAirlock2FADeviceData.DeviceTypeData getDeviceType() {
      return this.deviceType;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "PublicSelfServiceAirlock2FADeviceData(displayName=" + this.getDisplayName() + ", deviceType=" + this.getDeviceType() + ")";
   }

   public enum DeviceTypeData {
      ANDROID,
      IOS,
      HARDWARE;
   }
}
