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

com.zuora.model.OrderCreateAccount 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.CreateAccountPaymentMethod;
import com.zuora.model.CreditCard;
import com.zuora.model.OrderCreateAccountContact;
import com.zuora.model.TaxInfo;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

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

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

import com.zuora.JSON;

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

  public static final String SERIALIZED_NAME_ADDITIONAL_EMAIL_ADDRESSES = "additionalEmailAddresses";
  @SerializedName(SERIALIZED_NAME_ADDITIONAL_EMAIL_ADDRESSES)
  private String additionalEmailAddresses;

  public static final String SERIALIZED_NAME_ALLOW_INVOICE_EDIT = "allowInvoiceEdit";
  @SerializedName(SERIALIZED_NAME_ALLOW_INVOICE_EDIT)
  private Boolean allowInvoiceEdit;

  public static final String SERIALIZED_NAME_AUTO_PAY = "autoPay";
  @SerializedName(SERIALIZED_NAME_AUTO_PAY)
  private Boolean autoPay;

  public static final String SERIALIZED_NAME_BATCH = "batch";
  @SerializedName(SERIALIZED_NAME_BATCH)
  private String batch;

  public static final String SERIALIZED_NAME_BILL_CYCLE_DAY = "billCycleDay";
  @SerializedName(SERIALIZED_NAME_BILL_CYCLE_DAY)
  private Integer billCycleDay;

  public static final String SERIALIZED_NAME_BILL_TO_CONTACT = "billToContact";
  @SerializedName(SERIALIZED_NAME_BILL_TO_CONTACT)
  private OrderCreateAccountContact billToContact;

  public static final String SERIALIZED_NAME_COMMUNICATION_PROFILE_ID = "communicationProfileId";
  @SerializedName(SERIALIZED_NAME_COMMUNICATION_PROFILE_ID)
  private String communicationProfileId;

  public static final String SERIALIZED_NAME_CREDIT_CARD = "creditCard";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD)
  private CreditCard creditCard;

  public static final String SERIALIZED_NAME_CREDIT_MEMO_TEMPLATE_ID = "creditMemoTemplateId";
  @SerializedName(SERIALIZED_NAME_CREDIT_MEMO_TEMPLATE_ID)
  private String creditMemoTemplateId;

  public static final String SERIALIZED_NAME_CRM_ID = "crmId";
  @SerializedName(SERIALIZED_NAME_CRM_ID)
  private String crmId;

  public static final String SERIALIZED_NAME_CURRENCY = "currency";
  @SerializedName(SERIALIZED_NAME_CURRENCY)
  private String currency;

  public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "customFields";
  @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS)
  private Map customFields;

  public static final String SERIALIZED_NAME_CUSTOMER_SERVICE_REP_NAME = "customerServiceRepName";
  @SerializedName(SERIALIZED_NAME_CUSTOMER_SERVICE_REP_NAME)
  private String customerServiceRepName;

  public static final String SERIALIZED_NAME_DEBIT_MEMO_TEMPLATE_ID = "debitMemoTemplateId";
  @SerializedName(SERIALIZED_NAME_DEBIT_MEMO_TEMPLATE_ID)
  private String debitMemoTemplateId;

  public static final String SERIALIZED_NAME_HPM_CREDIT_CARD_PAYMENT_METHOD_ID = "hpmCreditCardPaymentMethodId";
  @SerializedName(SERIALIZED_NAME_HPM_CREDIT_CARD_PAYMENT_METHOD_ID)
  private String hpmCreditCardPaymentMethodId;

  public static final String SERIALIZED_NAME_INVOICE_DELIVERY_PREFS_EMAIL = "invoiceDeliveryPrefsEmail";
  @SerializedName(SERIALIZED_NAME_INVOICE_DELIVERY_PREFS_EMAIL)
  private Boolean invoiceDeliveryPrefsEmail;

  public static final String SERIALIZED_NAME_INVOICE_DELIVERY_PREFS_PRINT = "invoiceDeliveryPrefsPrint";
  @SerializedName(SERIALIZED_NAME_INVOICE_DELIVERY_PREFS_PRINT)
  private Boolean invoiceDeliveryPrefsPrint;

  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_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name;

  public static final String SERIALIZED_NAME_NOTES = "notes";
  @SerializedName(SERIALIZED_NAME_NOTES)
  private String notes;

  public static final String SERIALIZED_NAME_PARENT_ID = "parentId";
  @SerializedName(SERIALIZED_NAME_PARENT_ID)
  private String parentId;

  public static final String SERIALIZED_NAME_PARTNER_ACCOUNT = "partnerAccount";
  @SerializedName(SERIALIZED_NAME_PARTNER_ACCOUNT)
  private Boolean partnerAccount;

  public static final String SERIALIZED_NAME_PAYMENT_GATEWAY = "paymentGateway";
  @SerializedName(SERIALIZED_NAME_PAYMENT_GATEWAY)
  private String paymentGateway;

  public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod";
  @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD)
  private CreateAccountPaymentMethod paymentMethod;

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

  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_SALES_REP = "salesRep";
  @SerializedName(SERIALIZED_NAME_SALES_REP)
  private String salesRep;

  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 = "soldToContact";
  @SerializedName(SERIALIZED_NAME_SOLD_TO_CONTACT)
  private OrderCreateAccountContact soldToContact;

  public static final String SERIALIZED_NAME_SOLD_TO_SAME_AS_BILL_TO = "soldToSameAsBillTo";
  @SerializedName(SERIALIZED_NAME_SOLD_TO_SAME_AS_BILL_TO)
  private Boolean soldToSameAsBillTo;

  public static final String SERIALIZED_NAME_SHIP_TO_CONTACT = "shipToContact";
  @SerializedName(SERIALIZED_NAME_SHIP_TO_CONTACT)
  private OrderCreateAccountContact shipToContact;

  public static final String SERIALIZED_NAME_SHIP_TO_SAME_AS_BILL_TO = "shipToSameAsBillTo";
  @SerializedName(SERIALIZED_NAME_SHIP_TO_SAME_AS_BILL_TO)
  private Boolean shipToSameAsBillTo;

  public static final String SERIALIZED_NAME_TAX_INFO = "taxInfo";
  @SerializedName(SERIALIZED_NAME_TAX_INFO)
  private TaxInfo taxInfo;

  public OrderCreateAccount() {
  }

  public OrderCreateAccount accountNumber(String accountNumber) {
    this.accountNumber = accountNumber;
    return this;
  }

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

  public void setAccountNumber(String accountNumber) {
    this.accountNumber = accountNumber;
  }


  public OrderCreateAccount additionalEmailAddresses(String additionalEmailAddresses) {
    this.additionalEmailAddresses = additionalEmailAddresses;
    return this;
  }

  /**
   * List of additional email addresses to receive emailed invoices. Values should be a comma-separated list of email addresses. 
   * @return additionalEmailAddresses
   */
  @javax.annotation.Nullable
  public String getAdditionalEmailAddresses() {
    return additionalEmailAddresses;
  }

  public void setAdditionalEmailAddresses(String additionalEmailAddresses) {
    this.additionalEmailAddresses = additionalEmailAddresses;
  }


  public OrderCreateAccount allowInvoiceEdit(Boolean allowInvoiceEdit) {
    this.allowInvoiceEdit = allowInvoiceEdit;
    return this;
  }

  /**
   * Indicates if associated invoices can be edited. Values are:   * `true` * `false` (default) 
   * @return allowInvoiceEdit
   */
  @javax.annotation.Nullable
  public Boolean getAllowInvoiceEdit() {
    return allowInvoiceEdit;
  }

  public void setAllowInvoiceEdit(Boolean allowInvoiceEdit) {
    this.allowInvoiceEdit = allowInvoiceEdit;
  }


  public OrderCreateAccount autoPay(Boolean autoPay) {
    this.autoPay = autoPay;
    return this;
  }

  /**
   * Specifies whether future payments are to be automatically billed when they are due. Possible values are `true`, `false`.
   * @return autoPay
   */
  @javax.annotation.Nullable
  public Boolean getAutoPay() {
    return autoPay;
  }

  public void setAutoPay(Boolean autoPay) {
    this.autoPay = autoPay;
  }


  public OrderCreateAccount batch(String batch) {
    this.batch = batch;
    return this;
  }

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

  public void setBatch(String batch) {
    this.batch = batch;
  }


  public OrderCreateAccount billCycleDay(Integer billCycleDay) {
    this.billCycleDay = billCycleDay;
    return this;
  }

  /**
   * Day of the month that the account prefers billing periods to begin on. If set to 0, the bill cycle day will be set as \"AutoSet\".
   * minimum: 0
   * maximum: 31
   * @return billCycleDay
   */
  @javax.annotation.Nonnull
  public Integer getBillCycleDay() {
    return billCycleDay;
  }

  public void setBillCycleDay(Integer billCycleDay) {
    this.billCycleDay = billCycleDay;
  }


  public OrderCreateAccount billToContact(OrderCreateAccountContact billToContact) {
    this.billToContact = billToContact;
    return this;
  }

  /**
   * Get billToContact
   * @return billToContact
   */
  @javax.annotation.Nonnull
  public OrderCreateAccountContact getBillToContact() {
    return billToContact;
  }

  public void setBillToContact(OrderCreateAccountContact billToContact) {
    this.billToContact = billToContact;
  }


  public OrderCreateAccount communicationProfileId(String communicationProfileId) {
    this.communicationProfileId = communicationProfileId;
    return this;
  }

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

  public void setCommunicationProfileId(String communicationProfileId) {
    this.communicationProfileId = communicationProfileId;
  }


  public OrderCreateAccount creditCard(CreditCard creditCard) {
    this.creditCard = creditCard;
    return this;
  }

  /**
   * Get creditCard
   * @return creditCard
   */
  @javax.annotation.Nullable
  public CreditCard getCreditCard() {
    return creditCard;
  }

  public void setCreditCard(CreditCard creditCard) {
    this.creditCard = creditCard;
  }


  public OrderCreateAccount creditMemoTemplateId(String creditMemoTemplateId) {
    this.creditMemoTemplateId = creditMemoTemplateId;
    return this;
  }

  /**
   * **Note:** This field is only available if you have [Invoice Settlement](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement) enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement/Invoice_Settlement_Migration_Checklist_and_Guide) for more information.  The unique ID of the credit memo template, configured in **Billing Settings** > **Manage Billing Document Configuration** through the Zuora UI. For example, 2c92c08a6246fdf101626b1b3fe0144b. 
   * @return creditMemoTemplateId
   */
  @javax.annotation.Nullable
  public String getCreditMemoTemplateId() {
    return creditMemoTemplateId;
  }

  public void setCreditMemoTemplateId(String creditMemoTemplateId) {
    this.creditMemoTemplateId = creditMemoTemplateId;
  }


  public OrderCreateAccount crmId(String crmId) {
    this.crmId = crmId;
    return this;
  }

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

  public void setCrmId(String crmId) {
    this.crmId = crmId;
  }


  public OrderCreateAccount currency(String currency) {
    this.currency = currency;
    return this;
  }

  /**
   * 3 uppercase character currency code.  For payment method authorization, if the `paymentMethod` > `currencyCode` field is specified, `currencyCode` is used. Otherwise, this `currency` field is used for payment method authorization. If no currency is specified for the account, the default currency of the account is then used. 
   * @return currency
   */
  @javax.annotation.Nonnull
  public String getCurrency() {
    return currency;
  }

  public void setCurrency(String currency) {
    this.currency = currency;
  }


  public OrderCreateAccount customFields(Map customFields) {
    this.customFields = customFields;
    return this;
  }

  public OrderCreateAccount putCustomFieldsItem(String key, Object customFieldsItem) {
    if (this.customFields == null) {
      this.customFields = new HashMap<>();
    }
    this.customFields.put(key, customFieldsItem);
    return this;
  }

  /**
   * Get customFields
   * @return customFields
   */
  @javax.annotation.Nullable
  public Map getCustomFields() {
    return customFields;
  }

  public void setCustomFields(Map customFields) {
    this.customFields = customFields;
  }


  public OrderCreateAccount customerServiceRepName(String customerServiceRepName) {
    this.customerServiceRepName = customerServiceRepName;
    return this;
  }

  /**
   * Name of the account's customer service representative, if applicable. 
   * @return customerServiceRepName
   */
  @javax.annotation.Nullable
  public String getCustomerServiceRepName() {
    return customerServiceRepName;
  }

  public void setCustomerServiceRepName(String customerServiceRepName) {
    this.customerServiceRepName = customerServiceRepName;
  }


  public OrderCreateAccount debitMemoTemplateId(String debitMemoTemplateId) {
    this.debitMemoTemplateId = debitMemoTemplateId;
    return this;
  }

  /**
   * **Note:** This field is only available if you have [Invoice Settlement](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement) enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement/Invoice_Settlement_Migration_Checklist_and_Guide) for more information.  The unique ID of the debit memo template, configured in **Billing Settings** > **Manage Billing Document Configuration** through the Zuora UI. For example, 2c92c08d62470a8501626b19d24f19e2. 
   * @return debitMemoTemplateId
   */
  @javax.annotation.Nullable
  public String getDebitMemoTemplateId() {
    return debitMemoTemplateId;
  }

  public void setDebitMemoTemplateId(String debitMemoTemplateId) {
    this.debitMemoTemplateId = debitMemoTemplateId;
  }


  public OrderCreateAccount hpmCreditCardPaymentMethodId(String hpmCreditCardPaymentMethodId) {
    this.hpmCreditCardPaymentMethodId = hpmCreditCardPaymentMethodId;
    return this;
  }

  /**
   * The ID of the payment method associated with this account. The payment method specified for this field will be set as the default payment method of the account.  If the `autoPay` field is set to `true`, you must provide the credit card payment method ID for either this field or the `creditCard` field, but not both.  For the Credit Card Reference Transaction payment method, you can specify the payment method ID in this field or use the `paymentMethod` field to create a CC Reference Transaction payment method for an account. 
   * @return hpmCreditCardPaymentMethodId
   */
  @javax.annotation.Nullable
  public String getHpmCreditCardPaymentMethodId() {
    return hpmCreditCardPaymentMethodId;
  }

  public void setHpmCreditCardPaymentMethodId(String hpmCreditCardPaymentMethodId) {
    this.hpmCreditCardPaymentMethodId = hpmCreditCardPaymentMethodId;
  }


  public OrderCreateAccount invoiceDeliveryPrefsEmail(Boolean invoiceDeliveryPrefsEmail) {
    this.invoiceDeliveryPrefsEmail = invoiceDeliveryPrefsEmail;
    return this;
  }

  /**
   * Specifies whether to turn on the invoice delivery method 'Email' for the new account.  Values are:   * `true` (default). Turn on the invoice delivery method 'Email' for the new account. * `false`. Turn off the invoice delivery method 'Email' for the new account. 
   * @return invoiceDeliveryPrefsEmail
   */
  @javax.annotation.Nullable
  public Boolean getInvoiceDeliveryPrefsEmail() {
    return invoiceDeliveryPrefsEmail;
  }

  public void setInvoiceDeliveryPrefsEmail(Boolean invoiceDeliveryPrefsEmail) {
    this.invoiceDeliveryPrefsEmail = invoiceDeliveryPrefsEmail;
  }


  public OrderCreateAccount invoiceDeliveryPrefsPrint(Boolean invoiceDeliveryPrefsPrint) {
    this.invoiceDeliveryPrefsPrint = invoiceDeliveryPrefsPrint;
    return this;
  }

  /**
   * Specifies whether to turn on the invoice delivery method 'Print' for the new account. Values are:   * `true`. Turn on the invoice delivery method 'Print' for the new account. * `false` (default). Turn off the invoice delivery method 'Print' for the new account. 
   * @return invoiceDeliveryPrefsPrint
   */
  @javax.annotation.Nullable
  public Boolean getInvoiceDeliveryPrefsPrint() {
    return invoiceDeliveryPrefsPrint;
  }

  public void setInvoiceDeliveryPrefsPrint(Boolean invoiceDeliveryPrefsPrint) {
    this.invoiceDeliveryPrefsPrint = invoiceDeliveryPrefsPrint;
  }


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

  /**
   * Get name
   * @return name
   */
  @javax.annotation.Nonnull
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }


  public OrderCreateAccount notes(String notes) {
    this.notes = notes;
    return this;
  }

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

  public void setNotes(String notes) {
    this.notes = notes;
  }


  public OrderCreateAccount parentId(String parentId) {
    this.parentId = parentId;
    return this;
  }

  /**
   * Identifier of the parent customer account for this Account object. Use this field if you have <a href=\"https://knowledgecenter.zuora.com/Billing/Subscriptions/Customer_Accounts/A_Customer_Account_Introduction#Customer_Hierarchy\" target=\"_blank\">Customer Hierarchy</a> enabled.
   * @return parentId
   */
  @javax.annotation.Nullable
  public String getParentId() {
    return parentId;
  }

  public void setParentId(String parentId) {
    this.parentId = parentId;
  }


  public OrderCreateAccount partnerAccount(Boolean partnerAccount) {
    this.partnerAccount = partnerAccount;
    return this;
  }

  /**
   * Whether the customer account is a partner, distributor, or reseller.  You can set this field to `true` if you have business with distributors or resellers, or operating in B2B model to manage numerous subscriptions through concurrent API requests. After this field is set to `true`, the calculation of account metrics is performed asynchronously during operations such as subscription creation, order changes, invoice generation, and payments. **Note**: This field is available only if you have the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Manage_customer_accounts/AAA_Overview_of_customer_accounts/Reseller_Account\" target=\"_blank\">Reseller Account</a> feature enabled. 
   * @return partnerAccount
   */
  @javax.annotation.Nullable
  public Boolean getPartnerAccount() {
    return partnerAccount;
  }

  public void setPartnerAccount(Boolean partnerAccount) {
    this.partnerAccount = partnerAccount;
  }


  public OrderCreateAccount paymentGateway(String paymentGateway) {
    this.paymentGateway = paymentGateway;
    return this;
  }

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

  public void setPaymentGateway(String paymentGateway) {
    this.paymentGateway = paymentGateway;
  }


  public OrderCreateAccount paymentMethod(CreateAccountPaymentMethod paymentMethod) {
    this.paymentMethod = paymentMethod;
    return this;
  }

  /**
   * Get paymentMethod
   * @return paymentMethod
   */
  @javax.annotation.Nullable
  public CreateAccountPaymentMethod getPaymentMethod() {
    return paymentMethod;
  }

  public void setPaymentMethod(CreateAccountPaymentMethod paymentMethod) {
    this.paymentMethod = paymentMethod;
  }


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

  /**
   * **Note**: If you want to specify a payment term when creating a new account, you must set a value in this field. If you do not set a value in this field, Zuora will use `Due Upon Receipt` as the value instead of the default value set in **Billing Settings** > **Payment Terms** from Zuora UI. 
   * @return paymentTerm
   */
  @javax.annotation.Nullable
  public String getPaymentTerm() {
    return paymentTerm;
  }

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


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

  /**
   * The number of the purchase order associated with this account. Purchase order information generally comes from customers. 
   * @return purchaseOrderNumber
   */
  @javax.annotation.Nullable
  public String getPurchaseOrderNumber() {
    return purchaseOrderNumber;
  }

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


  public OrderCreateAccount salesRep(String salesRep) {
    this.salesRep = salesRep;
    return this;
  }

  /**
   * The name of the sales representative associated with this account, if applicable. 
   * @return salesRep
   */
  @javax.annotation.Nullable
  public String getSalesRep() {
    return salesRep;
  }

  public void setSalesRep(String salesRep) {
    this.salesRep = salesRep;
  }


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

  /**
   * The ID of the sequence set to assign to the customer account.   The billing documents to generate for this account will adopt the prefix and starting document number configured in the sequence set. 
   * @return sequenceSetId
   */
  @javax.annotation.Nullable
  public String getSequenceSetId() {
    return sequenceSetId;
  }

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


  public OrderCreateAccount soldToContact(OrderCreateAccountContact soldToContact) {
    this.soldToContact = soldToContact;
    return this;
  }

  /**
   * Get soldToContact
   * @return soldToContact
   */
  @javax.annotation.Nullable
  public OrderCreateAccountContact getSoldToContact() {
    return soldToContact;
  }

  public void setSoldToContact(OrderCreateAccountContact soldToContact) {
    this.soldToContact = soldToContact;
  }


  public OrderCreateAccount soldToSameAsBillTo(Boolean soldToSameAsBillTo) {
    this.soldToSameAsBillTo = soldToSameAsBillTo;
    return this;
  }

  /**
   * Whether the sold-to contact and bill-to contact are the same entity.   The created account has the same bill-to contact and sold-to contact entity only when all the following conditions are met in the request body:  - This field is set to `true`.  - A bill-to contact is specified. - No sold-to contact is specified. 
   * @return soldToSameAsBillTo
   */
  @javax.annotation.Nullable
  public Boolean getSoldToSameAsBillTo() {
    return soldToSameAsBillTo;
  }

  public void setSoldToSameAsBillTo(Boolean soldToSameAsBillTo) {
    this.soldToSameAsBillTo = soldToSameAsBillTo;
  }


  public OrderCreateAccount shipToContact(OrderCreateAccountContact shipToContact) {
    this.shipToContact = shipToContact;
    return this;
  }

  /**
   * Get shipToContact
   * @return shipToContact
   */
  @javax.annotation.Nullable
  public OrderCreateAccountContact getShipToContact() {
    return shipToContact;
  }

  public void setShipToContact(OrderCreateAccountContact shipToContact) {
    this.shipToContact = shipToContact;
  }


  public OrderCreateAccount shipToSameAsBillTo(Boolean shipToSameAsBillTo) {
    this.shipToSameAsBillTo = shipToSameAsBillTo;
    return this;
  }

  /**
   * The created account has the same ship-to contact and bill-to contact 
   * @return shipToSameAsBillTo
   */
  @javax.annotation.Nullable
  public Boolean getShipToSameAsBillTo() {
    return shipToSameAsBillTo;
  }

  public void setShipToSameAsBillTo(Boolean shipToSameAsBillTo) {
    this.shipToSameAsBillTo = shipToSameAsBillTo;
  }


  public OrderCreateAccount taxInfo(TaxInfo taxInfo) {
    this.taxInfo = taxInfo;
    return this;
  }

  /**
   * Get taxInfo
   * @return taxInfo
   */
  @javax.annotation.Nullable
  public TaxInfo getTaxInfo() {
    return taxInfo;
  }

  public void setTaxInfo(TaxInfo taxInfo) {
    this.taxInfo = taxInfo;
  }

  /**
   * 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 OrderCreateAccount instance itself
   */
  public OrderCreateAccount 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;
    }
    OrderCreateAccount orderCreateAccount = (OrderCreateAccount) o;
    return Objects.equals(this.accountNumber, orderCreateAccount.accountNumber) &&
        Objects.equals(this.additionalEmailAddresses, orderCreateAccount.additionalEmailAddresses) &&
        Objects.equals(this.allowInvoiceEdit, orderCreateAccount.allowInvoiceEdit) &&
        Objects.equals(this.autoPay, orderCreateAccount.autoPay) &&
        Objects.equals(this.batch, orderCreateAccount.batch) &&
        Objects.equals(this.billCycleDay, orderCreateAccount.billCycleDay) &&
        Objects.equals(this.billToContact, orderCreateAccount.billToContact) &&
        Objects.equals(this.communicationProfileId, orderCreateAccount.communicationProfileId) &&
        Objects.equals(this.creditCard, orderCreateAccount.creditCard) &&
        Objects.equals(this.creditMemoTemplateId, orderCreateAccount.creditMemoTemplateId) &&
        Objects.equals(this.crmId, orderCreateAccount.crmId) &&
        Objects.equals(this.currency, orderCreateAccount.currency) &&
        Objects.equals(this.customFields, orderCreateAccount.customFields) &&
        Objects.equals(this.customerServiceRepName, orderCreateAccount.customerServiceRepName) &&
        Objects.equals(this.debitMemoTemplateId, orderCreateAccount.debitMemoTemplateId) &&
        Objects.equals(this.hpmCreditCardPaymentMethodId, orderCreateAccount.hpmCreditCardPaymentMethodId) &&
        Objects.equals(this.invoiceDeliveryPrefsEmail, orderCreateAccount.invoiceDeliveryPrefsEmail) &&
        Objects.equals(this.invoiceDeliveryPrefsPrint, orderCreateAccount.invoiceDeliveryPrefsPrint) &&
        Objects.equals(this.invoiceTemplateId, orderCreateAccount.invoiceTemplateId) &&
        Objects.equals(this.name, orderCreateAccount.name) &&
        Objects.equals(this.notes, orderCreateAccount.notes) &&
        Objects.equals(this.parentId, orderCreateAccount.parentId) &&
        Objects.equals(this.partnerAccount, orderCreateAccount.partnerAccount) &&
        Objects.equals(this.paymentGateway, orderCreateAccount.paymentGateway) &&
        Objects.equals(this.paymentMethod, orderCreateAccount.paymentMethod) &&
        Objects.equals(this.paymentTerm, orderCreateAccount.paymentTerm) &&
        Objects.equals(this.purchaseOrderNumber, orderCreateAccount.purchaseOrderNumber) &&
        Objects.equals(this.salesRep, orderCreateAccount.salesRep) &&
        Objects.equals(this.sequenceSetId, orderCreateAccount.sequenceSetId) &&
        Objects.equals(this.soldToContact, orderCreateAccount.soldToContact) &&
        Objects.equals(this.soldToSameAsBillTo, orderCreateAccount.soldToSameAsBillTo) &&
        Objects.equals(this.shipToContact, orderCreateAccount.shipToContact) &&
        Objects.equals(this.shipToSameAsBillTo, orderCreateAccount.shipToSameAsBillTo) &&
        Objects.equals(this.taxInfo, orderCreateAccount.taxInfo)&&
        Objects.equals(this.additionalProperties, orderCreateAccount.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(accountNumber, additionalEmailAddresses, allowInvoiceEdit, autoPay, batch, billCycleDay, billToContact, communicationProfileId, creditCard, creditMemoTemplateId, crmId, currency, customFields, customerServiceRepName, debitMemoTemplateId, hpmCreditCardPaymentMethodId, invoiceDeliveryPrefsEmail, invoiceDeliveryPrefsPrint, invoiceTemplateId, name, notes, parentId, partnerAccount, paymentGateway, paymentMethod, paymentTerm, purchaseOrderNumber, salesRep, sequenceSetId, soldToContact, soldToSameAsBillTo, shipToContact, shipToSameAsBillTo, taxInfo, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class OrderCreateAccount {\n");
    sb.append("    accountNumber: ").append(toIndentedString(accountNumber)).append("\n");
    sb.append("    additionalEmailAddresses: ").append(toIndentedString(additionalEmailAddresses)).append("\n");
    sb.append("    allowInvoiceEdit: ").append(toIndentedString(allowInvoiceEdit)).append("\n");
    sb.append("    autoPay: ").append(toIndentedString(autoPay)).append("\n");
    sb.append("    batch: ").append(toIndentedString(batch)).append("\n");
    sb.append("    billCycleDay: ").append(toIndentedString(billCycleDay)).append("\n");
    sb.append("    billToContact: ").append(toIndentedString(billToContact)).append("\n");
    sb.append("    communicationProfileId: ").append(toIndentedString(communicationProfileId)).append("\n");
    sb.append("    creditCard: ").append(toIndentedString(creditCard)).append("\n");
    sb.append("    creditMemoTemplateId: ").append(toIndentedString(creditMemoTemplateId)).append("\n");
    sb.append("    crmId: ").append(toIndentedString(crmId)).append("\n");
    sb.append("    currency: ").append(toIndentedString(currency)).append("\n");
    sb.append("    customFields: ").append(toIndentedString(customFields)).append("\n");
    sb.append("    customerServiceRepName: ").append(toIndentedString(customerServiceRepName)).append("\n");
    sb.append("    debitMemoTemplateId: ").append(toIndentedString(debitMemoTemplateId)).append("\n");
    sb.append("    hpmCreditCardPaymentMethodId: ").append(toIndentedString(hpmCreditCardPaymentMethodId)).append("\n");
    sb.append("    invoiceDeliveryPrefsEmail: ").append(toIndentedString(invoiceDeliveryPrefsEmail)).append("\n");
    sb.append("    invoiceDeliveryPrefsPrint: ").append(toIndentedString(invoiceDeliveryPrefsPrint)).append("\n");
    sb.append("    invoiceTemplateId: ").append(toIndentedString(invoiceTemplateId)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    notes: ").append(toIndentedString(notes)).append("\n");
    sb.append("    parentId: ").append(toIndentedString(parentId)).append("\n");
    sb.append("    partnerAccount: ").append(toIndentedString(partnerAccount)).append("\n");
    sb.append("    paymentGateway: ").append(toIndentedString(paymentGateway)).append("\n");
    sb.append("    paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n");
    sb.append("    paymentTerm: ").append(toIndentedString(paymentTerm)).append("\n");
    sb.append("    purchaseOrderNumber: ").append(toIndentedString(purchaseOrderNumber)).append("\n");
    sb.append("    salesRep: ").append(toIndentedString(salesRep)).append("\n");
    sb.append("    sequenceSetId: ").append(toIndentedString(sequenceSetId)).append("\n");
    sb.append("    soldToContact: ").append(toIndentedString(soldToContact)).append("\n");
    sb.append("    soldToSameAsBillTo: ").append(toIndentedString(soldToSameAsBillTo)).append("\n");
    sb.append("    shipToContact: ").append(toIndentedString(shipToContact)).append("\n");
    sb.append("    shipToSameAsBillTo: ").append(toIndentedString(shipToSameAsBillTo)).append("\n");
    sb.append("    taxInfo: ").append(toIndentedString(taxInfo)).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("accountNumber");
    openapiFields.add("additionalEmailAddresses");
    openapiFields.add("allowInvoiceEdit");
    openapiFields.add("autoPay");
    openapiFields.add("batch");
    openapiFields.add("billCycleDay");
    openapiFields.add("billToContact");
    openapiFields.add("communicationProfileId");
    openapiFields.add("creditCard");
    openapiFields.add("creditMemoTemplateId");
    openapiFields.add("crmId");
    openapiFields.add("currency");
    openapiFields.add("customFields");
    openapiFields.add("customerServiceRepName");
    openapiFields.add("debitMemoTemplateId");
    openapiFields.add("hpmCreditCardPaymentMethodId");
    openapiFields.add("invoiceDeliveryPrefsEmail");
    openapiFields.add("invoiceDeliveryPrefsPrint");
    openapiFields.add("invoiceTemplateId");
    openapiFields.add("name");
    openapiFields.add("notes");
    openapiFields.add("parentId");
    openapiFields.add("partnerAccount");
    openapiFields.add("paymentGateway");
    openapiFields.add("paymentMethod");
    openapiFields.add("paymentTerm");
    openapiFields.add("purchaseOrderNumber");
    openapiFields.add("salesRep");
    openapiFields.add("sequenceSetId");
    openapiFields.add("soldToContact");
    openapiFields.add("soldToSameAsBillTo");
    openapiFields.add("shipToContact");
    openapiFields.add("shipToSameAsBillTo");
    openapiFields.add("taxInfo");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet();
    openapiRequiredFields.add("billCycleDay");
    openapiRequiredFields.add("billToContact");
    openapiRequiredFields.add("currency");
    openapiRequiredFields.add("name");
  }

  /**
   * 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 OrderCreateAccount
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!OrderCreateAccount.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in OrderCreateAccount is not found in the empty JSON string", OrderCreateAccount.openapiRequiredFields.toString()));
        }
      }

      // check to make sure all required properties/fields are present in the JSON string
      for (String requiredField : OrderCreateAccount.openapiRequiredFields) {
        if (jsonElement.getAsJsonObject().get(requiredField) == null) {
          throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
        }
      }
        JsonObject jsonObj = jsonElement.getAsJsonObject();
      if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString()));
      }
      if ((jsonObj.get("additionalEmailAddresses") != null && !jsonObj.get("additionalEmailAddresses").isJsonNull()) && !jsonObj.get("additionalEmailAddresses").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `additionalEmailAddresses` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalEmailAddresses").toString()));
      }
      if ((jsonObj.get("batch") != null && !jsonObj.get("batch").isJsonNull()) && !jsonObj.get("batch").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `batch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("batch").toString()));
      }
      if ((jsonObj.get("communicationProfileId") != null && !jsonObj.get("communicationProfileId").isJsonNull()) && !jsonObj.get("communicationProfileId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `communicationProfileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("communicationProfileId").toString()));
      }
      // validate the optional field `creditCard`
      if (jsonObj.get("creditCard") != null && !jsonObj.get("creditCard").isJsonNull()) {
        CreditCard.validateJsonElement(jsonObj.get("creditCard"));
      }
      if ((jsonObj.get("creditMemoTemplateId") != null && !jsonObj.get("creditMemoTemplateId").isJsonNull()) && !jsonObj.get("creditMemoTemplateId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `creditMemoTemplateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creditMemoTemplateId").toString()));
      }
      if ((jsonObj.get("crmId") != null && !jsonObj.get("crmId").isJsonNull()) && !jsonObj.get("crmId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `crmId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("crmId").toString()));
      }
      if (!jsonObj.get("currency").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString()));
      }
      if ((jsonObj.get("customerServiceRepName") != null && !jsonObj.get("customerServiceRepName").isJsonNull()) && !jsonObj.get("customerServiceRepName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `customerServiceRepName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerServiceRepName").toString()));
      }
      if ((jsonObj.get("debitMemoTemplateId") != null && !jsonObj.get("debitMemoTemplateId").isJsonNull()) && !jsonObj.get("debitMemoTemplateId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `debitMemoTemplateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("debitMemoTemplateId").toString()));
      }
      if ((jsonObj.get("hpmCreditCardPaymentMethodId") != null && !jsonObj.get("hpmCreditCardPaymentMethodId").isJsonNull()) && !jsonObj.get("hpmCreditCardPaymentMethodId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `hpmCreditCardPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hpmCreditCardPaymentMethodId").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("name").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
      }
      if ((jsonObj.get("notes") != null && !jsonObj.get("notes").isJsonNull()) && !jsonObj.get("notes").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `notes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notes").toString()));
      }
      if ((jsonObj.get("parentId") != null && !jsonObj.get("parentId").isJsonNull()) && !jsonObj.get("parentId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `parentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentId").toString()));
      }
      if ((jsonObj.get("paymentGateway") != null && !jsonObj.get("paymentGateway").isJsonNull()) && !jsonObj.get("paymentGateway").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `paymentGateway` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentGateway").toString()));
      }
      // validate the optional field `paymentMethod`
      if (jsonObj.get("paymentMethod") != null && !jsonObj.get("paymentMethod").isJsonNull()) {
        CreateAccountPaymentMethod.validateJsonElement(jsonObj.get("paymentMethod"));
      }
      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("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("salesRep") != null && !jsonObj.get("salesRep").isJsonNull()) && !jsonObj.get("salesRep").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `salesRep` to be a primitive type in the JSON string but got `%s`", jsonObj.get("salesRep").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()));
      }
      // validate the optional field `taxInfo`
      if (jsonObj.get("taxInfo") != null && !jsonObj.get("taxInfo").isJsonNull()) {
        TaxInfo.validateJsonElement(jsonObj.get("taxInfo"));
      }
  }

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

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

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





© 2015 - 2025 Weber Informatics LLC | Privacy Policy