com.conekta.model.OrderRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ct-conekta-java Show documentation
Show all versions of ct-conekta-java Show documentation
This is a java library that allows interaction with https://api.conekta.io API.
The newest version!
/*
* Conekta API
* Conekta sdk
*
* The version of the OpenAPI document: 2.1.0
* Contact: [email protected]
*
* 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.conekta.model;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.conekta.model.ChargeRequest;
import com.conekta.model.CheckoutRequest;
import com.conekta.model.CustomerShippingContacts;
import com.conekta.model.OrderDiscountLinesRequest;
import com.conekta.model.OrderFiscalEntityRequest;
import com.conekta.model.OrderRequestCustomerInfo;
import com.conekta.model.OrderTaxRequest;
import com.conekta.model.Product;
import com.conekta.model.ShippingRequest;
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.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.conekta.JSON;
/**
* a order
*/
@JsonPropertyOrder({
OrderRequest.JSON_PROPERTY_CHARGES,
OrderRequest.JSON_PROPERTY_CHECKOUT,
OrderRequest.JSON_PROPERTY_CURRENCY,
OrderRequest.JSON_PROPERTY_CUSTOMER_INFO,
OrderRequest.JSON_PROPERTY_DISCOUNT_LINES,
OrderRequest.JSON_PROPERTY_FISCAL_ENTITY,
OrderRequest.JSON_PROPERTY_LINE_ITEMS,
OrderRequest.JSON_PROPERTY_METADATA,
OrderRequest.JSON_PROPERTY_NEEDS_SHIPPING_CONTACT,
OrderRequest.JSON_PROPERTY_PRE_AUTHORIZE,
OrderRequest.JSON_PROPERTY_PROCESSING_MODE,
OrderRequest.JSON_PROPERTY_RETURN_URL,
OrderRequest.JSON_PROPERTY_SHIPPING_CONTACT,
OrderRequest.JSON_PROPERTY_SHIPPING_LINES,
OrderRequest.JSON_PROPERTY_TAX_LINES,
OrderRequest.JSON_PROPERTY_THREE_DS_MODE
})
@JsonTypeName("order_request")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
public class OrderRequest {
public static final String JSON_PROPERTY_CHARGES = "charges";
private List charges = new ArrayList<>();
public static final String JSON_PROPERTY_CHECKOUT = "checkout";
private CheckoutRequest checkout;
public static final String JSON_PROPERTY_CURRENCY = "currency";
private String currency;
public static final String JSON_PROPERTY_CUSTOMER_INFO = "customer_info";
private OrderRequestCustomerInfo customerInfo;
public static final String JSON_PROPERTY_DISCOUNT_LINES = "discount_lines";
private List discountLines = new ArrayList<>();
public static final String JSON_PROPERTY_FISCAL_ENTITY = "fiscal_entity";
private OrderFiscalEntityRequest fiscalEntity;
public static final String JSON_PROPERTY_LINE_ITEMS = "line_items";
private List lineItems = new ArrayList<>();
public static final String JSON_PROPERTY_METADATA = "metadata";
private Map metadata = new HashMap<>();
public static final String JSON_PROPERTY_NEEDS_SHIPPING_CONTACT = "needs_shipping_contact";
private Boolean needsShippingContact;
public static final String JSON_PROPERTY_PRE_AUTHORIZE = "pre_authorize";
private Boolean preAuthorize = false;
public static final String JSON_PROPERTY_PROCESSING_MODE = "processing_mode";
private String processingMode;
public static final String JSON_PROPERTY_RETURN_URL = "return_url";
private URI returnUrl;
public static final String JSON_PROPERTY_SHIPPING_CONTACT = "shipping_contact";
private CustomerShippingContacts shippingContact;
public static final String JSON_PROPERTY_SHIPPING_LINES = "shipping_lines";
private List shippingLines = new ArrayList<>();
public static final String JSON_PROPERTY_TAX_LINES = "tax_lines";
private List taxLines = new ArrayList<>();
public static final String JSON_PROPERTY_THREE_DS_MODE = "three_ds_mode";
private String threeDsMode;
public OrderRequest() {
}
public OrderRequest charges(List charges) {
this.charges = charges;
return this;
}
public OrderRequest addChargesItem(ChargeRequest chargesItem) {
if (this.charges == null) {
this.charges = new ArrayList<>();
}
this.charges.add(chargesItem);
return this;
}
/**
* List of [charges](https://developers.conekta.com/v2.1.0/reference/orderscreatecharge) that are applied to the order
* @return charges
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CHARGES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getCharges() {
return charges;
}
@JsonProperty(JSON_PROPERTY_CHARGES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setCharges(List charges) {
this.charges = charges;
}
public OrderRequest checkout(CheckoutRequest checkout) {
this.checkout = checkout;
return this;
}
/**
* Get checkout
* @return checkout
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CHECKOUT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CheckoutRequest getCheckout() {
return checkout;
}
@JsonProperty(JSON_PROPERTY_CHECKOUT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setCheckout(CheckoutRequest checkout) {
this.checkout = checkout;
}
public OrderRequest currency(String currency) {
this.currency = currency;
return this;
}
/**
* Currency with which the payment will be made. It uses the 3-letter code of the [International Standard ISO 4217.](https://es.wikipedia.org/wiki/ISO_4217)
* @return currency
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_CURRENCY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getCurrency() {
return currency;
}
@JsonProperty(JSON_PROPERTY_CURRENCY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setCurrency(String currency) {
this.currency = currency;
}
public OrderRequest customerInfo(OrderRequestCustomerInfo customerInfo) {
this.customerInfo = customerInfo;
return this;
}
/**
* Get customerInfo
* @return customerInfo
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_CUSTOMER_INFO)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public OrderRequestCustomerInfo getCustomerInfo() {
return customerInfo;
}
@JsonProperty(JSON_PROPERTY_CUSTOMER_INFO)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setCustomerInfo(OrderRequestCustomerInfo customerInfo) {
this.customerInfo = customerInfo;
}
public OrderRequest discountLines(List discountLines) {
this.discountLines = discountLines;
return this;
}
public OrderRequest addDiscountLinesItem(OrderDiscountLinesRequest discountLinesItem) {
if (this.discountLines == null) {
this.discountLines = new ArrayList<>();
}
this.discountLines.add(discountLinesItem);
return this;
}
/**
* List of [discounts](https://developers.conekta.com/v2.1.0/reference/orderscreatediscountline) that are applied to the order. You must have at least one discount.
* @return discountLines
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DISCOUNT_LINES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getDiscountLines() {
return discountLines;
}
@JsonProperty(JSON_PROPERTY_DISCOUNT_LINES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDiscountLines(List discountLines) {
this.discountLines = discountLines;
}
public OrderRequest fiscalEntity(OrderFiscalEntityRequest fiscalEntity) {
this.fiscalEntity = fiscalEntity;
return this;
}
/**
* Get fiscalEntity
* @return fiscalEntity
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_FISCAL_ENTITY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public OrderFiscalEntityRequest getFiscalEntity() {
return fiscalEntity;
}
@JsonProperty(JSON_PROPERTY_FISCAL_ENTITY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setFiscalEntity(OrderFiscalEntityRequest fiscalEntity) {
this.fiscalEntity = fiscalEntity;
}
public OrderRequest lineItems(List lineItems) {
this.lineItems = lineItems;
return this;
}
public OrderRequest addLineItemsItem(Product lineItemsItem) {
if (this.lineItems == null) {
this.lineItems = new ArrayList<>();
}
this.lineItems.add(lineItemsItem);
return this;
}
/**
* List of [products](https://developers.conekta.com/v2.1.0/reference/orderscreateproduct) that are sold in the order. You must have at least one product.
* @return lineItems
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_LINE_ITEMS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getLineItems() {
return lineItems;
}
@JsonProperty(JSON_PROPERTY_LINE_ITEMS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setLineItems(List lineItems) {
this.lineItems = lineItems;
}
public OrderRequest metadata(Map metadata) {
this.metadata = metadata;
return this;
}
public OrderRequest putMetadataItem(String key, Object metadataItem) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.put(key, metadataItem);
return this;
}
/**
* Metadata associated with the order
* @return metadata
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_METADATA)
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
public Map getMetadata() {
return metadata;
}
@JsonProperty(JSON_PROPERTY_METADATA)
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
public void setMetadata(Map metadata) {
this.metadata = metadata;
}
public OrderRequest needsShippingContact(Boolean needsShippingContact) {
this.needsShippingContact = needsShippingContact;
return this;
}
/**
* Allows you to fill out the shipping information at checkout
* @return needsShippingContact
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NEEDS_SHIPPING_CONTACT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getNeedsShippingContact() {
return needsShippingContact;
}
@JsonProperty(JSON_PROPERTY_NEEDS_SHIPPING_CONTACT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setNeedsShippingContact(Boolean needsShippingContact) {
this.needsShippingContact = needsShippingContact;
}
public OrderRequest preAuthorize(Boolean preAuthorize) {
this.preAuthorize = preAuthorize;
return this;
}
/**
* Indicates whether the order charges must be preauthorized
* @return preAuthorize
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_PRE_AUTHORIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getPreAuthorize() {
return preAuthorize;
}
@JsonProperty(JSON_PROPERTY_PRE_AUTHORIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPreAuthorize(Boolean preAuthorize) {
this.preAuthorize = preAuthorize;
}
public OrderRequest processingMode(String processingMode) {
this.processingMode = processingMode;
return this;
}
/**
* Indicates the processing mode for the order, either ecommerce, recurrent or validation.
* @return processingMode
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_PROCESSING_MODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getProcessingMode() {
return processingMode;
}
@JsonProperty(JSON_PROPERTY_PROCESSING_MODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setProcessingMode(String processingMode) {
this.processingMode = processingMode;
}
public OrderRequest returnUrl(URI returnUrl) {
this.returnUrl = returnUrl;
return this;
}
/**
* Indicates the redirection callback upon completion of the 3DS2 flow. Do not use this parameter if your order has a checkout parameter
* @return returnUrl
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RETURN_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public URI getReturnUrl() {
return returnUrl;
}
@JsonProperty(JSON_PROPERTY_RETURN_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setReturnUrl(URI returnUrl) {
this.returnUrl = returnUrl;
}
public OrderRequest shippingContact(CustomerShippingContacts shippingContact) {
this.shippingContact = shippingContact;
return this;
}
/**
* Get shippingContact
* @return shippingContact
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SHIPPING_CONTACT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CustomerShippingContacts getShippingContact() {
return shippingContact;
}
@JsonProperty(JSON_PROPERTY_SHIPPING_CONTACT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setShippingContact(CustomerShippingContacts shippingContact) {
this.shippingContact = shippingContact;
}
public OrderRequest shippingLines(List shippingLines) {
this.shippingLines = shippingLines;
return this;
}
public OrderRequest addShippingLinesItem(ShippingRequest shippingLinesItem) {
if (this.shippingLines == null) {
this.shippingLines = new ArrayList<>();
}
this.shippingLines.add(shippingLinesItem);
return this;
}
/**
* List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products.
* @return shippingLines
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SHIPPING_LINES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getShippingLines() {
return shippingLines;
}
@JsonProperty(JSON_PROPERTY_SHIPPING_LINES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setShippingLines(List shippingLines) {
this.shippingLines = shippingLines;
}
public OrderRequest taxLines(List taxLines) {
this.taxLines = taxLines;
return this;
}
public OrderRequest addTaxLinesItem(OrderTaxRequest taxLinesItem) {
if (this.taxLines == null) {
this.taxLines = new ArrayList<>();
}
this.taxLines.add(taxLinesItem);
return this;
}
/**
* List of [taxes](https://developers.conekta.com/v2.1.0/reference/orderscreatetaxes) that are applied to the order.
* @return taxLines
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAX_LINES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getTaxLines() {
return taxLines;
}
@JsonProperty(JSON_PROPERTY_TAX_LINES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setTaxLines(List taxLines) {
this.taxLines = taxLines;
}
public OrderRequest threeDsMode(String threeDsMode) {
this.threeDsMode = threeDsMode;
return this;
}
/**
* Indicates the 3DS2 mode for the order, either smart or strict.
* @return threeDsMode
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_THREE_DS_MODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getThreeDsMode() {
return threeDsMode;
}
@JsonProperty(JSON_PROPERTY_THREE_DS_MODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setThreeDsMode(String threeDsMode) {
this.threeDsMode = threeDsMode;
}
/**
* Return true if this order_request object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrderRequest orderRequest = (OrderRequest) o;
return Objects.equals(this.charges, orderRequest.charges) &&
Objects.equals(this.checkout, orderRequest.checkout) &&
Objects.equals(this.currency, orderRequest.currency) &&
Objects.equals(this.customerInfo, orderRequest.customerInfo) &&
Objects.equals(this.discountLines, orderRequest.discountLines) &&
Objects.equals(this.fiscalEntity, orderRequest.fiscalEntity) &&
Objects.equals(this.lineItems, orderRequest.lineItems) &&
Objects.equals(this.metadata, orderRequest.metadata) &&
Objects.equals(this.needsShippingContact, orderRequest.needsShippingContact) &&
Objects.equals(this.preAuthorize, orderRequest.preAuthorize) &&
Objects.equals(this.processingMode, orderRequest.processingMode) &&
Objects.equals(this.returnUrl, orderRequest.returnUrl) &&
Objects.equals(this.shippingContact, orderRequest.shippingContact) &&
Objects.equals(this.shippingLines, orderRequest.shippingLines) &&
Objects.equals(this.taxLines, orderRequest.taxLines) &&
Objects.equals(this.threeDsMode, orderRequest.threeDsMode);
}
@Override
public int hashCode() {
return Objects.hash(charges, checkout, currency, customerInfo, discountLines, fiscalEntity, lineItems, metadata, needsShippingContact, preAuthorize, processingMode, returnUrl, shippingContact, shippingLines, taxLines, threeDsMode);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrderRequest {\n");
sb.append(" charges: ").append(toIndentedString(charges)).append("\n");
sb.append(" checkout: ").append(toIndentedString(checkout)).append("\n");
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
sb.append(" customerInfo: ").append(toIndentedString(customerInfo)).append("\n");
sb.append(" discountLines: ").append(toIndentedString(discountLines)).append("\n");
sb.append(" fiscalEntity: ").append(toIndentedString(fiscalEntity)).append("\n");
sb.append(" lineItems: ").append(toIndentedString(lineItems)).append("\n");
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
sb.append(" needsShippingContact: ").append(toIndentedString(needsShippingContact)).append("\n");
sb.append(" preAuthorize: ").append(toIndentedString(preAuthorize)).append("\n");
sb.append(" processingMode: ").append(toIndentedString(processingMode)).append("\n");
sb.append(" returnUrl: ").append(toIndentedString(returnUrl)).append("\n");
sb.append(" shippingContact: ").append(toIndentedString(shippingContact)).append("\n");
sb.append(" shippingLines: ").append(toIndentedString(shippingLines)).append("\n");
sb.append(" taxLines: ").append(toIndentedString(taxLines)).append("\n");
sb.append(" threeDsMode: ").append(toIndentedString(threeDsMode)).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 ");
}
}