com.squareup.connect.models.V1Settlement 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 com.squareup.connect.models.V1SettlementEntry;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
/**
* V1Settlement
*/
public class V1Settlement {
@JsonProperty("id")
private String id = null;
/**
* The settlement's current status.
*/
public enum StatusEnum {
FAILED("FAILED"),
SENT("SENT");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String text) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("status")
private StatusEnum status = null;
@JsonProperty("total_money")
private V1Money totalMoney = null;
@JsonProperty("initiated_at")
private String initiatedAt = null;
@JsonProperty("bank_account_id")
private String bankAccountId = null;
@JsonProperty("entries")
private List entries = new ArrayList();
public V1Settlement id(String id) {
this.id = id;
return this;
}
/**
* The settlement's unique identifier.
* @return id
**/
@ApiModelProperty(value = "The settlement's unique identifier.")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public V1Settlement status(StatusEnum status) {
this.status = status;
return this;
}
/**
* The settlement's current status.
* @return status
**/
@ApiModelProperty(value = "The settlement's current status.")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public V1Settlement totalMoney(V1Money totalMoney) {
this.totalMoney = totalMoney;
return this;
}
/**
* The amount of money involved in the settlement. A positive amount indicates a deposit, and a negative amount indicates a withdrawal. This amount is never zero.
* @return totalMoney
**/
@ApiModelProperty(value = "The amount of money involved in the settlement. A positive amount indicates a deposit, and a negative amount indicates a withdrawal. This amount is never zero.")
public V1Money getTotalMoney() {
return totalMoney;
}
public void setTotalMoney(V1Money totalMoney) {
this.totalMoney = totalMoney;
}
public V1Settlement initiatedAt(String initiatedAt) {
this.initiatedAt = initiatedAt;
return this;
}
/**
* The time when the settlement was submitted for deposit or withdrawal, in ISO 8601 format.
* @return initiatedAt
**/
@ApiModelProperty(value = "The time when the settlement was submitted for deposit or withdrawal, in ISO 8601 format.")
public String getInitiatedAt() {
return initiatedAt;
}
public void setInitiatedAt(String initiatedAt) {
this.initiatedAt = initiatedAt;
}
public V1Settlement bankAccountId(String bankAccountId) {
this.bankAccountId = bankAccountId;
return this;
}
/**
* The Square-issued unique identifier for the bank account associated with the settlement.
* @return bankAccountId
**/
@ApiModelProperty(value = "The Square-issued unique identifier for the bank account associated with the settlement.")
public String getBankAccountId() {
return bankAccountId;
}
public void setBankAccountId(String bankAccountId) {
this.bankAccountId = bankAccountId;
}
public V1Settlement entries(List entries) {
this.entries = entries;
return this;
}
public V1Settlement addEntriesItem(V1SettlementEntry entriesItem) {
this.entries.add(entriesItem);
return this;
}
/**
* The entries included in this settlement.
* @return entries
**/
@ApiModelProperty(value = "The entries included in this settlement.")
public List getEntries() {
return entries;
}
public void setEntries(List entries) {
this.entries = entries;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1Settlement v1Settlement = (V1Settlement) o;
return Objects.equals(this.id, v1Settlement.id) &&
Objects.equals(this.status, v1Settlement.status) &&
Objects.equals(this.totalMoney, v1Settlement.totalMoney) &&
Objects.equals(this.initiatedAt, v1Settlement.initiatedAt) &&
Objects.equals(this.bankAccountId, v1Settlement.bankAccountId) &&
Objects.equals(this.entries, v1Settlement.entries);
}
@Override
public int hashCode() {
return Objects.hash(id, status, totalMoney, initiatedAt, bankAccountId, entries);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1Settlement {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" totalMoney: ").append(toIndentedString(totalMoney)).append("\n");
sb.append(" initiatedAt: ").append(toIndentedString(initiatedAt)).append("\n");
sb.append(" bankAccountId: ").append(toIndentedString(bankAccountId)).append("\n");
sb.append(" entries: ").append(toIndentedString(entries)).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 ");
}
}