
com.squareup.connect.models.V1PaymentItemization Maven / Gradle / Ivy
/*
* Square Connect API
* Client library for accessing the Square Connect APIs
*
* OpenAPI spec version: 2.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.squareup.connect.models;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.squareup.connect.models.V1Money;
import com.squareup.connect.models.V1PaymentDiscount;
import com.squareup.connect.models.V1PaymentItemDetail;
import com.squareup.connect.models.V1PaymentModifier;
import com.squareup.connect.models.V1PaymentTax;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* Payment include an` itemizations` field that lists the items purchased, along with associated fees, modifiers, and discounts. Each itemization has an `itemization_type` field that indicates which of the following the itemization represents: <ul> <li>An item variation from the merchant's item library</li> <li>A custom monetary amount</li> <li> An action performed on a Square gift card, such as activating or reloading it. </li> </ul> *Note**: itemization information included in a `Payment` object reflects details collected **at the time of the payment**. Details such as the name or price of items might have changed since the payment was processed.
*/
@ApiModel(description = "Payment include an` itemizations` field that lists the items purchased, along with associated fees, modifiers, and discounts. Each itemization has an `itemization_type` field that indicates which of the following the itemization represents: - An item variation from the merchant's item library
- A custom monetary amount
- An action performed on a Square gift card, such as activating or reloading it.
*Note**: itemization information included in a `Payment` object reflects details collected **at the time of the payment**. Details such as the name or price of items might have changed since the payment was processed.")
public class V1PaymentItemization {
@JsonProperty("name")
private String name = null;
@JsonProperty("quantity")
private BigDecimal quantity = null;
@JsonProperty("itemization_type")
private String itemizationType = null;
@JsonProperty("item_detail")
private V1PaymentItemDetail itemDetail = null;
@JsonProperty("notes")
private String notes = null;
@JsonProperty("item_variation_name")
private String itemVariationName = null;
@JsonProperty("total_money")
private V1Money totalMoney = null;
@JsonProperty("single_quantity_money")
private V1Money singleQuantityMoney = null;
@JsonProperty("gross_sales_money")
private V1Money grossSalesMoney = null;
@JsonProperty("discount_money")
private V1Money discountMoney = null;
@JsonProperty("net_sales_money")
private V1Money netSalesMoney = null;
@JsonProperty("taxes")
private List taxes = new ArrayList();
@JsonProperty("discounts")
private List discounts = new ArrayList();
@JsonProperty("modifiers")
private List modifiers = new ArrayList();
public V1PaymentItemization name(String name) {
this.name = name;
return this;
}
/**
* The item's name.
* @return name
**/
@ApiModelProperty(value = "The item's name.")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public V1PaymentItemization quantity(BigDecimal quantity) {
this.quantity = quantity;
return this;
}
/**
* The quantity of the item purchased. This can be a decimal value.
* @return quantity
**/
@ApiModelProperty(value = "The quantity of the item purchased. This can be a decimal value.")
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public V1PaymentItemization itemizationType(String itemizationType) {
this.itemizationType = itemizationType;
return this;
}
/**
* The type of purchase that the itemization represents, such as an ITEM or CUSTOM_AMOUNT See [V1PaymentItemizationItemizationType](#type-v1paymentitemizationitemizationtype) for possible values
* @return itemizationType
**/
@ApiModelProperty(value = "The type of purchase that the itemization represents, such as an ITEM or CUSTOM_AMOUNT See [V1PaymentItemizationItemizationType](#type-v1paymentitemizationitemizationtype) for possible values")
public String getItemizationType() {
return itemizationType;
}
public void setItemizationType(String itemizationType) {
this.itemizationType = itemizationType;
}
public V1PaymentItemization itemDetail(V1PaymentItemDetail itemDetail) {
this.itemDetail = itemDetail;
return this;
}
/**
* Details of the item, including its unique identifier and the identifier of the item variation purchased.
* @return itemDetail
**/
@ApiModelProperty(value = "Details of the item, including its unique identifier and the identifier of the item variation purchased.")
public V1PaymentItemDetail getItemDetail() {
return itemDetail;
}
public void setItemDetail(V1PaymentItemDetail itemDetail) {
this.itemDetail = itemDetail;
}
public V1PaymentItemization notes(String notes) {
this.notes = notes;
return this;
}
/**
* Notes entered by the merchant about the item at the time of payment, if any.
* @return notes
**/
@ApiModelProperty(value = "Notes entered by the merchant about the item at the time of payment, if any.")
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public V1PaymentItemization itemVariationName(String itemVariationName) {
this.itemVariationName = itemVariationName;
return this;
}
/**
* The name of the item variation purchased, if any.
* @return itemVariationName
**/
@ApiModelProperty(value = "The name of the item variation purchased, if any.")
public String getItemVariationName() {
return itemVariationName;
}
public void setItemVariationName(String itemVariationName) {
this.itemVariationName = itemVariationName;
}
public V1PaymentItemization totalMoney(V1Money totalMoney) {
this.totalMoney = totalMoney;
return this;
}
/**
* The total cost of the item, including all taxes and discounts.
* @return totalMoney
**/
@ApiModelProperty(value = "The total cost of the item, including all taxes and discounts.")
public V1Money getTotalMoney() {
return totalMoney;
}
public void setTotalMoney(V1Money totalMoney) {
this.totalMoney = totalMoney;
}
public V1PaymentItemization singleQuantityMoney(V1Money singleQuantityMoney) {
this.singleQuantityMoney = singleQuantityMoney;
return this;
}
/**
* The cost of a single unit of this item.
* @return singleQuantityMoney
**/
@ApiModelProperty(value = "The cost of a single unit of this item.")
public V1Money getSingleQuantityMoney() {
return singleQuantityMoney;
}
public void setSingleQuantityMoney(V1Money singleQuantityMoney) {
this.singleQuantityMoney = singleQuantityMoney;
}
public V1PaymentItemization grossSalesMoney(V1Money grossSalesMoney) {
this.grossSalesMoney = grossSalesMoney;
return this;
}
/**
* The total cost of the itemization and its modifiers, not including taxes or discounts.
* @return grossSalesMoney
**/
@ApiModelProperty(value = "The total cost of the itemization and its modifiers, not including taxes or discounts.")
public V1Money getGrossSalesMoney() {
return grossSalesMoney;
}
public void setGrossSalesMoney(V1Money grossSalesMoney) {
this.grossSalesMoney = grossSalesMoney;
}
public V1PaymentItemization discountMoney(V1Money discountMoney) {
this.discountMoney = discountMoney;
return this;
}
/**
* The total of all discounts applied to the itemization. This value is always negative or zero.
* @return discountMoney
**/
@ApiModelProperty(value = "The total of all discounts applied to the itemization. This value is always negative or zero.")
public V1Money getDiscountMoney() {
return discountMoney;
}
public void setDiscountMoney(V1Money discountMoney) {
this.discountMoney = discountMoney;
}
public V1PaymentItemization netSalesMoney(V1Money netSalesMoney) {
this.netSalesMoney = netSalesMoney;
return this;
}
/**
* The sum of gross_sales_money and discount_money.
* @return netSalesMoney
**/
@ApiModelProperty(value = "The sum of gross_sales_money and discount_money.")
public V1Money getNetSalesMoney() {
return netSalesMoney;
}
public void setNetSalesMoney(V1Money netSalesMoney) {
this.netSalesMoney = netSalesMoney;
}
public V1PaymentItemization taxes(List taxes) {
this.taxes = taxes;
return this;
}
public V1PaymentItemization addTaxesItem(V1PaymentTax taxesItem) {
this.taxes.add(taxesItem);
return this;
}
/**
* All taxes applied to this itemization.
* @return taxes
**/
@ApiModelProperty(value = "All taxes applied to this itemization.")
public List getTaxes() {
return taxes;
}
public void setTaxes(List taxes) {
this.taxes = taxes;
}
public V1PaymentItemization discounts(List discounts) {
this.discounts = discounts;
return this;
}
public V1PaymentItemization addDiscountsItem(V1PaymentDiscount discountsItem) {
this.discounts.add(discountsItem);
return this;
}
/**
* All discounts applied to this itemization.
* @return discounts
**/
@ApiModelProperty(value = "All discounts applied to this itemization.")
public List getDiscounts() {
return discounts;
}
public void setDiscounts(List discounts) {
this.discounts = discounts;
}
public V1PaymentItemization modifiers(List modifiers) {
this.modifiers = modifiers;
return this;
}
public V1PaymentItemization addModifiersItem(V1PaymentModifier modifiersItem) {
this.modifiers.add(modifiersItem);
return this;
}
/**
* All modifier options applied to this itemization.
* @return modifiers
**/
@ApiModelProperty(value = "All modifier options applied to this itemization.")
public List getModifiers() {
return modifiers;
}
public void setModifiers(List modifiers) {
this.modifiers = modifiers;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1PaymentItemization v1PaymentItemization = (V1PaymentItemization) o;
return Objects.equals(this.name, v1PaymentItemization.name) &&
Objects.equals(this.quantity, v1PaymentItemization.quantity) &&
Objects.equals(this.itemizationType, v1PaymentItemization.itemizationType) &&
Objects.equals(this.itemDetail, v1PaymentItemization.itemDetail) &&
Objects.equals(this.notes, v1PaymentItemization.notes) &&
Objects.equals(this.itemVariationName, v1PaymentItemization.itemVariationName) &&
Objects.equals(this.totalMoney, v1PaymentItemization.totalMoney) &&
Objects.equals(this.singleQuantityMoney, v1PaymentItemization.singleQuantityMoney) &&
Objects.equals(this.grossSalesMoney, v1PaymentItemization.grossSalesMoney) &&
Objects.equals(this.discountMoney, v1PaymentItemization.discountMoney) &&
Objects.equals(this.netSalesMoney, v1PaymentItemization.netSalesMoney) &&
Objects.equals(this.taxes, v1PaymentItemization.taxes) &&
Objects.equals(this.discounts, v1PaymentItemization.discounts) &&
Objects.equals(this.modifiers, v1PaymentItemization.modifiers);
}
@Override
public int hashCode() {
return Objects.hash(name, quantity, itemizationType, itemDetail, notes, itemVariationName, totalMoney, singleQuantityMoney, grossSalesMoney, discountMoney, netSalesMoney, taxes, discounts, modifiers);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1PaymentItemization {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" itemizationType: ").append(toIndentedString(itemizationType)).append("\n");
sb.append(" itemDetail: ").append(toIndentedString(itemDetail)).append("\n");
sb.append(" notes: ").append(toIndentedString(notes)).append("\n");
sb.append(" itemVariationName: ").append(toIndentedString(itemVariationName)).append("\n");
sb.append(" totalMoney: ").append(toIndentedString(totalMoney)).append("\n");
sb.append(" singleQuantityMoney: ").append(toIndentedString(singleQuantityMoney)).append("\n");
sb.append(" grossSalesMoney: ").append(toIndentedString(grossSalesMoney)).append("\n");
sb.append(" discountMoney: ").append(toIndentedString(discountMoney)).append("\n");
sb.append(" netSalesMoney: ").append(toIndentedString(netSalesMoney)).append("\n");
sb.append(" taxes: ").append(toIndentedString(taxes)).append("\n");
sb.append(" discounts: ").append(toIndentedString(discounts)).append("\n");
sb.append(" modifiers: ").append(toIndentedString(modifiers)).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(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy