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

com.zuora.model.CreateOrderTermsAndConditions 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.LastTerm;
import com.zuora.model.RenewalSetting;
import com.zuora.model.RenewalTerm;
import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

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

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

import com.zuora.JSON;

/**
 * Information about an order action of type `TermsAndConditions`. 
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class CreateOrderTermsAndConditions {
  public static final String SERIALIZED_NAME_AUTO_RENEW = "autoRenew";
  @SerializedName(SERIALIZED_NAME_AUTO_RENEW)
  private Boolean autoRenew;

  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_CLEARING_EXISTING_BILL_TO_CONTACT = "clearingExistingBillToContact";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_BILL_TO_CONTACT)
  private Boolean clearingExistingBillToContact = false;

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

  public static final String SERIALIZED_NAME_CLEARING_EXISTING_PAYMENT_TERM = "clearingExistingPaymentTerm";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_PAYMENT_TERM)
  private Boolean clearingExistingPaymentTerm = false;

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

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

  public static final String SERIALIZED_NAME_INVOICE_SEPARATELY = "invoiceSeparately";
  @SerializedName(SERIALIZED_NAME_INVOICE_SEPARATELY)
  private Boolean invoiceSeparately;

  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_LAST_TERM = "lastTerm";
  @SerializedName(SERIALIZED_NAME_LAST_TERM)
  private LastTerm lastTerm;

  public static final String SERIALIZED_NAME_TERM_INCREASE_TO_NEW_CONTRACT_LINE = "termIncreaseToNewContractLine";
  @SerializedName(SERIALIZED_NAME_TERM_INCREASE_TO_NEW_CONTRACT_LINE)
  private Boolean termIncreaseToNewContractLine;

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

  public static final String SERIALIZED_NAME_RENEWAL_SETTING = "renewalSetting";
  @SerializedName(SERIALIZED_NAME_RENEWAL_SETTING)
  private RenewalSetting renewalSetting;

  public static final String SERIALIZED_NAME_RENEWAL_TERMS = "renewalTerms";
  @SerializedName(SERIALIZED_NAME_RENEWAL_TERMS)
  private List renewalTerms;

  public static final String SERIALIZED_NAME_SCHEDULED_CANCEL_DATE = "scheduledCancelDate";
  @SerializedName(SERIALIZED_NAME_SCHEDULED_CANCEL_DATE)
  private LocalDate scheduledCancelDate;

  public static final String SERIALIZED_NAME_SCHEDULED_SUSPEND_DATE = "scheduledSuspendDate";
  @SerializedName(SERIALIZED_NAME_SCHEDULED_SUSPEND_DATE)
  private LocalDate scheduledSuspendDate;

  public static final String SERIALIZED_NAME_SCHEDULED_RESUME_DATE = "scheduledResumeDate";
  @SerializedName(SERIALIZED_NAME_SCHEDULED_RESUME_DATE)
  private LocalDate scheduledResumeDate;

  public static final String SERIALIZED_NAME_CLEARING_SCHEDULED_CANCEL_DATE = "clearingScheduledCancelDate";
  @SerializedName(SERIALIZED_NAME_CLEARING_SCHEDULED_CANCEL_DATE)
  private Boolean clearingScheduledCancelDate;

  public static final String SERIALIZED_NAME_CLEARING_SCHEDULED_SUSPEND_DATE = "clearingScheduledSuspendDate";
  @SerializedName(SERIALIZED_NAME_CLEARING_SCHEDULED_SUSPEND_DATE)
  private Boolean clearingScheduledSuspendDate;

  public static final String SERIALIZED_NAME_CLEARING_SCHEDULED_RESUME_DATE = "clearingScheduledResumeDate";
  @SerializedName(SERIALIZED_NAME_CLEARING_SCHEDULED_RESUME_DATE)
  private Boolean clearingScheduledResumeDate;

  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_SHIP_TO_CONTACT_ID = "shipToContactId";
  @SerializedName(SERIALIZED_NAME_SHIP_TO_CONTACT_ID)
  private String shipToContactId;

  public static final String SERIALIZED_NAME_CLEARING_EXISTING_SHIP_TO_CONTACT = "clearingExistingShipToContact";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_SHIP_TO_CONTACT)
  private Boolean clearingExistingShipToContact;

  public CreateOrderTermsAndConditions() {
  }

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

  /**
   * The ID of the bill-to contact associated with the subscription.  **Note**:    - If you have the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_customers_at_subscription_level/Flexible_Billing_Attributes\" target=\"_blank\">Flexible Billing Attributes</a> feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body.    - If you have the Flexible Billing Attributes feature enabled, and you do not specify this field in the request or you select **Default Contact from Account** for this field during subscription creation, the value of this field is automatically set to `null` in the response body. 
   * @return billToContactId
   */
  @javax.annotation.Nullable
  public String getBillToContactId() {
    return billToContactId;
  }

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


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

  /**
   * Whether to clear the existing bill-to contact ID at the subscription level. This field is mutually exclusive with the `billToContactId` field.  **Note**: If you have the [Flexible Billing Attributes](https://knowledgecenter.zuora.com/Billing/Subscriptions/Flexible_Billing_Attributes) feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body. 
   * @return clearingExistingBillToContact
   */
  @javax.annotation.Nullable
  public Boolean getClearingExistingBillToContact() {
    return clearingExistingBillToContact;
  }

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


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

  /**
   * Whether to clear the existing invoice template ID at the subscription level. This field is mutually exclusive with the `invoiceTemplateId` field.  **Note**: If you have the [Flexible Billing Attributes](https://knowledgecenter.zuora.com/Billing/Subscriptions/Flexible_Billing_Attributes) feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body. 
   * @return clearingExistingInvoiceTemplate
   */
  @javax.annotation.Nullable
  public Boolean getClearingExistingInvoiceTemplate() {
    return clearingExistingInvoiceTemplate;
  }

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


  public CreateOrderTermsAndConditions clearingExistingPaymentTerm(Boolean clearingExistingPaymentTerm) {
    this.clearingExistingPaymentTerm = clearingExistingPaymentTerm;
    return this;
  }

  /**
   * Whether to clear the existing payment term at the subscription level. This field is mutually exclusive with the `paymentTerm` field.  **Note**: If you have the [Flexible Billing Attributes](https://knowledgecenter.zuora.com/Billing/Subscriptions/Flexible_Billing_Attributes) feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body. 
   * @return clearingExistingPaymentTerm
   */
  @javax.annotation.Nullable
  public Boolean getClearingExistingPaymentTerm() {
    return clearingExistingPaymentTerm;
  }

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


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

  /**
   * Whether to clear the existing sequence set ID at the subscription level. This field is mutually exclusive with the `sequenceSetId` field.  **Note**: If you have the [Flexible Billing Attributes](https://knowledgecenter.zuora.com/Billing/Subscriptions/Flexible_Billing_Attributes) feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body. 
   * @return clearingExistingSequenceSet
   */
  @javax.annotation.Nullable
  public Boolean getClearingExistingSequenceSet() {
    return clearingExistingSequenceSet;
  }

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


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

  /**
   * Whether to clear the existing sold-to contact ID at the subscription level. This field is mutually exclusive with the `soldToContactId` field.  **Note**: If you have the [Flexible Billing Attributes](https://knowledgecenter.zuora.com/Billing/Subscriptions/Flexible_Billing_Attributes) feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body. 
   * @return clearingExistingSoldToContact
   */
  @javax.annotation.Nullable
  public Boolean getClearingExistingSoldToContact() {
    return clearingExistingSoldToContact;
  }

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


  public CreateOrderTermsAndConditions invoiceSeparately(Boolean invoiceSeparately) {
    this.invoiceSeparately = invoiceSeparately;
    return this;
  }

  /**
   * Specifies whether the subscription appears on a separate invoice when generates invoices.
   * @return invoiceSeparately
   */
  @javax.annotation.Nullable
  public Boolean getInvoiceSeparately() {
    return invoiceSeparately;
  }

  public void setInvoiceSeparately(Boolean invoiceSeparately) {
    this.invoiceSeparately = invoiceSeparately;
  }


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

  /**
   * The ID of the invoice template associated with the subscription.  **Note**:    - If you have the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_customers_at_subscription_level/Flexible_Billing_Attributes\" target=\"_blank\">Flexible Billing Attributes</a> feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body.    - If you have the Flexible Billing Attributes feature enabled, and you do not specify this field in the request or you select **Default Template from Account** for this field during subscription creation, the value of this field is automatically set to `null` in the response body. 
   * @return invoiceTemplateId
   */
  @javax.annotation.Nullable
  public String getInvoiceTemplateId() {
    return invoiceTemplateId;
  }

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


  public CreateOrderTermsAndConditions lastTerm(LastTerm lastTerm) {
    this.lastTerm = lastTerm;
    return this;
  }

  /**
   * Get lastTerm
   * @return lastTerm
   */
  @javax.annotation.Nullable
  public LastTerm getLastTerm() {
    return lastTerm;
  }

  public void setLastTerm(LastTerm lastTerm) {
    this.lastTerm = lastTerm;
  }


  public CreateOrderTermsAndConditions termIncreaseToNewContractLine(Boolean termIncreaseToNewContractLine) {
    this.termIncreaseToNewContractLine = termIncreaseToNewContractLine;
    return this;
  }

  /**
   * Reflect the term increase to a new contract line when term increased or converts from Term to Evergreen
   * @return termIncreaseToNewContractLine
   */
  @javax.annotation.Nullable
  public Boolean getTermIncreaseToNewContractLine() {
    return termIncreaseToNewContractLine;
  }

  public void setTermIncreaseToNewContractLine(Boolean termIncreaseToNewContractLine) {
    this.termIncreaseToNewContractLine = termIncreaseToNewContractLine;
  }


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

  /**
   * The name of the payment term associated with the subscription. For example, `Net 30`. The payment term determines the due dates of invoices.  **Note**:    - If you have the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_customers_at_subscription_level/Flexible_Billing_Attributes\" target=\"_blank\">Flexible Billing Attributes</a> feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body.    - If you have the Flexible Billing Attributes feature enabled, and you do not specify this field in the request or you select **Default Term from Account** for this field during subscription creation, the value of this field is automatically set to `null` in the response body. 
   * @return paymentTerm
   */
  @javax.annotation.Nullable
  public String getPaymentTerm() {
    return paymentTerm;
  }

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


  public CreateOrderTermsAndConditions renewalSetting(RenewalSetting renewalSetting) {
    this.renewalSetting = renewalSetting;
    return this;
  }

  /**
   * Get renewalSetting
   * @return renewalSetting
   */
  @javax.annotation.Nullable
  public RenewalSetting getRenewalSetting() {
    return renewalSetting;
  }

  public void setRenewalSetting(RenewalSetting renewalSetting) {
    this.renewalSetting = renewalSetting;
  }


  public CreateOrderTermsAndConditions renewalTerms(List renewalTerms) {
    this.renewalTerms = renewalTerms;
    return this;
  }

  public CreateOrderTermsAndConditions addRenewalTermsItem(RenewalTerm renewalTermsItem) {
    if (this.renewalTerms == null) {
      this.renewalTerms = new ArrayList<>();
    }
    this.renewalTerms.add(renewalTermsItem);
    return this;
  }

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

  public void setRenewalTerms(List renewalTerms) {
    this.renewalTerms = renewalTerms;
  }


  public CreateOrderTermsAndConditions scheduledCancelDate(LocalDate scheduledCancelDate) {
    this.scheduledCancelDate = scheduledCancelDate;
    return this;
  }

  /**
   * The date when the subscription is scheduled to be canceled. The subscription is not canceled until the date specified in this field. 
   * @return scheduledCancelDate
   */
  @javax.annotation.Nullable
  public LocalDate getScheduledCancelDate() {
    return scheduledCancelDate;
  }

  public void setScheduledCancelDate(LocalDate scheduledCancelDate) {
    this.scheduledCancelDate = scheduledCancelDate;
  }


  public CreateOrderTermsAndConditions scheduledSuspendDate(LocalDate scheduledSuspendDate) {
    this.scheduledSuspendDate = scheduledSuspendDate;
    return this;
  }

  /**
   * The date when the subscription is scheduled to be suspended. The subscription is not suspended until the date specified in this field. 
   * @return scheduledSuspendDate
   */
  @javax.annotation.Nullable
  public LocalDate getScheduledSuspendDate() {
    return scheduledSuspendDate;
  }

  public void setScheduledSuspendDate(LocalDate scheduledSuspendDate) {
    this.scheduledSuspendDate = scheduledSuspendDate;
  }


  public CreateOrderTermsAndConditions scheduledResumeDate(LocalDate scheduledResumeDate) {
    this.scheduledResumeDate = scheduledResumeDate;
    return this;
  }

  /**
   * The date when the subscription is scheduled to be resumed. The subscription is not resumed until the date specified in this field. 
   * @return scheduledResumeDate
   */
  @javax.annotation.Nullable
  public LocalDate getScheduledResumeDate() {
    return scheduledResumeDate;
  }

  public void setScheduledResumeDate(LocalDate scheduledResumeDate) {
    this.scheduledResumeDate = scheduledResumeDate;
  }


  public CreateOrderTermsAndConditions clearingScheduledCancelDate(Boolean clearingScheduledCancelDate) {
    this.clearingScheduledCancelDate = clearingScheduledCancelDate;
    return this;
  }

  /**
   * Whether to clear the scheduled cancel date at the subscription level. This field is mutually exclusive with the scheduledCancelDate field. 
   * @return clearingScheduledCancelDate
   */
  @javax.annotation.Nullable
  public Boolean getClearingScheduledCancelDate() {
    return clearingScheduledCancelDate;
  }

  public void setClearingScheduledCancelDate(Boolean clearingScheduledCancelDate) {
    this.clearingScheduledCancelDate = clearingScheduledCancelDate;
  }


  public CreateOrderTermsAndConditions clearingScheduledSuspendDate(Boolean clearingScheduledSuspendDate) {
    this.clearingScheduledSuspendDate = clearingScheduledSuspendDate;
    return this;
  }

  /**
   * Whether to clear the scheduled suspend date at the subscription level. This field is mutually exclusive with the scheduledSuspendDate field. 
   * @return clearingScheduledSuspendDate
   */
  @javax.annotation.Nullable
  public Boolean getClearingScheduledSuspendDate() {
    return clearingScheduledSuspendDate;
  }

  public void setClearingScheduledSuspendDate(Boolean clearingScheduledSuspendDate) {
    this.clearingScheduledSuspendDate = clearingScheduledSuspendDate;
  }


  public CreateOrderTermsAndConditions clearingScheduledResumeDate(Boolean clearingScheduledResumeDate) {
    this.clearingScheduledResumeDate = clearingScheduledResumeDate;
    return this;
  }

  /**
   * Whether to clear the scheduled resume date at the subscription level. This field is mutually exclusive with the scheduledResumeDate field. 
   * @return clearingScheduledResumeDate
   */
  @javax.annotation.Nullable
  public Boolean getClearingScheduledResumeDate() {
    return clearingScheduledResumeDate;
  }

  public void setClearingScheduledResumeDate(Boolean clearingScheduledResumeDate) {
    this.clearingScheduledResumeDate = clearingScheduledResumeDate;
  }


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

  /**
   * The ID of the sequence set associated with the subscription.  **Note**:    - If you have the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_customers_at_subscription_level/Flexible_Billing_Attributes\" target=\"_blank\">Flexible Billing Attributes</a> feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body.    - If you have the Flexible Billing Attributes feature enabled, and you do not specify this field in the request or you select **Default Set from Account** for this field during subscription creation, the value of this field is automatically set to `null` in the response body. 
   * @return sequenceSetId
   */
  @javax.annotation.Nullable
  public String getSequenceSetId() {
    return sequenceSetId;
  }

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


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

  /**
   * The ID of the sold-to contact associated with the subscription.  **Note**:    - If you have the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_customers_at_subscription_level/Flexible_Billing_Attributes\" target=\"_blank\">Flexible Billing Attributes</a> feature disabled, this field is unavailable in the request body and the value of this field is `null` in the response body.    - If you have the Flexible Billing Attributes feature enabled, and you do not specify this field in the request or you select **Default Contact from Account** for this field during subscription creation, the value of this field is automatically set to `null` in the response body. 
   * @return soldToContactId
   */
  @javax.annotation.Nullable
  public String getSoldToContactId() {
    return soldToContactId;
  }

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


  public CreateOrderTermsAndConditions shipToContactId(String shipToContactId) {
    this.shipToContactId = shipToContactId;
    return this;
  }

  /**
   * The ID of the ship-to contact associated with the subscription. 
   * @return shipToContactId
   */
  @javax.annotation.Nullable
  public String getShipToContactId() {
    return shipToContactId;
  }

  public void setShipToContactId(String shipToContactId) {
    this.shipToContactId = shipToContactId;
  }


  public CreateOrderTermsAndConditions clearingExistingShipToContact(Boolean clearingExistingShipToContact) {
    this.clearingExistingShipToContact = clearingExistingShipToContact;
    return this;
  }

  /**
   * Whether to clear the existing ship-to contact ID at the subscription level. This field is mutually exclusive with the `shipToContactId` field. 
   * @return clearingExistingShipToContact
   */
  @javax.annotation.Nullable
  public Boolean getClearingExistingShipToContact() {
    return clearingExistingShipToContact;
  }

  public void setClearingExistingShipToContact(Boolean clearingExistingShipToContact) {
    this.clearingExistingShipToContact = clearingExistingShipToContact;
  }

  /**
   * 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 CreateOrderTermsAndConditions instance itself
   */
  public CreateOrderTermsAndConditions 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;
    }
    CreateOrderTermsAndConditions createOrderTermsAndConditions = (CreateOrderTermsAndConditions) o;
    return Objects.equals(this.autoRenew, createOrderTermsAndConditions.autoRenew) &&
        Objects.equals(this.billToContactId, createOrderTermsAndConditions.billToContactId) &&
        Objects.equals(this.clearingExistingBillToContact, createOrderTermsAndConditions.clearingExistingBillToContact) &&
        Objects.equals(this.clearingExistingInvoiceTemplate, createOrderTermsAndConditions.clearingExistingInvoiceTemplate) &&
        Objects.equals(this.clearingExistingPaymentTerm, createOrderTermsAndConditions.clearingExistingPaymentTerm) &&
        Objects.equals(this.clearingExistingSequenceSet, createOrderTermsAndConditions.clearingExistingSequenceSet) &&
        Objects.equals(this.clearingExistingSoldToContact, createOrderTermsAndConditions.clearingExistingSoldToContact) &&
        Objects.equals(this.invoiceSeparately, createOrderTermsAndConditions.invoiceSeparately) &&
        Objects.equals(this.invoiceTemplateId, createOrderTermsAndConditions.invoiceTemplateId) &&
        Objects.equals(this.lastTerm, createOrderTermsAndConditions.lastTerm) &&
        Objects.equals(this.termIncreaseToNewContractLine, createOrderTermsAndConditions.termIncreaseToNewContractLine) &&
        Objects.equals(this.paymentTerm, createOrderTermsAndConditions.paymentTerm) &&
        Objects.equals(this.renewalSetting, createOrderTermsAndConditions.renewalSetting) &&
        Objects.equals(this.renewalTerms, createOrderTermsAndConditions.renewalTerms) &&
        Objects.equals(this.scheduledCancelDate, createOrderTermsAndConditions.scheduledCancelDate) &&
        Objects.equals(this.scheduledSuspendDate, createOrderTermsAndConditions.scheduledSuspendDate) &&
        Objects.equals(this.scheduledResumeDate, createOrderTermsAndConditions.scheduledResumeDate) &&
        Objects.equals(this.clearingScheduledCancelDate, createOrderTermsAndConditions.clearingScheduledCancelDate) &&
        Objects.equals(this.clearingScheduledSuspendDate, createOrderTermsAndConditions.clearingScheduledSuspendDate) &&
        Objects.equals(this.clearingScheduledResumeDate, createOrderTermsAndConditions.clearingScheduledResumeDate) &&
        Objects.equals(this.sequenceSetId, createOrderTermsAndConditions.sequenceSetId) &&
        Objects.equals(this.soldToContactId, createOrderTermsAndConditions.soldToContactId) &&
        Objects.equals(this.shipToContactId, createOrderTermsAndConditions.shipToContactId) &&
        Objects.equals(this.clearingExistingShipToContact, createOrderTermsAndConditions.clearingExistingShipToContact)&&
        Objects.equals(this.additionalProperties, createOrderTermsAndConditions.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(autoRenew, billToContactId, clearingExistingBillToContact, clearingExistingInvoiceTemplate, clearingExistingPaymentTerm, clearingExistingSequenceSet, clearingExistingSoldToContact, invoiceSeparately, invoiceTemplateId, lastTerm, termIncreaseToNewContractLine, paymentTerm, renewalSetting, renewalTerms, scheduledCancelDate, scheduledSuspendDate, scheduledResumeDate, clearingScheduledCancelDate, clearingScheduledSuspendDate, clearingScheduledResumeDate, sequenceSetId, soldToContactId, shipToContactId, clearingExistingShipToContact, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateOrderTermsAndConditions {\n");
    sb.append("    autoRenew: ").append(toIndentedString(autoRenew)).append("\n");
    sb.append("    billToContactId: ").append(toIndentedString(billToContactId)).append("\n");
    sb.append("    clearingExistingBillToContact: ").append(toIndentedString(clearingExistingBillToContact)).append("\n");
    sb.append("    clearingExistingInvoiceTemplate: ").append(toIndentedString(clearingExistingInvoiceTemplate)).append("\n");
    sb.append("    clearingExistingPaymentTerm: ").append(toIndentedString(clearingExistingPaymentTerm)).append("\n");
    sb.append("    clearingExistingSequenceSet: ").append(toIndentedString(clearingExistingSequenceSet)).append("\n");
    sb.append("    clearingExistingSoldToContact: ").append(toIndentedString(clearingExistingSoldToContact)).append("\n");
    sb.append("    invoiceSeparately: ").append(toIndentedString(invoiceSeparately)).append("\n");
    sb.append("    invoiceTemplateId: ").append(toIndentedString(invoiceTemplateId)).append("\n");
    sb.append("    lastTerm: ").append(toIndentedString(lastTerm)).append("\n");
    sb.append("    termIncreaseToNewContractLine: ").append(toIndentedString(termIncreaseToNewContractLine)).append("\n");
    sb.append("    paymentTerm: ").append(toIndentedString(paymentTerm)).append("\n");
    sb.append("    renewalSetting: ").append(toIndentedString(renewalSetting)).append("\n");
    sb.append("    renewalTerms: ").append(toIndentedString(renewalTerms)).append("\n");
    sb.append("    scheduledCancelDate: ").append(toIndentedString(scheduledCancelDate)).append("\n");
    sb.append("    scheduledSuspendDate: ").append(toIndentedString(scheduledSuspendDate)).append("\n");
    sb.append("    scheduledResumeDate: ").append(toIndentedString(scheduledResumeDate)).append("\n");
    sb.append("    clearingScheduledCancelDate: ").append(toIndentedString(clearingScheduledCancelDate)).append("\n");
    sb.append("    clearingScheduledSuspendDate: ").append(toIndentedString(clearingScheduledSuspendDate)).append("\n");
    sb.append("    clearingScheduledResumeDate: ").append(toIndentedString(clearingScheduledResumeDate)).append("\n");
    sb.append("    sequenceSetId: ").append(toIndentedString(sequenceSetId)).append("\n");
    sb.append("    soldToContactId: ").append(toIndentedString(soldToContactId)).append("\n");
    sb.append("    shipToContactId: ").append(toIndentedString(shipToContactId)).append("\n");
    sb.append("    clearingExistingShipToContact: ").append(toIndentedString(clearingExistingShipToContact)).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("autoRenew");
    openapiFields.add("billToContactId");
    openapiFields.add("clearingExistingBillToContact");
    openapiFields.add("clearingExistingInvoiceTemplate");
    openapiFields.add("clearingExistingPaymentTerm");
    openapiFields.add("clearingExistingSequenceSet");
    openapiFields.add("clearingExistingSoldToContact");
    openapiFields.add("invoiceSeparately");
    openapiFields.add("invoiceTemplateId");
    openapiFields.add("lastTerm");
    openapiFields.add("termIncreaseToNewContractLine");
    openapiFields.add("paymentTerm");
    openapiFields.add("renewalSetting");
    openapiFields.add("renewalTerms");
    openapiFields.add("scheduledCancelDate");
    openapiFields.add("scheduledSuspendDate");
    openapiFields.add("scheduledResumeDate");
    openapiFields.add("clearingScheduledCancelDate");
    openapiFields.add("clearingScheduledSuspendDate");
    openapiFields.add("clearingScheduledResumeDate");
    openapiFields.add("sequenceSetId");
    openapiFields.add("soldToContactId");
    openapiFields.add("shipToContactId");
    openapiFields.add("clearingExistingShipToContact");

    // 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 CreateOrderTermsAndConditions
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!CreateOrderTermsAndConditions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in CreateOrderTermsAndConditions is not found in the empty JSON string", CreateOrderTermsAndConditions.openapiRequiredFields.toString()));
        }
      }
        JsonObject jsonObj = jsonElement.getAsJsonObject();
      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("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()));
      }
      // validate the optional field `lastTerm`
      if (jsonObj.get("lastTerm") != null && !jsonObj.get("lastTerm").isJsonNull()) {
        LastTerm.validateJsonElement(jsonObj.get("lastTerm"));
      }
      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("renewalSetting") != null && !jsonObj.get("renewalSetting").isJsonNull()) && !jsonObj.get("renewalSetting").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `renewalSetting` to be a primitive type in the JSON string but got `%s`", jsonObj.get("renewalSetting").toString()));
      }
      // validate the optional field `renewalSetting`
      if (jsonObj.get("renewalSetting") != null && !jsonObj.get("renewalSetting").isJsonNull()) {
        RenewalSetting.validateJsonElement(jsonObj.get("renewalSetting"));
      }
      if (jsonObj.get("renewalTerms") != null && !jsonObj.get("renewalTerms").isJsonNull()) {
        JsonArray jsonArrayrenewalTerms = jsonObj.getAsJsonArray("renewalTerms");
        if (jsonArrayrenewalTerms != null) {
          // ensure the json data is an array
          if (!jsonObj.get("renewalTerms").isJsonArray()) {
            throw new IllegalArgumentException(String.format("Expected the field `renewalTerms` to be an array in the JSON string but got `%s`", jsonObj.get("renewalTerms").toString()));
          }

          // validate the optional field `renewalTerms` (array)
          for (int i = 0; i < jsonArrayrenewalTerms.size(); i++) {
            RenewalTerm.validateJsonElement(jsonArrayrenewalTerms.get(i));
          };
        }
      }
      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("shipToContactId") != null && !jsonObj.get("shipToContactId").isJsonNull()) && !jsonObj.get("shipToContactId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `shipToContactId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipToContactId").toString()));
      }
  }

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

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

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





© 2015 - 2025 Weber Informatics LLC | Privacy Policy