com.squareup.connect.models.V1Tender Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of connect Show documentation
Show all versions of connect Show documentation
Java client library for the Square Connect API
/*
* 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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* V1Tender
*/
public class V1Tender {
@JsonProperty("id")
private String id = null;
/**
* The type of tender.
*/
public enum TypeEnum {
CREDIT_CARD("CREDIT_CARD"),
CASH("CASH"),
THIRD_PARTY_CARD("THIRD_PARTY_CARD"),
NO_SALE("NO_SALE"),
SQUARE_WALLET("SQUARE_WALLET"),
SQUARE_GIFT_CARD("SQUARE_GIFT_CARD"),
UNKNOWN("UNKNOWN"),
OTHER("OTHER");
private String value;
TypeEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static TypeEnum fromValue(String text) {
for (TypeEnum b : TypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("type")
private TypeEnum type = null;
@JsonProperty("name")
private String name = null;
@JsonProperty("employee_id")
private String employeeId = null;
@JsonProperty("receipt_url")
private String receiptUrl = null;
/**
* The brand of credit card provided.
*/
public enum CardBrandEnum {
OTHER_BRAND("OTHER_BRAND"),
VISA("VISA"),
MASTER_CARD("MASTER_CARD"),
AMERICAN_EXPRESS("AMERICAN_EXPRESS"),
DISCOVER("DISCOVER"),
DISCOVER_DINERS("DISCOVER_DINERS"),
JCB("JCB"),
CHINA_UNIONPAY("CHINA_UNIONPAY"),
SQUARE_GIFT_CARD("SQUARE_GIFT_CARD");
private String value;
CardBrandEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static CardBrandEnum fromValue(String text) {
for (CardBrandEnum b : CardBrandEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("card_brand")
private CardBrandEnum cardBrand = null;
@JsonProperty("pan_suffix")
private String panSuffix = null;
/**
* The tender's unique ID.
*/
public enum EntryMethodEnum {
MANUAL("MANUAL"),
SCANNED("SCANNED"),
SQUARE_CASH("SQUARE_CASH"),
SQUARE_WALLET("SQUARE_WALLET"),
SWIPED("SWIPED"),
WEB_FORM("WEB_FORM"),
OTHER("OTHER");
private String value;
EntryMethodEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EntryMethodEnum fromValue(String text) {
for (EntryMethodEnum b : EntryMethodEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("entry_method")
private EntryMethodEnum entryMethod = null;
@JsonProperty("payment_note")
private String paymentNote = null;
@JsonProperty("total_money")
private V1Money totalMoney = null;
@JsonProperty("tendered_money")
private V1Money tenderedMoney = null;
@JsonProperty("change_back_money")
private V1Money changeBackMoney = null;
@JsonProperty("refunded_money")
private V1Money refundedMoney = null;
@JsonProperty("is_exchange")
private Boolean isExchange = null;
public V1Tender id(String id) {
this.id = id;
return this;
}
/**
* The tender's unique ID.
* @return id
**/
@ApiModelProperty(value = "The tender's unique ID.")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public V1Tender type(TypeEnum type) {
this.type = type;
return this;
}
/**
* The type of tender.
* @return type
**/
@ApiModelProperty(value = "The type of tender.")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
public V1Tender name(String name) {
this.name = name;
return this;
}
/**
* A human-readable description of the tender.
* @return name
**/
@ApiModelProperty(value = "A human-readable description of the tender.")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public V1Tender employeeId(String employeeId) {
this.employeeId = employeeId;
return this;
}
/**
* The ID of the employee that processed the tender.
* @return employeeId
**/
@ApiModelProperty(value = "The ID of the employee that processed the tender.")
public String getEmployeeId() {
return employeeId;
}
public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
public V1Tender receiptUrl(String receiptUrl) {
this.receiptUrl = receiptUrl;
return this;
}
/**
* The URL of the receipt for the tender.
* @return receiptUrl
**/
@ApiModelProperty(value = "The URL of the receipt for the tender.")
public String getReceiptUrl() {
return receiptUrl;
}
public void setReceiptUrl(String receiptUrl) {
this.receiptUrl = receiptUrl;
}
public V1Tender cardBrand(CardBrandEnum cardBrand) {
this.cardBrand = cardBrand;
return this;
}
/**
* The brand of credit card provided.
* @return cardBrand
**/
@ApiModelProperty(value = "The brand of credit card provided.")
public CardBrandEnum getCardBrand() {
return cardBrand;
}
public void setCardBrand(CardBrandEnum cardBrand) {
this.cardBrand = cardBrand;
}
public V1Tender panSuffix(String panSuffix) {
this.panSuffix = panSuffix;
return this;
}
/**
* The last four digits of the provided credit card's account number.
* @return panSuffix
**/
@ApiModelProperty(value = "The last four digits of the provided credit card's account number.")
public String getPanSuffix() {
return panSuffix;
}
public void setPanSuffix(String panSuffix) {
this.panSuffix = panSuffix;
}
public V1Tender entryMethod(EntryMethodEnum entryMethod) {
this.entryMethod = entryMethod;
return this;
}
/**
* The tender's unique ID.
* @return entryMethod
**/
@ApiModelProperty(value = "The tender's unique ID.")
public EntryMethodEnum getEntryMethod() {
return entryMethod;
}
public void setEntryMethod(EntryMethodEnum entryMethod) {
this.entryMethod = entryMethod;
}
public V1Tender paymentNote(String paymentNote) {
this.paymentNote = paymentNote;
return this;
}
/**
* Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER.
* @return paymentNote
**/
@ApiModelProperty(value = "Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER.")
public String getPaymentNote() {
return paymentNote;
}
public void setPaymentNote(String paymentNote) {
this.paymentNote = paymentNote;
}
public V1Tender totalMoney(V1Money totalMoney) {
this.totalMoney = totalMoney;
return this;
}
/**
* The total amount of money provided in this form of tender.
* @return totalMoney
**/
@ApiModelProperty(value = "The total amount of money provided in this form of tender.")
public V1Money getTotalMoney() {
return totalMoney;
}
public void setTotalMoney(V1Money totalMoney) {
this.totalMoney = totalMoney;
}
public V1Tender tenderedMoney(V1Money tenderedMoney) {
this.tenderedMoney = tenderedMoney;
return this;
}
/**
* The amount of total_money applied to the payment.
* @return tenderedMoney
**/
@ApiModelProperty(value = "The amount of total_money applied to the payment.")
public V1Money getTenderedMoney() {
return tenderedMoney;
}
public void setTenderedMoney(V1Money tenderedMoney) {
this.tenderedMoney = tenderedMoney;
}
public V1Tender changeBackMoney(V1Money changeBackMoney) {
this.changeBackMoney = changeBackMoney;
return this;
}
/**
* The amount of total_money returned to the buyer as change.
* @return changeBackMoney
**/
@ApiModelProperty(value = "The amount of total_money returned to the buyer as change.")
public V1Money getChangeBackMoney() {
return changeBackMoney;
}
public void setChangeBackMoney(V1Money changeBackMoney) {
this.changeBackMoney = changeBackMoney;
}
public V1Tender refundedMoney(V1Money refundedMoney) {
this.refundedMoney = refundedMoney;
return this;
}
/**
* The total of all refunds applied to this tender. This amount is always negative or zero.
* @return refundedMoney
**/
@ApiModelProperty(value = "The total of all refunds applied to this tender. This amount is always negative or zero.")
public V1Money getRefundedMoney() {
return refundedMoney;
}
public void setRefundedMoney(V1Money refundedMoney) {
this.refundedMoney = refundedMoney;
}
public V1Tender isExchange(Boolean isExchange) {
this.isExchange = isExchange;
return this;
}
/**
* Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange.
* @return isExchange
**/
@ApiModelProperty(value = "Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange.")
public Boolean getIsExchange() {
return isExchange;
}
public void setIsExchange(Boolean isExchange) {
this.isExchange = isExchange;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1Tender v1Tender = (V1Tender) o;
return Objects.equals(this.id, v1Tender.id) &&
Objects.equals(this.type, v1Tender.type) &&
Objects.equals(this.name, v1Tender.name) &&
Objects.equals(this.employeeId, v1Tender.employeeId) &&
Objects.equals(this.receiptUrl, v1Tender.receiptUrl) &&
Objects.equals(this.cardBrand, v1Tender.cardBrand) &&
Objects.equals(this.panSuffix, v1Tender.panSuffix) &&
Objects.equals(this.entryMethod, v1Tender.entryMethod) &&
Objects.equals(this.paymentNote, v1Tender.paymentNote) &&
Objects.equals(this.totalMoney, v1Tender.totalMoney) &&
Objects.equals(this.tenderedMoney, v1Tender.tenderedMoney) &&
Objects.equals(this.changeBackMoney, v1Tender.changeBackMoney) &&
Objects.equals(this.refundedMoney, v1Tender.refundedMoney) &&
Objects.equals(this.isExchange, v1Tender.isExchange);
}
@Override
public int hashCode() {
return Objects.hash(id, type, name, employeeId, receiptUrl, cardBrand, panSuffix, entryMethod, paymentNote, totalMoney, tenderedMoney, changeBackMoney, refundedMoney, isExchange);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1Tender {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" employeeId: ").append(toIndentedString(employeeId)).append("\n");
sb.append(" receiptUrl: ").append(toIndentedString(receiptUrl)).append("\n");
sb.append(" cardBrand: ").append(toIndentedString(cardBrand)).append("\n");
sb.append(" panSuffix: ").append(toIndentedString(panSuffix)).append("\n");
sb.append(" entryMethod: ").append(toIndentedString(entryMethod)).append("\n");
sb.append(" paymentNote: ").append(toIndentedString(paymentNote)).append("\n");
sb.append(" totalMoney: ").append(toIndentedString(totalMoney)).append("\n");
sb.append(" tenderedMoney: ").append(toIndentedString(tenderedMoney)).append("\n");
sb.append(" changeBackMoney: ").append(toIndentedString(changeBackMoney)).append("\n");
sb.append(" refundedMoney: ").append(toIndentedString(refundedMoney)).append("\n");
sb.append(" isExchange: ").append(toIndentedString(isExchange)).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 ");
}
}