/*
 * The Plaid API
 * The Plaid REST API. Please see https://plaid.com/docs/api for more details.
 *
 * The version of the OpenAPI document: 2020-09-14_1.680.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.plaid.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.plaid.client.model.ClientUserIdentityAddress;
import com.plaid.client.model.ClientUserIdentityEmail;
import com.plaid.client.model.ClientUserIdentityName;
import com.plaid.client.model.ClientUserIdentityPhoneNumber;
import com.plaid.client.model.UserIDNumber;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

/**
 * ClientUserIdentity is the shared user identity construct across /user/_* routes.
 */
@ApiModel(description = "ClientUserIdentity is the shared user identity construct across /user/_* routes.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-12-11T18:58:39.328614Z[Etc/UTC]")
public class ClientUserIdentity {
  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private ClientUserIdentityName name;

  public static final String SERIALIZED_NAME_DATE_OF_BIRTH = "date_of_birth";
  @SerializedName(SERIALIZED_NAME_DATE_OF_BIRTH)
  private LocalDate dateOfBirth;

  public static final String SERIALIZED_NAME_EMAILS = "emails";
  @SerializedName(SERIALIZED_NAME_EMAILS)
  private List<ClientUserIdentityEmail> emails = null;

  public static final String SERIALIZED_NAME_PHONE_NUMBERS = "phone_numbers";
  @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS)
  private List<ClientUserIdentityPhoneNumber> phoneNumbers = null;

  public static final String SERIALIZED_NAME_ADDRESSES = "addresses";
  @SerializedName(SERIALIZED_NAME_ADDRESSES)
  private List<ClientUserIdentityAddress> addresses = null;

  public static final String SERIALIZED_NAME_ID_NUMBERS = "id_numbers";
  @SerializedName(SERIALIZED_NAME_ID_NUMBERS)
  private List<UserIDNumber> idNumbers = null;


  public ClientUserIdentity name(ClientUserIdentityName name) {
    
    this.name = name;
    return this;
  }

   /**
   * Get name
   * @return name
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public ClientUserIdentityName getName() {
    return name;
  }


  public void setName(ClientUserIdentityName name) {
    this.name = name;
  }


  public ClientUserIdentity dateOfBirth(LocalDate dateOfBirth) {
    
    this.dateOfBirth = dateOfBirth;
    return this;
  }

   /**
   * The user&#39;s date of birth, to be provided in the format \&quot;yyyy-mm-dd\&quot;.
   * @return dateOfBirth
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The user's date of birth, to be provided in the format \"yyyy-mm-dd\".")

  public LocalDate getDateOfBirth() {
    return dateOfBirth;
  }


  public void setDateOfBirth(LocalDate dateOfBirth) {
    this.dateOfBirth = dateOfBirth;
  }


  public ClientUserIdentity emails(List<ClientUserIdentityEmail> emails) {
    
    this.emails = emails;
    return this;
  }

  public ClientUserIdentity addEmailsItem(ClientUserIdentityEmail emailsItem) {
    if (this.emails == null) {
      this.emails = new ArrayList<>();
    }
    this.emails.add(emailsItem);
    return this;
  }

   /**
   * The user&#39;s emails.
   * @return emails
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The user's emails.")

  public List<ClientUserIdentityEmail> getEmails() {
    return emails;
  }


  public void setEmails(List<ClientUserIdentityEmail> emails) {
    this.emails = emails;
  }


  public ClientUserIdentity phoneNumbers(List<ClientUserIdentityPhoneNumber> phoneNumbers) {
    
    this.phoneNumbers = phoneNumbers;
    return this;
  }

  public ClientUserIdentity addPhoneNumbersItem(ClientUserIdentityPhoneNumber phoneNumbersItem) {
    if (this.phoneNumbers == null) {
      this.phoneNumbers = new ArrayList<>();
    }
    this.phoneNumbers.add(phoneNumbersItem);
    return this;
  }

   /**
   * The user&#39;s phone numbers, in E.164 format: +{countrycode}{number}. For example: \&quot;+14157452130\&quot;. Phone numbers provided in other formats will be parsed on a best-effort basis. Phone number input is validated against valid number ranges; number strings that do not match a real-world phone numbering scheme may cause the request to fail, even in the Sandbox test environment.
   * @return phoneNumbers
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The user's phone numbers, in E.164 format: +{countrycode}{number}. For example: \"+14157452130\". Phone numbers provided in other formats will be parsed on a best-effort basis. Phone number input is validated against valid number ranges; number strings that do not match a real-world phone numbering scheme may cause the request to fail, even in the Sandbox test environment.")

  public List<ClientUserIdentityPhoneNumber> getPhoneNumbers() {
    return phoneNumbers;
  }


  public void setPhoneNumbers(List<ClientUserIdentityPhoneNumber> phoneNumbers) {
    this.phoneNumbers = phoneNumbers;
  }


  public ClientUserIdentity addresses(List<ClientUserIdentityAddress> addresses) {
    
    this.addresses = addresses;
    return this;
  }

  public ClientUserIdentity addAddressesItem(ClientUserIdentityAddress addressesItem) {
    if (this.addresses == null) {
      this.addresses = new ArrayList<>();
    }
    this.addresses.add(addressesItem);
    return this;
  }

   /**
   * The user&#39;s addresses.
   * @return addresses
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The user's addresses.")

  public List<ClientUserIdentityAddress> getAddresses() {
    return addresses;
  }


  public void setAddresses(List<ClientUserIdentityAddress> addresses) {
    this.addresses = addresses;
  }


  public ClientUserIdentity idNumbers(List<UserIDNumber> idNumbers) {
    
    this.idNumbers = idNumbers;
    return this;
  }

  public ClientUserIdentity addIdNumbersItem(UserIDNumber idNumbersItem) {
    if (this.idNumbers == null) {
      this.idNumbers = new ArrayList<>();
    }
    this.idNumbers.add(idNumbersItem);
    return this;
  }

   /**
   * The user&#39;s ID numbers.
   * @return idNumbers
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The user's ID numbers.")

  public List<UserIDNumber> getIdNumbers() {
    return idNumbers;
  }


  public void setIdNumbers(List<UserIDNumber> idNumbers) {
    this.idNumbers = idNumbers;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ClientUserIdentity clientUserIdentity = (ClientUserIdentity) o;
    return Objects.equals(this.name, clientUserIdentity.name) &&
        Objects.equals(this.dateOfBirth, clientUserIdentity.dateOfBirth) &&
        Objects.equals(this.emails, clientUserIdentity.emails) &&
        Objects.equals(this.phoneNumbers, clientUserIdentity.phoneNumbers) &&
        Objects.equals(this.addresses, clientUserIdentity.addresses) &&
        Objects.equals(this.idNumbers, clientUserIdentity.idNumbers);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, dateOfBirth, emails, phoneNumbers, addresses, idNumbers);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ClientUserIdentity {\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n");
    sb.append("    emails: ").append(toIndentedString(emails)).append("\n");
    sb.append("    phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n");
    sb.append("    addresses: ").append(toIndentedString(addresses)).append("\n");
    sb.append("    idNumbers: ").append(toIndentedString(idNumbers)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

