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

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.Size;
import java.util.Map;

public final class UserIdentificationRequest {
   @Size(min = 1, max = 500)
   @Nullable
   @Schema(
      description = "A unique username identifying the user. Only one field (username or any userdata item) can be set, not both.",
      minLength = 1,
      maxLength = 500
   )
   private String username;
   @Size(min = 1, max = 500)
   @Nullable
   @Schema(
      description = "Data items (e.g. email) belonging to the user, which are unique when combined and thus identify the user. Only one field (username or any userdata item) can be set, not both.",
      maxProperties = 500
   )
   private Map<String, String> data;

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

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public Map<String, String> getData() {
      return this.data;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setUsername(@Nullable String username) {
      this.username = username;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setData(@Nullable Map<String, String> data) {
      this.data = data;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "UserIdentificationRequest(username=" + this.getUsername() + ", data=" + this.getData() + ")";
   }
}
