@@ -21,12 +21,18 @@ class AmountDiscount < Orb::Internal::Type::BaseModel
2121 # @return [Array<String>, nil]
2222 optional :applies_to_price_ids , Orb ::Internal ::Type ::ArrayOf [ String ] , nil? : true
2323
24+ # @!attribute filters
25+ # The filters that determine which prices to apply this discount to.
26+ #
27+ # @return [Array<Orb::Models::AmountDiscount::Filter>, nil]
28+ optional :filters , -> { Orb ::Internal ::Type ::ArrayOf [ Orb ::AmountDiscount ::Filter ] } , nil? : true
29+
2430 # @!attribute reason
2531 #
2632 # @return [String, nil]
2733 optional :reason , String , nil? : true
2834
29- # @!method initialize(amount_discount:, discount_type:, applies_to_price_ids: nil, reason: nil)
35+ # @!method initialize(amount_discount:, discount_type:, applies_to_price_ids: nil, filters: nil, reason: nil)
3036 # Some parameter documentations has been truncated, see
3137 # {Orb::Models::AmountDiscount} for more details.
3238 #
@@ -36,6 +42,8 @@ class AmountDiscount < Orb::Internal::Type::BaseModel
3642 #
3743 # @param applies_to_price_ids [Array<String>, nil] List of price_ids that this discount applies to. For plan/plan phase discounts,
3844 #
45+ # @param filters [Array<Orb::Models::AmountDiscount::Filter>, nil] The filters that determine which prices to apply this discount to.
46+ #
3947 # @param reason [String, nil]
4048
4149 # @see Orb::Models::AmountDiscount#discount_type
@@ -47,6 +55,62 @@ module DiscountType
4755 # @!method self.values
4856 # @return [Array<Symbol>]
4957 end
58+
59+ class Filter < Orb ::Internal ::Type ::BaseModel
60+ # @!attribute field
61+ # The property of the price to filter on.
62+ #
63+ # @return [Symbol, Orb::Models::AmountDiscount::Filter::Field]
64+ required :field , enum : -> { Orb ::AmountDiscount ::Filter ::Field }
65+
66+ # @!attribute operator
67+ # Should prices that match the filter be included or excluded.
68+ #
69+ # @return [Symbol, Orb::Models::AmountDiscount::Filter::Operator]
70+ required :operator , enum : -> { Orb ::AmountDiscount ::Filter ::Operator }
71+
72+ # @!attribute values
73+ # The IDs or values that match this filter.
74+ #
75+ # @return [Array<String>]
76+ required :values , Orb ::Internal ::Type ::ArrayOf [ String ]
77+
78+ # @!method initialize(field:, operator:, values:)
79+ # @param field [Symbol, Orb::Models::AmountDiscount::Filter::Field] The property of the price to filter on.
80+ #
81+ # @param operator [Symbol, Orb::Models::AmountDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
82+ #
83+ # @param values [Array<String>] The IDs or values that match this filter.
84+
85+ # The property of the price to filter on.
86+ #
87+ # @see Orb::Models::AmountDiscount::Filter#field
88+ module Field
89+ extend Orb ::Internal ::Type ::Enum
90+
91+ PRICE_ID = :price_id
92+ ITEM_ID = :item_id
93+ PRICE_TYPE = :price_type
94+ CURRENCY = :currency
95+ PRICING_UNIT_ID = :pricing_unit_id
96+
97+ # @!method self.values
98+ # @return [Array<Symbol>]
99+ end
100+
101+ # Should prices that match the filter be included or excluded.
102+ #
103+ # @see Orb::Models::AmountDiscount::Filter#operator
104+ module Operator
105+ extend Orb ::Internal ::Type ::Enum
106+
107+ INCLUDES = :includes
108+ EXCLUDES = :excludes
109+
110+ # @!method self.values
111+ # @return [Array<Symbol>]
112+ end
113+ end
50114 end
51115 end
52116end
0 commit comments