content: /*
   * Adyen Checkout API
   *
   * The version of the OpenAPI document: 71
   *
   *
   * 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.checkout;
  
  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.Arrays;
  import java.util.logging.Logger;
  
  /** DonationPaymentResponse */
  @JsonPropertyOrder({
    DonationPaymentResponse.JSON_PROPERTY_AMOUNT,
    DonationPaymentResponse.JSON_PROPERTY_DONATION_ACCOUNT,
    DonationPaymentResponse.JSON_PROPERTY_ID,
    DonationPaymentResponse.JSON_PROPERTY_MERCHANT_ACCOUNT,
    DonationPaymentResponse.JSON_PROPERTY_PAYMENT,
    DonationPaymentResponse.JSON_PROPERTY_REFERENCE,
    DonationPaymentResponse.JSON_PROPERTY_STATUS
  })
  public class DonationPaymentResponse {
    public static final String JSON_PROPERTY_AMOUNT = "amount";
    private Amount amount;
  
    public static final String JSON_PROPERTY_DONATION_ACCOUNT = "donationAccount";
    private String donationAccount;
  
    public static final String JSON_PROPERTY_ID = "id";
    private String id;
  
    public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount";
    private String merchantAccount;
  
    public static final String JSON_PROPERTY_PAYMENT = "payment";
    private PaymentResponse payment;
  
    public static final String JSON_PROPERTY_REFERENCE = "reference";
    private String reference;
  
    /**
     * The status of the donation transaction. Possible values: * **completed** * **pending** *
     * **refused**
     */
    public enum StatusEnum {
      COMPLETED(String.valueOf("completed")),
  
      PENDING(String.valueOf("pending")),
  
      REFUSED(String.valueOf("refused"));
  
      private static final Logger LOG = Logger.getLogger(StatusEnum.class.getName());
  
      private String value;
  
      StatusEnum(String value) {
        this.value = value;
      }
  
      @JsonValue
      public String getValue() {
        return value;
      }
  
      @Override
      public String toString() {
        return String.valueOf(value);
      }
  
      @JsonCreator
      public static StatusEnum fromValue(String value) {
        for (StatusEnum b : StatusEnum.values()) {
          if (b.value.equals(value)) {
            return b;
          }
        }
        // handling unexpected value
        LOG.warning(
            "StatusEnum: unexpected enum value '"
                + value
                + "' - Supported values are "
                + Arrays.toString(StatusEnum.values()));
        return null;
      }
    }
  
    public static final String JSON_PROPERTY_STATUS = "status";
    private StatusEnum status;
  
    public DonationPaymentResponse() {}
  
    /**
     * amount
     *
     * @param amount
     * @return the current {@code DonationPaymentResponse} instance, allowing for method chaining
     */
    public DonationPaymentResponse 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 Adyen account name of your charity. We will provide you with this account name once your
     * chosen charity has been
     * [onboarded](https://docs.adyen.com/online-payments/donations#onboarding).
     *
     * @param donationAccount The Adyen account name of your charity. We will provide you with this
     *     account name once your chosen charity has been
     *     [onboarded](https://docs.adyen.com/online-payments/donations#onboarding).
     * @return the current {@code DonationPaymentResponse} instance, allowing for method chaining
     */
    public DonationPaymentResponse donationAccount(String donationAccount) {
      this.donationAccount = donationAccount;
      return this;
    }
  
    /**
     * The Adyen account name of your charity. We will provide you with this account name once your
     * chosen charity has been
     * [onboarded](https://docs.adyen.com/online-payments/donations#onboarding).
     *
     * @return donationAccount The Adyen account name of your charity. We will provide you with this
     *     account name once your chosen charity has been
     *     [onboarded](https://docs.adyen.com/online-payments/donations#onboarding).
     */
    @JsonProperty(JSON_PROPERTY_DONATION_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getDonationAccount() {
      return donationAccount;
    }
  
    /**
     * The Adyen account name of your charity. We will provide you with this account name once your
     * chosen charity has been
     * [onboarded](https://docs.adyen.com/online-payments/donations#onboarding).
     *
     * @param donationAccount The Adyen account name of your charity. We will provide you with this
     *     account name once your chosen charity has been
     *     [onboarded](https://docs.adyen.com/online-payments/donations#onboarding).
     */
    @JsonProperty(JSON_PROPERTY_DONATION_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDonationAccount(String donationAccount) {
      this.donationAccount = donationAccount;
    }
  
    /**
     * Your unique resource identifier.
     *
     * @param id Your unique resource identifier.
     * @return the current {@code DonationPaymentResponse} instance, allowing for method chaining
     */
    public DonationPaymentResponse id(String id) {
      this.id = id;
      return this;
    }
  
    /**
     * Your unique resource identifier.
     *
     * @return id Your unique resource identifier.
     */
    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getId() {
      return id;
    }
  
    /**
     * Your unique resource identifier.
     *
     * @param id Your unique resource identifier.
     */
    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setId(String id) {
      this.id = id;
    }
  
    /**
     * The merchant account identifier, with which you want to process the transaction.
     *
     * @param merchantAccount The merchant account identifier, with which you want to process the
     *     transaction.
     * @return the current {@code DonationPaymentResponse} instance, allowing for method chaining
     */
    public DonationPaymentResponse merchantAccount(String merchantAccount) {
      this.merchantAccount = merchantAccount;
      return this;
    }
  
    /**
     * The merchant account identifier, with which you want to process the transaction.
     *
     * @return merchantAccount The merchant account identifier, with which you want to process the
     *     transaction.
     */
    @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getMerchantAccount() {
      return merchantAccount;
    }
  
    /**
     * The merchant account identifier, with which you want to process the transaction.
     *
     * @param merchantAccount The merchant account identifier, with which you want to process the
     *     transaction.
     */
    @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setMerchantAccount(String merchantAccount) {
      this.merchantAccount = merchantAccount;
    }
  
    /**
     * payment
     *
     * @param payment
     * @return the current {@code DonationPaymentResponse} instance, allowing for method chaining
     */
    public DonationPaymentResponse payment(PaymentResponse payment) {
      this.payment = payment;
      return this;
    }
  
    /**
     * Get payment
     *
     * @return payment
     */
    @JsonProperty(JSON_PROPERTY_PAYMENT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public PaymentResponse getPayment() {
      return payment;
    }
  
    /**
     * payment
     *
     * @param payment
     */
    @JsonProperty(JSON_PROPERTY_PAYMENT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPayment(PaymentResponse payment) {
      this.payment = payment;
    }
  
    /**
     * The reference to uniquely identify a payment. This reference is used in all communication with
     * you about the payment status. We recommend using a unique value per payment; however, it is not
     * a requirement. If you need to provide multiple references for a transaction, separate them with
     * hyphens (\&quot;-\&quot;). Maximum length: 80 characters.
     *
     * @param reference The reference to uniquely identify a payment. This reference is used in all
     *     communication with you about the payment status. We recommend using a unique value per
     *     payment; however, it is not a requirement. If you need to provide multiple references for a
     *     transaction, separate them with hyphens (\&quot;-\&quot;). Maximum length: 80 characters.
     * @return the current {@code DonationPaymentResponse} instance, allowing for method chaining
     */
    public DonationPaymentResponse reference(String reference) {
      this.reference = reference;
      return this;
    }
  
    /**
     * The reference to uniquely identify a payment. This reference is used in all communication with
     * you about the payment status. We recommend using a unique value per payment; however, it is not
     * a requirement. If you need to provide multiple references for a transaction, separate them with
     * hyphens (\&quot;-\&quot;). Maximum length: 80 characters.
     *
     * @return reference The reference to uniquely identify a payment. This reference is used in all
     *     communication with you about the payment status. We recommend using a unique value per
     *     payment; however, it is not a requirement. If you need to provide multiple references for a
     *     transaction, separate them with hyphens (\&quot;-\&quot;). Maximum length: 80 characters.
     */
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getReference() {
      return reference;
    }
  
    /**
     * The reference to uniquely identify a payment. This reference is used in all communication with
     * you about the payment status. We recommend using a unique value per payment; however, it is not
     * a requirement. If you need to provide multiple references for a transaction, separate them with
     * hyphens (\&quot;-\&quot;). Maximum length: 80 characters.
     *
     * @param reference The reference to uniquely identify a payment. This reference is used in all
     *     communication with you about the payment status. We recommend using a unique value per
     *     payment; however, it is not a requirement. If you need to provide multiple references for a
     *     transaction, separate them with hyphens (\&quot;-\&quot;). Maximum length: 80 characters.
     */
    @JsonProperty(JSON_PROPERTY_REFERENCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setReference(String reference) {
      this.reference = reference;
    }
  
    /**
     * The status of the donation transaction. Possible values: * **completed** * **pending** *
     * **refused**
     *
     * @param status The status of the donation transaction. Possible values: * **completed** *
     *     **pending** * **refused**
     * @return the current {@code DonationPaymentResponse} instance, allowing for method chaining
     */
    public DonationPaymentResponse status(StatusEnum status) {
      this.status = status;
      return this;
    }
  
    /**
     * The status of the donation transaction. Possible values: * **completed** * **pending** *
     * **refused**
     *
     * @return status The status of the donation transaction. Possible values: * **completed** *
     *     **pending** * **refused**
     */
    @JsonProperty(JSON_PROPERTY_STATUS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public StatusEnum getStatus() {
      return status;
    }
  
    /**
     * The status of the donation transaction. Possible values: * **completed** * **pending** *
     * **refused**
     *
     * @param status The status of the donation transaction. Possible values: * **completed** *
     *     **pending** * **refused**
     */
    @JsonProperty(JSON_PROPERTY_STATUS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setStatus(StatusEnum status) {
      this.status = status;
    }
  
    /** Return true if this DonationPaymentResponse object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      DonationPaymentResponse donationPaymentResponse = (DonationPaymentResponse) o;
      return Objects.equals(this.amount, donationPaymentResponse.amount)
          && Objects.equals(this.donationAccount, donationPaymentResponse.donationAccount)
          && Objects.equals(this.id, donationPaymentResponse.id)
          && Objects.equals(this.merchantAccount, donationPaymentResponse.merchantAccount)
          && Objects.equals(this.payment, donationPaymentResponse.payment)
          && Objects.equals(this.reference, donationPaymentResponse.reference)
          && Objects.equals(this.status, donationPaymentResponse.status);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(amount, donationAccount, id, merchantAccount, payment, reference, status);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class DonationPaymentResponse {\n");
      sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
      sb.append("    donationAccount: ").append(toIndentedString(donationAccount)).append("\n");
      sb.append("    id: ").append(toIndentedString(id)).append("\n");
      sb.append("    merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
      sb.append("    payment: ").append(toIndentedString(payment)).append("\n");
      sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
      sb.append("    status: ").append(toIndentedString(status)).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 DonationPaymentResponse given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of DonationPaymentResponse
     * @throws JsonProcessingException if the JSON string is invalid with respect to
     *     DonationPaymentResponse
     */
    public static DonationPaymentResponse fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, DonationPaymentResponse.class);
    }
  
    /**
     * Convert an instance of DonationPaymentResponse to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  