
com.adyen.model.checkout.CreateOrderRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of adyen-java-api-library Show documentation
Show all versions of adyen-java-api-library Show documentation
Adyen API Client Library for Java
/*
* 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.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.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
/**
* CreateOrderRequest
*/
@JsonPropertyOrder({
CreateOrderRequest.JSON_PROPERTY_AMOUNT,
CreateOrderRequest.JSON_PROPERTY_EXPIRES_AT,
CreateOrderRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
CreateOrderRequest.JSON_PROPERTY_REFERENCE
})
public class CreateOrderRequest {
public static final String JSON_PROPERTY_AMOUNT = "amount";
private Amount amount;
public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt";
private String expiresAt;
public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount";
private String merchantAccount;
public static final String JSON_PROPERTY_REFERENCE = "reference";
private String reference;
public CreateOrderRequest() {
}
/**
* amount
*
* @param amount
* @return the current {@code CreateOrderRequest} instance, allowing for method chaining
*/
public CreateOrderRequest 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 date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.
*
* @param expiresAt The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.
* @return the current {@code CreateOrderRequest} instance, allowing for method chaining
*/
public CreateOrderRequest expiresAt(String expiresAt) {
this.expiresAt = expiresAt;
return this;
}
/**
* The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.
* @return expiresAt The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.
*/
@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getExpiresAt() {
return expiresAt;
}
/**
* The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.
*
* @param expiresAt The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.
*/
@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setExpiresAt(String expiresAt) {
this.expiresAt = expiresAt;
}
/**
* The merchant account identifier, with which you want to process the order.
*
* @param merchantAccount The merchant account identifier, with which you want to process the order.
* @return the current {@code CreateOrderRequest} instance, allowing for method chaining
*/
public CreateOrderRequest merchantAccount(String merchantAccount) {
this.merchantAccount = merchantAccount;
return this;
}
/**
* The merchant account identifier, with which you want to process the order.
* @return merchantAccount The merchant account identifier, with which you want to process the order.
*/
@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 order.
*
* @param merchantAccount The merchant account identifier, with which you want to process the order.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMerchantAccount(String merchantAccount) {
this.merchantAccount = merchantAccount;
}
/**
* A custom reference identifying the order.
*
* @param reference A custom reference identifying the order.
* @return the current {@code CreateOrderRequest} instance, allowing for method chaining
*/
public CreateOrderRequest reference(String reference) {
this.reference = reference;
return this;
}
/**
* A custom reference identifying the order.
* @return reference A custom reference identifying the order.
*/
@JsonProperty(JSON_PROPERTY_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getReference() {
return reference;
}
/**
* A custom reference identifying the order.
*
* @param reference A custom reference identifying the order.
*/
@JsonProperty(JSON_PROPERTY_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setReference(String reference) {
this.reference = reference;
}
/**
* Return true if this CreateOrderRequest object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateOrderRequest createOrderRequest = (CreateOrderRequest) o;
return Objects.equals(this.amount, createOrderRequest.amount) &&
Objects.equals(this.expiresAt, createOrderRequest.expiresAt) &&
Objects.equals(this.merchantAccount, createOrderRequest.merchantAccount) &&
Objects.equals(this.reference, createOrderRequest.reference);
}
@Override
public int hashCode() {
return Objects.hash(amount, expiresAt, merchantAccount, reference);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateOrderRequest {\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).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 CreateOrderRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateOrderRequest
* @throws JsonProcessingException if the JSON string is invalid with respect to CreateOrderRequest
*/
public static CreateOrderRequest fromJson(String jsonString) throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, CreateOrderRequest.class);
}
/**
* Convert an instance of CreateOrderRequest to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy