com.recurly.v3.requests.SubscriptionAddOnCreate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-client Show documentation
Show all versions of api-client Show documentation
The official Java client for Recurly's V3 API.
/**
* This file is automatically created by Recurly's OpenAPI generation process and thus any edits you
* make by hand will be lost. If you wish to make a change to this file, please create a Github
* issue explaining the changes you need and we will usher them to the appropriate places.
*/
package com.recurly.v3.requests;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.recurly.v3.Constants;
import com.recurly.v3.Request;
import com.recurly.v3.resources.*;
import java.math.BigDecimal;
import java.util.List;
public class SubscriptionAddOnCreate extends Request {
/**
* Used to determine where the associated add-on data is pulled from. If this value is set to
* `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the
* associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to
* `item`, then the associated add-on data will be pulled from the site's item catalog.
*/
@SerializedName("add_on_source")
@Expose
private Constants.AddOnSource addOnSource;
/**
* If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code` should be
* used. If `add_on_source` is set to `item`, then the `code` from the associated item should be
* used.
*/
@SerializedName("code")
@Expose
private String code;
/**
* If percentage tiers are provided in the request, all existing percentage tiers on the
* Subscription Add-on will be removed and replaced by the percentage tiers in the request. There
* must be one tier without ending_amount value which represents the final tier. Use only if
* add_on.tier_type is tiered or volume and add_on.usage_type is percentage. This feature is
* currently in development and requires approval and enablement, please contact support.
*/
@SerializedName("percentage_tiers")
@Expose
private List percentageTiers;
/** Quantity */
@SerializedName("quantity")
@Expose
private Integer quantity;
/** Revenue schedule type */
@SerializedName("revenue_schedule_type")
@Expose
private Constants.RevenueScheduleType revenueScheduleType;
/**
* If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
* must include one to many tiers with `ending_quantity` and `unit_amount`. There must be one tier
* without an `ending_quantity` value which represents the final tier. See our
* [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how to
* configure quantity-based pricing models.
*/
@SerializedName("tiers")
@Expose
private List tiers;
/**
* Allows up to 2 decimal places. Optionally, override the add-on's default unit amount. If the
* plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be
* provided.
*/
@SerializedName("unit_amount")
@Expose
private BigDecimal unitAmount;
/**
* Allows up to 9 decimal places. Optionally, override the add-on's default unit amount. If the
* plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal`
* cannot be provided. Only supported when the plan add-on's `add_on_type` = `usage`. If
* `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
*/
@SerializedName("unit_amount_decimal")
@Expose
private String unitAmountDecimal;
/**
* The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal
* places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is
* percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our
* [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an overview
* of how to configure usage add-ons.
*/
@SerializedName("usage_percentage")
@Expose
private BigDecimal usagePercentage;
/**
* Used to determine where the associated add-on data is pulled from. If this value is set to
* `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the
* associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to
* `item`, then the associated add-on data will be pulled from the site's item catalog.
*/
public Constants.AddOnSource getAddOnSource() {
return this.addOnSource;
}
/**
* @param addOnSource Used to determine where the associated add-on data is pulled from. If this
* value is set to `plan_add_on` or left blank, then add-on data will be pulled from the
* plan's add-ons. If the associated `plan` has `allow_any_item_on_subscriptions` set to
* `true` and this field is set to `item`, then the associated add-on data will be pulled from
* the site's item catalog.
*/
public void setAddOnSource(final Constants.AddOnSource addOnSource) {
this.addOnSource = addOnSource;
}
/**
* If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code` should be
* used. If `add_on_source` is set to `item`, then the `code` from the associated item should be
* used.
*/
public String getCode() {
return this.code;
}
/**
* @param code If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code`
* should be used. If `add_on_source` is set to `item`, then the `code` from the associated
* item should be used.
*/
public void setCode(final String code) {
this.code = code;
}
/**
* If percentage tiers are provided in the request, all existing percentage tiers on the
* Subscription Add-on will be removed and replaced by the percentage tiers in the request. There
* must be one tier without ending_amount value which represents the final tier. Use only if
* add_on.tier_type is tiered or volume and add_on.usage_type is percentage. This feature is
* currently in development and requires approval and enablement, please contact support.
*/
public List getPercentageTiers() {
return this.percentageTiers;
}
/**
* @param percentageTiers If percentage tiers are provided in the request, all existing percentage
* tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in
* the request. There must be one tier without ending_amount value which represents the final
* tier. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage.
* This feature is currently in development and requires approval and enablement, please
* contact support.
*/
public void setPercentageTiers(final List percentageTiers) {
this.percentageTiers = percentageTiers;
}
/** Quantity */
public Integer getQuantity() {
return this.quantity;
}
/** @param quantity Quantity */
public void setQuantity(final Integer quantity) {
this.quantity = quantity;
}
/** Revenue schedule type */
public Constants.RevenueScheduleType getRevenueScheduleType() {
return this.revenueScheduleType;
}
/** @param revenueScheduleType Revenue schedule type */
public void setRevenueScheduleType(final Constants.RevenueScheduleType revenueScheduleType) {
this.revenueScheduleType = revenueScheduleType;
}
/**
* If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
* must include one to many tiers with `ending_quantity` and `unit_amount`. There must be one tier
* without an `ending_quantity` value which represents the final tier. See our
* [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how to
* configure quantity-based pricing models.
*/
public List getTiers() {
return this.tiers;
}
/**
* @param tiers If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The
* `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount`.
* There must be one tier without an `ending_quantity` value which represents the final tier.
* See our [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an
* overview of how to configure quantity-based pricing models.
*/
public void setTiers(final List tiers) {
this.tiers = tiers;
}
/**
* Allows up to 2 decimal places. Optionally, override the add-on's default unit amount. If the
* plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be
* provided.
*/
public BigDecimal getUnitAmount() {
return this.unitAmount;
}
/**
* @param unitAmount Allows up to 2 decimal places. Optionally, override the add-on's default unit
* amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then
* `unit_amount` cannot be provided.
*/
public void setUnitAmount(final BigDecimal unitAmount) {
this.unitAmount = unitAmount;
}
/**
* Allows up to 9 decimal places. Optionally, override the add-on's default unit amount. If the
* plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal`
* cannot be provided. Only supported when the plan add-on's `add_on_type` = `usage`. If
* `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
*/
public String getUnitAmountDecimal() {
return this.unitAmountDecimal;
}
/**
* @param unitAmountDecimal Allows up to 9 decimal places. Optionally, override the add-on's
* default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or
* `stairstep`, then `unit_amount_decimal` cannot be provided. Only supported when the plan
* add-on's `add_on_type` = `usage`. If `unit_amount_decimal` is provided, `unit_amount`
* cannot be provided.
*/
public void setUnitAmountDecimal(final String unitAmountDecimal) {
this.unitAmountDecimal = unitAmountDecimal;
}
/**
* The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal
* places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is
* percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our
* [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an overview
* of how to configure usage add-ons.
*/
public BigDecimal getUsagePercentage() {
return this.usagePercentage;
}
/**
* @param usagePercentage The percentage taken of the monetary amount of usage tracked. This can
* be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is
* usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does
* not support tiers. See our
* [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an
* overview of how to configure usage add-ons.
*/
public void setUsagePercentage(final BigDecimal usagePercentage) {
this.usagePercentage = usagePercentage;
}
}