package com.airlock.iam.transactionapproval.infrastructure.transfer.response;

import com.fasterxml.jackson.annotation.JsonTypeName;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import java.util.List;
import lombok.NonNull;

@JsonTypeName("transaction-approval.airlock-2fa.device")
public final class TransactionApprovalAirlock2FADeviceData {
   public static final String TRANSACTION_APPROVAL_AIRLOCK_2FA_DEVICE_TYPE = "transaction-approval.airlock-2fa.device";
   @Schema(description = "A short string which can be used to identify the device in a prompt. By default, the display name is the device model.")
   @NonNull
   private final String displayName;
   @ArraySchema(arraySchema = @Schema(description = "Deprecated for removal without replacement."))
   @Deprecated(since = "7.3")
   @NotNull
   private final List<Airlock2FADeviceLegacyCapabilityData> capabilities;

   @SuppressFBWarnings(justification = "generated code")
   public TransactionApprovalAirlock2FADeviceData(@NonNull String displayName, List<Airlock2FADeviceLegacyCapabilityData> capabilities) {
      if (displayName == null) {
         throw new NullPointerException("displayName is marked non-null but is null");
      }

      this.displayName = displayName;
      this.capabilities = capabilities;
   }

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

   @Deprecated
   @SuppressFBWarnings(justification = "generated code")
   public List<Airlock2FADeviceLegacyCapabilityData> getCapabilities() {
      return this.capabilities;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof TransactionApprovalAirlock2FADeviceData 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$capabilities = this.capabilities;
            Object other$capabilities = other.capabilities;
            return this$capabilities == null ? other$capabilities == null : this$capabilities.equals(other$capabilities);
         } 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 $capabilities = this.capabilities;
      return result * 59 + ($capabilities == null ? 43 : $capabilities.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "TransactionApprovalAirlock2FADeviceData(displayName=" + this.getDisplayName() + ", capabilities=" + this.getCapabilities() + ")";
   }
}
