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.time.LocalDate;
  import java.util.*;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  import java.util.logging.Logger;
  
  /** SourceOfFunds */
  @JsonPropertyOrder({
    SourceOfFunds.JSON_PROPERTY_ADYEN_PROCESSED_FUNDS,
    SourceOfFunds.JSON_PROPERTY_AMOUNT,
    SourceOfFunds.JSON_PROPERTY_ASSET_MONTHS_HELD,
    SourceOfFunds.JSON_PROPERTY_CRYPTOCURRENCY_EXCHANGE,
    SourceOfFunds.JSON_PROPERTY_DATE_OF_FUNDS_RECEIVED,
    SourceOfFunds.JSON_PROPERTY_DATE_OF_SOURCE_EVENT,
    SourceOfFunds.JSON_PROPERTY_DESCRIPTION,
    SourceOfFunds.JSON_PROPERTY_FINANCIERS,
    SourceOfFunds.JSON_PROPERTY_ORIGINATOR_LEGAL_ENTITY_ID,
    SourceOfFunds.JSON_PROPERTY_PURPOSE,
    SourceOfFunds.JSON_PROPERTY_RELATIONSHIP,
    SourceOfFunds.JSON_PROPERTY_TYPE,
    SourceOfFunds.JSON_PROPERTY_WEBSITE
  })
  public class SourceOfFunds {
    public static final String JSON_PROPERTY_ADYEN_PROCESSED_FUNDS = "adyenProcessedFunds";
    private Boolean adyenProcessedFunds;
  
    public static final String JSON_PROPERTY_AMOUNT = "amount";
    private Amount amount;
  
    public static final String JSON_PROPERTY_ASSET_MONTHS_HELD = "assetMonthsHeld";
    private Integer assetMonthsHeld;
  
    public static final String JSON_PROPERTY_CRYPTOCURRENCY_EXCHANGE = "cryptocurrencyExchange";
    private String cryptocurrencyExchange;
  
    public static final String JSON_PROPERTY_DATE_OF_FUNDS_RECEIVED = "dateOfFundsReceived";
    private LocalDate dateOfFundsReceived;
  
    public static final String JSON_PROPERTY_DATE_OF_SOURCE_EVENT = "dateOfSourceEvent";
    private LocalDate dateOfSourceEvent;
  
    public static final String JSON_PROPERTY_DESCRIPTION = "description";
    private String description;
  
    public static final String JSON_PROPERTY_FINANCIERS = "financiers";
    private List<Financier> financiers;
  
    public static final String JSON_PROPERTY_ORIGINATOR_LEGAL_ENTITY_ID = "originatorLegalEntityId";
    private String originatorLegalEntityId;
  
    public static final String JSON_PROPERTY_PURPOSE = "purpose";
    private String purpose;
  
    public static final String JSON_PROPERTY_RELATIONSHIP = "relationship";
    private String relationship;
  
    /**
     * The type of the source of funds. Possible values: * **business** * **employment** *
     * **donations** * **inheritance** * **financialAid** * **rentalIncome** * **dividendIncome** *
     * **royaltyIncome** * **thirdPartyFunding** * **pensionIncome** * **insuranceSettlement** *
     * **cryptocurrencyIncome** * **assetSale** * **loans** * **gamblingWinnings**
     */
    public enum TypeEnum {
      BUSINESS(String.valueOf("business")),
  
      EMPLOYMENT(String.valueOf("employment")),
  
      DONATIONS(String.valueOf("donations")),
  
      INHERITANCE(String.valueOf("inheritance")),
  
      FINANCIALAID(String.valueOf("financialAid")),
  
      RENTALINCOME(String.valueOf("rentalIncome")),
  
      DIVIDENDINCOME(String.valueOf("dividendIncome")),
  
      ROYALTYINCOME(String.valueOf("royaltyIncome")),
  
      THIRDPARTYFUNDING(String.valueOf("thirdPartyFunding")),
  
      PENSIONINCOME(String.valueOf("pensionIncome")),
  
      INSURANCESETTLEMENT(String.valueOf("insuranceSettlement")),
  
      CRYPTOCURRENCYINCOME(String.valueOf("cryptocurrencyIncome")),
  
      ASSETSALE(String.valueOf("assetSale")),
  
      LOANS(String.valueOf("loans")),
  
      GAMBLINGWINNINGS(String.valueOf("gamblingWinnings"));
  
      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_WEBSITE = "website";
    private String website;
  
    public SourceOfFunds() {}
  
    /**
     * Indicates whether the funds are coming from transactions processed by Adyen. If **false**, the
     * &#x60;type&#x60; is required.
     *
     * @param adyenProcessedFunds Indicates whether the funds are coming from transactions processed
     *     by Adyen. If **false**, the &#x60;type&#x60; is required.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds adyenProcessedFunds(Boolean adyenProcessedFunds) {
      this.adyenProcessedFunds = adyenProcessedFunds;
      return this;
    }
  
    /**
     * Indicates whether the funds are coming from transactions processed by Adyen. If **false**, the
     * &#x60;type&#x60; is required.
     *
     * @return adyenProcessedFunds Indicates whether the funds are coming from transactions processed
     *     by Adyen. If **false**, the &#x60;type&#x60; is required.
     */
    @JsonProperty(JSON_PROPERTY_ADYEN_PROCESSED_FUNDS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Boolean getAdyenProcessedFunds() {
      return adyenProcessedFunds;
    }
  
    /**
     * Indicates whether the funds are coming from transactions processed by Adyen. If **false**, the
     * &#x60;type&#x60; is required.
     *
     * @param adyenProcessedFunds Indicates whether the funds are coming from transactions processed
     *     by Adyen. If **false**, the &#x60;type&#x60; is required.
     */
    @JsonProperty(JSON_PROPERTY_ADYEN_PROCESSED_FUNDS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAdyenProcessedFunds(Boolean adyenProcessedFunds) {
      this.adyenProcessedFunds = adyenProcessedFunds;
    }
  
    /**
     * amount
     *
     * @param amount
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds amount(Amount amount) {
      this.amount = amount;
      return this;
    }
  
    /**
     * Get amount
     *
     * @return amount
     */
    @JsonProperty(JSON_PROPERTY_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Amount getAmount() {
      return amount;
    }
  
    /**
     * amount
     *
     * @param amount
     */
    @JsonProperty(JSON_PROPERTY_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAmount(Amount amount) {
      this.amount = amount;
    }
  
    /**
     * The number of months that the asset has been in possession of the user. For example, if the
     * source of funds is of type **cryptocurrencyIncome** then &#x60;assetMonthsHeld&#x60; is the
     * number of months the user has owned the cryptocurrency.
     *
     * @param assetMonthsHeld The number of months that the asset has been in possession of the user.
     *     For example, if the source of funds is of type **cryptocurrencyIncome** then
     *     &#x60;assetMonthsHeld&#x60; is the number of months the user has owned the cryptocurrency.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds assetMonthsHeld(Integer assetMonthsHeld) {
      this.assetMonthsHeld = assetMonthsHeld;
      return this;
    }
  
    /**
     * The number of months that the asset has been in possession of the user. For example, if the
     * source of funds is of type **cryptocurrencyIncome** then &#x60;assetMonthsHeld&#x60; is the
     * number of months the user has owned the cryptocurrency.
     *
     * @return assetMonthsHeld The number of months that the asset has been in possession of the user.
     *     For example, if the source of funds is of type **cryptocurrencyIncome** then
     *     &#x60;assetMonthsHeld&#x60; is the number of months the user has owned the cryptocurrency.
     */
    @JsonProperty(JSON_PROPERTY_ASSET_MONTHS_HELD)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Integer getAssetMonthsHeld() {
      return assetMonthsHeld;
    }
  
    /**
     * The number of months that the asset has been in possession of the user. For example, if the
     * source of funds is of type **cryptocurrencyIncome** then &#x60;assetMonthsHeld&#x60; is the
     * number of months the user has owned the cryptocurrency.
     *
     * @param assetMonthsHeld The number of months that the asset has been in possession of the user.
     *     For example, if the source of funds is of type **cryptocurrencyIncome** then
     *     &#x60;assetMonthsHeld&#x60; is the number of months the user has owned the cryptocurrency.
     */
    @JsonProperty(JSON_PROPERTY_ASSET_MONTHS_HELD)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAssetMonthsHeld(Integer assetMonthsHeld) {
      this.assetMonthsHeld = assetMonthsHeld;
    }
  
    /**
     * Required if &#x60;type&#x60; is **cryptocurrencyIncome**. The cryptocurrency exchange where the
     * funds were acquired.
     *
     * @param cryptocurrencyExchange Required if &#x60;type&#x60; is **cryptocurrencyIncome**. The
     *     cryptocurrency exchange where the funds were acquired.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds cryptocurrencyExchange(String cryptocurrencyExchange) {
      this.cryptocurrencyExchange = cryptocurrencyExchange;
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **cryptocurrencyIncome**. The cryptocurrency exchange where the
     * funds were acquired.
     *
     * @return cryptocurrencyExchange Required if &#x60;type&#x60; is **cryptocurrencyIncome**. The
     *     cryptocurrency exchange where the funds were acquired.
     */
    @JsonProperty(JSON_PROPERTY_CRYPTOCURRENCY_EXCHANGE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getCryptocurrencyExchange() {
      return cryptocurrencyExchange;
    }
  
    /**
     * Required if &#x60;type&#x60; is **cryptocurrencyIncome**. The cryptocurrency exchange where the
     * funds were acquired.
     *
     * @param cryptocurrencyExchange Required if &#x60;type&#x60; is **cryptocurrencyIncome**. The
     *     cryptocurrency exchange where the funds were acquired.
     */
    @JsonProperty(JSON_PROPERTY_CRYPTOCURRENCY_EXCHANGE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setCryptocurrencyExchange(String cryptocurrencyExchange) {
      this.cryptocurrencyExchange = cryptocurrencyExchange;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The date the funds were
     * received, in YYYY-MM-DD format.
     *
     * @param dateOfFundsReceived Required if &#x60;type&#x60; is **donations** or **inheritance**.
     *     The date the funds were received, in YYYY-MM-DD format.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds dateOfFundsReceived(LocalDate dateOfFundsReceived) {
      this.dateOfFundsReceived = dateOfFundsReceived;
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The date the funds were
     * received, in YYYY-MM-DD format.
     *
     * @return dateOfFundsReceived Required if &#x60;type&#x60; is **donations** or **inheritance**.
     *     The date the funds were received, in YYYY-MM-DD format.
     */
    @JsonProperty(JSON_PROPERTY_DATE_OF_FUNDS_RECEIVED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public LocalDate getDateOfFundsReceived() {
      return dateOfFundsReceived;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The date the funds were
     * received, in YYYY-MM-DD format.
     *
     * @param dateOfFundsReceived Required if &#x60;type&#x60; is **donations** or **inheritance**.
     *     The date the funds were received, in YYYY-MM-DD format.
     */
    @JsonProperty(JSON_PROPERTY_DATE_OF_FUNDS_RECEIVED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDateOfFundsReceived(LocalDate dateOfFundsReceived) {
      this.dateOfFundsReceived = dateOfFundsReceived;
    }
  
    /**
     * Required if &#x60;type&#x60; is **assetSale** or **gamblingWinnings**. The date the funds were
     * received, in YYYY-MM-DD format. For example, if the source of funds is of type **assetSale**,
     * the dateOfSourceEvent is the date of the sale. If the source of funds is of type
     * **gamblingWinnings**, the dateOfSourceEvent is the date of winnings.
     *
     * @param dateOfSourceEvent Required if &#x60;type&#x60; is **assetSale** or **gamblingWinnings**.
     *     The date the funds were received, in YYYY-MM-DD format. For example, if the source of funds
     *     is of type **assetSale**, the dateOfSourceEvent is the date of the sale. If the source of
     *     funds is of type **gamblingWinnings**, the dateOfSourceEvent is the date of winnings.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds dateOfSourceEvent(LocalDate dateOfSourceEvent) {
      this.dateOfSourceEvent = dateOfSourceEvent;
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **assetSale** or **gamblingWinnings**. The date the funds were
     * received, in YYYY-MM-DD format. For example, if the source of funds is of type **assetSale**,
     * the dateOfSourceEvent is the date of the sale. If the source of funds is of type
     * **gamblingWinnings**, the dateOfSourceEvent is the date of winnings.
     *
     * @return dateOfSourceEvent Required if &#x60;type&#x60; is **assetSale** or
     *     **gamblingWinnings**. The date the funds were received, in YYYY-MM-DD format. For example,
     *     if the source of funds is of type **assetSale**, the dateOfSourceEvent is the date of the
     *     sale. If the source of funds is of type **gamblingWinnings**, the dateOfSourceEvent is the
     *     date of winnings.
     */
    @JsonProperty(JSON_PROPERTY_DATE_OF_SOURCE_EVENT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public LocalDate getDateOfSourceEvent() {
      return dateOfSourceEvent;
    }
  
    /**
     * Required if &#x60;type&#x60; is **assetSale** or **gamblingWinnings**. The date the funds were
     * received, in YYYY-MM-DD format. For example, if the source of funds is of type **assetSale**,
     * the dateOfSourceEvent is the date of the sale. If the source of funds is of type
     * **gamblingWinnings**, the dateOfSourceEvent is the date of winnings.
     *
     * @param dateOfSourceEvent Required if &#x60;type&#x60; is **assetSale** or **gamblingWinnings**.
     *     The date the funds were received, in YYYY-MM-DD format. For example, if the source of funds
     *     is of type **assetSale**, the dateOfSourceEvent is the date of the sale. If the source of
     *     funds is of type **gamblingWinnings**, the dateOfSourceEvent is the date of winnings.
     */
    @JsonProperty(JSON_PROPERTY_DATE_OF_SOURCE_EVENT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDateOfSourceEvent(LocalDate dateOfSourceEvent) {
      this.dateOfSourceEvent = dateOfSourceEvent;
    }
  
    /**
     * Required if &#x60;type&#x60; is **business** or **assetSale**. A description for the source of
     * funds. For example, for &#x60;type&#x60; **business**, provide a description of where the
     * business transactions come from, such as payments through bank transfer. For &#x60;type&#x60;
     * **assetSale**, provide a description of the asset. For example, the address of a residential
     * property if it is a property sale.
     *
     * @param description Required if &#x60;type&#x60; is **business** or **assetSale**. A description
     *     for the source of funds. For example, for &#x60;type&#x60; **business**, provide a
     *     description of where the business transactions come from, such as payments through bank
     *     transfer. For &#x60;type&#x60; **assetSale**, provide a description of the asset. For
     *     example, the address of a residential property if it is a property sale.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds description(String description) {
      this.description = description;
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **business** or **assetSale**. A description for the source of
     * funds. For example, for &#x60;type&#x60; **business**, provide a description of where the
     * business transactions come from, such as payments through bank transfer. For &#x60;type&#x60;
     * **assetSale**, provide a description of the asset. For example, the address of a residential
     * property if it is a property sale.
     *
     * @return description Required if &#x60;type&#x60; is **business** or **assetSale**. A
     *     description for the source of funds. For example, for &#x60;type&#x60; **business**,
     *     provide a description of where the business transactions come from, such as payments
     *     through bank transfer. For &#x60;type&#x60; **assetSale**, provide a description of the
     *     asset. For example, the address of a residential property if it is a property sale.
     */
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getDescription() {
      return description;
    }
  
    /**
     * Required if &#x60;type&#x60; is **business** or **assetSale**. A description for the source of
     * funds. For example, for &#x60;type&#x60; **business**, provide a description of where the
     * business transactions come from, such as payments through bank transfer. For &#x60;type&#x60;
     * **assetSale**, provide a description of the asset. For example, the address of a residential
     * property if it is a property sale.
     *
     * @param description Required if &#x60;type&#x60; is **business** or **assetSale**. A description
     *     for the source of funds. For example, for &#x60;type&#x60; **business**, provide a
     *     description of where the business transactions come from, such as payments through bank
     *     transfer. For &#x60;type&#x60; **assetSale**, provide a description of the asset. For
     *     example, the address of a residential property if it is a property sale.
     */
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDescription(String description) {
      this.description = description;
    }
  
    /**
     * Required if &#x60;type&#x60; is **thirdPartyFunding**. Information about the financiers.
     *
     * @param financiers Required if &#x60;type&#x60; is **thirdPartyFunding**. Information about the
     *     financiers.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds financiers(List<Financier> financiers) {
      this.financiers = financiers;
      return this;
    }
  
    public SourceOfFunds addFinanciersItem(Financier financiersItem) {
      if (this.financiers == null) {
        this.financiers = new ArrayList<>();
      }
      this.financiers.add(financiersItem);
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **thirdPartyFunding**. Information about the financiers.
     *
     * @return financiers Required if &#x60;type&#x60; is **thirdPartyFunding**. Information about the
     *     financiers.
     */
    @JsonProperty(JSON_PROPERTY_FINANCIERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<Financier> getFinanciers() {
      return financiers;
    }
  
    /**
     * Required if &#x60;type&#x60; is **thirdPartyFunding**. Information about the financiers.
     *
     * @param financiers Required if &#x60;type&#x60; is **thirdPartyFunding**. Information about the
     *     financiers.
     */
    @JsonProperty(JSON_PROPERTY_FINANCIERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setFinanciers(List<Financier> financiers) {
      this.financiers = financiers;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The legal entity ID
     * representing the originator of the source of funds. For example, if the source of funds is
     * **inheritance**, then &#x60;originatorOfFundsReference&#x60; should be the legal entity
     * reference of the benefactor.
     *
     * @param originatorLegalEntityId Required if &#x60;type&#x60; is **donations** or
     *     **inheritance**. The legal entity ID representing the originator of the source of funds.
     *     For example, if the source of funds is **inheritance**, then
     *     &#x60;originatorOfFundsReference&#x60; should be the legal entity reference of the
     *     benefactor.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds originatorLegalEntityId(String originatorLegalEntityId) {
      this.originatorLegalEntityId = originatorLegalEntityId;
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The legal entity ID
     * representing the originator of the source of funds. For example, if the source of funds is
     * **inheritance**, then &#x60;originatorOfFundsReference&#x60; should be the legal entity
     * reference of the benefactor.
     *
     * @return originatorLegalEntityId Required if &#x60;type&#x60; is **donations** or
     *     **inheritance**. The legal entity ID representing the originator of the source of funds.
     *     For example, if the source of funds is **inheritance**, then
     *     &#x60;originatorOfFundsReference&#x60; should be the legal entity reference of the
     *     benefactor.
     */
    @JsonProperty(JSON_PROPERTY_ORIGINATOR_LEGAL_ENTITY_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getOriginatorLegalEntityId() {
      return originatorLegalEntityId;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The legal entity ID
     * representing the originator of the source of funds. For example, if the source of funds is
     * **inheritance**, then &#x60;originatorOfFundsReference&#x60; should be the legal entity
     * reference of the benefactor.
     *
     * @param originatorLegalEntityId Required if &#x60;type&#x60; is **donations** or
     *     **inheritance**. The legal entity ID representing the originator of the source of funds.
     *     For example, if the source of funds is **inheritance**, then
     *     &#x60;originatorOfFundsReference&#x60; should be the legal entity reference of the
     *     benefactor.
     */
    @JsonProperty(JSON_PROPERTY_ORIGINATOR_LEGAL_ENTITY_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setOriginatorLegalEntityId(String originatorLegalEntityId) {
      this.originatorLegalEntityId = originatorLegalEntityId;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations**. The reason for receiving the funds.
     *
     * @param purpose Required if &#x60;type&#x60; is **donations**. The reason for receiving the
     *     funds.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds purpose(String purpose) {
      this.purpose = purpose;
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations**. The reason for receiving the funds.
     *
     * @return purpose Required if &#x60;type&#x60; is **donations**. The reason for receiving the
     *     funds.
     */
    @JsonProperty(JSON_PROPERTY_PURPOSE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getPurpose() {
      return purpose;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations**. The reason for receiving the funds.
     *
     * @param purpose Required if &#x60;type&#x60; is **donations**. The reason for receiving the
     *     funds.
     */
    @JsonProperty(JSON_PROPERTY_PURPOSE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPurpose(String purpose) {
      this.purpose = purpose;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The relationship of the
     * originator of the funds to the recipient.
     *
     * @param relationship Required if &#x60;type&#x60; is **donations** or **inheritance**. The
     *     relationship of the originator of the funds to the recipient.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds relationship(String relationship) {
      this.relationship = relationship;
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The relationship of the
     * originator of the funds to the recipient.
     *
     * @return relationship Required if &#x60;type&#x60; is **donations** or **inheritance**. The
     *     relationship of the originator of the funds to the recipient.
     */
    @JsonProperty(JSON_PROPERTY_RELATIONSHIP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getRelationship() {
      return relationship;
    }
  
    /**
     * Required if &#x60;type&#x60; is **donations** or **inheritance**. The relationship of the
     * originator of the funds to the recipient.
     *
     * @param relationship Required if &#x60;type&#x60; is **donations** or **inheritance**. The
     *     relationship of the originator of the funds to the recipient.
     */
    @JsonProperty(JSON_PROPERTY_RELATIONSHIP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setRelationship(String relationship) {
      this.relationship = relationship;
    }
  
    /**
     * The type of the source of funds. Possible values: * **business** * **employment** *
     * **donations** * **inheritance** * **financialAid** * **rentalIncome** * **dividendIncome** *
     * **royaltyIncome** * **thirdPartyFunding** * **pensionIncome** * **insuranceSettlement** *
     * **cryptocurrencyIncome** * **assetSale** * **loans** * **gamblingWinnings**
     *
     * @param type The type of the source of funds. Possible values: * **business** * **employment** *
     *     **donations** * **inheritance** * **financialAid** * **rentalIncome** * **dividendIncome**
     *     * **royaltyIncome** * **thirdPartyFunding** * **pensionIncome** * **insuranceSettlement** *
     *     **cryptocurrencyIncome** * **assetSale** * **loans** * **gamblingWinnings**
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds type(TypeEnum type) {
      this.type = type;
      return this;
    }
  
    /**
     * The type of the source of funds. Possible values: * **business** * **employment** *
     * **donations** * **inheritance** * **financialAid** * **rentalIncome** * **dividendIncome** *
     * **royaltyIncome** * **thirdPartyFunding** * **pensionIncome** * **insuranceSettlement** *
     * **cryptocurrencyIncome** * **assetSale** * **loans** * **gamblingWinnings**
     *
     * @return type The type of the source of funds. Possible values: * **business** * **employment**
     *     * **donations** * **inheritance** * **financialAid** * **rentalIncome** *
     *     **dividendIncome** * **royaltyIncome** * **thirdPartyFunding** * **pensionIncome** *
     *     **insuranceSettlement** * **cryptocurrencyIncome** * **assetSale** * **loans** *
     *     **gamblingWinnings**
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TypeEnum getType() {
      return type;
    }
  
    /**
     * The type of the source of funds. Possible values: * **business** * **employment** *
     * **donations** * **inheritance** * **financialAid** * **rentalIncome** * **dividendIncome** *
     * **royaltyIncome** * **thirdPartyFunding** * **pensionIncome** * **insuranceSettlement** *
     * **cryptocurrencyIncome** * **assetSale** * **loans** * **gamblingWinnings**
     *
     * @param type The type of the source of funds. Possible values: * **business** * **employment** *
     *     **donations** * **inheritance** * **financialAid** * **rentalIncome** * **dividendIncome**
     *     * **royaltyIncome** * **thirdPartyFunding** * **pensionIncome** * **insuranceSettlement** *
     *     **cryptocurrencyIncome** * **assetSale** * **loans** * **gamblingWinnings**
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setType(TypeEnum type) {
      this.type = type;
    }
  
    /**
     * Required if &#x60;type&#x60; is **gamblingWinnings**. The location of the gambling site for the
     * winnings. For example, if the source of funds is online gambling, provide the website of the
     * gambling company.
     *
     * @param website Required if &#x60;type&#x60; is **gamblingWinnings**. The location of the
     *     gambling site for the winnings. For example, if the source of funds is online gambling,
     *     provide the website of the gambling company.
     * @return the current {@code SourceOfFunds} instance, allowing for method chaining
     */
    public SourceOfFunds website(String website) {
      this.website = website;
      return this;
    }
  
    /**
     * Required if &#x60;type&#x60; is **gamblingWinnings**. The location of the gambling site for the
     * winnings. For example, if the source of funds is online gambling, provide the website of the
     * gambling company.
     *
     * @return website Required if &#x60;type&#x60; is **gamblingWinnings**. The location of the
     *     gambling site for the winnings. For example, if the source of funds is online gambling,
     *     provide the website of the gambling company.
     */
    @JsonProperty(JSON_PROPERTY_WEBSITE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getWebsite() {
      return website;
    }
  
    /**
     * Required if &#x60;type&#x60; is **gamblingWinnings**. The location of the gambling site for the
     * winnings. For example, if the source of funds is online gambling, provide the website of the
     * gambling company.
     *
     * @param website Required if &#x60;type&#x60; is **gamblingWinnings**. The location of the
     *     gambling site for the winnings. For example, if the source of funds is online gambling,
     *     provide the website of the gambling company.
     */
    @JsonProperty(JSON_PROPERTY_WEBSITE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setWebsite(String website) {
      this.website = website;
    }
  
    /** Return true if this SourceOfFunds object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      SourceOfFunds sourceOfFunds = (SourceOfFunds) o;
      return Objects.equals(this.adyenProcessedFunds, sourceOfFunds.adyenProcessedFunds)
          && Objects.equals(this.amount, sourceOfFunds.amount)
          && Objects.equals(this.assetMonthsHeld, sourceOfFunds.assetMonthsHeld)
          && Objects.equals(this.cryptocurrencyExchange, sourceOfFunds.cryptocurrencyExchange)
          && Objects.equals(this.dateOfFundsReceived, sourceOfFunds.dateOfFundsReceived)
          && Objects.equals(this.dateOfSourceEvent, sourceOfFunds.dateOfSourceEvent)
          && Objects.equals(this.description, sourceOfFunds.description)
          && Objects.equals(this.financiers, sourceOfFunds.financiers)
          && Objects.equals(this.originatorLegalEntityId, sourceOfFunds.originatorLegalEntityId)
          && Objects.equals(this.purpose, sourceOfFunds.purpose)
          && Objects.equals(this.relationship, sourceOfFunds.relationship)
          && Objects.equals(this.type, sourceOfFunds.type)
          && Objects.equals(this.website, sourceOfFunds.website);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(
          adyenProcessedFunds,
          amount,
          assetMonthsHeld,
          cryptocurrencyExchange,
          dateOfFundsReceived,
          dateOfSourceEvent,
          description,
          financiers,
          originatorLegalEntityId,
          purpose,
          relationship,
          type,
          website);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class SourceOfFunds {\n");
      sb.append("    adyenProcessedFunds: ")
          .append(toIndentedString(adyenProcessedFunds))
          .append("\n");
      sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
      sb.append("    assetMonthsHeld: ").append(toIndentedString(assetMonthsHeld)).append("\n");
      sb.append("    cryptocurrencyExchange: ")
          .append(toIndentedString(cryptocurrencyExchange))
          .append("\n");
      sb.append("    dateOfFundsReceived: ")
          .append(toIndentedString(dateOfFundsReceived))
          .append("\n");
      sb.append("    dateOfSourceEvent: ").append(toIndentedString(dateOfSourceEvent)).append("\n");
      sb.append("    description: ").append(toIndentedString(description)).append("\n");
      sb.append("    financiers: ").append(toIndentedString(financiers)).append("\n");
      sb.append("    originatorLegalEntityId: ")
          .append(toIndentedString(originatorLegalEntityId))
          .append("\n");
      sb.append("    purpose: ").append(toIndentedString(purpose)).append("\n");
      sb.append("    relationship: ").append(toIndentedString(relationship)).append("\n");
      sb.append("    type: ").append(toIndentedString(type)).append("\n");
      sb.append("    website: ").append(toIndentedString(website)).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 SourceOfFunds given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of SourceOfFunds
     * @throws JsonProcessingException if the JSON string is invalid with respect to SourceOfFunds
     */
    public static SourceOfFunds fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, SourceOfFunds.class);
    }
  
    /**
     * Convert an instance of SourceOfFunds to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  