Package io.voucherify.client.model
Class Discount
java.lang.Object
io.voucherify.client.model.Discount
@Generated("org.openapitools.codegen.languages.JavaClientCodegen")
public class Discount
extends Object
Discount
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumGets or Sets effectstatic enumGets or Sets type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddUnitsItem(DiscountUnitMultipleOneUnit unitsItem) aggregatedAmountLimit(Integer aggregatedAmountLimit) amountLimit(BigDecimal amountLimit) amountOff(BigDecimal amountOff) amountOffFormula(String amountOffFormula) effect(Discount.EffectEnum effect) booleanfixedAmount(BigDecimal fixedAmount) fixedAmountFormula(String fixedAmountFormula) static DiscountCreate an instance of Discount given an JSON stringMaximum discount amount per order.Upper limit allowed to be applied as a discount.Amount taken off the subtotal of a price.Get amountOffFormulaGet effectSets a fixed value for an order total or the item price.Get fixedAmountFormulaFlag indicating whether the discount was calculated using a formula.The percent discount that the customer will receive.Get percentOffFormulaGet productgetSku()Get skugetType()Get typeNumber of units to be granted a full value discount.Get unitOffFormulagetUnits()Get unitsThe product deemed as free, chosen from product inventory (e.g.inthashCode()percentOff(BigDecimal percentOff) percentOffFormula(String percentOffFormula) product(DiscountProduct product) voidsetAggregatedAmountLimit(Integer aggregatedAmountLimit) voidsetAmountLimit(BigDecimal amountLimit) voidsetAmountOff(BigDecimal amountOff) voidsetAmountOffFormula(String amountOffFormula) voidsetEffect(Discount.EffectEnum effect) voidsetFixedAmount(BigDecimal fixedAmount) voidsetFixedAmountFormula(String fixedAmountFormula) voidsetIsDynamic(Boolean isDynamic) voidsetPercentOff(BigDecimal percentOff) voidsetPercentOffFormula(String percentOffFormula) voidsetProduct(DiscountProduct product) voidvoidsetType(Discount.TypeEnum type) voidsetUnitOff(Integer unitOff) voidsetUnitOffFormula(String unitOffFormula) voidsetUnits(List<DiscountUnitMultipleOneUnit> units) voidsetUnitType(String unitType) sku(SimpleSkuDiscountUnit sku) toJson()Convert an instance of Discount to an JSON stringtoString()type(Discount.TypeEnum type) unitOffFormula(String unitOffFormula) units(List<DiscountUnitMultipleOneUnit> units)
-
Field Details
-
SERIALIZED_NAME_TYPE
- See Also:
-
SERIALIZED_NAME_AMOUNT_OFF
- See Also:
-
SERIALIZED_NAME_AMOUNT_OFF_FORMULA
- See Also:
-
SERIALIZED_NAME_AGGREGATED_AMOUNT_LIMIT
- See Also:
-
SERIALIZED_NAME_EFFECT
- See Also:
-
SERIALIZED_NAME_IS_DYNAMIC
- See Also:
-
SERIALIZED_NAME_UNIT_OFF
- See Also:
-
SERIALIZED_NAME_UNIT_OFF_FORMULA
- See Also:
-
SERIALIZED_NAME_UNIT_TYPE
- See Also:
-
SERIALIZED_NAME_PRODUCT
- See Also:
-
SERIALIZED_NAME_SKU
- See Also:
-
SERIALIZED_NAME_UNITS
- See Also:
-
SERIALIZED_NAME_PERCENT_OFF
- See Also:
-
SERIALIZED_NAME_PERCENT_OFF_FORMULA
- See Also:
-
SERIALIZED_NAME_AMOUNT_LIMIT
- See Also:
-
SERIALIZED_NAME_FIXED_AMOUNT
- See Also:
-
SERIALIZED_NAME_FIXED_AMOUNT_FORMULA
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
Discount
public Discount()
-
-
Method Details
-
type
-
getType
Get type- Returns:
- type
-
setType
-
amountOff
-
getAmountOff
Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000.- Returns:
- amountOff
-
setAmountOff
-
amountOffFormula
-
getAmountOffFormula
Get amountOffFormula- Returns:
- amountOffFormula
-
setAmountOffFormula
-
aggregatedAmountLimit
-
getAggregatedAmountLimit
Maximum discount amount per order.- Returns:
- aggregatedAmountLimit
-
setAggregatedAmountLimit
-
effect
-
getEffect
Get effect- Returns:
- effect
-
setEffect
-
isDynamic
-
getIsDynamic
Flag indicating whether the discount was calculated using a formula.- Returns:
- isDynamic
-
setIsDynamic
-
unitOff
-
getUnitOff
Number of units to be granted a full value discount.- Returns:
- unitOff
-
setUnitOff
-
unitOffFormula
-
getUnitOffFormula
Get unitOffFormula- Returns:
- unitOffFormula
-
setUnitOffFormula
-
unitType
-
getUnitType
The product deemed as free, chosen from product inventory (e.g. time, items).- Returns:
- unitType
-
setUnitType
-
product
-
getProduct
Get product- Returns:
- product
-
setProduct
-
sku
-
getSku
Get sku- Returns:
- sku
-
setSku
-
units
-
addUnitsItem
-
getUnits
Get units- Returns:
- units
-
setUnits
-
percentOff
-
getPercentOff
The percent discount that the customer will receive.- Returns:
- percentOff
-
setPercentOff
-
percentOffFormula
-
getPercentOffFormula
Get percentOffFormula- Returns:
- percentOffFormula
-
setPercentOffFormula
-
amountLimit
-
getAmountLimit
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600.- Returns:
- amountLimit
-
setAmountLimit
-
fixedAmount
-
getFixedAmount
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.- Returns:
- fixedAmount
-
setFixedAmount
-
fixedAmountFormula
-
getFixedAmountFormula
Get fixedAmountFormula- Returns:
- fixedAmountFormula
-
setFixedAmountFormula
-
equals
-
hashCode
public int hashCode() -
toString
-
fromJson
Create an instance of Discount given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Discount
- Throws:
IOException- if the JSON string is invalid with respect to Discount
-
toJson
Convert an instance of Discount to an JSON string- Returns:
- JSON string
-