orb-billing 0.5.5 → 0.7.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 (205) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +4 -0
  5. data/lib/orb/internal/type/base_model.rb +2 -2
  6. data/lib/orb/internal/type/union.rb +6 -6
  7. data/lib/orb/models/alert.rb +33 -1
  8. data/lib/orb/models/amount_discount.rb +10 -10
  9. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +17940 -0
  10. data/lib/orb/models/beta/external_plan_id_fetch_plan_version_params.rb +22 -0
  11. data/lib/orb/models/beta/external_plan_id_set_default_plan_version_params.rb +24 -0
  12. data/lib/orb/models/beta_create_plan_version_params.rb +17758 -0
  13. data/lib/orb/models/beta_fetch_plan_version_params.rb +20 -0
  14. data/lib/orb/models/beta_set_default_plan_version_params.rb +22 -0
  15. data/lib/orb/models/credit_note_create_params.rb +9 -9
  16. data/lib/orb/models/customer_create_params.rb +21 -3
  17. data/lib/orb/models/customer_update_by_external_id_params.rb +21 -3
  18. data/lib/orb/models/customer_update_params.rb +21 -3
  19. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +9 -1
  20. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +9 -1
  21. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +9 -1
  22. data/lib/orb/models/customers/credits/ledger_list_response.rb +9 -1
  23. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +1 -1
  24. data/lib/orb/models/customers/credits/top_up_create_params.rb +1 -1
  25. data/lib/orb/models/invoice.rb +626 -9
  26. data/lib/orb/models/invoice_fetch_upcoming_response.rb +624 -9
  27. data/lib/orb/models/invoice_line_item_create_response.rb +486 -7
  28. data/lib/orb/models/item.rb +18 -1
  29. data/lib/orb/models/item_archive_params.rb +14 -0
  30. data/lib/orb/models/item_create_params.rb +14 -1
  31. data/lib/orb/models/item_update_params.rb +16 -1
  32. data/lib/orb/models/percentage_discount.rb +10 -10
  33. data/lib/orb/models/plan.rb +618 -9
  34. data/lib/orb/models/plan_create_params.rb +2066 -30
  35. data/lib/orb/models/plan_version.rb +735 -0
  36. data/lib/orb/models/plan_version_phase.rb +70 -0
  37. data/lib/orb/models/price.rb +4124 -70
  38. data/lib/orb/models/price_create_params.rb +45 -1
  39. data/lib/orb/models/price_evaluate_multiple_params.rb +8620 -0
  40. data/lib/orb/models/price_evaluate_multiple_response.rb +51 -0
  41. data/lib/orb/models/subscription.rb +730 -54
  42. data/lib/orb/models/subscription_cancel_response.rb +706 -54
  43. data/lib/orb/models/subscription_change_apply_response.rb +728 -54
  44. data/lib/orb/models/subscription_change_cancel_response.rb +728 -54
  45. data/lib/orb/models/subscription_change_retrieve_response.rb +728 -54
  46. data/lib/orb/models/subscription_create_params.rb +5992 -1698
  47. data/lib/orb/models/subscription_create_response.rb +706 -54
  48. data/lib/orb/models/subscription_fetch_schedule_response.rb +3 -3
  49. data/lib/orb/models/subscription_price_intervals_params.rb +1392 -76
  50. data/lib/orb/models/subscription_price_intervals_response.rb +712 -54
  51. data/lib/orb/models/subscription_schedule_plan_change_params.rb +6005 -1723
  52. data/lib/orb/models/subscription_schedule_plan_change_response.rb +716 -54
  53. data/lib/orb/models/subscription_trigger_phase_response.rb +708 -54
  54. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +720 -54
  55. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +728 -54
  56. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +728 -54
  57. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +1 -1
  58. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +720 -54
  59. data/lib/orb/models/subscription_update_trial_response.rb +706 -54
  60. data/lib/orb/models/trial_discount.rb +10 -10
  61. data/lib/orb/models/usage_discount.rb +10 -10
  62. data/lib/orb/models.rb +16 -0
  63. data/lib/orb/resources/beta/external_plan_id.rb +113 -0
  64. data/lib/orb/resources/beta.rb +115 -0
  65. data/lib/orb/resources/credit_notes.rb +3 -3
  66. data/lib/orb/resources/customers/balance_transactions.rb +0 -7
  67. data/lib/orb/resources/customers.rb +4 -7
  68. data/lib/orb/resources/dimensional_price_groups.rb +1 -1
  69. data/lib/orb/resources/items.rb +34 -2
  70. data/lib/orb/resources/plans/external_plan_id.rb +1 -1
  71. data/lib/orb/resources/plans.rb +2 -2
  72. data/lib/orb/resources/prices.rb +69 -2
  73. data/lib/orb/resources/subscriptions.rb +5 -1
  74. data/lib/orb/version.rb +1 -1
  75. data/lib/orb.rb +13 -0
  76. data/rbi/orb/client.rbi +3 -0
  77. data/rbi/orb/models/alert.rbi +50 -3
  78. data/rbi/orb/models/amount_discount.rbi +8 -8
  79. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +32652 -0
  80. data/rbi/orb/models/beta/external_plan_id_fetch_plan_version_params.rbi +40 -0
  81. data/rbi/orb/models/beta/external_plan_id_set_default_plan_version_params.rbi +45 -0
  82. data/rbi/orb/models/beta_create_plan_version_params.rbi +32595 -0
  83. data/rbi/orb/models/beta_fetch_plan_version_params.rbi +35 -0
  84. data/rbi/orb/models/beta_set_default_plan_version_params.rbi +40 -0
  85. data/rbi/orb/models/credit_note_create_params.rbi +8 -8
  86. data/rbi/orb/models/customer_create_params.rbi +38 -4
  87. data/rbi/orb/models/customer_update_by_external_id_params.rbi +38 -4
  88. data/rbi/orb/models/customer_update_params.rbi +38 -4
  89. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +9 -1
  90. data/rbi/orb/models/customers/credits/ledger_create_entry_response.rbi +9 -1
  91. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +9 -1
  92. data/rbi/orb/models/customers/credits/ledger_list_response.rbi +9 -1
  93. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +2 -2
  94. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +2 -2
  95. data/rbi/orb/models/invoice.rbi +1451 -35
  96. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +1524 -4
  97. data/rbi/orb/models/invoice_line_item_create_response.rbi +1184 -2
  98. data/rbi/orb/models/item.rbi +20 -1
  99. data/rbi/orb/models/item_archive_params.rbi +25 -0
  100. data/rbi/orb/models/item_create_params.rbi +18 -1
  101. data/rbi/orb/models/item_update_params.rbi +17 -1
  102. data/rbi/orb/models/percentage_discount.rbi +10 -10
  103. data/rbi/orb/models/plan.rbi +1339 -4
  104. data/rbi/orb/models/plan_create_params.rbi +3833 -29
  105. data/rbi/orb/models/plan_version.rbi +1367 -0
  106. data/rbi/orb/models/plan_version_phase.rbi +99 -0
  107. data/rbi/orb/models/price.rbi +9447 -441
  108. data/rbi/orb/models/price_create_params.rbi +80 -0
  109. data/rbi/orb/models/price_evaluate_multiple_params.rbi +15764 -0
  110. data/rbi/orb/models/price_evaluate_multiple_response.rbi +96 -0
  111. data/rbi/orb/models/subscription.rbi +1654 -44
  112. data/rbi/orb/models/subscription_cancel_response.rbi +1692 -44
  113. data/rbi/orb/models/subscription_change_apply_response.rbi +1692 -44
  114. data/rbi/orb/models/subscription_change_cancel_response.rbi +1692 -44
  115. data/rbi/orb/models/subscription_change_retrieve_response.rbi +1692 -44
  116. data/rbi/orb/models/subscription_create_params.rbi +10400 -2710
  117. data/rbi/orb/models/subscription_create_response.rbi +1692 -44
  118. data/rbi/orb/models/subscription_fetch_schedule_response.rbi +13 -4
  119. data/rbi/orb/models/subscription_price_intervals_params.rbi +2401 -49
  120. data/rbi/orb/models/subscription_price_intervals_response.rbi +1692 -44
  121. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +10423 -2753
  122. data/rbi/orb/models/subscription_schedule_plan_change_response.rbi +1692 -44
  123. data/rbi/orb/models/subscription_trigger_phase_response.rbi +1692 -44
  124. data/rbi/orb/models/subscription_unschedule_cancellation_response.rbi +1692 -44
  125. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +1692 -44
  126. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +1692 -44
  127. data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +2 -2
  128. data/rbi/orb/models/subscription_update_fixed_fee_quantity_response.rbi +1692 -44
  129. data/rbi/orb/models/subscription_update_trial_response.rbi +1692 -44
  130. data/rbi/orb/models/trial_discount.rbi +8 -8
  131. data/rbi/orb/models/usage_discount.rbi +10 -10
  132. data/rbi/orb/models.rbi +16 -0
  133. data/rbi/orb/resources/beta/external_plan_id.rbi +118 -0
  134. data/rbi/orb/resources/beta.rbi +111 -0
  135. data/rbi/orb/resources/credit_notes.rbi +3 -3
  136. data/rbi/orb/resources/customers/balance_transactions.rbi +0 -7
  137. data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -2
  138. data/rbi/orb/resources/customers.rbi +7 -7
  139. data/rbi/orb/resources/dimensional_price_groups.rbi +1 -1
  140. data/rbi/orb/resources/items.rbi +20 -0
  141. data/rbi/orb/resources/plans/external_plan_id.rbi +1 -1
  142. data/rbi/orb/resources/plans.rbi +5 -2
  143. data/rbi/orb/resources/prices.rbi +73 -1
  144. data/rbi/orb/resources/subscriptions.rbi +9 -1
  145. data/sig/orb/client.rbs +2 -0
  146. data/sig/orb/models/alert.rbs +20 -3
  147. data/sig/orb/models/amount_discount.rbs +5 -5
  148. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +12898 -0
  149. data/sig/orb/models/beta/external_plan_id_fetch_plan_version_params.rbs +25 -0
  150. data/sig/orb/models/beta/external_plan_id_set_default_plan_version_params.rbs +25 -0
  151. data/sig/orb/models/beta_create_plan_version_params.rbs +12877 -0
  152. data/sig/orb/models/beta_fetch_plan_version_params.rbs +20 -0
  153. data/sig/orb/models/beta_set_default_plan_version_params.rbs +20 -0
  154. data/sig/orb/models/credit_note_create_params.rbs +6 -6
  155. data/sig/orb/models/customer_create_params.rbs +13 -0
  156. data/sig/orb/models/customer_update_by_external_id_params.rbs +13 -0
  157. data/sig/orb/models/customer_update_params.rbs +13 -0
  158. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs +7 -2
  159. data/sig/orb/models/customers/credits/ledger_create_entry_response.rbs +7 -2
  160. data/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs +7 -2
  161. data/sig/orb/models/customers/credits/ledger_list_response.rbs +7 -2
  162. data/sig/orb/models/invoice.rbs +558 -4
  163. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +558 -4
  164. data/sig/orb/models/invoice_line_item_create_response.rbs +414 -2
  165. data/sig/orb/models/item.rbs +5 -0
  166. data/sig/orb/models/item_archive_params.rbs +14 -0
  167. data/sig/orb/models/item_create_params.rbs +10 -2
  168. data/sig/orb/models/item_update_params.rbs +5 -0
  169. data/sig/orb/models/percentage_discount.rbs +5 -5
  170. data/sig/orb/models/plan.rbs +538 -4
  171. data/sig/orb/models/plan_create_params.rbs +1460 -3
  172. data/sig/orb/models/plan_version.rbs +583 -0
  173. data/sig/orb/models/plan_version_phase.rbs +60 -0
  174. data/sig/orb/models/price.rbs +3512 -96
  175. data/sig/orb/models/price_create_params.rbs +32 -0
  176. data/sig/orb/models/price_evaluate_multiple_params.rbs +6230 -0
  177. data/sig/orb/models/price_evaluate_multiple_response.rbs +50 -0
  178. data/sig/orb/models/subscription.rbs +609 -29
  179. data/sig/orb/models/subscription_cancel_response.rbs +609 -29
  180. data/sig/orb/models/subscription_change_apply_response.rbs +621 -29
  181. data/sig/orb/models/subscription_change_cancel_response.rbs +621 -29
  182. data/sig/orb/models/subscription_change_retrieve_response.rbs +621 -29
  183. data/sig/orb/models/subscription_create_params.rbs +4450 -1466
  184. data/sig/orb/models/subscription_create_response.rbs +609 -29
  185. data/sig/orb/models/subscription_fetch_schedule_response.rbs +4 -4
  186. data/sig/orb/models/subscription_price_intervals_params.rbs +920 -24
  187. data/sig/orb/models/subscription_price_intervals_response.rbs +609 -29
  188. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +4440 -1466
  189. data/sig/orb/models/subscription_schedule_plan_change_response.rbs +609 -29
  190. data/sig/orb/models/subscription_trigger_phase_response.rbs +609 -29
  191. data/sig/orb/models/subscription_unschedule_cancellation_response.rbs +609 -29
  192. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs +609 -29
  193. data/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs +609 -29
  194. data/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs +609 -29
  195. data/sig/orb/models/subscription_update_trial_response.rbs +609 -29
  196. data/sig/orb/models/trial_discount.rbs +5 -5
  197. data/sig/orb/models/usage_discount.rbs +5 -5
  198. data/sig/orb/models.rbs +16 -0
  199. data/sig/orb/resources/beta/external_plan_id.rbs +34 -0
  200. data/sig/orb/resources/beta.rbs +34 -0
  201. data/sig/orb/resources/credit_notes.rbs +1 -1
  202. data/sig/orb/resources/items.rbs +7 -0
  203. data/sig/orb/resources/prices.rbs +11 -0
  204. data/sig/orb/resources/subscriptions.rbs +2 -0
  205. metadata +40 -1
@@ -100,6 +100,8 @@ module Orb
100
100
  required :default_invoice_memo, String, nil?: true
101
101
 
102
102
  # @!attribute discount_intervals
103
+ # @deprecated
104
+ #
103
105
  # The discount intervals for this subscription sorted by the start_date.
104
106
  #
105
107
  # @return [Array<Orb::Models::Subscription::DiscountInterval::Amount, Orb::Models::Subscription::DiscountInterval::Percentage, Orb::Models::Subscription::DiscountInterval::Usage>]
@@ -124,6 +126,8 @@ module Orb
124
126
  required :invoicing_threshold, String, nil?: true
125
127
 
126
128
  # @!attribute maximum_intervals
129
+ # @deprecated
130
+ #
127
131
  # The maximum intervals for this subscription sorted by the start_date.
128
132
  #
129
133
  # @return [Array<Orb::Models::Subscription::MaximumInterval>]
@@ -139,11 +143,19 @@ module Orb
139
143
  required :metadata, Orb::Internal::Type::HashOf[String]
140
144
 
141
145
  # @!attribute minimum_intervals
146
+ # @deprecated
147
+ #
142
148
  # The minimum intervals for this subscription sorted by the start_date.
143
149
  #
144
150
  # @return [Array<Orb::Models::Subscription::MinimumInterval>]
145
151
  required :minimum_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::Subscription::MinimumInterval] }
146
152
 
153
+ # @!attribute name
154
+ # The name of the subscription.
155
+ #
156
+ # @return [String]
157
+ required :name, String
158
+
147
159
  # @!attribute net_terms
148
160
  # Determines the difference between the invoice issue date for subscription
149
161
  # invoices as the date that they are due. A value of `0` here represents that the
@@ -165,8 +177,8 @@ module Orb
165
177
  # subscription. You can see more about how to configure prices in the
166
178
  # [Price resource](/reference/price).
167
179
  #
168
- # @return [Orb::Models::Plan]
169
- required :plan, -> { Orb::Plan }
180
+ # @return [Orb::Models::Plan, nil]
181
+ required :plan, -> { Orb::Plan }, nil?: true
170
182
 
171
183
  # @!attribute price_intervals
172
184
  # The price intervals for this subscription.
@@ -195,7 +207,7 @@ module Orb
195
207
  # @return [Orb::Models::Subscription::TrialInfo]
196
208
  required :trial_info, -> { Orb::Subscription::TrialInfo }
197
209
 
198
- # @!method initialize(id:, active_plan_phase_order:, adjustment_intervals:, auto_collection:, billing_cycle_anchor_configuration:, billing_cycle_day:, created_at:, current_billing_period_end_date:, current_billing_period_start_date:, customer:, default_invoice_memo:, discount_intervals:, end_date:, fixed_fee_quantity_schedule:, invoicing_threshold:, maximum_intervals:, metadata:, minimum_intervals:, net_terms:, pending_subscription_change:, plan:, price_intervals:, redeemed_coupon:, start_date:, status:, trial_info:)
210
+ # @!method initialize(id:, active_plan_phase_order:, adjustment_intervals:, auto_collection:, billing_cycle_anchor_configuration:, billing_cycle_day:, created_at:, current_billing_period_end_date:, current_billing_period_start_date:, customer:, default_invoice_memo:, discount_intervals:, end_date:, fixed_fee_quantity_schedule:, invoicing_threshold:, maximum_intervals:, metadata:, minimum_intervals:, name:, net_terms:, pending_subscription_change:, plan:, price_intervals:, redeemed_coupon:, start_date:, status:, trial_info:)
199
211
  # Some parameter documentations has been truncated, see
200
212
  # {Orb::Models::Subscription} for more details.
201
213
  #
@@ -255,11 +267,13 @@ module Orb
255
267
  #
256
268
  # @param minimum_intervals [Array<Orb::Models::Subscription::MinimumInterval>] The minimum intervals for this subscription sorted by the start_date.
257
269
  #
270
+ # @param name [String] The name of the subscription.
271
+ #
258
272
  # @param net_terms [Integer] Determines the difference between the invoice issue date for subscription invoic
259
273
  #
260
274
  # @param pending_subscription_change [Orb::Models::Subscription::PendingSubscriptionChange, nil] A pending subscription change if one exists on this subscription.
261
275
  #
262
- # @param plan [Orb::Models::Plan] The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
276
+ # @param plan [Orb::Models::Plan, nil] The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
263
277
  #
264
278
  # @param price_intervals [Array<Orb::Models::Subscription::PriceInterval>] The price intervals for this subscription.
265
279
  #
@@ -342,11 +356,22 @@ module Orb
342
356
  required :adjustment_type, const: :usage_discount
343
357
 
344
358
  # @!attribute applies_to_price_ids
359
+ # @deprecated
360
+ #
345
361
  # The price IDs that this adjustment applies to.
346
362
  #
347
363
  # @return [Array<String>]
348
364
  required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
349
365
 
366
+ # @!attribute filters
367
+ # The filters that determine which prices to apply this adjustment to.
368
+ #
369
+ # @return [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter>]
370
+ required :filters,
371
+ -> {
372
+ Orb::Internal::Type::ArrayOf[Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter]
373
+ }
374
+
350
375
  # @!attribute is_invoice_level
351
376
  # True for adjustments that apply to an entire invocice, false for adjustments
352
377
  # that apply to only one price.
@@ -373,7 +398,7 @@ module Orb
373
398
  # @return [Float]
374
399
  required :usage_discount, Float
375
400
 
376
- # @!method initialize(id:, applies_to_price_ids:, is_invoice_level:, plan_phase_order:, reason:, usage_discount:, adjustment_type: :usage_discount)
401
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, plan_phase_order:, reason:, usage_discount:, adjustment_type: :usage_discount)
377
402
  # Some parameter documentations has been truncated, see
378
403
  # {Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount} for
379
404
  # more details.
@@ -382,6 +407,8 @@ module Orb
382
407
  #
383
408
  # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
384
409
  #
410
+ # @param filters [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
411
+ #
385
412
  # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
386
413
  #
387
414
  # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
@@ -391,6 +418,68 @@ module Orb
391
418
  # @param usage_discount [Float] The number of usage units by which to discount the price this adjustment applies
392
419
  #
393
420
  # @param adjustment_type [Symbol, :usage_discount]
421
+
422
+ class Filter < Orb::Internal::Type::BaseModel
423
+ # @!attribute field
424
+ # The property of the price to filter on.
425
+ #
426
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field]
427
+ required :field,
428
+ enum: -> {
429
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field
430
+ }
431
+
432
+ # @!attribute operator
433
+ # Should prices that match the filter be included or excluded.
434
+ #
435
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator]
436
+ required :operator,
437
+ enum: -> {
438
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator
439
+ }
440
+
441
+ # @!attribute values
442
+ # The IDs or values that match this filter.
443
+ #
444
+ # @return [Array<String>]
445
+ required :values, Orb::Internal::Type::ArrayOf[String]
446
+
447
+ # @!method initialize(field:, operator:, values:)
448
+ # @param field [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field] The property of the price to filter on.
449
+ #
450
+ # @param operator [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
451
+ #
452
+ # @param values [Array<String>] The IDs or values that match this filter.
453
+
454
+ # The property of the price to filter on.
455
+ #
456
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter#field
457
+ module Field
458
+ extend Orb::Internal::Type::Enum
459
+
460
+ PRICE_ID = :price_id
461
+ ITEM_ID = :item_id
462
+ PRICE_TYPE = :price_type
463
+ CURRENCY = :currency
464
+ PRICING_UNIT_ID = :pricing_unit_id
465
+
466
+ # @!method self.values
467
+ # @return [Array<Symbol>]
468
+ end
469
+
470
+ # Should prices that match the filter be included or excluded.
471
+ #
472
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter#operator
473
+ module Operator
474
+ extend Orb::Internal::Type::Enum
475
+
476
+ INCLUDES = :includes
477
+ EXCLUDES = :excludes
478
+
479
+ # @!method self.values
480
+ # @return [Array<Symbol>]
481
+ end
482
+ end
394
483
  end
395
484
 
396
485
  class AmountDiscount < Orb::Internal::Type::BaseModel
@@ -412,11 +501,22 @@ module Orb
412
501
  required :amount_discount, String
413
502
 
414
503
  # @!attribute applies_to_price_ids
504
+ # @deprecated
505
+ #
415
506
  # The price IDs that this adjustment applies to.
416
507
  #
417
508
  # @return [Array<String>]
418
509
  required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
419
510
 
511
+ # @!attribute filters
512
+ # The filters that determine which prices to apply this adjustment to.
513
+ #
514
+ # @return [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter>]
515
+ required :filters,
516
+ -> {
517
+ Orb::Internal::Type::ArrayOf[Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter]
518
+ }
519
+
420
520
  # @!attribute is_invoice_level
421
521
  # True for adjustments that apply to an entire invocice, false for adjustments
422
522
  # that apply to only one price.
@@ -436,7 +536,7 @@ module Orb
436
536
  # @return [String, nil]
437
537
  required :reason, String, nil?: true
438
538
 
439
- # @!method initialize(id:, amount_discount:, applies_to_price_ids:, is_invoice_level:, plan_phase_order:, reason:, adjustment_type: :amount_discount)
539
+ # @!method initialize(id:, amount_discount:, applies_to_price_ids:, filters:, is_invoice_level:, plan_phase_order:, reason:, adjustment_type: :amount_discount)
440
540
  # Some parameter documentations has been truncated, see
441
541
  # {Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount} for
442
542
  # more details.
@@ -447,6 +547,8 @@ module Orb
447
547
  #
448
548
  # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
449
549
  #
550
+ # @param filters [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
551
+ #
450
552
  # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
451
553
  #
452
554
  # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
@@ -454,6 +556,68 @@ module Orb
454
556
  # @param reason [String, nil] The reason for the adjustment.
455
557
  #
456
558
  # @param adjustment_type [Symbol, :amount_discount]
559
+
560
+ class Filter < Orb::Internal::Type::BaseModel
561
+ # @!attribute field
562
+ # The property of the price to filter on.
563
+ #
564
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field]
565
+ required :field,
566
+ enum: -> {
567
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field
568
+ }
569
+
570
+ # @!attribute operator
571
+ # Should prices that match the filter be included or excluded.
572
+ #
573
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator]
574
+ required :operator,
575
+ enum: -> {
576
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator
577
+ }
578
+
579
+ # @!attribute values
580
+ # The IDs or values that match this filter.
581
+ #
582
+ # @return [Array<String>]
583
+ required :values, Orb::Internal::Type::ArrayOf[String]
584
+
585
+ # @!method initialize(field:, operator:, values:)
586
+ # @param field [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field] The property of the price to filter on.
587
+ #
588
+ # @param operator [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
589
+ #
590
+ # @param values [Array<String>] The IDs or values that match this filter.
591
+
592
+ # The property of the price to filter on.
593
+ #
594
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter#field
595
+ module Field
596
+ extend Orb::Internal::Type::Enum
597
+
598
+ PRICE_ID = :price_id
599
+ ITEM_ID = :item_id
600
+ PRICE_TYPE = :price_type
601
+ CURRENCY = :currency
602
+ PRICING_UNIT_ID = :pricing_unit_id
603
+
604
+ # @!method self.values
605
+ # @return [Array<Symbol>]
606
+ end
607
+
608
+ # Should prices that match the filter be included or excluded.
609
+ #
610
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter#operator
611
+ module Operator
612
+ extend Orb::Internal::Type::Enum
613
+
614
+ INCLUDES = :includes
615
+ EXCLUDES = :excludes
616
+
617
+ # @!method self.values
618
+ # @return [Array<Symbol>]
619
+ end
620
+ end
457
621
  end
458
622
 
459
623
  class PercentageDiscount < Orb::Internal::Type::BaseModel
@@ -468,11 +632,22 @@ module Orb
468
632
  required :adjustment_type, const: :percentage_discount
469
633
 
470
634
  # @!attribute applies_to_price_ids
635
+ # @deprecated
636
+ #
471
637
  # The price IDs that this adjustment applies to.
472
638
  #
473
639
  # @return [Array<String>]
474
640
  required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
475
641
 
642
+ # @!attribute filters
643
+ # The filters that determine which prices to apply this adjustment to.
644
+ #
645
+ # @return [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter>]
646
+ required :filters,
647
+ -> {
648
+ Orb::Internal::Type::ArrayOf[Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter]
649
+ }
650
+
476
651
  # @!attribute is_invoice_level
477
652
  # True for adjustments that apply to an entire invocice, false for adjustments
478
653
  # that apply to only one price.
@@ -499,7 +674,7 @@ module Orb
499
674
  # @return [String, nil]
500
675
  required :reason, String, nil?: true
501
676
 
502
- # @!method initialize(id:, applies_to_price_ids:, is_invoice_level:, percentage_discount:, plan_phase_order:, reason:, adjustment_type: :percentage_discount)
677
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, percentage_discount:, plan_phase_order:, reason:, adjustment_type: :percentage_discount)
503
678
  # Some parameter documentations has been truncated, see
504
679
  # {Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount}
505
680
  # for more details.
@@ -508,6 +683,8 @@ module Orb
508
683
  #
509
684
  # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
510
685
  #
686
+ # @param filters [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
687
+ #
511
688
  # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
512
689
  #
513
690
  # @param percentage_discount [Float] The percentage (as a value between 0 and 1) by which to discount the price inter
@@ -517,6 +694,68 @@ module Orb
517
694
  # @param reason [String, nil] The reason for the adjustment.
518
695
  #
519
696
  # @param adjustment_type [Symbol, :percentage_discount]
697
+
698
+ class Filter < Orb::Internal::Type::BaseModel
699
+ # @!attribute field
700
+ # The property of the price to filter on.
701
+ #
702
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field]
703
+ required :field,
704
+ enum: -> {
705
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field
706
+ }
707
+
708
+ # @!attribute operator
709
+ # Should prices that match the filter be included or excluded.
710
+ #
711
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator]
712
+ required :operator,
713
+ enum: -> {
714
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator
715
+ }
716
+
717
+ # @!attribute values
718
+ # The IDs or values that match this filter.
719
+ #
720
+ # @return [Array<String>]
721
+ required :values, Orb::Internal::Type::ArrayOf[String]
722
+
723
+ # @!method initialize(field:, operator:, values:)
724
+ # @param field [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field] The property of the price to filter on.
725
+ #
726
+ # @param operator [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
727
+ #
728
+ # @param values [Array<String>] The IDs or values that match this filter.
729
+
730
+ # The property of the price to filter on.
731
+ #
732
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter#field
733
+ module Field
734
+ extend Orb::Internal::Type::Enum
735
+
736
+ PRICE_ID = :price_id
737
+ ITEM_ID = :item_id
738
+ PRICE_TYPE = :price_type
739
+ CURRENCY = :currency
740
+ PRICING_UNIT_ID = :pricing_unit_id
741
+
742
+ # @!method self.values
743
+ # @return [Array<Symbol>]
744
+ end
745
+
746
+ # Should prices that match the filter be included or excluded.
747
+ #
748
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter#operator
749
+ module Operator
750
+ extend Orb::Internal::Type::Enum
751
+
752
+ INCLUDES = :includes
753
+ EXCLUDES = :excludes
754
+
755
+ # @!method self.values
756
+ # @return [Array<Symbol>]
757
+ end
758
+ end
520
759
  end
521
760
 
522
761
  class Minimum < Orb::Internal::Type::BaseModel
@@ -531,11 +770,22 @@ module Orb
531
770
  required :adjustment_type, const: :minimum
532
771
 
533
772
  # @!attribute applies_to_price_ids
773
+ # @deprecated
774
+ #
534
775
  # The price IDs that this adjustment applies to.
535
776
  #
536
777
  # @return [Array<String>]
537
778
  required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
538
779
 
780
+ # @!attribute filters
781
+ # The filters that determine which prices to apply this adjustment to.
782
+ #
783
+ # @return [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter>]
784
+ required :filters,
785
+ -> {
786
+ Orb::Internal::Type::ArrayOf[Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter]
787
+ }
788
+
539
789
  # @!attribute is_invoice_level
540
790
  # True for adjustments that apply to an entire invocice, false for adjustments
541
791
  # that apply to only one price.
@@ -568,7 +818,7 @@ module Orb
568
818
  # @return [String, nil]
569
819
  required :reason, String, nil?: true
570
820
 
571
- # @!method initialize(id:, applies_to_price_ids:, is_invoice_level:, item_id:, minimum_amount:, plan_phase_order:, reason:, adjustment_type: :minimum)
821
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, item_id:, minimum_amount:, plan_phase_order:, reason:, adjustment_type: :minimum)
572
822
  # Some parameter documentations has been truncated, see
573
823
  # {Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum} for more
574
824
  # details.
@@ -577,6 +827,8 @@ module Orb
577
827
  #
578
828
  # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
579
829
  #
830
+ # @param filters [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter>] The filters that determine which prices to apply this adjustment to.
831
+ #
580
832
  # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
581
833
  #
582
834
  # @param item_id [String] The item ID that revenue from this minimum will be attributed to.
@@ -588,6 +840,68 @@ module Orb
588
840
  # @param reason [String, nil] The reason for the adjustment.
589
841
  #
590
842
  # @param adjustment_type [Symbol, :minimum]
843
+
844
+ class Filter < Orb::Internal::Type::BaseModel
845
+ # @!attribute field
846
+ # The property of the price to filter on.
847
+ #
848
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field]
849
+ required :field,
850
+ enum: -> {
851
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field
852
+ }
853
+
854
+ # @!attribute operator
855
+ # Should prices that match the filter be included or excluded.
856
+ #
857
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator]
858
+ required :operator,
859
+ enum: -> {
860
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator
861
+ }
862
+
863
+ # @!attribute values
864
+ # The IDs or values that match this filter.
865
+ #
866
+ # @return [Array<String>]
867
+ required :values, Orb::Internal::Type::ArrayOf[String]
868
+
869
+ # @!method initialize(field:, operator:, values:)
870
+ # @param field [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field] The property of the price to filter on.
871
+ #
872
+ # @param operator [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator] Should prices that match the filter be included or excluded.
873
+ #
874
+ # @param values [Array<String>] The IDs or values that match this filter.
875
+
876
+ # The property of the price to filter on.
877
+ #
878
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter#field
879
+ module Field
880
+ extend Orb::Internal::Type::Enum
881
+
882
+ PRICE_ID = :price_id
883
+ ITEM_ID = :item_id
884
+ PRICE_TYPE = :price_type
885
+ CURRENCY = :currency
886
+ PRICING_UNIT_ID = :pricing_unit_id
887
+
888
+ # @!method self.values
889
+ # @return [Array<Symbol>]
890
+ end
891
+
892
+ # Should prices that match the filter be included or excluded.
893
+ #
894
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter#operator
895
+ module Operator
896
+ extend Orb::Internal::Type::Enum
897
+
898
+ INCLUDES = :includes
899
+ EXCLUDES = :excludes
900
+
901
+ # @!method self.values
902
+ # @return [Array<Symbol>]
903
+ end
904
+ end
591
905
  end
592
906
 
593
907
  class Maximum < Orb::Internal::Type::BaseModel
@@ -602,11 +916,22 @@ module Orb
602
916
  required :adjustment_type, const: :maximum
603
917
 
604
918
  # @!attribute applies_to_price_ids
919
+ # @deprecated
920
+ #
605
921
  # The price IDs that this adjustment applies to.
606
922
  #
607
923
  # @return [Array<String>]
608
924
  required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
609
925
 
926
+ # @!attribute filters
927
+ # The filters that determine which prices to apply this adjustment to.
928
+ #
929
+ # @return [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter>]
930
+ required :filters,
931
+ -> {
932
+ Orb::Internal::Type::ArrayOf[Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter]
933
+ }
934
+
610
935
  # @!attribute is_invoice_level
611
936
  # True for adjustments that apply to an entire invocice, false for adjustments
612
937
  # that apply to only one price.
@@ -633,7 +958,7 @@ module Orb
633
958
  # @return [String, nil]
634
959
  required :reason, String, nil?: true
635
960
 
636
- # @!method initialize(id:, applies_to_price_ids:, is_invoice_level:, maximum_amount:, plan_phase_order:, reason:, adjustment_type: :maximum)
961
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, maximum_amount:, plan_phase_order:, reason:, adjustment_type: :maximum)
637
962
  # Some parameter documentations has been truncated, see
638
963
  # {Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum} for more
639
964
  # details.
@@ -642,6 +967,8 @@ module Orb
642
967
  #
643
968
  # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
644
969
  #
970
+ # @param filters [Array<Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter>] The filters that determine which prices to apply this adjustment to.
971
+ #
645
972
  # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
646
973
  #
647
974
  # @param maximum_amount [String] The maximum amount to charge in a given billing period for the prices this adjus
@@ -651,6 +978,68 @@ module Orb
651
978
  # @param reason [String, nil] The reason for the adjustment.
652
979
  #
653
980
  # @param adjustment_type [Symbol, :maximum]
981
+
982
+ class Filter < Orb::Internal::Type::BaseModel
983
+ # @!attribute field
984
+ # The property of the price to filter on.
985
+ #
986
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field]
987
+ required :field,
988
+ enum: -> {
989
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field
990
+ }
991
+
992
+ # @!attribute operator
993
+ # Should prices that match the filter be included or excluded.
994
+ #
995
+ # @return [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator]
996
+ required :operator,
997
+ enum: -> {
998
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator
999
+ }
1000
+
1001
+ # @!attribute values
1002
+ # The IDs or values that match this filter.
1003
+ #
1004
+ # @return [Array<String>]
1005
+ required :values, Orb::Internal::Type::ArrayOf[String]
1006
+
1007
+ # @!method initialize(field:, operator:, values:)
1008
+ # @param field [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field] The property of the price to filter on.
1009
+ #
1010
+ # @param operator [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator] Should prices that match the filter be included or excluded.
1011
+ #
1012
+ # @param values [Array<String>] The IDs or values that match this filter.
1013
+
1014
+ # The property of the price to filter on.
1015
+ #
1016
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter#field
1017
+ module Field
1018
+ extend Orb::Internal::Type::Enum
1019
+
1020
+ PRICE_ID = :price_id
1021
+ ITEM_ID = :item_id
1022
+ PRICE_TYPE = :price_type
1023
+ CURRENCY = :currency
1024
+ PRICING_UNIT_ID = :pricing_unit_id
1025
+
1026
+ # @!method self.values
1027
+ # @return [Array<Symbol>]
1028
+ end
1029
+
1030
+ # Should prices that match the filter be included or excluded.
1031
+ #
1032
+ # @see Orb::Models::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter#operator
1033
+ module Operator
1034
+ extend Orb::Internal::Type::Enum
1035
+
1036
+ INCLUDES = :includes
1037
+ EXCLUDES = :excludes
1038
+
1039
+ # @!method self.values
1040
+ # @return [Array<Symbol>]
1041
+ end
1042
+ end
654
1043
  end
655
1044
 
656
1045
  # @!method self.variants
@@ -713,12 +1102,6 @@ module Orb
713
1102
  # @return [String]
714
1103
  required :amount_discount, String
715
1104
 
716
- # @!attribute applies_to_price_ids
717
- # The price ids that this discount interval applies to.
718
- #
719
- # @return [Array<String>]
720
- required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
721
-
722
1105
  # @!attribute applies_to_price_interval_ids
723
1106
  # The price interval ids that this discount interval applies to.
724
1107
  #
@@ -736,33 +1119,90 @@ module Orb
736
1119
  # @return [Time, nil]
737
1120
  required :end_date, Time, nil?: true
738
1121
 
1122
+ # @!attribute filters
1123
+ # The filters that determine which prices this discount interval applies to.
1124
+ #
1125
+ # @return [Array<Orb::Models::Subscription::DiscountInterval::Amount::Filter>]
1126
+ required :filters,
1127
+ -> { Orb::Internal::Type::ArrayOf[Orb::Subscription::DiscountInterval::Amount::Filter] }
1128
+
739
1129
  # @!attribute start_date
740
1130
  # The start date of the discount interval.
741
1131
  #
742
1132
  # @return [Time]
743
1133
  required :start_date, Time
744
1134
 
745
- # @!method initialize(amount_discount:, applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, start_date:, discount_type: :amount)
1135
+ # @!method initialize(amount_discount:, applies_to_price_interval_ids:, end_date:, filters:, start_date:, discount_type: :amount)
746
1136
  # @param amount_discount [String] Only available if discount_type is `amount`.
747
1137
  #
748
- # @param applies_to_price_ids [Array<String>] The price ids that this discount interval applies to.
749
- #
750
1138
  # @param applies_to_price_interval_ids [Array<String>] The price interval ids that this discount interval applies to.
751
1139
  #
752
1140
  # @param end_date [Time, nil] The end date of the discount interval.
753
1141
  #
1142
+ # @param filters [Array<Orb::Models::Subscription::DiscountInterval::Amount::Filter>] The filters that determine which prices this discount interval applies to.
1143
+ #
754
1144
  # @param start_date [Time] The start date of the discount interval.
755
1145
  #
756
1146
  # @param discount_type [Symbol, :amount]
1147
+
1148
+ class Filter < Orb::Internal::Type::BaseModel
1149
+ # @!attribute field
1150
+ # The property of the price to filter on.
1151
+ #
1152
+ # @return [Symbol, Orb::Models::Subscription::DiscountInterval::Amount::Filter::Field]
1153
+ required :field, enum: -> { Orb::Subscription::DiscountInterval::Amount::Filter::Field }
1154
+
1155
+ # @!attribute operator
1156
+ # Should prices that match the filter be included or excluded.
1157
+ #
1158
+ # @return [Symbol, Orb::Models::Subscription::DiscountInterval::Amount::Filter::Operator]
1159
+ required :operator, enum: -> { Orb::Subscription::DiscountInterval::Amount::Filter::Operator }
1160
+
1161
+ # @!attribute values
1162
+ # The IDs or values that match this filter.
1163
+ #
1164
+ # @return [Array<String>]
1165
+ required :values, Orb::Internal::Type::ArrayOf[String]
1166
+
1167
+ # @!method initialize(field:, operator:, values:)
1168
+ # @param field [Symbol, Orb::Models::Subscription::DiscountInterval::Amount::Filter::Field] The property of the price to filter on.
1169
+ #
1170
+ # @param operator [Symbol, Orb::Models::Subscription::DiscountInterval::Amount::Filter::Operator] Should prices that match the filter be included or excluded.
1171
+ #
1172
+ # @param values [Array<String>] The IDs or values that match this filter.
1173
+
1174
+ # The property of the price to filter on.
1175
+ #
1176
+ # @see Orb::Models::Subscription::DiscountInterval::Amount::Filter#field
1177
+ module Field
1178
+ extend Orb::Internal::Type::Enum
1179
+
1180
+ PRICE_ID = :price_id
1181
+ ITEM_ID = :item_id
1182
+ PRICE_TYPE = :price_type
1183
+ CURRENCY = :currency
1184
+ PRICING_UNIT_ID = :pricing_unit_id
1185
+
1186
+ # @!method self.values
1187
+ # @return [Array<Symbol>]
1188
+ end
1189
+
1190
+ # Should prices that match the filter be included or excluded.
1191
+ #
1192
+ # @see Orb::Models::Subscription::DiscountInterval::Amount::Filter#operator
1193
+ module Operator
1194
+ extend Orb::Internal::Type::Enum
1195
+
1196
+ INCLUDES = :includes
1197
+ EXCLUDES = :excludes
1198
+
1199
+ # @!method self.values
1200
+ # @return [Array<Symbol>]
1201
+ end
1202
+ end
757
1203
  end
758
1204
 
759
1205
  class Percentage < Orb::Internal::Type::BaseModel
760
- # @!attribute applies_to_price_ids
761
- # The price ids that this discount interval applies to.
762
- #
763
- # @return [Array<String>]
764
- required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
765
-
766
1206
  # @!attribute applies_to_price_interval_ids
767
1207
  # The price interval ids that this discount interval applies to.
768
1208
  #
@@ -780,6 +1220,15 @@ module Orb
780
1220
  # @return [Time, nil]
781
1221
  required :end_date, Time, nil?: true
782
1222
 
1223
+ # @!attribute filters
1224
+ # The filters that determine which prices this discount interval applies to.
1225
+ #
1226
+ # @return [Array<Orb::Models::Subscription::DiscountInterval::Percentage::Filter>]
1227
+ required :filters,
1228
+ -> {
1229
+ Orb::Internal::Type::ArrayOf[Orb::Subscription::DiscountInterval::Percentage::Filter]
1230
+ }
1231
+
783
1232
  # @!attribute percentage_discount
784
1233
  # Only available if discount_type is `percentage`.This is a number between 0
785
1234
  # and 1.
@@ -793,30 +1242,80 @@ module Orb
793
1242
  # @return [Time]
794
1243
  required :start_date, Time
795
1244
 
796
- # @!method initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, percentage_discount:, start_date:, discount_type: :percentage)
1245
+ # @!method initialize(applies_to_price_interval_ids:, end_date:, filters:, percentage_discount:, start_date:, discount_type: :percentage)
797
1246
  # Some parameter documentations has been truncated, see
798
1247
  # {Orb::Models::Subscription::DiscountInterval::Percentage} for more details.
799
1248
  #
800
- # @param applies_to_price_ids [Array<String>] The price ids that this discount interval applies to.
801
- #
802
1249
  # @param applies_to_price_interval_ids [Array<String>] The price interval ids that this discount interval applies to.
803
1250
  #
804
1251
  # @param end_date [Time, nil] The end date of the discount interval.
805
1252
  #
1253
+ # @param filters [Array<Orb::Models::Subscription::DiscountInterval::Percentage::Filter>] The filters that determine which prices this discount interval applies to.
1254
+ #
806
1255
  # @param percentage_discount [Float] Only available if discount_type is `percentage`.This is a number between 0 and 1
807
1256
  #
808
1257
  # @param start_date [Time] The start date of the discount interval.
809
1258
  #
810
1259
  # @param discount_type [Symbol, :percentage]
1260
+
1261
+ class Filter < Orb::Internal::Type::BaseModel
1262
+ # @!attribute field
1263
+ # The property of the price to filter on.
1264
+ #
1265
+ # @return [Symbol, Orb::Models::Subscription::DiscountInterval::Percentage::Filter::Field]
1266
+ required :field, enum: -> { Orb::Subscription::DiscountInterval::Percentage::Filter::Field }
1267
+
1268
+ # @!attribute operator
1269
+ # Should prices that match the filter be included or excluded.
1270
+ #
1271
+ # @return [Symbol, Orb::Models::Subscription::DiscountInterval::Percentage::Filter::Operator]
1272
+ required :operator, enum: -> { Orb::Subscription::DiscountInterval::Percentage::Filter::Operator }
1273
+
1274
+ # @!attribute values
1275
+ # The IDs or values that match this filter.
1276
+ #
1277
+ # @return [Array<String>]
1278
+ required :values, Orb::Internal::Type::ArrayOf[String]
1279
+
1280
+ # @!method initialize(field:, operator:, values:)
1281
+ # @param field [Symbol, Orb::Models::Subscription::DiscountInterval::Percentage::Filter::Field] The property of the price to filter on.
1282
+ #
1283
+ # @param operator [Symbol, Orb::Models::Subscription::DiscountInterval::Percentage::Filter::Operator] Should prices that match the filter be included or excluded.
1284
+ #
1285
+ # @param values [Array<String>] The IDs or values that match this filter.
1286
+
1287
+ # The property of the price to filter on.
1288
+ #
1289
+ # @see Orb::Models::Subscription::DiscountInterval::Percentage::Filter#field
1290
+ module Field
1291
+ extend Orb::Internal::Type::Enum
1292
+
1293
+ PRICE_ID = :price_id
1294
+ ITEM_ID = :item_id
1295
+ PRICE_TYPE = :price_type
1296
+ CURRENCY = :currency
1297
+ PRICING_UNIT_ID = :pricing_unit_id
1298
+
1299
+ # @!method self.values
1300
+ # @return [Array<Symbol>]
1301
+ end
1302
+
1303
+ # Should prices that match the filter be included or excluded.
1304
+ #
1305
+ # @see Orb::Models::Subscription::DiscountInterval::Percentage::Filter#operator
1306
+ module Operator
1307
+ extend Orb::Internal::Type::Enum
1308
+
1309
+ INCLUDES = :includes
1310
+ EXCLUDES = :excludes
1311
+
1312
+ # @!method self.values
1313
+ # @return [Array<Symbol>]
1314
+ end
1315
+ end
811
1316
  end
812
1317
 
813
1318
  class Usage < Orb::Internal::Type::BaseModel
814
- # @!attribute applies_to_price_ids
815
- # The price ids that this discount interval applies to.
816
- #
817
- # @return [Array<String>]
818
- required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
819
-
820
1319
  # @!attribute applies_to_price_interval_ids
821
1320
  # The price interval ids that this discount interval applies to.
822
1321
  #
@@ -834,6 +1333,15 @@ module Orb
834
1333
  # @return [Time, nil]
835
1334
  required :end_date, Time, nil?: true
836
1335
 
1336
+ # @!attribute filters
1337
+ # The filters that determine which prices this discount interval applies to.
1338
+ #
1339
+ # @return [Array<Orb::Models::Subscription::DiscountInterval::Usage::Filter>]
1340
+ required :filters,
1341
+ -> {
1342
+ Orb::Internal::Type::ArrayOf[Orb::Subscription::DiscountInterval::Usage::Filter]
1343
+ }
1344
+
837
1345
  # @!attribute start_date
838
1346
  # The start date of the discount interval.
839
1347
  #
@@ -847,21 +1355,77 @@ module Orb
847
1355
  # @return [Float]
848
1356
  required :usage_discount, Float
849
1357
 
850
- # @!method initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, start_date:, usage_discount:, discount_type: :usage)
1358
+ # @!method initialize(applies_to_price_interval_ids:, end_date:, filters:, start_date:, usage_discount:, discount_type: :usage)
851
1359
  # Some parameter documentations has been truncated, see
852
1360
  # {Orb::Models::Subscription::DiscountInterval::Usage} for more details.
853
1361
  #
854
- # @param applies_to_price_ids [Array<String>] The price ids that this discount interval applies to.
855
- #
856
1362
  # @param applies_to_price_interval_ids [Array<String>] The price interval ids that this discount interval applies to.
857
1363
  #
858
1364
  # @param end_date [Time, nil] The end date of the discount interval.
859
1365
  #
1366
+ # @param filters [Array<Orb::Models::Subscription::DiscountInterval::Usage::Filter>] The filters that determine which prices this discount interval applies to.
1367
+ #
860
1368
  # @param start_date [Time] The start date of the discount interval.
861
1369
  #
862
1370
  # @param usage_discount [Float] Only available if discount_type is `usage`. Number of usage units that this disc
863
1371
  #
864
1372
  # @param discount_type [Symbol, :usage]
1373
+
1374
+ class Filter < Orb::Internal::Type::BaseModel
1375
+ # @!attribute field
1376
+ # The property of the price to filter on.
1377
+ #
1378
+ # @return [Symbol, Orb::Models::Subscription::DiscountInterval::Usage::Filter::Field]
1379
+ required :field, enum: -> { Orb::Subscription::DiscountInterval::Usage::Filter::Field }
1380
+
1381
+ # @!attribute operator
1382
+ # Should prices that match the filter be included or excluded.
1383
+ #
1384
+ # @return [Symbol, Orb::Models::Subscription::DiscountInterval::Usage::Filter::Operator]
1385
+ required :operator, enum: -> { Orb::Subscription::DiscountInterval::Usage::Filter::Operator }
1386
+
1387
+ # @!attribute values
1388
+ # The IDs or values that match this filter.
1389
+ #
1390
+ # @return [Array<String>]
1391
+ required :values, Orb::Internal::Type::ArrayOf[String]
1392
+
1393
+ # @!method initialize(field:, operator:, values:)
1394
+ # @param field [Symbol, Orb::Models::Subscription::DiscountInterval::Usage::Filter::Field] The property of the price to filter on.
1395
+ #
1396
+ # @param operator [Symbol, Orb::Models::Subscription::DiscountInterval::Usage::Filter::Operator] Should prices that match the filter be included or excluded.
1397
+ #
1398
+ # @param values [Array<String>] The IDs or values that match this filter.
1399
+
1400
+ # The property of the price to filter on.
1401
+ #
1402
+ # @see Orb::Models::Subscription::DiscountInterval::Usage::Filter#field
1403
+ module Field
1404
+ extend Orb::Internal::Type::Enum
1405
+
1406
+ PRICE_ID = :price_id
1407
+ ITEM_ID = :item_id
1408
+ PRICE_TYPE = :price_type
1409
+ CURRENCY = :currency
1410
+ PRICING_UNIT_ID = :pricing_unit_id
1411
+
1412
+ # @!method self.values
1413
+ # @return [Array<Symbol>]
1414
+ end
1415
+
1416
+ # Should prices that match the filter be included or excluded.
1417
+ #
1418
+ # @see Orb::Models::Subscription::DiscountInterval::Usage::Filter#operator
1419
+ module Operator
1420
+ extend Orb::Internal::Type::Enum
1421
+
1422
+ INCLUDES = :includes
1423
+ EXCLUDES = :excludes
1424
+
1425
+ # @!method self.values
1426
+ # @return [Array<Symbol>]
1427
+ end
1428
+ end
865
1429
  end
866
1430
 
867
1431
  # @!method self.variants
@@ -897,12 +1461,6 @@ module Orb
897
1461
  end
898
1462
 
899
1463
  class MaximumInterval < Orb::Internal::Type::BaseModel
900
- # @!attribute applies_to_price_ids
901
- # The price ids that this maximum interval applies to.
902
- #
903
- # @return [Array<String>]
904
- required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
905
-
906
1464
  # @!attribute applies_to_price_interval_ids
907
1465
  # The price interval ids that this maximum interval applies to.
908
1466
  #
@@ -915,6 +1473,12 @@ module Orb
915
1473
  # @return [Time, nil]
916
1474
  required :end_date, Time, nil?: true
917
1475
 
1476
+ # @!attribute filters
1477
+ # The filters that determine which prices this maximum interval applies to.
1478
+ #
1479
+ # @return [Array<Orb::Models::Subscription::MaximumInterval::Filter>]
1480
+ required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::Subscription::MaximumInterval::Filter] }
1481
+
918
1482
  # @!attribute maximum_amount
919
1483
  # The maximum amount to charge in a given billing period for the price intervals
920
1484
  # this transform applies to.
@@ -928,28 +1492,78 @@ module Orb
928
1492
  # @return [Time]
929
1493
  required :start_date, Time
930
1494
 
931
- # @!method initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:)
1495
+ # @!method initialize(applies_to_price_interval_ids:, end_date:, filters:, maximum_amount:, start_date:)
932
1496
  # Some parameter documentations has been truncated, see
933
1497
  # {Orb::Models::Subscription::MaximumInterval} for more details.
934
1498
  #
935
- # @param applies_to_price_ids [Array<String>] The price ids that this maximum interval applies to.
936
- #
937
1499
  # @param applies_to_price_interval_ids [Array<String>] The price interval ids that this maximum interval applies to.
938
1500
  #
939
1501
  # @param end_date [Time, nil] The end date of the maximum interval.
940
1502
  #
1503
+ # @param filters [Array<Orb::Models::Subscription::MaximumInterval::Filter>] The filters that determine which prices this maximum interval applies to.
1504
+ #
941
1505
  # @param maximum_amount [String] The maximum amount to charge in a given billing period for the price intervals t
942
1506
  #
943
1507
  # @param start_date [Time] The start date of the maximum interval.
1508
+
1509
+ class Filter < Orb::Internal::Type::BaseModel
1510
+ # @!attribute field
1511
+ # The property of the price to filter on.
1512
+ #
1513
+ # @return [Symbol, Orb::Models::Subscription::MaximumInterval::Filter::Field]
1514
+ required :field, enum: -> { Orb::Subscription::MaximumInterval::Filter::Field }
1515
+
1516
+ # @!attribute operator
1517
+ # Should prices that match the filter be included or excluded.
1518
+ #
1519
+ # @return [Symbol, Orb::Models::Subscription::MaximumInterval::Filter::Operator]
1520
+ required :operator, enum: -> { Orb::Subscription::MaximumInterval::Filter::Operator }
1521
+
1522
+ # @!attribute values
1523
+ # The IDs or values that match this filter.
1524
+ #
1525
+ # @return [Array<String>]
1526
+ required :values, Orb::Internal::Type::ArrayOf[String]
1527
+
1528
+ # @!method initialize(field:, operator:, values:)
1529
+ # @param field [Symbol, Orb::Models::Subscription::MaximumInterval::Filter::Field] The property of the price to filter on.
1530
+ #
1531
+ # @param operator [Symbol, Orb::Models::Subscription::MaximumInterval::Filter::Operator] Should prices that match the filter be included or excluded.
1532
+ #
1533
+ # @param values [Array<String>] The IDs or values that match this filter.
1534
+
1535
+ # The property of the price to filter on.
1536
+ #
1537
+ # @see Orb::Models::Subscription::MaximumInterval::Filter#field
1538
+ module Field
1539
+ extend Orb::Internal::Type::Enum
1540
+
1541
+ PRICE_ID = :price_id
1542
+ ITEM_ID = :item_id
1543
+ PRICE_TYPE = :price_type
1544
+ CURRENCY = :currency
1545
+ PRICING_UNIT_ID = :pricing_unit_id
1546
+
1547
+ # @!method self.values
1548
+ # @return [Array<Symbol>]
1549
+ end
1550
+
1551
+ # Should prices that match the filter be included or excluded.
1552
+ #
1553
+ # @see Orb::Models::Subscription::MaximumInterval::Filter#operator
1554
+ module Operator
1555
+ extend Orb::Internal::Type::Enum
1556
+
1557
+ INCLUDES = :includes
1558
+ EXCLUDES = :excludes
1559
+
1560
+ # @!method self.values
1561
+ # @return [Array<Symbol>]
1562
+ end
1563
+ end
944
1564
  end
945
1565
 
946
1566
  class MinimumInterval < Orb::Internal::Type::BaseModel
947
- # @!attribute applies_to_price_ids
948
- # The price ids that this minimum interval applies to.
949
- #
950
- # @return [Array<String>]
951
- required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
952
-
953
1567
  # @!attribute applies_to_price_interval_ids
954
1568
  # The price interval ids that this minimum interval applies to.
955
1569
  #
@@ -962,6 +1576,12 @@ module Orb
962
1576
  # @return [Time, nil]
963
1577
  required :end_date, Time, nil?: true
964
1578
 
1579
+ # @!attribute filters
1580
+ # The filters that determine which prices this minimum interval applies to.
1581
+ #
1582
+ # @return [Array<Orb::Models::Subscription::MinimumInterval::Filter>]
1583
+ required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::Subscription::MinimumInterval::Filter] }
1584
+
965
1585
  # @!attribute minimum_amount
966
1586
  # The minimum amount to charge in a given billing period for the price intervals
967
1587
  # this minimum applies to.
@@ -975,19 +1595,75 @@ module Orb
975
1595
  # @return [Time]
976
1596
  required :start_date, Time
977
1597
 
978
- # @!method initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:)
1598
+ # @!method initialize(applies_to_price_interval_ids:, end_date:, filters:, minimum_amount:, start_date:)
979
1599
  # Some parameter documentations has been truncated, see
980
1600
  # {Orb::Models::Subscription::MinimumInterval} for more details.
981
1601
  #
982
- # @param applies_to_price_ids [Array<String>] The price ids that this minimum interval applies to.
983
- #
984
1602
  # @param applies_to_price_interval_ids [Array<String>] The price interval ids that this minimum interval applies to.
985
1603
  #
986
1604
  # @param end_date [Time, nil] The end date of the minimum interval.
987
1605
  #
1606
+ # @param filters [Array<Orb::Models::Subscription::MinimumInterval::Filter>] The filters that determine which prices this minimum interval applies to.
1607
+ #
988
1608
  # @param minimum_amount [String] The minimum amount to charge in a given billing period for the price intervals t
989
1609
  #
990
1610
  # @param start_date [Time] The start date of the minimum interval.
1611
+
1612
+ class Filter < Orb::Internal::Type::BaseModel
1613
+ # @!attribute field
1614
+ # The property of the price to filter on.
1615
+ #
1616
+ # @return [Symbol, Orb::Models::Subscription::MinimumInterval::Filter::Field]
1617
+ required :field, enum: -> { Orb::Subscription::MinimumInterval::Filter::Field }
1618
+
1619
+ # @!attribute operator
1620
+ # Should prices that match the filter be included or excluded.
1621
+ #
1622
+ # @return [Symbol, Orb::Models::Subscription::MinimumInterval::Filter::Operator]
1623
+ required :operator, enum: -> { Orb::Subscription::MinimumInterval::Filter::Operator }
1624
+
1625
+ # @!attribute values
1626
+ # The IDs or values that match this filter.
1627
+ #
1628
+ # @return [Array<String>]
1629
+ required :values, Orb::Internal::Type::ArrayOf[String]
1630
+
1631
+ # @!method initialize(field:, operator:, values:)
1632
+ # @param field [Symbol, Orb::Models::Subscription::MinimumInterval::Filter::Field] The property of the price to filter on.
1633
+ #
1634
+ # @param operator [Symbol, Orb::Models::Subscription::MinimumInterval::Filter::Operator] Should prices that match the filter be included or excluded.
1635
+ #
1636
+ # @param values [Array<String>] The IDs or values that match this filter.
1637
+
1638
+ # The property of the price to filter on.
1639
+ #
1640
+ # @see Orb::Models::Subscription::MinimumInterval::Filter#field
1641
+ module Field
1642
+ extend Orb::Internal::Type::Enum
1643
+
1644
+ PRICE_ID = :price_id
1645
+ ITEM_ID = :item_id
1646
+ PRICE_TYPE = :price_type
1647
+ CURRENCY = :currency
1648
+ PRICING_UNIT_ID = :pricing_unit_id
1649
+
1650
+ # @!method self.values
1651
+ # @return [Array<Symbol>]
1652
+ end
1653
+
1654
+ # Should prices that match the filter be included or excluded.
1655
+ #
1656
+ # @see Orb::Models::Subscription::MinimumInterval::Filter#operator
1657
+ module Operator
1658
+ extend Orb::Internal::Type::Enum
1659
+
1660
+ INCLUDES = :includes
1661
+ EXCLUDES = :excludes
1662
+
1663
+ # @!method self.values
1664
+ # @return [Array<Symbol>]
1665
+ end
1666
+ end
991
1667
  end
992
1668
 
993
1669
  # @see Orb::Models::Subscription#pending_subscription_change