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.mtan.token.information")
public final class AuthenticationMtanRegistrationTokenInformationData {
   public static final String USER_EDIT_ITEM_AUTH_INFO_TYPE = "authentication.mtan.token.information";
   @NotNull
   @Schema(description = "Number information.")
   private final AuthenticationMtanRegistrationTokenInformationData.AuthenticationMtanRegistrationTokenNumberData number;
   @Nullable
   @Schema(description = "Label information.")
   private final AuthenticationMtanRegistrationTokenInformationData.AuthenticationMtanRegistrationTokenLabelData label;

   @SuppressFBWarnings(justification = "generated code")
   public AuthenticationMtanRegistrationTokenInformationData(
      AuthenticationMtanRegistrationTokenInformationData.AuthenticationMtanRegistrationTokenNumberData number,
      @Nullable AuthenticationMtanRegistrationTokenInformationData.AuthenticationMtanRegistrationTokenLabelData label
   ) {
      this.number = number;
      this.label = label;
   }

   @SuppressFBWarnings(justification = "generated code")
   public AuthenticationMtanRegistrationTokenInformationData.AuthenticationMtanRegistrationTokenNumberData getNumber() {
      return this.number;
   }

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public AuthenticationMtanRegistrationTokenInformationData.AuthenticationMtanRegistrationTokenLabelData getLabel() {
      return this.label;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "AuthenticationMtanRegistrationTokenInformationData(number=" + this.getNumber() + ", label=" + this.getLabel() + ")";
   }

   public static final class AuthenticationMtanRegistrationTokenLabelData {
      @Schema(description = "The current value of the label.")
      private final String currentValue;
      @NotNull
      @Schema(description = "Whether label is required.")
      private final boolean required;

      @SuppressFBWarnings(justification = "generated code")
      public AuthenticationMtanRegistrationTokenLabelData(String currentValue, boolean required) {
         this.currentValue = currentValue;
         this.required = required;
      }

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

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

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

            Object this$currentValue = this.currentValue;
            Object other$currentValue = other.currentValue;
            return this$currentValue == null ? other$currentValue == null : this$currentValue.equals(other$currentValue);
         }
      }

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

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "AuthenticationMtanRegistrationTokenInformationData.AuthenticationMtanRegistrationTokenLabelData(currentValue="
            + this.getCurrentValue()
            + ", required="
            + this.isRequired()
            + ")";
      }
   }

   public static final class AuthenticationMtanRegistrationTokenNumberData {
      @Nullable
      @Schema(description = "The current value of the number.")
      private final String currentValue;

      @SuppressFBWarnings(justification = "generated code")
      public AuthenticationMtanRegistrationTokenNumberData(@Nullable String currentValue) {
         this.currentValue = currentValue;
      }

      @Nullable
      @SuppressFBWarnings(justification = "generated code")
      public String getCurrentValue() {
         return this.currentValue;
      }

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

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

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "AuthenticationMtanRegistrationTokenInformationData.AuthenticationMtanRegistrationTokenNumberData(currentValue=" + this.getCurrentValue() + ")";
      }
   }
}
