content: /*
   * Legal Entity Management 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.legalentitymanagement;
  
  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.util.*;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.logging.Logger;
  
  /** LegalEntityInfo */
  @JsonPropertyOrder({
    LegalEntityInfo.JSON_PROPERTY_CAPABILITIES,
    LegalEntityInfo.JSON_PROPERTY_ENTITY_ASSOCIATIONS,
    LegalEntityInfo.JSON_PROPERTY_INDIVIDUAL,
    LegalEntityInfo.JSON_PROPERTY_ORGANIZATION,
    LegalEntityInfo.JSON_PROPERTY_REFERENCE,
    LegalEntityInfo.JSON_PROPERTY_SOLE_PROPRIETORSHIP,
    LegalEntityInfo.JSON_PROPERTY_TRUST,
    LegalEntityInfo.JSON_PROPERTY_TYPE,
    LegalEntityInfo.JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP,
    LegalEntityInfo.JSON_PROPERTY_VERIFICATION_PLAN
  })
  public class LegalEntityInfo {
    public static final String JSON_PROPERTY_CAPABILITIES = "capabilities";
    private Map<String, LegalEntityCapability> capabilities;
  
    public static final String JSON_PROPERTY_ENTITY_ASSOCIATIONS = "entityAssociations";
    private List<LegalEntityAssociation> entityAssociations;
  
    public static final String JSON_PROPERTY_INDIVIDUAL = "individual";
    private Individual individual;
  
    public static final String JSON_PROPERTY_ORGANIZATION = "organization";
    private Organization organization;
  
    public static final String JSON_PROPERTY_REFERENCE = "reference";
    private String reference;
  
    public static final String JSON_PROPERTY_SOLE_PROPRIETORSHIP = "soleProprietorship";
    private SoleProprietorship soleProprietorship;
  
    public static final String JSON_PROPERTY_TRUST = "trust";
    private Trust trust;
  
    /**
     * The type of legal entity. Possible values: **individual**, **organization**,
     * **soleProprietorship**, or **trust**.
     */
    public enum TypeEnum {
      INDIVIDUAL(String.valueOf("individual")),
  
      ORGANIZATION(String.valueOf("organization")),
  
      SOLEPROPRIETORSHIP(String.valueOf("soleProprietorship")),
  
      TRUST(String.valueOf("trust")),
  
      UNINCORPORATEDPARTNERSHIP(String.valueOf("unincorporatedPartnership"));
  
      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_UNINCORPORATED_PARTNERSHIP = "unincorporatedPartnership";
    private UnincorporatedPartnership unincorporatedPartnership;
  
    public static final String JSON_PROPERTY_VERIFICATION_PLAN = "verificationPlan";
    private String verificationPlan;
  
    public LegalEntityInfo() {}
  
    /**
     * Contains key-value pairs that specify the actions that the legal entity can do in your
     * platform.The key is a capability required for your integration. For example, **issueCard** for
     * Issuing. The value is an object containing the settings for the capability.
     *
     * @param capabilities Contains key-value pairs that specify the actions that the legal entity can
     *     do in your platform.The key is a capability required for your integration. For example,
     *     **issueCard** for Issuing. The value is an object containing the settings for the
     *     capability.
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo capabilities(Map<String, LegalEntityCapability> capabilities) {
      this.capabilities = capabilities;
      return this;
    }
  
    public LegalEntityInfo putCapabilitiesItem(String key, LegalEntityCapability capabilitiesItem) {
      if (this.capabilities == null) {
        this.capabilities = new HashMap<>();
      }
      this.capabilities.put(key, capabilitiesItem);
      return this;
    }
  
    /**
     * Contains key-value pairs that specify the actions that the legal entity can do in your
     * platform.The key is a capability required for your integration. For example, **issueCard** for
     * Issuing. The value is an object containing the settings for the capability.
     *
     * @return capabilities Contains key-value pairs that specify the actions that the legal entity
     *     can do in your platform.The key is a capability required for your integration. For example,
     *     **issueCard** for Issuing. The value is an object containing the settings for the
     *     capability.
     */
    @JsonProperty(JSON_PROPERTY_CAPABILITIES)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Map<String, LegalEntityCapability> getCapabilities() {
      return capabilities;
    }
  
    /**
     * Contains key-value pairs that specify the actions that the legal entity can do in your
     * platform.The key is a capability required for your integration. For example, **issueCard** for
     * Issuing. The value is an object containing the settings for the capability.
     *
     * @param capabilities Contains key-value pairs that specify the actions that the legal entity can
     *     do in your platform.The key is a capability required for your integration. For example,
     *     **issueCard** for Issuing. The value is an object containing the settings for the
     *     capability.
     */
    @JsonProperty(JSON_PROPERTY_CAPABILITIES)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setCapabilities(Map<String, LegalEntityCapability> capabilities) {
      this.capabilities = capabilities;
    }
  
    /**
     * List of legal entities associated with the current legal entity. For example, ultimate
     * beneficial owners associated with an organization through ownership or control, or as
     * signatories.
     *
     * @param entityAssociations List of legal entities associated with the current legal entity. For
     *     example, ultimate beneficial owners associated with an organization through ownership or
     *     control, or as signatories.
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo entityAssociations(List<LegalEntityAssociation> entityAssociations) {
      this.entityAssociations = entityAssociations;
      return this;
    }
  
    public LegalEntityInfo addEntityAssociationsItem(LegalEntityAssociation entityAssociationsItem) {
      if (this.entityAssociations == null) {
        this.entityAssociations = new ArrayList<>();
      }
      this.entityAssociations.add(entityAssociationsItem);
      return this;
    }
  
    /**
     * List of legal entities associated with the current legal entity. For example, ultimate
     * beneficial owners associated with an organization through ownership or control, or as
     * signatories.
     *
     * @return entityAssociations List of legal entities associated with the current legal entity. For
     *     example, ultimate beneficial owners associated with an organization through ownership or
     *     control, or as signatories.
     */
    @JsonProperty(JSON_PROPERTY_ENTITY_ASSOCIATIONS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<LegalEntityAssociation> getEntityAssociations() {
      return entityAssociations;
    }
  
    /**
     * List of legal entities associated with the current legal entity. For example, ultimate
     * beneficial owners associated with an organization through ownership or control, or as
     * signatories.
     *
     * @param entityAssociations List of legal entities associated with the current legal entity. For
     *     example, ultimate beneficial owners associated with an organization through ownership or
     *     control, or as signatories.
     */
    @JsonProperty(JSON_PROPERTY_ENTITY_ASSOCIATIONS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setEntityAssociations(List<LegalEntityAssociation> entityAssociations) {
      this.entityAssociations = entityAssociations;
    }
  
    /**
     * individual
     *
     * @param individual
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo individual(Individual individual) {
      this.individual = individual;
      return this;
    }
  
    /**
     * Get individual
     *
     * @return individual
     */
    @JsonProperty(JSON_PROPERTY_INDIVIDUAL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Individual getIndividual() {
      return individual;
    }
  
    /**
     * individual
     *
     * @param individual
     */
    @JsonProperty(JSON_PROPERTY_INDIVIDUAL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setIndividual(Individual individual) {
      this.individual = individual;
    }
  
    /**
     * organization
     *
     * @param organization
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo organization(Organization organization) {
      this.organization = organization;
      return this;
    }
  
    /**
     * Get organization
     *
     * @return organization
     */
    @JsonProperty(JSON_PROPERTY_ORGANIZATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Organization getOrganization() {
      return organization;
    }
  
    /**
     * organization
     *
     * @param organization
     */
    @JsonProperty(JSON_PROPERTY_ORGANIZATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setOrganization(Organization organization) {
      this.organization = organization;
    }
  
    /**
     * Your reference for the legal entity, maximum 150 characters.
     *
     * @param reference Your reference for the legal entity, maximum 150 characters.
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo reference(String reference) {
      this.reference = reference;
      return this;
    }
  
    /**
     * Your reference for the legal entity, maximum 150 characters.
     *
     * @return reference Your reference for the legal entity, maximum 150 characters.
     */
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getReference() {
      return reference;
    }
  
    /**
     * Your reference for the legal entity, maximum 150 characters.
     *
     * @param reference Your reference for the legal entity, maximum 150 characters.
     */
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setReference(String reference) {
      this.reference = reference;
    }
  
    /**
     * soleProprietorship
     *
     * @param soleProprietorship
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo soleProprietorship(SoleProprietorship soleProprietorship) {
      this.soleProprietorship = soleProprietorship;
      return this;
    }
  
    /**
     * Get soleProprietorship
     *
     * @return soleProprietorship
     */
    @JsonProperty(JSON_PROPERTY_SOLE_PROPRIETORSHIP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public SoleProprietorship getSoleProprietorship() {
      return soleProprietorship;
    }
  
    /**
     * soleProprietorship
     *
     * @param soleProprietorship
     */
    @JsonProperty(JSON_PROPERTY_SOLE_PROPRIETORSHIP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setSoleProprietorship(SoleProprietorship soleProprietorship) {
      this.soleProprietorship = soleProprietorship;
    }
  
    /**
     * trust
     *
     * @param trust
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo trust(Trust trust) {
      this.trust = trust;
      return this;
    }
  
    /**
     * Get trust
     *
     * @return trust
     */
    @JsonProperty(JSON_PROPERTY_TRUST)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Trust getTrust() {
      return trust;
    }
  
    /**
     * trust
     *
     * @param trust
     */
    @JsonProperty(JSON_PROPERTY_TRUST)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTrust(Trust trust) {
      this.trust = trust;
    }
  
    /**
     * The type of legal entity. Possible values: **individual**, **organization**,
     * **soleProprietorship**, or **trust**.
     *
     * @param type The type of legal entity. Possible values: **individual**, **organization**,
     *     **soleProprietorship**, or **trust**.
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo type(TypeEnum type) {
      this.type = type;
      return this;
    }
  
    /**
     * The type of legal entity. Possible values: **individual**, **organization**,
     * **soleProprietorship**, or **trust**.
     *
     * @return type The type of legal entity. Possible values: **individual**, **organization**,
     *     **soleProprietorship**, or **trust**.
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TypeEnum getType() {
      return type;
    }
  
    /**
     * The type of legal entity. Possible values: **individual**, **organization**,
     * **soleProprietorship**, or **trust**.
     *
     * @param type The type of legal entity. Possible values: **individual**, **organization**,
     *     **soleProprietorship**, or **trust**.
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setType(TypeEnum type) {
      this.type = type;
    }
  
    /**
     * unincorporatedPartnership
     *
     * @param unincorporatedPartnership
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo unincorporatedPartnership(
        UnincorporatedPartnership unincorporatedPartnership) {
      this.unincorporatedPartnership = unincorporatedPartnership;
      return this;
    }
  
    /**
     * Get unincorporatedPartnership
     *
     * @return unincorporatedPartnership
     */
    @JsonProperty(JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public UnincorporatedPartnership getUnincorporatedPartnership() {
      return unincorporatedPartnership;
    }
  
    /**
     * unincorporatedPartnership
     *
     * @param unincorporatedPartnership
     */
    @JsonProperty(JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setUnincorporatedPartnership(UnincorporatedPartnership unincorporatedPartnership) {
      this.unincorporatedPartnership = unincorporatedPartnership;
    }
  
    /**
     * A key-value pair that specifies the verification process for a legal entity. Set to **upfront**
     * for upfront verification for
     * [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification).
     *
     * @param verificationPlan A key-value pair that specifies the verification process for a legal
     *     entity. Set to **upfront** for upfront verification for
     *     [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification).
     * @return the current {@code LegalEntityInfo} instance, allowing for method chaining
     */
    public LegalEntityInfo verificationPlan(String verificationPlan) {
      this.verificationPlan = verificationPlan;
      return this;
    }
  
    /**
     * A key-value pair that specifies the verification process for a legal entity. Set to **upfront**
     * for upfront verification for
     * [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification).
     *
     * @return verificationPlan A key-value pair that specifies the verification process for a legal
     *     entity. Set to **upfront** for upfront verification for
     *     [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification).
     */
    @JsonProperty(JSON_PROPERTY_VERIFICATION_PLAN)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getVerificationPlan() {
      return verificationPlan;
    }
  
    /**
     * A key-value pair that specifies the verification process for a legal entity. Set to **upfront**
     * for upfront verification for
     * [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification).
     *
     * @param verificationPlan A key-value pair that specifies the verification process for a legal
     *     entity. Set to **upfront** for upfront verification for
     *     [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification).
     */
    @JsonProperty(JSON_PROPERTY_VERIFICATION_PLAN)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setVerificationPlan(String verificationPlan) {
      this.verificationPlan = verificationPlan;
    }
  
    /** Return true if this LegalEntityInfo object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      LegalEntityInfo legalEntityInfo = (LegalEntityInfo) o;
      return Objects.equals(this.capabilities, legalEntityInfo.capabilities)
          && Objects.equals(this.entityAssociations, legalEntityInfo.entityAssociations)
          && Objects.equals(this.individual, legalEntityInfo.individual)
          && Objects.equals(this.organization, legalEntityInfo.organization)
          && Objects.equals(this.reference, legalEntityInfo.reference)
          && Objects.equals(this.soleProprietorship, legalEntityInfo.soleProprietorship)
          && Objects.equals(this.trust, legalEntityInfo.trust)
          && Objects.equals(this.type, legalEntityInfo.type)
          && Objects.equals(this.unincorporatedPartnership, legalEntityInfo.unincorporatedPartnership)
          && Objects.equals(this.verificationPlan, legalEntityInfo.verificationPlan);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(
          capabilities,
          entityAssociations,
          individual,
          organization,
          reference,
          soleProprietorship,
          trust,
          type,
          unincorporatedPartnership,
          verificationPlan);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class LegalEntityInfo {\n");
      sb.append("    capabilities: ").append(toIndentedString(capabilities)).append("\n");
      sb.append("    entityAssociations: ").append(toIndentedString(entityAssociations)).append("\n");
      sb.append("    individual: ").append(toIndentedString(individual)).append("\n");
      sb.append("    organization: ").append(toIndentedString(organization)).append("\n");
      sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
      sb.append("    soleProprietorship: ").append(toIndentedString(soleProprietorship)).append("\n");
      sb.append("    trust: ").append(toIndentedString(trust)).append("\n");
      sb.append("    type: ").append(toIndentedString(type)).append("\n");
      sb.append("    unincorporatedPartnership: ")
          .append(toIndentedString(unincorporatedPartnership))
          .append("\n");
      sb.append("    verificationPlan: ").append(toIndentedString(verificationPlan)).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 LegalEntityInfo given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of LegalEntityInfo
     * @throws JsonProcessingException if the JSON string is invalid with respect to LegalEntityInfo
     */
    public static LegalEntityInfo fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, LegalEntityInfo.class);
    }
  
    /**
     * Convert an instance of LegalEntityInfo to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  