content: /*
   * Adyen Payment API
   *
   * The version of the OpenAPI document: 68
   *
   *
   * 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.payment;
  
  import com.fasterxml.jackson.annotation.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import java.util.*;
  
  /** DonationRequest */
  @JsonPropertyOrder({
    DonationRequest.JSON_PROPERTY_DONATION_ACCOUNT,
    DonationRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
    DonationRequest.JSON_PROPERTY_MODIFICATION_AMOUNT,
    DonationRequest.JSON_PROPERTY_ORIGINAL_REFERENCE,
    DonationRequest.JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC,
    DonationRequest.JSON_PROPERTY_REFERENCE
  })
  public class DonationRequest {
    public static final String JSON_PROPERTY_DONATION_ACCOUNT = "donationAccount";
    private String donationAccount;
  
    public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount";
    private String merchantAccount;
  
    public static final String JSON_PROPERTY_MODIFICATION_AMOUNT = "modificationAmount";
    private Amount modificationAmount;
  
    public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference";
    private String originalReference;
  
    public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic";
    private PlatformChargebackLogic platformChargebackLogic;
  
    public static final String JSON_PROPERTY_REFERENCE = "reference";
    private String reference;
  
    public DonationRequest() {}
  
    /**
     * The Adyen account name of the charity.
     *
     * @param donationAccount The Adyen account name of the charity.
     * @return the current {@code DonationRequest} instance, allowing for method chaining
     */
    public DonationRequest donationAccount(String donationAccount) {
      this.donationAccount = donationAccount;
      return this;
    }
  
    /**
     * The Adyen account name of the charity.
     *
     * @return donationAccount The Adyen account name of the charity.
     */
    @JsonProperty(JSON_PROPERTY_DONATION_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getDonationAccount() {
      return donationAccount;
    }
  
    /**
     * The Adyen account name of the charity.
     *
     * @param donationAccount The Adyen account name of the charity.
     */
    @JsonProperty(JSON_PROPERTY_DONATION_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDonationAccount(String donationAccount) {
      this.donationAccount = donationAccount;
    }
  
    /**
     * The merchant account that is used to process the payment.
     *
     * @param merchantAccount The merchant account that is used to process the payment.
     * @return the current {@code DonationRequest} instance, allowing for method chaining
     */
    public DonationRequest merchantAccount(String merchantAccount) {
      this.merchantAccount = merchantAccount;
      return this;
    }
  
    /**
     * The merchant account that is used to process the payment.
     *
     * @return merchantAccount The merchant account that is used to process the payment.
     */
    @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getMerchantAccount() {
      return merchantAccount;
    }
  
    /**
     * The merchant account that is used to process the payment.
     *
     * @param merchantAccount The merchant account that is used to process the payment.
     */
    @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setMerchantAccount(String merchantAccount) {
      this.merchantAccount = merchantAccount;
    }
  
    /**
     * modificationAmount
     *
     * @param modificationAmount
     * @return the current {@code DonationRequest} instance, allowing for method chaining
     */
    public DonationRequest modificationAmount(Amount modificationAmount) {
      this.modificationAmount = modificationAmount;
      return this;
    }
  
    /**
     * Get modificationAmount
     *
     * @return modificationAmount
     */
    @JsonProperty(JSON_PROPERTY_MODIFICATION_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Amount getModificationAmount() {
      return modificationAmount;
    }
  
    /**
     * modificationAmount
     *
     * @param modificationAmount
     */
    @JsonProperty(JSON_PROPERTY_MODIFICATION_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setModificationAmount(Amount modificationAmount) {
      this.modificationAmount = modificationAmount;
    }
  
    /**
     * The original pspReference of the payment to modify. This reference is returned in: *
     * authorisation response * authorisation notification
     *
     * @param originalReference The original pspReference of the payment to modify. This reference is
     *     returned in: * authorisation response * authorisation notification
     * @return the current {@code DonationRequest} instance, allowing for method chaining
     */
    public DonationRequest originalReference(String originalReference) {
      this.originalReference = originalReference;
      return this;
    }
  
    /**
     * The original pspReference of the payment to modify. This reference is returned in: *
     * authorisation response * authorisation notification
     *
     * @return originalReference The original pspReference of the payment to modify. This reference is
     *     returned in: * authorisation response * authorisation notification
     */
    @JsonProperty(JSON_PROPERTY_ORIGINAL_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getOriginalReference() {
      return originalReference;
    }
  
    /**
     * The original pspReference of the payment to modify. This reference is returned in: *
     * authorisation response * authorisation notification
     *
     * @param originalReference The original pspReference of the payment to modify. This reference is
     *     returned in: * authorisation response * authorisation notification
     */
    @JsonProperty(JSON_PROPERTY_ORIGINAL_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setOriginalReference(String originalReference) {
      this.originalReference = originalReference;
    }
  
    /**
     * platformChargebackLogic
     *
     * @param platformChargebackLogic
     * @return the current {@code DonationRequest} instance, allowing for method chaining
     */
    public DonationRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) {
      this.platformChargebackLogic = platformChargebackLogic;
      return this;
    }
  
    /**
     * Get platformChargebackLogic
     *
     * @return platformChargebackLogic
     */
    @JsonProperty(JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public PlatformChargebackLogic getPlatformChargebackLogic() {
      return platformChargebackLogic;
    }
  
    /**
     * platformChargebackLogic
     *
     * @param platformChargebackLogic
     */
    @JsonProperty(JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) {
      this.platformChargebackLogic = platformChargebackLogic;
    }
  
    /**
     * Your reference for the payment modification. This reference is visible in Customer Area and in
     * reports. Maximum length: 80 characters.
     *
     * @param reference Your reference for the payment modification. This reference is visible in
     *     Customer Area and in reports. Maximum length: 80 characters.
     * @return the current {@code DonationRequest} instance, allowing for method chaining
     */
    public DonationRequest reference(String reference) {
      this.reference = reference;
      return this;
    }
  
    /**
     * Your reference for the payment modification. This reference is visible in Customer Area and in
     * reports. Maximum length: 80 characters.
     *
     * @return reference Your reference for the payment modification. This reference is visible in
     *     Customer Area and in reports. Maximum length: 80 characters.
     */
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getReference() {
      return reference;
    }
  
    /**
     * Your reference for the payment modification. This reference is visible in Customer Area and in
     * reports. Maximum length: 80 characters.
     *
     * @param reference Your reference for the payment modification. This reference is visible in
     *     Customer Area and in reports. Maximum length: 80 characters.
     */
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setReference(String reference) {
      this.reference = reference;
    }
  
    /** Return true if this DonationRequest object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      DonationRequest donationRequest = (DonationRequest) o;
      return Objects.equals(this.donationAccount, donationRequest.donationAccount)
          && Objects.equals(this.merchantAccount, donationRequest.merchantAccount)
          && Objects.equals(this.modificationAmount, donationRequest.modificationAmount)
          && Objects.equals(this.originalReference, donationRequest.originalReference)
          && Objects.equals(this.platformChargebackLogic, donationRequest.platformChargebackLogic)
          && Objects.equals(this.reference, donationRequest.reference);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(
          donationAccount,
          merchantAccount,
          modificationAmount,
          originalReference,
          platformChargebackLogic,
          reference);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class DonationRequest {\n");
      sb.append("    donationAccount: ").append(toIndentedString(donationAccount)).append("\n");
      sb.append("    merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
      sb.append("    modificationAmount: ").append(toIndentedString(modificationAmount)).append("\n");
      sb.append("    originalReference: ").append(toIndentedString(originalReference)).append("\n");
      sb.append("    platformChargebackLogic: ")
          .append(toIndentedString(platformChargebackLogic))
          .append("\n");
      sb.append("    reference: ").append(toIndentedString(reference)).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 DonationRequest given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of DonationRequest
     * @throws JsonProcessingException if the JSON string is invalid with respect to DonationRequest
     */
    public static DonationRequest fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, DonationRequest.class);
    }
  
    /**
     * Convert an instance of DonationRequest to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  