org.openapitools.client.model.SubscriptionItemPatchRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zuora-sdk-java Show documentation
Show all versions of zuora-sdk-java Show documentation
The SDK of JAVA language for Zuora pricing system
/*
* 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.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.ItemTier;
import org.openapitools.client.model.Overage;
import org.openapitools.client.model.Recurring;
import org.openapitools.client.model.SubscriptionItemPrepaymentField;
import org.threeten.bp.LocalDate;
import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
* SubscriptionItemPatchRequest
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class SubscriptionItemPatchRequest {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_RECURRING = "recurring";
@SerializedName(SERIALIZED_NAME_RECURRING)
private Recurring recurring;
public static final String SERIALIZED_NAME_SUBSCRIPTION_ITEM_NUMBER = "subscription_item_number";
@SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ITEM_NUMBER)
private String subscriptionItemNumber;
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_START_DATE = "start_date";
@SerializedName(SERIALIZED_NAME_START_DATE)
private LocalDate startDate;
public static final String SERIALIZED_NAME_END_DATE = "end_date";
@SerializedName(SERIALIZED_NAME_END_DATE)
private LocalDate endDate;
/**
* Gets or Sets applyDiscountTo
*/
@JsonAdapter(ApplyDiscountToEnum.Adapter.class)
public enum ApplyDiscountToEnum {
ONE_TIME("one_time"),
RECURRING("recurring"),
USAGE("usage"),
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");
private String value;
ApplyDiscountToEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ApplyDiscountToEnum fromValue(String value) {
for (ApplyDiscountToEnum b : ApplyDiscountToEnum.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 ApplyDiscountToEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ApplyDiscountToEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ApplyDiscountToEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_APPLY_DISCOUNT_TO = "apply_discount_to";
@SerializedName(SERIALIZED_NAME_APPLY_DISCOUNT_TO)
private List applyDiscountTo = null;
/**
* Specifies at what level a discount should be applied.
*/
@JsonAdapter(DiscountLevelEnum.Adapter.class)
public enum DiscountLevelEnum {
ACCOUNT("account"),
SUBSCRIPTION("subscription"),
PLAN("plan"),
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");
private String value;
DiscountLevelEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static DiscountLevelEnum fromValue(String value) {
for (DiscountLevelEnum b : DiscountLevelEnum.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 DiscountLevelEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public DiscountLevelEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return DiscountLevelEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_DISCOUNT_LEVEL = "discount_level";
@SerializedName(SERIALIZED_NAME_DISCOUNT_LEVEL)
private DiscountLevelEnum discountLevel;
/**
* Specifies when to start billing your customer.
*/
@JsonAdapter(StartEventEnum.Adapter.class)
public enum StartEventEnum {
CONTRACT_EFFECTIVE("contract_effective"),
SERVICE_ACTIVATION("service_activation"),
CUSTOMER_ACCEPTANCE("customer_acceptance"),
SPECIFIC_DATE("specific_date"),
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");
private String value;
StartEventEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StartEventEnum fromValue(String value) {
for (StartEventEnum b : StartEventEnum.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 StartEventEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StartEventEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StartEventEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_START_EVENT = "start_event";
@SerializedName(SERIALIZED_NAME_START_EVENT)
private StartEventEnum startEvent;
public static final String SERIALIZED_NAME_DISCOUNT_PERCENT = "discount_percent";
@SerializedName(SERIALIZED_NAME_DISCOUNT_PERCENT)
private BigDecimal discountPercent;
public static final String SERIALIZED_NAME_QUANTITY = "quantity";
@SerializedName(SERIALIZED_NAME_QUANTITY)
private BigDecimal quantity;
public static final String SERIALIZED_NAME_AMOUNT = "amount";
@SerializedName(SERIALIZED_NAME_AMOUNT)
private BigDecimal amount;
public static final String SERIALIZED_NAME_UNIT_AMOUNT = "unit_amount";
@SerializedName(SERIALIZED_NAME_UNIT_AMOUNT)
private BigDecimal unitAmount;
public static final String SERIALIZED_NAME_TIERS = "tiers";
@SerializedName(SERIALIZED_NAME_TIERS)
private List tiers = null;
public static final String SERIALIZED_NAME_OVERAGE = "overage";
@SerializedName(SERIALIZED_NAME_OVERAGE)
private Overage overage;
public static final String SERIALIZED_NAME_UNIQUE_TOKEN = "unique_token";
@SerializedName(SERIALIZED_NAME_UNIQUE_TOKEN)
private String uniqueToken;
public static final String SERIALIZED_NAME_PREPAYMENT = "prepayment";
@SerializedName(SERIALIZED_NAME_PREPAYMENT)
private SubscriptionItemPrepaymentField prepayment;
public static final String SERIALIZED_NAME_CUSTOM_FIELD_PER_UNIT_RATE = "custom_field_per_unit_rate";
@SerializedName(SERIALIZED_NAME_CUSTOM_FIELD_PER_UNIT_RATE)
private String customFieldPerUnitRate;
public static final String SERIALIZED_NAME_CUSTOM_FIELD_TOTAL_AMOUNT = "custom_field_total_amount";
@SerializedName(SERIALIZED_NAME_CUSTOM_FIELD_TOTAL_AMOUNT)
private String customFieldTotalAmount;
public SubscriptionItemPatchRequest() {
}
public SubscriptionItemPatchRequest id(String id) {
this.id = id;
return this;
}
/**
* Identifier of the subscription item.
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Identifier of the subscription item.")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public SubscriptionItemPatchRequest recurring(Recurring recurring) {
this.recurring = recurring;
return this;
}
/**
* Get recurring
* @return recurring
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Recurring getRecurring() {
return recurring;
}
public void setRecurring(Recurring recurring) {
this.recurring = recurring;
}
public SubscriptionItemPatchRequest subscriptionItemNumber(String subscriptionItemNumber) {
this.subscriptionItemNumber = subscriptionItemNumber;
return this;
}
/**
* Human-readable identifier of the subscription. It can be user-supplied.
* @return subscriptionItemNumber
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Human-readable identifier of the subscription. It can be user-supplied.")
public String getSubscriptionItemNumber() {
return subscriptionItemNumber;
}
public void setSubscriptionItemNumber(String subscriptionItemNumber) {
this.subscriptionItemNumber = subscriptionItemNumber;
}
public SubscriptionItemPatchRequest customFields(Map customFields) {
this.customFields = customFields;
return this;
}
public SubscriptionItemPatchRequest 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 SubscriptionItemPatchRequest 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(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 SubscriptionItemPatchRequest startDate(LocalDate startDate) {
this.startDate = startDate;
return this;
}
/**
* The date when the subscription item starts
* @return startDate
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The date when the subscription item starts")
public LocalDate getStartDate() {
return startDate;
}
public void setStartDate(LocalDate startDate) {
this.startDate = startDate;
}
public SubscriptionItemPatchRequest endDate(LocalDate endDate) {
this.endDate = endDate;
return this;
}
/**
* The date when the subscription item ends or ended.
* @return endDate
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The date when the subscription item ends or ended.")
public LocalDate getEndDate() {
return endDate;
}
public void setEndDate(LocalDate endDate) {
this.endDate = endDate;
}
public SubscriptionItemPatchRequest applyDiscountTo(List applyDiscountTo) {
this.applyDiscountTo = applyDiscountTo;
return this;
}
public SubscriptionItemPatchRequest addApplyDiscountToItem(ApplyDiscountToEnum applyDiscountToItem) {
if (this.applyDiscountTo == null) {
this.applyDiscountTo = new ArrayList();
}
this.applyDiscountTo.add(applyDiscountToItem);
return this;
}
/**
* Any combination of one-time, recurring, or usage prices.
* @return applyDiscountTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Any combination of one-time, recurring, or usage prices.")
public List getApplyDiscountTo() {
return applyDiscountTo;
}
public void setApplyDiscountTo(List applyDiscountTo) {
this.applyDiscountTo = applyDiscountTo;
}
public SubscriptionItemPatchRequest discountLevel(DiscountLevelEnum discountLevel) {
this.discountLevel = discountLevel;
return this;
}
/**
* Specifies at what level a discount should be applied.
* @return discountLevel
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Specifies at what level a discount should be applied.")
public DiscountLevelEnum getDiscountLevel() {
return discountLevel;
}
public void setDiscountLevel(DiscountLevelEnum discountLevel) {
this.discountLevel = discountLevel;
}
public SubscriptionItemPatchRequest startEvent(StartEventEnum startEvent) {
this.startEvent = startEvent;
return this;
}
/**
* Specifies when to start billing your customer.
* @return startEvent
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Specifies when to start billing your customer.")
public StartEventEnum getStartEvent() {
return startEvent;
}
public void setStartEvent(StartEventEnum startEvent) {
this.startEvent = startEvent;
}
public SubscriptionItemPatchRequest discountPercent(BigDecimal discountPercent) {
this.discountPercent = discountPercent;
return this;
}
/**
* Discount percent. Specify this field if you want to override with a discount-based discount price.
* @return discountPercent
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Discount percent. Specify this field if you want to override with a discount-based discount price.")
public BigDecimal getDiscountPercent() {
return discountPercent;
}
public void setDiscountPercent(BigDecimal discountPercent) {
this.discountPercent = discountPercent;
}
public SubscriptionItemPatchRequest quantity(BigDecimal quantity) {
this.quantity = quantity;
return this;
}
/**
* Quantity of the product to which your customers subscribe.
* @return quantity
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Quantity of the product to which your customers subscribe.")
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public SubscriptionItemPatchRequest amount(BigDecimal amount) {
this.amount = amount;
return this;
}
/**
* The amount of the price. Specify this field if you want to override the original price with a flat-fee price
* @return amount
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The amount of the price. Specify this field if you want to override the original price with a flat-fee price")
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public SubscriptionItemPatchRequest unitAmount(BigDecimal unitAmount) {
this.unitAmount = unitAmount;
return this;
}
/**
* The unit amount of the price. Specify this field if you want to override the orignial price with a per-unit price.
* @return unitAmount
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The unit amount of the price. Specify this field if you want to override the orignial price with a per-unit price.")
public BigDecimal getUnitAmount() {
return unitAmount;
}
public void setUnitAmount(BigDecimal unitAmount) {
this.unitAmount = unitAmount;
}
public SubscriptionItemPatchRequest tiers(List tiers) {
this.tiers = tiers;
return this;
}
public SubscriptionItemPatchRequest addTiersItem(ItemTier tiersItem) {
if (this.tiers == null) {
this.tiers = new ArrayList();
}
this.tiers.add(tiersItem);
return this;
}
/**
* Information of all tiers if you want to override the original price with a tiered price.
* @return tiers
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Information of all tiers if you want to override the original price with a tiered price.")
public List getTiers() {
return tiers;
}
public void setTiers(List tiers) {
this.tiers = tiers;
}
public SubscriptionItemPatchRequest overage(Overage overage) {
this.overage = overage;
return this;
}
/**
* Get overage
* @return overage
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Overage getOverage() {
return overage;
}
public void setOverage(Overage overage) {
this.overage = overage;
}
public SubscriptionItemPatchRequest uniqueToken(String uniqueToken) {
this.uniqueToken = uniqueToken;
return this;
}
/**
* Unique identifier for the price. This identifier enables you to refer to the price before the price has an internal identifier in Zuora.
* @return uniqueToken
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Unique identifier for the price. This identifier enables you to refer to the price before the price has an internal identifier in Zuora.")
public String getUniqueToken() {
return uniqueToken;
}
public void setUniqueToken(String uniqueToken) {
this.uniqueToken = uniqueToken;
}
public SubscriptionItemPatchRequest prepayment(SubscriptionItemPrepaymentField prepayment) {
this.prepayment = prepayment;
return this;
}
/**
* Get prepayment
* @return prepayment
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public SubscriptionItemPrepaymentField getPrepayment() {
return prepayment;
}
public void setPrepayment(SubscriptionItemPrepaymentField prepayment) {
this.prepayment = prepayment;
}
public SubscriptionItemPatchRequest customFieldPerUnitRate(String customFieldPerUnitRate) {
this.customFieldPerUnitRate = customFieldPerUnitRate;
return this;
}
/**
* Name of the custom field that will be used to set a per unit rate under the `Pre-Rated Per Unit` charge model
* @return customFieldPerUnitRate
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the custom field that will be used to set a per unit rate under the `Pre-Rated Per Unit` charge model ")
public String getCustomFieldPerUnitRate() {
return customFieldPerUnitRate;
}
public void setCustomFieldPerUnitRate(String customFieldPerUnitRate) {
this.customFieldPerUnitRate = customFieldPerUnitRate;
}
public SubscriptionItemPatchRequest customFieldTotalAmount(String customFieldTotalAmount) {
this.customFieldTotalAmount = customFieldTotalAmount;
return this;
}
/**
* Name of the custom field that will be used to set a total amount under the `Pre-Rated` charge model
* @return customFieldTotalAmount
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the custom field that will be used to set a total amount under the `Pre-Rated` charge model ")
public String getCustomFieldTotalAmount() {
return customFieldTotalAmount;
}
public void setCustomFieldTotalAmount(String customFieldTotalAmount) {
this.customFieldTotalAmount = customFieldTotalAmount;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SubscriptionItemPatchRequest subscriptionItemPatchRequest = (SubscriptionItemPatchRequest) o;
return Objects.equals(this.id, subscriptionItemPatchRequest.id) &&
Objects.equals(this.recurring, subscriptionItemPatchRequest.recurring) &&
Objects.equals(this.subscriptionItemNumber, subscriptionItemPatchRequest.subscriptionItemNumber) &&
Objects.equals(this.customFields, subscriptionItemPatchRequest.customFields) &&
Objects.equals(this.description, subscriptionItemPatchRequest.description) &&
Objects.equals(this.startDate, subscriptionItemPatchRequest.startDate) &&
Objects.equals(this.endDate, subscriptionItemPatchRequest.endDate) &&
Objects.equals(this.applyDiscountTo, subscriptionItemPatchRequest.applyDiscountTo) &&
Objects.equals(this.discountLevel, subscriptionItemPatchRequest.discountLevel) &&
Objects.equals(this.startEvent, subscriptionItemPatchRequest.startEvent) &&
Objects.equals(this.discountPercent, subscriptionItemPatchRequest.discountPercent) &&
Objects.equals(this.quantity, subscriptionItemPatchRequest.quantity) &&
Objects.equals(this.amount, subscriptionItemPatchRequest.amount) &&
Objects.equals(this.unitAmount, subscriptionItemPatchRequest.unitAmount) &&
Objects.equals(this.tiers, subscriptionItemPatchRequest.tiers) &&
Objects.equals(this.overage, subscriptionItemPatchRequest.overage) &&
Objects.equals(this.uniqueToken, subscriptionItemPatchRequest.uniqueToken) &&
Objects.equals(this.prepayment, subscriptionItemPatchRequest.prepayment) &&
Objects.equals(this.customFieldPerUnitRate, subscriptionItemPatchRequest.customFieldPerUnitRate) &&
Objects.equals(this.customFieldTotalAmount, subscriptionItemPatchRequest.customFieldTotalAmount);
}
@Override
public int hashCode() {
return Objects.hash(id, recurring, subscriptionItemNumber, customFields, description, startDate, endDate, applyDiscountTo, discountLevel, startEvent, discountPercent, quantity, amount, unitAmount, tiers, overage, uniqueToken, prepayment, customFieldPerUnitRate, customFieldTotalAmount);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SubscriptionItemPatchRequest {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" recurring: ").append(toIndentedString(recurring)).append("\n");
sb.append(" subscriptionItemNumber: ").append(toIndentedString(subscriptionItemNumber)).append("\n");
sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n");
sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n");
sb.append(" applyDiscountTo: ").append(toIndentedString(applyDiscountTo)).append("\n");
sb.append(" discountLevel: ").append(toIndentedString(discountLevel)).append("\n");
sb.append(" startEvent: ").append(toIndentedString(startEvent)).append("\n");
sb.append(" discountPercent: ").append(toIndentedString(discountPercent)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" unitAmount: ").append(toIndentedString(unitAmount)).append("\n");
sb.append(" tiers: ").append(toIndentedString(tiers)).append("\n");
sb.append(" overage: ").append(toIndentedString(overage)).append("\n");
sb.append(" uniqueToken: ").append(toIndentedString(uniqueToken)).append("\n");
sb.append(" prepayment: ").append(toIndentedString(prepayment)).append("\n");
sb.append(" customFieldPerUnitRate: ").append(toIndentedString(customFieldPerUnitRate)).append("\n");
sb.append(" customFieldTotalAmount: ").append(toIndentedString(customFieldTotalAmount)).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