orb-billing 0.5.4 → 0.6.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 (211) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/orb/internal/type/base_model.rb +2 -2
  5. data/lib/orb/internal/type/union.rb +6 -6
  6. data/lib/orb/internal/util.rb +5 -1
  7. data/lib/orb/models/alert.rb +33 -1
  8. data/lib/orb/models/amount_discount.rb +10 -10
  9. data/lib/orb/models/credit_note_create_params.rb +9 -9
  10. data/lib/orb/models/customer_create_params.rb +21 -3
  11. data/lib/orb/models/customer_update_by_external_id_params.rb +21 -3
  12. data/lib/orb/models/customer_update_params.rb +21 -3
  13. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +9 -1
  14. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +9 -1
  15. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +9 -1
  16. data/lib/orb/models/customers/credits/ledger_list_response.rb +9 -1
  17. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +1 -1
  18. data/lib/orb/models/customers/credits/top_up_create_params.rb +1 -1
  19. data/lib/orb/models/invoice.rb +626 -9
  20. data/lib/orb/models/invoice_fetch_upcoming_response.rb +624 -9
  21. data/lib/orb/models/invoice_line_item_create_response.rb +486 -7
  22. data/lib/orb/models/item.rb +18 -1
  23. data/lib/orb/models/item_archive_params.rb +14 -0
  24. data/lib/orb/models/item_create_params.rb +14 -1
  25. data/lib/orb/models/item_update_params.rb +16 -1
  26. data/lib/orb/models/percentage_discount.rb +10 -10
  27. data/lib/orb/models/plan.rb +618 -9
  28. data/lib/orb/models/plan_create_params.rb +2066 -30
  29. data/lib/orb/models/plan_set_default_version_params.rb +22 -0
  30. data/lib/orb/models/plans/external_plan_id/version_create_params.rb +17948 -0
  31. data/lib/orb/models/plans/external_plan_id/version_create_response.rb +819 -0
  32. data/lib/orb/models/plans/external_plan_id/version_retrieve_params.rb +24 -0
  33. data/lib/orb/models/plans/external_plan_id/version_retrieve_response.rb +819 -0
  34. data/lib/orb/models/plans/external_plan_id_set_default_version_params.rb +24 -0
  35. data/lib/orb/models/plans/version_create_params.rb +17794 -0
  36. data/lib/orb/models/plans/version_create_response.rb +814 -0
  37. data/lib/orb/models/plans/version_retrieve_params.rb +22 -0
  38. data/lib/orb/models/plans/version_retrieve_response.rb +814 -0
  39. data/lib/orb/models/price.rb +4124 -70
  40. data/lib/orb/models/price_create_params.rb +45 -1
  41. data/lib/orb/models/price_evaluate_params.rb +8529 -21
  42. data/lib/orb/models/price_evaluate_response.rb +38 -3
  43. data/lib/orb/models/subscription.rb +730 -54
  44. data/lib/orb/models/subscription_cancel_response.rb +706 -54
  45. data/lib/orb/models/subscription_change_apply_response.rb +728 -54
  46. data/lib/orb/models/subscription_change_cancel_response.rb +728 -54
  47. data/lib/orb/models/subscription_change_retrieve_response.rb +728 -54
  48. data/lib/orb/models/subscription_create_params.rb +5992 -1698
  49. data/lib/orb/models/subscription_create_response.rb +706 -54
  50. data/lib/orb/models/subscription_fetch_schedule_response.rb +3 -3
  51. data/lib/orb/models/subscription_price_intervals_params.rb +1392 -76
  52. data/lib/orb/models/subscription_price_intervals_response.rb +712 -54
  53. data/lib/orb/models/subscription_schedule_plan_change_params.rb +6005 -1723
  54. data/lib/orb/models/subscription_schedule_plan_change_response.rb +716 -54
  55. data/lib/orb/models/subscription_trigger_phase_response.rb +708 -54
  56. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +720 -54
  57. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +728 -54
  58. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +728 -54
  59. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +1 -1
  60. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +720 -54
  61. data/lib/orb/models/subscription_update_trial_response.rb +706 -54
  62. data/lib/orb/models/trial_discount.rb +10 -10
  63. data/lib/orb/models/usage_discount.rb +10 -10
  64. data/lib/orb/models.rb +4 -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/versions.rb +88 -0
  71. data/lib/orb/resources/plans/external_plan_id.rb +32 -1
  72. data/lib/orb/resources/plans/versions.rb +86 -0
  73. data/lib/orb/resources/plans.rb +33 -2
  74. data/lib/orb/resources/prices.rb +23 -17
  75. data/lib/orb/resources/subscriptions.rb +5 -1
  76. data/lib/orb/version.rb +1 -1
  77. data/lib/orb.rb +16 -1
  78. data/rbi/orb/models/alert.rbi +50 -3
  79. data/rbi/orb/models/amount_discount.rbi +8 -8
  80. data/rbi/orb/models/credit_note_create_params.rbi +8 -8
  81. data/rbi/orb/models/customer_create_params.rbi +38 -4
  82. data/rbi/orb/models/customer_update_by_external_id_params.rbi +38 -4
  83. data/rbi/orb/models/customer_update_params.rbi +38 -4
  84. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +9 -1
  85. data/rbi/orb/models/customers/credits/ledger_create_entry_response.rbi +9 -1
  86. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +9 -1
  87. data/rbi/orb/models/customers/credits/ledger_list_response.rbi +9 -1
  88. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +2 -2
  89. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +2 -2
  90. data/rbi/orb/models/invoice.rbi +1451 -35
  91. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +1524 -4
  92. data/rbi/orb/models/invoice_line_item_create_response.rbi +1184 -2
  93. data/rbi/orb/models/item.rbi +20 -1
  94. data/rbi/orb/models/item_archive_params.rbi +25 -0
  95. data/rbi/orb/models/item_create_params.rbi +18 -1
  96. data/rbi/orb/models/item_update_params.rbi +17 -1
  97. data/rbi/orb/models/percentage_discount.rbi +10 -10
  98. data/rbi/orb/models/plan.rbi +1339 -4
  99. data/rbi/orb/models/plan_create_params.rbi +3833 -29
  100. data/rbi/orb/models/plan_set_default_version_params.rbi +40 -0
  101. data/rbi/orb/models/plans/external_plan_id/version_create_params.rbi +32668 -0
  102. data/rbi/orb/models/plans/external_plan_id/version_create_response.rbi +1562 -0
  103. data/rbi/orb/models/plans/external_plan_id/version_retrieve_params.rbi +42 -0
  104. data/rbi/orb/models/plans/external_plan_id/version_retrieve_response.rbi +1562 -0
  105. data/rbi/orb/models/plans/external_plan_id_set_default_version_params.rbi +45 -0
  106. data/rbi/orb/models/plans/version_create_params.rbi +32607 -0
  107. data/rbi/orb/models/plans/version_create_response.rbi +1556 -0
  108. data/rbi/orb/models/plans/version_retrieve_params.rbi +37 -0
  109. data/rbi/orb/models/plans/version_retrieve_response.rbi +1558 -0
  110. data/rbi/orb/models/price.rbi +9447 -441
  111. data/rbi/orb/models/price_create_params.rbi +80 -0
  112. data/rbi/orb/models/price_evaluate_params.rbi +15684 -25
  113. data/rbi/orb/models/price_evaluate_response.rbi +68 -5
  114. data/rbi/orb/models/subscription.rbi +1654 -44
  115. data/rbi/orb/models/subscription_cancel_response.rbi +1692 -44
  116. data/rbi/orb/models/subscription_change_apply_response.rbi +1692 -44
  117. data/rbi/orb/models/subscription_change_cancel_response.rbi +1692 -44
  118. data/rbi/orb/models/subscription_change_retrieve_response.rbi +1692 -44
  119. data/rbi/orb/models/subscription_create_params.rbi +10400 -2710
  120. data/rbi/orb/models/subscription_create_response.rbi +1692 -44
  121. data/rbi/orb/models/subscription_fetch_schedule_response.rbi +13 -4
  122. data/rbi/orb/models/subscription_price_intervals_params.rbi +2401 -49
  123. data/rbi/orb/models/subscription_price_intervals_response.rbi +1692 -44
  124. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +10423 -2753
  125. data/rbi/orb/models/subscription_schedule_plan_change_response.rbi +1692 -44
  126. data/rbi/orb/models/subscription_trigger_phase_response.rbi +1692 -44
  127. data/rbi/orb/models/subscription_unschedule_cancellation_response.rbi +1692 -44
  128. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +1692 -44
  129. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +1692 -44
  130. data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +2 -2
  131. data/rbi/orb/models/subscription_update_fixed_fee_quantity_response.rbi +1692 -44
  132. data/rbi/orb/models/subscription_update_trial_response.rbi +1692 -44
  133. data/rbi/orb/models/trial_discount.rbi +8 -8
  134. data/rbi/orb/models/usage_discount.rbi +10 -10
  135. data/rbi/orb/models.rbi +4 -0
  136. data/rbi/orb/resources/credit_notes.rbi +3 -3
  137. data/rbi/orb/resources/customers/balance_transactions.rbi +0 -7
  138. data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -2
  139. data/rbi/orb/resources/customers.rbi +7 -7
  140. data/rbi/orb/resources/dimensional_price_groups.rbi +1 -1
  141. data/rbi/orb/resources/items.rbi +20 -0
  142. data/rbi/orb/resources/plans/external_plan_id/versions.rbi +103 -0
  143. data/rbi/orb/resources/plans/external_plan_id.rbi +23 -1
  144. data/rbi/orb/resources/plans/versions.rbi +91 -0
  145. data/rbi/orb/resources/plans.rbi +27 -2
  146. data/rbi/orb/resources/prices.rbi +27 -17
  147. data/rbi/orb/resources/subscriptions.rbi +9 -1
  148. data/sig/orb/models/alert.rbs +20 -3
  149. data/sig/orb/models/amount_discount.rbs +5 -5
  150. data/sig/orb/models/credit_note_create_params.rbs +6 -6
  151. data/sig/orb/models/customer_create_params.rbs +13 -0
  152. data/sig/orb/models/customer_update_by_external_id_params.rbs +13 -0
  153. data/sig/orb/models/customer_update_params.rbs +13 -0
  154. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs +7 -2
  155. data/sig/orb/models/customers/credits/ledger_create_entry_response.rbs +7 -2
  156. data/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs +7 -2
  157. data/sig/orb/models/customers/credits/ledger_list_response.rbs +7 -2
  158. data/sig/orb/models/invoice.rbs +558 -4
  159. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +558 -4
  160. data/sig/orb/models/invoice_line_item_create_response.rbs +414 -2
  161. data/sig/orb/models/item.rbs +5 -0
  162. data/sig/orb/models/item_archive_params.rbs +14 -0
  163. data/sig/orb/models/item_create_params.rbs +10 -2
  164. data/sig/orb/models/item_update_params.rbs +5 -0
  165. data/sig/orb/models/percentage_discount.rbs +5 -5
  166. data/sig/orb/models/plan.rbs +538 -4
  167. data/sig/orb/models/plan_create_params.rbs +1460 -3
  168. data/sig/orb/models/plan_set_default_version_params.rbs +20 -0
  169. data/sig/orb/models/plans/external_plan_id/version_create_params.rbs +12923 -0
  170. data/sig/orb/models/plans/external_plan_id/version_create_response.rbs +664 -0
  171. data/sig/orb/models/plans/external_plan_id/version_retrieve_params.rbs +27 -0
  172. data/sig/orb/models/plans/external_plan_id/version_retrieve_response.rbs +664 -0
  173. data/sig/orb/models/plans/external_plan_id_set_default_version_params.rbs +25 -0
  174. data/sig/orb/models/plans/version_create_params.rbs +12898 -0
  175. data/sig/orb/models/plans/version_create_response.rbs +662 -0
  176. data/sig/orb/models/plans/version_retrieve_params.rbs +25 -0
  177. data/sig/orb/models/plans/version_retrieve_response.rbs +662 -0
  178. data/sig/orb/models/price.rbs +3512 -96
  179. data/sig/orb/models/price_create_params.rbs +32 -0
  180. data/sig/orb/models/price_evaluate_params.rbs +6187 -10
  181. data/sig/orb/models/price_evaluate_response.rbs +41 -4
  182. data/sig/orb/models/subscription.rbs +609 -29
  183. data/sig/orb/models/subscription_cancel_response.rbs +609 -29
  184. data/sig/orb/models/subscription_change_apply_response.rbs +621 -29
  185. data/sig/orb/models/subscription_change_cancel_response.rbs +621 -29
  186. data/sig/orb/models/subscription_change_retrieve_response.rbs +621 -29
  187. data/sig/orb/models/subscription_create_params.rbs +4450 -1466
  188. data/sig/orb/models/subscription_create_response.rbs +609 -29
  189. data/sig/orb/models/subscription_fetch_schedule_response.rbs +4 -4
  190. data/sig/orb/models/subscription_price_intervals_params.rbs +920 -24
  191. data/sig/orb/models/subscription_price_intervals_response.rbs +609 -29
  192. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +4440 -1466
  193. data/sig/orb/models/subscription_schedule_plan_change_response.rbs +609 -29
  194. data/sig/orb/models/subscription_trigger_phase_response.rbs +609 -29
  195. data/sig/orb/models/subscription_unschedule_cancellation_response.rbs +609 -29
  196. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs +609 -29
  197. data/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs +609 -29
  198. data/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs +609 -29
  199. data/sig/orb/models/subscription_update_trial_response.rbs +609 -29
  200. data/sig/orb/models/trial_discount.rbs +5 -5
  201. data/sig/orb/models/usage_discount.rbs +5 -5
  202. data/sig/orb/models.rbs +4 -0
  203. data/sig/orb/resources/credit_notes.rbs +1 -1
  204. data/sig/orb/resources/items.rbs +7 -0
  205. data/sig/orb/resources/plans/external_plan_id/versions.rbs +30 -0
  206. data/sig/orb/resources/plans/external_plan_id.rbs +8 -0
  207. data/sig/orb/resources/plans/versions.rbs +28 -0
  208. data/sig/orb/resources/plans.rbs +8 -0
  209. data/sig/orb/resources/prices.rbs +3 -3
  210. data/sig/orb/resources/subscriptions.rbs +2 -0
  211. metadata +41 -2
@@ -115,6 +115,10 @@ module Orb
115
115
  sig { returns(T::Array[Orb::Subscription::MinimumInterval]) }
116
116
  attr_accessor :minimum_intervals
117
117
 
118
+ # The name of the subscription.
119
+ sig { returns(String) }
120
+ attr_accessor :name
121
+
118
122
  # Determines the difference between the invoice issue date for subscription
119
123
  # invoices as the date that they are due. A value of `0` here represents that the
120
124
  # invoice is due on issue, whereas a value of `30` represents that the customer
@@ -138,10 +142,10 @@ module Orb
138
142
  # subscribed to by a customer. Plans define the billing behavior of the
139
143
  # subscription. You can see more about how to configure prices in the
140
144
  # [Price resource](/reference/price).
141
- sig { returns(Orb::Plan) }
145
+ sig { returns(T.nilable(Orb::Plan)) }
142
146
  attr_reader :plan
143
147
 
144
- sig { params(plan: Orb::Plan::OrHash).void }
148
+ sig { params(plan: T.nilable(Orb::Plan::OrHash)).void }
145
149
  attr_writer :plan
146
150
 
147
151
  # The price intervals for this subscription.
@@ -222,10 +226,11 @@ module Orb
222
226
  metadata: T::Hash[Symbol, String],
223
227
  minimum_intervals:
224
228
  T::Array[Orb::Subscription::MinimumInterval::OrHash],
229
+ name: String,
225
230
  net_terms: Integer,
226
231
  pending_subscription_change:
227
232
  T.nilable(Orb::Subscription::PendingSubscriptionChange::OrHash),
228
- plan: Orb::Plan::OrHash,
233
+ plan: T.nilable(Orb::Plan::OrHash),
229
234
  price_intervals: T::Array[Orb::Subscription::PriceInterval::OrHash],
230
235
  redeemed_coupon: T.nilable(Orb::Subscription::RedeemedCoupon::OrHash),
231
236
  start_date: Time,
@@ -297,6 +302,8 @@ module Orb
297
302
  metadata:,
298
303
  # The minimum intervals for this subscription sorted by the start_date.
299
304
  minimum_intervals:,
305
+ # The name of the subscription.
306
+ name:,
300
307
  # Determines the difference between the invoice issue date for subscription
301
308
  # invoices as the date that they are due. A value of `0` here represents that the
302
309
  # invoice is due on issue, whereas a value of `30` represents that the customer
@@ -344,10 +351,11 @@ module Orb
344
351
  maximum_intervals: T::Array[Orb::Subscription::MaximumInterval],
345
352
  metadata: T::Hash[Symbol, String],
346
353
  minimum_intervals: T::Array[Orb::Subscription::MinimumInterval],
354
+ name: String,
347
355
  net_terms: Integer,
348
356
  pending_subscription_change:
349
357
  T.nilable(Orb::Subscription::PendingSubscriptionChange),
350
- plan: Orb::Plan,
358
+ plan: T.nilable(Orb::Plan),
351
359
  price_intervals: T::Array[Orb::Subscription::PriceInterval],
352
360
  redeemed_coupon: T.nilable(Orb::Subscription::RedeemedCoupon),
353
361
  start_date: Time,
@@ -461,6 +469,16 @@ module Orb
461
469
  sig { returns(T::Array[String]) }
462
470
  attr_accessor :applies_to_price_ids
463
471
 
472
+ # The filters that determine which prices to apply this adjustment to.
473
+ sig do
474
+ returns(
475
+ T::Array[
476
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter
477
+ ]
478
+ )
479
+ end
480
+ attr_accessor :filters
481
+
464
482
  # True for adjustments that apply to an entire invocice, false for adjustments
465
483
  # that apply to only one price.
466
484
  sig { returns(T::Boolean) }
@@ -483,6 +501,10 @@ module Orb
483
501
  params(
484
502
  id: String,
485
503
  applies_to_price_ids: T::Array[String],
504
+ filters:
505
+ T::Array[
506
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::OrHash
507
+ ],
486
508
  is_invoice_level: T::Boolean,
487
509
  plan_phase_order: T.nilable(Integer),
488
510
  reason: T.nilable(String),
@@ -494,6 +516,8 @@ module Orb
494
516
  id:,
495
517
  # The price IDs that this adjustment applies to.
496
518
  applies_to_price_ids:,
519
+ # The filters that determine which prices to apply this adjustment to.
520
+ filters:,
497
521
  # True for adjustments that apply to an entire invocice, false for adjustments
498
522
  # that apply to only one price.
499
523
  is_invoice_level:,
@@ -514,6 +538,10 @@ module Orb
514
538
  id: String,
515
539
  adjustment_type: Symbol,
516
540
  applies_to_price_ids: T::Array[String],
541
+ filters:
542
+ T::Array[
543
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter
544
+ ],
517
545
  is_invoice_level: T::Boolean,
518
546
  plan_phase_order: T.nilable(Integer),
519
547
  reason: T.nilable(String),
@@ -523,6 +551,154 @@ module Orb
523
551
  end
524
552
  def to_hash
525
553
  end
554
+
555
+ class Filter < Orb::Internal::Type::BaseModel
556
+ OrHash =
557
+ T.type_alias do
558
+ T.any(
559
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter,
560
+ Orb::Internal::AnyHash
561
+ )
562
+ end
563
+
564
+ # The property of the price to filter on.
565
+ sig do
566
+ returns(
567
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
568
+ )
569
+ end
570
+ attr_accessor :field
571
+
572
+ # Should prices that match the filter be included or excluded.
573
+ sig do
574
+ returns(
575
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
576
+ )
577
+ end
578
+ attr_accessor :operator
579
+
580
+ # The IDs or values that match this filter.
581
+ sig { returns(T::Array[String]) }
582
+ attr_accessor :values
583
+
584
+ sig do
585
+ params(
586
+ field:
587
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::OrSymbol,
588
+ operator:
589
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator::OrSymbol,
590
+ values: T::Array[String]
591
+ ).returns(T.attached_class)
592
+ end
593
+ def self.new(
594
+ # The property of the price to filter on.
595
+ field:,
596
+ # Should prices that match the filter be included or excluded.
597
+ operator:,
598
+ # The IDs or values that match this filter.
599
+ values:
600
+ )
601
+ end
602
+
603
+ sig do
604
+ override.returns(
605
+ {
606
+ field:
607
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol,
608
+ operator:
609
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol,
610
+ values: T::Array[String]
611
+ }
612
+ )
613
+ end
614
+ def to_hash
615
+ end
616
+
617
+ # The property of the price to filter on.
618
+ module Field
619
+ extend Orb::Internal::Type::Enum
620
+
621
+ TaggedSymbol =
622
+ T.type_alias do
623
+ T.all(
624
+ Symbol,
625
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field
626
+ )
627
+ end
628
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
629
+
630
+ PRICE_ID =
631
+ T.let(
632
+ :price_id,
633
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
634
+ )
635
+ ITEM_ID =
636
+ T.let(
637
+ :item_id,
638
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
639
+ )
640
+ PRICE_TYPE =
641
+ T.let(
642
+ :price_type,
643
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
644
+ )
645
+ CURRENCY =
646
+ T.let(
647
+ :currency,
648
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
649
+ )
650
+ PRICING_UNIT_ID =
651
+ T.let(
652
+ :pricing_unit_id,
653
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
654
+ )
655
+
656
+ sig do
657
+ override.returns(
658
+ T::Array[
659
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
660
+ ]
661
+ )
662
+ end
663
+ def self.values
664
+ end
665
+ end
666
+
667
+ # Should prices that match the filter be included or excluded.
668
+ module Operator
669
+ extend Orb::Internal::Type::Enum
670
+
671
+ TaggedSymbol =
672
+ T.type_alias do
673
+ T.all(
674
+ Symbol,
675
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator
676
+ )
677
+ end
678
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
679
+
680
+ INCLUDES =
681
+ T.let(
682
+ :includes,
683
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
684
+ )
685
+ EXCLUDES =
686
+ T.let(
687
+ :excludes,
688
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
689
+ )
690
+
691
+ sig do
692
+ override.returns(
693
+ T::Array[
694
+ Orb::Subscription::AdjustmentInterval::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
695
+ ]
696
+ )
697
+ end
698
+ def self.values
699
+ end
700
+ end
701
+ end
526
702
  end
527
703
 
528
704
  class AmountDiscount < Orb::Internal::Type::BaseModel
@@ -549,6 +725,16 @@ module Orb
549
725
  sig { returns(T::Array[String]) }
550
726
  attr_accessor :applies_to_price_ids
551
727
 
728
+ # The filters that determine which prices to apply this adjustment to.
729
+ sig do
730
+ returns(
731
+ T::Array[
732
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter
733
+ ]
734
+ )
735
+ end
736
+ attr_accessor :filters
737
+
552
738
  # True for adjustments that apply to an entire invocice, false for adjustments
553
739
  # that apply to only one price.
554
740
  sig { returns(T::Boolean) }
@@ -567,6 +753,10 @@ module Orb
567
753
  id: String,
568
754
  amount_discount: String,
569
755
  applies_to_price_ids: T::Array[String],
756
+ filters:
757
+ T::Array[
758
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::OrHash
759
+ ],
570
760
  is_invoice_level: T::Boolean,
571
761
  plan_phase_order: T.nilable(Integer),
572
762
  reason: T.nilable(String),
@@ -580,6 +770,8 @@ module Orb
580
770
  amount_discount:,
581
771
  # The price IDs that this adjustment applies to.
582
772
  applies_to_price_ids:,
773
+ # The filters that determine which prices to apply this adjustment to.
774
+ filters:,
583
775
  # True for adjustments that apply to an entire invocice, false for adjustments
584
776
  # that apply to only one price.
585
777
  is_invoice_level:,
@@ -598,6 +790,10 @@ module Orb
598
790
  adjustment_type: Symbol,
599
791
  amount_discount: String,
600
792
  applies_to_price_ids: T::Array[String],
793
+ filters:
794
+ T::Array[
795
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter
796
+ ],
601
797
  is_invoice_level: T::Boolean,
602
798
  plan_phase_order: T.nilable(Integer),
603
799
  reason: T.nilable(String)
@@ -606,6 +802,154 @@ module Orb
606
802
  end
607
803
  def to_hash
608
804
  end
805
+
806
+ class Filter < Orb::Internal::Type::BaseModel
807
+ OrHash =
808
+ T.type_alias do
809
+ T.any(
810
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter,
811
+ Orb::Internal::AnyHash
812
+ )
813
+ end
814
+
815
+ # The property of the price to filter on.
816
+ sig do
817
+ returns(
818
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
819
+ )
820
+ end
821
+ attr_accessor :field
822
+
823
+ # Should prices that match the filter be included or excluded.
824
+ sig do
825
+ returns(
826
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
827
+ )
828
+ end
829
+ attr_accessor :operator
830
+
831
+ # The IDs or values that match this filter.
832
+ sig { returns(T::Array[String]) }
833
+ attr_accessor :values
834
+
835
+ sig do
836
+ params(
837
+ field:
838
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::OrSymbol,
839
+ operator:
840
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator::OrSymbol,
841
+ values: T::Array[String]
842
+ ).returns(T.attached_class)
843
+ end
844
+ def self.new(
845
+ # The property of the price to filter on.
846
+ field:,
847
+ # Should prices that match the filter be included or excluded.
848
+ operator:,
849
+ # The IDs or values that match this filter.
850
+ values:
851
+ )
852
+ end
853
+
854
+ sig do
855
+ override.returns(
856
+ {
857
+ field:
858
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol,
859
+ operator:
860
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol,
861
+ values: T::Array[String]
862
+ }
863
+ )
864
+ end
865
+ def to_hash
866
+ end
867
+
868
+ # The property of the price to filter on.
869
+ module Field
870
+ extend Orb::Internal::Type::Enum
871
+
872
+ TaggedSymbol =
873
+ T.type_alias do
874
+ T.all(
875
+ Symbol,
876
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field
877
+ )
878
+ end
879
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
880
+
881
+ PRICE_ID =
882
+ T.let(
883
+ :price_id,
884
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
885
+ )
886
+ ITEM_ID =
887
+ T.let(
888
+ :item_id,
889
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
890
+ )
891
+ PRICE_TYPE =
892
+ T.let(
893
+ :price_type,
894
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
895
+ )
896
+ CURRENCY =
897
+ T.let(
898
+ :currency,
899
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
900
+ )
901
+ PRICING_UNIT_ID =
902
+ T.let(
903
+ :pricing_unit_id,
904
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
905
+ )
906
+
907
+ sig do
908
+ override.returns(
909
+ T::Array[
910
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
911
+ ]
912
+ )
913
+ end
914
+ def self.values
915
+ end
916
+ end
917
+
918
+ # Should prices that match the filter be included or excluded.
919
+ module Operator
920
+ extend Orb::Internal::Type::Enum
921
+
922
+ TaggedSymbol =
923
+ T.type_alias do
924
+ T.all(
925
+ Symbol,
926
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator
927
+ )
928
+ end
929
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
930
+
931
+ INCLUDES =
932
+ T.let(
933
+ :includes,
934
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
935
+ )
936
+ EXCLUDES =
937
+ T.let(
938
+ :excludes,
939
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
940
+ )
941
+
942
+ sig do
943
+ override.returns(
944
+ T::Array[
945
+ Orb::Subscription::AdjustmentInterval::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
946
+ ]
947
+ )
948
+ end
949
+ def self.values
950
+ end
951
+ end
952
+ end
609
953
  end
610
954
 
611
955
  class PercentageDiscount < Orb::Internal::Type::BaseModel
@@ -627,6 +971,16 @@ module Orb
627
971
  sig { returns(T::Array[String]) }
628
972
  attr_accessor :applies_to_price_ids
629
973
 
974
+ # The filters that determine which prices to apply this adjustment to.
975
+ sig do
976
+ returns(
977
+ T::Array[
978
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter
979
+ ]
980
+ )
981
+ end
982
+ attr_accessor :filters
983
+
630
984
  # True for adjustments that apply to an entire invocice, false for adjustments
631
985
  # that apply to only one price.
632
986
  sig { returns(T::Boolean) }
@@ -649,6 +1003,10 @@ module Orb
649
1003
  params(
650
1004
  id: String,
651
1005
  applies_to_price_ids: T::Array[String],
1006
+ filters:
1007
+ T::Array[
1008
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::OrHash
1009
+ ],
652
1010
  is_invoice_level: T::Boolean,
653
1011
  percentage_discount: Float,
654
1012
  plan_phase_order: T.nilable(Integer),
@@ -660,6 +1018,8 @@ module Orb
660
1018
  id:,
661
1019
  # The price IDs that this adjustment applies to.
662
1020
  applies_to_price_ids:,
1021
+ # The filters that determine which prices to apply this adjustment to.
1022
+ filters:,
663
1023
  # True for adjustments that apply to an entire invocice, false for adjustments
664
1024
  # that apply to only one price.
665
1025
  is_invoice_level:,
@@ -680,6 +1040,10 @@ module Orb
680
1040
  id: String,
681
1041
  adjustment_type: Symbol,
682
1042
  applies_to_price_ids: T::Array[String],
1043
+ filters:
1044
+ T::Array[
1045
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter
1046
+ ],
683
1047
  is_invoice_level: T::Boolean,
684
1048
  percentage_discount: Float,
685
1049
  plan_phase_order: T.nilable(Integer),
@@ -689,6 +1053,154 @@ module Orb
689
1053
  end
690
1054
  def to_hash
691
1055
  end
1056
+
1057
+ class Filter < Orb::Internal::Type::BaseModel
1058
+ OrHash =
1059
+ T.type_alias do
1060
+ T.any(
1061
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter,
1062
+ Orb::Internal::AnyHash
1063
+ )
1064
+ end
1065
+
1066
+ # The property of the price to filter on.
1067
+ sig do
1068
+ returns(
1069
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
1070
+ )
1071
+ end
1072
+ attr_accessor :field
1073
+
1074
+ # Should prices that match the filter be included or excluded.
1075
+ sig do
1076
+ returns(
1077
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
1078
+ )
1079
+ end
1080
+ attr_accessor :operator
1081
+
1082
+ # The IDs or values that match this filter.
1083
+ sig { returns(T::Array[String]) }
1084
+ attr_accessor :values
1085
+
1086
+ sig do
1087
+ params(
1088
+ field:
1089
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::OrSymbol,
1090
+ operator:
1091
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator::OrSymbol,
1092
+ values: T::Array[String]
1093
+ ).returns(T.attached_class)
1094
+ end
1095
+ def self.new(
1096
+ # The property of the price to filter on.
1097
+ field:,
1098
+ # Should prices that match the filter be included or excluded.
1099
+ operator:,
1100
+ # The IDs or values that match this filter.
1101
+ values:
1102
+ )
1103
+ end
1104
+
1105
+ sig do
1106
+ override.returns(
1107
+ {
1108
+ field:
1109
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol,
1110
+ operator:
1111
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol,
1112
+ values: T::Array[String]
1113
+ }
1114
+ )
1115
+ end
1116
+ def to_hash
1117
+ end
1118
+
1119
+ # The property of the price to filter on.
1120
+ module Field
1121
+ extend Orb::Internal::Type::Enum
1122
+
1123
+ TaggedSymbol =
1124
+ T.type_alias do
1125
+ T.all(
1126
+ Symbol,
1127
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field
1128
+ )
1129
+ end
1130
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1131
+
1132
+ PRICE_ID =
1133
+ T.let(
1134
+ :price_id,
1135
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
1136
+ )
1137
+ ITEM_ID =
1138
+ T.let(
1139
+ :item_id,
1140
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
1141
+ )
1142
+ PRICE_TYPE =
1143
+ T.let(
1144
+ :price_type,
1145
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
1146
+ )
1147
+ CURRENCY =
1148
+ T.let(
1149
+ :currency,
1150
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
1151
+ )
1152
+ PRICING_UNIT_ID =
1153
+ T.let(
1154
+ :pricing_unit_id,
1155
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
1156
+ )
1157
+
1158
+ sig do
1159
+ override.returns(
1160
+ T::Array[
1161
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
1162
+ ]
1163
+ )
1164
+ end
1165
+ def self.values
1166
+ end
1167
+ end
1168
+
1169
+ # Should prices that match the filter be included or excluded.
1170
+ module Operator
1171
+ extend Orb::Internal::Type::Enum
1172
+
1173
+ TaggedSymbol =
1174
+ T.type_alias do
1175
+ T.all(
1176
+ Symbol,
1177
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator
1178
+ )
1179
+ end
1180
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1181
+
1182
+ INCLUDES =
1183
+ T.let(
1184
+ :includes,
1185
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
1186
+ )
1187
+ EXCLUDES =
1188
+ T.let(
1189
+ :excludes,
1190
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
1191
+ )
1192
+
1193
+ sig do
1194
+ override.returns(
1195
+ T::Array[
1196
+ Orb::Subscription::AdjustmentInterval::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
1197
+ ]
1198
+ )
1199
+ end
1200
+ def self.values
1201
+ end
1202
+ end
1203
+ end
692
1204
  end
693
1205
 
694
1206
  class Minimum < Orb::Internal::Type::BaseModel
@@ -710,6 +1222,16 @@ module Orb
710
1222
  sig { returns(T::Array[String]) }
711
1223
  attr_accessor :applies_to_price_ids
712
1224
 
1225
+ # The filters that determine which prices to apply this adjustment to.
1226
+ sig do
1227
+ returns(
1228
+ T::Array[
1229
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter
1230
+ ]
1231
+ )
1232
+ end
1233
+ attr_accessor :filters
1234
+
713
1235
  # True for adjustments that apply to an entire invocice, false for adjustments
714
1236
  # that apply to only one price.
715
1237
  sig { returns(T::Boolean) }
@@ -736,6 +1258,10 @@ module Orb
736
1258
  params(
737
1259
  id: String,
738
1260
  applies_to_price_ids: T::Array[String],
1261
+ filters:
1262
+ T::Array[
1263
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::OrHash
1264
+ ],
739
1265
  is_invoice_level: T::Boolean,
740
1266
  item_id: String,
741
1267
  minimum_amount: String,
@@ -748,6 +1274,8 @@ module Orb
748
1274
  id:,
749
1275
  # The price IDs that this adjustment applies to.
750
1276
  applies_to_price_ids:,
1277
+ # The filters that determine which prices to apply this adjustment to.
1278
+ filters:,
751
1279
  # True for adjustments that apply to an entire invocice, false for adjustments
752
1280
  # that apply to only one price.
753
1281
  is_invoice_level:,
@@ -770,6 +1298,10 @@ module Orb
770
1298
  id: String,
771
1299
  adjustment_type: Symbol,
772
1300
  applies_to_price_ids: T::Array[String],
1301
+ filters:
1302
+ T::Array[
1303
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter
1304
+ ],
773
1305
  is_invoice_level: T::Boolean,
774
1306
  item_id: String,
775
1307
  minimum_amount: String,
@@ -780,6 +1312,154 @@ module Orb
780
1312
  end
781
1313
  def to_hash
782
1314
  end
1315
+
1316
+ class Filter < Orb::Internal::Type::BaseModel
1317
+ OrHash =
1318
+ T.type_alias do
1319
+ T.any(
1320
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter,
1321
+ Orb::Internal::AnyHash
1322
+ )
1323
+ end
1324
+
1325
+ # The property of the price to filter on.
1326
+ sig do
1327
+ returns(
1328
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::TaggedSymbol
1329
+ )
1330
+ end
1331
+ attr_accessor :field
1332
+
1333
+ # Should prices that match the filter be included or excluded.
1334
+ sig do
1335
+ returns(
1336
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator::TaggedSymbol
1337
+ )
1338
+ end
1339
+ attr_accessor :operator
1340
+
1341
+ # The IDs or values that match this filter.
1342
+ sig { returns(T::Array[String]) }
1343
+ attr_accessor :values
1344
+
1345
+ sig do
1346
+ params(
1347
+ field:
1348
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::OrSymbol,
1349
+ operator:
1350
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator::OrSymbol,
1351
+ values: T::Array[String]
1352
+ ).returns(T.attached_class)
1353
+ end
1354
+ def self.new(
1355
+ # The property of the price to filter on.
1356
+ field:,
1357
+ # Should prices that match the filter be included or excluded.
1358
+ operator:,
1359
+ # The IDs or values that match this filter.
1360
+ values:
1361
+ )
1362
+ end
1363
+
1364
+ sig do
1365
+ override.returns(
1366
+ {
1367
+ field:
1368
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::TaggedSymbol,
1369
+ operator:
1370
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator::TaggedSymbol,
1371
+ values: T::Array[String]
1372
+ }
1373
+ )
1374
+ end
1375
+ def to_hash
1376
+ end
1377
+
1378
+ # The property of the price to filter on.
1379
+ module Field
1380
+ extend Orb::Internal::Type::Enum
1381
+
1382
+ TaggedSymbol =
1383
+ T.type_alias do
1384
+ T.all(
1385
+ Symbol,
1386
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field
1387
+ )
1388
+ end
1389
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1390
+
1391
+ PRICE_ID =
1392
+ T.let(
1393
+ :price_id,
1394
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::TaggedSymbol
1395
+ )
1396
+ ITEM_ID =
1397
+ T.let(
1398
+ :item_id,
1399
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::TaggedSymbol
1400
+ )
1401
+ PRICE_TYPE =
1402
+ T.let(
1403
+ :price_type,
1404
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::TaggedSymbol
1405
+ )
1406
+ CURRENCY =
1407
+ T.let(
1408
+ :currency,
1409
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::TaggedSymbol
1410
+ )
1411
+ PRICING_UNIT_ID =
1412
+ T.let(
1413
+ :pricing_unit_id,
1414
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::TaggedSymbol
1415
+ )
1416
+
1417
+ sig do
1418
+ override.returns(
1419
+ T::Array[
1420
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Field::TaggedSymbol
1421
+ ]
1422
+ )
1423
+ end
1424
+ def self.values
1425
+ end
1426
+ end
1427
+
1428
+ # Should prices that match the filter be included or excluded.
1429
+ module Operator
1430
+ extend Orb::Internal::Type::Enum
1431
+
1432
+ TaggedSymbol =
1433
+ T.type_alias do
1434
+ T.all(
1435
+ Symbol,
1436
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator
1437
+ )
1438
+ end
1439
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1440
+
1441
+ INCLUDES =
1442
+ T.let(
1443
+ :includes,
1444
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator::TaggedSymbol
1445
+ )
1446
+ EXCLUDES =
1447
+ T.let(
1448
+ :excludes,
1449
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator::TaggedSymbol
1450
+ )
1451
+
1452
+ sig do
1453
+ override.returns(
1454
+ T::Array[
1455
+ Orb::Subscription::AdjustmentInterval::Adjustment::Minimum::Filter::Operator::TaggedSymbol
1456
+ ]
1457
+ )
1458
+ end
1459
+ def self.values
1460
+ end
1461
+ end
1462
+ end
783
1463
  end
784
1464
 
785
1465
  class Maximum < Orb::Internal::Type::BaseModel
@@ -801,6 +1481,16 @@ module Orb
801
1481
  sig { returns(T::Array[String]) }
802
1482
  attr_accessor :applies_to_price_ids
803
1483
 
1484
+ # The filters that determine which prices to apply this adjustment to.
1485
+ sig do
1486
+ returns(
1487
+ T::Array[
1488
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter
1489
+ ]
1490
+ )
1491
+ end
1492
+ attr_accessor :filters
1493
+
804
1494
  # True for adjustments that apply to an entire invocice, false for adjustments
805
1495
  # that apply to only one price.
806
1496
  sig { returns(T::Boolean) }
@@ -823,6 +1513,10 @@ module Orb
823
1513
  params(
824
1514
  id: String,
825
1515
  applies_to_price_ids: T::Array[String],
1516
+ filters:
1517
+ T::Array[
1518
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::OrHash
1519
+ ],
826
1520
  is_invoice_level: T::Boolean,
827
1521
  maximum_amount: String,
828
1522
  plan_phase_order: T.nilable(Integer),
@@ -834,6 +1528,8 @@ module Orb
834
1528
  id:,
835
1529
  # The price IDs that this adjustment applies to.
836
1530
  applies_to_price_ids:,
1531
+ # The filters that determine which prices to apply this adjustment to.
1532
+ filters:,
837
1533
  # True for adjustments that apply to an entire invocice, false for adjustments
838
1534
  # that apply to only one price.
839
1535
  is_invoice_level:,
@@ -854,6 +1550,10 @@ module Orb
854
1550
  id: String,
855
1551
  adjustment_type: Symbol,
856
1552
  applies_to_price_ids: T::Array[String],
1553
+ filters:
1554
+ T::Array[
1555
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter
1556
+ ],
857
1557
  is_invoice_level: T::Boolean,
858
1558
  maximum_amount: String,
859
1559
  plan_phase_order: T.nilable(Integer),
@@ -863,6 +1563,154 @@ module Orb
863
1563
  end
864
1564
  def to_hash
865
1565
  end
1566
+
1567
+ class Filter < Orb::Internal::Type::BaseModel
1568
+ OrHash =
1569
+ T.type_alias do
1570
+ T.any(
1571
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter,
1572
+ Orb::Internal::AnyHash
1573
+ )
1574
+ end
1575
+
1576
+ # The property of the price to filter on.
1577
+ sig do
1578
+ returns(
1579
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::TaggedSymbol
1580
+ )
1581
+ end
1582
+ attr_accessor :field
1583
+
1584
+ # Should prices that match the filter be included or excluded.
1585
+ sig do
1586
+ returns(
1587
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator::TaggedSymbol
1588
+ )
1589
+ end
1590
+ attr_accessor :operator
1591
+
1592
+ # The IDs or values that match this filter.
1593
+ sig { returns(T::Array[String]) }
1594
+ attr_accessor :values
1595
+
1596
+ sig do
1597
+ params(
1598
+ field:
1599
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::OrSymbol,
1600
+ operator:
1601
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator::OrSymbol,
1602
+ values: T::Array[String]
1603
+ ).returns(T.attached_class)
1604
+ end
1605
+ def self.new(
1606
+ # The property of the price to filter on.
1607
+ field:,
1608
+ # Should prices that match the filter be included or excluded.
1609
+ operator:,
1610
+ # The IDs or values that match this filter.
1611
+ values:
1612
+ )
1613
+ end
1614
+
1615
+ sig do
1616
+ override.returns(
1617
+ {
1618
+ field:
1619
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::TaggedSymbol,
1620
+ operator:
1621
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator::TaggedSymbol,
1622
+ values: T::Array[String]
1623
+ }
1624
+ )
1625
+ end
1626
+ def to_hash
1627
+ end
1628
+
1629
+ # The property of the price to filter on.
1630
+ module Field
1631
+ extend Orb::Internal::Type::Enum
1632
+
1633
+ TaggedSymbol =
1634
+ T.type_alias do
1635
+ T.all(
1636
+ Symbol,
1637
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field
1638
+ )
1639
+ end
1640
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1641
+
1642
+ PRICE_ID =
1643
+ T.let(
1644
+ :price_id,
1645
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::TaggedSymbol
1646
+ )
1647
+ ITEM_ID =
1648
+ T.let(
1649
+ :item_id,
1650
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::TaggedSymbol
1651
+ )
1652
+ PRICE_TYPE =
1653
+ T.let(
1654
+ :price_type,
1655
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::TaggedSymbol
1656
+ )
1657
+ CURRENCY =
1658
+ T.let(
1659
+ :currency,
1660
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::TaggedSymbol
1661
+ )
1662
+ PRICING_UNIT_ID =
1663
+ T.let(
1664
+ :pricing_unit_id,
1665
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::TaggedSymbol
1666
+ )
1667
+
1668
+ sig do
1669
+ override.returns(
1670
+ T::Array[
1671
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Field::TaggedSymbol
1672
+ ]
1673
+ )
1674
+ end
1675
+ def self.values
1676
+ end
1677
+ end
1678
+
1679
+ # Should prices that match the filter be included or excluded.
1680
+ module Operator
1681
+ extend Orb::Internal::Type::Enum
1682
+
1683
+ TaggedSymbol =
1684
+ T.type_alias do
1685
+ T.all(
1686
+ Symbol,
1687
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator
1688
+ )
1689
+ end
1690
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1691
+
1692
+ INCLUDES =
1693
+ T.let(
1694
+ :includes,
1695
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator::TaggedSymbol
1696
+ )
1697
+ EXCLUDES =
1698
+ T.let(
1699
+ :excludes,
1700
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator::TaggedSymbol
1701
+ )
1702
+
1703
+ sig do
1704
+ override.returns(
1705
+ T::Array[
1706
+ Orb::Subscription::AdjustmentInterval::Adjustment::Maximum::Filter::Operator::TaggedSymbol
1707
+ ]
1708
+ )
1709
+ end
1710
+ def self.values
1711
+ end
1712
+ end
1713
+ end
866
1714
  end
867
1715
 
868
1716
  sig do
@@ -965,10 +1813,6 @@ module Orb
965
1813
  sig { returns(String) }
966
1814
  attr_accessor :amount_discount
967
1815
 
968
- # The price ids that this discount interval applies to.
969
- sig { returns(T::Array[String]) }
970
- attr_accessor :applies_to_price_ids
971
-
972
1816
  # The price interval ids that this discount interval applies to.
973
1817
  sig { returns(T::Array[String]) }
974
1818
  attr_accessor :applies_to_price_interval_ids
@@ -980,6 +1824,14 @@ module Orb
980
1824
  sig { returns(T.nilable(Time)) }
981
1825
  attr_accessor :end_date
982
1826
 
1827
+ # The filters that determine which prices this discount interval applies to.
1828
+ sig do
1829
+ returns(
1830
+ T::Array[Orb::Subscription::DiscountInterval::Amount::Filter]
1831
+ )
1832
+ end
1833
+ attr_accessor :filters
1834
+
983
1835
  # The start date of the discount interval.
984
1836
  sig { returns(Time) }
985
1837
  attr_accessor :start_date
@@ -987,9 +1839,12 @@ module Orb
987
1839
  sig do
988
1840
  params(
989
1841
  amount_discount: String,
990
- applies_to_price_ids: T::Array[String],
991
1842
  applies_to_price_interval_ids: T::Array[String],
992
1843
  end_date: T.nilable(Time),
1844
+ filters:
1845
+ T::Array[
1846
+ Orb::Subscription::DiscountInterval::Amount::Filter::OrHash
1847
+ ],
993
1848
  start_date: Time,
994
1849
  discount_type: Symbol
995
1850
  ).returns(T.attached_class)
@@ -997,12 +1852,12 @@ module Orb
997
1852
  def self.new(
998
1853
  # Only available if discount_type is `amount`.
999
1854
  amount_discount:,
1000
- # The price ids that this discount interval applies to.
1001
- applies_to_price_ids:,
1002
1855
  # The price interval ids that this discount interval applies to.
1003
1856
  applies_to_price_interval_ids:,
1004
1857
  # The end date of the discount interval.
1005
1858
  end_date:,
1859
+ # The filters that determine which prices this discount interval applies to.
1860
+ filters:,
1006
1861
  # The start date of the discount interval.
1007
1862
  start_date:,
1008
1863
  discount_type: :amount
@@ -1013,16 +1868,165 @@ module Orb
1013
1868
  override.returns(
1014
1869
  {
1015
1870
  amount_discount: String,
1016
- applies_to_price_ids: T::Array[String],
1017
1871
  applies_to_price_interval_ids: T::Array[String],
1018
1872
  discount_type: Symbol,
1019
1873
  end_date: T.nilable(Time),
1874
+ filters:
1875
+ T::Array[Orb::Subscription::DiscountInterval::Amount::Filter],
1020
1876
  start_date: Time
1021
1877
  }
1022
1878
  )
1023
1879
  end
1024
1880
  def to_hash
1025
1881
  end
1882
+
1883
+ class Filter < Orb::Internal::Type::BaseModel
1884
+ OrHash =
1885
+ T.type_alias do
1886
+ T.any(
1887
+ Orb::Subscription::DiscountInterval::Amount::Filter,
1888
+ Orb::Internal::AnyHash
1889
+ )
1890
+ end
1891
+
1892
+ # The property of the price to filter on.
1893
+ sig do
1894
+ returns(
1895
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::TaggedSymbol
1896
+ )
1897
+ end
1898
+ attr_accessor :field
1899
+
1900
+ # Should prices that match the filter be included or excluded.
1901
+ sig do
1902
+ returns(
1903
+ Orb::Subscription::DiscountInterval::Amount::Filter::Operator::TaggedSymbol
1904
+ )
1905
+ end
1906
+ attr_accessor :operator
1907
+
1908
+ # The IDs or values that match this filter.
1909
+ sig { returns(T::Array[String]) }
1910
+ attr_accessor :values
1911
+
1912
+ sig do
1913
+ params(
1914
+ field:
1915
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::OrSymbol,
1916
+ operator:
1917
+ Orb::Subscription::DiscountInterval::Amount::Filter::Operator::OrSymbol,
1918
+ values: T::Array[String]
1919
+ ).returns(T.attached_class)
1920
+ end
1921
+ def self.new(
1922
+ # The property of the price to filter on.
1923
+ field:,
1924
+ # Should prices that match the filter be included or excluded.
1925
+ operator:,
1926
+ # The IDs or values that match this filter.
1927
+ values:
1928
+ )
1929
+ end
1930
+
1931
+ sig do
1932
+ override.returns(
1933
+ {
1934
+ field:
1935
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::TaggedSymbol,
1936
+ operator:
1937
+ Orb::Subscription::DiscountInterval::Amount::Filter::Operator::TaggedSymbol,
1938
+ values: T::Array[String]
1939
+ }
1940
+ )
1941
+ end
1942
+ def to_hash
1943
+ end
1944
+
1945
+ # The property of the price to filter on.
1946
+ module Field
1947
+ extend Orb::Internal::Type::Enum
1948
+
1949
+ TaggedSymbol =
1950
+ T.type_alias do
1951
+ T.all(
1952
+ Symbol,
1953
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field
1954
+ )
1955
+ end
1956
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1957
+
1958
+ PRICE_ID =
1959
+ T.let(
1960
+ :price_id,
1961
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::TaggedSymbol
1962
+ )
1963
+ ITEM_ID =
1964
+ T.let(
1965
+ :item_id,
1966
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::TaggedSymbol
1967
+ )
1968
+ PRICE_TYPE =
1969
+ T.let(
1970
+ :price_type,
1971
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::TaggedSymbol
1972
+ )
1973
+ CURRENCY =
1974
+ T.let(
1975
+ :currency,
1976
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::TaggedSymbol
1977
+ )
1978
+ PRICING_UNIT_ID =
1979
+ T.let(
1980
+ :pricing_unit_id,
1981
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::TaggedSymbol
1982
+ )
1983
+
1984
+ sig do
1985
+ override.returns(
1986
+ T::Array[
1987
+ Orb::Subscription::DiscountInterval::Amount::Filter::Field::TaggedSymbol
1988
+ ]
1989
+ )
1990
+ end
1991
+ def self.values
1992
+ end
1993
+ end
1994
+
1995
+ # Should prices that match the filter be included or excluded.
1996
+ module Operator
1997
+ extend Orb::Internal::Type::Enum
1998
+
1999
+ TaggedSymbol =
2000
+ T.type_alias do
2001
+ T.all(
2002
+ Symbol,
2003
+ Orb::Subscription::DiscountInterval::Amount::Filter::Operator
2004
+ )
2005
+ end
2006
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2007
+
2008
+ INCLUDES =
2009
+ T.let(
2010
+ :includes,
2011
+ Orb::Subscription::DiscountInterval::Amount::Filter::Operator::TaggedSymbol
2012
+ )
2013
+ EXCLUDES =
2014
+ T.let(
2015
+ :excludes,
2016
+ Orb::Subscription::DiscountInterval::Amount::Filter::Operator::TaggedSymbol
2017
+ )
2018
+
2019
+ sig do
2020
+ override.returns(
2021
+ T::Array[
2022
+ Orb::Subscription::DiscountInterval::Amount::Filter::Operator::TaggedSymbol
2023
+ ]
2024
+ )
2025
+ end
2026
+ def self.values
2027
+ end
2028
+ end
2029
+ end
1026
2030
  end
1027
2031
 
1028
2032
  class Percentage < Orb::Internal::Type::BaseModel
@@ -1034,10 +2038,6 @@ module Orb
1034
2038
  )
1035
2039
  end
1036
2040
 
1037
- # The price ids that this discount interval applies to.
1038
- sig { returns(T::Array[String]) }
1039
- attr_accessor :applies_to_price_ids
1040
-
1041
2041
  # The price interval ids that this discount interval applies to.
1042
2042
  sig { returns(T::Array[String]) }
1043
2043
  attr_accessor :applies_to_price_interval_ids
@@ -1049,6 +2049,14 @@ module Orb
1049
2049
  sig { returns(T.nilable(Time)) }
1050
2050
  attr_accessor :end_date
1051
2051
 
2052
+ # The filters that determine which prices this discount interval applies to.
2053
+ sig do
2054
+ returns(
2055
+ T::Array[Orb::Subscription::DiscountInterval::Percentage::Filter]
2056
+ )
2057
+ end
2058
+ attr_accessor :filters
2059
+
1052
2060
  # Only available if discount_type is `percentage`.This is a number between 0
1053
2061
  # and 1.
1054
2062
  sig { returns(Float) }
@@ -1060,21 +2068,24 @@ module Orb
1060
2068
 
1061
2069
  sig do
1062
2070
  params(
1063
- applies_to_price_ids: T::Array[String],
1064
2071
  applies_to_price_interval_ids: T::Array[String],
1065
2072
  end_date: T.nilable(Time),
2073
+ filters:
2074
+ T::Array[
2075
+ Orb::Subscription::DiscountInterval::Percentage::Filter::OrHash
2076
+ ],
1066
2077
  percentage_discount: Float,
1067
2078
  start_date: Time,
1068
2079
  discount_type: Symbol
1069
2080
  ).returns(T.attached_class)
1070
2081
  end
1071
2082
  def self.new(
1072
- # The price ids that this discount interval applies to.
1073
- applies_to_price_ids:,
1074
2083
  # The price interval ids that this discount interval applies to.
1075
2084
  applies_to_price_interval_ids:,
1076
2085
  # The end date of the discount interval.
1077
2086
  end_date:,
2087
+ # The filters that determine which prices this discount interval applies to.
2088
+ filters:,
1078
2089
  # Only available if discount_type is `percentage`.This is a number between 0
1079
2090
  # and 1.
1080
2091
  percentage_discount:,
@@ -1087,10 +2098,13 @@ module Orb
1087
2098
  sig do
1088
2099
  override.returns(
1089
2100
  {
1090
- applies_to_price_ids: T::Array[String],
1091
2101
  applies_to_price_interval_ids: T::Array[String],
1092
2102
  discount_type: Symbol,
1093
2103
  end_date: T.nilable(Time),
2104
+ filters:
2105
+ T::Array[
2106
+ Orb::Subscription::DiscountInterval::Percentage::Filter
2107
+ ],
1094
2108
  percentage_discount: Float,
1095
2109
  start_date: Time
1096
2110
  }
@@ -1098,6 +2112,154 @@ module Orb
1098
2112
  end
1099
2113
  def to_hash
1100
2114
  end
2115
+
2116
+ class Filter < Orb::Internal::Type::BaseModel
2117
+ OrHash =
2118
+ T.type_alias do
2119
+ T.any(
2120
+ Orb::Subscription::DiscountInterval::Percentage::Filter,
2121
+ Orb::Internal::AnyHash
2122
+ )
2123
+ end
2124
+
2125
+ # The property of the price to filter on.
2126
+ sig do
2127
+ returns(
2128
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::TaggedSymbol
2129
+ )
2130
+ end
2131
+ attr_accessor :field
2132
+
2133
+ # Should prices that match the filter be included or excluded.
2134
+ sig do
2135
+ returns(
2136
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Operator::TaggedSymbol
2137
+ )
2138
+ end
2139
+ attr_accessor :operator
2140
+
2141
+ # The IDs or values that match this filter.
2142
+ sig { returns(T::Array[String]) }
2143
+ attr_accessor :values
2144
+
2145
+ sig do
2146
+ params(
2147
+ field:
2148
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::OrSymbol,
2149
+ operator:
2150
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Operator::OrSymbol,
2151
+ values: T::Array[String]
2152
+ ).returns(T.attached_class)
2153
+ end
2154
+ def self.new(
2155
+ # The property of the price to filter on.
2156
+ field:,
2157
+ # Should prices that match the filter be included or excluded.
2158
+ operator:,
2159
+ # The IDs or values that match this filter.
2160
+ values:
2161
+ )
2162
+ end
2163
+
2164
+ sig do
2165
+ override.returns(
2166
+ {
2167
+ field:
2168
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::TaggedSymbol,
2169
+ operator:
2170
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Operator::TaggedSymbol,
2171
+ values: T::Array[String]
2172
+ }
2173
+ )
2174
+ end
2175
+ def to_hash
2176
+ end
2177
+
2178
+ # The property of the price to filter on.
2179
+ module Field
2180
+ extend Orb::Internal::Type::Enum
2181
+
2182
+ TaggedSymbol =
2183
+ T.type_alias do
2184
+ T.all(
2185
+ Symbol,
2186
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field
2187
+ )
2188
+ end
2189
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2190
+
2191
+ PRICE_ID =
2192
+ T.let(
2193
+ :price_id,
2194
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::TaggedSymbol
2195
+ )
2196
+ ITEM_ID =
2197
+ T.let(
2198
+ :item_id,
2199
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::TaggedSymbol
2200
+ )
2201
+ PRICE_TYPE =
2202
+ T.let(
2203
+ :price_type,
2204
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::TaggedSymbol
2205
+ )
2206
+ CURRENCY =
2207
+ T.let(
2208
+ :currency,
2209
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::TaggedSymbol
2210
+ )
2211
+ PRICING_UNIT_ID =
2212
+ T.let(
2213
+ :pricing_unit_id,
2214
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::TaggedSymbol
2215
+ )
2216
+
2217
+ sig do
2218
+ override.returns(
2219
+ T::Array[
2220
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Field::TaggedSymbol
2221
+ ]
2222
+ )
2223
+ end
2224
+ def self.values
2225
+ end
2226
+ end
2227
+
2228
+ # Should prices that match the filter be included or excluded.
2229
+ module Operator
2230
+ extend Orb::Internal::Type::Enum
2231
+
2232
+ TaggedSymbol =
2233
+ T.type_alias do
2234
+ T.all(
2235
+ Symbol,
2236
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Operator
2237
+ )
2238
+ end
2239
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2240
+
2241
+ INCLUDES =
2242
+ T.let(
2243
+ :includes,
2244
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Operator::TaggedSymbol
2245
+ )
2246
+ EXCLUDES =
2247
+ T.let(
2248
+ :excludes,
2249
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Operator::TaggedSymbol
2250
+ )
2251
+
2252
+ sig do
2253
+ override.returns(
2254
+ T::Array[
2255
+ Orb::Subscription::DiscountInterval::Percentage::Filter::Operator::TaggedSymbol
2256
+ ]
2257
+ )
2258
+ end
2259
+ def self.values
2260
+ end
2261
+ end
2262
+ end
1101
2263
  end
1102
2264
 
1103
2265
  class Usage < Orb::Internal::Type::BaseModel
@@ -1109,10 +2271,6 @@ module Orb
1109
2271
  )
1110
2272
  end
1111
2273
 
1112
- # The price ids that this discount interval applies to.
1113
- sig { returns(T::Array[String]) }
1114
- attr_accessor :applies_to_price_ids
1115
-
1116
2274
  # The price interval ids that this discount interval applies to.
1117
2275
  sig { returns(T::Array[String]) }
1118
2276
  attr_accessor :applies_to_price_interval_ids
@@ -1124,6 +2282,14 @@ module Orb
1124
2282
  sig { returns(T.nilable(Time)) }
1125
2283
  attr_accessor :end_date
1126
2284
 
2285
+ # The filters that determine which prices this discount interval applies to.
2286
+ sig do
2287
+ returns(
2288
+ T::Array[Orb::Subscription::DiscountInterval::Usage::Filter]
2289
+ )
2290
+ end
2291
+ attr_accessor :filters
2292
+
1127
2293
  # The start date of the discount interval.
1128
2294
  sig { returns(Time) }
1129
2295
  attr_accessor :start_date
@@ -1135,21 +2301,24 @@ module Orb
1135
2301
 
1136
2302
  sig do
1137
2303
  params(
1138
- applies_to_price_ids: T::Array[String],
1139
2304
  applies_to_price_interval_ids: T::Array[String],
1140
2305
  end_date: T.nilable(Time),
2306
+ filters:
2307
+ T::Array[
2308
+ Orb::Subscription::DiscountInterval::Usage::Filter::OrHash
2309
+ ],
1141
2310
  start_date: Time,
1142
2311
  usage_discount: Float,
1143
2312
  discount_type: Symbol
1144
2313
  ).returns(T.attached_class)
1145
2314
  end
1146
2315
  def self.new(
1147
- # The price ids that this discount interval applies to.
1148
- applies_to_price_ids:,
1149
2316
  # The price interval ids that this discount interval applies to.
1150
2317
  applies_to_price_interval_ids:,
1151
2318
  # The end date of the discount interval.
1152
2319
  end_date:,
2320
+ # The filters that determine which prices this discount interval applies to.
2321
+ filters:,
1153
2322
  # The start date of the discount interval.
1154
2323
  start_date:,
1155
2324
  # Only available if discount_type is `usage`. Number of usage units that this
@@ -1162,10 +2331,11 @@ module Orb
1162
2331
  sig do
1163
2332
  override.returns(
1164
2333
  {
1165
- applies_to_price_ids: T::Array[String],
1166
2334
  applies_to_price_interval_ids: T::Array[String],
1167
2335
  discount_type: Symbol,
1168
2336
  end_date: T.nilable(Time),
2337
+ filters:
2338
+ T::Array[Orb::Subscription::DiscountInterval::Usage::Filter],
1169
2339
  start_date: Time,
1170
2340
  usage_discount: Float
1171
2341
  }
@@ -1173,6 +2343,154 @@ module Orb
1173
2343
  end
1174
2344
  def to_hash
1175
2345
  end
2346
+
2347
+ class Filter < Orb::Internal::Type::BaseModel
2348
+ OrHash =
2349
+ T.type_alias do
2350
+ T.any(
2351
+ Orb::Subscription::DiscountInterval::Usage::Filter,
2352
+ Orb::Internal::AnyHash
2353
+ )
2354
+ end
2355
+
2356
+ # The property of the price to filter on.
2357
+ sig do
2358
+ returns(
2359
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::TaggedSymbol
2360
+ )
2361
+ end
2362
+ attr_accessor :field
2363
+
2364
+ # Should prices that match the filter be included or excluded.
2365
+ sig do
2366
+ returns(
2367
+ Orb::Subscription::DiscountInterval::Usage::Filter::Operator::TaggedSymbol
2368
+ )
2369
+ end
2370
+ attr_accessor :operator
2371
+
2372
+ # The IDs or values that match this filter.
2373
+ sig { returns(T::Array[String]) }
2374
+ attr_accessor :values
2375
+
2376
+ sig do
2377
+ params(
2378
+ field:
2379
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::OrSymbol,
2380
+ operator:
2381
+ Orb::Subscription::DiscountInterval::Usage::Filter::Operator::OrSymbol,
2382
+ values: T::Array[String]
2383
+ ).returns(T.attached_class)
2384
+ end
2385
+ def self.new(
2386
+ # The property of the price to filter on.
2387
+ field:,
2388
+ # Should prices that match the filter be included or excluded.
2389
+ operator:,
2390
+ # The IDs or values that match this filter.
2391
+ values:
2392
+ )
2393
+ end
2394
+
2395
+ sig do
2396
+ override.returns(
2397
+ {
2398
+ field:
2399
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::TaggedSymbol,
2400
+ operator:
2401
+ Orb::Subscription::DiscountInterval::Usage::Filter::Operator::TaggedSymbol,
2402
+ values: T::Array[String]
2403
+ }
2404
+ )
2405
+ end
2406
+ def to_hash
2407
+ end
2408
+
2409
+ # The property of the price to filter on.
2410
+ module Field
2411
+ extend Orb::Internal::Type::Enum
2412
+
2413
+ TaggedSymbol =
2414
+ T.type_alias do
2415
+ T.all(
2416
+ Symbol,
2417
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field
2418
+ )
2419
+ end
2420
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2421
+
2422
+ PRICE_ID =
2423
+ T.let(
2424
+ :price_id,
2425
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::TaggedSymbol
2426
+ )
2427
+ ITEM_ID =
2428
+ T.let(
2429
+ :item_id,
2430
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::TaggedSymbol
2431
+ )
2432
+ PRICE_TYPE =
2433
+ T.let(
2434
+ :price_type,
2435
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::TaggedSymbol
2436
+ )
2437
+ CURRENCY =
2438
+ T.let(
2439
+ :currency,
2440
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::TaggedSymbol
2441
+ )
2442
+ PRICING_UNIT_ID =
2443
+ T.let(
2444
+ :pricing_unit_id,
2445
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::TaggedSymbol
2446
+ )
2447
+
2448
+ sig do
2449
+ override.returns(
2450
+ T::Array[
2451
+ Orb::Subscription::DiscountInterval::Usage::Filter::Field::TaggedSymbol
2452
+ ]
2453
+ )
2454
+ end
2455
+ def self.values
2456
+ end
2457
+ end
2458
+
2459
+ # Should prices that match the filter be included or excluded.
2460
+ module Operator
2461
+ extend Orb::Internal::Type::Enum
2462
+
2463
+ TaggedSymbol =
2464
+ T.type_alias do
2465
+ T.all(
2466
+ Symbol,
2467
+ Orb::Subscription::DiscountInterval::Usage::Filter::Operator
2468
+ )
2469
+ end
2470
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2471
+
2472
+ INCLUDES =
2473
+ T.let(
2474
+ :includes,
2475
+ Orb::Subscription::DiscountInterval::Usage::Filter::Operator::TaggedSymbol
2476
+ )
2477
+ EXCLUDES =
2478
+ T.let(
2479
+ :excludes,
2480
+ Orb::Subscription::DiscountInterval::Usage::Filter::Operator::TaggedSymbol
2481
+ )
2482
+
2483
+ sig do
2484
+ override.returns(
2485
+ T::Array[
2486
+ Orb::Subscription::DiscountInterval::Usage::Filter::Operator::TaggedSymbol
2487
+ ]
2488
+ )
2489
+ end
2490
+ def self.values
2491
+ end
2492
+ end
2493
+ end
1176
2494
  end
1177
2495
 
1178
2496
  sig do
@@ -1236,10 +2554,6 @@ module Orb
1236
2554
  T.any(Orb::Subscription::MaximumInterval, Orb::Internal::AnyHash)
1237
2555
  end
1238
2556
 
1239
- # The price ids that this maximum interval applies to.
1240
- sig { returns(T::Array[String]) }
1241
- attr_accessor :applies_to_price_ids
1242
-
1243
2557
  # The price interval ids that this maximum interval applies to.
1244
2558
  sig { returns(T::Array[String]) }
1245
2559
  attr_accessor :applies_to_price_interval_ids
@@ -1248,6 +2562,10 @@ module Orb
1248
2562
  sig { returns(T.nilable(Time)) }
1249
2563
  attr_accessor :end_date
1250
2564
 
2565
+ # The filters that determine which prices this maximum interval applies to.
2566
+ sig { returns(T::Array[Orb::Subscription::MaximumInterval::Filter]) }
2567
+ attr_accessor :filters
2568
+
1251
2569
  # The maximum amount to charge in a given billing period for the price intervals
1252
2570
  # this transform applies to.
1253
2571
  sig { returns(String) }
@@ -1259,20 +2577,21 @@ module Orb
1259
2577
 
1260
2578
  sig do
1261
2579
  params(
1262
- applies_to_price_ids: T::Array[String],
1263
2580
  applies_to_price_interval_ids: T::Array[String],
1264
2581
  end_date: T.nilable(Time),
2582
+ filters:
2583
+ T::Array[Orb::Subscription::MaximumInterval::Filter::OrHash],
1265
2584
  maximum_amount: String,
1266
2585
  start_date: Time
1267
2586
  ).returns(T.attached_class)
1268
2587
  end
1269
2588
  def self.new(
1270
- # The price ids that this maximum interval applies to.
1271
- applies_to_price_ids:,
1272
2589
  # The price interval ids that this maximum interval applies to.
1273
2590
  applies_to_price_interval_ids:,
1274
2591
  # The end date of the maximum interval.
1275
2592
  end_date:,
2593
+ # The filters that determine which prices this maximum interval applies to.
2594
+ filters:,
1276
2595
  # The maximum amount to charge in a given billing period for the price intervals
1277
2596
  # this transform applies to.
1278
2597
  maximum_amount:,
@@ -1284,9 +2603,9 @@ module Orb
1284
2603
  sig do
1285
2604
  override.returns(
1286
2605
  {
1287
- applies_to_price_ids: T::Array[String],
1288
2606
  applies_to_price_interval_ids: T::Array[String],
1289
2607
  end_date: T.nilable(Time),
2608
+ filters: T::Array[Orb::Subscription::MaximumInterval::Filter],
1290
2609
  maximum_amount: String,
1291
2610
  start_date: Time
1292
2611
  }
@@ -1294,6 +2613,151 @@ module Orb
1294
2613
  end
1295
2614
  def to_hash
1296
2615
  end
2616
+
2617
+ class Filter < Orb::Internal::Type::BaseModel
2618
+ OrHash =
2619
+ T.type_alias do
2620
+ T.any(
2621
+ Orb::Subscription::MaximumInterval::Filter,
2622
+ Orb::Internal::AnyHash
2623
+ )
2624
+ end
2625
+
2626
+ # The property of the price to filter on.
2627
+ sig do
2628
+ returns(
2629
+ Orb::Subscription::MaximumInterval::Filter::Field::TaggedSymbol
2630
+ )
2631
+ end
2632
+ attr_accessor :field
2633
+
2634
+ # Should prices that match the filter be included or excluded.
2635
+ sig do
2636
+ returns(
2637
+ Orb::Subscription::MaximumInterval::Filter::Operator::TaggedSymbol
2638
+ )
2639
+ end
2640
+ attr_accessor :operator
2641
+
2642
+ # The IDs or values that match this filter.
2643
+ sig { returns(T::Array[String]) }
2644
+ attr_accessor :values
2645
+
2646
+ sig do
2647
+ params(
2648
+ field:
2649
+ Orb::Subscription::MaximumInterval::Filter::Field::OrSymbol,
2650
+ operator:
2651
+ Orb::Subscription::MaximumInterval::Filter::Operator::OrSymbol,
2652
+ values: T::Array[String]
2653
+ ).returns(T.attached_class)
2654
+ end
2655
+ def self.new(
2656
+ # The property of the price to filter on.
2657
+ field:,
2658
+ # Should prices that match the filter be included or excluded.
2659
+ operator:,
2660
+ # The IDs or values that match this filter.
2661
+ values:
2662
+ )
2663
+ end
2664
+
2665
+ sig do
2666
+ override.returns(
2667
+ {
2668
+ field:
2669
+ Orb::Subscription::MaximumInterval::Filter::Field::TaggedSymbol,
2670
+ operator:
2671
+ Orb::Subscription::MaximumInterval::Filter::Operator::TaggedSymbol,
2672
+ values: T::Array[String]
2673
+ }
2674
+ )
2675
+ end
2676
+ def to_hash
2677
+ end
2678
+
2679
+ # The property of the price to filter on.
2680
+ module Field
2681
+ extend Orb::Internal::Type::Enum
2682
+
2683
+ TaggedSymbol =
2684
+ T.type_alias do
2685
+ T.all(Symbol, Orb::Subscription::MaximumInterval::Filter::Field)
2686
+ end
2687
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2688
+
2689
+ PRICE_ID =
2690
+ T.let(
2691
+ :price_id,
2692
+ Orb::Subscription::MaximumInterval::Filter::Field::TaggedSymbol
2693
+ )
2694
+ ITEM_ID =
2695
+ T.let(
2696
+ :item_id,
2697
+ Orb::Subscription::MaximumInterval::Filter::Field::TaggedSymbol
2698
+ )
2699
+ PRICE_TYPE =
2700
+ T.let(
2701
+ :price_type,
2702
+ Orb::Subscription::MaximumInterval::Filter::Field::TaggedSymbol
2703
+ )
2704
+ CURRENCY =
2705
+ T.let(
2706
+ :currency,
2707
+ Orb::Subscription::MaximumInterval::Filter::Field::TaggedSymbol
2708
+ )
2709
+ PRICING_UNIT_ID =
2710
+ T.let(
2711
+ :pricing_unit_id,
2712
+ Orb::Subscription::MaximumInterval::Filter::Field::TaggedSymbol
2713
+ )
2714
+
2715
+ sig do
2716
+ override.returns(
2717
+ T::Array[
2718
+ Orb::Subscription::MaximumInterval::Filter::Field::TaggedSymbol
2719
+ ]
2720
+ )
2721
+ end
2722
+ def self.values
2723
+ end
2724
+ end
2725
+
2726
+ # Should prices that match the filter be included or excluded.
2727
+ module Operator
2728
+ extend Orb::Internal::Type::Enum
2729
+
2730
+ TaggedSymbol =
2731
+ T.type_alias do
2732
+ T.all(
2733
+ Symbol,
2734
+ Orb::Subscription::MaximumInterval::Filter::Operator
2735
+ )
2736
+ end
2737
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2738
+
2739
+ INCLUDES =
2740
+ T.let(
2741
+ :includes,
2742
+ Orb::Subscription::MaximumInterval::Filter::Operator::TaggedSymbol
2743
+ )
2744
+ EXCLUDES =
2745
+ T.let(
2746
+ :excludes,
2747
+ Orb::Subscription::MaximumInterval::Filter::Operator::TaggedSymbol
2748
+ )
2749
+
2750
+ sig do
2751
+ override.returns(
2752
+ T::Array[
2753
+ Orb::Subscription::MaximumInterval::Filter::Operator::TaggedSymbol
2754
+ ]
2755
+ )
2756
+ end
2757
+ def self.values
2758
+ end
2759
+ end
2760
+ end
1297
2761
  end
1298
2762
 
1299
2763
  class MinimumInterval < Orb::Internal::Type::BaseModel
@@ -1302,10 +2766,6 @@ module Orb
1302
2766
  T.any(Orb::Subscription::MinimumInterval, Orb::Internal::AnyHash)
1303
2767
  end
1304
2768
 
1305
- # The price ids that this minimum interval applies to.
1306
- sig { returns(T::Array[String]) }
1307
- attr_accessor :applies_to_price_ids
1308
-
1309
2769
  # The price interval ids that this minimum interval applies to.
1310
2770
  sig { returns(T::Array[String]) }
1311
2771
  attr_accessor :applies_to_price_interval_ids
@@ -1314,6 +2774,10 @@ module Orb
1314
2774
  sig { returns(T.nilable(Time)) }
1315
2775
  attr_accessor :end_date
1316
2776
 
2777
+ # The filters that determine which prices this minimum interval applies to.
2778
+ sig { returns(T::Array[Orb::Subscription::MinimumInterval::Filter]) }
2779
+ attr_accessor :filters
2780
+
1317
2781
  # The minimum amount to charge in a given billing period for the price intervals
1318
2782
  # this minimum applies to.
1319
2783
  sig { returns(String) }
@@ -1325,20 +2789,21 @@ module Orb
1325
2789
 
1326
2790
  sig do
1327
2791
  params(
1328
- applies_to_price_ids: T::Array[String],
1329
2792
  applies_to_price_interval_ids: T::Array[String],
1330
2793
  end_date: T.nilable(Time),
2794
+ filters:
2795
+ T::Array[Orb::Subscription::MinimumInterval::Filter::OrHash],
1331
2796
  minimum_amount: String,
1332
2797
  start_date: Time
1333
2798
  ).returns(T.attached_class)
1334
2799
  end
1335
2800
  def self.new(
1336
- # The price ids that this minimum interval applies to.
1337
- applies_to_price_ids:,
1338
2801
  # The price interval ids that this minimum interval applies to.
1339
2802
  applies_to_price_interval_ids:,
1340
2803
  # The end date of the minimum interval.
1341
2804
  end_date:,
2805
+ # The filters that determine which prices this minimum interval applies to.
2806
+ filters:,
1342
2807
  # The minimum amount to charge in a given billing period for the price intervals
1343
2808
  # this minimum applies to.
1344
2809
  minimum_amount:,
@@ -1350,9 +2815,9 @@ module Orb
1350
2815
  sig do
1351
2816
  override.returns(
1352
2817
  {
1353
- applies_to_price_ids: T::Array[String],
1354
2818
  applies_to_price_interval_ids: T::Array[String],
1355
2819
  end_date: T.nilable(Time),
2820
+ filters: T::Array[Orb::Subscription::MinimumInterval::Filter],
1356
2821
  minimum_amount: String,
1357
2822
  start_date: Time
1358
2823
  }
@@ -1360,6 +2825,151 @@ module Orb
1360
2825
  end
1361
2826
  def to_hash
1362
2827
  end
2828
+
2829
+ class Filter < Orb::Internal::Type::BaseModel
2830
+ OrHash =
2831
+ T.type_alias do
2832
+ T.any(
2833
+ Orb::Subscription::MinimumInterval::Filter,
2834
+ Orb::Internal::AnyHash
2835
+ )
2836
+ end
2837
+
2838
+ # The property of the price to filter on.
2839
+ sig do
2840
+ returns(
2841
+ Orb::Subscription::MinimumInterval::Filter::Field::TaggedSymbol
2842
+ )
2843
+ end
2844
+ attr_accessor :field
2845
+
2846
+ # Should prices that match the filter be included or excluded.
2847
+ sig do
2848
+ returns(
2849
+ Orb::Subscription::MinimumInterval::Filter::Operator::TaggedSymbol
2850
+ )
2851
+ end
2852
+ attr_accessor :operator
2853
+
2854
+ # The IDs or values that match this filter.
2855
+ sig { returns(T::Array[String]) }
2856
+ attr_accessor :values
2857
+
2858
+ sig do
2859
+ params(
2860
+ field:
2861
+ Orb::Subscription::MinimumInterval::Filter::Field::OrSymbol,
2862
+ operator:
2863
+ Orb::Subscription::MinimumInterval::Filter::Operator::OrSymbol,
2864
+ values: T::Array[String]
2865
+ ).returns(T.attached_class)
2866
+ end
2867
+ def self.new(
2868
+ # The property of the price to filter on.
2869
+ field:,
2870
+ # Should prices that match the filter be included or excluded.
2871
+ operator:,
2872
+ # The IDs or values that match this filter.
2873
+ values:
2874
+ )
2875
+ end
2876
+
2877
+ sig do
2878
+ override.returns(
2879
+ {
2880
+ field:
2881
+ Orb::Subscription::MinimumInterval::Filter::Field::TaggedSymbol,
2882
+ operator:
2883
+ Orb::Subscription::MinimumInterval::Filter::Operator::TaggedSymbol,
2884
+ values: T::Array[String]
2885
+ }
2886
+ )
2887
+ end
2888
+ def to_hash
2889
+ end
2890
+
2891
+ # The property of the price to filter on.
2892
+ module Field
2893
+ extend Orb::Internal::Type::Enum
2894
+
2895
+ TaggedSymbol =
2896
+ T.type_alias do
2897
+ T.all(Symbol, Orb::Subscription::MinimumInterval::Filter::Field)
2898
+ end
2899
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2900
+
2901
+ PRICE_ID =
2902
+ T.let(
2903
+ :price_id,
2904
+ Orb::Subscription::MinimumInterval::Filter::Field::TaggedSymbol
2905
+ )
2906
+ ITEM_ID =
2907
+ T.let(
2908
+ :item_id,
2909
+ Orb::Subscription::MinimumInterval::Filter::Field::TaggedSymbol
2910
+ )
2911
+ PRICE_TYPE =
2912
+ T.let(
2913
+ :price_type,
2914
+ Orb::Subscription::MinimumInterval::Filter::Field::TaggedSymbol
2915
+ )
2916
+ CURRENCY =
2917
+ T.let(
2918
+ :currency,
2919
+ Orb::Subscription::MinimumInterval::Filter::Field::TaggedSymbol
2920
+ )
2921
+ PRICING_UNIT_ID =
2922
+ T.let(
2923
+ :pricing_unit_id,
2924
+ Orb::Subscription::MinimumInterval::Filter::Field::TaggedSymbol
2925
+ )
2926
+
2927
+ sig do
2928
+ override.returns(
2929
+ T::Array[
2930
+ Orb::Subscription::MinimumInterval::Filter::Field::TaggedSymbol
2931
+ ]
2932
+ )
2933
+ end
2934
+ def self.values
2935
+ end
2936
+ end
2937
+
2938
+ # Should prices that match the filter be included or excluded.
2939
+ module Operator
2940
+ extend Orb::Internal::Type::Enum
2941
+
2942
+ TaggedSymbol =
2943
+ T.type_alias do
2944
+ T.all(
2945
+ Symbol,
2946
+ Orb::Subscription::MinimumInterval::Filter::Operator
2947
+ )
2948
+ end
2949
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2950
+
2951
+ INCLUDES =
2952
+ T.let(
2953
+ :includes,
2954
+ Orb::Subscription::MinimumInterval::Filter::Operator::TaggedSymbol
2955
+ )
2956
+ EXCLUDES =
2957
+ T.let(
2958
+ :excludes,
2959
+ Orb::Subscription::MinimumInterval::Filter::Operator::TaggedSymbol
2960
+ )
2961
+
2962
+ sig do
2963
+ override.returns(
2964
+ T::Array[
2965
+ Orb::Subscription::MinimumInterval::Filter::Operator::TaggedSymbol
2966
+ ]
2967
+ )
2968
+ end
2969
+ def self.values
2970
+ end
2971
+ end
2972
+ end
1363
2973
  end
1364
2974
 
1365
2975
  class PendingSubscriptionChange < Orb::Internal::Type::BaseModel