org.openapitools.client.model.PaymentsAppliedToResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zuora-sdk-java Show documentation
Show all versions of zuora-sdk-java Show documentation
The SDK of JAVA language for Zuora pricing system
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.BillingDocument;
import org.openapitools.client.model.PaymentAppliedToBillingItemResponse;
import org.openapitools.jackson.nullable.JsonNullable;
import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
* PaymentsAppliedToResponse
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class PaymentsAppliedToResponse {
public static final String SERIALIZED_NAME_BILLING_DOCUMENT_ID = "billing_document_id";
@SerializedName(SERIALIZED_NAME_BILLING_DOCUMENT_ID)
private String billingDocumentId;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_AMOUNT = "amount";
@SerializedName(SERIALIZED_NAME_AMOUNT)
private BigDecimal amount;
public static final String SERIALIZED_NAME_BILLING_DOCUMENT = "billing_document";
@SerializedName(SERIALIZED_NAME_BILLING_DOCUMENT)
private BillingDocument billingDocument;
/**
* The type of billing document. Can be one of the debit memo or invoice.
*/
@JsonAdapter(BillingDocumentTypeEnum.Adapter.class)
public enum BillingDocumentTypeEnum {
DEBIT_MEMO("debit_memo"),
INVOICE("invoice"),
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");
private String value;
BillingDocumentTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static BillingDocumentTypeEnum fromValue(String value) {
for (BillingDocumentTypeEnum b : BillingDocumentTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final BillingDocumentTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public BillingDocumentTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return BillingDocumentTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_BILLING_DOCUMENT_TYPE = "billing_document_type";
@SerializedName(SERIALIZED_NAME_BILLING_DOCUMENT_TYPE)
private BillingDocumentTypeEnum billingDocumentType;
/**
* Gets or Sets state
*/
@JsonAdapter(StateEnum.Adapter.class)
public enum StateEnum {
DRAFT("draft"),
POSTED("posted"),
PROCESSING("processing"),
PROCESSED("processed"),
ERROR("error"),
CANCELED("canceled"),
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");
private String value;
StateEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StateEnum fromValue(String value) {
for (StateEnum b : StateEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StateEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StateEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_STATE = "state";
@SerializedName(SERIALIZED_NAME_STATE)
private StateEnum state;
public static final String SERIALIZED_NAME_ITEMS = "items";
@SerializedName(SERIALIZED_NAME_ITEMS)
private List items = null;
public PaymentsAppliedToResponse() {
}
public PaymentsAppliedToResponse(
StateEnum state
) {
this();
this.state = state;
}
public PaymentsAppliedToResponse billingDocumentId(String billingDocumentId) {
this.billingDocumentId = billingDocumentId;
return this;
}
/**
* Identifier of an invoice or a debit memo.
* @return billingDocumentId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Identifier of an invoice or a debit memo.")
public String getBillingDocumentId() {
return billingDocumentId;
}
public void setBillingDocumentId(String billingDocumentId) {
this.billingDocumentId = billingDocumentId;
}
public PaymentsAppliedToResponse id(String id) {
this.id = id;
return this;
}
/**
* Identifier of the payment application.
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Identifier of the payment application.")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public PaymentsAppliedToResponse amount(BigDecimal amount) {
this.amount = amount;
return this;
}
/**
* The amount of the payment that is applied to the specific billing document item or taxation item.
* @return amount
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The amount of the payment that is applied to the specific billing document item or taxation item.")
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public PaymentsAppliedToResponse billingDocument(BillingDocument billingDocument) {
this.billingDocument = billingDocument;
return this;
}
/**
* The related billing document.
* @return billingDocument
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The related billing document.")
public BillingDocument getBillingDocument() {
return billingDocument;
}
public void setBillingDocument(BillingDocument billingDocument) {
this.billingDocument = billingDocument;
}
public PaymentsAppliedToResponse billingDocumentType(BillingDocumentTypeEnum billingDocumentType) {
this.billingDocumentType = billingDocumentType;
return this;
}
/**
* The type of billing document. Can be one of the debit memo or invoice.
* @return billingDocumentType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The type of billing document. Can be one of the debit memo or invoice.")
public BillingDocumentTypeEnum getBillingDocumentType() {
return billingDocumentType;
}
public void setBillingDocumentType(BillingDocumentTypeEnum billingDocumentType) {
this.billingDocumentType = billingDocumentType;
}
/**
* Get state
* @return state
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public StateEnum getState() {
return state;
}
public PaymentsAppliedToResponse items(List items) {
this.items = items;
return this;
}
public PaymentsAppliedToResponse addItemsItem(PaymentAppliedToBillingItemResponse itemsItem) {
if (this.items == null) {
this.items = new ArrayList();
}
this.items.add(itemsItem);
return this;
}
/**
* The related billing document item.
* @return items
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The related billing document item.")
public List getItems() {
return items;
}
public void setItems(List items) {
this.items = items;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PaymentsAppliedToResponse paymentsAppliedToResponse = (PaymentsAppliedToResponse) o;
return Objects.equals(this.billingDocumentId, paymentsAppliedToResponse.billingDocumentId) &&
Objects.equals(this.id, paymentsAppliedToResponse.id) &&
Objects.equals(this.amount, paymentsAppliedToResponse.amount) &&
Objects.equals(this.billingDocument, paymentsAppliedToResponse.billingDocument) &&
Objects.equals(this.billingDocumentType, paymentsAppliedToResponse.billingDocumentType) &&
Objects.equals(this.state, paymentsAppliedToResponse.state) &&
Objects.equals(this.items, paymentsAppliedToResponse.items);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(billingDocumentId, id, amount, billingDocument, billingDocumentType, state, items);
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PaymentsAppliedToResponse {\n");
sb.append(" billingDocumentId: ").append(toIndentedString(billingDocumentId)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" billingDocument: ").append(toIndentedString(billingDocument)).append("\n");
sb.append(" billingDocumentType: ").append(toIndentedString(billingDocumentType)).append("\n");
sb.append(" state: ").append(toIndentedString(state)).append("\n");
sb.append(" items: ").append(toIndentedString(items)).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 ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy