Class Discount

java.lang.Object
io.voucherify.client.model.Discount

@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class Discount extends Object
Discount
  • Field Details

  • Constructor Details

    • Discount

      public Discount()
  • Method Details

    • type

      public Discount type(Discount.TypeEnum type)
    • getType

      @Nullable public Discount.TypeEnum getType()
      Get type
      Returns:
      type
    • setType

      public void setType(Discount.TypeEnum type)
    • amountOff

      public Discount amountOff(BigDecimal amountOff)
    • getAmountOff

      @Nullable public BigDecimal 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

      public void setAmountOff(BigDecimal amountOff)
    • amountOffFormula

      public Discount amountOffFormula(String amountOffFormula)
    • getAmountOffFormula

      @Nullable public String getAmountOffFormula()
      Get amountOffFormula
      Returns:
      amountOffFormula
    • setAmountOffFormula

      public void setAmountOffFormula(String amountOffFormula)
    • aggregatedAmountLimit

      public Discount aggregatedAmountLimit(Integer aggregatedAmountLimit)
    • getAggregatedAmountLimit

      @Nullable public Integer getAggregatedAmountLimit()
      Maximum discount amount per order.
      Returns:
      aggregatedAmountLimit
    • setAggregatedAmountLimit

      public void setAggregatedAmountLimit(Integer aggregatedAmountLimit)
    • effect

      public Discount effect(Discount.EffectEnum effect)
    • getEffect

      @Nullable public Discount.EffectEnum getEffect()
      Get effect
      Returns:
      effect
    • setEffect

      public void setEffect(Discount.EffectEnum effect)
    • isDynamic

      public Discount isDynamic(Boolean isDynamic)
    • getIsDynamic

      @Nullable public Boolean getIsDynamic()
      Flag indicating whether the discount was calculated using a formula.
      Returns:
      isDynamic
    • setIsDynamic

      public void setIsDynamic(Boolean isDynamic)
    • unitOff

      public Discount unitOff(Integer unitOff)
    • getUnitOff

      @Nullable public Integer getUnitOff()
      Number of units to be granted a full value discount.
      Returns:
      unitOff
    • setUnitOff

      public void setUnitOff(Integer unitOff)
    • unitOffFormula

      public Discount unitOffFormula(String unitOffFormula)
    • getUnitOffFormula

      @Nullable public String getUnitOffFormula()
      Get unitOffFormula
      Returns:
      unitOffFormula
    • setUnitOffFormula

      public void setUnitOffFormula(String unitOffFormula)
    • unitType

      public Discount unitType(String unitType)
    • getUnitType

      @Nullable public String getUnitType()
      The product deemed as free, chosen from product inventory (e.g. time, items).
      Returns:
      unitType
    • setUnitType

      public void setUnitType(String unitType)
    • product

      public Discount product(DiscountProduct product)
    • getProduct

      @Nullable public DiscountProduct getProduct()
      Get product
      Returns:
      product
    • setProduct

      public void setProduct(DiscountProduct product)
    • sku

      public Discount sku(SimpleSkuDiscountUnit sku)
    • getSku

      @Nullable public SimpleSkuDiscountUnit getSku()
      Get sku
      Returns:
      sku
    • setSku

      public void setSku(SimpleSkuDiscountUnit sku)
    • units

      public Discount units(List<DiscountUnitMultipleOneUnit> units)
    • addUnitsItem

      public Discount addUnitsItem(DiscountUnitMultipleOneUnit unitsItem)
    • getUnits

      @Nullable public List<DiscountUnitMultipleOneUnit> getUnits()
      Get units
      Returns:
      units
    • setUnits

      public void setUnits(List<DiscountUnitMultipleOneUnit> units)
    • percentOff

      public Discount percentOff(BigDecimal percentOff)
    • getPercentOff

      @Nullable public BigDecimal getPercentOff()
      The percent discount that the customer will receive.
      Returns:
      percentOff
    • setPercentOff

      public void setPercentOff(BigDecimal percentOff)
    • percentOffFormula

      public Discount percentOffFormula(String percentOffFormula)
    • getPercentOffFormula

      @Nullable public String getPercentOffFormula()
      Get percentOffFormula
      Returns:
      percentOffFormula
    • setPercentOffFormula

      public void setPercentOffFormula(String percentOffFormula)
    • amountLimit

      public Discount amountLimit(BigDecimal amountLimit)
    • getAmountLimit

      @Nullable public BigDecimal 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

      public void setAmountLimit(BigDecimal amountLimit)
    • fixedAmount

      public Discount fixedAmount(BigDecimal fixedAmount)
    • getFixedAmount

      @Nullable public BigDecimal 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

      public void setFixedAmount(BigDecimal fixedAmount)
    • fixedAmountFormula

      public Discount fixedAmountFormula(String fixedAmountFormula)
    • getFixedAmountFormula

      @Nullable public String getFixedAmountFormula()
      Get fixedAmountFormula
      Returns:
      fixedAmountFormula
    • setFixedAmountFormula

      public void setFixedAmountFormula(String fixedAmountFormula)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fromJson

      public static Discount fromJson(String jsonString) throws IOException
      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

      public String toJson()
      Convert an instance of Discount to an JSON string
      Returns:
      JSON string