content: /*
   * Transfers API
   *
   * The version of the OpenAPI document: 4
   *
   *
   * 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.adyen.model.transfers;
  
  import com.fasterxml.jackson.annotation.JsonCreator;
  import com.fasterxml.jackson.annotation.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.annotation.JsonValue;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import java.time.LocalDate;
  import java.util.*;
  import java.util.Arrays;
  import java.util.logging.Logger;
  
  /** UltimatePartyIdentification */
  @JsonPropertyOrder({
    UltimatePartyIdentification.JSON_PROPERTY_ADDRESS,
    UltimatePartyIdentification.JSON_PROPERTY_DATE_OF_BIRTH,
    UltimatePartyIdentification.JSON_PROPERTY_EMAIL,
    UltimatePartyIdentification.JSON_PROPERTY_FIRST_NAME,
    UltimatePartyIdentification.JSON_PROPERTY_FULL_NAME,
    UltimatePartyIdentification.JSON_PROPERTY_LAST_NAME,
    UltimatePartyIdentification.JSON_PROPERTY_REFERENCE,
    UltimatePartyIdentification.JSON_PROPERTY_TYPE,
    UltimatePartyIdentification.JSON_PROPERTY_URL
  })
  public class UltimatePartyIdentification {
    public static final String JSON_PROPERTY_ADDRESS = "address";
    private Address address;
  
    public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth";
    private LocalDate dateOfBirth;
  
    public static final String JSON_PROPERTY_EMAIL = "email";
    private String email;
  
    public static final String JSON_PROPERTY_FIRST_NAME = "firstName";
    private String firstName;
  
    public static final String JSON_PROPERTY_FULL_NAME = "fullName";
    private String fullName;
  
    public static final String JSON_PROPERTY_LAST_NAME = "lastName";
    private String lastName;
  
    public static final String JSON_PROPERTY_REFERENCE = "reference";
    private String reference;
  
    /**
     * The type of entity that owns the bank account or card. Possible values: **individual**,
     * **organization**, or **unknown**. Required when &#x60;category&#x60; is **card**. In this case,
     * the value must be **individual**.
     */
    public enum TypeEnum {
      INDIVIDUAL(String.valueOf("individual")),
  
      ORGANIZATION(String.valueOf("organization")),
  
      UNKNOWN(String.valueOf("unknown"));
  
      private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName());
  
      private String value;
  
      TypeEnum(String value) {
        this.value = value;
      }
  
      @JsonValue
      public String getValue() {
        return value;
      }
  
      @Override
      public String toString() {
        return String.valueOf(value);
      }
  
      @JsonCreator
      public static TypeEnum fromValue(String value) {
        for (TypeEnum b : TypeEnum.values()) {
          if (b.value.equals(value)) {
            return b;
          }
        }
        // handling unexpected value
        LOG.warning(
            "TypeEnum: unexpected enum value '"
                + value
                + "' - Supported values are "
                + Arrays.toString(TypeEnum.values()));
        return null;
      }
    }
  
    public static final String JSON_PROPERTY_TYPE = "type";
    private TypeEnum type;
  
    public static final String JSON_PROPERTY_URL = "url";
    private String url;
  
    public UltimatePartyIdentification() {}
  
    /**
     * address
     *
     * @param address
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification address(Address address) {
      this.address = address;
      return this;
    }
  
    /**
     * Get address
     *
     * @return address
     */
    @JsonProperty(JSON_PROPERTY_ADDRESS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Address getAddress() {
      return address;
    }
  
    /**
     * address
     *
     * @param address
     */
    @JsonProperty(JSON_PROPERTY_ADDRESS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAddress(Address address) {
      this.address = address;
    }
  
    /**
     * The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format.
     * For example, **YYYY-MM-DD**. Allowed only when &#x60;type&#x60; is **individual**.
     *
     * @param dateOfBirth The date of birth of the individual in
     *     [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**.
     *     Allowed only when &#x60;type&#x60; is **individual**.
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification dateOfBirth(LocalDate dateOfBirth) {
      this.dateOfBirth = dateOfBirth;
      return this;
    }
  
    /**
     * The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format.
     * For example, **YYYY-MM-DD**. Allowed only when &#x60;type&#x60; is **individual**.
     *
     * @return dateOfBirth The date of birth of the individual in
     *     [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**.
     *     Allowed only when &#x60;type&#x60; is **individual**.
     */
    @JsonProperty(JSON_PROPERTY_DATE_OF_BIRTH)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public LocalDate getDateOfBirth() {
      return dateOfBirth;
    }
  
    /**
     * The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format.
     * For example, **YYYY-MM-DD**. Allowed only when &#x60;type&#x60; is **individual**.
     *
     * @param dateOfBirth The date of birth of the individual in
     *     [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**.
     *     Allowed only when &#x60;type&#x60; is **individual**.
     */
    @JsonProperty(JSON_PROPERTY_DATE_OF_BIRTH)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDateOfBirth(LocalDate dateOfBirth) {
      this.dateOfBirth = dateOfBirth;
    }
  
    /**
     * The email address of the organization or individual. Maximum length: 254 characters.
     *
     * @param email The email address of the organization or individual. Maximum length: 254
     *     characters.
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification email(String email) {
      this.email = email;
      return this;
    }
  
    /**
     * The email address of the organization or individual. Maximum length: 254 characters.
     *
     * @return email The email address of the organization or individual. Maximum length: 254
     *     characters.
     */
    @JsonProperty(JSON_PROPERTY_EMAIL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getEmail() {
      return email;
    }
  
    /**
     * The email address of the organization or individual. Maximum length: 254 characters.
     *
     * @param email The email address of the organization or individual. Maximum length: 254
     *     characters.
     */
    @JsonProperty(JSON_PROPERTY_EMAIL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setEmail(String email) {
      this.email = email;
    }
  
    /**
     * The first name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This
     * parameter is: - Allowed only when &#x60;type&#x60; is **individual**. - Required when
     * &#x60;category&#x60; is **card**.
     *
     * @param firstName The first name of the individual. Supported characters: [a-z] [A-Z] - . / —
     *     and space. This parameter is: - Allowed only when &#x60;type&#x60; is **individual**. -
     *     Required when &#x60;category&#x60; is **card**.
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification firstName(String firstName) {
      this.firstName = firstName;
      return this;
    }
  
    /**
     * The first name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This
     * parameter is: - Allowed only when &#x60;type&#x60; is **individual**. - Required when
     * &#x60;category&#x60; is **card**.
     *
     * @return firstName The first name of the individual. Supported characters: [a-z] [A-Z] - . / —
     *     and space. This parameter is: - Allowed only when &#x60;type&#x60; is **individual**. -
     *     Required when &#x60;category&#x60; is **card**.
     */
    @JsonProperty(JSON_PROPERTY_FIRST_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getFirstName() {
      return firstName;
    }
  
    /**
     * The first name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This
     * parameter is: - Allowed only when &#x60;type&#x60; is **individual**. - Required when
     * &#x60;category&#x60; is **card**.
     *
     * @param firstName The first name of the individual. Supported characters: [a-z] [A-Z] - . / —
     *     and space. This parameter is: - Allowed only when &#x60;type&#x60; is **individual**. -
     *     Required when &#x60;category&#x60; is **card**.
     */
    @JsonProperty(JSON_PROPERTY_FIRST_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setFirstName(String firstName) {
      this.firstName = firstName;
    }
  
    /**
     * The full name of the entity that owns the bank account or card. Supported characters: [a-z]
     * [A-Z] [0-9] , . ; : - — / \\ + &amp; ! ? @ ( ) \&quot; &#39; and space. Required when
     * &#x60;category&#x60; is **bank**.
     *
     * @param fullName The full name of the entity that owns the bank account or card. Supported
     *     characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + &amp; ! ? @ ( ) \&quot; &#39; and space.
     *     Required when &#x60;category&#x60; is **bank**.
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification fullName(String fullName) {
      this.fullName = fullName;
      return this;
    }
  
    /**
     * The full name of the entity that owns the bank account or card. Supported characters: [a-z]
     * [A-Z] [0-9] , . ; : - — / \\ + &amp; ! ? @ ( ) \&quot; &#39; and space. Required when
     * &#x60;category&#x60; is **bank**.
     *
     * @return fullName The full name of the entity that owns the bank account or card. Supported
     *     characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + &amp; ! ? @ ( ) \&quot; &#39; and space.
     *     Required when &#x60;category&#x60; is **bank**.
     */
    @JsonProperty(JSON_PROPERTY_FULL_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getFullName() {
      return fullName;
    }
  
    /**
     * The full name of the entity that owns the bank account or card. Supported characters: [a-z]
     * [A-Z] [0-9] , . ; : - — / \\ + &amp; ! ? @ ( ) \&quot; &#39; and space. Required when
     * &#x60;category&#x60; is **bank**.
     *
     * @param fullName The full name of the entity that owns the bank account or card. Supported
     *     characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + &amp; ! ? @ ( ) \&quot; &#39; and space.
     *     Required when &#x60;category&#x60; is **bank**.
     */
    @JsonProperty(JSON_PROPERTY_FULL_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setFullName(String fullName) {
      this.fullName = fullName;
    }
  
    /**
     * The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This
     * parameter is: - Allowed only when &#x60;type&#x60; is **individual**. - Required when
     * &#x60;category&#x60; is **card**.
     *
     * @param lastName The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and
     *     space. This parameter is: - Allowed only when &#x60;type&#x60; is **individual**. -
     *     Required when &#x60;category&#x60; is **card**.
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification lastName(String lastName) {
      this.lastName = lastName;
      return this;
    }
  
    /**
     * The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This
     * parameter is: - Allowed only when &#x60;type&#x60; is **individual**. - Required when
     * &#x60;category&#x60; is **card**.
     *
     * @return lastName The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and
     *     space. This parameter is: - Allowed only when &#x60;type&#x60; is **individual**. -
     *     Required when &#x60;category&#x60; is **card**.
     */
    @JsonProperty(JSON_PROPERTY_LAST_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getLastName() {
      return lastName;
    }
  
    /**
     * The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This
     * parameter is: - Allowed only when &#x60;type&#x60; is **individual**. - Required when
     * &#x60;category&#x60; is **card**.
     *
     * @param lastName The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and
     *     space. This parameter is: - Allowed only when &#x60;type&#x60; is **individual**. -
     *     Required when &#x60;category&#x60; is **card**.
     */
    @JsonProperty(JSON_PROPERTY_LAST_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLastName(String lastName) {
      this.lastName = lastName;
    }
  
    /**
     * A unique reference to identify the party or counterparty involved in the transfer. For example,
     * your client&#39;s unique wallet or payee ID. Required when you include
     * &#x60;cardIdentification.storedPaymentMethodId&#x60;.
     *
     * @param reference A unique reference to identify the party or counterparty involved in the
     *     transfer. For example, your client&#39;s unique wallet or payee ID. Required when you
     *     include &#x60;cardIdentification.storedPaymentMethodId&#x60;.
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification reference(String reference) {
      this.reference = reference;
      return this;
    }
  
    /**
     * A unique reference to identify the party or counterparty involved in the transfer. For example,
     * your client&#39;s unique wallet or payee ID. Required when you include
     * &#x60;cardIdentification.storedPaymentMethodId&#x60;.
     *
     * @return reference A unique reference to identify the party or counterparty involved in the
     *     transfer. For example, your client&#39;s unique wallet or payee ID. Required when you
     *     include &#x60;cardIdentification.storedPaymentMethodId&#x60;.
     */
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getReference() {
      return reference;
    }
  
    /**
     * A unique reference to identify the party or counterparty involved in the transfer. For example,
     * your client&#39;s unique wallet or payee ID. Required when you include
     * &#x60;cardIdentification.storedPaymentMethodId&#x60;.
     *
     * @param reference A unique reference to identify the party or counterparty involved in the
     *     transfer. For example, your client&#39;s unique wallet or payee ID. Required when you
     *     include &#x60;cardIdentification.storedPaymentMethodId&#x60;.
     */
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setReference(String reference) {
      this.reference = reference;
    }
  
    /**
     * The type of entity that owns the bank account or card. Possible values: **individual**,
     * **organization**, or **unknown**. Required when &#x60;category&#x60; is **card**. In this case,
     * the value must be **individual**.
     *
     * @param type The type of entity that owns the bank account or card. Possible values:
     *     **individual**, **organization**, or **unknown**. Required when &#x60;category&#x60; is
     *     **card**. In this case, the value must be **individual**.
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification type(TypeEnum type) {
      this.type = type;
      return this;
    }
  
    /**
     * The type of entity that owns the bank account or card. Possible values: **individual**,
     * **organization**, or **unknown**. Required when &#x60;category&#x60; is **card**. In this case,
     * the value must be **individual**.
     *
     * @return type The type of entity that owns the bank account or card. Possible values:
     *     **individual**, **organization**, or **unknown**. Required when &#x60;category&#x60; is
     *     **card**. In this case, the value must be **individual**.
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TypeEnum getType() {
      return type;
    }
  
    /**
     * The type of entity that owns the bank account or card. Possible values: **individual**,
     * **organization**, or **unknown**. Required when &#x60;category&#x60; is **card**. In this case,
     * the value must be **individual**.
     *
     * @param type The type of entity that owns the bank account or card. Possible values:
     *     **individual**, **organization**, or **unknown**. Required when &#x60;category&#x60; is
     *     **card**. In this case, the value must be **individual**.
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setType(TypeEnum type) {
      this.type = type;
    }
  
    /**
     * The URL of the organization or individual. Maximum length: 255 characters.
     *
     * @param url The URL of the organization or individual. Maximum length: 255 characters.
     * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining
     */
    public UltimatePartyIdentification url(String url) {
      this.url = url;
      return this;
    }
  
    /**
     * The URL of the organization or individual. Maximum length: 255 characters.
     *
     * @return url The URL of the organization or individual. Maximum length: 255 characters.
     */
    @JsonProperty(JSON_PROPERTY_URL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getUrl() {
      return url;
    }
  
    /**
     * The URL of the organization or individual. Maximum length: 255 characters.
     *
     * @param url The URL of the organization or individual. Maximum length: 255 characters.
     */
    @JsonProperty(JSON_PROPERTY_URL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setUrl(String url) {
      this.url = url;
    }
  
    /** Return true if this UltimatePartyIdentification object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      UltimatePartyIdentification ultimatePartyIdentification = (UltimatePartyIdentification) o;
      return Objects.equals(this.address, ultimatePartyIdentification.address)
          && Objects.equals(this.dateOfBirth, ultimatePartyIdentification.dateOfBirth)
          && Objects.equals(this.email, ultimatePartyIdentification.email)
          && Objects.equals(this.firstName, ultimatePartyIdentification.firstName)
          && Objects.equals(this.fullName, ultimatePartyIdentification.fullName)
          && Objects.equals(this.lastName, ultimatePartyIdentification.lastName)
          && Objects.equals(this.reference, ultimatePartyIdentification.reference)
          && Objects.equals(this.type, ultimatePartyIdentification.type)
          && Objects.equals(this.url, ultimatePartyIdentification.url);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(
          address, dateOfBirth, email, firstName, fullName, lastName, reference, type, url);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class UltimatePartyIdentification {\n");
      sb.append("    address: ").append(toIndentedString(address)).append("\n");
      sb.append("    dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n");
      sb.append("    email: ").append(toIndentedString(email)).append("\n");
      sb.append("    firstName: ").append(toIndentedString(firstName)).append("\n");
      sb.append("    fullName: ").append(toIndentedString(fullName)).append("\n");
      sb.append("    lastName: ").append(toIndentedString(lastName)).append("\n");
      sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
      sb.append("    type: ").append(toIndentedString(type)).append("\n");
      sb.append("    url: ").append(toIndentedString(url)).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    ");
    }
  
    /**
     * Create an instance of UltimatePartyIdentification given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of UltimatePartyIdentification
     * @throws JsonProcessingException if the JSON string is invalid with respect to
     *     UltimatePartyIdentification
     */
    public static UltimatePartyIdentification fromJson(String jsonString)
        throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, UltimatePartyIdentification.class);
    }
  
    /**
     * Convert an instance of UltimatePartyIdentification to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  