com.zuora.model.ExpandedDebitMemo 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
/*
* Zuora API Reference
* REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
*
* The version of the OpenAPI document: 2024-05-20
* 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.zuora.model;
import java.util.Objects;
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 com.zuora.model.ExpandedAccount;
import com.zuora.model.ExpandedContact;
import com.zuora.model.ExpandedDebitMemoItem;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.zuora.JSON;
/**
* ExpandedDebitMemo
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class ExpandedDebitMemo {
public static final String SERIALIZED_NAME_AUTO_PAY = "autoPay";
@SerializedName(SERIALIZED_NAME_AUTO_PAY)
private Boolean autoPay;
public static final String SERIALIZED_NAME_BALANCE = "balance";
@SerializedName(SERIALIZED_NAME_BALANCE)
private BigDecimal balance;
public static final String SERIALIZED_NAME_BILL_TO_CONTACT_ID = "billToContactId";
@SerializedName(SERIALIZED_NAME_BILL_TO_CONTACT_ID)
private String billToContactId;
public static final String SERIALIZED_NAME_BILL_TO_CONTACT_SNAPSHOT_ID = "billToContactSnapshotId";
@SerializedName(SERIALIZED_NAME_BILL_TO_CONTACT_SNAPSHOT_ID)
private String billToContactSnapshotId;
public static final String SERIALIZED_NAME_CANCELLED_BY_ID = "cancelledById";
@SerializedName(SERIALIZED_NAME_CANCELLED_BY_ID)
private String cancelledById;
public static final String SERIALIZED_NAME_CANCELLED_ON = "cancelledOn";
@SerializedName(SERIALIZED_NAME_CANCELLED_ON)
private String cancelledOn;
public static final String SERIALIZED_NAME_COMMENTS = "comments";
@SerializedName(SERIALIZED_NAME_COMMENTS)
private String comments;
public static final String SERIALIZED_NAME_CREDIT_MEMO_ID = "creditMemoId";
@SerializedName(SERIALIZED_NAME_CREDIT_MEMO_ID)
private String creditMemoId;
public static final String SERIALIZED_NAME_CURRENCY = "currency";
@SerializedName(SERIALIZED_NAME_CURRENCY)
private String currency;
public static final String SERIALIZED_NAME_DISCOUNT_AMOUNT = "discountAmount";
@SerializedName(SERIALIZED_NAME_DISCOUNT_AMOUNT)
private BigDecimal discountAmount;
public static final String SERIALIZED_NAME_DUE_DATE = "dueDate";
@SerializedName(SERIALIZED_NAME_DUE_DATE)
private LocalDate dueDate;
public static final String SERIALIZED_NAME_E_INVOICE_STATUS = "eInvoiceStatus";
@SerializedName(SERIALIZED_NAME_E_INVOICE_STATUS)
private String eInvoiceStatus;
public static final String SERIALIZED_NAME_E_INVOICE_FILE_ID = "eInvoiceFileId";
@SerializedName(SERIALIZED_NAME_E_INVOICE_FILE_ID)
private String eInvoiceFileId;
public static final String SERIALIZED_NAME_E_INVOICE_ERROR_CODE = "eInvoiceErrorCode";
@SerializedName(SERIALIZED_NAME_E_INVOICE_ERROR_CODE)
private String eInvoiceErrorCode;
public static final String SERIALIZED_NAME_E_INVOICE_ERROR_MESSAGE = "eInvoiceErrorMessage";
@SerializedName(SERIALIZED_NAME_E_INVOICE_ERROR_MESSAGE)
private String eInvoiceErrorMessage;
public static final String SERIALIZED_NAME_EXCHANGE_RATE_DATE = "exchangeRateDate";
@SerializedName(SERIALIZED_NAME_EXCHANGE_RATE_DATE)
private LocalDate exchangeRateDate;
public static final String SERIALIZED_NAME_INVOICE_GROUP_NUMBER = "invoiceGroupNumber";
@SerializedName(SERIALIZED_NAME_INVOICE_GROUP_NUMBER)
private String invoiceGroupNumber;
public static final String SERIALIZED_NAME_MEMO_DATE = "memoDate";
@SerializedName(SERIALIZED_NAME_MEMO_DATE)
private LocalDate memoDate;
public static final String SERIALIZED_NAME_MEMO_NUMBER = "memoNumber";
@SerializedName(SERIALIZED_NAME_MEMO_NUMBER)
private String memoNumber;
public static final String SERIALIZED_NAME_POSTED_BY_ID = "postedById";
@SerializedName(SERIALIZED_NAME_POSTED_BY_ID)
private String postedById;
public static final String SERIALIZED_NAME_POSTED_ON = "postedOn";
@SerializedName(SERIALIZED_NAME_POSTED_ON)
private String postedOn;
public static final String SERIALIZED_NAME_REASON_CODE = "reasonCode";
@SerializedName(SERIALIZED_NAME_REASON_CODE)
private String reasonCode;
public static final String SERIALIZED_NAME_REFERRED_DEBIT_MEMO_ID = "referredDebitMemoId";
@SerializedName(SERIALIZED_NAME_REFERRED_DEBIT_MEMO_ID)
private String referredDebitMemoId;
public static final String SERIALIZED_NAME_SEQUENCE_SET_ID = "sequenceSetId";
@SerializedName(SERIALIZED_NAME_SEQUENCE_SET_ID)
private String sequenceSetId;
public static final String SERIALIZED_NAME_SOLD_TO_CONTACT_SNAPSHOT_ID = "soldToContactSnapshotId";
@SerializedName(SERIALIZED_NAME_SOLD_TO_CONTACT_SNAPSHOT_ID)
private String soldToContactSnapshotId;
public static final String SERIALIZED_NAME_SOURCE = "source";
@SerializedName(SERIALIZED_NAME_SOURCE)
private String source;
public static final String SERIALIZED_NAME_SOURCE_TYPE = "sourceType";
@SerializedName(SERIALIZED_NAME_SOURCE_TYPE)
private String sourceType;
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private String status;
public static final String SERIALIZED_NAME_TARGET_DATE = "targetDate";
@SerializedName(SERIALIZED_NAME_TARGET_DATE)
private LocalDate targetDate;
public static final String SERIALIZED_NAME_TAX_AMOUNT = "taxAmount";
@SerializedName(SERIALIZED_NAME_TAX_AMOUNT)
private BigDecimal taxAmount;
public static final String SERIALIZED_NAME_TAX_AUTO_CALCULATION = "taxAutoCalculation";
@SerializedName(SERIALIZED_NAME_TAX_AUTO_CALCULATION)
private Boolean taxAutoCalculation;
public static final String SERIALIZED_NAME_TAX_MESSAGE = "taxMessage";
@SerializedName(SERIALIZED_NAME_TAX_MESSAGE)
private String taxMessage;
public static final String SERIALIZED_NAME_TAX_STATUS = "taxStatus";
@SerializedName(SERIALIZED_NAME_TAX_STATUS)
private String taxStatus;
public static final String SERIALIZED_NAME_TOTAL_AMOUNT = "totalAmount";
@SerializedName(SERIALIZED_NAME_TOTAL_AMOUNT)
private BigDecimal totalAmount;
public static final String SERIALIZED_NAME_TOTAL_AMOUNT_WITHOUT_TAX = "totalAmountWithoutTax";
@SerializedName(SERIALIZED_NAME_TOTAL_AMOUNT_WITHOUT_TAX)
private BigDecimal totalAmountWithoutTax;
public static final String SERIALIZED_NAME_TOTAL_TAX_EXEMPT_AMOUNT = "totalTaxExemptAmount";
@SerializedName(SERIALIZED_NAME_TOTAL_TAX_EXEMPT_AMOUNT)
private BigDecimal totalTaxExemptAmount;
public static final String SERIALIZED_NAME_TRANSFERRED_TO_ACCOUNTING = "transferredToAccounting";
@SerializedName(SERIALIZED_NAME_TRANSFERRED_TO_ACCOUNTING)
private String transferredToAccounting;
public static final String SERIALIZED_NAME_INVOICE_ID = "invoiceId";
@SerializedName(SERIALIZED_NAME_INVOICE_ID)
private String invoiceId;
public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId";
@SerializedName(SERIALIZED_NAME_ACCOUNT_ID)
private String accountId;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_CREATED_BY_ID = "createdById";
@SerializedName(SERIALIZED_NAME_CREATED_BY_ID)
private String createdById;
public static final String SERIALIZED_NAME_CREATED_DATE = "createdDate";
@SerializedName(SERIALIZED_NAME_CREATED_DATE)
private String createdDate;
public static final String SERIALIZED_NAME_UPDATED_BY_ID = "updatedById";
@SerializedName(SERIALIZED_NAME_UPDATED_BY_ID)
private String updatedById;
public static final String SERIALIZED_NAME_UPDATED_DATE = "updatedDate";
@SerializedName(SERIALIZED_NAME_UPDATED_DATE)
private String updatedDate;
public static final String SERIALIZED_NAME_PAYMENT_TERM = "paymentTerm";
@SerializedName(SERIALIZED_NAME_PAYMENT_TERM)
private String paymentTerm;
public static final String SERIALIZED_NAME_ACCOUNT = "account";
@SerializedName(SERIALIZED_NAME_ACCOUNT)
private ExpandedAccount account;
public static final String SERIALIZED_NAME_BILL_TO_CONTACT = "billToContact";
@SerializedName(SERIALIZED_NAME_BILL_TO_CONTACT)
private ExpandedContact billToContact;
public static final String SERIALIZED_NAME_DEBIT_MEMO_ITEMS = "debitMemoItems";
@SerializedName(SERIALIZED_NAME_DEBIT_MEMO_ITEMS)
private List debitMemoItems;
public ExpandedDebitMemo() {
}
public ExpandedDebitMemo autoPay(Boolean autoPay) {
this.autoPay = autoPay;
return this;
}
/**
* Get autoPay
* @return autoPay
*/
@javax.annotation.Nullable
public Boolean getAutoPay() {
return autoPay;
}
public void setAutoPay(Boolean autoPay) {
this.autoPay = autoPay;
}
public ExpandedDebitMemo balance(BigDecimal balance) {
this.balance = balance;
return this;
}
/**
* Get balance
* @return balance
*/
@javax.annotation.Nullable
public BigDecimal getBalance() {
return balance;
}
public void setBalance(BigDecimal balance) {
this.balance = balance;
}
public ExpandedDebitMemo billToContactId(String billToContactId) {
this.billToContactId = billToContactId;
return this;
}
/**
* Get billToContactId
* @return billToContactId
*/
@javax.annotation.Nullable
public String getBillToContactId() {
return billToContactId;
}
public void setBillToContactId(String billToContactId) {
this.billToContactId = billToContactId;
}
public ExpandedDebitMemo billToContactSnapshotId(String billToContactSnapshotId) {
this.billToContactSnapshotId = billToContactSnapshotId;
return this;
}
/**
* Get billToContactSnapshotId
* @return billToContactSnapshotId
*/
@javax.annotation.Nullable
public String getBillToContactSnapshotId() {
return billToContactSnapshotId;
}
public void setBillToContactSnapshotId(String billToContactSnapshotId) {
this.billToContactSnapshotId = billToContactSnapshotId;
}
public ExpandedDebitMemo cancelledById(String cancelledById) {
this.cancelledById = cancelledById;
return this;
}
/**
* Get cancelledById
* @return cancelledById
*/
@javax.annotation.Nullable
public String getCancelledById() {
return cancelledById;
}
public void setCancelledById(String cancelledById) {
this.cancelledById = cancelledById;
}
public ExpandedDebitMemo cancelledOn(String cancelledOn) {
this.cancelledOn = cancelledOn;
return this;
}
/**
* Get cancelledOn
* @return cancelledOn
*/
@javax.annotation.Nullable
public String getCancelledOn() {
return cancelledOn;
}
public void setCancelledOn(String cancelledOn) {
this.cancelledOn = cancelledOn;
}
public ExpandedDebitMemo comments(String comments) {
this.comments = comments;
return this;
}
/**
* Get comments
* @return comments
*/
@javax.annotation.Nullable
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public ExpandedDebitMemo creditMemoId(String creditMemoId) {
this.creditMemoId = creditMemoId;
return this;
}
/**
* Get creditMemoId
* @return creditMemoId
*/
@javax.annotation.Nullable
public String getCreditMemoId() {
return creditMemoId;
}
public void setCreditMemoId(String creditMemoId) {
this.creditMemoId = creditMemoId;
}
public ExpandedDebitMemo currency(String currency) {
this.currency = currency;
return this;
}
/**
* Get currency
* @return currency
*/
@javax.annotation.Nullable
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public ExpandedDebitMemo discountAmount(BigDecimal discountAmount) {
this.discountAmount = discountAmount;
return this;
}
/**
* Get discountAmount
* @return discountAmount
*/
@javax.annotation.Nullable
public BigDecimal getDiscountAmount() {
return discountAmount;
}
public void setDiscountAmount(BigDecimal discountAmount) {
this.discountAmount = discountAmount;
}
public ExpandedDebitMemo dueDate(LocalDate dueDate) {
this.dueDate = dueDate;
return this;
}
/**
* Get dueDate
* @return dueDate
*/
@javax.annotation.Nullable
public LocalDate getDueDate() {
return dueDate;
}
public void setDueDate(LocalDate dueDate) {
this.dueDate = dueDate;
}
public ExpandedDebitMemo eInvoiceStatus(String eInvoiceStatus) {
this.eInvoiceStatus = eInvoiceStatus;
return this;
}
/**
* Get eInvoiceStatus
* @return eInvoiceStatus
*/
@javax.annotation.Nullable
public String geteInvoiceStatus() {
return eInvoiceStatus;
}
public void seteInvoiceStatus(String eInvoiceStatus) {
this.eInvoiceStatus = eInvoiceStatus;
}
public ExpandedDebitMemo eInvoiceFileId(String eInvoiceFileId) {
this.eInvoiceFileId = eInvoiceFileId;
return this;
}
/**
* Get eInvoiceFileId
* @return eInvoiceFileId
*/
@javax.annotation.Nullable
public String geteInvoiceFileId() {
return eInvoiceFileId;
}
public void seteInvoiceFileId(String eInvoiceFileId) {
this.eInvoiceFileId = eInvoiceFileId;
}
public ExpandedDebitMemo eInvoiceErrorCode(String eInvoiceErrorCode) {
this.eInvoiceErrorCode = eInvoiceErrorCode;
return this;
}
/**
* Get eInvoiceErrorCode
* @return eInvoiceErrorCode
*/
@javax.annotation.Nullable
public String geteInvoiceErrorCode() {
return eInvoiceErrorCode;
}
public void seteInvoiceErrorCode(String eInvoiceErrorCode) {
this.eInvoiceErrorCode = eInvoiceErrorCode;
}
public ExpandedDebitMemo eInvoiceErrorMessage(String eInvoiceErrorMessage) {
this.eInvoiceErrorMessage = eInvoiceErrorMessage;
return this;
}
/**
* Get eInvoiceErrorMessage
* @return eInvoiceErrorMessage
*/
@javax.annotation.Nullable
public String geteInvoiceErrorMessage() {
return eInvoiceErrorMessage;
}
public void seteInvoiceErrorMessage(String eInvoiceErrorMessage) {
this.eInvoiceErrorMessage = eInvoiceErrorMessage;
}
public ExpandedDebitMemo exchangeRateDate(LocalDate exchangeRateDate) {
this.exchangeRateDate = exchangeRateDate;
return this;
}
/**
* Get exchangeRateDate
* @return exchangeRateDate
*/
@javax.annotation.Nullable
public LocalDate getExchangeRateDate() {
return exchangeRateDate;
}
public void setExchangeRateDate(LocalDate exchangeRateDate) {
this.exchangeRateDate = exchangeRateDate;
}
public ExpandedDebitMemo invoiceGroupNumber(String invoiceGroupNumber) {
this.invoiceGroupNumber = invoiceGroupNumber;
return this;
}
/**
* Get invoiceGroupNumber
* @return invoiceGroupNumber
*/
@javax.annotation.Nullable
public String getInvoiceGroupNumber() {
return invoiceGroupNumber;
}
public void setInvoiceGroupNumber(String invoiceGroupNumber) {
this.invoiceGroupNumber = invoiceGroupNumber;
}
public ExpandedDebitMemo memoDate(LocalDate memoDate) {
this.memoDate = memoDate;
return this;
}
/**
* Get memoDate
* @return memoDate
*/
@javax.annotation.Nullable
public LocalDate getMemoDate() {
return memoDate;
}
public void setMemoDate(LocalDate memoDate) {
this.memoDate = memoDate;
}
public ExpandedDebitMemo memoNumber(String memoNumber) {
this.memoNumber = memoNumber;
return this;
}
/**
* Get memoNumber
* @return memoNumber
*/
@javax.annotation.Nullable
public String getMemoNumber() {
return memoNumber;
}
public void setMemoNumber(String memoNumber) {
this.memoNumber = memoNumber;
}
public ExpandedDebitMemo postedById(String postedById) {
this.postedById = postedById;
return this;
}
/**
* Get postedById
* @return postedById
*/
@javax.annotation.Nullable
public String getPostedById() {
return postedById;
}
public void setPostedById(String postedById) {
this.postedById = postedById;
}
public ExpandedDebitMemo postedOn(String postedOn) {
this.postedOn = postedOn;
return this;
}
/**
* Get postedOn
* @return postedOn
*/
@javax.annotation.Nullable
public String getPostedOn() {
return postedOn;
}
public void setPostedOn(String postedOn) {
this.postedOn = postedOn;
}
public ExpandedDebitMemo reasonCode(String reasonCode) {
this.reasonCode = reasonCode;
return this;
}
/**
* Get reasonCode
* @return reasonCode
*/
@javax.annotation.Nullable
public String getReasonCode() {
return reasonCode;
}
public void setReasonCode(String reasonCode) {
this.reasonCode = reasonCode;
}
public ExpandedDebitMemo referredDebitMemoId(String referredDebitMemoId) {
this.referredDebitMemoId = referredDebitMemoId;
return this;
}
/**
* Get referredDebitMemoId
* @return referredDebitMemoId
*/
@javax.annotation.Nullable
public String getReferredDebitMemoId() {
return referredDebitMemoId;
}
public void setReferredDebitMemoId(String referredDebitMemoId) {
this.referredDebitMemoId = referredDebitMemoId;
}
public ExpandedDebitMemo sequenceSetId(String sequenceSetId) {
this.sequenceSetId = sequenceSetId;
return this;
}
/**
* Get sequenceSetId
* @return sequenceSetId
*/
@javax.annotation.Nullable
public String getSequenceSetId() {
return sequenceSetId;
}
public void setSequenceSetId(String sequenceSetId) {
this.sequenceSetId = sequenceSetId;
}
public ExpandedDebitMemo soldToContactSnapshotId(String soldToContactSnapshotId) {
this.soldToContactSnapshotId = soldToContactSnapshotId;
return this;
}
/**
* Get soldToContactSnapshotId
* @return soldToContactSnapshotId
*/
@javax.annotation.Nullable
public String getSoldToContactSnapshotId() {
return soldToContactSnapshotId;
}
public void setSoldToContactSnapshotId(String soldToContactSnapshotId) {
this.soldToContactSnapshotId = soldToContactSnapshotId;
}
public ExpandedDebitMemo source(String source) {
this.source = source;
return this;
}
/**
* Get source
* @return source
*/
@javax.annotation.Nullable
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public ExpandedDebitMemo sourceType(String sourceType) {
this.sourceType = sourceType;
return this;
}
/**
* Get sourceType
* @return sourceType
*/
@javax.annotation.Nullable
public String getSourceType() {
return sourceType;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
public ExpandedDebitMemo status(String status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
*/
@javax.annotation.Nullable
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public ExpandedDebitMemo targetDate(LocalDate targetDate) {
this.targetDate = targetDate;
return this;
}
/**
* Get targetDate
* @return targetDate
*/
@javax.annotation.Nullable
public LocalDate getTargetDate() {
return targetDate;
}
public void setTargetDate(LocalDate targetDate) {
this.targetDate = targetDate;
}
public ExpandedDebitMemo taxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount;
return this;
}
/**
* Get taxAmount
* @return taxAmount
*/
@javax.annotation.Nullable
public BigDecimal getTaxAmount() {
return taxAmount;
}
public void setTaxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount;
}
public ExpandedDebitMemo taxAutoCalculation(Boolean taxAutoCalculation) {
this.taxAutoCalculation = taxAutoCalculation;
return this;
}
/**
* Get taxAutoCalculation
* @return taxAutoCalculation
*/
@javax.annotation.Nullable
public Boolean getTaxAutoCalculation() {
return taxAutoCalculation;
}
public void setTaxAutoCalculation(Boolean taxAutoCalculation) {
this.taxAutoCalculation = taxAutoCalculation;
}
public ExpandedDebitMemo taxMessage(String taxMessage) {
this.taxMessage = taxMessage;
return this;
}
/**
* Get taxMessage
* @return taxMessage
*/
@javax.annotation.Nullable
public String getTaxMessage() {
return taxMessage;
}
public void setTaxMessage(String taxMessage) {
this.taxMessage = taxMessage;
}
public ExpandedDebitMemo taxStatus(String taxStatus) {
this.taxStatus = taxStatus;
return this;
}
/**
* Get taxStatus
* @return taxStatus
*/
@javax.annotation.Nullable
public String getTaxStatus() {
return taxStatus;
}
public void setTaxStatus(String taxStatus) {
this.taxStatus = taxStatus;
}
public ExpandedDebitMemo totalAmount(BigDecimal totalAmount) {
this.totalAmount = totalAmount;
return this;
}
/**
* Get totalAmount
* @return totalAmount
*/
@javax.annotation.Nullable
public BigDecimal getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(BigDecimal totalAmount) {
this.totalAmount = totalAmount;
}
public ExpandedDebitMemo totalAmountWithoutTax(BigDecimal totalAmountWithoutTax) {
this.totalAmountWithoutTax = totalAmountWithoutTax;
return this;
}
/**
* Get totalAmountWithoutTax
* @return totalAmountWithoutTax
*/
@javax.annotation.Nullable
public BigDecimal getTotalAmountWithoutTax() {
return totalAmountWithoutTax;
}
public void setTotalAmountWithoutTax(BigDecimal totalAmountWithoutTax) {
this.totalAmountWithoutTax = totalAmountWithoutTax;
}
public ExpandedDebitMemo totalTaxExemptAmount(BigDecimal totalTaxExemptAmount) {
this.totalTaxExemptAmount = totalTaxExemptAmount;
return this;
}
/**
* Get totalTaxExemptAmount
* @return totalTaxExemptAmount
*/
@javax.annotation.Nullable
public BigDecimal getTotalTaxExemptAmount() {
return totalTaxExemptAmount;
}
public void setTotalTaxExemptAmount(BigDecimal totalTaxExemptAmount) {
this.totalTaxExemptAmount = totalTaxExemptAmount;
}
public ExpandedDebitMemo transferredToAccounting(String transferredToAccounting) {
this.transferredToAccounting = transferredToAccounting;
return this;
}
/**
* Get transferredToAccounting
* @return transferredToAccounting
*/
@javax.annotation.Nullable
public String getTransferredToAccounting() {
return transferredToAccounting;
}
public void setTransferredToAccounting(String transferredToAccounting) {
this.transferredToAccounting = transferredToAccounting;
}
public ExpandedDebitMemo invoiceId(String invoiceId) {
this.invoiceId = invoiceId;
return this;
}
/**
* Get invoiceId
* @return invoiceId
*/
@javax.annotation.Nullable
public String getInvoiceId() {
return invoiceId;
}
public void setInvoiceId(String invoiceId) {
this.invoiceId = invoiceId;
}
public ExpandedDebitMemo accountId(String accountId) {
this.accountId = accountId;
return this;
}
/**
* Get accountId
* @return accountId
*/
@javax.annotation.Nullable
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public ExpandedDebitMemo id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@javax.annotation.Nullable
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public ExpandedDebitMemo createdById(String createdById) {
this.createdById = createdById;
return this;
}
/**
* Get createdById
* @return createdById
*/
@javax.annotation.Nullable
public String getCreatedById() {
return createdById;
}
public void setCreatedById(String createdById) {
this.createdById = createdById;
}
public ExpandedDebitMemo createdDate(String createdDate) {
this.createdDate = createdDate;
return this;
}
/**
* Get createdDate
* @return createdDate
*/
@javax.annotation.Nullable
public String getCreatedDate() {
return createdDate;
}
public void setCreatedDate(String createdDate) {
this.createdDate = createdDate;
}
public ExpandedDebitMemo updatedById(String updatedById) {
this.updatedById = updatedById;
return this;
}
/**
* Get updatedById
* @return updatedById
*/
@javax.annotation.Nullable
public String getUpdatedById() {
return updatedById;
}
public void setUpdatedById(String updatedById) {
this.updatedById = updatedById;
}
public ExpandedDebitMemo updatedDate(String updatedDate) {
this.updatedDate = updatedDate;
return this;
}
/**
* Get updatedDate
* @return updatedDate
*/
@javax.annotation.Nullable
public String getUpdatedDate() {
return updatedDate;
}
public void setUpdatedDate(String updatedDate) {
this.updatedDate = updatedDate;
}
public ExpandedDebitMemo paymentTerm(String paymentTerm) {
this.paymentTerm = paymentTerm;
return this;
}
/**
* Get paymentTerm
* @return paymentTerm
*/
@javax.annotation.Nullable
public String getPaymentTerm() {
return paymentTerm;
}
public void setPaymentTerm(String paymentTerm) {
this.paymentTerm = paymentTerm;
}
public ExpandedDebitMemo account(ExpandedAccount account) {
this.account = account;
return this;
}
/**
* Get account
* @return account
*/
@javax.annotation.Nullable
public ExpandedAccount getAccount() {
return account;
}
public void setAccount(ExpandedAccount account) {
this.account = account;
}
public ExpandedDebitMemo billToContact(ExpandedContact billToContact) {
this.billToContact = billToContact;
return this;
}
/**
* Get billToContact
* @return billToContact
*/
@javax.annotation.Nullable
public ExpandedContact getBillToContact() {
return billToContact;
}
public void setBillToContact(ExpandedContact billToContact) {
this.billToContact = billToContact;
}
public ExpandedDebitMemo debitMemoItems(List debitMemoItems) {
this.debitMemoItems = debitMemoItems;
return this;
}
public ExpandedDebitMemo addDebitMemoItemsItem(ExpandedDebitMemoItem debitMemoItemsItem) {
if (this.debitMemoItems == null) {
this.debitMemoItems = new ArrayList<>();
}
this.debitMemoItems.add(debitMemoItemsItem);
return this;
}
/**
* Get debitMemoItems
* @return debitMemoItems
*/
@javax.annotation.Nullable
public List getDebitMemoItems() {
return debitMemoItems;
}
public void setDebitMemoItems(List debitMemoItems) {
this.debitMemoItems = debitMemoItems;
}
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
private Map additionalProperties;
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ExpandedDebitMemo instance itself
*/
public ExpandedDebitMemo putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
this.additionalProperties.put(key, value);
return this;
}
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExpandedDebitMemo expandedDebitMemo = (ExpandedDebitMemo) o;
return Objects.equals(this.autoPay, expandedDebitMemo.autoPay) &&
Objects.equals(this.balance, expandedDebitMemo.balance) &&
Objects.equals(this.billToContactId, expandedDebitMemo.billToContactId) &&
Objects.equals(this.billToContactSnapshotId, expandedDebitMemo.billToContactSnapshotId) &&
Objects.equals(this.cancelledById, expandedDebitMemo.cancelledById) &&
Objects.equals(this.cancelledOn, expandedDebitMemo.cancelledOn) &&
Objects.equals(this.comments, expandedDebitMemo.comments) &&
Objects.equals(this.creditMemoId, expandedDebitMemo.creditMemoId) &&
Objects.equals(this.currency, expandedDebitMemo.currency) &&
Objects.equals(this.discountAmount, expandedDebitMemo.discountAmount) &&
Objects.equals(this.dueDate, expandedDebitMemo.dueDate) &&
Objects.equals(this.eInvoiceStatus, expandedDebitMemo.eInvoiceStatus) &&
Objects.equals(this.eInvoiceFileId, expandedDebitMemo.eInvoiceFileId) &&
Objects.equals(this.eInvoiceErrorCode, expandedDebitMemo.eInvoiceErrorCode) &&
Objects.equals(this.eInvoiceErrorMessage, expandedDebitMemo.eInvoiceErrorMessage) &&
Objects.equals(this.exchangeRateDate, expandedDebitMemo.exchangeRateDate) &&
Objects.equals(this.invoiceGroupNumber, expandedDebitMemo.invoiceGroupNumber) &&
Objects.equals(this.memoDate, expandedDebitMemo.memoDate) &&
Objects.equals(this.memoNumber, expandedDebitMemo.memoNumber) &&
Objects.equals(this.postedById, expandedDebitMemo.postedById) &&
Objects.equals(this.postedOn, expandedDebitMemo.postedOn) &&
Objects.equals(this.reasonCode, expandedDebitMemo.reasonCode) &&
Objects.equals(this.referredDebitMemoId, expandedDebitMemo.referredDebitMemoId) &&
Objects.equals(this.sequenceSetId, expandedDebitMemo.sequenceSetId) &&
Objects.equals(this.soldToContactSnapshotId, expandedDebitMemo.soldToContactSnapshotId) &&
Objects.equals(this.source, expandedDebitMemo.source) &&
Objects.equals(this.sourceType, expandedDebitMemo.sourceType) &&
Objects.equals(this.status, expandedDebitMemo.status) &&
Objects.equals(this.targetDate, expandedDebitMemo.targetDate) &&
Objects.equals(this.taxAmount, expandedDebitMemo.taxAmount) &&
Objects.equals(this.taxAutoCalculation, expandedDebitMemo.taxAutoCalculation) &&
Objects.equals(this.taxMessage, expandedDebitMemo.taxMessage) &&
Objects.equals(this.taxStatus, expandedDebitMemo.taxStatus) &&
Objects.equals(this.totalAmount, expandedDebitMemo.totalAmount) &&
Objects.equals(this.totalAmountWithoutTax, expandedDebitMemo.totalAmountWithoutTax) &&
Objects.equals(this.totalTaxExemptAmount, expandedDebitMemo.totalTaxExemptAmount) &&
Objects.equals(this.transferredToAccounting, expandedDebitMemo.transferredToAccounting) &&
Objects.equals(this.invoiceId, expandedDebitMemo.invoiceId) &&
Objects.equals(this.accountId, expandedDebitMemo.accountId) &&
Objects.equals(this.id, expandedDebitMemo.id) &&
Objects.equals(this.createdById, expandedDebitMemo.createdById) &&
Objects.equals(this.createdDate, expandedDebitMemo.createdDate) &&
Objects.equals(this.updatedById, expandedDebitMemo.updatedById) &&
Objects.equals(this.updatedDate, expandedDebitMemo.updatedDate) &&
Objects.equals(this.paymentTerm, expandedDebitMemo.paymentTerm) &&
Objects.equals(this.account, expandedDebitMemo.account) &&
Objects.equals(this.billToContact, expandedDebitMemo.billToContact) &&
Objects.equals(this.debitMemoItems, expandedDebitMemo.debitMemoItems)&&
Objects.equals(this.additionalProperties, expandedDebitMemo.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(autoPay, balance, billToContactId, billToContactSnapshotId, cancelledById, cancelledOn, comments, creditMemoId, currency, discountAmount, dueDate, eInvoiceStatus, eInvoiceFileId, eInvoiceErrorCode, eInvoiceErrorMessage, exchangeRateDate, invoiceGroupNumber, memoDate, memoNumber, postedById, postedOn, reasonCode, referredDebitMemoId, sequenceSetId, soldToContactSnapshotId, source, sourceType, status, targetDate, taxAmount, taxAutoCalculation, taxMessage, taxStatus, totalAmount, totalAmountWithoutTax, totalTaxExemptAmount, transferredToAccounting, invoiceId, accountId, id, createdById, createdDate, updatedById, updatedDate, paymentTerm, account, billToContact, debitMemoItems, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExpandedDebitMemo {\n");
sb.append(" autoPay: ").append(toIndentedString(autoPay)).append("\n");
sb.append(" balance: ").append(toIndentedString(balance)).append("\n");
sb.append(" billToContactId: ").append(toIndentedString(billToContactId)).append("\n");
sb.append(" billToContactSnapshotId: ").append(toIndentedString(billToContactSnapshotId)).append("\n");
sb.append(" cancelledById: ").append(toIndentedString(cancelledById)).append("\n");
sb.append(" cancelledOn: ").append(toIndentedString(cancelledOn)).append("\n");
sb.append(" comments: ").append(toIndentedString(comments)).append("\n");
sb.append(" creditMemoId: ").append(toIndentedString(creditMemoId)).append("\n");
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
sb.append(" discountAmount: ").append(toIndentedString(discountAmount)).append("\n");
sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n");
sb.append(" eInvoiceStatus: ").append(toIndentedString(eInvoiceStatus)).append("\n");
sb.append(" eInvoiceFileId: ").append(toIndentedString(eInvoiceFileId)).append("\n");
sb.append(" eInvoiceErrorCode: ").append(toIndentedString(eInvoiceErrorCode)).append("\n");
sb.append(" eInvoiceErrorMessage: ").append(toIndentedString(eInvoiceErrorMessage)).append("\n");
sb.append(" exchangeRateDate: ").append(toIndentedString(exchangeRateDate)).append("\n");
sb.append(" invoiceGroupNumber: ").append(toIndentedString(invoiceGroupNumber)).append("\n");
sb.append(" memoDate: ").append(toIndentedString(memoDate)).append("\n");
sb.append(" memoNumber: ").append(toIndentedString(memoNumber)).append("\n");
sb.append(" postedById: ").append(toIndentedString(postedById)).append("\n");
sb.append(" postedOn: ").append(toIndentedString(postedOn)).append("\n");
sb.append(" reasonCode: ").append(toIndentedString(reasonCode)).append("\n");
sb.append(" referredDebitMemoId: ").append(toIndentedString(referredDebitMemoId)).append("\n");
sb.append(" sequenceSetId: ").append(toIndentedString(sequenceSetId)).append("\n");
sb.append(" soldToContactSnapshotId: ").append(toIndentedString(soldToContactSnapshotId)).append("\n");
sb.append(" source: ").append(toIndentedString(source)).append("\n");
sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" targetDate: ").append(toIndentedString(targetDate)).append("\n");
sb.append(" taxAmount: ").append(toIndentedString(taxAmount)).append("\n");
sb.append(" taxAutoCalculation: ").append(toIndentedString(taxAutoCalculation)).append("\n");
sb.append(" taxMessage: ").append(toIndentedString(taxMessage)).append("\n");
sb.append(" taxStatus: ").append(toIndentedString(taxStatus)).append("\n");
sb.append(" totalAmount: ").append(toIndentedString(totalAmount)).append("\n");
sb.append(" totalAmountWithoutTax: ").append(toIndentedString(totalAmountWithoutTax)).append("\n");
sb.append(" totalTaxExemptAmount: ").append(toIndentedString(totalTaxExemptAmount)).append("\n");
sb.append(" transferredToAccounting: ").append(toIndentedString(transferredToAccounting)).append("\n");
sb.append(" invoiceId: ").append(toIndentedString(invoiceId)).append("\n");
sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" createdById: ").append(toIndentedString(createdById)).append("\n");
sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n");
sb.append(" updatedById: ").append(toIndentedString(updatedById)).append("\n");
sb.append(" updatedDate: ").append(toIndentedString(updatedDate)).append("\n");
sb.append(" paymentTerm: ").append(toIndentedString(paymentTerm)).append("\n");
sb.append(" account: ").append(toIndentedString(account)).append("\n");
sb.append(" billToContact: ").append(toIndentedString(billToContact)).append("\n");
sb.append(" debitMemoItems: ").append(toIndentedString(debitMemoItems)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 ");
}
public static HashSet openapiFields;
public static HashSet openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
openapiFields.add("autoPay");
openapiFields.add("balance");
openapiFields.add("billToContactId");
openapiFields.add("billToContactSnapshotId");
openapiFields.add("cancelledById");
openapiFields.add("cancelledOn");
openapiFields.add("comments");
openapiFields.add("creditMemoId");
openapiFields.add("currency");
openapiFields.add("discountAmount");
openapiFields.add("dueDate");
openapiFields.add("eInvoiceStatus");
openapiFields.add("eInvoiceFileId");
openapiFields.add("eInvoiceErrorCode");
openapiFields.add("eInvoiceErrorMessage");
openapiFields.add("exchangeRateDate");
openapiFields.add("invoiceGroupNumber");
openapiFields.add("memoDate");
openapiFields.add("memoNumber");
openapiFields.add("postedById");
openapiFields.add("postedOn");
openapiFields.add("reasonCode");
openapiFields.add("referredDebitMemoId");
openapiFields.add("sequenceSetId");
openapiFields.add("soldToContactSnapshotId");
openapiFields.add("source");
openapiFields.add("sourceType");
openapiFields.add("status");
openapiFields.add("targetDate");
openapiFields.add("taxAmount");
openapiFields.add("taxAutoCalculation");
openapiFields.add("taxMessage");
openapiFields.add("taxStatus");
openapiFields.add("totalAmount");
openapiFields.add("totalAmountWithoutTax");
openapiFields.add("totalTaxExemptAmount");
openapiFields.add("transferredToAccounting");
openapiFields.add("invoiceId");
openapiFields.add("accountId");
openapiFields.add("id");
openapiFields.add("createdById");
openapiFields.add("createdDate");
openapiFields.add("updatedById");
openapiFields.add("updatedDate");
openapiFields.add("paymentTerm");
openapiFields.add("account");
openapiFields.add("billToContact");
openapiFields.add("debitMemoItems");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to ExpandedDebitMemo
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!ExpandedDebitMemo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ExpandedDebitMemo is not found in the empty JSON string", ExpandedDebitMemo.openapiRequiredFields.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("billToContactId") != null && !jsonObj.get("billToContactId").isJsonNull()) && !jsonObj.get("billToContactId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `billToContactId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billToContactId").toString()));
}
if ((jsonObj.get("billToContactSnapshotId") != null && !jsonObj.get("billToContactSnapshotId").isJsonNull()) && !jsonObj.get("billToContactSnapshotId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `billToContactSnapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billToContactSnapshotId").toString()));
}
if ((jsonObj.get("cancelledById") != null && !jsonObj.get("cancelledById").isJsonNull()) && !jsonObj.get("cancelledById").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `cancelledById` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cancelledById").toString()));
}
if ((jsonObj.get("cancelledOn") != null && !jsonObj.get("cancelledOn").isJsonNull()) && !jsonObj.get("cancelledOn").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `cancelledOn` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cancelledOn").toString()));
}
if ((jsonObj.get("comments") != null && !jsonObj.get("comments").isJsonNull()) && !jsonObj.get("comments").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `comments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comments").toString()));
}
if ((jsonObj.get("creditMemoId") != null && !jsonObj.get("creditMemoId").isJsonNull()) && !jsonObj.get("creditMemoId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `creditMemoId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creditMemoId").toString()));
}
if ((jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonNull()) && !jsonObj.get("currency").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString()));
}
if ((jsonObj.get("eInvoiceStatus") != null && !jsonObj.get("eInvoiceStatus").isJsonNull()) && !jsonObj.get("eInvoiceStatus").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eInvoiceStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eInvoiceStatus").toString()));
}
if ((jsonObj.get("eInvoiceFileId") != null && !jsonObj.get("eInvoiceFileId").isJsonNull()) && !jsonObj.get("eInvoiceFileId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eInvoiceFileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eInvoiceFileId").toString()));
}
if ((jsonObj.get("eInvoiceErrorCode") != null && !jsonObj.get("eInvoiceErrorCode").isJsonNull()) && !jsonObj.get("eInvoiceErrorCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eInvoiceErrorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eInvoiceErrorCode").toString()));
}
if ((jsonObj.get("eInvoiceErrorMessage") != null && !jsonObj.get("eInvoiceErrorMessage").isJsonNull()) && !jsonObj.get("eInvoiceErrorMessage").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eInvoiceErrorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eInvoiceErrorMessage").toString()));
}
if ((jsonObj.get("invoiceGroupNumber") != null && !jsonObj.get("invoiceGroupNumber").isJsonNull()) && !jsonObj.get("invoiceGroupNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `invoiceGroupNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceGroupNumber").toString()));
}
if ((jsonObj.get("memoNumber") != null && !jsonObj.get("memoNumber").isJsonNull()) && !jsonObj.get("memoNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `memoNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("memoNumber").toString()));
}
if ((jsonObj.get("postedById") != null && !jsonObj.get("postedById").isJsonNull()) && !jsonObj.get("postedById").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `postedById` to be a primitive type in the JSON string but got `%s`", jsonObj.get("postedById").toString()));
}
if ((jsonObj.get("postedOn") != null && !jsonObj.get("postedOn").isJsonNull()) && !jsonObj.get("postedOn").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `postedOn` to be a primitive type in the JSON string but got `%s`", jsonObj.get("postedOn").toString()));
}
if ((jsonObj.get("reasonCode") != null && !jsonObj.get("reasonCode").isJsonNull()) && !jsonObj.get("reasonCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `reasonCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reasonCode").toString()));
}
if ((jsonObj.get("referredDebitMemoId") != null && !jsonObj.get("referredDebitMemoId").isJsonNull()) && !jsonObj.get("referredDebitMemoId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `referredDebitMemoId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referredDebitMemoId").toString()));
}
if ((jsonObj.get("sequenceSetId") != null && !jsonObj.get("sequenceSetId").isJsonNull()) && !jsonObj.get("sequenceSetId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sequenceSetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sequenceSetId").toString()));
}
if ((jsonObj.get("soldToContactSnapshotId") != null && !jsonObj.get("soldToContactSnapshotId").isJsonNull()) && !jsonObj.get("soldToContactSnapshotId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `soldToContactSnapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("soldToContactSnapshotId").toString()));
}
if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) && !jsonObj.get("source").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString()));
}
if ((jsonObj.get("sourceType") != null && !jsonObj.get("sourceType").isJsonNull()) && !jsonObj.get("sourceType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sourceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceType").toString()));
}
if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
if ((jsonObj.get("taxMessage") != null && !jsonObj.get("taxMessage").isJsonNull()) && !jsonObj.get("taxMessage").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `taxMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxMessage").toString()));
}
if ((jsonObj.get("taxStatus") != null && !jsonObj.get("taxStatus").isJsonNull()) && !jsonObj.get("taxStatus").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `taxStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxStatus").toString()));
}
if ((jsonObj.get("transferredToAccounting") != null && !jsonObj.get("transferredToAccounting").isJsonNull()) && !jsonObj.get("transferredToAccounting").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `transferredToAccounting` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferredToAccounting").toString()));
}
if ((jsonObj.get("invoiceId") != null && !jsonObj.get("invoiceId").isJsonNull()) && !jsonObj.get("invoiceId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `invoiceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceId").toString()));
}
if ((jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) && !jsonObj.get("accountId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString()));
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("createdById") != null && !jsonObj.get("createdById").isJsonNull()) && !jsonObj.get("createdById").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdById` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdById").toString()));
}
if ((jsonObj.get("createdDate") != null && !jsonObj.get("createdDate").isJsonNull()) && !jsonObj.get("createdDate").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdDate").toString()));
}
if ((jsonObj.get("updatedById") != null && !jsonObj.get("updatedById").isJsonNull()) && !jsonObj.get("updatedById").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `updatedById` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedById").toString()));
}
if ((jsonObj.get("updatedDate") != null && !jsonObj.get("updatedDate").isJsonNull()) && !jsonObj.get("updatedDate").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `updatedDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedDate").toString()));
}
if ((jsonObj.get("paymentTerm") != null && !jsonObj.get("paymentTerm").isJsonNull()) && !jsonObj.get("paymentTerm").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `paymentTerm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentTerm").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("debitMemoItems") != null && !jsonObj.get("debitMemoItems").isJsonNull() && !jsonObj.get("debitMemoItems").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `debitMemoItems` to be an array in the JSON string but got `%s`", jsonObj.get("debitMemoItems").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!ExpandedDebitMemo.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ExpandedDebitMemo' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ExpandedDebitMemo.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, ExpandedDebitMemo value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// support null values
out.beginObject();
Iterator iterator = obj.entrySet().iterator();
while(iterator.hasNext()) {
Map.Entry e = (Map.Entry) iterator.next();
out.name((String)e.getKey());
elementAdapter.write(out, e.getValue());
}
// end
// serialize additional properties
if (value.getAdditionalProperties() != null) {
// support null values
boolean oldSerializeNulls = out.getSerializeNulls();
out.setSerializeNulls(true); //force serialize
// end
for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
if (entry.getValue() instanceof String)
obj.addProperty(entry.getKey(), (String) entry.getValue());
else if (entry.getValue() instanceof Number)
obj.addProperty(entry.getKey(), (Number) entry.getValue());
else if (entry.getValue() instanceof Boolean)
obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
else if (entry.getValue() instanceof Character)
obj.addProperty(entry.getKey(), (Character) entry.getValue());
else if (entry.getValue() == null)
obj.add(entry.getKey(), null);
else {
JsonElement jsonElement = gson.toJsonTree(entry.getValue());
if (jsonElement.isJsonArray()) {
obj.add(entry.getKey(), jsonElement.getAsJsonArray());
} else {
obj.add(entry.getKey(), jsonElement.getAsJsonObject());
}
}
out.name((String)entry.getKey());
elementAdapter.write(out, obj.get(entry.getKey()));
}
out.setSerializeNulls(oldSerializeNulls); //restore
}
out.endObject();
}
@Override
public ExpandedDebitMemo read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
ExpandedDebitMemo instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
if (entry.getValue().getAsJsonPrimitive().isString())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
else if (entry.getValue().getAsJsonPrimitive().isNumber())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
else if (entry.getValue().getAsJsonPrimitive().isBoolean())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();
}
}
/**
* Create an instance of ExpandedDebitMemo given an JSON string
*
* @param jsonString JSON string
* @return An instance of ExpandedDebitMemo
* @throws IOException if the JSON string is invalid with respect to ExpandedDebitMemo
*/
public static ExpandedDebitMemo fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ExpandedDebitMemo.class);
}
/**
* Convert an instance of ExpandedDebitMemo to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy