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

com.zuora.model.OrderActionTermsAndConditions 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.InitialTerm;
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 OrderActionTermsAndConditions {
  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_GROUP_NUMBER = "clearingExistingInvoiceGroupNumber";
  @SerializedName(SERIALIZED_NAME_CLEARING_EXISTING_INVOICE_GROUP_NUMBER)
  private Boolean clearingExistingInvoiceGroupNumber = 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_INITIAL_TERM = "initialTerm";
  @SerializedName(SERIALIZED_NAME_INITIAL_TERM)
  private InitialTerm initialTerm;

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

  public static final String SERIALIZED_NAME_INVOICE_GROUP_NUMBER = "invoiceGroupNumber";
  @SerializedName(SERIALIZED_NAME_INVOICE_GROUP_NUMBER)
  private String invoiceGroupNumber;

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

  public static final String SERIALIZED_NAME_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 OrderActionTermsAndConditions() {
  }

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

  /**
   * Whether to clear the existing invoice group number at the subscription level. This field is mutually exclusive with the `invoiceGroupNumber` 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 clearingExistingInvoiceGroupNumber
   */
  @javax.annotation.Nullable
  public Boolean getClearingExistingInvoiceGroupNumber() {
    return clearingExistingInvoiceGroupNumber;
  }

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


  public OrderActionTermsAndConditions 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 OrderActionTermsAndConditions 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 OrderActionTermsAndConditions 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 OrderActionTermsAndConditions 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 OrderActionTermsAndConditions initialTerm(InitialTerm initialTerm) {
    this.initialTerm = initialTerm;
    return this;
  }

  /**
   * Get initialTerm
   * @return initialTerm
   */
  @javax.annotation.Nullable
  public InitialTerm getInitialTerm() {
    return initialTerm;
  }

  public void setInitialTerm(InitialTerm initialTerm) {
    this.initialTerm = initialTerm;
  }


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

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

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


  public OrderActionTermsAndConditions invoiceGroupNumber(String invoiceGroupNumber) {
    this.invoiceGroupNumber = invoiceGroupNumber;
    return this;
  }

  /**
   * The number of invoice group associated with the subscription.  **Note**: This field is available only 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 enabled. 
   * @return invoiceGroupNumber
   */
  @javax.annotation.Nullable
  public String getInvoiceGroupNumber() {
    return invoiceGroupNumber;
  }

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


  public OrderActionTermsAndConditions 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 OrderActionTermsAndConditions 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 OrderActionTermsAndConditions 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 OrderActionTermsAndConditions renewalTerms(List renewalTerms) {
    this.renewalTerms = renewalTerms;
    return this;
  }

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

  @Override
  public int hashCode() {
    return Objects.hash(autoRenew, billToContactId, clearingExistingBillToContact, clearingExistingInvoiceGroupNumber, clearingExistingInvoiceTemplate, clearingExistingPaymentTerm, clearingExistingSequenceSet, clearingExistingSoldToContact, initialTerm, invoiceSeparately, invoiceGroupNumber, invoiceTemplateId, 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 OrderActionTermsAndConditions {\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("    clearingExistingInvoiceGroupNumber: ").append(toIndentedString(clearingExistingInvoiceGroupNumber)).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("    initialTerm: ").append(toIndentedString(initialTerm)).append("\n");
    sb.append("    invoiceSeparately: ").append(toIndentedString(invoiceSeparately)).append("\n");
    sb.append("    invoiceGroupNumber: ").append(toIndentedString(invoiceGroupNumber)).append("\n");
    sb.append("    invoiceTemplateId: ").append(toIndentedString(invoiceTemplateId)).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("clearingExistingInvoiceGroupNumber");
    openapiFields.add("clearingExistingInvoiceTemplate");
    openapiFields.add("clearingExistingPaymentTerm");
    openapiFields.add("clearingExistingSequenceSet");
    openapiFields.add("clearingExistingSoldToContact");
    openapiFields.add("initialTerm");
    openapiFields.add("invoiceSeparately");
    openapiFields.add("invoiceGroupNumber");
    openapiFields.add("invoiceTemplateId");
    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 OrderActionTermsAndConditions
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!OrderActionTermsAndConditions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in OrderActionTermsAndConditions is not found in the empty JSON string", OrderActionTermsAndConditions.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()));
      }
      // validate the optional field `initialTerm`
      if (jsonObj.get("initialTerm") != null && !jsonObj.get("initialTerm").isJsonNull()) {
        InitialTerm.validateJsonElement(jsonObj.get("initialTerm"));
      }
      if ((jsonObj.get("invoiceGroupNumber") != null && !jsonObj.get("invoiceGroupNumber").isJsonNull()) && !jsonObj.get("invoiceGroupNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `invoiceGroupNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceGroupNumber").toString()));
      }
      if ((jsonObj.get("invoiceTemplateId") != null && !jsonObj.get("invoiceTemplateId").isJsonNull()) && !jsonObj.get("invoiceTemplateId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `invoiceTemplateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceTemplateId").toString()));
      }
      if ((jsonObj.get("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 (!OrderActionTermsAndConditions.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'OrderActionTermsAndConditions' and its subtypes
       }
       final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(OrderActionTermsAndConditions.class));

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

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





© 2015 - 2025 Weber Informatics LLC | Privacy Policy