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.ArraySchema;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import java.util.List;

@JsonTypeName("authentication.data-edit-item-info")
public final class UserDataEditItemInfoAuthResponseAttributesData {
   public static final String JSON_API_ID_DESCRIPTION = "The configured context-data name";
   public static final String USER_DATA_EDIT_ITEM_AUTH_INFO_TYPE = "authentication.data-edit-item-info";
   @Nullable
   @Schema(
      oneOf = {Object.class, String.class, Number.class, Boolean.class, Long.class},
      description = "Current value of this item in the data edit step. If this item was not edited, the value returned corresponds to the persisted value. Maybe absent if no value is defined or is not yet available."
   )
   private final Object currentValue;
   @Nullable
   @Schema(description = "Whether a value for the item has to be edit in the current data edit step. May be absent for custom data items.")
   private final Boolean required;
   @Nullable
   @Schema(description = "The type of the item. May be absent for custom data items.")
   private final String itemType;
   @Nullable
   @Schema(description = "The input purpose to be rendered in the HTML attribute \"autocomplete\".")
   private final String inputPurpose;
   @ArraySchema(
      arraySchema = @Schema(description = "Known additional validations that will be performed on the item. May be absent. Further validations may apply.")
   )
   @Nullable
   private final List<UserDataItemValidationAuthData> additionalValidations;
   @ArraySchema(arraySchema = @Schema(description = "The optional list of allowed values the user can choose from."))
   @Nullable
   private final List<String> allowedValues;

   @SuppressFBWarnings(justification = "generated code")
   public UserDataEditItemInfoAuthResponseAttributesData(
      @Nullable Object currentValue,
      @Nullable Boolean required,
      @Nullable String itemType,
      @Nullable String inputPurpose,
      @Nullable List<UserDataItemValidationAuthData> additionalValidations,
      @Nullable List<String> allowedValues
   ) {
      this.currentValue = currentValue;
      this.required = required;
      this.itemType = itemType;
      this.inputPurpose = inputPurpose;
      this.additionalValidations = additionalValidations;
      this.allowedValues = allowedValues;
   }

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

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public Boolean getRequired() {
      return this.required;
   }

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

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

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public List<UserDataItemValidationAuthData> getAdditionalValidations() {
      return this.additionalValidations;
   }

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public List<String> getAllowedValues() {
      return this.allowedValues;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "UserDataEditItemInfoAuthResponseAttributesData(currentValue="
         + this.getCurrentValue()
         + ", required="
         + this.getRequired()
         + ", itemType="
         + this.getItemType()
         + ", inputPurpose="
         + this.getInputPurpose()
         + ", additionalValidations="
         + this.getAdditionalValidations()
         + ", allowedValues="
         + this.getAllowedValues()
         + ")";
   }
}
