content: /*
   * Account API
   * This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead.  The Account API provides endpoints for managing account-related entities on your platform. These related entities include account holders, accounts, bank accounts, shareholders, and verification-related documents. The management operations include actions such as creation, retrieval, updating, and deletion of them.  For more information, refer to our [documentation](https://docs.adyen.com/marketplaces-and-platforms/classic). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example:   ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ```  Alternatively, you can use the username and password to connect to the API using basic authentication. For example:  ``` curl -U \"ws@MarketPlace.YOUR_PLATFORM_ACCOUNT\":\"YOUR_WS_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` When going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints).  ## Versioning The Account API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number.  For example: ``` https://cal-test.adyen.com/cal/services/Account/v6/createAccountHolder ```
   *
   * The version of the OpenAPI document: 6
   *
   *
   * 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.marketpayaccount;
  
  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 io.swagger.annotations.ApiModelProperty;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Objects;
  
  /** LegalArrangementDetail */
  @JsonPropertyOrder({
    LegalArrangementDetail.JSON_PROPERTY_ADDRESS,
    LegalArrangementDetail.JSON_PROPERTY_LEGAL_ARRANGEMENT_CODE,
    LegalArrangementDetail.JSON_PROPERTY_LEGAL_ARRANGEMENT_ENTITIES,
    LegalArrangementDetail.JSON_PROPERTY_LEGAL_ARRANGEMENT_REFERENCE,
    LegalArrangementDetail.JSON_PROPERTY_LEGAL_FORM,
    LegalArrangementDetail.JSON_PROPERTY_NAME,
    LegalArrangementDetail.JSON_PROPERTY_REGISTRATION_NUMBER,
    LegalArrangementDetail.JSON_PROPERTY_TAX_NUMBER,
    LegalArrangementDetail.JSON_PROPERTY_TYPE
  })
  public class LegalArrangementDetail {
    public static final String JSON_PROPERTY_ADDRESS = "address";
    private ViasAddress address;
  
    public static final String JSON_PROPERTY_LEGAL_ARRANGEMENT_CODE = "legalArrangementCode";
    private String legalArrangementCode;
  
    public static final String JSON_PROPERTY_LEGAL_ARRANGEMENT_ENTITIES = "legalArrangementEntities";
    private List<LegalArrangementEntityDetail> legalArrangementEntities = null;
  
    public static final String JSON_PROPERTY_LEGAL_ARRANGEMENT_REFERENCE =
        "legalArrangementReference";
    private String legalArrangementReference;
  
    /**
     * The form of legal arrangement. Required if &#x60;type&#x60; is **Trust** or **Partnership**.
     * The possible values depend on the &#x60;type&#x60;. - For &#x60;type&#x60; **Trust**:
     * **CashManagementTrust**, **CorporateUnitTrust**, **DeceasedEstate**,
     * **DiscretionaryInvestmentTrust**, **DiscretionaryServicesManagementTrust**,
     * **DiscretionaryTradingTrust**, **FirstHomeSaverAccountsTrust**, **FixedTrust**,
     * **FixedUnitTrust**, **HybridTrust**, **ListedPublicUnitTrust**, **OtherTrust**,
     * **PooledSuperannuationTrust**, **PublicTradingTrust**, or **UnlistedPublicUnitTrust**. - For
     * &#x60;type&#x60; **Partnership**: **LimitedPartnership**, **FamilyPartnership**, or
     * **OtherPartnership**
     */
    public enum LegalFormEnum {
      CASHMANAGEMENTTRUST("CashManagementTrust"),
  
      CORPORATEUNITTRUST("CorporateUnitTrust"),
  
      DECEASEDESTATE("DeceasedEstate"),
  
      DISCRETIONARYINVESTMENTTRUST("DiscretionaryInvestmentTrust"),
  
      DISCRETIONARYSERVICESMANAGEMENTTRUST("DiscretionaryServicesManagementTrust"),
  
      DISCRETIONARYTRADINGTRUST("DiscretionaryTradingTrust"),
  
      FIRSTHOMESAVERACCOUNTSTRUST("FirstHomeSaverAccountsTrust"),
  
      FIXEDTRUST("FixedTrust"),
  
      FIXEDUNITTRUST("FixedUnitTrust"),
  
      HYBRIDTRUST("HybridTrust"),
  
      LISTEDPUBLICUNITTRUST("ListedPublicUnitTrust"),
  
      OTHERTRUST("OtherTrust"),
  
      POOLEDSUPERANNUATIONTRUST("PooledSuperannuationTrust"),
  
      PUBLICTRADINGTRUST("PublicTradingTrust"),
  
      UNLISTEDPUBLICUNITTRUST("UnlistedPublicUnitTrust"),
  
      LIMITEDPARTNERSHIP("LimitedPartnership"),
  
      FAMILYPARTNERSHIP("FamilyPartnership"),
  
      OTHERPARTNERSHIP("OtherPartnership");
  
      private String value;
  
      LegalFormEnum(String value) {
        this.value = value;
      }
  
      @JsonValue
      public String getValue() {
        return value;
      }
  
      @Override
      public String toString() {
        return String.valueOf(value);
      }
  
      @JsonCreator
      public static LegalFormEnum fromValue(String value) {
        for (LegalFormEnum b : LegalFormEnum.values()) {
          if (b.value.equals(value)) {
            return b;
          }
        }
        throw new IllegalArgumentException("Unexpected value '" + value + "'");
      }
    }
  
    public static final String JSON_PROPERTY_LEGAL_FORM = "legalForm";
    private LegalFormEnum legalForm;
  
    public static final String JSON_PROPERTY_NAME = "name";
    private String name;
  
    public static final String JSON_PROPERTY_REGISTRATION_NUMBER = "registrationNumber";
    private String registrationNumber;
  
    public static final String JSON_PROPERTY_TAX_NUMBER = "taxNumber";
    private String taxNumber;
  
    /**
     * The [type of legal
     * arrangement](https://docs.adyen.com/marketplaces-and-platforms/classic/verification-process/legal-arrangements#types-of-legal-arrangements).
     * Possible values: - **Association** - **Partnership** - **SoleProprietorship** - **Trust**
     */
    public enum TypeEnum {
      ASSOCIATION("Association"),
  
      PARTNERSHIP("Partnership"),
  
      SOLEPROPRIETORSHIP("SoleProprietorship"),
  
      TRUST("Trust");
  
      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;
          }
        }
        throw new IllegalArgumentException("Unexpected value '" + value + "'");
      }
    }
  
    public static final String JSON_PROPERTY_TYPE = "type";
    private TypeEnum type;
  
    public LegalArrangementDetail() {}
  
    public LegalArrangementDetail address(ViasAddress address) {
      this.address = address;
      return this;
    }
  
    /**
     * Get address
     *
     * @return address
     */
    @ApiModelProperty(required = true, value = "")
    @JsonProperty(JSON_PROPERTY_ADDRESS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public ViasAddress getAddress() {
      return address;
    }
  
    @JsonProperty(JSON_PROPERTY_ADDRESS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAddress(ViasAddress address) {
      this.address = address;
    }
  
    public LegalArrangementDetail legalArrangementCode(String legalArrangementCode) {
      this.legalArrangementCode = legalArrangementCode;
      return this;
    }
  
    /**
     * Adyen-generated unique alphanumeric identifier (UUID) for the entry, returned in the response
     * when you create a legal arrangement. Use only when updating an account holder. If you include
     * this field when creating an account holder, the request will fail.
     *
     * @return legalArrangementCode
     */
    @ApiModelProperty(
        value =
            "Adyen-generated unique alphanumeric identifier (UUID) for the entry, returned in the response when you create a legal arrangement. Use only when updating an account holder. If you include this field when creating an account holder, the request will fail.")
    @JsonProperty(JSON_PROPERTY_LEGAL_ARRANGEMENT_CODE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getLegalArrangementCode() {
      return legalArrangementCode;
    }
  
    @JsonProperty(JSON_PROPERTY_LEGAL_ARRANGEMENT_CODE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLegalArrangementCode(String legalArrangementCode) {
      this.legalArrangementCode = legalArrangementCode;
    }
  
    public LegalArrangementDetail legalArrangementEntities(
        List<LegalArrangementEntityDetail> legalArrangementEntities) {
      this.legalArrangementEntities = legalArrangementEntities;
      return this;
    }
  
    public LegalArrangementDetail addLegalArrangementEntitiesItem(
        LegalArrangementEntityDetail legalArrangementEntitiesItem) {
      if (this.legalArrangementEntities == null) {
        this.legalArrangementEntities = new ArrayList<>();
      }
      this.legalArrangementEntities.add(legalArrangementEntitiesItem);
      return this;
    }
  
    /**
     * An array containing information about other entities that are part of the legal arrangement.
     *
     * @return legalArrangementEntities
     */
    @ApiModelProperty(
        value =
            "An array containing information about other entities that are part of the legal arrangement.")
    @JsonProperty(JSON_PROPERTY_LEGAL_ARRANGEMENT_ENTITIES)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<LegalArrangementEntityDetail> getLegalArrangementEntities() {
      return legalArrangementEntities;
    }
  
    @JsonProperty(JSON_PROPERTY_LEGAL_ARRANGEMENT_ENTITIES)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLegalArrangementEntities(
        List<LegalArrangementEntityDetail> legalArrangementEntities) {
      this.legalArrangementEntities = legalArrangementEntities;
    }
  
    public LegalArrangementDetail legalArrangementReference(String legalArrangementReference) {
      this.legalArrangementReference = legalArrangementReference;
      return this;
    }
  
    /**
     * Your reference for the legal arrangement. Must be between 3 to 128 characters.
     *
     * @return legalArrangementReference
     */
    @ApiModelProperty(
        value = "Your reference for the legal arrangement. Must be between 3 to 128 characters.")
    @JsonProperty(JSON_PROPERTY_LEGAL_ARRANGEMENT_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getLegalArrangementReference() {
      return legalArrangementReference;
    }
  
    @JsonProperty(JSON_PROPERTY_LEGAL_ARRANGEMENT_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLegalArrangementReference(String legalArrangementReference) {
      this.legalArrangementReference = legalArrangementReference;
    }
  
    public LegalArrangementDetail legalForm(LegalFormEnum legalForm) {
      this.legalForm = legalForm;
      return this;
    }
  
    /**
     * The form of legal arrangement. Required if &#x60;type&#x60; is **Trust** or **Partnership**.
     * The possible values depend on the &#x60;type&#x60;. - For &#x60;type&#x60; **Trust**:
     * **CashManagementTrust**, **CorporateUnitTrust**, **DeceasedEstate**,
     * **DiscretionaryInvestmentTrust**, **DiscretionaryServicesManagementTrust**,
     * **DiscretionaryTradingTrust**, **FirstHomeSaverAccountsTrust**, **FixedTrust**,
     * **FixedUnitTrust**, **HybridTrust**, **ListedPublicUnitTrust**, **OtherTrust**,
     * **PooledSuperannuationTrust**, **PublicTradingTrust**, or **UnlistedPublicUnitTrust**. - For
     * &#x60;type&#x60; **Partnership**: **LimitedPartnership**, **FamilyPartnership**, or
     * **OtherPartnership**
     *
     * @return legalForm
     */
    @ApiModelProperty(
        value =
            "The form of legal arrangement. Required if `type` is **Trust** or **Partnership**.  The possible values depend on the `type`.  - For `type` **Trust**:  **CashManagementTrust**, **CorporateUnitTrust**, **DeceasedEstate**, **DiscretionaryInvestmentTrust**, **DiscretionaryServicesManagementTrust**, **DiscretionaryTradingTrust**, **FirstHomeSaverAccountsTrust**, **FixedTrust**, **FixedUnitTrust**, **HybridTrust**, **ListedPublicUnitTrust**, **OtherTrust**, **PooledSuperannuationTrust**, **PublicTradingTrust**, or **UnlistedPublicUnitTrust**.  - For `type` **Partnership**: **LimitedPartnership**, **FamilyPartnership**, or **OtherPartnership**")
    @JsonProperty(JSON_PROPERTY_LEGAL_FORM)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public LegalFormEnum getLegalForm() {
      return legalForm;
    }
  
    @JsonProperty(JSON_PROPERTY_LEGAL_FORM)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLegalForm(LegalFormEnum legalForm) {
      this.legalForm = legalForm;
    }
  
    public LegalArrangementDetail name(String name) {
      this.name = name;
      return this;
    }
  
    /**
     * The legal name of the legal arrangement. Minimum length: 3 characters.
     *
     * @return name
     */
    @ApiModelProperty(
        required = true,
        value = "The legal name of the legal arrangement. Minimum length: 3 characters.")
    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getName() {
      return name;
    }
  
    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setName(String name) {
      this.name = name;
    }
  
    public LegalArrangementDetail registrationNumber(String registrationNumber) {
      this.registrationNumber = registrationNumber;
      return this;
    }
  
    /**
     * The registration number of the legal arrangement.
     *
     * @return registrationNumber
     */
    @ApiModelProperty(value = "The registration number of the legal arrangement.")
    @JsonProperty(JSON_PROPERTY_REGISTRATION_NUMBER)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getRegistrationNumber() {
      return registrationNumber;
    }
  
    @JsonProperty(JSON_PROPERTY_REGISTRATION_NUMBER)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setRegistrationNumber(String registrationNumber) {
      this.registrationNumber = registrationNumber;
    }
  
    public LegalArrangementDetail taxNumber(String taxNumber) {
      this.taxNumber = taxNumber;
      return this;
    }
  
    /**
     * The tax identification number of the legal arrangement.
     *
     * @return taxNumber
     */
    @ApiModelProperty(value = "The tax identification number of the legal arrangement.")
    @JsonProperty(JSON_PROPERTY_TAX_NUMBER)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getTaxNumber() {
      return taxNumber;
    }
  
    @JsonProperty(JSON_PROPERTY_TAX_NUMBER)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTaxNumber(String taxNumber) {
      this.taxNumber = taxNumber;
    }
  
    public LegalArrangementDetail type(TypeEnum type) {
      this.type = type;
      return this;
    }
  
    /**
     * The [type of legal
     * arrangement](https://docs.adyen.com/marketplaces-and-platforms/classic/verification-process/legal-arrangements#types-of-legal-arrangements).
     * Possible values: - **Association** - **Partnership** - **SoleProprietorship** - **Trust**
     *
     * @return type
     */
    @ApiModelProperty(
        required = true,
        value =
            "The [type of legal arrangement](https://docs.adyen.com/marketplaces-and-platforms/classic/verification-process/legal-arrangements#types-of-legal-arrangements).  Possible values:  - **Association**   - **Partnership**   - **SoleProprietorship**   - **Trust**   ")
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TypeEnum getType() {
      return type;
    }
  
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setType(TypeEnum type) {
      this.type = type;
    }
  
    /** Return true if this LegalArrangementDetail object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      LegalArrangementDetail legalArrangementDetail = (LegalArrangementDetail) o;
      return Objects.equals(this.address, legalArrangementDetail.address)
          && Objects.equals(this.legalArrangementCode, legalArrangementDetail.legalArrangementCode)
          && Objects.equals(
              this.legalArrangementEntities, legalArrangementDetail.legalArrangementEntities)
          && Objects.equals(
              this.legalArrangementReference, legalArrangementDetail.legalArrangementReference)
          && Objects.equals(this.legalForm, legalArrangementDetail.legalForm)
          && Objects.equals(this.name, legalArrangementDetail.name)
          && Objects.equals(this.registrationNumber, legalArrangementDetail.registrationNumber)
          && Objects.equals(this.taxNumber, legalArrangementDetail.taxNumber)
          && Objects.equals(this.type, legalArrangementDetail.type);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(
          address,
          legalArrangementCode,
          legalArrangementEntities,
          legalArrangementReference,
          legalForm,
          name,
          registrationNumber,
          taxNumber,
          type);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class LegalArrangementDetail {\n");
      sb.append("    address: ").append(toIndentedString(address)).append("\n");
      sb.append("    legalArrangementCode: ")
          .append(toIndentedString(legalArrangementCode))
          .append("\n");
      sb.append("    legalArrangementEntities: ")
          .append(toIndentedString(legalArrangementEntities))
          .append("\n");
      sb.append("    legalArrangementReference: ")
          .append(toIndentedString(legalArrangementReference))
          .append("\n");
      sb.append("    legalForm: ").append(toIndentedString(legalForm)).append("\n");
      sb.append("    name: ").append(toIndentedString(name)).append("\n");
      sb.append("    registrationNumber: ").append(toIndentedString(registrationNumber)).append("\n");
      sb.append("    taxNumber: ").append(toIndentedString(taxNumber)).append("\n");
      sb.append("    type: ").append(toIndentedString(type)).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 LegalArrangementDetail given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of LegalArrangementDetail
     * @throws JsonProcessingException if the JSON string is invalid with respect to
     *     LegalArrangementDetail
     */
    public static LegalArrangementDetail fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, LegalArrangementDetail.class);
    }
  
    /**
     * Convert an instance of LegalArrangementDetail to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  