content: /*
   * Fund 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 Fund API provides endpoints for managing the funds in the accounts on your platform. These management operations include, for example, the transfer of funds from one account to another, the payout of funds to an account holder, and the retrieval of balances in an account.  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 Fund 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/Fund/v6/accountHolderBalance ```
   *
   * 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.marketpayfund;
  
  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.Objects;
  
  /** Split */
  @JsonPropertyOrder({
    Split.JSON_PROPERTY_ACCOUNT,
    Split.JSON_PROPERTY_AMOUNT,
    Split.JSON_PROPERTY_DESCRIPTION,
    Split.JSON_PROPERTY_REFERENCE,
    Split.JSON_PROPERTY_TYPE
  })
  public class Split {
    public static final String JSON_PROPERTY_ACCOUNT = "account";
    private String account;
  
    public static final String JSON_PROPERTY_AMOUNT = "amount";
    private SplitAmount amount;
  
    public static final String JSON_PROPERTY_DESCRIPTION = "description";
    private String description;
  
    public static final String JSON_PROPERTY_REFERENCE = "reference";
    private String reference;
  
    /**
     * The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**,
     * **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**.
     */
    public enum TypeEnum {
      BALANCEACCOUNT("BalanceAccount"),
  
      COMMISSION("Commission"),
  
      DEFAULT("Default"),
  
      MARKETPLACE("MarketPlace"),
  
      PAYMENTFEE("PaymentFee"),
  
      PAYMENTFEEACQUIRING("PaymentFeeAcquiring"),
  
      PAYMENTFEEADYEN("PaymentFeeAdyen"),
  
      PAYMENTFEEADYENCOMMISSION("PaymentFeeAdyenCommission"),
  
      PAYMENTFEEADYENMARKUP("PaymentFeeAdyenMarkup"),
  
      PAYMENTFEEINTERCHANGE("PaymentFeeInterchange"),
  
      PAYMENTFEESCHEMEFEE("PaymentFeeSchemeFee"),
  
      REMAINDER("Remainder"),
  
      SURCHARGE("Surcharge"),
  
      TIP("Tip"),
  
      VAT("VAT"),
  
      VERIFICATION("Verification");
  
      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 Split() {}
  
    public Split account(String account) {
      this.account = account;
      return this;
    }
  
    /**
     * Unique identifier of the account where the split amount should be sent. This is required if
     * &#x60;type&#x60; is **MarketPlace** or **BalanceAccount**.
     *
     * @return account
     */
    @ApiModelProperty(
        value =
            "Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**.  ")
    @JsonProperty(JSON_PROPERTY_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getAccount() {
      return account;
    }
  
    @JsonProperty(JSON_PROPERTY_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAccount(String account) {
      this.account = account;
    }
  
    public Split amount(SplitAmount amount) {
      this.amount = amount;
      return this;
    }
  
    /**
     * Get amount
     *
     * @return amount
     */
    @ApiModelProperty(required = true, value = "")
    @JsonProperty(JSON_PROPERTY_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public SplitAmount getAmount() {
      return amount;
    }
  
    @JsonProperty(JSON_PROPERTY_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAmount(SplitAmount amount) {
      this.amount = amount;
    }
  
    public Split description(String description) {
      this.description = description;
      return this;
    }
  
    /**
     * A description of this split.
     *
     * @return description
     */
    @ApiModelProperty(value = "A description of this split.")
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getDescription() {
      return description;
    }
  
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDescription(String description) {
      this.description = description;
    }
  
    public Split reference(String reference) {
      this.reference = reference;
      return this;
    }
  
    /**
     * Your reference for the split, which you can use to link the split to other operations such as
     * captures and refunds. This is required if &#x60;type&#x60; is **MarketPlace** or
     * **BalanceAccount**. For the other types, we also recommend sending a reference so you can
     * reconcile the split and the associated payment in the transaction overview and in the reports.
     * If the reference is not provided, the split is reported as part of the aggregated
     * [TransferBalance record
     * type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for
     * Platforms.
     *
     * @return reference
     */
    @ApiModelProperty(
        value =
            "Your reference for the split, which you can use to link the split to other operations such as captures and refunds.  This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms.")
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getReference() {
      return reference;
    }
  
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setReference(String reference) {
      this.reference = reference;
    }
  
    public Split type(TypeEnum type) {
      this.type = type;
      return this;
    }
  
    /**
     * The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**,
     * **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**.
     *
     * @return type
     */
    @ApiModelProperty(
        required = true,
        value =
            "The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**.")
    @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 Split object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      Split split = (Split) o;
      return Objects.equals(this.account, split.account)
          && Objects.equals(this.amount, split.amount)
          && Objects.equals(this.description, split.description)
          && Objects.equals(this.reference, split.reference)
          && Objects.equals(this.type, split.type);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(account, amount, description, reference, type);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class Split {\n");
      sb.append("    account: ").append(toIndentedString(account)).append("\n");
      sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
      sb.append("    description: ").append(toIndentedString(description)).append("\n");
      sb.append("    reference: ").append(toIndentedString(reference)).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 Split given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of Split
     * @throws JsonProcessingException if the JSON string is invalid with respect to Split
     */
    public static Split fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, Split.class);
    }
  
    /**
     * Convert an instance of Split to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  