All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zuora.model.ExpandedInvoiceItem Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
 * 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.ExpandedInvoice;
import com.zuora.model.ExpandedOrderLineItem;
import com.zuora.model.ExpandedRatePlanCharge;
import com.zuora.model.ExpandedSubscription;
import com.zuora.model.ExpandedTaxationItem;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.zuora.JSON;

/**
 * ExpandedInvoiceItem
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class ExpandedInvoiceItem {
  public static final String SERIALIZED_NAME_INVOICE_ID = "invoiceId";
  @SerializedName(SERIALIZED_NAME_INVOICE_ID)
  private String invoiceId;

  public static final String SERIALIZED_NAME_INVOICE_SCHEDULE_ID = "invoiceScheduleId";
  @SerializedName(SERIALIZED_NAME_INVOICE_SCHEDULE_ID)
  private String invoiceScheduleId;

  public static final String SERIALIZED_NAME_INVOICE_SCHEDULE_ITEM_ID = "invoiceScheduleItemId";
  @SerializedName(SERIALIZED_NAME_INVOICE_SCHEDULE_ITEM_ID)
  private String invoiceScheduleItemId;

  public static final String SERIALIZED_NAME_RATE_PLAN_CHARGE_ID = "ratePlanChargeId";
  @SerializedName(SERIALIZED_NAME_RATE_PLAN_CHARGE_ID)
  private String ratePlanChargeId;

  public static final String SERIALIZED_NAME_ACCOUNTING_CODE = "accountingCode";
  @SerializedName(SERIALIZED_NAME_ACCOUNTING_CODE)
  private String accountingCode;

  public static final String SERIALIZED_NAME_APPLIED_TO_INVOICE_ITEM_ID = "appliedToInvoiceItemId";
  @SerializedName(SERIALIZED_NAME_APPLIED_TO_INVOICE_ITEM_ID)
  private String appliedToInvoiceItemId;

  public static final String SERIALIZED_NAME_CHARGE_AMOUNT = "chargeAmount";
  @SerializedName(SERIALIZED_NAME_CHARGE_AMOUNT)
  private BigDecimal chargeAmount;

  public static final String SERIALIZED_NAME_CHARGE_DATE = "chargeDate";
  @SerializedName(SERIALIZED_NAME_CHARGE_DATE)
  private String chargeDate;

  public static final String SERIALIZED_NAME_CHARGE_NAME = "chargeName";
  @SerializedName(SERIALIZED_NAME_CHARGE_NAME)
  private String chargeName;

  public static final String SERIALIZED_NAME_CHARGE_NUMBER = "chargeNumber";
  @SerializedName(SERIALIZED_NAME_CHARGE_NUMBER)
  private String chargeNumber;

  public static final String SERIALIZED_NAME_COMMITMENT_CHARGE_NUMBER = "commitmentChargeNumber";
  @SerializedName(SERIALIZED_NAME_COMMITMENT_CHARGE_NUMBER)
  private String commitmentChargeNumber;

  public static final String SERIALIZED_NAME_COMMITMENT_CHARGE_SEGMENT_NUMBER = "commitmentChargeSegmentNumber";
  @SerializedName(SERIALIZED_NAME_COMMITMENT_CHARGE_SEGMENT_NUMBER)
  private String commitmentChargeSegmentNumber;

  public static final String SERIALIZED_NAME_DESCRIPTION = "description";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION)
  private String description;

  public static final String SERIALIZED_NAME_DISCOUNT_AMOUNT = "discountAmount";
  @SerializedName(SERIALIZED_NAME_DISCOUNT_AMOUNT)
  private BigDecimal discountAmount;

  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_FULFILLMENT_ID = "fulfillmentId";
  @SerializedName(SERIALIZED_NAME_FULFILLMENT_ID)
  private String fulfillmentId;

  public static final String SERIALIZED_NAME_ITEM_SOLD_TO_CONTACT_ID = "itemSoldToContactId";
  @SerializedName(SERIALIZED_NAME_ITEM_SOLD_TO_CONTACT_ID)
  private String itemSoldToContactId;

  public static final String SERIALIZED_NAME_ITEM_SOLD_TO_CONTACT_SNAPSHOT_ID = "itemSoldToContactSnapshotId";
  @SerializedName(SERIALIZED_NAME_ITEM_SOLD_TO_CONTACT_SNAPSHOT_ID)
  private String itemSoldToContactSnapshotId;

  public static final String SERIALIZED_NAME_PROCESSING_TYPE = "processingType";
  @SerializedName(SERIALIZED_NAME_PROCESSING_TYPE)
  private String processingType;

  public static final String SERIALIZED_NAME_QUANTITY = "quantity";
  @SerializedName(SERIALIZED_NAME_QUANTITY)
  private BigDecimal quantity;

  public static final String SERIALIZED_NAME_REFLECT_DISCOUNT_IN_NET_AMOUNT = "reflectDiscountInNetAmount";
  @SerializedName(SERIALIZED_NAME_REFLECT_DISCOUNT_IN_NET_AMOUNT)
  private Boolean reflectDiscountInNetAmount;

  public static final String SERIALIZED_NAME_REV_REC_START_DATE = "revRecStartDate";
  @SerializedName(SERIALIZED_NAME_REV_REC_START_DATE)
  private LocalDate revRecStartDate;

  public static final String SERIALIZED_NAME_SERVICE_END_DATE = "serviceEndDate";
  @SerializedName(SERIALIZED_NAME_SERVICE_END_DATE)
  private LocalDate serviceEndDate;

  public static final String SERIALIZED_NAME_SERVICE_START_DATE = "serviceStartDate";
  @SerializedName(SERIALIZED_NAME_SERVICE_START_DATE)
  private LocalDate serviceStartDate;

  public static final String SERIALIZED_NAME_S_K_U = "sKU";
  @SerializedName(SERIALIZED_NAME_S_K_U)
  private String sKU;

  public static final String SERIALIZED_NAME_SOURCE_ITEM_TYPE = "sourceItemType";
  @SerializedName(SERIALIZED_NAME_SOURCE_ITEM_TYPE)
  private String sourceItemType;

  public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscriptionId";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID)
  private String subscriptionId;

  public static final String SERIALIZED_NAME_SUBSCRIPTION_NUMBER = "subscriptionNumber";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_NUMBER)
  private String subscriptionNumber;

  public static final String SERIALIZED_NAME_TAX_AMOUNT = "taxAmount";
  @SerializedName(SERIALIZED_NAME_TAX_AMOUNT)
  private BigDecimal taxAmount;

  public static final String SERIALIZED_NAME_TAX_CODE = "taxCode";
  @SerializedName(SERIALIZED_NAME_TAX_CODE)
  private String taxCode;

  public static final String SERIALIZED_NAME_TAX_EXEMPT_AMOUNT = "taxExemptAmount";
  @SerializedName(SERIALIZED_NAME_TAX_EXEMPT_AMOUNT)
  private BigDecimal taxExemptAmount;

  public static final String SERIALIZED_NAME_TAX_MODE = "taxMode";
  @SerializedName(SERIALIZED_NAME_TAX_MODE)
  private String taxMode;

  public static final String SERIALIZED_NAME_UNIT_PRICE = "unitPrice";
  @SerializedName(SERIALIZED_NAME_UNIT_PRICE)
  private BigDecimal unitPrice;

  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_BALANCE = "balance";
  @SerializedName(SERIALIZED_NAME_BALANCE)
  private BigDecimal balance;

  public static final String SERIALIZED_NAME_NUMBER_OF_DELIVERIES = "numberOfDeliveries";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_DELIVERIES)
  private BigDecimal numberOfDeliveries;

  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private String id;

  public static final String SERIALIZED_NAME_CREATED_BY_ID = "createdById";
  @SerializedName(SERIALIZED_NAME_CREATED_BY_ID)
  private String createdById;

  public static final String SERIALIZED_NAME_CREATED_DATE = "createdDate";
  @SerializedName(SERIALIZED_NAME_CREATED_DATE)
  private String createdDate;

  public static final String SERIALIZED_NAME_UPDATED_BY_ID = "updatedById";
  @SerializedName(SERIALIZED_NAME_UPDATED_BY_ID)
  private String updatedById;

  public static final String SERIALIZED_NAME_UPDATED_DATE = "updatedDate";
  @SerializedName(SERIALIZED_NAME_UPDATED_DATE)
  private String updatedDate;

  public static final String SERIALIZED_NAME_ACCOUNT_RECEIVABLE_ACCOUNTING_CODE_ID = "accountReceivableAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_ACCOUNT_RECEIVABLE_ACCOUNTING_CODE_ID)
  private String accountReceivableAccountingCodeId;

  public static final String SERIALIZED_NAME_RECOGNIZED_REVENUE_ACCOUNTING_CODE_ID = "recognizedRevenueAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_RECOGNIZED_REVENUE_ACCOUNTING_CODE_ID)
  private String recognizedRevenueAccountingCodeId;

  public static final String SERIALIZED_NAME_DEFERRED_REVENUE_ACCOUNTING_CODE_ID = "deferredRevenueAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_DEFERRED_REVENUE_ACCOUNTING_CODE_ID)
  private String deferredRevenueAccountingCodeId;

  public static final String SERIALIZED_NAME_CONTRACT_ASSET_ACCOUNTING_CODE_ID = "contractAssetAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_CONTRACT_ASSET_ACCOUNTING_CODE_ID)
  private String contractAssetAccountingCodeId;

  public static final String SERIALIZED_NAME_CONTRACT_LIABILITY_ACCOUNTING_CODE_ID = "contractLiabilityAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_CONTRACT_LIABILITY_ACCOUNTING_CODE_ID)
  private String contractLiabilityAccountingCodeId;

  public static final String SERIALIZED_NAME_CONTRACT_RECOGNIZED_REVENUE_ACCOUNTING_CODE_ID = "contractRecognizedRevenueAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_CONTRACT_RECOGNIZED_REVENUE_ACCOUNTING_CODE_ID)
  private String contractRecognizedRevenueAccountingCodeId;

  public static final String SERIALIZED_NAME_UNBILLED_RECEIVABLES_ACCOUNTING_CODE_ID = "unbilledReceivablesAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_UNBILLED_RECEIVABLES_ACCOUNTING_CODE_ID)
  private String unbilledReceivablesAccountingCodeId;

  public static final String SERIALIZED_NAME_ADJUSTMENT_REVENUE_ACCOUNTING_CODE_ID = "adjustmentRevenueAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_ADJUSTMENT_REVENUE_ACCOUNTING_CODE_ID)
  private String adjustmentRevenueAccountingCodeId;

  public static final String SERIALIZED_NAME_ADJUSTMENT_LIABILITY_ACCOUNTING_CODE_ID = "adjustmentLiabilityAccountingCodeId";
  @SerializedName(SERIALIZED_NAME_ADJUSTMENT_LIABILITY_ACCOUNTING_CODE_ID)
  private String adjustmentLiabilityAccountingCodeId;

  public static final String SERIALIZED_NAME_JOURNAL_ENTRY_ID = "journalEntryId";
  @SerializedName(SERIALIZED_NAME_JOURNAL_ENTRY_ID)
  private String journalEntryId;

  public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId";
  @SerializedName(SERIALIZED_NAME_ACCOUNT_ID)
  private String accountId;

  public static final String SERIALIZED_NAME_BILL_TO_CONTACT_SNAPSHOT_ID = "billToContactSnapshotId";
  @SerializedName(SERIALIZED_NAME_BILL_TO_CONTACT_SNAPSHOT_ID)
  private String billToContactSnapshotId;

  public static final String SERIALIZED_NAME_SOLD_TO_CONTACT_SNAPSHOT_ID = "soldToContactSnapshotId";
  @SerializedName(SERIALIZED_NAME_SOLD_TO_CONTACT_SNAPSHOT_ID)
  private String soldToContactSnapshotId;

  public static final String SERIALIZED_NAME_PARENT_ACCOUNT_ID = "parentAccountId";
  @SerializedName(SERIALIZED_NAME_PARENT_ACCOUNT_ID)
  private String parentAccountId;

  public static final String SERIALIZED_NAME_BILL_TO_CONTACT_ID = "billToContactId";
  @SerializedName(SERIALIZED_NAME_BILL_TO_CONTACT_ID)
  private String billToContactId;

  public static final String SERIALIZED_NAME_SOLD_TO_CONTACT_ID = "soldToContactId";
  @SerializedName(SERIALIZED_NAME_SOLD_TO_CONTACT_ID)
  private String soldToContactId;

  public static final String SERIALIZED_NAME_DEFAULT_PAYMENT_METHOD_ID = "defaultPaymentMethodId";
  @SerializedName(SERIALIZED_NAME_DEFAULT_PAYMENT_METHOD_ID)
  private String defaultPaymentMethodId;

  public static final String SERIALIZED_NAME_RATE_PLAN_ID = "ratePlanId";
  @SerializedName(SERIALIZED_NAME_RATE_PLAN_ID)
  private String ratePlanId;

  public static final String SERIALIZED_NAME_AMENDMENT_ID = "amendmentId";
  @SerializedName(SERIALIZED_NAME_AMENDMENT_ID)
  private String amendmentId;

  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_PRODUCT_RATE_PLAN_ID = "productRatePlanId";
  @SerializedName(SERIALIZED_NAME_PRODUCT_RATE_PLAN_ID)
  private String productRatePlanId;

  public static final String SERIALIZED_NAME_PRODUCT_ID = "productId";
  @SerializedName(SERIALIZED_NAME_PRODUCT_ID)
  private String productId;

  public static final String SERIALIZED_NAME_BOOKING_REFERENCE = "bookingReference";
  @SerializedName(SERIALIZED_NAME_BOOKING_REFERENCE)
  private String bookingReference;

  public static final String SERIALIZED_NAME_ITEM_TYPE = "itemType";
  @SerializedName(SERIALIZED_NAME_ITEM_TYPE)
  private String itemType;

  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_REV_REC_CODE = "revRecCode";
  @SerializedName(SERIALIZED_NAME_REV_REC_CODE)
  private String revRecCode;

  public static final String SERIALIZED_NAME_REV_REC_TRIGGER_CONDITION = "revRecTriggerCondition";
  @SerializedName(SERIALIZED_NAME_REV_REC_TRIGGER_CONDITION)
  private String revRecTriggerCondition;

  public static final String SERIALIZED_NAME_REVENUE_RECOGNITION_RULE_NAME = "revenueRecognitionRuleName";
  @SerializedName(SERIALIZED_NAME_REVENUE_RECOGNITION_RULE_NAME)
  private String revenueRecognitionRuleName;

  public static final String SERIALIZED_NAME_ORDER_LINE_ITEM_ID = "orderLineItemId";
  @SerializedName(SERIALIZED_NAME_ORDER_LINE_ITEM_ID)
  private String orderLineItemId;

  public static final String SERIALIZED_NAME_INVOICE = "invoice";
  @SerializedName(SERIALIZED_NAME_INVOICE)
  private ExpandedInvoice invoice;

  public static final String SERIALIZED_NAME_SUBSCRIPTION = "subscription";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTION)
  private ExpandedSubscription subscription;

  public static final String SERIALIZED_NAME_TAXATION_ITEMS = "taxationItems";
  @SerializedName(SERIALIZED_NAME_TAXATION_ITEMS)
  private List taxationItems;

  public static final String SERIALIZED_NAME_RATE_PLAN_CHARGE = "ratePlanCharge";
  @SerializedName(SERIALIZED_NAME_RATE_PLAN_CHARGE)
  private ExpandedRatePlanCharge ratePlanCharge;

  public static final String SERIALIZED_NAME_ORDER_LINE_ITEM = "orderLineItem";
  @SerializedName(SERIALIZED_NAME_ORDER_LINE_ITEM)
  private ExpandedOrderLineItem orderLineItem;

  public ExpandedInvoiceItem() {
  }

  public ExpandedInvoiceItem invoiceId(String invoiceId) {
    this.invoiceId = invoiceId;
    return this;
  }

  /**
   * Get invoiceId
   * @return invoiceId
   */
  @javax.annotation.Nullable
  public String getInvoiceId() {
    return invoiceId;
  }

  public void setInvoiceId(String invoiceId) {
    this.invoiceId = invoiceId;
  }


  public ExpandedInvoiceItem invoiceScheduleId(String invoiceScheduleId) {
    this.invoiceScheduleId = invoiceScheduleId;
    return this;
  }

  /**
   * Get invoiceScheduleId
   * @return invoiceScheduleId
   */
  @javax.annotation.Nullable
  public String getInvoiceScheduleId() {
    return invoiceScheduleId;
  }

  public void setInvoiceScheduleId(String invoiceScheduleId) {
    this.invoiceScheduleId = invoiceScheduleId;
  }


  public ExpandedInvoiceItem invoiceScheduleItemId(String invoiceScheduleItemId) {
    this.invoiceScheduleItemId = invoiceScheduleItemId;
    return this;
  }

  /**
   * Get invoiceScheduleItemId
   * @return invoiceScheduleItemId
   */
  @javax.annotation.Nullable
  public String getInvoiceScheduleItemId() {
    return invoiceScheduleItemId;
  }

  public void setInvoiceScheduleItemId(String invoiceScheduleItemId) {
    this.invoiceScheduleItemId = invoiceScheduleItemId;
  }


  public ExpandedInvoiceItem ratePlanChargeId(String ratePlanChargeId) {
    this.ratePlanChargeId = ratePlanChargeId;
    return this;
  }

  /**
   * Get ratePlanChargeId
   * @return ratePlanChargeId
   */
  @javax.annotation.Nullable
  public String getRatePlanChargeId() {
    return ratePlanChargeId;
  }

  public void setRatePlanChargeId(String ratePlanChargeId) {
    this.ratePlanChargeId = ratePlanChargeId;
  }


  public ExpandedInvoiceItem accountingCode(String accountingCode) {
    this.accountingCode = accountingCode;
    return this;
  }

  /**
   * Get accountingCode
   * @return accountingCode
   */
  @javax.annotation.Nullable
  public String getAccountingCode() {
    return accountingCode;
  }

  public void setAccountingCode(String accountingCode) {
    this.accountingCode = accountingCode;
  }


  public ExpandedInvoiceItem appliedToInvoiceItemId(String appliedToInvoiceItemId) {
    this.appliedToInvoiceItemId = appliedToInvoiceItemId;
    return this;
  }

  /**
   * Get appliedToInvoiceItemId
   * @return appliedToInvoiceItemId
   */
  @javax.annotation.Nullable
  public String getAppliedToInvoiceItemId() {
    return appliedToInvoiceItemId;
  }

  public void setAppliedToInvoiceItemId(String appliedToInvoiceItemId) {
    this.appliedToInvoiceItemId = appliedToInvoiceItemId;
  }


  public ExpandedInvoiceItem chargeAmount(BigDecimal chargeAmount) {
    this.chargeAmount = chargeAmount;
    return this;
  }

  /**
   * Get chargeAmount
   * @return chargeAmount
   */
  @javax.annotation.Nullable
  public BigDecimal getChargeAmount() {
    return chargeAmount;
  }

  public void setChargeAmount(BigDecimal chargeAmount) {
    this.chargeAmount = chargeAmount;
  }


  public ExpandedInvoiceItem chargeDate(String chargeDate) {
    this.chargeDate = chargeDate;
    return this;
  }

  /**
   * Get chargeDate
   * @return chargeDate
   */
  @javax.annotation.Nullable
  public String getChargeDate() {
    return chargeDate;
  }

  public void setChargeDate(String chargeDate) {
    this.chargeDate = chargeDate;
  }


  public ExpandedInvoiceItem chargeName(String chargeName) {
    this.chargeName = chargeName;
    return this;
  }

  /**
   * Get chargeName
   * @return chargeName
   */
  @javax.annotation.Nullable
  public String getChargeName() {
    return chargeName;
  }

  public void setChargeName(String chargeName) {
    this.chargeName = chargeName;
  }


  public ExpandedInvoiceItem chargeNumber(String chargeNumber) {
    this.chargeNumber = chargeNumber;
    return this;
  }

  /**
   * Get chargeNumber
   * @return chargeNumber
   */
  @javax.annotation.Nullable
  public String getChargeNumber() {
    return chargeNumber;
  }

  public void setChargeNumber(String chargeNumber) {
    this.chargeNumber = chargeNumber;
  }


  public ExpandedInvoiceItem commitmentChargeNumber(String commitmentChargeNumber) {
    this.commitmentChargeNumber = commitmentChargeNumber;
    return this;
  }

  /**
   * Get commitmentChargeNumber
   * @return commitmentChargeNumber
   */
  @javax.annotation.Nullable
  public String getCommitmentChargeNumber() {
    return commitmentChargeNumber;
  }

  public void setCommitmentChargeNumber(String commitmentChargeNumber) {
    this.commitmentChargeNumber = commitmentChargeNumber;
  }


  public ExpandedInvoiceItem commitmentChargeSegmentNumber(String commitmentChargeSegmentNumber) {
    this.commitmentChargeSegmentNumber = commitmentChargeSegmentNumber;
    return this;
  }

  /**
   * Get commitmentChargeSegmentNumber
   * @return commitmentChargeSegmentNumber
   */
  @javax.annotation.Nullable
  public String getCommitmentChargeSegmentNumber() {
    return commitmentChargeSegmentNumber;
  }

  public void setCommitmentChargeSegmentNumber(String commitmentChargeSegmentNumber) {
    this.commitmentChargeSegmentNumber = commitmentChargeSegmentNumber;
  }


  public ExpandedInvoiceItem description(String description) {
    this.description = description;
    return this;
  }

  /**
   * Get description
   * @return description
   */
  @javax.annotation.Nullable
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }


  public ExpandedInvoiceItem discountAmount(BigDecimal discountAmount) {
    this.discountAmount = discountAmount;
    return this;
  }

  /**
   * Get discountAmount
   * @return discountAmount
   */
  @javax.annotation.Nullable
  public BigDecimal getDiscountAmount() {
    return discountAmount;
  }

  public void setDiscountAmount(BigDecimal discountAmount) {
    this.discountAmount = discountAmount;
  }


  public ExpandedInvoiceItem excludeItemBillingFromRevenueAccounting(Boolean excludeItemBillingFromRevenueAccounting) {
    this.excludeItemBillingFromRevenueAccounting = excludeItemBillingFromRevenueAccounting;
    return this;
  }

  /**
   * Get excludeItemBillingFromRevenueAccounting
   * @return excludeItemBillingFromRevenueAccounting
   */
  @javax.annotation.Nullable
  public Boolean getExcludeItemBillingFromRevenueAccounting() {
    return excludeItemBillingFromRevenueAccounting;
  }

  public void setExcludeItemBillingFromRevenueAccounting(Boolean excludeItemBillingFromRevenueAccounting) {
    this.excludeItemBillingFromRevenueAccounting = excludeItemBillingFromRevenueAccounting;
  }


  public ExpandedInvoiceItem fulfillmentId(String fulfillmentId) {
    this.fulfillmentId = fulfillmentId;
    return this;
  }

  /**
   * Get fulfillmentId
   * @return fulfillmentId
   */
  @javax.annotation.Nullable
  public String getFulfillmentId() {
    return fulfillmentId;
  }

  public void setFulfillmentId(String fulfillmentId) {
    this.fulfillmentId = fulfillmentId;
  }


  public ExpandedInvoiceItem itemSoldToContactId(String itemSoldToContactId) {
    this.itemSoldToContactId = itemSoldToContactId;
    return this;
  }

  /**
   * Get itemSoldToContactId
   * @return itemSoldToContactId
   */
  @javax.annotation.Nullable
  public String getItemSoldToContactId() {
    return itemSoldToContactId;
  }

  public void setItemSoldToContactId(String itemSoldToContactId) {
    this.itemSoldToContactId = itemSoldToContactId;
  }


  public ExpandedInvoiceItem itemSoldToContactSnapshotId(String itemSoldToContactSnapshotId) {
    this.itemSoldToContactSnapshotId = itemSoldToContactSnapshotId;
    return this;
  }

  /**
   * Get itemSoldToContactSnapshotId
   * @return itemSoldToContactSnapshotId
   */
  @javax.annotation.Nullable
  public String getItemSoldToContactSnapshotId() {
    return itemSoldToContactSnapshotId;
  }

  public void setItemSoldToContactSnapshotId(String itemSoldToContactSnapshotId) {
    this.itemSoldToContactSnapshotId = itemSoldToContactSnapshotId;
  }


  public ExpandedInvoiceItem processingType(String processingType) {
    this.processingType = processingType;
    return this;
  }

  /**
   * Get processingType
   * @return processingType
   */
  @javax.annotation.Nullable
  public String getProcessingType() {
    return processingType;
  }

  public void setProcessingType(String processingType) {
    this.processingType = processingType;
  }


  public ExpandedInvoiceItem quantity(BigDecimal quantity) {
    this.quantity = quantity;
    return this;
  }

  /**
   * Get quantity
   * @return quantity
   */
  @javax.annotation.Nullable
  public BigDecimal getQuantity() {
    return quantity;
  }

  public void setQuantity(BigDecimal quantity) {
    this.quantity = quantity;
  }


  public ExpandedInvoiceItem reflectDiscountInNetAmount(Boolean reflectDiscountInNetAmount) {
    this.reflectDiscountInNetAmount = reflectDiscountInNetAmount;
    return this;
  }

  /**
   * Get reflectDiscountInNetAmount
   * @return reflectDiscountInNetAmount
   */
  @javax.annotation.Nullable
  public Boolean getReflectDiscountInNetAmount() {
    return reflectDiscountInNetAmount;
  }

  public void setReflectDiscountInNetAmount(Boolean reflectDiscountInNetAmount) {
    this.reflectDiscountInNetAmount = reflectDiscountInNetAmount;
  }


  public ExpandedInvoiceItem revRecStartDate(LocalDate revRecStartDate) {
    this.revRecStartDate = revRecStartDate;
    return this;
  }

  /**
   * Get revRecStartDate
   * @return revRecStartDate
   */
  @javax.annotation.Nullable
  public LocalDate getRevRecStartDate() {
    return revRecStartDate;
  }

  public void setRevRecStartDate(LocalDate revRecStartDate) {
    this.revRecStartDate = revRecStartDate;
  }


  public ExpandedInvoiceItem serviceEndDate(LocalDate serviceEndDate) {
    this.serviceEndDate = serviceEndDate;
    return this;
  }

  /**
   * Get serviceEndDate
   * @return serviceEndDate
   */
  @javax.annotation.Nullable
  public LocalDate getServiceEndDate() {
    return serviceEndDate;
  }

  public void setServiceEndDate(LocalDate serviceEndDate) {
    this.serviceEndDate = serviceEndDate;
  }


  public ExpandedInvoiceItem serviceStartDate(LocalDate serviceStartDate) {
    this.serviceStartDate = serviceStartDate;
    return this;
  }

  /**
   * Get serviceStartDate
   * @return serviceStartDate
   */
  @javax.annotation.Nullable
  public LocalDate getServiceStartDate() {
    return serviceStartDate;
  }

  public void setServiceStartDate(LocalDate serviceStartDate) {
    this.serviceStartDate = serviceStartDate;
  }


  public ExpandedInvoiceItem sKU(String sKU) {
    this.sKU = sKU;
    return this;
  }

  /**
   * Get sKU
   * @return sKU
   */
  @javax.annotation.Nullable
  public String getsKU() {
    return sKU;
  }

  public void setsKU(String sKU) {
    this.sKU = sKU;
  }


  public ExpandedInvoiceItem sourceItemType(String sourceItemType) {
    this.sourceItemType = sourceItemType;
    return this;
  }

  /**
   * Get sourceItemType
   * @return sourceItemType
   */
  @javax.annotation.Nullable
  public String getSourceItemType() {
    return sourceItemType;
  }

  public void setSourceItemType(String sourceItemType) {
    this.sourceItemType = sourceItemType;
  }


  public ExpandedInvoiceItem subscriptionId(String subscriptionId) {
    this.subscriptionId = subscriptionId;
    return this;
  }

  /**
   * Get subscriptionId
   * @return subscriptionId
   */
  @javax.annotation.Nullable
  public String getSubscriptionId() {
    return subscriptionId;
  }

  public void setSubscriptionId(String subscriptionId) {
    this.subscriptionId = subscriptionId;
  }


  public ExpandedInvoiceItem subscriptionNumber(String subscriptionNumber) {
    this.subscriptionNumber = subscriptionNumber;
    return this;
  }

  /**
   * Get subscriptionNumber
   * @return subscriptionNumber
   */
  @javax.annotation.Nullable
  public String getSubscriptionNumber() {
    return subscriptionNumber;
  }

  public void setSubscriptionNumber(String subscriptionNumber) {
    this.subscriptionNumber = subscriptionNumber;
  }


  public ExpandedInvoiceItem taxAmount(BigDecimal taxAmount) {
    this.taxAmount = taxAmount;
    return this;
  }

  /**
   * Get taxAmount
   * @return taxAmount
   */
  @javax.annotation.Nullable
  public BigDecimal getTaxAmount() {
    return taxAmount;
  }

  public void setTaxAmount(BigDecimal taxAmount) {
    this.taxAmount = taxAmount;
  }


  public ExpandedInvoiceItem taxCode(String taxCode) {
    this.taxCode = taxCode;
    return this;
  }

  /**
   * Get taxCode
   * @return taxCode
   */
  @javax.annotation.Nullable
  public String getTaxCode() {
    return taxCode;
  }

  public void setTaxCode(String taxCode) {
    this.taxCode = taxCode;
  }


  public ExpandedInvoiceItem taxExemptAmount(BigDecimal taxExemptAmount) {
    this.taxExemptAmount = taxExemptAmount;
    return this;
  }

  /**
   * Get taxExemptAmount
   * @return taxExemptAmount
   */
  @javax.annotation.Nullable
  public BigDecimal getTaxExemptAmount() {
    return taxExemptAmount;
  }

  public void setTaxExemptAmount(BigDecimal taxExemptAmount) {
    this.taxExemptAmount = taxExemptAmount;
  }


  public ExpandedInvoiceItem taxMode(String taxMode) {
    this.taxMode = taxMode;
    return this;
  }

  /**
   * Get taxMode
   * @return taxMode
   */
  @javax.annotation.Nullable
  public String getTaxMode() {
    return taxMode;
  }

  public void setTaxMode(String taxMode) {
    this.taxMode = taxMode;
  }


  public ExpandedInvoiceItem unitPrice(BigDecimal unitPrice) {
    this.unitPrice = unitPrice;
    return this;
  }

  /**
   * Get unitPrice
   * @return unitPrice
   */
  @javax.annotation.Nullable
  public BigDecimal getUnitPrice() {
    return unitPrice;
  }

  public void setUnitPrice(BigDecimal unitPrice) {
    this.unitPrice = unitPrice;
  }


  public ExpandedInvoiceItem uOM(String uOM) {
    this.uOM = uOM;
    return this;
  }

  /**
   * Get uOM
   * @return uOM
   */
  @javax.annotation.Nullable
  public String getuOM() {
    return uOM;
  }

  public void setuOM(String uOM) {
    this.uOM = uOM;
  }


  public ExpandedInvoiceItem balance(BigDecimal balance) {
    this.balance = balance;
    return this;
  }

  /**
   * Get balance
   * @return balance
   */
  @javax.annotation.Nullable
  public BigDecimal getBalance() {
    return balance;
  }

  public void setBalance(BigDecimal balance) {
    this.balance = balance;
  }


  public ExpandedInvoiceItem numberOfDeliveries(BigDecimal numberOfDeliveries) {
    this.numberOfDeliveries = numberOfDeliveries;
    return this;
  }

  /**
   * Get numberOfDeliveries
   * @return numberOfDeliveries
   */
  @javax.annotation.Nullable
  public BigDecimal getNumberOfDeliveries() {
    return numberOfDeliveries;
  }

  public void setNumberOfDeliveries(BigDecimal numberOfDeliveries) {
    this.numberOfDeliveries = numberOfDeliveries;
  }


  public ExpandedInvoiceItem id(String id) {
    this.id = id;
    return this;
  }

  /**
   * Get id
   * @return id
   */
  @javax.annotation.Nullable
  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }


  public ExpandedInvoiceItem createdById(String createdById) {
    this.createdById = createdById;
    return this;
  }

  /**
   * Get createdById
   * @return createdById
   */
  @javax.annotation.Nullable
  public String getCreatedById() {
    return createdById;
  }

  public void setCreatedById(String createdById) {
    this.createdById = createdById;
  }


  public ExpandedInvoiceItem createdDate(String createdDate) {
    this.createdDate = createdDate;
    return this;
  }

  /**
   * Get createdDate
   * @return createdDate
   */
  @javax.annotation.Nullable
  public String getCreatedDate() {
    return createdDate;
  }

  public void setCreatedDate(String createdDate) {
    this.createdDate = createdDate;
  }


  public ExpandedInvoiceItem updatedById(String updatedById) {
    this.updatedById = updatedById;
    return this;
  }

  /**
   * Get updatedById
   * @return updatedById
   */
  @javax.annotation.Nullable
  public String getUpdatedById() {
    return updatedById;
  }

  public void setUpdatedById(String updatedById) {
    this.updatedById = updatedById;
  }


  public ExpandedInvoiceItem updatedDate(String updatedDate) {
    this.updatedDate = updatedDate;
    return this;
  }

  /**
   * Get updatedDate
   * @return updatedDate
   */
  @javax.annotation.Nullable
  public String getUpdatedDate() {
    return updatedDate;
  }

  public void setUpdatedDate(String updatedDate) {
    this.updatedDate = updatedDate;
  }


  public ExpandedInvoiceItem accountReceivableAccountingCodeId(String accountReceivableAccountingCodeId) {
    this.accountReceivableAccountingCodeId = accountReceivableAccountingCodeId;
    return this;
  }

  /**
   * Get accountReceivableAccountingCodeId
   * @return accountReceivableAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getAccountReceivableAccountingCodeId() {
    return accountReceivableAccountingCodeId;
  }

  public void setAccountReceivableAccountingCodeId(String accountReceivableAccountingCodeId) {
    this.accountReceivableAccountingCodeId = accountReceivableAccountingCodeId;
  }


  public ExpandedInvoiceItem recognizedRevenueAccountingCodeId(String recognizedRevenueAccountingCodeId) {
    this.recognizedRevenueAccountingCodeId = recognizedRevenueAccountingCodeId;
    return this;
  }

  /**
   * Get recognizedRevenueAccountingCodeId
   * @return recognizedRevenueAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getRecognizedRevenueAccountingCodeId() {
    return recognizedRevenueAccountingCodeId;
  }

  public void setRecognizedRevenueAccountingCodeId(String recognizedRevenueAccountingCodeId) {
    this.recognizedRevenueAccountingCodeId = recognizedRevenueAccountingCodeId;
  }


  public ExpandedInvoiceItem deferredRevenueAccountingCodeId(String deferredRevenueAccountingCodeId) {
    this.deferredRevenueAccountingCodeId = deferredRevenueAccountingCodeId;
    return this;
  }

  /**
   * Get deferredRevenueAccountingCodeId
   * @return deferredRevenueAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getDeferredRevenueAccountingCodeId() {
    return deferredRevenueAccountingCodeId;
  }

  public void setDeferredRevenueAccountingCodeId(String deferredRevenueAccountingCodeId) {
    this.deferredRevenueAccountingCodeId = deferredRevenueAccountingCodeId;
  }


  public ExpandedInvoiceItem contractAssetAccountingCodeId(String contractAssetAccountingCodeId) {
    this.contractAssetAccountingCodeId = contractAssetAccountingCodeId;
    return this;
  }

  /**
   * Get contractAssetAccountingCodeId
   * @return contractAssetAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getContractAssetAccountingCodeId() {
    return contractAssetAccountingCodeId;
  }

  public void setContractAssetAccountingCodeId(String contractAssetAccountingCodeId) {
    this.contractAssetAccountingCodeId = contractAssetAccountingCodeId;
  }


  public ExpandedInvoiceItem contractLiabilityAccountingCodeId(String contractLiabilityAccountingCodeId) {
    this.contractLiabilityAccountingCodeId = contractLiabilityAccountingCodeId;
    return this;
  }

  /**
   * Get contractLiabilityAccountingCodeId
   * @return contractLiabilityAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getContractLiabilityAccountingCodeId() {
    return contractLiabilityAccountingCodeId;
  }

  public void setContractLiabilityAccountingCodeId(String contractLiabilityAccountingCodeId) {
    this.contractLiabilityAccountingCodeId = contractLiabilityAccountingCodeId;
  }


  public ExpandedInvoiceItem contractRecognizedRevenueAccountingCodeId(String contractRecognizedRevenueAccountingCodeId) {
    this.contractRecognizedRevenueAccountingCodeId = contractRecognizedRevenueAccountingCodeId;
    return this;
  }

  /**
   * Get contractRecognizedRevenueAccountingCodeId
   * @return contractRecognizedRevenueAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getContractRecognizedRevenueAccountingCodeId() {
    return contractRecognizedRevenueAccountingCodeId;
  }

  public void setContractRecognizedRevenueAccountingCodeId(String contractRecognizedRevenueAccountingCodeId) {
    this.contractRecognizedRevenueAccountingCodeId = contractRecognizedRevenueAccountingCodeId;
  }


  public ExpandedInvoiceItem unbilledReceivablesAccountingCodeId(String unbilledReceivablesAccountingCodeId) {
    this.unbilledReceivablesAccountingCodeId = unbilledReceivablesAccountingCodeId;
    return this;
  }

  /**
   * Get unbilledReceivablesAccountingCodeId
   * @return unbilledReceivablesAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getUnbilledReceivablesAccountingCodeId() {
    return unbilledReceivablesAccountingCodeId;
  }

  public void setUnbilledReceivablesAccountingCodeId(String unbilledReceivablesAccountingCodeId) {
    this.unbilledReceivablesAccountingCodeId = unbilledReceivablesAccountingCodeId;
  }


  public ExpandedInvoiceItem adjustmentRevenueAccountingCodeId(String adjustmentRevenueAccountingCodeId) {
    this.adjustmentRevenueAccountingCodeId = adjustmentRevenueAccountingCodeId;
    return this;
  }

  /**
   * Get adjustmentRevenueAccountingCodeId
   * @return adjustmentRevenueAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getAdjustmentRevenueAccountingCodeId() {
    return adjustmentRevenueAccountingCodeId;
  }

  public void setAdjustmentRevenueAccountingCodeId(String adjustmentRevenueAccountingCodeId) {
    this.adjustmentRevenueAccountingCodeId = adjustmentRevenueAccountingCodeId;
  }


  public ExpandedInvoiceItem adjustmentLiabilityAccountingCodeId(String adjustmentLiabilityAccountingCodeId) {
    this.adjustmentLiabilityAccountingCodeId = adjustmentLiabilityAccountingCodeId;
    return this;
  }

  /**
   * Get adjustmentLiabilityAccountingCodeId
   * @return adjustmentLiabilityAccountingCodeId
   */
  @javax.annotation.Nullable
  public String getAdjustmentLiabilityAccountingCodeId() {
    return adjustmentLiabilityAccountingCodeId;
  }

  public void setAdjustmentLiabilityAccountingCodeId(String adjustmentLiabilityAccountingCodeId) {
    this.adjustmentLiabilityAccountingCodeId = adjustmentLiabilityAccountingCodeId;
  }


  public ExpandedInvoiceItem journalEntryId(String journalEntryId) {
    this.journalEntryId = journalEntryId;
    return this;
  }

  /**
   * Get journalEntryId
   * @return journalEntryId
   */
  @javax.annotation.Nullable
  public String getJournalEntryId() {
    return journalEntryId;
  }

  public void setJournalEntryId(String journalEntryId) {
    this.journalEntryId = journalEntryId;
  }


  public ExpandedInvoiceItem accountId(String accountId) {
    this.accountId = accountId;
    return this;
  }

  /**
   * Get accountId
   * @return accountId
   */
  @javax.annotation.Nullable
  public String getAccountId() {
    return accountId;
  }

  public void setAccountId(String accountId) {
    this.accountId = accountId;
  }


  public ExpandedInvoiceItem billToContactSnapshotId(String billToContactSnapshotId) {
    this.billToContactSnapshotId = billToContactSnapshotId;
    return this;
  }

  /**
   * Get billToContactSnapshotId
   * @return billToContactSnapshotId
   */
  @javax.annotation.Nullable
  public String getBillToContactSnapshotId() {
    return billToContactSnapshotId;
  }

  public void setBillToContactSnapshotId(String billToContactSnapshotId) {
    this.billToContactSnapshotId = billToContactSnapshotId;
  }


  public ExpandedInvoiceItem soldToContactSnapshotId(String soldToContactSnapshotId) {
    this.soldToContactSnapshotId = soldToContactSnapshotId;
    return this;
  }

  /**
   * Get soldToContactSnapshotId
   * @return soldToContactSnapshotId
   */
  @javax.annotation.Nullable
  public String getSoldToContactSnapshotId() {
    return soldToContactSnapshotId;
  }

  public void setSoldToContactSnapshotId(String soldToContactSnapshotId) {
    this.soldToContactSnapshotId = soldToContactSnapshotId;
  }


  public ExpandedInvoiceItem parentAccountId(String parentAccountId) {
    this.parentAccountId = parentAccountId;
    return this;
  }

  /**
   * Get parentAccountId
   * @return parentAccountId
   */
  @javax.annotation.Nullable
  public String getParentAccountId() {
    return parentAccountId;
  }

  public void setParentAccountId(String parentAccountId) {
    this.parentAccountId = parentAccountId;
  }


  public ExpandedInvoiceItem billToContactId(String billToContactId) {
    this.billToContactId = billToContactId;
    return this;
  }

  /**
   * Get billToContactId
   * @return billToContactId
   */
  @javax.annotation.Nullable
  public String getBillToContactId() {
    return billToContactId;
  }

  public void setBillToContactId(String billToContactId) {
    this.billToContactId = billToContactId;
  }


  public ExpandedInvoiceItem soldToContactId(String soldToContactId) {
    this.soldToContactId = soldToContactId;
    return this;
  }

  /**
   * Get soldToContactId
   * @return soldToContactId
   */
  @javax.annotation.Nullable
  public String getSoldToContactId() {
    return soldToContactId;
  }

  public void setSoldToContactId(String soldToContactId) {
    this.soldToContactId = soldToContactId;
  }


  public ExpandedInvoiceItem defaultPaymentMethodId(String defaultPaymentMethodId) {
    this.defaultPaymentMethodId = defaultPaymentMethodId;
    return this;
  }

  /**
   * Get defaultPaymentMethodId
   * @return defaultPaymentMethodId
   */
  @javax.annotation.Nullable
  public String getDefaultPaymentMethodId() {
    return defaultPaymentMethodId;
  }

  public void setDefaultPaymentMethodId(String defaultPaymentMethodId) {
    this.defaultPaymentMethodId = defaultPaymentMethodId;
  }


  public ExpandedInvoiceItem ratePlanId(String ratePlanId) {
    this.ratePlanId = ratePlanId;
    return this;
  }

  /**
   * Get ratePlanId
   * @return ratePlanId
   */
  @javax.annotation.Nullable
  public String getRatePlanId() {
    return ratePlanId;
  }

  public void setRatePlanId(String ratePlanId) {
    this.ratePlanId = ratePlanId;
  }


  public ExpandedInvoiceItem amendmentId(String amendmentId) {
    this.amendmentId = amendmentId;
    return this;
  }

  /**
   * Get amendmentId
   * @return amendmentId
   */
  @javax.annotation.Nullable
  public String getAmendmentId() {
    return amendmentId;
  }

  public void setAmendmentId(String amendmentId) {
    this.amendmentId = amendmentId;
  }


  public ExpandedInvoiceItem productRatePlanChargeId(String productRatePlanChargeId) {
    this.productRatePlanChargeId = productRatePlanChargeId;
    return this;
  }

  /**
   * Get productRatePlanChargeId
   * @return productRatePlanChargeId
   */
  @javax.annotation.Nullable
  public String getProductRatePlanChargeId() {
    return productRatePlanChargeId;
  }

  public void setProductRatePlanChargeId(String productRatePlanChargeId) {
    this.productRatePlanChargeId = productRatePlanChargeId;
  }


  public ExpandedInvoiceItem productRatePlanId(String productRatePlanId) {
    this.productRatePlanId = productRatePlanId;
    return this;
  }

  /**
   * Get productRatePlanId
   * @return productRatePlanId
   */
  @javax.annotation.Nullable
  public String getProductRatePlanId() {
    return productRatePlanId;
  }

  public void setProductRatePlanId(String productRatePlanId) {
    this.productRatePlanId = productRatePlanId;
  }


  public ExpandedInvoiceItem productId(String productId) {
    this.productId = productId;
    return this;
  }

  /**
   * Get productId
   * @return productId
   */
  @javax.annotation.Nullable
  public String getProductId() {
    return productId;
  }

  public void setProductId(String productId) {
    this.productId = productId;
  }


  public ExpandedInvoiceItem bookingReference(String bookingReference) {
    this.bookingReference = bookingReference;
    return this;
  }

  /**
   * Get bookingReference
   * @return bookingReference
   */
  @javax.annotation.Nullable
  public String getBookingReference() {
    return bookingReference;
  }

  public void setBookingReference(String bookingReference) {
    this.bookingReference = bookingReference;
  }


  public ExpandedInvoiceItem itemType(String itemType) {
    this.itemType = itemType;
    return this;
  }

  /**
   * Get itemType
   * @return itemType
   */
  @javax.annotation.Nullable
  public String getItemType() {
    return itemType;
  }

  public void setItemType(String itemType) {
    this.itemType = itemType;
  }


  public ExpandedInvoiceItem purchaseOrderNumber(String purchaseOrderNumber) {
    this.purchaseOrderNumber = purchaseOrderNumber;
    return this;
  }

  /**
   * Get purchaseOrderNumber
   * @return purchaseOrderNumber
   */
  @javax.annotation.Nullable
  public String getPurchaseOrderNumber() {
    return purchaseOrderNumber;
  }

  public void setPurchaseOrderNumber(String purchaseOrderNumber) {
    this.purchaseOrderNumber = purchaseOrderNumber;
  }


  public ExpandedInvoiceItem revRecCode(String revRecCode) {
    this.revRecCode = revRecCode;
    return this;
  }

  /**
   * Get revRecCode
   * @return revRecCode
   */
  @javax.annotation.Nullable
  public String getRevRecCode() {
    return revRecCode;
  }

  public void setRevRecCode(String revRecCode) {
    this.revRecCode = revRecCode;
  }


  public ExpandedInvoiceItem revRecTriggerCondition(String revRecTriggerCondition) {
    this.revRecTriggerCondition = revRecTriggerCondition;
    return this;
  }

  /**
   * Get revRecTriggerCondition
   * @return revRecTriggerCondition
   */
  @javax.annotation.Nullable
  public String getRevRecTriggerCondition() {
    return revRecTriggerCondition;
  }

  public void setRevRecTriggerCondition(String revRecTriggerCondition) {
    this.revRecTriggerCondition = revRecTriggerCondition;
  }


  public ExpandedInvoiceItem revenueRecognitionRuleName(String revenueRecognitionRuleName) {
    this.revenueRecognitionRuleName = revenueRecognitionRuleName;
    return this;
  }

  /**
   * Get revenueRecognitionRuleName
   * @return revenueRecognitionRuleName
   */
  @javax.annotation.Nullable
  public String getRevenueRecognitionRuleName() {
    return revenueRecognitionRuleName;
  }

  public void setRevenueRecognitionRuleName(String revenueRecognitionRuleName) {
    this.revenueRecognitionRuleName = revenueRecognitionRuleName;
  }


  public ExpandedInvoiceItem orderLineItemId(String orderLineItemId) {
    this.orderLineItemId = orderLineItemId;
    return this;
  }

  /**
   * Get orderLineItemId
   * @return orderLineItemId
   */
  @javax.annotation.Nullable
  public String getOrderLineItemId() {
    return orderLineItemId;
  }

  public void setOrderLineItemId(String orderLineItemId) {
    this.orderLineItemId = orderLineItemId;
  }


  public ExpandedInvoiceItem invoice(ExpandedInvoice invoice) {
    this.invoice = invoice;
    return this;
  }

  /**
   * Get invoice
   * @return invoice
   */
  @javax.annotation.Nullable
  public ExpandedInvoice getInvoice() {
    return invoice;
  }

  public void setInvoice(ExpandedInvoice invoice) {
    this.invoice = invoice;
  }


  public ExpandedInvoiceItem subscription(ExpandedSubscription subscription) {
    this.subscription = subscription;
    return this;
  }

  /**
   * Get subscription
   * @return subscription
   */
  @javax.annotation.Nullable
  public ExpandedSubscription getSubscription() {
    return subscription;
  }

  public void setSubscription(ExpandedSubscription subscription) {
    this.subscription = subscription;
  }


  public ExpandedInvoiceItem taxationItems(List taxationItems) {
    this.taxationItems = taxationItems;
    return this;
  }

  public ExpandedInvoiceItem addTaxationItemsItem(ExpandedTaxationItem taxationItemsItem) {
    if (this.taxationItems == null) {
      this.taxationItems = new ArrayList<>();
    }
    this.taxationItems.add(taxationItemsItem);
    return this;
  }

  /**
   * Get taxationItems
   * @return taxationItems
   */
  @javax.annotation.Nullable
  public List getTaxationItems() {
    return taxationItems;
  }

  public void setTaxationItems(List taxationItems) {
    this.taxationItems = taxationItems;
  }


  public ExpandedInvoiceItem ratePlanCharge(ExpandedRatePlanCharge ratePlanCharge) {
    this.ratePlanCharge = ratePlanCharge;
    return this;
  }

  /**
   * Get ratePlanCharge
   * @return ratePlanCharge
   */
  @javax.annotation.Nullable
  public ExpandedRatePlanCharge getRatePlanCharge() {
    return ratePlanCharge;
  }

  public void setRatePlanCharge(ExpandedRatePlanCharge ratePlanCharge) {
    this.ratePlanCharge = ratePlanCharge;
  }


  public ExpandedInvoiceItem orderLineItem(ExpandedOrderLineItem orderLineItem) {
    this.orderLineItem = orderLineItem;
    return this;
  }

  /**
   * Get orderLineItem
   * @return orderLineItem
   */
  @javax.annotation.Nullable
  public ExpandedOrderLineItem getOrderLineItem() {
    return orderLineItem;
  }

  public void setOrderLineItem(ExpandedOrderLineItem orderLineItem) {
    this.orderLineItem = orderLineItem;
  }

  /**
   * 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 ExpandedInvoiceItem instance itself
   */
  public ExpandedInvoiceItem 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;
    }
    ExpandedInvoiceItem expandedInvoiceItem = (ExpandedInvoiceItem) o;
    return Objects.equals(this.invoiceId, expandedInvoiceItem.invoiceId) &&
        Objects.equals(this.invoiceScheduleId, expandedInvoiceItem.invoiceScheduleId) &&
        Objects.equals(this.invoiceScheduleItemId, expandedInvoiceItem.invoiceScheduleItemId) &&
        Objects.equals(this.ratePlanChargeId, expandedInvoiceItem.ratePlanChargeId) &&
        Objects.equals(this.accountingCode, expandedInvoiceItem.accountingCode) &&
        Objects.equals(this.appliedToInvoiceItemId, expandedInvoiceItem.appliedToInvoiceItemId) &&
        Objects.equals(this.chargeAmount, expandedInvoiceItem.chargeAmount) &&
        Objects.equals(this.chargeDate, expandedInvoiceItem.chargeDate) &&
        Objects.equals(this.chargeName, expandedInvoiceItem.chargeName) &&
        Objects.equals(this.chargeNumber, expandedInvoiceItem.chargeNumber) &&
        Objects.equals(this.commitmentChargeNumber, expandedInvoiceItem.commitmentChargeNumber) &&
        Objects.equals(this.commitmentChargeSegmentNumber, expandedInvoiceItem.commitmentChargeSegmentNumber) &&
        Objects.equals(this.description, expandedInvoiceItem.description) &&
        Objects.equals(this.discountAmount, expandedInvoiceItem.discountAmount) &&
        Objects.equals(this.excludeItemBillingFromRevenueAccounting, expandedInvoiceItem.excludeItemBillingFromRevenueAccounting) &&
        Objects.equals(this.fulfillmentId, expandedInvoiceItem.fulfillmentId) &&
        Objects.equals(this.itemSoldToContactId, expandedInvoiceItem.itemSoldToContactId) &&
        Objects.equals(this.itemSoldToContactSnapshotId, expandedInvoiceItem.itemSoldToContactSnapshotId) &&
        Objects.equals(this.processingType, expandedInvoiceItem.processingType) &&
        Objects.equals(this.quantity, expandedInvoiceItem.quantity) &&
        Objects.equals(this.reflectDiscountInNetAmount, expandedInvoiceItem.reflectDiscountInNetAmount) &&
        Objects.equals(this.revRecStartDate, expandedInvoiceItem.revRecStartDate) &&
        Objects.equals(this.serviceEndDate, expandedInvoiceItem.serviceEndDate) &&
        Objects.equals(this.serviceStartDate, expandedInvoiceItem.serviceStartDate) &&
        Objects.equals(this.sKU, expandedInvoiceItem.sKU) &&
        Objects.equals(this.sourceItemType, expandedInvoiceItem.sourceItemType) &&
        Objects.equals(this.subscriptionId, expandedInvoiceItem.subscriptionId) &&
        Objects.equals(this.subscriptionNumber, expandedInvoiceItem.subscriptionNumber) &&
        Objects.equals(this.taxAmount, expandedInvoiceItem.taxAmount) &&
        Objects.equals(this.taxCode, expandedInvoiceItem.taxCode) &&
        Objects.equals(this.taxExemptAmount, expandedInvoiceItem.taxExemptAmount) &&
        Objects.equals(this.taxMode, expandedInvoiceItem.taxMode) &&
        Objects.equals(this.unitPrice, expandedInvoiceItem.unitPrice) &&
        Objects.equals(this.uOM, expandedInvoiceItem.uOM) &&
        Objects.equals(this.balance, expandedInvoiceItem.balance) &&
        Objects.equals(this.numberOfDeliveries, expandedInvoiceItem.numberOfDeliveries) &&
        Objects.equals(this.id, expandedInvoiceItem.id) &&
        Objects.equals(this.createdById, expandedInvoiceItem.createdById) &&
        Objects.equals(this.createdDate, expandedInvoiceItem.createdDate) &&
        Objects.equals(this.updatedById, expandedInvoiceItem.updatedById) &&
        Objects.equals(this.updatedDate, expandedInvoiceItem.updatedDate) &&
        Objects.equals(this.accountReceivableAccountingCodeId, expandedInvoiceItem.accountReceivableAccountingCodeId) &&
        Objects.equals(this.recognizedRevenueAccountingCodeId, expandedInvoiceItem.recognizedRevenueAccountingCodeId) &&
        Objects.equals(this.deferredRevenueAccountingCodeId, expandedInvoiceItem.deferredRevenueAccountingCodeId) &&
        Objects.equals(this.contractAssetAccountingCodeId, expandedInvoiceItem.contractAssetAccountingCodeId) &&
        Objects.equals(this.contractLiabilityAccountingCodeId, expandedInvoiceItem.contractLiabilityAccountingCodeId) &&
        Objects.equals(this.contractRecognizedRevenueAccountingCodeId, expandedInvoiceItem.contractRecognizedRevenueAccountingCodeId) &&
        Objects.equals(this.unbilledReceivablesAccountingCodeId, expandedInvoiceItem.unbilledReceivablesAccountingCodeId) &&
        Objects.equals(this.adjustmentRevenueAccountingCodeId, expandedInvoiceItem.adjustmentRevenueAccountingCodeId) &&
        Objects.equals(this.adjustmentLiabilityAccountingCodeId, expandedInvoiceItem.adjustmentLiabilityAccountingCodeId) &&
        Objects.equals(this.journalEntryId, expandedInvoiceItem.journalEntryId) &&
        Objects.equals(this.accountId, expandedInvoiceItem.accountId) &&
        Objects.equals(this.billToContactSnapshotId, expandedInvoiceItem.billToContactSnapshotId) &&
        Objects.equals(this.soldToContactSnapshotId, expandedInvoiceItem.soldToContactSnapshotId) &&
        Objects.equals(this.parentAccountId, expandedInvoiceItem.parentAccountId) &&
        Objects.equals(this.billToContactId, expandedInvoiceItem.billToContactId) &&
        Objects.equals(this.soldToContactId, expandedInvoiceItem.soldToContactId) &&
        Objects.equals(this.defaultPaymentMethodId, expandedInvoiceItem.defaultPaymentMethodId) &&
        Objects.equals(this.ratePlanId, expandedInvoiceItem.ratePlanId) &&
        Objects.equals(this.amendmentId, expandedInvoiceItem.amendmentId) &&
        Objects.equals(this.productRatePlanChargeId, expandedInvoiceItem.productRatePlanChargeId) &&
        Objects.equals(this.productRatePlanId, expandedInvoiceItem.productRatePlanId) &&
        Objects.equals(this.productId, expandedInvoiceItem.productId) &&
        Objects.equals(this.bookingReference, expandedInvoiceItem.bookingReference) &&
        Objects.equals(this.itemType, expandedInvoiceItem.itemType) &&
        Objects.equals(this.purchaseOrderNumber, expandedInvoiceItem.purchaseOrderNumber) &&
        Objects.equals(this.revRecCode, expandedInvoiceItem.revRecCode) &&
        Objects.equals(this.revRecTriggerCondition, expandedInvoiceItem.revRecTriggerCondition) &&
        Objects.equals(this.revenueRecognitionRuleName, expandedInvoiceItem.revenueRecognitionRuleName) &&
        Objects.equals(this.orderLineItemId, expandedInvoiceItem.orderLineItemId) &&
        Objects.equals(this.invoice, expandedInvoiceItem.invoice) &&
        Objects.equals(this.subscription, expandedInvoiceItem.subscription) &&
        Objects.equals(this.taxationItems, expandedInvoiceItem.taxationItems) &&
        Objects.equals(this.ratePlanCharge, expandedInvoiceItem.ratePlanCharge) &&
        Objects.equals(this.orderLineItem, expandedInvoiceItem.orderLineItem)&&
        Objects.equals(this.additionalProperties, expandedInvoiceItem.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(invoiceId, invoiceScheduleId, invoiceScheduleItemId, ratePlanChargeId, accountingCode, appliedToInvoiceItemId, chargeAmount, chargeDate, chargeName, chargeNumber, commitmentChargeNumber, commitmentChargeSegmentNumber, description, discountAmount, excludeItemBillingFromRevenueAccounting, fulfillmentId, itemSoldToContactId, itemSoldToContactSnapshotId, processingType, quantity, reflectDiscountInNetAmount, revRecStartDate, serviceEndDate, serviceStartDate, sKU, sourceItemType, subscriptionId, subscriptionNumber, taxAmount, taxCode, taxExemptAmount, taxMode, unitPrice, uOM, balance, numberOfDeliveries, id, createdById, createdDate, updatedById, updatedDate, accountReceivableAccountingCodeId, recognizedRevenueAccountingCodeId, deferredRevenueAccountingCodeId, contractAssetAccountingCodeId, contractLiabilityAccountingCodeId, contractRecognizedRevenueAccountingCodeId, unbilledReceivablesAccountingCodeId, adjustmentRevenueAccountingCodeId, adjustmentLiabilityAccountingCodeId, journalEntryId, accountId, billToContactSnapshotId, soldToContactSnapshotId, parentAccountId, billToContactId, soldToContactId, defaultPaymentMethodId, ratePlanId, amendmentId, productRatePlanChargeId, productRatePlanId, productId, bookingReference, itemType, purchaseOrderNumber, revRecCode, revRecTriggerCondition, revenueRecognitionRuleName, orderLineItemId, invoice, subscription, taxationItems, ratePlanCharge, orderLineItem, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ExpandedInvoiceItem {\n");
    sb.append("    invoiceId: ").append(toIndentedString(invoiceId)).append("\n");
    sb.append("    invoiceScheduleId: ").append(toIndentedString(invoiceScheduleId)).append("\n");
    sb.append("    invoiceScheduleItemId: ").append(toIndentedString(invoiceScheduleItemId)).append("\n");
    sb.append("    ratePlanChargeId: ").append(toIndentedString(ratePlanChargeId)).append("\n");
    sb.append("    accountingCode: ").append(toIndentedString(accountingCode)).append("\n");
    sb.append("    appliedToInvoiceItemId: ").append(toIndentedString(appliedToInvoiceItemId)).append("\n");
    sb.append("    chargeAmount: ").append(toIndentedString(chargeAmount)).append("\n");
    sb.append("    chargeDate: ").append(toIndentedString(chargeDate)).append("\n");
    sb.append("    chargeName: ").append(toIndentedString(chargeName)).append("\n");
    sb.append("    chargeNumber: ").append(toIndentedString(chargeNumber)).append("\n");
    sb.append("    commitmentChargeNumber: ").append(toIndentedString(commitmentChargeNumber)).append("\n");
    sb.append("    commitmentChargeSegmentNumber: ").append(toIndentedString(commitmentChargeSegmentNumber)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    discountAmount: ").append(toIndentedString(discountAmount)).append("\n");
    sb.append("    excludeItemBillingFromRevenueAccounting: ").append(toIndentedString(excludeItemBillingFromRevenueAccounting)).append("\n");
    sb.append("    fulfillmentId: ").append(toIndentedString(fulfillmentId)).append("\n");
    sb.append("    itemSoldToContactId: ").append(toIndentedString(itemSoldToContactId)).append("\n");
    sb.append("    itemSoldToContactSnapshotId: ").append(toIndentedString(itemSoldToContactSnapshotId)).append("\n");
    sb.append("    processingType: ").append(toIndentedString(processingType)).append("\n");
    sb.append("    quantity: ").append(toIndentedString(quantity)).append("\n");
    sb.append("    reflectDiscountInNetAmount: ").append(toIndentedString(reflectDiscountInNetAmount)).append("\n");
    sb.append("    revRecStartDate: ").append(toIndentedString(revRecStartDate)).append("\n");
    sb.append("    serviceEndDate: ").append(toIndentedString(serviceEndDate)).append("\n");
    sb.append("    serviceStartDate: ").append(toIndentedString(serviceStartDate)).append("\n");
    sb.append("    sKU: ").append(toIndentedString(sKU)).append("\n");
    sb.append("    sourceItemType: ").append(toIndentedString(sourceItemType)).append("\n");
    sb.append("    subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n");
    sb.append("    subscriptionNumber: ").append(toIndentedString(subscriptionNumber)).append("\n");
    sb.append("    taxAmount: ").append(toIndentedString(taxAmount)).append("\n");
    sb.append("    taxCode: ").append(toIndentedString(taxCode)).append("\n");
    sb.append("    taxExemptAmount: ").append(toIndentedString(taxExemptAmount)).append("\n");
    sb.append("    taxMode: ").append(toIndentedString(taxMode)).append("\n");
    sb.append("    unitPrice: ").append(toIndentedString(unitPrice)).append("\n");
    sb.append("    uOM: ").append(toIndentedString(uOM)).append("\n");
    sb.append("    balance: ").append(toIndentedString(balance)).append("\n");
    sb.append("    numberOfDeliveries: ").append(toIndentedString(numberOfDeliveries)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    createdById: ").append(toIndentedString(createdById)).append("\n");
    sb.append("    createdDate: ").append(toIndentedString(createdDate)).append("\n");
    sb.append("    updatedById: ").append(toIndentedString(updatedById)).append("\n");
    sb.append("    updatedDate: ").append(toIndentedString(updatedDate)).append("\n");
    sb.append("    accountReceivableAccountingCodeId: ").append(toIndentedString(accountReceivableAccountingCodeId)).append("\n");
    sb.append("    recognizedRevenueAccountingCodeId: ").append(toIndentedString(recognizedRevenueAccountingCodeId)).append("\n");
    sb.append("    deferredRevenueAccountingCodeId: ").append(toIndentedString(deferredRevenueAccountingCodeId)).append("\n");
    sb.append("    contractAssetAccountingCodeId: ").append(toIndentedString(contractAssetAccountingCodeId)).append("\n");
    sb.append("    contractLiabilityAccountingCodeId: ").append(toIndentedString(contractLiabilityAccountingCodeId)).append("\n");
    sb.append("    contractRecognizedRevenueAccountingCodeId: ").append(toIndentedString(contractRecognizedRevenueAccountingCodeId)).append("\n");
    sb.append("    unbilledReceivablesAccountingCodeId: ").append(toIndentedString(unbilledReceivablesAccountingCodeId)).append("\n");
    sb.append("    adjustmentRevenueAccountingCodeId: ").append(toIndentedString(adjustmentRevenueAccountingCodeId)).append("\n");
    sb.append("    adjustmentLiabilityAccountingCodeId: ").append(toIndentedString(adjustmentLiabilityAccountingCodeId)).append("\n");
    sb.append("    journalEntryId: ").append(toIndentedString(journalEntryId)).append("\n");
    sb.append("    accountId: ").append(toIndentedString(accountId)).append("\n");
    sb.append("    billToContactSnapshotId: ").append(toIndentedString(billToContactSnapshotId)).append("\n");
    sb.append("    soldToContactSnapshotId: ").append(toIndentedString(soldToContactSnapshotId)).append("\n");
    sb.append("    parentAccountId: ").append(toIndentedString(parentAccountId)).append("\n");
    sb.append("    billToContactId: ").append(toIndentedString(billToContactId)).append("\n");
    sb.append("    soldToContactId: ").append(toIndentedString(soldToContactId)).append("\n");
    sb.append("    defaultPaymentMethodId: ").append(toIndentedString(defaultPaymentMethodId)).append("\n");
    sb.append("    ratePlanId: ").append(toIndentedString(ratePlanId)).append("\n");
    sb.append("    amendmentId: ").append(toIndentedString(amendmentId)).append("\n");
    sb.append("    productRatePlanChargeId: ").append(toIndentedString(productRatePlanChargeId)).append("\n");
    sb.append("    productRatePlanId: ").append(toIndentedString(productRatePlanId)).append("\n");
    sb.append("    productId: ").append(toIndentedString(productId)).append("\n");
    sb.append("    bookingReference: ").append(toIndentedString(bookingReference)).append("\n");
    sb.append("    itemType: ").append(toIndentedString(itemType)).append("\n");
    sb.append("    purchaseOrderNumber: ").append(toIndentedString(purchaseOrderNumber)).append("\n");
    sb.append("    revRecCode: ").append(toIndentedString(revRecCode)).append("\n");
    sb.append("    revRecTriggerCondition: ").append(toIndentedString(revRecTriggerCondition)).append("\n");
    sb.append("    revenueRecognitionRuleName: ").append(toIndentedString(revenueRecognitionRuleName)).append("\n");
    sb.append("    orderLineItemId: ").append(toIndentedString(orderLineItemId)).append("\n");
    sb.append("    invoice: ").append(toIndentedString(invoice)).append("\n");
    sb.append("    subscription: ").append(toIndentedString(subscription)).append("\n");
    sb.append("    taxationItems: ").append(toIndentedString(taxationItems)).append("\n");
    sb.append("    ratePlanCharge: ").append(toIndentedString(ratePlanCharge)).append("\n");
    sb.append("    orderLineItem: ").append(toIndentedString(orderLineItem)).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("invoiceId");
    openapiFields.add("invoiceScheduleId");
    openapiFields.add("invoiceScheduleItemId");
    openapiFields.add("ratePlanChargeId");
    openapiFields.add("accountingCode");
    openapiFields.add("appliedToInvoiceItemId");
    openapiFields.add("chargeAmount");
    openapiFields.add("chargeDate");
    openapiFields.add("chargeName");
    openapiFields.add("chargeNumber");
    openapiFields.add("commitmentChargeNumber");
    openapiFields.add("commitmentChargeSegmentNumber");
    openapiFields.add("description");
    openapiFields.add("discountAmount");
    openapiFields.add("excludeItemBillingFromRevenueAccounting");
    openapiFields.add("fulfillmentId");
    openapiFields.add("itemSoldToContactId");
    openapiFields.add("itemSoldToContactSnapshotId");
    openapiFields.add("processingType");
    openapiFields.add("quantity");
    openapiFields.add("reflectDiscountInNetAmount");
    openapiFields.add("revRecStartDate");
    openapiFields.add("serviceEndDate");
    openapiFields.add("serviceStartDate");
    openapiFields.add("sKU");
    openapiFields.add("sourceItemType");
    openapiFields.add("subscriptionId");
    openapiFields.add("subscriptionNumber");
    openapiFields.add("taxAmount");
    openapiFields.add("taxCode");
    openapiFields.add("taxExemptAmount");
    openapiFields.add("taxMode");
    openapiFields.add("unitPrice");
    openapiFields.add("uOM");
    openapiFields.add("balance");
    openapiFields.add("numberOfDeliveries");
    openapiFields.add("id");
    openapiFields.add("createdById");
    openapiFields.add("createdDate");
    openapiFields.add("updatedById");
    openapiFields.add("updatedDate");
    openapiFields.add("accountReceivableAccountingCodeId");
    openapiFields.add("recognizedRevenueAccountingCodeId");
    openapiFields.add("deferredRevenueAccountingCodeId");
    openapiFields.add("contractAssetAccountingCodeId");
    openapiFields.add("contractLiabilityAccountingCodeId");
    openapiFields.add("contractRecognizedRevenueAccountingCodeId");
    openapiFields.add("unbilledReceivablesAccountingCodeId");
    openapiFields.add("adjustmentRevenueAccountingCodeId");
    openapiFields.add("adjustmentLiabilityAccountingCodeId");
    openapiFields.add("journalEntryId");
    openapiFields.add("accountId");
    openapiFields.add("billToContactSnapshotId");
    openapiFields.add("soldToContactSnapshotId");
    openapiFields.add("parentAccountId");
    openapiFields.add("billToContactId");
    openapiFields.add("soldToContactId");
    openapiFields.add("defaultPaymentMethodId");
    openapiFields.add("ratePlanId");
    openapiFields.add("amendmentId");
    openapiFields.add("productRatePlanChargeId");
    openapiFields.add("productRatePlanId");
    openapiFields.add("productId");
    openapiFields.add("bookingReference");
    openapiFields.add("itemType");
    openapiFields.add("purchaseOrderNumber");
    openapiFields.add("revRecCode");
    openapiFields.add("revRecTriggerCondition");
    openapiFields.add("revenueRecognitionRuleName");
    openapiFields.add("orderLineItemId");
    openapiFields.add("invoice");
    openapiFields.add("subscription");
    openapiFields.add("taxationItems");
    openapiFields.add("ratePlanCharge");
    openapiFields.add("orderLineItem");

    // 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 ExpandedInvoiceItem
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!ExpandedInvoiceItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in ExpandedInvoiceItem is not found in the empty JSON string", ExpandedInvoiceItem.openapiRequiredFields.toString()));
        }
      }
        JsonObject jsonObj = jsonElement.getAsJsonObject();
      if ((jsonObj.get("invoiceId") != null && !jsonObj.get("invoiceId").isJsonNull()) && !jsonObj.get("invoiceId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `invoiceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceId").toString()));
      }
      if ((jsonObj.get("invoiceScheduleId") != null && !jsonObj.get("invoiceScheduleId").isJsonNull()) && !jsonObj.get("invoiceScheduleId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `invoiceScheduleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceScheduleId").toString()));
      }
      if ((jsonObj.get("invoiceScheduleItemId") != null && !jsonObj.get("invoiceScheduleItemId").isJsonNull()) && !jsonObj.get("invoiceScheduleItemId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `invoiceScheduleItemId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceScheduleItemId").toString()));
      }
      if ((jsonObj.get("ratePlanChargeId") != null && !jsonObj.get("ratePlanChargeId").isJsonNull()) && !jsonObj.get("ratePlanChargeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `ratePlanChargeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratePlanChargeId").toString()));
      }
      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("appliedToInvoiceItemId") != null && !jsonObj.get("appliedToInvoiceItemId").isJsonNull()) && !jsonObj.get("appliedToInvoiceItemId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `appliedToInvoiceItemId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appliedToInvoiceItemId").toString()));
      }
      if ((jsonObj.get("chargeDate") != null && !jsonObj.get("chargeDate").isJsonNull()) && !jsonObj.get("chargeDate").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `chargeDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chargeDate").toString()));
      }
      if ((jsonObj.get("chargeName") != null && !jsonObj.get("chargeName").isJsonNull()) && !jsonObj.get("chargeName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `chargeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chargeName").toString()));
      }
      if ((jsonObj.get("chargeNumber") != null && !jsonObj.get("chargeNumber").isJsonNull()) && !jsonObj.get("chargeNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `chargeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chargeNumber").toString()));
      }
      if ((jsonObj.get("commitmentChargeNumber") != null && !jsonObj.get("commitmentChargeNumber").isJsonNull()) && !jsonObj.get("commitmentChargeNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `commitmentChargeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitmentChargeNumber").toString()));
      }
      if ((jsonObj.get("commitmentChargeSegmentNumber") != null && !jsonObj.get("commitmentChargeSegmentNumber").isJsonNull()) && !jsonObj.get("commitmentChargeSegmentNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `commitmentChargeSegmentNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitmentChargeSegmentNumber").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("fulfillmentId") != null && !jsonObj.get("fulfillmentId").isJsonNull()) && !jsonObj.get("fulfillmentId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `fulfillmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fulfillmentId").toString()));
      }
      if ((jsonObj.get("itemSoldToContactId") != null && !jsonObj.get("itemSoldToContactId").isJsonNull()) && !jsonObj.get("itemSoldToContactId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `itemSoldToContactId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemSoldToContactId").toString()));
      }
      if ((jsonObj.get("itemSoldToContactSnapshotId") != null && !jsonObj.get("itemSoldToContactSnapshotId").isJsonNull()) && !jsonObj.get("itemSoldToContactSnapshotId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `itemSoldToContactSnapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemSoldToContactSnapshotId").toString()));
      }
      if ((jsonObj.get("processingType") != null && !jsonObj.get("processingType").isJsonNull()) && !jsonObj.get("processingType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `processingType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processingType").toString()));
      }
      if ((jsonObj.get("sKU") != null && !jsonObj.get("sKU").isJsonNull()) && !jsonObj.get("sKU").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `sKU` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sKU").toString()));
      }
      if ((jsonObj.get("sourceItemType") != null && !jsonObj.get("sourceItemType").isJsonNull()) && !jsonObj.get("sourceItemType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `sourceItemType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceItemType").toString()));
      }
      if ((jsonObj.get("subscriptionId") != null && !jsonObj.get("subscriptionId").isJsonNull()) && !jsonObj.get("subscriptionId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `subscriptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriptionId").toString()));
      }
      if ((jsonObj.get("subscriptionNumber") != null && !jsonObj.get("subscriptionNumber").isJsonNull()) && !jsonObj.get("subscriptionNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `subscriptionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriptionNumber").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()));
      }
      if ((jsonObj.get("taxMode") != null && !jsonObj.get("taxMode").isJsonNull()) && !jsonObj.get("taxMode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `taxMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxMode").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("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
      }
      if ((jsonObj.get("createdById") != null && !jsonObj.get("createdById").isJsonNull()) && !jsonObj.get("createdById").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `createdById` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdById").toString()));
      }
      if ((jsonObj.get("createdDate") != null && !jsonObj.get("createdDate").isJsonNull()) && !jsonObj.get("createdDate").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `createdDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdDate").toString()));
      }
      if ((jsonObj.get("updatedById") != null && !jsonObj.get("updatedById").isJsonNull()) && !jsonObj.get("updatedById").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `updatedById` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedById").toString()));
      }
      if ((jsonObj.get("updatedDate") != null && !jsonObj.get("updatedDate").isJsonNull()) && !jsonObj.get("updatedDate").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `updatedDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedDate").toString()));
      }
      if ((jsonObj.get("accountReceivableAccountingCodeId") != null && !jsonObj.get("accountReceivableAccountingCodeId").isJsonNull()) && !jsonObj.get("accountReceivableAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `accountReceivableAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountReceivableAccountingCodeId").toString()));
      }
      if ((jsonObj.get("recognizedRevenueAccountingCodeId") != null && !jsonObj.get("recognizedRevenueAccountingCodeId").isJsonNull()) && !jsonObj.get("recognizedRevenueAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `recognizedRevenueAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recognizedRevenueAccountingCodeId").toString()));
      }
      if ((jsonObj.get("deferredRevenueAccountingCodeId") != null && !jsonObj.get("deferredRevenueAccountingCodeId").isJsonNull()) && !jsonObj.get("deferredRevenueAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `deferredRevenueAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deferredRevenueAccountingCodeId").toString()));
      }
      if ((jsonObj.get("contractAssetAccountingCodeId") != null && !jsonObj.get("contractAssetAccountingCodeId").isJsonNull()) && !jsonObj.get("contractAssetAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `contractAssetAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAssetAccountingCodeId").toString()));
      }
      if ((jsonObj.get("contractLiabilityAccountingCodeId") != null && !jsonObj.get("contractLiabilityAccountingCodeId").isJsonNull()) && !jsonObj.get("contractLiabilityAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `contractLiabilityAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractLiabilityAccountingCodeId").toString()));
      }
      if ((jsonObj.get("contractRecognizedRevenueAccountingCodeId") != null && !jsonObj.get("contractRecognizedRevenueAccountingCodeId").isJsonNull()) && !jsonObj.get("contractRecognizedRevenueAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `contractRecognizedRevenueAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractRecognizedRevenueAccountingCodeId").toString()));
      }
      if ((jsonObj.get("unbilledReceivablesAccountingCodeId") != null && !jsonObj.get("unbilledReceivablesAccountingCodeId").isJsonNull()) && !jsonObj.get("unbilledReceivablesAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `unbilledReceivablesAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("unbilledReceivablesAccountingCodeId").toString()));
      }
      if ((jsonObj.get("adjustmentRevenueAccountingCodeId") != null && !jsonObj.get("adjustmentRevenueAccountingCodeId").isJsonNull()) && !jsonObj.get("adjustmentRevenueAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `adjustmentRevenueAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("adjustmentRevenueAccountingCodeId").toString()));
      }
      if ((jsonObj.get("adjustmentLiabilityAccountingCodeId") != null && !jsonObj.get("adjustmentLiabilityAccountingCodeId").isJsonNull()) && !jsonObj.get("adjustmentLiabilityAccountingCodeId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `adjustmentLiabilityAccountingCodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("adjustmentLiabilityAccountingCodeId").toString()));
      }
      if ((jsonObj.get("journalEntryId") != null && !jsonObj.get("journalEntryId").isJsonNull()) && !jsonObj.get("journalEntryId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `journalEntryId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("journalEntryId").toString()));
      }
      if ((jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) && !jsonObj.get("accountId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString()));
      }
      if ((jsonObj.get("billToContactSnapshotId") != null && !jsonObj.get("billToContactSnapshotId").isJsonNull()) && !jsonObj.get("billToContactSnapshotId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `billToContactSnapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billToContactSnapshotId").toString()));
      }
      if ((jsonObj.get("soldToContactSnapshotId") != null && !jsonObj.get("soldToContactSnapshotId").isJsonNull()) && !jsonObj.get("soldToContactSnapshotId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `soldToContactSnapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("soldToContactSnapshotId").toString()));
      }
      if ((jsonObj.get("parentAccountId") != null && !jsonObj.get("parentAccountId").isJsonNull()) && !jsonObj.get("parentAccountId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `parentAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentAccountId").toString()));
      }
      if ((jsonObj.get("billToContactId") != null && !jsonObj.get("billToContactId").isJsonNull()) && !jsonObj.get("billToContactId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `billToContactId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billToContactId").toString()));
      }
      if ((jsonObj.get("soldToContactId") != null && !jsonObj.get("soldToContactId").isJsonNull()) && !jsonObj.get("soldToContactId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `soldToContactId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("soldToContactId").toString()));
      }
      if ((jsonObj.get("defaultPaymentMethodId") != null && !jsonObj.get("defaultPaymentMethodId").isJsonNull()) && !jsonObj.get("defaultPaymentMethodId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `defaultPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultPaymentMethodId").toString()));
      }
      if ((jsonObj.get("ratePlanId") != null && !jsonObj.get("ratePlanId").isJsonNull()) && !jsonObj.get("ratePlanId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `ratePlanId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratePlanId").toString()));
      }
      if ((jsonObj.get("amendmentId") != null && !jsonObj.get("amendmentId").isJsonNull()) && !jsonObj.get("amendmentId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `amendmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amendmentId").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("productRatePlanId") != null && !jsonObj.get("productRatePlanId").isJsonNull()) && !jsonObj.get("productRatePlanId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `productRatePlanId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productRatePlanId").toString()));
      }
      if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString()));
      }
      if ((jsonObj.get("bookingReference") != null && !jsonObj.get("bookingReference").isJsonNull()) && !jsonObj.get("bookingReference").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `bookingReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bookingReference").toString()));
      }
      if ((jsonObj.get("itemType") != null && !jsonObj.get("itemType").isJsonNull()) && !jsonObj.get("itemType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `itemType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemType").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("revRecCode") != null && !jsonObj.get("revRecCode").isJsonNull()) && !jsonObj.get("revRecCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `revRecCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revRecCode").toString()));
      }
      if ((jsonObj.get("revRecTriggerCondition") != null && !jsonObj.get("revRecTriggerCondition").isJsonNull()) && !jsonObj.get("revRecTriggerCondition").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `revRecTriggerCondition` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revRecTriggerCondition").toString()));
      }
      if ((jsonObj.get("revenueRecognitionRuleName") != null && !jsonObj.get("revenueRecognitionRuleName").isJsonNull()) && !jsonObj.get("revenueRecognitionRuleName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `revenueRecognitionRuleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revenueRecognitionRuleName").toString()));
      }
      if ((jsonObj.get("orderLineItemId") != null && !jsonObj.get("orderLineItemId").isJsonNull()) && !jsonObj.get("orderLineItemId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `orderLineItemId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderLineItemId").toString()));
      }
      // ensure the optional json data is an array if present
      if (jsonObj.get("taxationItems") != null && !jsonObj.get("taxationItems").isJsonNull() && !jsonObj.get("taxationItems").isJsonArray()) {
        throw new IllegalArgumentException(String.format("Expected the field `taxationItems` to be an array in the JSON string but got `%s`", jsonObj.get("taxationItems").toString()));
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public  TypeAdapter create(Gson gson, TypeToken type) {
       if (!ExpandedInvoiceItem.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'ExpandedInvoiceItem' and its subtypes
       }
       final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(ExpandedInvoiceItem.class));

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, ExpandedInvoiceItem 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 ExpandedInvoiceItem read(JsonReader in) throws IOException {
             JsonElement jsonElement = elementAdapter.read(in);
             validateJsonElement(jsonElement);
             JsonObject jsonObj = jsonElement.getAsJsonObject();
             // store additional fields in the deserialized instance
             ExpandedInvoiceItem 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 ExpandedInvoiceItem given an JSON string
   *
   * @param jsonString JSON string
   * @return An instance of ExpandedInvoiceItem
   * @throws IOException if the JSON string is invalid with respect to ExpandedInvoiceItem
   */
  public static ExpandedInvoiceItem fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, ExpandedInvoiceItem.class);
  }

  /**
   * Convert an instance of ExpandedInvoiceItem to an JSON string
   *
   * @return JSON string
   */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy