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

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

There is a newer version: 3.4.0
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.ExpandedOrders;
import com.zuora.model.ExpandedSubscription;
import java.io.IOException;
import java.time.LocalDate;
import java.util.Arrays;

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;

/**
 * ExpandedOrderAction
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class ExpandedOrderAction {
  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_CONTRACT_EFFECTIVE_DATE = "contractEffectiveDate";
  @SerializedName(SERIALIZED_NAME_CONTRACT_EFFECTIVE_DATE)
  private LocalDate contractEffectiveDate;

  public static final String SERIALIZED_NAME_CUSTOMER_ACCEPTANCE_DATE = "customerAcceptanceDate";
  @SerializedName(SERIALIZED_NAME_CUSTOMER_ACCEPTANCE_DATE)
  private LocalDate customerAcceptanceDate;

  public static final String SERIALIZED_NAME_TYPE = "type";
  @SerializedName(SERIALIZED_NAME_TYPE)
  private String type;

  public static final String SERIALIZED_NAME_SEQUENCE = "sequence";
  @SerializedName(SERIALIZED_NAME_SEQUENCE)
  private Integer sequence;

  public static final String SERIALIZED_NAME_SUBSCRIPTION_VERSION_AMENDMENT_ID = "subscriptionVersionAmendmentId";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_VERSION_AMENDMENT_ID)
  private String subscriptionVersionAmendmentId;

  public static final String SERIALIZED_NAME_ORDER_ID = "orderId";
  @SerializedName(SERIALIZED_NAME_ORDER_ID)
  private String orderId;

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

  public static final String SERIALIZED_NAME_CHANGE_REASON = "changeReason";
  @SerializedName(SERIALIZED_NAME_CHANGE_REASON)
  private String changeReason;

  public static final String SERIALIZED_NAME_SERVICE_ACTIVATION_DATE = "serviceActivationDate";
  @SerializedName(SERIALIZED_NAME_SERVICE_ACTIVATION_DATE)
  private LocalDate serviceActivationDate;

  public static final String SERIALIZED_NAME_AUTO_RENEW = "autoRenew";
  @SerializedName(SERIALIZED_NAME_AUTO_RENEW)
  private Boolean autoRenew;

  public static final String SERIALIZED_NAME_RENEW_SETTING = "renewSetting";
  @SerializedName(SERIALIZED_NAME_RENEW_SETTING)
  private String renewSetting;

  public static final String SERIALIZED_NAME_RENEWAL_TERM = "renewalTerm";
  @SerializedName(SERIALIZED_NAME_RENEWAL_TERM)
  private Long renewalTerm;

  public static final String SERIALIZED_NAME_RENEWAL_TERM_PERIOD_TYPE = "renewalTermPeriodType";
  @SerializedName(SERIALIZED_NAME_RENEWAL_TERM_PERIOD_TYPE)
  private String renewalTermPeriodType;

  public static final String SERIALIZED_NAME_TERM_START_DATE = "termStartDate";
  @SerializedName(SERIALIZED_NAME_TERM_START_DATE)
  private LocalDate termStartDate;

  public static final String SERIALIZED_NAME_TERM_TYPE = "termType";
  @SerializedName(SERIALIZED_NAME_TERM_TYPE)
  private String termType;

  public static final String SERIALIZED_NAME_CURRENT_TERM = "currentTerm";
  @SerializedName(SERIALIZED_NAME_CURRENT_TERM)
  private Long currentTerm;

  public static final String SERIALIZED_NAME_CURRENT_TERM_PERIOD_TYPE = "currentTermPeriodType";
  @SerializedName(SERIALIZED_NAME_CURRENT_TERM_PERIOD_TYPE)
  private String currentTermPeriodType;

  public static final String SERIALIZED_NAME_SUSPEND_DATE = "suspendDate";
  @SerializedName(SERIALIZED_NAME_SUSPEND_DATE)
  private LocalDate suspendDate;

  public static final String SERIALIZED_NAME_RESUME_DATE = "resumeDate";
  @SerializedName(SERIALIZED_NAME_RESUME_DATE)
  private LocalDate resumeDate;

  public static final String SERIALIZED_NAME_CANCELLATION_EFFECTIVE_DATE = "cancellationEffectiveDate";
  @SerializedName(SERIALIZED_NAME_CANCELLATION_EFFECTIVE_DATE)
  private LocalDate cancellationEffectiveDate;

  public static final String SERIALIZED_NAME_CANCELLATION_POLICY = "cancellationPolicy";
  @SerializedName(SERIALIZED_NAME_CANCELLATION_POLICY)
  private String cancellationPolicy;

  public static final String SERIALIZED_NAME_PAYMENT_TERM = "paymentTerm";
  @SerializedName(SERIALIZED_NAME_PAYMENT_TERM)
  private String paymentTerm;

  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_INVOICE_GROUP_NUMBER = "invoiceGroupNumber";
  @SerializedName(SERIALIZED_NAME_INVOICE_GROUP_NUMBER)
  private String invoiceGroupNumber;

  public static final String SERIALIZED_NAME_INVOICE_TEMPLATE_ID = "invoiceTemplateId";
  @SerializedName(SERIALIZED_NAME_INVOICE_TEMPLATE_ID)
  private String invoiceTemplateId;

  public static final String SERIALIZED_NAME_SEQUENCE_SET_ID = "sequenceSetId";
  @SerializedName(SERIALIZED_NAME_SEQUENCE_SET_ID)
  private String sequenceSetId;

  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_CLEARING_EXISTING_PAYMENT_TERM = "clearingExistingPaymentTerm";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_PAYMENT_TERM)
  private Boolean clearingExistingPaymentTerm;

  public static final String SERIALIZED_NAME_CLEARING_EXISTING_BILL_TO_CONTACT = "clearingExistingBillToContact";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_BILL_TO_CONTACT)
  private Boolean clearingExistingBillToContact;

  public static final String SERIALIZED_NAME_CLEARING_EXISTING_INVOICE_GROUP_NUMBER = "clearingExistingInvoiceGroupNumber";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_INVOICE_GROUP_NUMBER)
  private Boolean clearingExistingInvoiceGroupNumber;

  public static final String SERIALIZED_NAME_CLEARING_EXISTING_INVOICE_TEMPLATE = "clearingExistingInvoiceTemplate";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_INVOICE_TEMPLATE)
  private Boolean clearingExistingInvoiceTemplate;

  public static final String SERIALIZED_NAME_CLEARING_EXISTING_SEQUENCE_SET = "clearingExistingSequenceSet";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_SEQUENCE_SET)
  private Boolean clearingExistingSequenceSet;

  public static final String SERIALIZED_NAME_CLEARING_EXISTING_SOLD_TO_CONTACT = "clearingExistingSoldToContact";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_SOLD_TO_CONTACT)
  private Boolean clearingExistingSoldToContact;

  public static final String SERIALIZED_NAME_SUB_TYPE = "subType";
  @SerializedName(SERIALIZED_NAME_SUB_TYPE)
  private String subType;

  public static final String SERIALIZED_NAME_EFFECTIVE_POLICY = "effectivePolicy";
  @SerializedName(SERIALIZED_NAME_EFFECTIVE_POLICY)
  private String effectivePolicy;

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

  public static final String SERIALIZED_NAME_ORDER = "order";
  @SerializedName(SERIALIZED_NAME_ORDER)
  private ExpandedOrders order;

  public ExpandedOrderAction() {
  }

  public ExpandedOrderAction 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 ExpandedOrderAction 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 ExpandedOrderAction 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 ExpandedOrderAction 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 ExpandedOrderAction 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 ExpandedOrderAction contractEffectiveDate(LocalDate contractEffectiveDate) {
    this.contractEffectiveDate = contractEffectiveDate;
    return this;
  }

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

  public void setContractEffectiveDate(LocalDate contractEffectiveDate) {
    this.contractEffectiveDate = contractEffectiveDate;
  }


  public ExpandedOrderAction customerAcceptanceDate(LocalDate customerAcceptanceDate) {
    this.customerAcceptanceDate = customerAcceptanceDate;
    return this;
  }

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

  public void setCustomerAcceptanceDate(LocalDate customerAcceptanceDate) {
    this.customerAcceptanceDate = customerAcceptanceDate;
  }


  public ExpandedOrderAction type(String type) {
    this.type = type;
    return this;
  }

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

  public void setType(String type) {
    this.type = type;
  }


  public ExpandedOrderAction sequence(Integer sequence) {
    this.sequence = sequence;
    return this;
  }

  /**
   * Get sequence
   * @return sequence
   */
  @javax.annotation.Nullable
  public Integer getSequence() {
    return sequence;
  }

  public void setSequence(Integer sequence) {
    this.sequence = sequence;
  }


  public ExpandedOrderAction subscriptionVersionAmendmentId(String subscriptionVersionAmendmentId) {
    this.subscriptionVersionAmendmentId = subscriptionVersionAmendmentId;
    return this;
  }

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

  public void setSubscriptionVersionAmendmentId(String subscriptionVersionAmendmentId) {
    this.subscriptionVersionAmendmentId = subscriptionVersionAmendmentId;
  }


  public ExpandedOrderAction orderId(String orderId) {
    this.orderId = orderId;
    return this;
  }

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

  public void setOrderId(String orderId) {
    this.orderId = orderId;
  }


  public ExpandedOrderAction 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 ExpandedOrderAction changeReason(String changeReason) {
    this.changeReason = changeReason;
    return this;
  }

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

  public void setChangeReason(String changeReason) {
    this.changeReason = changeReason;
  }


  public ExpandedOrderAction serviceActivationDate(LocalDate serviceActivationDate) {
    this.serviceActivationDate = serviceActivationDate;
    return this;
  }

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

  public void setServiceActivationDate(LocalDate serviceActivationDate) {
    this.serviceActivationDate = serviceActivationDate;
  }


  public ExpandedOrderAction autoRenew(Boolean autoRenew) {
    this.autoRenew = autoRenew;
    return this;
  }

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

  public void setAutoRenew(Boolean autoRenew) {
    this.autoRenew = autoRenew;
  }


  public ExpandedOrderAction renewSetting(String renewSetting) {
    this.renewSetting = renewSetting;
    return this;
  }

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

  public void setRenewSetting(String renewSetting) {
    this.renewSetting = renewSetting;
  }


  public ExpandedOrderAction renewalTerm(Long renewalTerm) {
    this.renewalTerm = renewalTerm;
    return this;
  }

  /**
   * Get renewalTerm
   * @return renewalTerm
   */
  @javax.annotation.Nullable
  public Long getRenewalTerm() {
    return renewalTerm;
  }

  public void setRenewalTerm(Long renewalTerm) {
    this.renewalTerm = renewalTerm;
  }


  public ExpandedOrderAction renewalTermPeriodType(String renewalTermPeriodType) {
    this.renewalTermPeriodType = renewalTermPeriodType;
    return this;
  }

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

  public void setRenewalTermPeriodType(String renewalTermPeriodType) {
    this.renewalTermPeriodType = renewalTermPeriodType;
  }


  public ExpandedOrderAction termStartDate(LocalDate termStartDate) {
    this.termStartDate = termStartDate;
    return this;
  }

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

  public void setTermStartDate(LocalDate termStartDate) {
    this.termStartDate = termStartDate;
  }


  public ExpandedOrderAction termType(String termType) {
    this.termType = termType;
    return this;
  }

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

  public void setTermType(String termType) {
    this.termType = termType;
  }


  public ExpandedOrderAction currentTerm(Long currentTerm) {
    this.currentTerm = currentTerm;
    return this;
  }

  /**
   * Get currentTerm
   * @return currentTerm
   */
  @javax.annotation.Nullable
  public Long getCurrentTerm() {
    return currentTerm;
  }

  public void setCurrentTerm(Long currentTerm) {
    this.currentTerm = currentTerm;
  }


  public ExpandedOrderAction currentTermPeriodType(String currentTermPeriodType) {
    this.currentTermPeriodType = currentTermPeriodType;
    return this;
  }

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

  public void setCurrentTermPeriodType(String currentTermPeriodType) {
    this.currentTermPeriodType = currentTermPeriodType;
  }


  public ExpandedOrderAction suspendDate(LocalDate suspendDate) {
    this.suspendDate = suspendDate;
    return this;
  }

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

  public void setSuspendDate(LocalDate suspendDate) {
    this.suspendDate = suspendDate;
  }


  public ExpandedOrderAction resumeDate(LocalDate resumeDate) {
    this.resumeDate = resumeDate;
    return this;
  }

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

  public void setResumeDate(LocalDate resumeDate) {
    this.resumeDate = resumeDate;
  }


  public ExpandedOrderAction cancellationEffectiveDate(LocalDate cancellationEffectiveDate) {
    this.cancellationEffectiveDate = cancellationEffectiveDate;
    return this;
  }

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

  public void setCancellationEffectiveDate(LocalDate cancellationEffectiveDate) {
    this.cancellationEffectiveDate = cancellationEffectiveDate;
  }


  public ExpandedOrderAction cancellationPolicy(String cancellationPolicy) {
    this.cancellationPolicy = cancellationPolicy;
    return this;
  }

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

  public void setCancellationPolicy(String cancellationPolicy) {
    this.cancellationPolicy = cancellationPolicy;
  }


  public ExpandedOrderAction paymentTerm(String paymentTerm) {
    this.paymentTerm = paymentTerm;
    return this;
  }

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

  public void setPaymentTerm(String paymentTerm) {
    this.paymentTerm = paymentTerm;
  }


  public ExpandedOrderAction 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 ExpandedOrderAction invoiceGroupNumber(String invoiceGroupNumber) {
    this.invoiceGroupNumber = invoiceGroupNumber;
    return this;
  }

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

  public void setInvoiceGroupNumber(String invoiceGroupNumber) {
    this.invoiceGroupNumber = invoiceGroupNumber;
  }


  public ExpandedOrderAction invoiceTemplateId(String invoiceTemplateId) {
    this.invoiceTemplateId = invoiceTemplateId;
    return this;
  }

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

  public void setInvoiceTemplateId(String invoiceTemplateId) {
    this.invoiceTemplateId = invoiceTemplateId;
  }


  public ExpandedOrderAction sequenceSetId(String sequenceSetId) {
    this.sequenceSetId = sequenceSetId;
    return this;
  }

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

  public void setSequenceSetId(String sequenceSetId) {
    this.sequenceSetId = sequenceSetId;
  }


  public ExpandedOrderAction 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 ExpandedOrderAction clearingExistingPaymentTerm(Boolean clearingExistingPaymentTerm) {
    this.clearingExistingPaymentTerm = clearingExistingPaymentTerm;
    return this;
  }

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

  public void setClearingExistingPaymentTerm(Boolean clearingExistingPaymentTerm) {
    this.clearingExistingPaymentTerm = clearingExistingPaymentTerm;
  }


  public ExpandedOrderAction clearingExistingBillToContact(Boolean clearingExistingBillToContact) {
    this.clearingExistingBillToContact = clearingExistingBillToContact;
    return this;
  }

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

  public void setClearingExistingBillToContact(Boolean clearingExistingBillToContact) {
    this.clearingExistingBillToContact = clearingExistingBillToContact;
  }


  public ExpandedOrderAction clearingExistingInvoiceGroupNumber(Boolean clearingExistingInvoiceGroupNumber) {
    this.clearingExistingInvoiceGroupNumber = clearingExistingInvoiceGroupNumber;
    return this;
  }

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

  public void setClearingExistingInvoiceGroupNumber(Boolean clearingExistingInvoiceGroupNumber) {
    this.clearingExistingInvoiceGroupNumber = clearingExistingInvoiceGroupNumber;
  }


  public ExpandedOrderAction clearingExistingInvoiceTemplate(Boolean clearingExistingInvoiceTemplate) {
    this.clearingExistingInvoiceTemplate = clearingExistingInvoiceTemplate;
    return this;
  }

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

  public void setClearingExistingInvoiceTemplate(Boolean clearingExistingInvoiceTemplate) {
    this.clearingExistingInvoiceTemplate = clearingExistingInvoiceTemplate;
  }


  public ExpandedOrderAction clearingExistingSequenceSet(Boolean clearingExistingSequenceSet) {
    this.clearingExistingSequenceSet = clearingExistingSequenceSet;
    return this;
  }

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

  public void setClearingExistingSequenceSet(Boolean clearingExistingSequenceSet) {
    this.clearingExistingSequenceSet = clearingExistingSequenceSet;
  }


  public ExpandedOrderAction clearingExistingSoldToContact(Boolean clearingExistingSoldToContact) {
    this.clearingExistingSoldToContact = clearingExistingSoldToContact;
    return this;
  }

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

  public void setClearingExistingSoldToContact(Boolean clearingExistingSoldToContact) {
    this.clearingExistingSoldToContact = clearingExistingSoldToContact;
  }


  public ExpandedOrderAction subType(String subType) {
    this.subType = subType;
    return this;
  }

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

  public void setSubType(String subType) {
    this.subType = subType;
  }


  public ExpandedOrderAction effectivePolicy(String effectivePolicy) {
    this.effectivePolicy = effectivePolicy;
    return this;
  }

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

  public void setEffectivePolicy(String effectivePolicy) {
    this.effectivePolicy = effectivePolicy;
  }


  public ExpandedOrderAction 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 ExpandedOrderAction order(ExpandedOrders order) {
    this.order = order;
    return this;
  }

  /**
   * Get order
   * @return order
   */
  @javax.annotation.Nullable
  public ExpandedOrders getOrder() {
    return order;
  }

  public void setOrder(ExpandedOrders order) {
    this.order = order;
  }

  /**
   * 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 ExpandedOrderAction instance itself
   */
  public ExpandedOrderAction 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;
    }
    ExpandedOrderAction expandedOrderAction = (ExpandedOrderAction) o;
    return Objects.equals(this.id, expandedOrderAction.id) &&
        Objects.equals(this.createdById, expandedOrderAction.createdById) &&
        Objects.equals(this.createdDate, expandedOrderAction.createdDate) &&
        Objects.equals(this.updatedById, expandedOrderAction.updatedById) &&
        Objects.equals(this.updatedDate, expandedOrderAction.updatedDate) &&
        Objects.equals(this.contractEffectiveDate, expandedOrderAction.contractEffectiveDate) &&
        Objects.equals(this.customerAcceptanceDate, expandedOrderAction.customerAcceptanceDate) &&
        Objects.equals(this.type, expandedOrderAction.type) &&
        Objects.equals(this.sequence, expandedOrderAction.sequence) &&
        Objects.equals(this.subscriptionVersionAmendmentId, expandedOrderAction.subscriptionVersionAmendmentId) &&
        Objects.equals(this.orderId, expandedOrderAction.orderId) &&
        Objects.equals(this.subscriptionId, expandedOrderAction.subscriptionId) &&
        Objects.equals(this.changeReason, expandedOrderAction.changeReason) &&
        Objects.equals(this.serviceActivationDate, expandedOrderAction.serviceActivationDate) &&
        Objects.equals(this.autoRenew, expandedOrderAction.autoRenew) &&
        Objects.equals(this.renewSetting, expandedOrderAction.renewSetting) &&
        Objects.equals(this.renewalTerm, expandedOrderAction.renewalTerm) &&
        Objects.equals(this.renewalTermPeriodType, expandedOrderAction.renewalTermPeriodType) &&
        Objects.equals(this.termStartDate, expandedOrderAction.termStartDate) &&
        Objects.equals(this.termType, expandedOrderAction.termType) &&
        Objects.equals(this.currentTerm, expandedOrderAction.currentTerm) &&
        Objects.equals(this.currentTermPeriodType, expandedOrderAction.currentTermPeriodType) &&
        Objects.equals(this.suspendDate, expandedOrderAction.suspendDate) &&
        Objects.equals(this.resumeDate, expandedOrderAction.resumeDate) &&
        Objects.equals(this.cancellationEffectiveDate, expandedOrderAction.cancellationEffectiveDate) &&
        Objects.equals(this.cancellationPolicy, expandedOrderAction.cancellationPolicy) &&
        Objects.equals(this.paymentTerm, expandedOrderAction.paymentTerm) &&
        Objects.equals(this.billToContactId, expandedOrderAction.billToContactId) &&
        Objects.equals(this.invoiceGroupNumber, expandedOrderAction.invoiceGroupNumber) &&
        Objects.equals(this.invoiceTemplateId, expandedOrderAction.invoiceTemplateId) &&
        Objects.equals(this.sequenceSetId, expandedOrderAction.sequenceSetId) &&
        Objects.equals(this.soldToContactId, expandedOrderAction.soldToContactId) &&
        Objects.equals(this.clearingExistingPaymentTerm, expandedOrderAction.clearingExistingPaymentTerm) &&
        Objects.equals(this.clearingExistingBillToContact, expandedOrderAction.clearingExistingBillToContact) &&
        Objects.equals(this.clearingExistingInvoiceGroupNumber, expandedOrderAction.clearingExistingInvoiceGroupNumber) &&
        Objects.equals(this.clearingExistingInvoiceTemplate, expandedOrderAction.clearingExistingInvoiceTemplate) &&
        Objects.equals(this.clearingExistingSequenceSet, expandedOrderAction.clearingExistingSequenceSet) &&
        Objects.equals(this.clearingExistingSoldToContact, expandedOrderAction.clearingExistingSoldToContact) &&
        Objects.equals(this.subType, expandedOrderAction.subType) &&
        Objects.equals(this.effectivePolicy, expandedOrderAction.effectivePolicy) &&
        Objects.equals(this.subscription, expandedOrderAction.subscription) &&
        Objects.equals(this.order, expandedOrderAction.order)&&
        Objects.equals(this.additionalProperties, expandedOrderAction.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, createdById, createdDate, updatedById, updatedDate, contractEffectiveDate, customerAcceptanceDate, type, sequence, subscriptionVersionAmendmentId, orderId, subscriptionId, changeReason, serviceActivationDate, autoRenew, renewSetting, renewalTerm, renewalTermPeriodType, termStartDate, termType, currentTerm, currentTermPeriodType, suspendDate, resumeDate, cancellationEffectiveDate, cancellationPolicy, paymentTerm, billToContactId, invoiceGroupNumber, invoiceTemplateId, sequenceSetId, soldToContactId, clearingExistingPaymentTerm, clearingExistingBillToContact, clearingExistingInvoiceGroupNumber, clearingExistingInvoiceTemplate, clearingExistingSequenceSet, clearingExistingSoldToContact, subType, effectivePolicy, subscription, order, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ExpandedOrderAction {\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("    contractEffectiveDate: ").append(toIndentedString(contractEffectiveDate)).append("\n");
    sb.append("    customerAcceptanceDate: ").append(toIndentedString(customerAcceptanceDate)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    sequence: ").append(toIndentedString(sequence)).append("\n");
    sb.append("    subscriptionVersionAmendmentId: ").append(toIndentedString(subscriptionVersionAmendmentId)).append("\n");
    sb.append("    orderId: ").append(toIndentedString(orderId)).append("\n");
    sb.append("    subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n");
    sb.append("    changeReason: ").append(toIndentedString(changeReason)).append("\n");
    sb.append("    serviceActivationDate: ").append(toIndentedString(serviceActivationDate)).append("\n");
    sb.append("    autoRenew: ").append(toIndentedString(autoRenew)).append("\n");
    sb.append("    renewSetting: ").append(toIndentedString(renewSetting)).append("\n");
    sb.append("    renewalTerm: ").append(toIndentedString(renewalTerm)).append("\n");
    sb.append("    renewalTermPeriodType: ").append(toIndentedString(renewalTermPeriodType)).append("\n");
    sb.append("    termStartDate: ").append(toIndentedString(termStartDate)).append("\n");
    sb.append("    termType: ").append(toIndentedString(termType)).append("\n");
    sb.append("    currentTerm: ").append(toIndentedString(currentTerm)).append("\n");
    sb.append("    currentTermPeriodType: ").append(toIndentedString(currentTermPeriodType)).append("\n");
    sb.append("    suspendDate: ").append(toIndentedString(suspendDate)).append("\n");
    sb.append("    resumeDate: ").append(toIndentedString(resumeDate)).append("\n");
    sb.append("    cancellationEffectiveDate: ").append(toIndentedString(cancellationEffectiveDate)).append("\n");
    sb.append("    cancellationPolicy: ").append(toIndentedString(cancellationPolicy)).append("\n");
    sb.append("    paymentTerm: ").append(toIndentedString(paymentTerm)).append("\n");
    sb.append("    billToContactId: ").append(toIndentedString(billToContactId)).append("\n");
    sb.append("    invoiceGroupNumber: ").append(toIndentedString(invoiceGroupNumber)).append("\n");
    sb.append("    invoiceTemplateId: ").append(toIndentedString(invoiceTemplateId)).append("\n");
    sb.append("    sequenceSetId: ").append(toIndentedString(sequenceSetId)).append("\n");
    sb.append("    soldToContactId: ").append(toIndentedString(soldToContactId)).append("\n");
    sb.append("    clearingExistingPaymentTerm: ").append(toIndentedString(clearingExistingPaymentTerm)).append("\n");
    sb.append("    clearingExistingBillToContact: ").append(toIndentedString(clearingExistingBillToContact)).append("\n");
    sb.append("    clearingExistingInvoiceGroupNumber: ").append(toIndentedString(clearingExistingInvoiceGroupNumber)).append("\n");
    sb.append("    clearingExistingInvoiceTemplate: ").append(toIndentedString(clearingExistingInvoiceTemplate)).append("\n");
    sb.append("    clearingExistingSequenceSet: ").append(toIndentedString(clearingExistingSequenceSet)).append("\n");
    sb.append("    clearingExistingSoldToContact: ").append(toIndentedString(clearingExistingSoldToContact)).append("\n");
    sb.append("    subType: ").append(toIndentedString(subType)).append("\n");
    sb.append("    effectivePolicy: ").append(toIndentedString(effectivePolicy)).append("\n");
    sb.append("    subscription: ").append(toIndentedString(subscription)).append("\n");
    sb.append("    order: ").append(toIndentedString(order)).append("\n");
    sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }


  public static HashSet openapiFields;
  public static HashSet openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet();
    openapiFields.add("id");
    openapiFields.add("createdById");
    openapiFields.add("createdDate");
    openapiFields.add("updatedById");
    openapiFields.add("updatedDate");
    openapiFields.add("contractEffectiveDate");
    openapiFields.add("customerAcceptanceDate");
    openapiFields.add("type");
    openapiFields.add("sequence");
    openapiFields.add("subscriptionVersionAmendmentId");
    openapiFields.add("orderId");
    openapiFields.add("subscriptionId");
    openapiFields.add("changeReason");
    openapiFields.add("serviceActivationDate");
    openapiFields.add("autoRenew");
    openapiFields.add("renewSetting");
    openapiFields.add("renewalTerm");
    openapiFields.add("renewalTermPeriodType");
    openapiFields.add("termStartDate");
    openapiFields.add("termType");
    openapiFields.add("currentTerm");
    openapiFields.add("currentTermPeriodType");
    openapiFields.add("suspendDate");
    openapiFields.add("resumeDate");
    openapiFields.add("cancellationEffectiveDate");
    openapiFields.add("cancellationPolicy");
    openapiFields.add("paymentTerm");
    openapiFields.add("billToContactId");
    openapiFields.add("invoiceGroupNumber");
    openapiFields.add("invoiceTemplateId");
    openapiFields.add("sequenceSetId");
    openapiFields.add("soldToContactId");
    openapiFields.add("clearingExistingPaymentTerm");
    openapiFields.add("clearingExistingBillToContact");
    openapiFields.add("clearingExistingInvoiceGroupNumber");
    openapiFields.add("clearingExistingInvoiceTemplate");
    openapiFields.add("clearingExistingSequenceSet");
    openapiFields.add("clearingExistingSoldToContact");
    openapiFields.add("subType");
    openapiFields.add("effectivePolicy");
    openapiFields.add("subscription");
    openapiFields.add("order");

    // 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 ExpandedOrderAction
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!ExpandedOrderAction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in ExpandedOrderAction is not found in the empty JSON string", ExpandedOrderAction.openapiRequiredFields.toString()));
        }
      }
        JsonObject jsonObj = jsonElement.getAsJsonObject();
      if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
      }
      if ((jsonObj.get("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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString()));
      }
      if ((jsonObj.get("subscriptionVersionAmendmentId") != null && !jsonObj.get("subscriptionVersionAmendmentId").isJsonNull()) && !jsonObj.get("subscriptionVersionAmendmentId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `subscriptionVersionAmendmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriptionVersionAmendmentId").toString()));
      }
      if ((jsonObj.get("orderId") != null && !jsonObj.get("orderId").isJsonNull()) && !jsonObj.get("orderId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `orderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderId").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("changeReason") != null && !jsonObj.get("changeReason").isJsonNull()) && !jsonObj.get("changeReason").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `changeReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("changeReason").toString()));
      }
      if ((jsonObj.get("renewSetting") != null && !jsonObj.get("renewSetting").isJsonNull()) && !jsonObj.get("renewSetting").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `renewSetting` to be a primitive type in the JSON string but got `%s`", jsonObj.get("renewSetting").toString()));
      }
      if ((jsonObj.get("renewalTermPeriodType") != null && !jsonObj.get("renewalTermPeriodType").isJsonNull()) && !jsonObj.get("renewalTermPeriodType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `renewalTermPeriodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("renewalTermPeriodType").toString()));
      }
      if ((jsonObj.get("termType") != null && !jsonObj.get("termType").isJsonNull()) && !jsonObj.get("termType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `termType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("termType").toString()));
      }
      if ((jsonObj.get("currentTermPeriodType") != null && !jsonObj.get("currentTermPeriodType").isJsonNull()) && !jsonObj.get("currentTermPeriodType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `currentTermPeriodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currentTermPeriodType").toString()));
      }
      if ((jsonObj.get("cancellationPolicy") != null && !jsonObj.get("cancellationPolicy").isJsonNull()) && !jsonObj.get("cancellationPolicy").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `cancellationPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cancellationPolicy").toString()));
      }
      if ((jsonObj.get("paymentTerm") != null && !jsonObj.get("paymentTerm").isJsonNull()) && !jsonObj.get("paymentTerm").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `paymentTerm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentTerm").toString()));
      }
      if ((jsonObj.get("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("invoiceGroupNumber") != null && !jsonObj.get("invoiceGroupNumber").isJsonNull()) && !jsonObj.get("invoiceGroupNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `invoiceGroupNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceGroupNumber").toString()));
      }
      if ((jsonObj.get("invoiceTemplateId") != null && !jsonObj.get("invoiceTemplateId").isJsonNull()) && !jsonObj.get("invoiceTemplateId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `invoiceTemplateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceTemplateId").toString()));
      }
      if ((jsonObj.get("sequenceSetId") != null && !jsonObj.get("sequenceSetId").isJsonNull()) && !jsonObj.get("sequenceSetId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `sequenceSetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sequenceSetId").toString()));
      }
      if ((jsonObj.get("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("subType") != null && !jsonObj.get("subType").isJsonNull()) && !jsonObj.get("subType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `subType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subType").toString()));
      }
      if ((jsonObj.get("effectivePolicy") != null && !jsonObj.get("effectivePolicy").isJsonNull()) && !jsonObj.get("effectivePolicy").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `effectivePolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effectivePolicy").toString()));
      }
  }

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

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

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





© 2015 - 2025 Weber Informatics LLC | Privacy Policy