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

org.openapitools.client.model.OrderPreviewCreateRequest Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/

package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.LineItemCreateRequest;
import org.openapitools.client.model.PostSubscriptionOrderRequest;
import org.openapitools.client.model.SubscriptionPreviewAccountRequest;
import org.threeten.bp.LocalDate;

import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
 * OrderPreviewCreateRequest
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class OrderPreviewCreateRequest {
  /**
   * Category of the order to indicate a product sale or return. Default value is `sale`.
   */
  @JsonAdapter(CategoryEnum.Adapter.class)
  public enum CategoryEnum {
    SALE("sale"),
    
    RETURN("return"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

    CategoryEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static CategoryEnum fromValue(String value) {
      for (CategoryEnum b : CategoryEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final CategoryEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public CategoryEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return CategoryEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_CATEGORY = "category";
  @SerializedName(SERIALIZED_NAME_CATEGORY)
  private CategoryEnum category;

  public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "custom_fields";
  @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS)
  @JsonAdapter(CustomFieldAdapter.class)
  private Map customFields = null;

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

  public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "account_number";
  @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER)
  private String accountNumber;

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

  public static final String SERIALIZED_NAME_ORDER_DATE = "order_date";
  @SerializedName(SERIALIZED_NAME_ORDER_DATE)
  private LocalDate orderDate;

  public static final String SERIALIZED_NAME_ORDER_NUMBER = "order_number";
  @SerializedName(SERIALIZED_NAME_ORDER_NUMBER)
  private String orderNumber;

  public static final String SERIALIZED_NAME_LINE_ITEMS = "line_items";
  @SerializedName(SERIALIZED_NAME_LINE_ITEMS)
  private List lineItems = null;

  public static final String SERIALIZED_NAME_SUBSCRIPTIONS = "subscriptions";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTIONS)
  private List subscriptions = null;

  public static final String SERIALIZED_NAME_ACCOUNT_DATA = "account_data";
  @SerializedName(SERIALIZED_NAME_ACCOUNT_DATA)
  private SubscriptionPreviewAccountRequest accountData;

  public static final String SERIALIZED_NAME_NUMBER_OF_PERIODS = "number_of_periods";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_PERIODS)
  private Integer numberOfPeriods;

  public static final String SERIALIZED_NAME_TERM_END = "term_end";
  @SerializedName(SERIALIZED_NAME_TERM_END)
  private Boolean termEnd;

  /**
   * Gets or Sets metrics
   */
  @JsonAdapter(MetricsEnum.Adapter.class)
  public enum MetricsEnum {
    BILLING_DOCUMENTS("billing_documents"),
    
    DELTA_METRICS("delta_metrics"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

    MetricsEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static MetricsEnum fromValue(String value) {
      for (MetricsEnum b : MetricsEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final MetricsEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public MetricsEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return MetricsEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_METRICS = "metrics";
  @SerializedName(SERIALIZED_NAME_METRICS)
  private List metrics = new ArrayList();

  public static final String SERIALIZED_NAME_END_DATE = "end_date";
  @SerializedName(SERIALIZED_NAME_END_DATE)
  private LocalDate endDate;

  public OrderPreviewCreateRequest() { 
  }

  public OrderPreviewCreateRequest category(CategoryEnum category) {
    
    this.category = category;
    return this;
  }

   /**
   * Category of the order to indicate a product sale or return. Default value is `sale`.
   * @return category
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Category of the order to indicate a product sale or return. Default value is `sale`.")

  public CategoryEnum getCategory() {
    return category;
  }


  public void setCategory(CategoryEnum category) {
    this.category = category;
  }


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

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

   /**
   * Set of user-defined fields associated with this object. Useful for storing additional information about the object in a structured format.
   * @return customFields
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Set of user-defined fields associated with this object. Useful for storing additional information about the object in a structured format.")

  public Map getCustomFields() {
    return customFields;
  }


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


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

   /**
   * An arbitrary string attached to the object. Often useful for displaying to users.
   * @return description
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "description of test account", value = "An arbitrary string attached to the object. Often useful for displaying to users.")

  public String getDescription() {
    return description;
  }


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


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

   /**
   * Human-readable identifier of the account. It can be user-supplied.
   * @return accountNumber
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "A-100001", value = "Human-readable identifier of the account. It can be user-supplied.")

  public String getAccountNumber() {
    return accountNumber;
  }


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


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

   /**
   * Identifier of the account.
   * @return accountId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2c92c0f86a8dd422016a9e7a70116b0d", value = "Identifier of the account.")

  public String getAccountId() {
    return accountId;
  }


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


  public OrderPreviewCreateRequest orderDate(LocalDate orderDate) {
    
    this.orderDate = orderDate;
    return this;
  }

   /**
   * The date when the order is signed. All the order actions under this order will use this order date as the contract effective date if the contract effective date field is skipped or its value is left as null.
   * @return orderDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Sat Jan 01 00:00:00 GMT 2022", value = "The date when the order is signed. All the order actions under this order will use this order date as the contract effective date if the contract effective date field is skipped or its value is left as null.")

  public LocalDate getOrderDate() {
    return orderDate;
  }


  public void setOrderDate(LocalDate orderDate) {
    this.orderDate = orderDate;
  }


  public OrderPreviewCreateRequest orderNumber(String orderNumber) {
    
    this.orderNumber = orderNumber;
    return this;
  }

   /**
   * The order number of the new order. If not provided, system will auto-generate a number for this order.     Note: Ensure that the order number does not contain a slash.
   * @return orderNumber
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The order number of the new order. If not provided, system will auto-generate a number for this order.     Note: Ensure that the order number does not contain a slash.")

  public String getOrderNumber() {
    return orderNumber;
  }


  public void setOrderNumber(String orderNumber) {
    this.orderNumber = orderNumber;
  }


  public OrderPreviewCreateRequest lineItems(List lineItems) {
    
    this.lineItems = lineItems;
    return this;
  }

  public OrderPreviewCreateRequest addLineItemsItem(LineItemCreateRequest lineItemsItem) {
    if (this.lineItems == null) {
      this.lineItems = new ArrayList();
    }
    this.lineItems.add(lineItemsItem);
    return this;
  }

   /**
   * Order line items are non-subscription-based items created by an order, representing transactional charges such as one-time fees, physical goods, or professional service charges that are not sold as subscription services.    By specifying this field, you can launch non-subscription and unified monetization business models in Zuora, in addition to subscription business models.
   * @return lineItems
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Order line items are non-subscription-based items created by an order, representing transactional charges such as one-time fees, physical goods, or professional service charges that are not sold as subscription services.    By specifying this field, you can launch non-subscription and unified monetization business models in Zuora, in addition to subscription business models.")

  public List getLineItems() {
    return lineItems;
  }


  public void setLineItems(List lineItems) {
    this.lineItems = lineItems;
  }


  public OrderPreviewCreateRequest subscriptions(List subscriptions) {
    
    this.subscriptions = subscriptions;
    return this;
  }

  public OrderPreviewCreateRequest addSubscriptionsItem(PostSubscriptionOrderRequest subscriptionsItem) {
    if (this.subscriptions == null) {
      this.subscriptions = new ArrayList();
    }
    this.subscriptions.add(subscriptionsItem);
    return this;
  }

   /**
   * Based on the intended order action, each item should include specific fields.     For example, to preview a new subscription for a new account, you must specify the `account_data` and `subscription_plans` fields at a minimum.
   * @return subscriptions
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Based on the intended order action, each item should include specific fields.     For example, to preview a new subscription for a new account, you must specify the `account_data` and `subscription_plans` fields at a minimum.")

  public List getSubscriptions() {
    return subscriptions;
  }


  public void setSubscriptions(List subscriptions) {
    this.subscriptions = subscriptions;
  }


  public OrderPreviewCreateRequest accountData(SubscriptionPreviewAccountRequest accountData) {
    
    this.accountData = accountData;
    return this;
  }

   /**
   * Get accountData
   * @return accountData
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public SubscriptionPreviewAccountRequest getAccountData() {
    return accountData;
  }


  public void setAccountData(SubscriptionPreviewAccountRequest accountData) {
    this.accountData = accountData;
  }


  public OrderPreviewCreateRequest numberOfPeriods(Integer numberOfPeriods) {
    
    this.numberOfPeriods = numberOfPeriods;
    return this;
  }

   /**
   * Specifies how many billing periods you want to preview.
   * @return numberOfPeriods
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Specifies how many billing periods you want to preview.")

  public Integer getNumberOfPeriods() {
    return numberOfPeriods;
  }


  public void setNumberOfPeriods(Integer numberOfPeriods) {
    this.numberOfPeriods = numberOfPeriods;
  }


  public OrderPreviewCreateRequest termEnd(Boolean termEnd) {
    
    this.termEnd = termEnd;
    return this;
  }

   /**
   * Indicates whether to preview the subscription till the end of the current term.
   * @return termEnd
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Indicates whether to preview the subscription till the end of the current term.")

  public Boolean getTermEnd() {
    return termEnd;
  }


  public void setTermEnd(Boolean termEnd) {
    this.termEnd = termEnd;
  }


  public OrderPreviewCreateRequest metrics(List metrics) {
    
    this.metrics = metrics;
    return this;
  }

  public OrderPreviewCreateRequest addMetricsItem(MetricsEnum metricsItem) {
    this.metrics.add(metricsItem);
    return this;
  }

   /**
   * Specifies the metrics you want to preview.    You can preview metrics of billing documents, the order delta metrics, or both.
   * @return metrics
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "Specifies the metrics you want to preview.    You can preview metrics of billing documents, the order delta metrics, or both.")

  public List getMetrics() {
    return metrics;
  }


  public void setMetrics(List metrics) {
    this.metrics = metrics;
  }


  public OrderPreviewCreateRequest endDate(LocalDate endDate) {
    
    this.endDate = endDate;
    return this;
  }

   /**
   * End date of the period for which you want to preview the subscription
   * @return endDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "End date of the period for which you want to preview the subscription")

  public LocalDate getEndDate() {
    return endDate;
  }


  public void setEndDate(LocalDate endDate) {
    this.endDate = endDate;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    OrderPreviewCreateRequest orderPreviewCreateRequest = (OrderPreviewCreateRequest) o;
    return Objects.equals(this.category, orderPreviewCreateRequest.category) &&
        Objects.equals(this.customFields, orderPreviewCreateRequest.customFields) &&
        Objects.equals(this.description, orderPreviewCreateRequest.description) &&
        Objects.equals(this.accountNumber, orderPreviewCreateRequest.accountNumber) &&
        Objects.equals(this.accountId, orderPreviewCreateRequest.accountId) &&
        Objects.equals(this.orderDate, orderPreviewCreateRequest.orderDate) &&
        Objects.equals(this.orderNumber, orderPreviewCreateRequest.orderNumber) &&
        Objects.equals(this.lineItems, orderPreviewCreateRequest.lineItems) &&
        Objects.equals(this.subscriptions, orderPreviewCreateRequest.subscriptions) &&
        Objects.equals(this.accountData, orderPreviewCreateRequest.accountData) &&
        Objects.equals(this.numberOfPeriods, orderPreviewCreateRequest.numberOfPeriods) &&
        Objects.equals(this.termEnd, orderPreviewCreateRequest.termEnd) &&
        Objects.equals(this.metrics, orderPreviewCreateRequest.metrics) &&
        Objects.equals(this.endDate, orderPreviewCreateRequest.endDate);
  }

  @Override
  public int hashCode() {
    return Objects.hash(category, customFields, description, accountNumber, accountId, orderDate, orderNumber, lineItems, subscriptions, accountData, numberOfPeriods, termEnd, metrics, endDate);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class OrderPreviewCreateRequest {\n");
    sb.append("    category: ").append(toIndentedString(category)).append("\n");
    sb.append("    customFields: ").append(toIndentedString(customFields)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    accountNumber: ").append(toIndentedString(accountNumber)).append("\n");
    sb.append("    accountId: ").append(toIndentedString(accountId)).append("\n");
    sb.append("    orderDate: ").append(toIndentedString(orderDate)).append("\n");
    sb.append("    orderNumber: ").append(toIndentedString(orderNumber)).append("\n");
    sb.append("    lineItems: ").append(toIndentedString(lineItems)).append("\n");
    sb.append("    subscriptions: ").append(toIndentedString(subscriptions)).append("\n");
    sb.append("    accountData: ").append(toIndentedString(accountData)).append("\n");
    sb.append("    numberOfPeriods: ").append(toIndentedString(numberOfPeriods)).append("\n");
    sb.append("    termEnd: ").append(toIndentedString(termEnd)).append("\n");
    sb.append("    metrics: ").append(toIndentedString(metrics)).append("\n");
    sb.append("    endDate: ").append(toIndentedString(endDate)).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    ");
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy