com.zuora.model.OrderLineItem 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.OrderLineItemBillingRule;
import com.zuora.model.OrderLineItemCategory;
import com.zuora.model.OrderLineItemInlineDiscountType;
import com.zuora.model.OrderLineItemState;
import com.zuora.model.OrderLineItemType;
import com.zuora.model.TaxMode;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
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;
/**
* OrderLineItem
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class OrderLineItem {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_AMENDED_BY_ORDER_ON = "amendedByOrderOn";
@SerializedName(SERIALIZED_NAME_AMENDED_BY_ORDER_ON)
private String amendedByOrderOn;
public static final String SERIALIZED_NAME_CURRENCY = "currency";
@SerializedName(SERIALIZED_NAME_CURRENCY)
private String currency;
public static final String SERIALIZED_NAME_PAYMENT_TERM = "paymentTerm";
@SerializedName(SERIALIZED_NAME_PAYMENT_TERM)
private String paymentTerm;
public static final String SERIALIZED_NAME_INVOICE_TEMPLATE_ID = "invoiceTemplateId";
@SerializedName(SERIALIZED_NAME_INVOICE_TEMPLATE_ID)
private String invoiceTemplateId;
public static final String SERIALIZED_NAME_AMOUNT = "amount";
@SerializedName(SERIALIZED_NAME_AMOUNT)
private BigDecimal amount;
public static final String SERIALIZED_NAME_AMOUNT_WITHOUT_TAX = "amountWithoutTax";
@SerializedName(SERIALIZED_NAME_AMOUNT_WITHOUT_TAX)
private BigDecimal amountWithoutTax;
public static final String SERIALIZED_NAME_ITEM_NUMBER = "itemNumber";
@SerializedName(SERIALIZED_NAME_ITEM_NUMBER)
private String itemNumber;
public static final String SERIALIZED_NAME_U_O_M = "UOM";
@SerializedName(SERIALIZED_NAME_U_O_M)
private String UOM;
public static final String SERIALIZED_NAME_AMOUNT_PER_UNIT = "amountPerUnit";
@SerializedName(SERIALIZED_NAME_AMOUNT_PER_UNIT)
private BigDecimal amountPerUnit;
public static final String SERIALIZED_NAME_BILL_TARGET_DATE = "billTargetDate";
@SerializedName(SERIALIZED_NAME_BILL_TARGET_DATE)
private LocalDate billTargetDate;
public static final String SERIALIZED_NAME_BILL_TO = "billTo";
@SerializedName(SERIALIZED_NAME_BILL_TO)
private String billTo;
public static final String SERIALIZED_NAME_BILL_TO_SNAPSHOT_ID = "billToSnapshotId";
@SerializedName(SERIALIZED_NAME_BILL_TO_SNAPSHOT_ID)
private String billToSnapshotId;
public static final String SERIALIZED_NAME_BILLING_RULE = "billingRule";
@SerializedName(SERIALIZED_NAME_BILLING_RULE)
private OrderLineItemBillingRule billingRule = OrderLineItemBillingRule.TRIGGERWITHOUTFULFILLMENT;
public static final String SERIALIZED_NAME_ACCOUNTING_CODE = "accountingCode";
@SerializedName(SERIALIZED_NAME_ACCOUNTING_CODE)
private String accountingCode;
public static final String SERIALIZED_NAME_ADJUSTMENT_LIABILITY_ACCOUNTING_CODE = "adjustmentLiabilityAccountingCode";
@SerializedName(SERIALIZED_NAME_ADJUSTMENT_LIABILITY_ACCOUNTING_CODE)
private String adjustmentLiabilityAccountingCode;
public static final String SERIALIZED_NAME_ADJUSTMENT_REVENUE_ACCOUNTING_CODE = "adjustmentRevenueAccountingCode";
@SerializedName(SERIALIZED_NAME_ADJUSTMENT_REVENUE_ACCOUNTING_CODE)
private String adjustmentRevenueAccountingCode;
public static final String SERIALIZED_NAME_CONTRACT_ASSET_ACCOUNTING_CODE = "contractAssetAccountingCode";
@SerializedName(SERIALIZED_NAME_CONTRACT_ASSET_ACCOUNTING_CODE)
private String contractAssetAccountingCode;
public static final String SERIALIZED_NAME_CONTRACT_LIABILITY_ACCOUNTING_CODE = "contractLiabilityAccountingCode";
@SerializedName(SERIALIZED_NAME_CONTRACT_LIABILITY_ACCOUNTING_CODE)
private String contractLiabilityAccountingCode;
public static final String SERIALIZED_NAME_CONTRACT_RECOGNIZED_REVENUE_ACCOUNTING_CODE = "contractRecognizedRevenueAccountingCode";
@SerializedName(SERIALIZED_NAME_CONTRACT_RECOGNIZED_REVENUE_ACCOUNTING_CODE)
private String contractRecognizedRevenueAccountingCode;
public static final String SERIALIZED_NAME_DEFERRED_REVENUE_ACCOUNTING_CODE = "deferredRevenueAccountingCode";
@SerializedName(SERIALIZED_NAME_DEFERRED_REVENUE_ACCOUNTING_CODE)
private String deferredRevenueAccountingCode;
public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "customFields";
@SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS)
private Map customFields;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_DISCOUNT = "discount";
@SerializedName(SERIALIZED_NAME_DISCOUNT)
private BigDecimal discount;
public static final String SERIALIZED_NAME_EXCLUDE_ITEM_BILLING_FROM_REVENUE_ACCOUNTING = "excludeItemBillingFromRevenueAccounting";
@SerializedName(SERIALIZED_NAME_EXCLUDE_ITEM_BILLING_FROM_REVENUE_ACCOUNTING)
private Boolean excludeItemBillingFromRevenueAccounting;
public static final String SERIALIZED_NAME_EXCLUDE_ITEM_BOOKING_FROM_REVENUE_ACCOUNTING = "excludeItemBookingFromRevenueAccounting";
@SerializedName(SERIALIZED_NAME_EXCLUDE_ITEM_BOOKING_FROM_REVENUE_ACCOUNTING)
private Boolean excludeItemBookingFromRevenueAccounting;
public static final String SERIALIZED_NAME_REVENUE_RECOGNITION_TIMING = "revenueRecognitionTiming";
@SerializedName(SERIALIZED_NAME_REVENUE_RECOGNITION_TIMING)
private String revenueRecognitionTiming;
public static final String SERIALIZED_NAME_REVENUE_AMORTIZATION_METHOD = "revenueAmortizationMethod";
@SerializedName(SERIALIZED_NAME_REVENUE_AMORTIZATION_METHOD)
private String revenueAmortizationMethod;
public static final String SERIALIZED_NAME_INLINE_DISCOUNT_PER_UNIT = "inlineDiscountPerUnit";
@SerializedName(SERIALIZED_NAME_INLINE_DISCOUNT_PER_UNIT)
private BigDecimal inlineDiscountPerUnit;
public static final String SERIALIZED_NAME_INLINE_DISCOUNT_TYPE = "inlineDiscountType";
@SerializedName(SERIALIZED_NAME_INLINE_DISCOUNT_TYPE)
private OrderLineItemInlineDiscountType inlineDiscountType;
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_INVOICE_OWNER_ACCOUNT_ID = "invoiceOwnerAccountId";
@SerializedName(SERIALIZED_NAME_INVOICE_OWNER_ACCOUNT_ID)
private String invoiceOwnerAccountId;
public static final String SERIALIZED_NAME_INVOICE_OWNER_ACCOUNT_NAME = "invoiceOwnerAccountName";
@SerializedName(SERIALIZED_NAME_INVOICE_OWNER_ACCOUNT_NAME)
private String invoiceOwnerAccountName;
public static final String SERIALIZED_NAME_INVOICE_OWNER_ACCOUNT_NUMBER = "invoiceOwnerAccountNumber";
@SerializedName(SERIALIZED_NAME_INVOICE_OWNER_ACCOUNT_NUMBER)
private String invoiceOwnerAccountNumber;
public static final String SERIALIZED_NAME_IS_ALLOCATION_ELIGIBLE = "isAllocationEligible";
@SerializedName(SERIALIZED_NAME_IS_ALLOCATION_ELIGIBLE)
private Boolean isAllocationEligible;
public static final String SERIALIZED_NAME_IS_UNBILLED = "isUnbilled";
@SerializedName(SERIALIZED_NAME_IS_UNBILLED)
private Boolean isUnbilled;
public static final String SERIALIZED_NAME_ITEM_CATEGORY = "itemCategory";
@SerializedName(SERIALIZED_NAME_ITEM_CATEGORY)
private OrderLineItemCategory itemCategory = OrderLineItemCategory.SALES;
public static final String SERIALIZED_NAME_ITEM_NAME = "itemName";
@SerializedName(SERIALIZED_NAME_ITEM_NAME)
private String itemName;
public static final String SERIALIZED_NAME_ITEM_STATE = "itemState";
@SerializedName(SERIALIZED_NAME_ITEM_STATE)
private OrderLineItemState itemState;
public static final String SERIALIZED_NAME_ITEM_TYPE = "itemType";
@SerializedName(SERIALIZED_NAME_ITEM_TYPE)
private OrderLineItemType itemType;
public static final String SERIALIZED_NAME_LIST_PRICE = "listPrice";
@SerializedName(SERIALIZED_NAME_LIST_PRICE)
private BigDecimal listPrice;
public static final String SERIALIZED_NAME_LIST_PRICE_PER_UNIT = "listPricePerUnit";
@SerializedName(SERIALIZED_NAME_LIST_PRICE_PER_UNIT)
private BigDecimal listPricePerUnit;
public static final String SERIALIZED_NAME_ORIGINAL_ORDER_ID = "originalOrderId";
@SerializedName(SERIALIZED_NAME_ORIGINAL_ORDER_ID)
private String originalOrderId;
public static final String SERIALIZED_NAME_ORIGINAL_ORDER_DATE = "originalOrderDate";
@SerializedName(SERIALIZED_NAME_ORIGINAL_ORDER_DATE)
private LocalDate originalOrderDate;
public static final String SERIALIZED_NAME_ORIGINAL_ORDER_LINE_ITEM_ID = "originalOrderLineItemId";
@SerializedName(SERIALIZED_NAME_ORIGINAL_ORDER_LINE_ITEM_ID)
private String originalOrderLineItemId;
public static final String SERIALIZED_NAME_ORIGINAL_ORDER_LINE_ITEM_NUMBER = "originalOrderLineItemNumber";
@SerializedName(SERIALIZED_NAME_ORIGINAL_ORDER_LINE_ITEM_NUMBER)
private String originalOrderLineItemNumber;
public static final String SERIALIZED_NAME_ORIGINAL_ORDER_NUMBER = "originalOrderNumber";
@SerializedName(SERIALIZED_NAME_ORIGINAL_ORDER_NUMBER)
private String originalOrderNumber;
public static final String SERIALIZED_NAME_OWNER_ACCOUNT_ID = "ownerAccountId";
@SerializedName(SERIALIZED_NAME_OWNER_ACCOUNT_ID)
private String ownerAccountId;
public static final String SERIALIZED_NAME_OWNER_ACCOUNT_NAME = "ownerAccountName";
@SerializedName(SERIALIZED_NAME_OWNER_ACCOUNT_NAME)
private String ownerAccountName;
public static final String SERIALIZED_NAME_OWNER_ACCOUNT_NUMBER = "ownerAccountNumber";
@SerializedName(SERIALIZED_NAME_OWNER_ACCOUNT_NUMBER)
private String ownerAccountNumber;
public static final String SERIALIZED_NAME_PRODUCT_CODE = "productCode";
@SerializedName(SERIALIZED_NAME_PRODUCT_CODE)
private String productCode;
public static final String SERIALIZED_NAME_PRODUCT_RATE_PLAN_CHARGE_ID = "productRatePlanChargeId";
@SerializedName(SERIALIZED_NAME_PRODUCT_RATE_PLAN_CHARGE_ID)
private String productRatePlanChargeId;
public static final String SERIALIZED_NAME_PURCHASE_ORDER_NUMBER = "purchaseOrderNumber";
@SerializedName(SERIALIZED_NAME_PURCHASE_ORDER_NUMBER)
private String purchaseOrderNumber;
public static final String SERIALIZED_NAME_QUANTITY = "quantity";
@SerializedName(SERIALIZED_NAME_QUANTITY)
private BigDecimal quantity;
public static final String SERIALIZED_NAME_QUANTITY_AVAILABLE_FOR_RETURN = "quantityAvailableForReturn";
@SerializedName(SERIALIZED_NAME_QUANTITY_AVAILABLE_FOR_RETURN)
private BigDecimal quantityAvailableForReturn;
public static final String SERIALIZED_NAME_QUANTITY_FULFILLED = "quantityFulfilled";
@SerializedName(SERIALIZED_NAME_QUANTITY_FULFILLED)
private BigDecimal quantityFulfilled;
public static final String SERIALIZED_NAME_QUANTITY_PENDING_FULFILLMENT = "quantityPendingFulfillment";
@SerializedName(SERIALIZED_NAME_QUANTITY_PENDING_FULFILLMENT)
private BigDecimal quantityPendingFulfillment;
public static final String SERIALIZED_NAME_RECOGNIZED_REVENUE_ACCOUNTING_CODE = "recognizedRevenueAccountingCode";
@SerializedName(SERIALIZED_NAME_RECOGNIZED_REVENUE_ACCOUNTING_CODE)
private String recognizedRevenueAccountingCode;
public static final String SERIALIZED_NAME_RELATED_SUBSCRIPTION_NUMBER = "relatedSubscriptionNumber";
@SerializedName(SERIALIZED_NAME_RELATED_SUBSCRIPTION_NUMBER)
private String relatedSubscriptionNumber;
public static final String SERIALIZED_NAME_REQUIRES_FULFILLMENT = "requiresFulfillment";
@SerializedName(SERIALIZED_NAME_REQUIRES_FULFILLMENT)
private Boolean requiresFulfillment;
public static final String SERIALIZED_NAME_REVENUE_RECOGNITION_RULE = "revenueRecognitionRule";
@SerializedName(SERIALIZED_NAME_REVENUE_RECOGNITION_RULE)
private String revenueRecognitionRule;
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 = "soldTo";
@SerializedName(SERIALIZED_NAME_SOLD_TO)
private String soldTo;
public static final String SERIALIZED_NAME_SOLD_TO_SNAPSHOT_ID = "soldToSnapshotId";
@SerializedName(SERIALIZED_NAME_SOLD_TO_SNAPSHOT_ID)
private String soldToSnapshotId;
public static final String SERIALIZED_NAME_SHIP_TO = "shipTo";
@SerializedName(SERIALIZED_NAME_SHIP_TO)
private String shipTo;
public static final String SERIALIZED_NAME_SHIP_TO_SNAPSHOT_ID = "shipToSnapshotId";
@SerializedName(SERIALIZED_NAME_SHIP_TO_SNAPSHOT_ID)
private String shipToSnapshotId;
public static final String SERIALIZED_NAME_TAX_CODE = "taxCode";
@SerializedName(SERIALIZED_NAME_TAX_CODE)
private String taxCode;
public static final String SERIALIZED_NAME_TAX_MODE = "taxMode";
@SerializedName(SERIALIZED_NAME_TAX_MODE)
private TaxMode taxMode;
public static final String SERIALIZED_NAME_TRANSACTION_END_DATE = "transactionEndDate";
@SerializedName(SERIALIZED_NAME_TRANSACTION_END_DATE)
private LocalDate transactionEndDate;
public static final String SERIALIZED_NAME_TRANSACTION_START_DATE = "transactionStartDate";
@SerializedName(SERIALIZED_NAME_TRANSACTION_START_DATE)
private LocalDate transactionStartDate;
public static final String SERIALIZED_NAME_UNBILLED_RECEIVABLES_ACCOUNTING_CODE = "unbilledReceivablesAccountingCode";
@SerializedName(SERIALIZED_NAME_UNBILLED_RECEIVABLES_ACCOUNTING_CODE)
private String unbilledReceivablesAccountingCode;
public OrderLineItem() {
}
public OrderLineItem id(String id) {
this.id = id;
return this;
}
/**
* The sytem generated Id for the Order Line Item.
* @return id
*/
@javax.annotation.Nullable
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public OrderLineItem amendedByOrderOn(String amendedByOrderOn) {
this.amendedByOrderOn = amendedByOrderOn;
return this;
}
/**
* The date when the rate plan charge is amended through an order or amendment. This field is to standardize the booking date information to increase audit ability and traceability of data between Zuora Billing and Zuora Revenue. It is mapped as the booking date for a sale order line in Zuora Revenue.
* @return amendedByOrderOn
*/
@javax.annotation.Nullable
public String getAmendedByOrderOn() {
return amendedByOrderOn;
}
public void setAmendedByOrderOn(String amendedByOrderOn) {
this.amendedByOrderOn = amendedByOrderOn;
}
public OrderLineItem currency(String currency) {
this.currency = currency;
return this;
}
/**
* The currency for the Order Line Item.
* @return currency
*/
@javax.annotation.Nullable
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public OrderLineItem paymentTerm(String paymentTerm) {
this.paymentTerm = paymentTerm;
return this;
}
/**
* The payment term for the Order Line Item
* @return paymentTerm
*/
@javax.annotation.Nullable
public String getPaymentTerm() {
return paymentTerm;
}
public void setPaymentTerm(String paymentTerm) {
this.paymentTerm = paymentTerm;
}
public OrderLineItem invoiceTemplateId(String invoiceTemplateId) {
this.invoiceTemplateId = invoiceTemplateId;
return this;
}
/**
* The invoice template id for the Order Line Item
* @return invoiceTemplateId
*/
@javax.annotation.Nullable
public String getInvoiceTemplateId() {
return invoiceTemplateId;
}
public void setInvoiceTemplateId(String invoiceTemplateId) {
this.invoiceTemplateId = invoiceTemplateId;
}
public OrderLineItem amount(BigDecimal amount) {
this.amount = amount;
return this;
}
/**
* The calculated gross amount for the Order Line Item.
* @return amount
*/
@javax.annotation.Nullable
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public OrderLineItem amountWithoutTax(BigDecimal amountWithoutTax) {
this.amountWithoutTax = amountWithoutTax;
return this;
}
/**
* The calculated gross amount for an order line item excluding tax. If the tax mode is tax exclusive, the value of this field equals that of the `amount` field. If the tax mode of an order line item is not set, the system treats it as tax exclusive by default. The value of the `amountWithoutTax` field equals that of the `amount` field. If you create an order line item from the product catalog, the tax mode and tax code of the product rate plan charge are used for the order line item by default. You can still overwrite this default set-up by setting the tax mode and tax code of the order line item.
* @return amountWithoutTax
*/
@javax.annotation.Nullable
public BigDecimal getAmountWithoutTax() {
return amountWithoutTax;
}
public void setAmountWithoutTax(BigDecimal amountWithoutTax) {
this.amountWithoutTax = amountWithoutTax;
}
public OrderLineItem itemNumber(String itemNumber) {
this.itemNumber = itemNumber;
return this;
}
/**
* The number for the Order Line Item.
* @return itemNumber
*/
@javax.annotation.Nullable
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public OrderLineItem UOM(String UOM) {
this.UOM = UOM;
return this;
}
/**
* Specifies the units to measure usage.
* @return UOM
*/
@javax.annotation.Nullable
public String getUOM() {
return UOM;
}
public void setUOM(String UOM) {
this.UOM = UOM;
}
public OrderLineItem amountPerUnit(BigDecimal amountPerUnit) {
this.amountPerUnit = amountPerUnit;
return this;
}
/**
* The actual charged amount per unit for the Order Line Item.
* @return amountPerUnit
*/
@javax.annotation.Nullable
public BigDecimal getAmountPerUnit() {
return amountPerUnit;
}
public void setAmountPerUnit(BigDecimal amountPerUnit) {
this.amountPerUnit = amountPerUnit;
}
public OrderLineItem billTargetDate(LocalDate billTargetDate) {
this.billTargetDate = billTargetDate;
return this;
}
/**
* The target date for the Order Line Item to be picked up by bill run for billing.
* @return billTargetDate
*/
@javax.annotation.Nullable
public LocalDate getBillTargetDate() {
return billTargetDate;
}
public void setBillTargetDate(LocalDate billTargetDate) {
this.billTargetDate = billTargetDate;
}
public OrderLineItem billTo(String billTo) {
this.billTo = billTo;
return this;
}
/**
* The ID of a contact that belongs to the billing account of the order line item. Use this field to assign an existing account as the bill-to contact of an order line item.
* @return billTo
*/
@javax.annotation.Nullable
public String getBillTo() {
return billTo;
}
public void setBillTo(String billTo) {
this.billTo = billTo;
}
public OrderLineItem billToSnapshotId(String billToSnapshotId) {
this.billToSnapshotId = billToSnapshotId;
return this;
}
/**
* The snapshot of the ID for an account used as the sold-to contact of an order line item. This field is used to store the original information about the account, in case the information about the account is changed after the creation of the order line item. The `billToSnapshotId` field is exposed while retrieving the order line item details.
* @return billToSnapshotId
*/
@javax.annotation.Nullable
public String getBillToSnapshotId() {
return billToSnapshotId;
}
public void setBillToSnapshotId(String billToSnapshotId) {
this.billToSnapshotId = billToSnapshotId;
}
public OrderLineItem billingRule(OrderLineItemBillingRule billingRule) {
this.billingRule = billingRule;
return this;
}
/**
* Get billingRule
* @return billingRule
*/
@javax.annotation.Nullable
public OrderLineItemBillingRule getBillingRule() {
return billingRule;
}
public void setBillingRule(OrderLineItemBillingRule billingRule) {
this.billingRule = billingRule;
}
public OrderLineItem accountingCode(String accountingCode) {
this.accountingCode = accountingCode;
return this;
}
/**
* The accounting code for the Order Line Item.
* @return accountingCode
*/
@javax.annotation.Nullable
public String getAccountingCode() {
return accountingCode;
}
public void setAccountingCode(String accountingCode) {
this.accountingCode = accountingCode;
}
public OrderLineItem adjustmentLiabilityAccountingCode(String adjustmentLiabilityAccountingCode) {
this.adjustmentLiabilityAccountingCode = adjustmentLiabilityAccountingCode;
return this;
}
/**
* The accounting code on the Order Line Item object for customers using [Zuora Billing - Revenue Integration](https://knowledgecenter.zuora.com/Zuora_Revenue/Zuora_Billing_-_Revenue_Integration).
* @return adjustmentLiabilityAccountingCode
*/
@javax.annotation.Nullable
public String getAdjustmentLiabilityAccountingCode() {
return adjustmentLiabilityAccountingCode;
}
public void setAdjustmentLiabilityAccountingCode(String adjustmentLiabilityAccountingCode) {
this.adjustmentLiabilityAccountingCode = adjustmentLiabilityAccountingCode;
}
public OrderLineItem adjustmentRevenueAccountingCode(String adjustmentRevenueAccountingCode) {
this.adjustmentRevenueAccountingCode = adjustmentRevenueAccountingCode;
return this;
}
/**
* The accounting code on the Order Line Item object for customers using [Zuora Billing - Revenue Integration](https://knowledgecenter.zuora.com/Zuora_Revenue/Zuora_Billing_-_Revenue_Integration).
* @return adjustmentRevenueAccountingCode
*/
@javax.annotation.Nullable
public String getAdjustmentRevenueAccountingCode() {
return adjustmentRevenueAccountingCode;
}
public void setAdjustmentRevenueAccountingCode(String adjustmentRevenueAccountingCode) {
this.adjustmentRevenueAccountingCode = adjustmentRevenueAccountingCode;
}
public OrderLineItem contractAssetAccountingCode(String contractAssetAccountingCode) {
this.contractAssetAccountingCode = contractAssetAccountingCode;
return this;
}
/**
* The accounting code on the Order Line Item object for customers using [Zuora Billing - Revenue Integration](https://knowledgecenter.zuora.com/Zuora_Revenue/Zuora_Billing_-_Revenue_Integration).
* @return contractAssetAccountingCode
*/
@javax.annotation.Nullable
public String getContractAssetAccountingCode() {
return contractAssetAccountingCode;
}
public void setContractAssetAccountingCode(String contractAssetAccountingCode) {
this.contractAssetAccountingCode = contractAssetAccountingCode;
}
public OrderLineItem contractLiabilityAccountingCode(String contractLiabilityAccountingCode) {
this.contractLiabilityAccountingCode = contractLiabilityAccountingCode;
return this;
}
/**
* The accounting code on the Order Line Item object for customers using [Zuora Billing - Revenue Integration](https://knowledgecenter.zuora.com/Zuora_Revenue/Zuora_Billing_-_Revenue_Integration).
* @return contractLiabilityAccountingCode
*/
@javax.annotation.Nullable
public String getContractLiabilityAccountingCode() {
return contractLiabilityAccountingCode;
}
public void setContractLiabilityAccountingCode(String contractLiabilityAccountingCode) {
this.contractLiabilityAccountingCode = contractLiabilityAccountingCode;
}
public OrderLineItem contractRecognizedRevenueAccountingCode(String contractRecognizedRevenueAccountingCode) {
this.contractRecognizedRevenueAccountingCode = contractRecognizedRevenueAccountingCode;
return this;
}
/**
* The accounting code on the Order Line Item object for customers using [Zuora Billing - Revenue Integration](https://knowledgecenter.zuora.com/Zuora_Revenue/Zuora_Billing_-_Revenue_Integration).
* @return contractRecognizedRevenueAccountingCode
*/
@javax.annotation.Nullable
public String getContractRecognizedRevenueAccountingCode() {
return contractRecognizedRevenueAccountingCode;
}
public void setContractRecognizedRevenueAccountingCode(String contractRecognizedRevenueAccountingCode) {
this.contractRecognizedRevenueAccountingCode = contractRecognizedRevenueAccountingCode;
}
public OrderLineItem deferredRevenueAccountingCode(String deferredRevenueAccountingCode) {
this.deferredRevenueAccountingCode = deferredRevenueAccountingCode;
return this;
}
/**
* The deferred revenue accounting code for the Order Line Item.
* @return deferredRevenueAccountingCode
*/
@javax.annotation.Nullable
public String getDeferredRevenueAccountingCode() {
return deferredRevenueAccountingCode;
}
public void setDeferredRevenueAccountingCode(String deferredRevenueAccountingCode) {
this.deferredRevenueAccountingCode = deferredRevenueAccountingCode;
}
public OrderLineItem customFields(Map customFields) {
this.customFields = customFields;
return this;
}
public OrderLineItem putCustomFieldsItem(String key, Object customFieldsItem) {
if (this.customFields == null) {
this.customFields = new HashMap<>();
}
this.customFields.put(key, customFieldsItem);
return this;
}
/**
* Container for custom fields of an Order Line Item object.
* @return customFields
*/
@javax.annotation.Nullable
public Map getCustomFields() {
return customFields;
}
public void setCustomFields(Map customFields) {
this.customFields = customFields;
}
public OrderLineItem description(String description) {
this.description = description;
return this;
}
/**
* The description of the Order Line Item.
* @return description
*/
@javax.annotation.Nullable
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public OrderLineItem discount(BigDecimal discount) {
this.discount = discount;
return this;
}
/**
* This field shows the total discount amount that is applied to an order line item after the `inlineDiscountType`, `inlineDiscountPerUnit` and `quantity` fields are set. The inline discount is applied to the list price of an order line item (see the `listPrice` field).
* @return discount
*/
@javax.annotation.Nullable
public BigDecimal getDiscount() {
return discount;
}
public void setDiscount(BigDecimal discount) {
this.discount = discount;
}
public OrderLineItem excludeItemBillingFromRevenueAccounting(Boolean excludeItemBillingFromRevenueAccounting) {
this.excludeItemBillingFromRevenueAccounting = excludeItemBillingFromRevenueAccounting;
return this;
}
/**
* The flag to exclude Order Line Item related invoice items, invoice item adjustments, credit memo items, and debit memo items from revenue accounting. **Note**: This field is only available if you have the [Zuora Billing - Revenue Integration](https://knowledgecenter.zuora.com/Zuora_Revenue/Zuora_Billing_-_Revenue_Integration) feature enabled.
* @return excludeItemBillingFromRevenueAccounting
*/
@javax.annotation.Nullable
public Boolean getExcludeItemBillingFromRevenueAccounting() {
return excludeItemBillingFromRevenueAccounting;
}
public void setExcludeItemBillingFromRevenueAccounting(Boolean excludeItemBillingFromRevenueAccounting) {
this.excludeItemBillingFromRevenueAccounting = excludeItemBillingFromRevenueAccounting;
}
public OrderLineItem excludeItemBookingFromRevenueAccounting(Boolean excludeItemBookingFromRevenueAccounting) {
this.excludeItemBookingFromRevenueAccounting = excludeItemBookingFromRevenueAccounting;
return this;
}
/**
* The flag to exclude Order Line Item from revenue accounting. **Note**: This field is only available if you have the [Zuora Billing - Revenue Integration](https://knowledgecenter.zuora.com/Zuora_Revenue/Zuora_Billing_-_Revenue_Integration) feature enabled.
* @return excludeItemBookingFromRevenueAccounting
*/
@javax.annotation.Nullable
public Boolean getExcludeItemBookingFromRevenueAccounting() {
return excludeItemBookingFromRevenueAccounting;
}
public void setExcludeItemBookingFromRevenueAccounting(Boolean excludeItemBookingFromRevenueAccounting) {
this.excludeItemBookingFromRevenueAccounting = excludeItemBookingFromRevenueAccounting;
}
public OrderLineItem revenueRecognitionTiming(String revenueRecognitionTiming) {
this.revenueRecognitionTiming = revenueRecognitionTiming;
return this;
}
/**
* This field is used to dictate the type of revenue recognition timing.
* @return revenueRecognitionTiming
*/
@javax.annotation.Nullable
public String getRevenueRecognitionTiming() {
return revenueRecognitionTiming;
}
public void setRevenueRecognitionTiming(String revenueRecognitionTiming) {
this.revenueRecognitionTiming = revenueRecognitionTiming;
}
public OrderLineItem revenueAmortizationMethod(String revenueAmortizationMethod) {
this.revenueAmortizationMethod = revenueAmortizationMethod;
return this;
}
/**
* This field is used to dictate the type of revenue amortization method.
* @return revenueAmortizationMethod
*/
@javax.annotation.Nullable
public String getRevenueAmortizationMethod() {
return revenueAmortizationMethod;
}
public void setRevenueAmortizationMethod(String revenueAmortizationMethod) {
this.revenueAmortizationMethod = revenueAmortizationMethod;
}
public OrderLineItem inlineDiscountPerUnit(BigDecimal inlineDiscountPerUnit) {
this.inlineDiscountPerUnit = inlineDiscountPerUnit;
return this;
}
/**
* This field is used in accordance with the `inlineDiscountType` field, in the following manner: * If the `inlineDiscountType` field is set as `Percentage`, this field specifies the discount percentage for each unit of the order line item. For exmaple, if you specify `5` in this field, the discount percentage is 5%. * If the `inlineDiscountType` field is set as `FixedAmount`, this field specifies the discount amount on each unit of the order line item. For exmaple, if you specify `10` in this field, the discount amount on each unit of the order line item is 10. Once you set the `inlineDiscountType`, `inlineDiscountPerUnit`, and `listPricePerUnit` fields, the system will automatically generate the `amountPerUnit` field. You shall not set the `amountPerUnit` field by yourself.
* @return inlineDiscountPerUnit
*/
@javax.annotation.Nullable
public BigDecimal getInlineDiscountPerUnit() {
return inlineDiscountPerUnit;
}
public void setInlineDiscountPerUnit(BigDecimal inlineDiscountPerUnit) {
this.inlineDiscountPerUnit = inlineDiscountPerUnit;
}
public OrderLineItem inlineDiscountType(OrderLineItemInlineDiscountType inlineDiscountType) {
this.inlineDiscountType = inlineDiscountType;
return this;
}
/**
* Get inlineDiscountType
* @return inlineDiscountType
*/
@javax.annotation.Nullable
public OrderLineItemInlineDiscountType getInlineDiscountType() {
return inlineDiscountType;
}
public void setInlineDiscountType(OrderLineItemInlineDiscountType inlineDiscountType) {
this.inlineDiscountType = inlineDiscountType;
}
public OrderLineItem invoiceGroupNumber(String invoiceGroupNumber) {
this.invoiceGroupNumber = invoiceGroupNumber;
return this;
}
/**
* The invoice group number associated with the order line item.
* @return invoiceGroupNumber
*/
@javax.annotation.Nullable
public String getInvoiceGroupNumber() {
return invoiceGroupNumber;
}
public void setInvoiceGroupNumber(String invoiceGroupNumber) {
this.invoiceGroupNumber = invoiceGroupNumber;
}
public OrderLineItem invoiceOwnerAccountId(String invoiceOwnerAccountId) {
this.invoiceOwnerAccountId = invoiceOwnerAccountId;
return this;
}
/**
* The account ID of the invoice owner of the order line item.
* @return invoiceOwnerAccountId
*/
@javax.annotation.Nullable
public String getInvoiceOwnerAccountId() {
return invoiceOwnerAccountId;
}
public void setInvoiceOwnerAccountId(String invoiceOwnerAccountId) {
this.invoiceOwnerAccountId = invoiceOwnerAccountId;
}
public OrderLineItem invoiceOwnerAccountName(String invoiceOwnerAccountName) {
this.invoiceOwnerAccountName = invoiceOwnerAccountName;
return this;
}
/**
* The account name of the invoice owner of the order line item.
* @return invoiceOwnerAccountName
*/
@javax.annotation.Nullable
public String getInvoiceOwnerAccountName() {
return invoiceOwnerAccountName;
}
public void setInvoiceOwnerAccountName(String invoiceOwnerAccountName) {
this.invoiceOwnerAccountName = invoiceOwnerAccountName;
}
public OrderLineItem invoiceOwnerAccountNumber(String invoiceOwnerAccountNumber) {
this.invoiceOwnerAccountNumber = invoiceOwnerAccountNumber;
return this;
}
/**
* The account number of the invoice owner of the order line item.
* @return invoiceOwnerAccountNumber
*/
@javax.annotation.Nullable
public String getInvoiceOwnerAccountNumber() {
return invoiceOwnerAccountNumber;
}
public void setInvoiceOwnerAccountNumber(String invoiceOwnerAccountNumber) {
this.invoiceOwnerAccountNumber = invoiceOwnerAccountNumber;
}
public OrderLineItem isAllocationEligible(Boolean isAllocationEligible) {
this.isAllocationEligible = isAllocationEligible;
return this;
}
/**
* This field is used to identify if the charge segment is allocation eligible in revenue recognition. **Note**: This feature is in the **Early Adopter** phase. If you want to use the feature, submit a request at <a href=\"https://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a>, and we will evaluate whether the feature is suitable for your use cases.
* @return isAllocationEligible
*/
@javax.annotation.Nullable
public Boolean getIsAllocationEligible() {
return isAllocationEligible;
}
public void setIsAllocationEligible(Boolean isAllocationEligible) {
this.isAllocationEligible = isAllocationEligible;
}
public OrderLineItem isUnbilled(Boolean isUnbilled) {
this.isUnbilled = isUnbilled;
return this;
}
/**
* This field is used to dictate how to perform the accounting during revenue recognition. **Note**: This feature is in the **Early Adopter** phase. If you want to use the feature, submit a request at <a href=\"https://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a>, and we will evaluate whether the feature is suitable for your use cases.
* @return isUnbilled
*/
@javax.annotation.Nullable
public Boolean getIsUnbilled() {
return isUnbilled;
}
public void setIsUnbilled(Boolean isUnbilled) {
this.isUnbilled = isUnbilled;
}
public OrderLineItem itemCategory(OrderLineItemCategory itemCategory) {
this.itemCategory = itemCategory;
return this;
}
/**
* Get itemCategory
* @return itemCategory
*/
@javax.annotation.Nullable
public OrderLineItemCategory getItemCategory() {
return itemCategory;
}
public void setItemCategory(OrderLineItemCategory itemCategory) {
this.itemCategory = itemCategory;
}
public OrderLineItem itemName(String itemName) {
this.itemName = itemName;
return this;
}
/**
* The name of the Order Line Item.
* @return itemName
*/
@javax.annotation.Nullable
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public OrderLineItem itemState(OrderLineItemState itemState) {
this.itemState = itemState;
return this;
}
/**
* Get itemState
* @return itemState
*/
@javax.annotation.Nullable
public OrderLineItemState getItemState() {
return itemState;
}
public void setItemState(OrderLineItemState itemState) {
this.itemState = itemState;
}
public OrderLineItem itemType(OrderLineItemType itemType) {
this.itemType = itemType;
return this;
}
/**
* Get itemType
* @return itemType
*/
@javax.annotation.Nullable
public OrderLineItemType getItemType() {
return itemType;
}
public void setItemType(OrderLineItemType itemType) {
this.itemType = itemType;
}
public OrderLineItem listPrice(BigDecimal listPrice) {
this.listPrice = listPrice;
return this;
}
/**
* The extended list price for an order line item, calculated by the formula: listPrice = listPricePerUnit * quantity
* @return listPrice
*/
@javax.annotation.Nullable
public BigDecimal getListPrice() {
return listPrice;
}
public void setListPrice(BigDecimal listPrice) {
this.listPrice = listPrice;
}
public OrderLineItem listPricePerUnit(BigDecimal listPricePerUnit) {
this.listPricePerUnit = listPricePerUnit;
return this;
}
/**
* The list price per unit for the Order Line Item.
* @return listPricePerUnit
*/
@javax.annotation.Nullable
public BigDecimal getListPricePerUnit() {
return listPricePerUnit;
}
public void setListPricePerUnit(BigDecimal listPricePerUnit) {
this.listPricePerUnit = listPricePerUnit;
}
public OrderLineItem originalOrderId(String originalOrderId) {
this.originalOrderId = originalOrderId;
return this;
}
/**
* The ID of the original sale order for a return order line item.
* @return originalOrderId
*/
@javax.annotation.Nullable
public String getOriginalOrderId() {
return originalOrderId;
}
public void setOriginalOrderId(String originalOrderId) {
this.originalOrderId = originalOrderId;
}
public OrderLineItem originalOrderDate(LocalDate originalOrderDate) {
this.originalOrderDate = originalOrderDate;
return this;
}
/**
* The date when the rate plan charge is created through an order or amendment. This field is to standardize the booking date information to increase audit ability and traceability of data between Zuora Billing and Zuora Revenue. It is mapped as the booking date for a sale order line in Zuora Revenue.
* @return originalOrderDate
*/
@javax.annotation.Nullable
public LocalDate getOriginalOrderDate() {
return originalOrderDate;
}
public void setOriginalOrderDate(LocalDate originalOrderDate) {
this.originalOrderDate = originalOrderDate;
}
public OrderLineItem originalOrderLineItemId(String originalOrderLineItemId) {
this.originalOrderLineItemId = originalOrderLineItemId;
return this;
}
/**
* The ID of the original sale order line item for a return order line item.
* @return originalOrderLineItemId
*/
@javax.annotation.Nullable
public String getOriginalOrderLineItemId() {
return originalOrderLineItemId;
}
public void setOriginalOrderLineItemId(String originalOrderLineItemId) {
this.originalOrderLineItemId = originalOrderLineItemId;
}
public OrderLineItem originalOrderLineItemNumber(String originalOrderLineItemNumber) {
this.originalOrderLineItemNumber = originalOrderLineItemNumber;
return this;
}
/**
* The number of the original sale order line item for a return order line item.
* @return originalOrderLineItemNumber
*/
@javax.annotation.Nullable
public String getOriginalOrderLineItemNumber() {
return originalOrderLineItemNumber;
}
public void setOriginalOrderLineItemNumber(String originalOrderLineItemNumber) {
this.originalOrderLineItemNumber = originalOrderLineItemNumber;
}
public OrderLineItem originalOrderNumber(String originalOrderNumber) {
this.originalOrderNumber = originalOrderNumber;
return this;
}
/**
* The number of the original sale order for a return order line item.
* @return originalOrderNumber
*/
@javax.annotation.Nullable
public String getOriginalOrderNumber() {
return originalOrderNumber;
}
public void setOriginalOrderNumber(String originalOrderNumber) {
this.originalOrderNumber = originalOrderNumber;
}
public OrderLineItem ownerAccountId(String ownerAccountId) {
this.ownerAccountId = ownerAccountId;
return this;
}
/**
* The account ID of the owner of the order line item.
* @return ownerAccountId
*/
@javax.annotation.Nullable
public String getOwnerAccountId() {
return ownerAccountId;
}
public void setOwnerAccountId(String ownerAccountId) {
this.ownerAccountId = ownerAccountId;
}
public OrderLineItem ownerAccountName(String ownerAccountName) {
this.ownerAccountName = ownerAccountName;
return this;
}
/**
* The account name of the owner of the order line item.
* @return ownerAccountName
*/
@javax.annotation.Nullable
public String getOwnerAccountName() {
return ownerAccountName;
}
public void setOwnerAccountName(String ownerAccountName) {
this.ownerAccountName = ownerAccountName;
}
public OrderLineItem ownerAccountNumber(String ownerAccountNumber) {
this.ownerAccountNumber = ownerAccountNumber;
return this;
}
/**
* The account number of the owner of the order line item.
* @return ownerAccountNumber
*/
@javax.annotation.Nullable
public String getOwnerAccountNumber() {
return ownerAccountNumber;
}
public void setOwnerAccountNumber(String ownerAccountNumber) {
this.ownerAccountNumber = ownerAccountNumber;
}
public OrderLineItem productCode(String productCode) {
this.productCode = productCode;
return this;
}
/**
* The product code for the Order Line Item.
* @return productCode
*/
@javax.annotation.Nullable
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public OrderLineItem productRatePlanChargeId(String productRatePlanChargeId) {
this.productRatePlanChargeId = productRatePlanChargeId;
return this;
}
/**
* Id of a Product Rate Plan Charge. Only one-time charges are supported.
* @return productRatePlanChargeId
*/
@javax.annotation.Nullable
public String getProductRatePlanChargeId() {
return productRatePlanChargeId;
}
public void setProductRatePlanChargeId(String productRatePlanChargeId) {
this.productRatePlanChargeId = productRatePlanChargeId;
}
public OrderLineItem purchaseOrderNumber(String purchaseOrderNumber) {
this.purchaseOrderNumber = purchaseOrderNumber;
return this;
}
/**
* Used by customers to specify the Purchase Order Number provided by the buyer.
* @return purchaseOrderNumber
*/
@javax.annotation.Nullable
public String getPurchaseOrderNumber() {
return purchaseOrderNumber;
}
public void setPurchaseOrderNumber(String purchaseOrderNumber) {
this.purchaseOrderNumber = purchaseOrderNumber;
}
public OrderLineItem quantity(BigDecimal quantity) {
this.quantity = quantity;
return this;
}
/**
* The quantity of units, such as the number of authors in a hosted wiki service.
* @return quantity
*/
@javax.annotation.Nullable
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public OrderLineItem quantityAvailableForReturn(BigDecimal quantityAvailableForReturn) {
this.quantityAvailableForReturn = quantityAvailableForReturn;
return this;
}
/**
* The quantity that can be returned for an order line item.
* @return quantityAvailableForReturn
*/
@javax.annotation.Nullable
public BigDecimal getQuantityAvailableForReturn() {
return quantityAvailableForReturn;
}
public void setQuantityAvailableForReturn(BigDecimal quantityAvailableForReturn) {
this.quantityAvailableForReturn = quantityAvailableForReturn;
}
public OrderLineItem quantityFulfilled(BigDecimal quantityFulfilled) {
this.quantityFulfilled = quantityFulfilled;
return this;
}
/**
* The quantity that has been fulfilled by fulfillments for the order line item. This field will be updated automatically when related fulfillments become 'SentToBilling' or 'Complete' state.
* @return quantityFulfilled
*/
@javax.annotation.Nullable
public BigDecimal getQuantityFulfilled() {
return quantityFulfilled;
}
public void setQuantityFulfilled(BigDecimal quantityFulfilled) {
this.quantityFulfilled = quantityFulfilled;
}
public OrderLineItem quantityPendingFulfillment(BigDecimal quantityPendingFulfillment) {
this.quantityPendingFulfillment = quantityPendingFulfillment;
return this;
}
/**
* The quantity that's need to be fulfilled by fulfillments for the order line item. This field will be updated automatically when related fulfillments become 'SentToBilling' or 'Complete' state.
* @return quantityPendingFulfillment
*/
@javax.annotation.Nullable
public BigDecimal getQuantityPendingFulfillment() {
return quantityPendingFulfillment;
}
public void setQuantityPendingFulfillment(BigDecimal quantityPendingFulfillment) {
this.quantityPendingFulfillment = quantityPendingFulfillment;
}
public OrderLineItem recognizedRevenueAccountingCode(String recognizedRevenueAccountingCode) {
this.recognizedRevenueAccountingCode = recognizedRevenueAccountingCode;
return this;
}
/**
* The recognized revenue accounting code for the Order Line Item.
* @return recognizedRevenueAccountingCode
*/
@javax.annotation.Nullable
public String getRecognizedRevenueAccountingCode() {
return recognizedRevenueAccountingCode;
}
public void setRecognizedRevenueAccountingCode(String recognizedRevenueAccountingCode) {
this.recognizedRevenueAccountingCode = recognizedRevenueAccountingCode;
}
public OrderLineItem relatedSubscriptionNumber(String relatedSubscriptionNumber) {
this.relatedSubscriptionNumber = relatedSubscriptionNumber;
return this;
}
/**
* Use this field to relate an order line item to a subscription when you create the order line item. * To relate an order line item to a new subscription which is yet to create in the same \"Create an order\" call, use this field in combination with the `subscriptions` > `subscriptionNumber` field in the \"Create order\" operation. Specify this field to the same value as that of the 'subscriptions' > `subscriptionNumber` field when you make the \"Create order\" call. * To relate an order line item to an existing subscription, specify this field to the subscription number of the existing subscription.
* @return relatedSubscriptionNumber
*/
@javax.annotation.Nullable
public String getRelatedSubscriptionNumber() {
return relatedSubscriptionNumber;
}
public void setRelatedSubscriptionNumber(String relatedSubscriptionNumber) {
this.relatedSubscriptionNumber = relatedSubscriptionNumber;
}
public OrderLineItem requiresFulfillment(Boolean requiresFulfillment) {
this.requiresFulfillment = requiresFulfillment;
return this;
}
/**
* The flag to show whether fulfillment is needed or not. It's derived from billing rule of the Order Line Item.
* @return requiresFulfillment
*/
@javax.annotation.Nullable
public Boolean getRequiresFulfillment() {
return requiresFulfillment;
}
public void setRequiresFulfillment(Boolean requiresFulfillment) {
this.requiresFulfillment = requiresFulfillment;
}
public OrderLineItem revenueRecognitionRule(String revenueRecognitionRule) {
this.revenueRecognitionRule = revenueRecognitionRule;
return this;
}
/**
* The Revenue Recognition rule for the Order Line Item.
* @return revenueRecognitionRule
*/
@javax.annotation.Nullable
public String getRevenueRecognitionRule() {
return revenueRecognitionRule;
}
public void setRevenueRecognitionRule(String revenueRecognitionRule) {
this.revenueRecognitionRule = revenueRecognitionRule;
}
public OrderLineItem sequenceSetId(String sequenceSetId) {
this.sequenceSetId = sequenceSetId;
return this;
}
/**
* The ID of the sequence set associated with the OrderLineItem.
* @return sequenceSetId
*/
@javax.annotation.Nullable
public String getSequenceSetId() {
return sequenceSetId;
}
public void setSequenceSetId(String sequenceSetId) {
this.sequenceSetId = sequenceSetId;
}
public OrderLineItem soldTo(String soldTo) {
this.soldTo = soldTo;
return this;
}
/**
* The ID of a contact that belongs to the owner acount or billing account of the order line item. Use this field to assign an existing account as the sold-to contact of an order line item.
* @return soldTo
*/
@javax.annotation.Nullable
public String getSoldTo() {
return soldTo;
}
public void setSoldTo(String soldTo) {
this.soldTo = soldTo;
}
public OrderLineItem soldToSnapshotId(String soldToSnapshotId) {
this.soldToSnapshotId = soldToSnapshotId;
return this;
}
/**
* The snapshot of the ID for an account used as the sold-to contact of an order line item. This field is used to store the original information about the account, in case the information about the account is changed after the creation of the order line item. The `soldToSnapshotId` field is exposed while retrieving the order line item details.
* @return soldToSnapshotId
*/
@javax.annotation.Nullable
public String getSoldToSnapshotId() {
return soldToSnapshotId;
}
public void setSoldToSnapshotId(String soldToSnapshotId) {
this.soldToSnapshotId = soldToSnapshotId;
}
public OrderLineItem shipTo(String shipTo) {
this.shipTo = shipTo;
return this;
}
/**
* The ID of a contact that belongs to the owner account or billing account of the order line item. Use this field to assign an existing account as the ship-to contact of an order line item.
* @return shipTo
*/
@javax.annotation.Nullable
public String getShipTo() {
return shipTo;
}
public void setShipTo(String shipTo) {
this.shipTo = shipTo;
}
public OrderLineItem shipToSnapshotId(String shipToSnapshotId) {
this.shipToSnapshotId = shipToSnapshotId;
return this;
}
/**
* The snapshot of the ID for an account used as the ship-to contact of an order line item. This field is used to store the original information about the account, in case the information about the account is changed after the creation of the order line item. The `shipToSnapshotId` field is exposed while retrieving the order line item details.
* @return shipToSnapshotId
*/
@javax.annotation.Nullable
public String getShipToSnapshotId() {
return shipToSnapshotId;
}
public void setShipToSnapshotId(String shipToSnapshotId) {
this.shipToSnapshotId = shipToSnapshotId;
}
public OrderLineItem taxCode(String taxCode) {
this.taxCode = taxCode;
return this;
}
/**
* The tax code for the Order Line Item.
* @return taxCode
*/
@javax.annotation.Nullable
public String getTaxCode() {
return taxCode;
}
public void setTaxCode(String taxCode) {
this.taxCode = taxCode;
}
public OrderLineItem taxMode(TaxMode taxMode) {
this.taxMode = taxMode;
return this;
}
/**
* Get taxMode
* @return taxMode
*/
@javax.annotation.Nullable
public TaxMode getTaxMode() {
return taxMode;
}
public void setTaxMode(TaxMode taxMode) {
this.taxMode = taxMode;
}
public OrderLineItem transactionEndDate(LocalDate transactionEndDate) {
this.transactionEndDate = transactionEndDate;
return this;
}
/**
* The date a transaction is completed. The default value of this field is the transaction start date. Also, the value of this field should always equal or be later than the value of the `transactionStartDate` field.
* @return transactionEndDate
*/
@javax.annotation.Nullable
public LocalDate getTransactionEndDate() {
return transactionEndDate;
}
public void setTransactionEndDate(LocalDate transactionEndDate) {
this.transactionEndDate = transactionEndDate;
}
public OrderLineItem transactionStartDate(LocalDate transactionStartDate) {
this.transactionStartDate = transactionStartDate;
return this;
}
/**
* The date a transaction starts. The default value of this field is the order date.
* @return transactionStartDate
*/
@javax.annotation.Nullable
public LocalDate getTransactionStartDate() {
return transactionStartDate;
}
public void setTransactionStartDate(LocalDate transactionStartDate) {
this.transactionStartDate = transactionStartDate;
}
public OrderLineItem unbilledReceivablesAccountingCode(String unbilledReceivablesAccountingCode) {
this.unbilledReceivablesAccountingCode = unbilledReceivablesAccountingCode;
return this;
}
/**
* The accounting code on the Order Line Item object for customers using [Zuora Billing - Revenue Integration](https://knowledgecenter.zuora.com/Zuora_Revenue/Zuora_Billing_-_Revenue_Integration).
* @return unbilledReceivablesAccountingCode
*/
@javax.annotation.Nullable
public String getUnbilledReceivablesAccountingCode() {
return unbilledReceivablesAccountingCode;
}
public void setUnbilledReceivablesAccountingCode(String unbilledReceivablesAccountingCode) {
this.unbilledReceivablesAccountingCode = unbilledReceivablesAccountingCode;
}
/**
* 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 OrderLineItem instance itself
*/
public OrderLineItem 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;
}
OrderLineItem orderLineItem = (OrderLineItem) o;
return Objects.equals(this.id, orderLineItem.id) &&
Objects.equals(this.amendedByOrderOn, orderLineItem.amendedByOrderOn) &&
Objects.equals(this.currency, orderLineItem.currency) &&
Objects.equals(this.paymentTerm, orderLineItem.paymentTerm) &&
Objects.equals(this.invoiceTemplateId, orderLineItem.invoiceTemplateId) &&
Objects.equals(this.amount, orderLineItem.amount) &&
Objects.equals(this.amountWithoutTax, orderLineItem.amountWithoutTax) &&
Objects.equals(this.itemNumber, orderLineItem.itemNumber) &&
Objects.equals(this.UOM, orderLineItem.UOM) &&
Objects.equals(this.amountPerUnit, orderLineItem.amountPerUnit) &&
Objects.equals(this.billTargetDate, orderLineItem.billTargetDate) &&
Objects.equals(this.billTo, orderLineItem.billTo) &&
Objects.equals(this.billToSnapshotId, orderLineItem.billToSnapshotId) &&
Objects.equals(this.billingRule, orderLineItem.billingRule) &&
Objects.equals(this.accountingCode, orderLineItem.accountingCode) &&
Objects.equals(this.adjustmentLiabilityAccountingCode, orderLineItem.adjustmentLiabilityAccountingCode) &&
Objects.equals(this.adjustmentRevenueAccountingCode, orderLineItem.adjustmentRevenueAccountingCode) &&
Objects.equals(this.contractAssetAccountingCode, orderLineItem.contractAssetAccountingCode) &&
Objects.equals(this.contractLiabilityAccountingCode, orderLineItem.contractLiabilityAccountingCode) &&
Objects.equals(this.contractRecognizedRevenueAccountingCode, orderLineItem.contractRecognizedRevenueAccountingCode) &&
Objects.equals(this.deferredRevenueAccountingCode, orderLineItem.deferredRevenueAccountingCode) &&
Objects.equals(this.customFields, orderLineItem.customFields) &&
Objects.equals(this.description, orderLineItem.description) &&
Objects.equals(this.discount, orderLineItem.discount) &&
Objects.equals(this.excludeItemBillingFromRevenueAccounting, orderLineItem.excludeItemBillingFromRevenueAccounting) &&
Objects.equals(this.excludeItemBookingFromRevenueAccounting, orderLineItem.excludeItemBookingFromRevenueAccounting) &&
Objects.equals(this.revenueRecognitionTiming, orderLineItem.revenueRecognitionTiming) &&
Objects.equals(this.revenueAmortizationMethod, orderLineItem.revenueAmortizationMethod) &&
Objects.equals(this.inlineDiscountPerUnit, orderLineItem.inlineDiscountPerUnit) &&
Objects.equals(this.inlineDiscountType, orderLineItem.inlineDiscountType) &&
Objects.equals(this.invoiceGroupNumber, orderLineItem.invoiceGroupNumber) &&
Objects.equals(this.invoiceOwnerAccountId, orderLineItem.invoiceOwnerAccountId) &&
Objects.equals(this.invoiceOwnerAccountName, orderLineItem.invoiceOwnerAccountName) &&
Objects.equals(this.invoiceOwnerAccountNumber, orderLineItem.invoiceOwnerAccountNumber) &&
Objects.equals(this.isAllocationEligible, orderLineItem.isAllocationEligible) &&
Objects.equals(this.isUnbilled, orderLineItem.isUnbilled) &&
Objects.equals(this.itemCategory, orderLineItem.itemCategory) &&
Objects.equals(this.itemName, orderLineItem.itemName) &&
Objects.equals(this.itemState, orderLineItem.itemState) &&
Objects.equals(this.itemType, orderLineItem.itemType) &&
Objects.equals(this.listPrice, orderLineItem.listPrice) &&
Objects.equals(this.listPricePerUnit, orderLineItem.listPricePerUnit) &&
Objects.equals(this.originalOrderId, orderLineItem.originalOrderId) &&
Objects.equals(this.originalOrderDate, orderLineItem.originalOrderDate) &&
Objects.equals(this.originalOrderLineItemId, orderLineItem.originalOrderLineItemId) &&
Objects.equals(this.originalOrderLineItemNumber, orderLineItem.originalOrderLineItemNumber) &&
Objects.equals(this.originalOrderNumber, orderLineItem.originalOrderNumber) &&
Objects.equals(this.ownerAccountId, orderLineItem.ownerAccountId) &&
Objects.equals(this.ownerAccountName, orderLineItem.ownerAccountName) &&
Objects.equals(this.ownerAccountNumber, orderLineItem.ownerAccountNumber) &&
Objects.equals(this.productCode, orderLineItem.productCode) &&
Objects.equals(this.productRatePlanChargeId, orderLineItem.productRatePlanChargeId) &&
Objects.equals(this.purchaseOrderNumber, orderLineItem.purchaseOrderNumber) &&
Objects.equals(this.quantity, orderLineItem.quantity) &&
Objects.equals(this.quantityAvailableForReturn, orderLineItem.quantityAvailableForReturn) &&
Objects.equals(this.quantityFulfilled, orderLineItem.quantityFulfilled) &&
Objects.equals(this.quantityPendingFulfillment, orderLineItem.quantityPendingFulfillment) &&
Objects.equals(this.recognizedRevenueAccountingCode, orderLineItem.recognizedRevenueAccountingCode) &&
Objects.equals(this.relatedSubscriptionNumber, orderLineItem.relatedSubscriptionNumber) &&
Objects.equals(this.requiresFulfillment, orderLineItem.requiresFulfillment) &&
Objects.equals(this.revenueRecognitionRule, orderLineItem.revenueRecognitionRule) &&
Objects.equals(this.sequenceSetId, orderLineItem.sequenceSetId) &&
Objects.equals(this.soldTo, orderLineItem.soldTo) &&
Objects.equals(this.soldToSnapshotId, orderLineItem.soldToSnapshotId) &&
Objects.equals(this.shipTo, orderLineItem.shipTo) &&
Objects.equals(this.shipToSnapshotId, orderLineItem.shipToSnapshotId) &&
Objects.equals(this.taxCode, orderLineItem.taxCode) &&
Objects.equals(this.taxMode, orderLineItem.taxMode) &&
Objects.equals(this.transactionEndDate, orderLineItem.transactionEndDate) &&
Objects.equals(this.transactionStartDate, orderLineItem.transactionStartDate) &&
Objects.equals(this.unbilledReceivablesAccountingCode, orderLineItem.unbilledReceivablesAccountingCode)&&
Objects.equals(this.additionalProperties, orderLineItem.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(id, amendedByOrderOn, currency, paymentTerm, invoiceTemplateId, amount, amountWithoutTax, itemNumber, UOM, amountPerUnit, billTargetDate, billTo, billToSnapshotId, billingRule, accountingCode, adjustmentLiabilityAccountingCode, adjustmentRevenueAccountingCode, contractAssetAccountingCode, contractLiabilityAccountingCode, contractRecognizedRevenueAccountingCode, deferredRevenueAccountingCode, customFields, description, discount, excludeItemBillingFromRevenueAccounting, excludeItemBookingFromRevenueAccounting, revenueRecognitionTiming, revenueAmortizationMethod, inlineDiscountPerUnit, inlineDiscountType, invoiceGroupNumber, invoiceOwnerAccountId, invoiceOwnerAccountName, invoiceOwnerAccountNumber, isAllocationEligible, isUnbilled, itemCategory, itemName, itemState, itemType, listPrice, listPricePerUnit, originalOrderId, originalOrderDate, originalOrderLineItemId, originalOrderLineItemNumber, originalOrderNumber, ownerAccountId, ownerAccountName, ownerAccountNumber, productCode, productRatePlanChargeId, purchaseOrderNumber, quantity, quantityAvailableForReturn, quantityFulfilled, quantityPendingFulfillment, recognizedRevenueAccountingCode, relatedSubscriptionNumber, requiresFulfillment, revenueRecognitionRule, sequenceSetId, soldTo, soldToSnapshotId, shipTo, shipToSnapshotId, taxCode, taxMode, transactionEndDate, transactionStartDate, unbilledReceivablesAccountingCode, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrderLineItem {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" amendedByOrderOn: ").append(toIndentedString(amendedByOrderOn)).append("\n");
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
sb.append(" paymentTerm: ").append(toIndentedString(paymentTerm)).append("\n");
sb.append(" invoiceTemplateId: ").append(toIndentedString(invoiceTemplateId)).append("\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" amountWithoutTax: ").append(toIndentedString(amountWithoutTax)).append("\n");
sb.append(" itemNumber: ").append(toIndentedString(itemNumber)).append("\n");
sb.append(" UOM: ").append(toIndentedString(UOM)).append("\n");
sb.append(" amountPerUnit: ").append(toIndentedString(amountPerUnit)).append("\n");
sb.append(" billTargetDate: ").append(toIndentedString(billTargetDate)).append("\n");
sb.append(" billTo: ").append(toIndentedString(billTo)).append("\n");
sb.append(" billToSnapshotId: ").append(toIndentedString(billToSnapshotId)).append("\n");
sb.append(" billingRule: ").append(toIndentedString(billingRule)).append("\n");
sb.append(" accountingCode: ").append(toIndentedString(accountingCode)).append("\n");
sb.append(" adjustmentLiabilityAccountingCode: ").append(toIndentedString(adjustmentLiabilityAccountingCode)).append("\n");
sb.append(" adjustmentRevenueAccountingCode: ").append(toIndentedString(adjustmentRevenueAccountingCode)).append("\n");
sb.append(" contractAssetAccountingCode: ").append(toIndentedString(contractAssetAccountingCode)).append("\n");
sb.append(" contractLiabilityAccountingCode: ").append(toIndentedString(contractLiabilityAccountingCode)).append("\n");
sb.append(" contractRecognizedRevenueAccountingCode: ").append(toIndentedString(contractRecognizedRevenueAccountingCode)).append("\n");
sb.append(" deferredRevenueAccountingCode: ").append(toIndentedString(deferredRevenueAccountingCode)).append("\n");
sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" discount: ").append(toIndentedString(discount)).append("\n");
sb.append(" excludeItemBillingFromRevenueAccounting: ").append(toIndentedString(excludeItemBillingFromRevenueAccounting)).append("\n");
sb.append(" excludeItemBookingFromRevenueAccounting: ").append(toIndentedString(excludeItemBookingFromRevenueAccounting)).append("\n");
sb.append(" revenueRecognitionTiming: ").append(toIndentedString(revenueRecognitionTiming)).append("\n");
sb.append(" revenueAmortizationMethod: ").append(toIndentedString(revenueAmortizationMethod)).append("\n");
sb.append(" inlineDiscountPerUnit: ").append(toIndentedString(inlineDiscountPerUnit)).append("\n");
sb.append(" inlineDiscountType: ").append(toIndentedString(inlineDiscountType)).append("\n");
sb.append(" invoiceGroupNumber: ").append(toIndentedString(invoiceGroupNumber)).append("\n");
sb.append(" invoiceOwnerAccountId: ").append(toIndentedString(invoiceOwnerAccountId)).append("\n");
sb.append(" invoiceOwnerAccountName: ").append(toIndentedString(invoiceOwnerAccountName)).append("\n");
sb.append(" invoiceOwnerAccountNumber: ").append(toIndentedString(invoiceOwnerAccountNumber)).append("\n");
sb.append(" isAllocationEligible: ").append(toIndentedString(isAllocationEligible)).append("\n");
sb.append(" isUnbilled: ").append(toIndentedString(isUnbilled)).append("\n");
sb.append(" itemCategory: ").append(toIndentedString(itemCategory)).append("\n");
sb.append(" itemName: ").append(toIndentedString(itemName)).append("\n");
sb.append(" itemState: ").append(toIndentedString(itemState)).append("\n");
sb.append(" itemType: ").append(toIndentedString(itemType)).append("\n");
sb.append(" listPrice: ").append(toIndentedString(listPrice)).append("\n");
sb.append(" listPricePerUnit: ").append(toIndentedString(listPricePerUnit)).append("\n");
sb.append(" originalOrderId: ").append(toIndentedString(originalOrderId)).append("\n");
sb.append(" originalOrderDate: ").append(toIndentedString(originalOrderDate)).append("\n");
sb.append(" originalOrderLineItemId: ").append(toIndentedString(originalOrderLineItemId)).append("\n");
sb.append(" originalOrderLineItemNumber: ").append(toIndentedString(originalOrderLineItemNumber)).append("\n");
sb.append(" originalOrderNumber: ").append(toIndentedString(originalOrderNumber)).append("\n");
sb.append(" ownerAccountId: ").append(toIndentedString(ownerAccountId)).append("\n");
sb.append(" ownerAccountName: ").append(toIndentedString(ownerAccountName)).append("\n");
sb.append(" ownerAccountNumber: ").append(toIndentedString(ownerAccountNumber)).append("\n");
sb.append(" productCode: ").append(toIndentedString(productCode)).append("\n");
sb.append(" productRatePlanChargeId: ").append(toIndentedString(productRatePlanChargeId)).append("\n");
sb.append(" purchaseOrderNumber: ").append(toIndentedString(purchaseOrderNumber)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" quantityAvailableForReturn: ").append(toIndentedString(quantityAvailableForReturn)).append("\n");
sb.append(" quantityFulfilled: ").append(toIndentedString(quantityFulfilled)).append("\n");
sb.append(" quantityPendingFulfillment: ").append(toIndentedString(quantityPendingFulfillment)).append("\n");
sb.append(" recognizedRevenueAccountingCode: ").append(toIndentedString(recognizedRevenueAccountingCode)).append("\n");
sb.append(" relatedSubscriptionNumber: ").append(toIndentedString(relatedSubscriptionNumber)).append("\n");
sb.append(" requiresFulfillment: ").append(toIndentedString(requiresFulfillment)).append("\n");
sb.append(" revenueRecognitionRule: ").append(toIndentedString(revenueRecognitionRule)).append("\n");
sb.append(" sequenceSetId: ").append(toIndentedString(sequenceSetId)).append("\n");
sb.append(" soldTo: ").append(toIndentedString(soldTo)).append("\n");
sb.append(" soldToSnapshotId: ").append(toIndentedString(soldToSnapshotId)).append("\n");
sb.append(" shipTo: ").append(toIndentedString(shipTo)).append("\n");
sb.append(" shipToSnapshotId: ").append(toIndentedString(shipToSnapshotId)).append("\n");
sb.append(" taxCode: ").append(toIndentedString(taxCode)).append("\n");
sb.append(" taxMode: ").append(toIndentedString(taxMode)).append("\n");
sb.append(" transactionEndDate: ").append(toIndentedString(transactionEndDate)).append("\n");
sb.append(" transactionStartDate: ").append(toIndentedString(transactionStartDate)).append("\n");
sb.append(" unbilledReceivablesAccountingCode: ").append(toIndentedString(unbilledReceivablesAccountingCode)).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("id");
openapiFields.add("amendedByOrderOn");
openapiFields.add("currency");
openapiFields.add("paymentTerm");
openapiFields.add("invoiceTemplateId");
openapiFields.add("amount");
openapiFields.add("amountWithoutTax");
openapiFields.add("itemNumber");
openapiFields.add("UOM");
openapiFields.add("amountPerUnit");
openapiFields.add("billTargetDate");
openapiFields.add("billTo");
openapiFields.add("billToSnapshotId");
openapiFields.add("billingRule");
openapiFields.add("accountingCode");
openapiFields.add("adjustmentLiabilityAccountingCode");
openapiFields.add("adjustmentRevenueAccountingCode");
openapiFields.add("contractAssetAccountingCode");
openapiFields.add("contractLiabilityAccountingCode");
openapiFields.add("contractRecognizedRevenueAccountingCode");
openapiFields.add("deferredRevenueAccountingCode");
openapiFields.add("customFields");
openapiFields.add("description");
openapiFields.add("discount");
openapiFields.add("excludeItemBillingFromRevenueAccounting");
openapiFields.add("excludeItemBookingFromRevenueAccounting");
openapiFields.add("revenueRecognitionTiming");
openapiFields.add("revenueAmortizationMethod");
openapiFields.add("inlineDiscountPerUnit");
openapiFields.add("inlineDiscountType");
openapiFields.add("invoiceGroupNumber");
openapiFields.add("invoiceOwnerAccountId");
openapiFields.add("invoiceOwnerAccountName");
openapiFields.add("invoiceOwnerAccountNumber");
openapiFields.add("isAllocationEligible");
openapiFields.add("isUnbilled");
openapiFields.add("itemCategory");
openapiFields.add("itemName");
openapiFields.add("itemState");
openapiFields.add("itemType");
openapiFields.add("listPrice");
openapiFields.add("listPricePerUnit");
openapiFields.add("originalOrderId");
openapiFields.add("originalOrderDate");
openapiFields.add("originalOrderLineItemId");
openapiFields.add("originalOrderLineItemNumber");
openapiFields.add("originalOrderNumber");
openapiFields.add("ownerAccountId");
openapiFields.add("ownerAccountName");
openapiFields.add("ownerAccountNumber");
openapiFields.add("productCode");
openapiFields.add("productRatePlanChargeId");
openapiFields.add("purchaseOrderNumber");
openapiFields.add("quantity");
openapiFields.add("quantityAvailableForReturn");
openapiFields.add("quantityFulfilled");
openapiFields.add("quantityPendingFulfillment");
openapiFields.add("recognizedRevenueAccountingCode");
openapiFields.add("relatedSubscriptionNumber");
openapiFields.add("requiresFulfillment");
openapiFields.add("revenueRecognitionRule");
openapiFields.add("sequenceSetId");
openapiFields.add("soldTo");
openapiFields.add("soldToSnapshotId");
openapiFields.add("shipTo");
openapiFields.add("shipToSnapshotId");
openapiFields.add("taxCode");
openapiFields.add("taxMode");
openapiFields.add("transactionEndDate");
openapiFields.add("transactionStartDate");
openapiFields.add("unbilledReceivablesAccountingCode");
// 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 OrderLineItem
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!OrderLineItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in OrderLineItem is not found in the empty JSON string", OrderLineItem.openapiRequiredFields.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
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("amendedByOrderOn") != null && !jsonObj.get("amendedByOrderOn").isJsonNull()) && !jsonObj.get("amendedByOrderOn").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `amendedByOrderOn` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amendedByOrderOn").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("paymentTerm") != null && !jsonObj.get("paymentTerm").isJsonNull()) && !jsonObj.get("paymentTerm").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `paymentTerm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentTerm").toString()));
}
if ((jsonObj.get("invoiceTemplateId") != null && !jsonObj.get("invoiceTemplateId").isJsonNull()) && !jsonObj.get("invoiceTemplateId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `invoiceTemplateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceTemplateId").toString()));
}
if ((jsonObj.get("itemNumber") != null && !jsonObj.get("itemNumber").isJsonNull()) && !jsonObj.get("itemNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `itemNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemNumber").toString()));
}
if ((jsonObj.get("UOM") != null && !jsonObj.get("UOM").isJsonNull()) && !jsonObj.get("UOM").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `UOM` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UOM").toString()));
}
if ((jsonObj.get("billTo") != null && !jsonObj.get("billTo").isJsonNull()) && !jsonObj.get("billTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `billTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billTo").toString()));
}
if ((jsonObj.get("billToSnapshotId") != null && !jsonObj.get("billToSnapshotId").isJsonNull()) && !jsonObj.get("billToSnapshotId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `billToSnapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billToSnapshotId").toString()));
}
// validate the optional field `billingRule`
if (jsonObj.get("billingRule") != null && !jsonObj.get("billingRule").isJsonNull()) {
OrderLineItemBillingRule.validateJsonElement(jsonObj.get("billingRule"));
}
if ((jsonObj.get("accountingCode") != null && !jsonObj.get("accountingCode").isJsonNull()) && !jsonObj.get("accountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `accountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountingCode").toString()));
}
if ((jsonObj.get("adjustmentLiabilityAccountingCode") != null && !jsonObj.get("adjustmentLiabilityAccountingCode").isJsonNull()) && !jsonObj.get("adjustmentLiabilityAccountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `adjustmentLiabilityAccountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("adjustmentLiabilityAccountingCode").toString()));
}
if ((jsonObj.get("adjustmentRevenueAccountingCode") != null && !jsonObj.get("adjustmentRevenueAccountingCode").isJsonNull()) && !jsonObj.get("adjustmentRevenueAccountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `adjustmentRevenueAccountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("adjustmentRevenueAccountingCode").toString()));
}
if ((jsonObj.get("contractAssetAccountingCode") != null && !jsonObj.get("contractAssetAccountingCode").isJsonNull()) && !jsonObj.get("contractAssetAccountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contractAssetAccountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAssetAccountingCode").toString()));
}
if ((jsonObj.get("contractLiabilityAccountingCode") != null && !jsonObj.get("contractLiabilityAccountingCode").isJsonNull()) && !jsonObj.get("contractLiabilityAccountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contractLiabilityAccountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractLiabilityAccountingCode").toString()));
}
if ((jsonObj.get("contractRecognizedRevenueAccountingCode") != null && !jsonObj.get("contractRecognizedRevenueAccountingCode").isJsonNull()) && !jsonObj.get("contractRecognizedRevenueAccountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contractRecognizedRevenueAccountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractRecognizedRevenueAccountingCode").toString()));
}
if ((jsonObj.get("deferredRevenueAccountingCode") != null && !jsonObj.get("deferredRevenueAccountingCode").isJsonNull()) && !jsonObj.get("deferredRevenueAccountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `deferredRevenueAccountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deferredRevenueAccountingCode").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
if ((jsonObj.get("revenueRecognitionTiming") != null && !jsonObj.get("revenueRecognitionTiming").isJsonNull()) && !jsonObj.get("revenueRecognitionTiming").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `revenueRecognitionTiming` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revenueRecognitionTiming").toString()));
}
if ((jsonObj.get("revenueAmortizationMethod") != null && !jsonObj.get("revenueAmortizationMethod").isJsonNull()) && !jsonObj.get("revenueAmortizationMethod").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `revenueAmortizationMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revenueAmortizationMethod").toString()));
}
if ((jsonObj.get("inlineDiscountType") != null && !jsonObj.get("inlineDiscountType").isJsonNull()) && !jsonObj.get("inlineDiscountType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inlineDiscountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inlineDiscountType").toString()));
}
// validate the optional field `inlineDiscountType`
if (jsonObj.get("inlineDiscountType") != null && !jsonObj.get("inlineDiscountType").isJsonNull()) {
OrderLineItemInlineDiscountType.validateJsonElement(jsonObj.get("inlineDiscountType"));
}
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("invoiceOwnerAccountId") != null && !jsonObj.get("invoiceOwnerAccountId").isJsonNull()) && !jsonObj.get("invoiceOwnerAccountId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `invoiceOwnerAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceOwnerAccountId").toString()));
}
if ((jsonObj.get("invoiceOwnerAccountName") != null && !jsonObj.get("invoiceOwnerAccountName").isJsonNull()) && !jsonObj.get("invoiceOwnerAccountName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `invoiceOwnerAccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceOwnerAccountName").toString()));
}
if ((jsonObj.get("invoiceOwnerAccountNumber") != null && !jsonObj.get("invoiceOwnerAccountNumber").isJsonNull()) && !jsonObj.get("invoiceOwnerAccountNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `invoiceOwnerAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceOwnerAccountNumber").toString()));
}
// validate the optional field `itemCategory`
if (jsonObj.get("itemCategory") != null && !jsonObj.get("itemCategory").isJsonNull()) {
OrderLineItemCategory.validateJsonElement(jsonObj.get("itemCategory"));
}
if ((jsonObj.get("itemName") != null && !jsonObj.get("itemName").isJsonNull()) && !jsonObj.get("itemName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `itemName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemName").toString()));
}
// validate the optional field `itemState`
if (jsonObj.get("itemState") != null && !jsonObj.get("itemState").isJsonNull()) {
OrderLineItemState.validateJsonElement(jsonObj.get("itemState"));
}
// validate the optional field `itemType`
if (jsonObj.get("itemType") != null && !jsonObj.get("itemType").isJsonNull()) {
OrderLineItemType.validateJsonElement(jsonObj.get("itemType"));
}
if ((jsonObj.get("originalOrderId") != null && !jsonObj.get("originalOrderId").isJsonNull()) && !jsonObj.get("originalOrderId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `originalOrderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalOrderId").toString()));
}
if ((jsonObj.get("originalOrderLineItemId") != null && !jsonObj.get("originalOrderLineItemId").isJsonNull()) && !jsonObj.get("originalOrderLineItemId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `originalOrderLineItemId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalOrderLineItemId").toString()));
}
if ((jsonObj.get("originalOrderLineItemNumber") != null && !jsonObj.get("originalOrderLineItemNumber").isJsonNull()) && !jsonObj.get("originalOrderLineItemNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `originalOrderLineItemNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalOrderLineItemNumber").toString()));
}
if ((jsonObj.get("originalOrderNumber") != null && !jsonObj.get("originalOrderNumber").isJsonNull()) && !jsonObj.get("originalOrderNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `originalOrderNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalOrderNumber").toString()));
}
if ((jsonObj.get("ownerAccountId") != null && !jsonObj.get("ownerAccountId").isJsonNull()) && !jsonObj.get("ownerAccountId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `ownerAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerAccountId").toString()));
}
if ((jsonObj.get("ownerAccountName") != null && !jsonObj.get("ownerAccountName").isJsonNull()) && !jsonObj.get("ownerAccountName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `ownerAccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerAccountName").toString()));
}
if ((jsonObj.get("ownerAccountNumber") != null && !jsonObj.get("ownerAccountNumber").isJsonNull()) && !jsonObj.get("ownerAccountNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `ownerAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerAccountNumber").toString()));
}
if ((jsonObj.get("productCode") != null && !jsonObj.get("productCode").isJsonNull()) && !jsonObj.get("productCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `productCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productCode").toString()));
}
if ((jsonObj.get("productRatePlanChargeId") != null && !jsonObj.get("productRatePlanChargeId").isJsonNull()) && !jsonObj.get("productRatePlanChargeId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `productRatePlanChargeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productRatePlanChargeId").toString()));
}
if ((jsonObj.get("purchaseOrderNumber") != null && !jsonObj.get("purchaseOrderNumber").isJsonNull()) && !jsonObj.get("purchaseOrderNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `purchaseOrderNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purchaseOrderNumber").toString()));
}
if ((jsonObj.get("recognizedRevenueAccountingCode") != null && !jsonObj.get("recognizedRevenueAccountingCode").isJsonNull()) && !jsonObj.get("recognizedRevenueAccountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recognizedRevenueAccountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recognizedRevenueAccountingCode").toString()));
}
if ((jsonObj.get("relatedSubscriptionNumber") != null && !jsonObj.get("relatedSubscriptionNumber").isJsonNull()) && !jsonObj.get("relatedSubscriptionNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `relatedSubscriptionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relatedSubscriptionNumber").toString()));
}
if ((jsonObj.get("revenueRecognitionRule") != null && !jsonObj.get("revenueRecognitionRule").isJsonNull()) && !jsonObj.get("revenueRecognitionRule").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `revenueRecognitionRule` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revenueRecognitionRule").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("soldTo") != null && !jsonObj.get("soldTo").isJsonNull()) && !jsonObj.get("soldTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `soldTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("soldTo").toString()));
}
if ((jsonObj.get("soldToSnapshotId") != null && !jsonObj.get("soldToSnapshotId").isJsonNull()) && !jsonObj.get("soldToSnapshotId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `soldToSnapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("soldToSnapshotId").toString()));
}
if ((jsonObj.get("shipTo") != null && !jsonObj.get("shipTo").isJsonNull()) && !jsonObj.get("shipTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `shipTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipTo").toString()));
}
if ((jsonObj.get("shipToSnapshotId") != null && !jsonObj.get("shipToSnapshotId").isJsonNull()) && !jsonObj.get("shipToSnapshotId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `shipToSnapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipToSnapshotId").toString()));
}
if ((jsonObj.get("taxCode") != null && !jsonObj.get("taxCode").isJsonNull()) && !jsonObj.get("taxCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `taxCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxCode").toString()));
}
// validate the optional field `taxMode`
if (jsonObj.get("taxMode") != null && !jsonObj.get("taxMode").isJsonNull()) {
TaxMode.validateJsonElement(jsonObj.get("taxMode"));
}
if ((jsonObj.get("unbilledReceivablesAccountingCode") != null && !jsonObj.get("unbilledReceivablesAccountingCode").isJsonNull()) && !jsonObj.get("unbilledReceivablesAccountingCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `unbilledReceivablesAccountingCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("unbilledReceivablesAccountingCode").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!OrderLineItem.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'OrderLineItem' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(OrderLineItem.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, OrderLineItem 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 OrderLineItem read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
OrderLineItem 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 OrderLineItem given an JSON string
*
* @param jsonString JSON string
* @return An instance of OrderLineItem
* @throws IOException if the JSON string is invalid with respect to OrderLineItem
*/
public static OrderLineItem fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, OrderLineItem.class);
}
/**
* Convert an instance of OrderLineItem to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy