com.zuora.model.ExpandedCreditMemo 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.ExpandedCreditMemoApplication;
import com.zuora.model.ExpandedCreditMemoItem;
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;
/**
* ExpandedCreditMemo
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class ExpandedCreditMemo {
public static final String SERIALIZED_NAME_APPLIED_AMOUNT = "appliedAmount";
@SerializedName(SERIALIZED_NAME_APPLIED_AMOUNT)
private BigDecimal appliedAmount;
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_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_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_EXCLUDE_FROM_AUTO_APPLY_RULES = "excludeFromAutoApplyRules";
@SerializedName(SERIALIZED_NAME_EXCLUDE_FROM_AUTO_APPLY_RULES)
private Boolean excludeFromAutoApplyRules;
public static final String SERIALIZED_NAME_AUTO_APPLY_UPON_POSTING = "autoApplyUponPosting";
@SerializedName(SERIALIZED_NAME_AUTO_APPLY_UPON_POSTING)
private Boolean autoApplyUponPosting;
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_REFUND_AMOUNT = "refundAmount";
@SerializedName(SERIALIZED_NAME_REFUND_AMOUNT)
private BigDecimal refundAmount;
public static final String SERIALIZED_NAME_REVERSED = "reversed";
@SerializedName(SERIALIZED_NAME_REVERSED)
private Boolean reversed;
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_SOURCE_ID = "sourceId";
@SerializedName(SERIALIZED_NAME_SOURCE_ID)
private String sourceId;
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_DEBIT_MEMO_ID = "debitMemoId";
@SerializedName(SERIALIZED_NAME_DEBIT_MEMO_ID)
private String debitMemoId;
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_CREDIT_MEMO_ITEMS = "creditMemoItems";
@SerializedName(SERIALIZED_NAME_CREDIT_MEMO_ITEMS)
private List creditMemoItems;
public static final String SERIALIZED_NAME_CREDIT_MEMO_APPLICATIONS = "creditMemoApplications";
@SerializedName(SERIALIZED_NAME_CREDIT_MEMO_APPLICATIONS)
private List creditMemoApplications;
public ExpandedCreditMemo() {
}
public ExpandedCreditMemo appliedAmount(BigDecimal appliedAmount) {
this.appliedAmount = appliedAmount;
return this;
}
/**
* Get appliedAmount
* @return appliedAmount
*/
@javax.annotation.Nullable
public BigDecimal getAppliedAmount() {
return appliedAmount;
}
public void setAppliedAmount(BigDecimal appliedAmount) {
this.appliedAmount = appliedAmount;
}
public ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo excludeFromAutoApplyRules(Boolean excludeFromAutoApplyRules) {
this.excludeFromAutoApplyRules = excludeFromAutoApplyRules;
return this;
}
/**
* Get excludeFromAutoApplyRules
* @return excludeFromAutoApplyRules
*/
@javax.annotation.Nullable
public Boolean getExcludeFromAutoApplyRules() {
return excludeFromAutoApplyRules;
}
public void setExcludeFromAutoApplyRules(Boolean excludeFromAutoApplyRules) {
this.excludeFromAutoApplyRules = excludeFromAutoApplyRules;
}
public ExpandedCreditMemo autoApplyUponPosting(Boolean autoApplyUponPosting) {
this.autoApplyUponPosting = autoApplyUponPosting;
return this;
}
/**
* Get autoApplyUponPosting
* @return autoApplyUponPosting
*/
@javax.annotation.Nullable
public Boolean getAutoApplyUponPosting() {
return autoApplyUponPosting;
}
public void setAutoApplyUponPosting(Boolean autoApplyUponPosting) {
this.autoApplyUponPosting = autoApplyUponPosting;
}
public ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo refundAmount(BigDecimal refundAmount) {
this.refundAmount = refundAmount;
return this;
}
/**
* Get refundAmount
* @return refundAmount
*/
@javax.annotation.Nullable
public BigDecimal getRefundAmount() {
return refundAmount;
}
public void setRefundAmount(BigDecimal refundAmount) {
this.refundAmount = refundAmount;
}
public ExpandedCreditMemo reversed(Boolean reversed) {
this.reversed = reversed;
return this;
}
/**
* Get reversed
* @return reversed
*/
@javax.annotation.Nullable
public Boolean getReversed() {
return reversed;
}
public void setReversed(Boolean reversed) {
this.reversed = reversed;
}
public ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo sourceId(String sourceId) {
this.sourceId = sourceId;
return this;
}
/**
* Get sourceId
* @return sourceId
*/
@javax.annotation.Nullable
public String getSourceId() {
return sourceId;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo debitMemoId(String debitMemoId) {
this.debitMemoId = debitMemoId;
return this;
}
/**
* Get debitMemoId
* @return debitMemoId
*/
@javax.annotation.Nullable
public String getDebitMemoId() {
return debitMemoId;
}
public void setDebitMemoId(String debitMemoId) {
this.debitMemoId = debitMemoId;
}
public ExpandedCreditMemo 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 ExpandedCreditMemo 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 ExpandedCreditMemo creditMemoItems(List creditMemoItems) {
this.creditMemoItems = creditMemoItems;
return this;
}
public ExpandedCreditMemo addCreditMemoItemsItem(ExpandedCreditMemoItem creditMemoItemsItem) {
if (this.creditMemoItems == null) {
this.creditMemoItems = new ArrayList<>();
}
this.creditMemoItems.add(creditMemoItemsItem);
return this;
}
/**
* Get creditMemoItems
* @return creditMemoItems
*/
@javax.annotation.Nullable
public List getCreditMemoItems() {
return creditMemoItems;
}
public void setCreditMemoItems(List creditMemoItems) {
this.creditMemoItems = creditMemoItems;
}
public ExpandedCreditMemo creditMemoApplications(List creditMemoApplications) {
this.creditMemoApplications = creditMemoApplications;
return this;
}
public ExpandedCreditMemo addCreditMemoApplicationsItem(ExpandedCreditMemoApplication creditMemoApplicationsItem) {
if (this.creditMemoApplications == null) {
this.creditMemoApplications = new ArrayList<>();
}
this.creditMemoApplications.add(creditMemoApplicationsItem);
return this;
}
/**
* Get creditMemoApplications
* @return creditMemoApplications
*/
@javax.annotation.Nullable
public List getCreditMemoApplications() {
return creditMemoApplications;
}
public void setCreditMemoApplications(List creditMemoApplications) {
this.creditMemoApplications = creditMemoApplications;
}
/**
* 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 ExpandedCreditMemo instance itself
*/
public ExpandedCreditMemo 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;
}
ExpandedCreditMemo expandedCreditMemo = (ExpandedCreditMemo) o;
return Objects.equals(this.appliedAmount, expandedCreditMemo.appliedAmount) &&
Objects.equals(this.balance, expandedCreditMemo.balance) &&
Objects.equals(this.billToContactId, expandedCreditMemo.billToContactId) &&
Objects.equals(this.billToContactSnapshotId, expandedCreditMemo.billToContactSnapshotId) &&
Objects.equals(this.cancelledById, expandedCreditMemo.cancelledById) &&
Objects.equals(this.cancelledOn, expandedCreditMemo.cancelledOn) &&
Objects.equals(this.comments, expandedCreditMemo.comments) &&
Objects.equals(this.currency, expandedCreditMemo.currency) &&
Objects.equals(this.discountAmount, expandedCreditMemo.discountAmount) &&
Objects.equals(this.eInvoiceStatus, expandedCreditMemo.eInvoiceStatus) &&
Objects.equals(this.eInvoiceFileId, expandedCreditMemo.eInvoiceFileId) &&
Objects.equals(this.eInvoiceErrorCode, expandedCreditMemo.eInvoiceErrorCode) &&
Objects.equals(this.eInvoiceErrorMessage, expandedCreditMemo.eInvoiceErrorMessage) &&
Objects.equals(this.exchangeRateDate, expandedCreditMemo.exchangeRateDate) &&
Objects.equals(this.excludeFromAutoApplyRules, expandedCreditMemo.excludeFromAutoApplyRules) &&
Objects.equals(this.autoApplyUponPosting, expandedCreditMemo.autoApplyUponPosting) &&
Objects.equals(this.invoiceGroupNumber, expandedCreditMemo.invoiceGroupNumber) &&
Objects.equals(this.memoDate, expandedCreditMemo.memoDate) &&
Objects.equals(this.memoNumber, expandedCreditMemo.memoNumber) &&
Objects.equals(this.postedById, expandedCreditMemo.postedById) &&
Objects.equals(this.postedOn, expandedCreditMemo.postedOn) &&
Objects.equals(this.reasonCode, expandedCreditMemo.reasonCode) &&
Objects.equals(this.refundAmount, expandedCreditMemo.refundAmount) &&
Objects.equals(this.reversed, expandedCreditMemo.reversed) &&
Objects.equals(this.sequenceSetId, expandedCreditMemo.sequenceSetId) &&
Objects.equals(this.soldToContactSnapshotId, expandedCreditMemo.soldToContactSnapshotId) &&
Objects.equals(this.source, expandedCreditMemo.source) &&
Objects.equals(this.sourceType, expandedCreditMemo.sourceType) &&
Objects.equals(this.status, expandedCreditMemo.status) &&
Objects.equals(this.targetDate, expandedCreditMemo.targetDate) &&
Objects.equals(this.taxAmount, expandedCreditMemo.taxAmount) &&
Objects.equals(this.taxAutoCalculation, expandedCreditMemo.taxAutoCalculation) &&
Objects.equals(this.taxMessage, expandedCreditMemo.taxMessage) &&
Objects.equals(this.taxStatus, expandedCreditMemo.taxStatus) &&
Objects.equals(this.totalAmount, expandedCreditMemo.totalAmount) &&
Objects.equals(this.totalAmountWithoutTax, expandedCreditMemo.totalAmountWithoutTax) &&
Objects.equals(this.totalTaxExemptAmount, expandedCreditMemo.totalTaxExemptAmount) &&
Objects.equals(this.transferredToAccounting, expandedCreditMemo.transferredToAccounting) &&
Objects.equals(this.invoiceId, expandedCreditMemo.invoiceId) &&
Objects.equals(this.accountId, expandedCreditMemo.accountId) &&
Objects.equals(this.id, expandedCreditMemo.id) &&
Objects.equals(this.createdById, expandedCreditMemo.createdById) &&
Objects.equals(this.sourceId, expandedCreditMemo.sourceId) &&
Objects.equals(this.createdDate, expandedCreditMemo.createdDate) &&
Objects.equals(this.updatedById, expandedCreditMemo.updatedById) &&
Objects.equals(this.updatedDate, expandedCreditMemo.updatedDate) &&
Objects.equals(this.debitMemoId, expandedCreditMemo.debitMemoId) &&
Objects.equals(this.account, expandedCreditMemo.account) &&
Objects.equals(this.billToContact, expandedCreditMemo.billToContact) &&
Objects.equals(this.creditMemoItems, expandedCreditMemo.creditMemoItems) &&
Objects.equals(this.creditMemoApplications, expandedCreditMemo.creditMemoApplications)&&
Objects.equals(this.additionalProperties, expandedCreditMemo.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(appliedAmount, balance, billToContactId, billToContactSnapshotId, cancelledById, cancelledOn, comments, currency, discountAmount, eInvoiceStatus, eInvoiceFileId, eInvoiceErrorCode, eInvoiceErrorMessage, exchangeRateDate, excludeFromAutoApplyRules, autoApplyUponPosting, invoiceGroupNumber, memoDate, memoNumber, postedById, postedOn, reasonCode, refundAmount, reversed, sequenceSetId, soldToContactSnapshotId, source, sourceType, status, targetDate, taxAmount, taxAutoCalculation, taxMessage, taxStatus, totalAmount, totalAmountWithoutTax, totalTaxExemptAmount, transferredToAccounting, invoiceId, accountId, id, createdById, sourceId, createdDate, updatedById, updatedDate, debitMemoId, account, billToContact, creditMemoItems, creditMemoApplications, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExpandedCreditMemo {\n");
sb.append(" appliedAmount: ").append(toIndentedString(appliedAmount)).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(" currency: ").append(toIndentedString(currency)).append("\n");
sb.append(" discountAmount: ").append(toIndentedString(discountAmount)).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(" excludeFromAutoApplyRules: ").append(toIndentedString(excludeFromAutoApplyRules)).append("\n");
sb.append(" autoApplyUponPosting: ").append(toIndentedString(autoApplyUponPosting)).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(" refundAmount: ").append(toIndentedString(refundAmount)).append("\n");
sb.append(" reversed: ").append(toIndentedString(reversed)).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(" sourceId: ").append(toIndentedString(sourceId)).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(" debitMemoId: ").append(toIndentedString(debitMemoId)).append("\n");
sb.append(" account: ").append(toIndentedString(account)).append("\n");
sb.append(" billToContact: ").append(toIndentedString(billToContact)).append("\n");
sb.append(" creditMemoItems: ").append(toIndentedString(creditMemoItems)).append("\n");
sb.append(" creditMemoApplications: ").append(toIndentedString(creditMemoApplications)).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("appliedAmount");
openapiFields.add("balance");
openapiFields.add("billToContactId");
openapiFields.add("billToContactSnapshotId");
openapiFields.add("cancelledById");
openapiFields.add("cancelledOn");
openapiFields.add("comments");
openapiFields.add("currency");
openapiFields.add("discountAmount");
openapiFields.add("eInvoiceStatus");
openapiFields.add("eInvoiceFileId");
openapiFields.add("eInvoiceErrorCode");
openapiFields.add("eInvoiceErrorMessage");
openapiFields.add("exchangeRateDate");
openapiFields.add("excludeFromAutoApplyRules");
openapiFields.add("autoApplyUponPosting");
openapiFields.add("invoiceGroupNumber");
openapiFields.add("memoDate");
openapiFields.add("memoNumber");
openapiFields.add("postedById");
openapiFields.add("postedOn");
openapiFields.add("reasonCode");
openapiFields.add("refundAmount");
openapiFields.add("reversed");
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("sourceId");
openapiFields.add("createdDate");
openapiFields.add("updatedById");
openapiFields.add("updatedDate");
openapiFields.add("debitMemoId");
openapiFields.add("account");
openapiFields.add("billToContact");
openapiFields.add("creditMemoItems");
openapiFields.add("creditMemoApplications");
// 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 ExpandedCreditMemo
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!ExpandedCreditMemo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ExpandedCreditMemo is not found in the empty JSON string", ExpandedCreditMemo.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("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("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("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) && !jsonObj.get("sourceId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").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("debitMemoId") != null && !jsonObj.get("debitMemoId").isJsonNull()) && !jsonObj.get("debitMemoId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `debitMemoId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("debitMemoId").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("creditMemoItems") != null && !jsonObj.get("creditMemoItems").isJsonNull() && !jsonObj.get("creditMemoItems").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `creditMemoItems` to be an array in the JSON string but got `%s`", jsonObj.get("creditMemoItems").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("creditMemoApplications") != null && !jsonObj.get("creditMemoApplications").isJsonNull() && !jsonObj.get("creditMemoApplications").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `creditMemoApplications` to be an array in the JSON string but got `%s`", jsonObj.get("creditMemoApplications").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!ExpandedCreditMemo.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ExpandedCreditMemo' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ExpandedCreditMemo.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, ExpandedCreditMemo 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 ExpandedCreditMemo read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
ExpandedCreditMemo 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 ExpandedCreditMemo given an JSON string
*
* @param jsonString JSON string
* @return An instance of ExpandedCreditMemo
* @throws IOException if the JSON string is invalid with respect to ExpandedCreditMemo
*/
public static ExpandedCreditMemo fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ExpandedCreditMemo.class);
}
/**
* Convert an instance of ExpandedCreditMemo to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy