orb-billing 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/README.md +1 -1
  4. data/lib/orb/internal/type/union.rb +3 -8
  5. data/lib/orb/internal/util.rb +8 -9
  6. data/lib/orb/models/amount_discount.rb +65 -1
  7. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +1437 -15
  8. data/lib/orb/models/beta_create_plan_version_params.rb +1435 -15
  9. data/lib/orb/models/percentage_discount.rb +65 -1
  10. data/lib/orb/models/subscription_create_params.rb +1435 -15
  11. data/lib/orb/models/subscription_price_intervals_params.rb +715 -5
  12. data/lib/orb/models/subscription_redeem_coupon_params.rb +17 -9
  13. data/lib/orb/models/subscription_schedule_plan_change_params.rb +1435 -15
  14. data/lib/orb/models/trial_discount.rb +65 -1
  15. data/lib/orb/models/usage_discount.rb +65 -1
  16. data/lib/orb/resources/subscriptions.rb +6 -4
  17. data/lib/orb/version.rb +1 -1
  18. data/rbi/orb/internal/util.rbi +2 -0
  19. data/rbi/orb/models/amount_discount.rbi +117 -0
  20. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +6145 -3045
  21. data/rbi/orb/models/beta_create_plan_version_params.rbi +6096 -2996
  22. data/rbi/orb/models/percentage_discount.rbi +131 -0
  23. data/rbi/orb/models/subscription_create_params.rbi +6037 -2937
  24. data/rbi/orb/models/subscription_price_intervals_params.rbi +1633 -83
  25. data/rbi/orb/models/subscription_redeem_coupon_params.rbi +16 -8
  26. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +6948 -3848
  27. data/rbi/orb/models/trial_discount.rbi +109 -0
  28. data/rbi/orb/models/usage_discount.rbi +109 -0
  29. data/rbi/orb/resources/subscriptions.rbi +7 -4
  30. data/sig/orb/models/amount_discount.rbs +58 -0
  31. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +1130 -20
  32. data/sig/orb/models/beta_create_plan_version_params.rbs +1130 -20
  33. data/sig/orb/models/percentage_discount.rbs +58 -0
  34. data/sig/orb/models/subscription_create_params.rbs +1130 -20
  35. data/sig/orb/models/subscription_price_intervals_params.rbs +565 -10
  36. data/sig/orb/models/subscription_redeem_coupon_params.rbs +11 -6
  37. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +1130 -20
  38. data/sig/orb/models/trial_discount.rbs +58 -0
  39. data/sig/orb/models/usage_discount.rbs +58 -0
  40. data/sig/orb/resources/subscriptions.rbs +2 -1
  41. metadata +2 -2
@@ -22,12 +22,18 @@ module Orb
22
22
  # @return [Array<String>, nil]
23
23
  optional :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
24
24
 
25
+ # @!attribute filters
26
+ # The filters that determine which prices to apply this discount to.
27
+ #
28
+ # @return [Array<Orb::Models::PercentageDiscount::Filter>, nil]
29
+ optional :filters, -> { Orb::Internal::Type::ArrayOf[Orb::PercentageDiscount::Filter] }, nil?: true
30
+
25
31
  # @!attribute reason
26
32
  #
27
33
  # @return [String, nil]
28
34
  optional :reason, String, nil?: true
29
35
 
30
- # @!method initialize(discount_type:, percentage_discount:, applies_to_price_ids: nil, reason: nil)
36
+ # @!method initialize(discount_type:, percentage_discount:, applies_to_price_ids: nil, filters: nil, reason: nil)
31
37
  # Some parameter documentations has been truncated, see
32
38
  # {Orb::Models::PercentageDiscount} for more details.
33
39
  #
@@ -37,6 +43,8 @@ module Orb
37
43
  #
38
44
  # @param applies_to_price_ids [Array<String>, nil] List of price_ids that this discount applies to. For plan/plan phase discounts,
39
45
  #
46
+ # @param filters [Array<Orb::Models::PercentageDiscount::Filter>, nil] The filters that determine which prices to apply this discount to.
47
+ #
40
48
  # @param reason [String, nil]
41
49
 
42
50
  # @see Orb::Models::PercentageDiscount#discount_type
@@ -48,6 +56,62 @@ module Orb
48
56
  # @!method self.values
49
57
  # @return [Array<Symbol>]
50
58
  end
59
+
60
+ class Filter < Orb::Internal::Type::BaseModel
61
+ # @!attribute field
62
+ # The property of the price to filter on.
63
+ #
64
+ # @return [Symbol, Orb::Models::PercentageDiscount::Filter::Field]
65
+ required :field, enum: -> { Orb::PercentageDiscount::Filter::Field }
66
+
67
+ # @!attribute operator
68
+ # Should prices that match the filter be included or excluded.
69
+ #
70
+ # @return [Symbol, Orb::Models::PercentageDiscount::Filter::Operator]
71
+ required :operator, enum: -> { Orb::PercentageDiscount::Filter::Operator }
72
+
73
+ # @!attribute values
74
+ # The IDs or values that match this filter.
75
+ #
76
+ # @return [Array<String>]
77
+ required :values, Orb::Internal::Type::ArrayOf[String]
78
+
79
+ # @!method initialize(field:, operator:, values:)
80
+ # @param field [Symbol, Orb::Models::PercentageDiscount::Filter::Field] The property of the price to filter on.
81
+ #
82
+ # @param operator [Symbol, Orb::Models::PercentageDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
83
+ #
84
+ # @param values [Array<String>] The IDs or values that match this filter.
85
+
86
+ # The property of the price to filter on.
87
+ #
88
+ # @see Orb::Models::PercentageDiscount::Filter#field
89
+ module Field
90
+ extend Orb::Internal::Type::Enum
91
+
92
+ PRICE_ID = :price_id
93
+ ITEM_ID = :item_id
94
+ PRICE_TYPE = :price_type
95
+ CURRENCY = :currency
96
+ PRICING_UNIT_ID = :pricing_unit_id
97
+
98
+ # @!method self.values
99
+ # @return [Array<Symbol>]
100
+ end
101
+
102
+ # Should prices that match the filter be included or excluded.
103
+ #
104
+ # @see Orb::Models::PercentageDiscount::Filter#operator
105
+ module Operator
106
+ extend Orb::Internal::Type::Enum
107
+
108
+ INCLUDES = :includes
109
+ EXCLUDES = :excludes
110
+
111
+ # @!method self.values
112
+ # @return [Array<Symbol>]
113
+ end
114
+ end
51
115
  end
52
116
  end
53
117
  end