com.zuora.model.UpdateInvoiceResponse 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.BillingDocumentStatus;
import com.zuora.model.FailedReason;
import com.zuora.model.TransferredToAccountingStatus;
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;
/**
* UpdateInvoiceResponse
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class UpdateInvoiceResponse {
public static final String SERIALIZED_NAME_PROCESS_ID = "processId";
@SerializedName(SERIALIZED_NAME_PROCESS_ID)
private String processId;
public static final String SERIALIZED_NAME_REQUEST_ID = "requestId";
@SerializedName(SERIALIZED_NAME_REQUEST_ID)
private String requestId;
public static final String SERIALIZED_NAME_REASONS = "reasons";
@SerializedName(SERIALIZED_NAME_REASONS)
private List reasons;
public static final String SERIALIZED_NAME_SUCCESS = "success";
@SerializedName(SERIALIZED_NAME_SUCCESS)
private Boolean success;
public static final String SERIALIZED_NAME_INTEGRATION_ID_N_S = "IntegrationId__NS";
@SerializedName(SERIALIZED_NAME_INTEGRATION_ID_N_S)
private String integrationIdNS;
public static final String SERIALIZED_NAME_INTEGRATION_STATUS_N_S = "IntegrationStatus__NS";
@SerializedName(SERIALIZED_NAME_INTEGRATION_STATUS_N_S)
private String integrationStatusNS;
public static final String SERIALIZED_NAME_SYNC_DATE_N_S = "SyncDate__NS";
@SerializedName(SERIALIZED_NAME_SYNC_DATE_N_S)
private String syncDateNS;
public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId";
@SerializedName(SERIALIZED_NAME_ACCOUNT_ID)
private String accountId;
public static final String SERIALIZED_NAME_AMOUNT = "amount";
@SerializedName(SERIALIZED_NAME_AMOUNT)
private BigDecimal amount;
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_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_COMMENT = "comment";
@SerializedName(SERIALIZED_NAME_COMMENT)
private String comment;
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_CREDIT_BALANCE_ADJUSTMENT_AMOUNT = "creditBalanceAdjustmentAmount";
@SerializedName(SERIALIZED_NAME_CREDIT_BALANCE_ADJUSTMENT_AMOUNT)
private BigDecimal creditBalanceAdjustmentAmount;
public static final String SERIALIZED_NAME_CURRENCY = "currency";
@SerializedName(SERIALIZED_NAME_CURRENCY)
private String currency;
public static final String SERIALIZED_NAME_DISCOUNT = "discount";
@SerializedName(SERIALIZED_NAME_DISCOUNT)
private BigDecimal discount;
public static final String SERIALIZED_NAME_DUE_DATE = "dueDate";
@SerializedName(SERIALIZED_NAME_DUE_DATE)
private LocalDate dueDate;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_INVOICE_DATE = "invoiceDate";
@SerializedName(SERIALIZED_NAME_INVOICE_DATE)
private LocalDate invoiceDate;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private String number;
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_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private BillingDocumentStatus 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_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 TransferredToAccountingStatus transferredToAccounting;
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 UpdateInvoiceResponse() {
}
public UpdateInvoiceResponse processId(String processId) {
this.processId = processId;
return this;
}
/**
* The Id of the process that handle the operation.
* @return processId
*/
@javax.annotation.Nullable
public String getProcessId() {
return processId;
}
public void setProcessId(String processId) {
this.processId = processId;
}
public UpdateInvoiceResponse requestId(String requestId) {
this.requestId = requestId;
return this;
}
/**
* Unique request identifier. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution.
* @return requestId
*/
@javax.annotation.Nullable
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public UpdateInvoiceResponse reasons(List reasons) {
this.reasons = reasons;
return this;
}
public UpdateInvoiceResponse addReasonsItem(FailedReason reasonsItem) {
if (this.reasons == null) {
this.reasons = new ArrayList<>();
}
this.reasons.add(reasonsItem);
return this;
}
/**
* Get reasons
* @return reasons
*/
@javax.annotation.Nullable
public List getReasons() {
return reasons;
}
public void setReasons(List reasons) {
this.reasons = reasons;
}
public UpdateInvoiceResponse success(Boolean success) {
this.success = success;
return this;
}
/**
* Indicates whether the call succeeded.
* @return success
*/
@javax.annotation.Nullable
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public UpdateInvoiceResponse integrationIdNS(String integrationIdNS) {
this.integrationIdNS = integrationIdNS;
return this;
}
/**
* ID of the corresponding object in NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
* @return integrationIdNS
*/
@javax.annotation.Nullable
public String getIntegrationIdNS() {
return integrationIdNS;
}
public void setIntegrationIdNS(String integrationIdNS) {
this.integrationIdNS = integrationIdNS;
}
public UpdateInvoiceResponse integrationStatusNS(String integrationStatusNS) {
this.integrationStatusNS = integrationStatusNS;
return this;
}
/**
* Status of the invoice's synchronization with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
* @return integrationStatusNS
*/
@javax.annotation.Nullable
public String getIntegrationStatusNS() {
return integrationStatusNS;
}
public void setIntegrationStatusNS(String integrationStatusNS) {
this.integrationStatusNS = integrationStatusNS;
}
public UpdateInvoiceResponse syncDateNS(String syncDateNS) {
this.syncDateNS = syncDateNS;
return this;
}
/**
* Date when the invoice was synchronized with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
* @return syncDateNS
*/
@javax.annotation.Nullable
public String getSyncDateNS() {
return syncDateNS;
}
public void setSyncDateNS(String syncDateNS) {
this.syncDateNS = syncDateNS;
}
public UpdateInvoiceResponse accountId(String accountId) {
this.accountId = accountId;
return this;
}
/**
* The ID of the customer account associated with the invoice.
* @return accountId
*/
@javax.annotation.Nullable
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public UpdateInvoiceResponse amount(BigDecimal amount) {
this.amount = amount;
return this;
}
/**
* The total amount of the invoice.
* @return amount
*/
@javax.annotation.Nullable
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public UpdateInvoiceResponse autoPay(Boolean autoPay) {
this.autoPay = autoPay;
return this;
}
/**
* Whether invoices are automatically picked up for processing in the corresponding payment run.
* @return autoPay
*/
@javax.annotation.Nullable
public Boolean getAutoPay() {
return autoPay;
}
public void setAutoPay(Boolean autoPay) {
this.autoPay = autoPay;
}
public UpdateInvoiceResponse balance(BigDecimal balance) {
this.balance = balance;
return this;
}
/**
* The balance of the invoice.
* @return balance
*/
@javax.annotation.Nullable
public BigDecimal getBalance() {
return balance;
}
public void setBalance(BigDecimal balance) {
this.balance = balance;
}
public UpdateInvoiceResponse cancelledById(String cancelledById) {
this.cancelledById = cancelledById;
return this;
}
/**
* The ID of the Zuora user who cancelled the invoice.
* @return cancelledById
*/
@javax.annotation.Nullable
public String getCancelledById() {
return cancelledById;
}
public void setCancelledById(String cancelledById) {
this.cancelledById = cancelledById;
}
public UpdateInvoiceResponse cancelledOn(String cancelledOn) {
this.cancelledOn = cancelledOn;
return this;
}
/**
* The date and time when the invoice was cancelled, in `yyyy-mm-dd hh:mm:ss` format.
* @return cancelledOn
*/
@javax.annotation.Nullable
public String getCancelledOn() {
return cancelledOn;
}
public void setCancelledOn(String cancelledOn) {
this.cancelledOn = cancelledOn;
}
public UpdateInvoiceResponse comment(String comment) {
this.comment = comment;
return this;
}
/**
* Comments about the invoice.
* @return comment
*/
@javax.annotation.Nullable
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public UpdateInvoiceResponse createdById(String createdById) {
this.createdById = createdById;
return this;
}
/**
* The ID of the Zuora user who created the invoice.
* @return createdById
*/
@javax.annotation.Nullable
public String getCreatedById() {
return createdById;
}
public void setCreatedById(String createdById) {
this.createdById = createdById;
}
public UpdateInvoiceResponse createdDate(String createdDate) {
this.createdDate = createdDate;
return this;
}
/**
* The date and time when the invoice was created, in `yyyy-mm-dd hh:mm:ss` format. For example, 2017-03-01 15:31:10.
* @return createdDate
*/
@javax.annotation.Nullable
public String getCreatedDate() {
return createdDate;
}
public void setCreatedDate(String createdDate) {
this.createdDate = createdDate;
}
public UpdateInvoiceResponse creditBalanceAdjustmentAmount(BigDecimal creditBalanceAdjustmentAmount) {
this.creditBalanceAdjustmentAmount = creditBalanceAdjustmentAmount;
return this;
}
/**
* **Note:** This filed is only available if you have the Credit Balance feature enabled and the Invoice Settlement feature disabled. The currency amount of the adjustment applied to the customer's credit balance.
* @return creditBalanceAdjustmentAmount
*/
@javax.annotation.Nullable
public BigDecimal getCreditBalanceAdjustmentAmount() {
return creditBalanceAdjustmentAmount;
}
public void setCreditBalanceAdjustmentAmount(BigDecimal creditBalanceAdjustmentAmount) {
this.creditBalanceAdjustmentAmount = creditBalanceAdjustmentAmount;
}
public UpdateInvoiceResponse currency(String currency) {
this.currency = currency;
return this;
}
/**
* A currency defined in the web-based UI administrative settings.
* @return currency
*/
@javax.annotation.Nullable
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public UpdateInvoiceResponse discount(BigDecimal discount) {
this.discount = discount;
return this;
}
/**
* The discount of the invoice.
* @return discount
*/
@javax.annotation.Nullable
public BigDecimal getDiscount() {
return discount;
}
public void setDiscount(BigDecimal discount) {
this.discount = discount;
}
public UpdateInvoiceResponse dueDate(LocalDate dueDate) {
this.dueDate = dueDate;
return this;
}
/**
* The date by which the payment for this invoice is due.
* @return dueDate
*/
@javax.annotation.Nullable
public LocalDate getDueDate() {
return dueDate;
}
public void setDueDate(LocalDate dueDate) {
this.dueDate = dueDate;
}
public UpdateInvoiceResponse id(String id) {
this.id = id;
return this;
}
/**
* The unique ID of the invoice.
* @return id
*/
@javax.annotation.Nullable
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public UpdateInvoiceResponse invoiceDate(LocalDate invoiceDate) {
this.invoiceDate = invoiceDate;
return this;
}
/**
* The date on which to generate the invoice.
* @return invoiceDate
*/
@javax.annotation.Nullable
public LocalDate getInvoiceDate() {
return invoiceDate;
}
public void setInvoiceDate(LocalDate invoiceDate) {
this.invoiceDate = invoiceDate;
}
public UpdateInvoiceResponse number(String number) {
this.number = number;
return this;
}
/**
* The unique identification number of the invoice.
* @return number
*/
@javax.annotation.Nullable
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public UpdateInvoiceResponse postedById(String postedById) {
this.postedById = postedById;
return this;
}
/**
* The ID of the Zuora user who posted the invoice.
* @return postedById
*/
@javax.annotation.Nullable
public String getPostedById() {
return postedById;
}
public void setPostedById(String postedById) {
this.postedById = postedById;
}
public UpdateInvoiceResponse postedOn(String postedOn) {
this.postedOn = postedOn;
return this;
}
/**
* The date and time when the invoice was posted, in `yyyy-mm-dd hh:mm:ss` format.
* @return postedOn
*/
@javax.annotation.Nullable
public String getPostedOn() {
return postedOn;
}
public void setPostedOn(String postedOn) {
this.postedOn = postedOn;
}
public UpdateInvoiceResponse status(BillingDocumentStatus status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
*/
@javax.annotation.Nullable
public BillingDocumentStatus getStatus() {
return status;
}
public void setStatus(BillingDocumentStatus status) {
this.status = status;
}
public UpdateInvoiceResponse targetDate(LocalDate targetDate) {
this.targetDate = targetDate;
return this;
}
/**
* The target date for the invoice, in `yyyy-mm-dd` format. For example, 2017-07-20.
* @return targetDate
*/
@javax.annotation.Nullable
public LocalDate getTargetDate() {
return targetDate;
}
public void setTargetDate(LocalDate targetDate) {
this.targetDate = targetDate;
}
public UpdateInvoiceResponse taxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount;
return this;
}
/**
* The amount of taxation.
* @return taxAmount
*/
@javax.annotation.Nullable
public BigDecimal getTaxAmount() {
return taxAmount;
}
public void setTaxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount;
}
public UpdateInvoiceResponse totalTaxExemptAmount(BigDecimal totalTaxExemptAmount) {
this.totalTaxExemptAmount = totalTaxExemptAmount;
return this;
}
/**
* The calculated tax amount excluded due to the exemption.
* @return totalTaxExemptAmount
*/
@javax.annotation.Nullable
public BigDecimal getTotalTaxExemptAmount() {
return totalTaxExemptAmount;
}
public void setTotalTaxExemptAmount(BigDecimal totalTaxExemptAmount) {
this.totalTaxExemptAmount = totalTaxExemptAmount;
}
public UpdateInvoiceResponse transferredToAccounting(TransferredToAccountingStatus transferredToAccounting) {
this.transferredToAccounting = transferredToAccounting;
return this;
}
/**
* Get transferredToAccounting
* @return transferredToAccounting
*/
@javax.annotation.Nullable
public TransferredToAccountingStatus getTransferredToAccounting() {
return transferredToAccounting;
}
public void setTransferredToAccounting(TransferredToAccountingStatus transferredToAccounting) {
this.transferredToAccounting = transferredToAccounting;
}
public UpdateInvoiceResponse updatedById(String updatedById) {
this.updatedById = updatedById;
return this;
}
/**
* The ID of the Zuora user who last updated the invoice.
* @return updatedById
*/
@javax.annotation.Nullable
public String getUpdatedById() {
return updatedById;
}
public void setUpdatedById(String updatedById) {
this.updatedById = updatedById;
}
public UpdateInvoiceResponse updatedDate(String updatedDate) {
this.updatedDate = updatedDate;
return this;
}
/**
* The date and time when the invoice was last updated, in `yyyy-mm-dd hh:mm:ss` format. For example, 2017-03-02 15:36:10.
* @return updatedDate
*/
@javax.annotation.Nullable
public String getUpdatedDate() {
return updatedDate;
}
public void setUpdatedDate(String updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 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 UpdateInvoiceResponse instance itself
*/
public UpdateInvoiceResponse 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;
}
UpdateInvoiceResponse updateInvoiceResponse = (UpdateInvoiceResponse) o;
return Objects.equals(this.processId, updateInvoiceResponse.processId) &&
Objects.equals(this.requestId, updateInvoiceResponse.requestId) &&
Objects.equals(this.reasons, updateInvoiceResponse.reasons) &&
Objects.equals(this.success, updateInvoiceResponse.success) &&
Objects.equals(this.integrationIdNS, updateInvoiceResponse.integrationIdNS) &&
Objects.equals(this.integrationStatusNS, updateInvoiceResponse.integrationStatusNS) &&
Objects.equals(this.syncDateNS, updateInvoiceResponse.syncDateNS) &&
Objects.equals(this.accountId, updateInvoiceResponse.accountId) &&
Objects.equals(this.amount, updateInvoiceResponse.amount) &&
Objects.equals(this.autoPay, updateInvoiceResponse.autoPay) &&
Objects.equals(this.balance, updateInvoiceResponse.balance) &&
Objects.equals(this.cancelledById, updateInvoiceResponse.cancelledById) &&
Objects.equals(this.cancelledOn, updateInvoiceResponse.cancelledOn) &&
Objects.equals(this.comment, updateInvoiceResponse.comment) &&
Objects.equals(this.createdById, updateInvoiceResponse.createdById) &&
Objects.equals(this.createdDate, updateInvoiceResponse.createdDate) &&
Objects.equals(this.creditBalanceAdjustmentAmount, updateInvoiceResponse.creditBalanceAdjustmentAmount) &&
Objects.equals(this.currency, updateInvoiceResponse.currency) &&
Objects.equals(this.discount, updateInvoiceResponse.discount) &&
Objects.equals(this.dueDate, updateInvoiceResponse.dueDate) &&
Objects.equals(this.id, updateInvoiceResponse.id) &&
Objects.equals(this.invoiceDate, updateInvoiceResponse.invoiceDate) &&
Objects.equals(this.number, updateInvoiceResponse.number) &&
Objects.equals(this.postedById, updateInvoiceResponse.postedById) &&
Objects.equals(this.postedOn, updateInvoiceResponse.postedOn) &&
Objects.equals(this.status, updateInvoiceResponse.status) &&
Objects.equals(this.targetDate, updateInvoiceResponse.targetDate) &&
Objects.equals(this.taxAmount, updateInvoiceResponse.taxAmount) &&
Objects.equals(this.totalTaxExemptAmount, updateInvoiceResponse.totalTaxExemptAmount) &&
Objects.equals(this.transferredToAccounting, updateInvoiceResponse.transferredToAccounting) &&
Objects.equals(this.updatedById, updateInvoiceResponse.updatedById) &&
Objects.equals(this.updatedDate, updateInvoiceResponse.updatedDate)&&
Objects.equals(this.additionalProperties, updateInvoiceResponse.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(processId, requestId, reasons, success, integrationIdNS, integrationStatusNS, syncDateNS, accountId, amount, autoPay, balance, cancelledById, cancelledOn, comment, createdById, createdDate, creditBalanceAdjustmentAmount, currency, discount, dueDate, id, invoiceDate, number, postedById, postedOn, status, targetDate, taxAmount, totalTaxExemptAmount, transferredToAccounting, updatedById, updatedDate, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UpdateInvoiceResponse {\n");
sb.append(" processId: ").append(toIndentedString(processId)).append("\n");
sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n");
sb.append(" reasons: ").append(toIndentedString(reasons)).append("\n");
sb.append(" success: ").append(toIndentedString(success)).append("\n");
sb.append(" integrationIdNS: ").append(toIndentedString(integrationIdNS)).append("\n");
sb.append(" integrationStatusNS: ").append(toIndentedString(integrationStatusNS)).append("\n");
sb.append(" syncDateNS: ").append(toIndentedString(syncDateNS)).append("\n");
sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" autoPay: ").append(toIndentedString(autoPay)).append("\n");
sb.append(" balance: ").append(toIndentedString(balance)).append("\n");
sb.append(" cancelledById: ").append(toIndentedString(cancelledById)).append("\n");
sb.append(" cancelledOn: ").append(toIndentedString(cancelledOn)).append("\n");
sb.append(" comment: ").append(toIndentedString(comment)).append("\n");
sb.append(" createdById: ").append(toIndentedString(createdById)).append("\n");
sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n");
sb.append(" creditBalanceAdjustmentAmount: ").append(toIndentedString(creditBalanceAdjustmentAmount)).append("\n");
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
sb.append(" discount: ").append(toIndentedString(discount)).append("\n");
sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" invoiceDate: ").append(toIndentedString(invoiceDate)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" postedById: ").append(toIndentedString(postedById)).append("\n");
sb.append(" postedOn: ").append(toIndentedString(postedOn)).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(" totalTaxExemptAmount: ").append(toIndentedString(totalTaxExemptAmount)).append("\n");
sb.append(" transferredToAccounting: ").append(toIndentedString(transferredToAccounting)).append("\n");
sb.append(" updatedById: ").append(toIndentedString(updatedById)).append("\n");
sb.append(" updatedDate: ").append(toIndentedString(updatedDate)).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("processId");
openapiFields.add("requestId");
openapiFields.add("reasons");
openapiFields.add("success");
openapiFields.add("IntegrationId__NS");
openapiFields.add("IntegrationStatus__NS");
openapiFields.add("SyncDate__NS");
openapiFields.add("accountId");
openapiFields.add("amount");
openapiFields.add("autoPay");
openapiFields.add("balance");
openapiFields.add("cancelledById");
openapiFields.add("cancelledOn");
openapiFields.add("comment");
openapiFields.add("createdById");
openapiFields.add("createdDate");
openapiFields.add("creditBalanceAdjustmentAmount");
openapiFields.add("currency");
openapiFields.add("discount");
openapiFields.add("dueDate");
openapiFields.add("id");
openapiFields.add("invoiceDate");
openapiFields.add("number");
openapiFields.add("postedById");
openapiFields.add("postedOn");
openapiFields.add("status");
openapiFields.add("targetDate");
openapiFields.add("taxAmount");
openapiFields.add("totalTaxExemptAmount");
openapiFields.add("transferredToAccounting");
openapiFields.add("updatedById");
openapiFields.add("updatedDate");
// 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 UpdateInvoiceResponse
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!UpdateInvoiceResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateInvoiceResponse is not found in the empty JSON string", UpdateInvoiceResponse.openapiRequiredFields.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("processId") != null && !jsonObj.get("processId").isJsonNull()) && !jsonObj.get("processId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `processId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processId").toString()));
}
if ((jsonObj.get("requestId") != null && !jsonObj.get("requestId").isJsonNull()) && !jsonObj.get("requestId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString()));
}
if (jsonObj.get("reasons") != null && !jsonObj.get("reasons").isJsonNull()) {
JsonArray jsonArrayreasons = jsonObj.getAsJsonArray("reasons");
if (jsonArrayreasons != null) {
// ensure the json data is an array
if (!jsonObj.get("reasons").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `reasons` to be an array in the JSON string but got `%s`", jsonObj.get("reasons").toString()));
}
// validate the optional field `reasons` (array)
for (int i = 0; i < jsonArrayreasons.size(); i++) {
FailedReason.validateJsonElement(jsonArrayreasons.get(i));
};
}
}
if ((jsonObj.get("IntegrationId__NS") != null && !jsonObj.get("IntegrationId__NS").isJsonNull()) && !jsonObj.get("IntegrationId__NS").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `IntegrationId__NS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IntegrationId__NS").toString()));
}
if ((jsonObj.get("IntegrationStatus__NS") != null && !jsonObj.get("IntegrationStatus__NS").isJsonNull()) && !jsonObj.get("IntegrationStatus__NS").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `IntegrationStatus__NS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IntegrationStatus__NS").toString()));
}
if ((jsonObj.get("SyncDate__NS") != null && !jsonObj.get("SyncDate__NS").isJsonNull()) && !jsonObj.get("SyncDate__NS").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `SyncDate__NS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SyncDate__NS").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("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("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").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("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("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("number") != null && !jsonObj.get("number").isJsonNull()) && !jsonObj.get("number").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").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("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()));
}
// validate the optional field `status`
if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) {
BillingDocumentStatus.validateJsonElement(jsonObj.get("status"));
}
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()));
}
// validate the optional field `transferredToAccounting`
if (jsonObj.get("transferredToAccounting") != null && !jsonObj.get("transferredToAccounting").isJsonNull()) {
TransferredToAccountingStatus.validateJsonElement(jsonObj.get("transferredToAccounting"));
}
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()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!UpdateInvoiceResponse.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UpdateInvoiceResponse' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UpdateInvoiceResponse.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, UpdateInvoiceResponse 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 UpdateInvoiceResponse read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
UpdateInvoiceResponse 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 UpdateInvoiceResponse given an JSON string
*
* @param jsonString JSON string
* @return An instance of UpdateInvoiceResponse
* @throws IOException if the JSON string is invalid with respect to UpdateInvoiceResponse
*/
public static UpdateInvoiceResponse fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UpdateInvoiceResponse.class);
}
/**
* Convert an instance of UpdateInvoiceResponse to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy