All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adyen.model.checkout.PaypalUpdateOrderRequest Maven / Gradle / Ivy

There is a newer version: 38.1.0
Show newest version
/*
 * 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 java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.adyen.model.checkout.Amount;
import com.adyen.model.checkout.DeliveryMethod;
import com.adyen.model.checkout.TaxTotal;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;


/**
 * PaypalUpdateOrderRequest
 */
@JsonPropertyOrder({
  PaypalUpdateOrderRequest.JSON_PROPERTY_AMOUNT,
  PaypalUpdateOrderRequest.JSON_PROPERTY_DELIVERY_METHODS,
  PaypalUpdateOrderRequest.JSON_PROPERTY_PAYMENT_DATA,
  PaypalUpdateOrderRequest.JSON_PROPERTY_PSP_REFERENCE,
  PaypalUpdateOrderRequest.JSON_PROPERTY_SESSION_ID,
  PaypalUpdateOrderRequest.JSON_PROPERTY_TAX_TOTAL
})

public class PaypalUpdateOrderRequest {
  public static final String JSON_PROPERTY_AMOUNT = "amount";
  private Amount amount;

  public static final String JSON_PROPERTY_DELIVERY_METHODS = "deliveryMethods";
  private List deliveryMethods;

  public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData";
  private String paymentData;

  public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference";
  private String pspReference;

  public static final String JSON_PROPERTY_SESSION_ID = "sessionId";
  private String sessionId;

  public static final String JSON_PROPERTY_TAX_TOTAL = "taxTotal";
  private TaxTotal taxTotal;

  public PaypalUpdateOrderRequest() { 
  }

  /**
   * amount
   *
   * @param amount 
   * @return the current {@code PaypalUpdateOrderRequest} instance, allowing for method chaining
   */
  public PaypalUpdateOrderRequest 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 list of new delivery methods and the cost of each.
   *
   * @param deliveryMethods The list of new delivery methods and the cost of each.
   * @return the current {@code PaypalUpdateOrderRequest} instance, allowing for method chaining
   */
  public PaypalUpdateOrderRequest deliveryMethods(List deliveryMethods) {
    this.deliveryMethods = deliveryMethods;
    return this;
  }

  public PaypalUpdateOrderRequest addDeliveryMethodsItem(DeliveryMethod deliveryMethodsItem) {
    if (this.deliveryMethods == null) {
      this.deliveryMethods = new ArrayList<>();
    }
    this.deliveryMethods.add(deliveryMethodsItem);
    return this;
  }

  /**
   * The list of new delivery methods and the cost of each.
   * @return deliveryMethods The list of new delivery methods and the cost of each.
   */
  @JsonProperty(JSON_PROPERTY_DELIVERY_METHODS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public List getDeliveryMethods() {
    return deliveryMethods;
  }

  /**
   * The list of new delivery methods and the cost of each.
   *
   * @param deliveryMethods The list of new delivery methods and the cost of each.
   */
  @JsonProperty(JSON_PROPERTY_DELIVERY_METHODS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDeliveryMethods(List deliveryMethods) {
    this.deliveryMethods = deliveryMethods;
  }

  /**
   * The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request.
   *
   * @param paymentData The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request.
   * @return the current {@code PaypalUpdateOrderRequest} instance, allowing for method chaining
   */
  public PaypalUpdateOrderRequest paymentData(String paymentData) {
    this.paymentData = paymentData;
    return this;
  }

  /**
   * The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request.
   * @return paymentData The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request.
   */
  @JsonProperty(JSON_PROPERTY_PAYMENT_DATA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getPaymentData() {
    return paymentData;
  }

  /**
   * The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request.
   *
   * @param paymentData The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request.
   */
  @JsonProperty(JSON_PROPERTY_PAYMENT_DATA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPaymentData(String paymentData) {
    this.paymentData = paymentData;
  }

  /**
   * The original `pspReference` from the `/payments` response.
   *
   * @param pspReference The original `pspReference` from the `/payments` response.
   * @return the current {@code PaypalUpdateOrderRequest} instance, allowing for method chaining
   */
  public PaypalUpdateOrderRequest pspReference(String pspReference) {
    this.pspReference = pspReference;
    return this;
  }

  /**
   * The original `pspReference` from the `/payments` response.
   * @return pspReference The original `pspReference` from the `/payments` response.
   */
  @JsonProperty(JSON_PROPERTY_PSP_REFERENCE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getPspReference() {
    return pspReference;
  }

  /**
   * The original `pspReference` from the `/payments` response.
   *
   * @param pspReference The original `pspReference` from the `/payments` response.
   */
  @JsonProperty(JSON_PROPERTY_PSP_REFERENCE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPspReference(String pspReference) {
    this.pspReference = pspReference;
  }

  /**
   * The original `sessionId` from the `/sessions` response.
   *
   * @param sessionId The original `sessionId` from the `/sessions` response.
   * @return the current {@code PaypalUpdateOrderRequest} instance, allowing for method chaining
   */
  public PaypalUpdateOrderRequest sessionId(String sessionId) {
    this.sessionId = sessionId;
    return this;
  }

  /**
   * The original `sessionId` from the `/sessions` response.
   * @return sessionId The original `sessionId` from the `/sessions` response.
   */
  @JsonProperty(JSON_PROPERTY_SESSION_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getSessionId() {
    return sessionId;
  }

  /**
   * The original `sessionId` from the `/sessions` response.
   *
   * @param sessionId The original `sessionId` from the `/sessions` response.
   */
  @JsonProperty(JSON_PROPERTY_SESSION_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSessionId(String sessionId) {
    this.sessionId = sessionId;
  }

  /**
   * taxTotal
   *
   * @param taxTotal 
   * @return the current {@code PaypalUpdateOrderRequest} instance, allowing for method chaining
   */
  public PaypalUpdateOrderRequest taxTotal(TaxTotal taxTotal) {
    this.taxTotal = taxTotal;
    return this;
  }

  /**
   * Get taxTotal
   * @return taxTotal 
   */
  @JsonProperty(JSON_PROPERTY_TAX_TOTAL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public TaxTotal getTaxTotal() {
    return taxTotal;
  }

  /**
   * taxTotal
   *
   * @param taxTotal 
   */
  @JsonProperty(JSON_PROPERTY_TAX_TOTAL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setTaxTotal(TaxTotal taxTotal) {
    this.taxTotal = taxTotal;
  }

  /**
   * Return true if this PaypalUpdateOrderRequest object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PaypalUpdateOrderRequest paypalUpdateOrderRequest = (PaypalUpdateOrderRequest) o;
    return Objects.equals(this.amount, paypalUpdateOrderRequest.amount) &&
        Objects.equals(this.deliveryMethods, paypalUpdateOrderRequest.deliveryMethods) &&
        Objects.equals(this.paymentData, paypalUpdateOrderRequest.paymentData) &&
        Objects.equals(this.pspReference, paypalUpdateOrderRequest.pspReference) &&
        Objects.equals(this.sessionId, paypalUpdateOrderRequest.sessionId) &&
        Objects.equals(this.taxTotal, paypalUpdateOrderRequest.taxTotal);
  }

  @Override
  public int hashCode() {
    return Objects.hash(amount, deliveryMethods, paymentData, pspReference, sessionId, taxTotal);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PaypalUpdateOrderRequest {\n");
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
    sb.append("    deliveryMethods: ").append(toIndentedString(deliveryMethods)).append("\n");
    sb.append("    paymentData: ").append(toIndentedString(paymentData)).append("\n");
    sb.append("    pspReference: ").append(toIndentedString(pspReference)).append("\n");
    sb.append("    sessionId: ").append(toIndentedString(sessionId)).append("\n");
    sb.append("    taxTotal: ").append(toIndentedString(taxTotal)).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 PaypalUpdateOrderRequest given an JSON string
   *
   * @param jsonString JSON string
   * @return An instance of PaypalUpdateOrderRequest
   * @throws JsonProcessingException if the JSON string is invalid with respect to PaypalUpdateOrderRequest
   */
  public static PaypalUpdateOrderRequest fromJson(String jsonString) throws JsonProcessingException {
    return JSON.getMapper().readValue(jsonString, PaypalUpdateOrderRequest.class);
  }
/**
  * Convert an instance of PaypalUpdateOrderRequest to an JSON string
  *
  * @return JSON string
  */
  public String toJson() throws JsonProcessingException {
    return JSON.getMapper().writeValueAsString(this);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy