Class DiscountsFinalPrice


  • @Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
               comments="Generator version: 7.4.0")
    public class DiscountsFinalPrice
    extends Object
    Fixed amount discount that reduces the regular price by a specific monetary value. Example: $100 regular price with a $10 fixed discount results in $90 final price.
    • Constructor Detail

      • DiscountsFinalPrice

        public DiscountsFinalPrice()
    • Method Detail

      • getCode

        @Nonnull
        public String getCode()
        Unique identifier for the discount. Must be unique within the price record. Use descriptive codes for easier management (e.g., \"loyalty_discount\", \"holiday_sale\").
        Returns:
        code
      • setCode

        public void setCode​(String code)
      • getPrice

        @Nonnull
        public Float getPrice()
        Fixed discount amount in the same currency as the price book. Must be a positive number less than the regular price.
        Returns:
        price
      • setPrice

        public void setPrice​(Float price)
      • hashCode

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

        public static void validateJsonElement​(com.google.gson.JsonElement jsonElement)
                                        throws IOException
        Validates the JSON Element and throws an exception if issues found
        Parameters:
        jsonElement - JSON Element
        Throws:
        IOException - if the JSON Element is invalid with respect to DiscountsFinalPrice
      • fromJson

        public static DiscountsFinalPrice fromJson​(String jsonString)
                                            throws IOException
        Create an instance of DiscountsFinalPrice given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of DiscountsFinalPrice
        Throws:
        IOException - if the JSON string is invalid with respect to DiscountsFinalPrice
      • toJson

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