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
@@ -0,0 +1,1556 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ module Plans
6
+ class VersionCreateResponse < Orb::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Orb::Models::Plans::VersionCreateResponse,
11
+ Orb::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Adjustments for this plan. If the plan has phases, this includes adjustments
16
+ # across all phases of the plan.
17
+ sig do
18
+ returns(
19
+ T::Array[
20
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Variants
21
+ ]
22
+ )
23
+ end
24
+ attr_accessor :adjustments
25
+
26
+ sig { returns(Time) }
27
+ attr_accessor :created_at
28
+
29
+ sig do
30
+ returns(
31
+ T.nilable(
32
+ T::Array[Orb::Models::Plans::VersionCreateResponse::PlanPhase]
33
+ )
34
+ )
35
+ end
36
+ attr_accessor :plan_phases
37
+
38
+ # Prices for this plan. If the plan has phases, this includes prices across all
39
+ # phases of the plan.
40
+ sig { returns(T::Array[Orb::Price::Variants]) }
41
+ attr_accessor :prices
42
+
43
+ sig { returns(Integer) }
44
+ attr_accessor :version
45
+
46
+ # The PlanVersion resource represents the prices and adjustments present on a
47
+ # specific version of a plan.
48
+ sig do
49
+ params(
50
+ adjustments:
51
+ T::Array[
52
+ T.any(
53
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::OrHash,
54
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::OrHash,
55
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::OrHash,
56
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::OrHash,
57
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::OrHash
58
+ )
59
+ ],
60
+ created_at: Time,
61
+ plan_phases:
62
+ T.nilable(
63
+ T::Array[
64
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::OrHash
65
+ ]
66
+ ),
67
+ prices:
68
+ T::Array[
69
+ T.any(
70
+ Orb::Price::Unit::OrHash,
71
+ Orb::Price::Package::OrHash,
72
+ Orb::Price::Matrix::OrHash,
73
+ Orb::Price::Tiered::OrHash,
74
+ Orb::Price::TieredBps::OrHash,
75
+ Orb::Price::Bps::OrHash,
76
+ Orb::Price::BulkBps::OrHash,
77
+ Orb::Price::Bulk::OrHash,
78
+ Orb::Price::ThresholdTotalAmount::OrHash,
79
+ Orb::Price::TieredPackage::OrHash,
80
+ Orb::Price::GroupedTiered::OrHash,
81
+ Orb::Price::TieredWithMinimum::OrHash,
82
+ Orb::Price::TieredPackageWithMinimum::OrHash,
83
+ Orb::Price::PackageWithAllocation::OrHash,
84
+ Orb::Price::UnitWithPercent::OrHash,
85
+ Orb::Price::MatrixWithAllocation::OrHash,
86
+ Orb::Price::TieredWithProration::OrHash,
87
+ Orb::Price::UnitWithProration::OrHash,
88
+ Orb::Price::GroupedAllocation::OrHash,
89
+ Orb::Price::GroupedWithProratedMinimum::OrHash,
90
+ Orb::Price::GroupedWithMeteredMinimum::OrHash,
91
+ Orb::Price::MatrixWithDisplayName::OrHash,
92
+ Orb::Price::BulkWithProration::OrHash,
93
+ Orb::Price::GroupedTieredPackage::OrHash,
94
+ Orb::Price::MaxGroupTieredPackage::OrHash,
95
+ Orb::Price::ScalableMatrixWithUnitPricing::OrHash,
96
+ Orb::Price::ScalableMatrixWithTieredPricing::OrHash,
97
+ Orb::Price::CumulativeGroupedBulk::OrHash
98
+ )
99
+ ],
100
+ version: Integer
101
+ ).returns(T.attached_class)
102
+ end
103
+ def self.new(
104
+ # Adjustments for this plan. If the plan has phases, this includes adjustments
105
+ # across all phases of the plan.
106
+ adjustments:,
107
+ created_at:,
108
+ plan_phases:,
109
+ # Prices for this plan. If the plan has phases, this includes prices across all
110
+ # phases of the plan.
111
+ prices:,
112
+ version:
113
+ )
114
+ end
115
+
116
+ sig do
117
+ override.returns(
118
+ {
119
+ adjustments:
120
+ T::Array[
121
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Variants
122
+ ],
123
+ created_at: Time,
124
+ plan_phases:
125
+ T.nilable(
126
+ T::Array[Orb::Models::Plans::VersionCreateResponse::PlanPhase]
127
+ ),
128
+ prices: T::Array[Orb::Price::Variants],
129
+ version: Integer
130
+ }
131
+ )
132
+ end
133
+ def to_hash
134
+ end
135
+
136
+ module Adjustment
137
+ extend Orb::Internal::Type::Union
138
+
139
+ Variants =
140
+ T.type_alias do
141
+ T.any(
142
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount,
143
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount,
144
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount,
145
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum,
146
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum
147
+ )
148
+ end
149
+
150
+ class UsageDiscount < Orb::Internal::Type::BaseModel
151
+ OrHash =
152
+ T.type_alias do
153
+ T.any(
154
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount,
155
+ Orb::Internal::AnyHash
156
+ )
157
+ end
158
+
159
+ sig { returns(String) }
160
+ attr_accessor :id
161
+
162
+ sig { returns(Symbol) }
163
+ attr_accessor :adjustment_type
164
+
165
+ # The price IDs that this adjustment applies to.
166
+ sig { returns(T::Array[String]) }
167
+ attr_accessor :applies_to_price_ids
168
+
169
+ # The filters that determine which prices to apply this adjustment to.
170
+ sig do
171
+ returns(
172
+ T::Array[
173
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter
174
+ ]
175
+ )
176
+ end
177
+ attr_accessor :filters
178
+
179
+ # True for adjustments that apply to an entire invocice, false for adjustments
180
+ # that apply to only one price.
181
+ sig { returns(T::Boolean) }
182
+ attr_accessor :is_invoice_level
183
+
184
+ # The plan phase in which this adjustment is active.
185
+ sig { returns(T.nilable(Integer)) }
186
+ attr_accessor :plan_phase_order
187
+
188
+ # The reason for the adjustment.
189
+ sig { returns(T.nilable(String)) }
190
+ attr_accessor :reason
191
+
192
+ # The number of usage units by which to discount the price this adjustment applies
193
+ # to in a given billing period.
194
+ sig { returns(Float) }
195
+ attr_accessor :usage_discount
196
+
197
+ sig do
198
+ params(
199
+ id: String,
200
+ applies_to_price_ids: T::Array[String],
201
+ filters:
202
+ T::Array[
203
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::OrHash
204
+ ],
205
+ is_invoice_level: T::Boolean,
206
+ plan_phase_order: T.nilable(Integer),
207
+ reason: T.nilable(String),
208
+ usage_discount: Float,
209
+ adjustment_type: Symbol
210
+ ).returns(T.attached_class)
211
+ end
212
+ def self.new(
213
+ id:,
214
+ # The price IDs that this adjustment applies to.
215
+ applies_to_price_ids:,
216
+ # The filters that determine which prices to apply this adjustment to.
217
+ filters:,
218
+ # True for adjustments that apply to an entire invocice, false for adjustments
219
+ # that apply to only one price.
220
+ is_invoice_level:,
221
+ # The plan phase in which this adjustment is active.
222
+ plan_phase_order:,
223
+ # The reason for the adjustment.
224
+ reason:,
225
+ # The number of usage units by which to discount the price this adjustment applies
226
+ # to in a given billing period.
227
+ usage_discount:,
228
+ adjustment_type: :usage_discount
229
+ )
230
+ end
231
+
232
+ sig do
233
+ override.returns(
234
+ {
235
+ id: String,
236
+ adjustment_type: Symbol,
237
+ applies_to_price_ids: T::Array[String],
238
+ filters:
239
+ T::Array[
240
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter
241
+ ],
242
+ is_invoice_level: T::Boolean,
243
+ plan_phase_order: T.nilable(Integer),
244
+ reason: T.nilable(String),
245
+ usage_discount: Float
246
+ }
247
+ )
248
+ end
249
+ def to_hash
250
+ end
251
+
252
+ class Filter < Orb::Internal::Type::BaseModel
253
+ OrHash =
254
+ T.type_alias do
255
+ T.any(
256
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter,
257
+ Orb::Internal::AnyHash
258
+ )
259
+ end
260
+
261
+ # The property of the price to filter on.
262
+ sig do
263
+ returns(
264
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
265
+ )
266
+ end
267
+ attr_accessor :field
268
+
269
+ # Should prices that match the filter be included or excluded.
270
+ sig do
271
+ returns(
272
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
273
+ )
274
+ end
275
+ attr_accessor :operator
276
+
277
+ # The IDs or values that match this filter.
278
+ sig { returns(T::Array[String]) }
279
+ attr_accessor :values
280
+
281
+ sig do
282
+ params(
283
+ field:
284
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::OrSymbol,
285
+ operator:
286
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator::OrSymbol,
287
+ values: T::Array[String]
288
+ ).returns(T.attached_class)
289
+ end
290
+ def self.new(
291
+ # The property of the price to filter on.
292
+ field:,
293
+ # Should prices that match the filter be included or excluded.
294
+ operator:,
295
+ # The IDs or values that match this filter.
296
+ values:
297
+ )
298
+ end
299
+
300
+ sig do
301
+ override.returns(
302
+ {
303
+ field:
304
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol,
305
+ operator:
306
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol,
307
+ values: T::Array[String]
308
+ }
309
+ )
310
+ end
311
+ def to_hash
312
+ end
313
+
314
+ # The property of the price to filter on.
315
+ module Field
316
+ extend Orb::Internal::Type::Enum
317
+
318
+ TaggedSymbol =
319
+ T.type_alias do
320
+ T.all(
321
+ Symbol,
322
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field
323
+ )
324
+ end
325
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
326
+
327
+ PRICE_ID =
328
+ T.let(
329
+ :price_id,
330
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
331
+ )
332
+ ITEM_ID =
333
+ T.let(
334
+ :item_id,
335
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
336
+ )
337
+ PRICE_TYPE =
338
+ T.let(
339
+ :price_type,
340
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
341
+ )
342
+ CURRENCY =
343
+ T.let(
344
+ :currency,
345
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
346
+ )
347
+ PRICING_UNIT_ID =
348
+ T.let(
349
+ :pricing_unit_id,
350
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
351
+ )
352
+
353
+ sig do
354
+ override.returns(
355
+ T::Array[
356
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
357
+ ]
358
+ )
359
+ end
360
+ def self.values
361
+ end
362
+ end
363
+
364
+ # Should prices that match the filter be included or excluded.
365
+ module Operator
366
+ extend Orb::Internal::Type::Enum
367
+
368
+ TaggedSymbol =
369
+ T.type_alias do
370
+ T.all(
371
+ Symbol,
372
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator
373
+ )
374
+ end
375
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
376
+
377
+ INCLUDES =
378
+ T.let(
379
+ :includes,
380
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
381
+ )
382
+ EXCLUDES =
383
+ T.let(
384
+ :excludes,
385
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
386
+ )
387
+
388
+ sig do
389
+ override.returns(
390
+ T::Array[
391
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
392
+ ]
393
+ )
394
+ end
395
+ def self.values
396
+ end
397
+ end
398
+ end
399
+ end
400
+
401
+ class AmountDiscount < Orb::Internal::Type::BaseModel
402
+ OrHash =
403
+ T.type_alias do
404
+ T.any(
405
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount,
406
+ Orb::Internal::AnyHash
407
+ )
408
+ end
409
+
410
+ sig { returns(String) }
411
+ attr_accessor :id
412
+
413
+ sig { returns(Symbol) }
414
+ attr_accessor :adjustment_type
415
+
416
+ # The amount by which to discount the prices this adjustment applies to in a given
417
+ # billing period.
418
+ sig { returns(String) }
419
+ attr_accessor :amount_discount
420
+
421
+ # The price IDs that this adjustment applies to.
422
+ sig { returns(T::Array[String]) }
423
+ attr_accessor :applies_to_price_ids
424
+
425
+ # The filters that determine which prices to apply this adjustment to.
426
+ sig do
427
+ returns(
428
+ T::Array[
429
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter
430
+ ]
431
+ )
432
+ end
433
+ attr_accessor :filters
434
+
435
+ # True for adjustments that apply to an entire invocice, false for adjustments
436
+ # that apply to only one price.
437
+ sig { returns(T::Boolean) }
438
+ attr_accessor :is_invoice_level
439
+
440
+ # The plan phase in which this adjustment is active.
441
+ sig { returns(T.nilable(Integer)) }
442
+ attr_accessor :plan_phase_order
443
+
444
+ # The reason for the adjustment.
445
+ sig { returns(T.nilable(String)) }
446
+ attr_accessor :reason
447
+
448
+ sig do
449
+ params(
450
+ id: String,
451
+ amount_discount: String,
452
+ applies_to_price_ids: T::Array[String],
453
+ filters:
454
+ T::Array[
455
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::OrHash
456
+ ],
457
+ is_invoice_level: T::Boolean,
458
+ plan_phase_order: T.nilable(Integer),
459
+ reason: T.nilable(String),
460
+ adjustment_type: Symbol
461
+ ).returns(T.attached_class)
462
+ end
463
+ def self.new(
464
+ id:,
465
+ # The amount by which to discount the prices this adjustment applies to in a given
466
+ # billing period.
467
+ amount_discount:,
468
+ # The price IDs that this adjustment applies to.
469
+ applies_to_price_ids:,
470
+ # The filters that determine which prices to apply this adjustment to.
471
+ filters:,
472
+ # True for adjustments that apply to an entire invocice, false for adjustments
473
+ # that apply to only one price.
474
+ is_invoice_level:,
475
+ # The plan phase in which this adjustment is active.
476
+ plan_phase_order:,
477
+ # The reason for the adjustment.
478
+ reason:,
479
+ adjustment_type: :amount_discount
480
+ )
481
+ end
482
+
483
+ sig do
484
+ override.returns(
485
+ {
486
+ id: String,
487
+ adjustment_type: Symbol,
488
+ amount_discount: String,
489
+ applies_to_price_ids: T::Array[String],
490
+ filters:
491
+ T::Array[
492
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter
493
+ ],
494
+ is_invoice_level: T::Boolean,
495
+ plan_phase_order: T.nilable(Integer),
496
+ reason: T.nilable(String)
497
+ }
498
+ )
499
+ end
500
+ def to_hash
501
+ end
502
+
503
+ class Filter < Orb::Internal::Type::BaseModel
504
+ OrHash =
505
+ T.type_alias do
506
+ T.any(
507
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter,
508
+ Orb::Internal::AnyHash
509
+ )
510
+ end
511
+
512
+ # The property of the price to filter on.
513
+ sig do
514
+ returns(
515
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
516
+ )
517
+ end
518
+ attr_accessor :field
519
+
520
+ # Should prices that match the filter be included or excluded.
521
+ sig do
522
+ returns(
523
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
524
+ )
525
+ end
526
+ attr_accessor :operator
527
+
528
+ # The IDs or values that match this filter.
529
+ sig { returns(T::Array[String]) }
530
+ attr_accessor :values
531
+
532
+ sig do
533
+ params(
534
+ field:
535
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::OrSymbol,
536
+ operator:
537
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator::OrSymbol,
538
+ values: T::Array[String]
539
+ ).returns(T.attached_class)
540
+ end
541
+ def self.new(
542
+ # The property of the price to filter on.
543
+ field:,
544
+ # Should prices that match the filter be included or excluded.
545
+ operator:,
546
+ # The IDs or values that match this filter.
547
+ values:
548
+ )
549
+ end
550
+
551
+ sig do
552
+ override.returns(
553
+ {
554
+ field:
555
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol,
556
+ operator:
557
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol,
558
+ values: T::Array[String]
559
+ }
560
+ )
561
+ end
562
+ def to_hash
563
+ end
564
+
565
+ # The property of the price to filter on.
566
+ module Field
567
+ extend Orb::Internal::Type::Enum
568
+
569
+ TaggedSymbol =
570
+ T.type_alias do
571
+ T.all(
572
+ Symbol,
573
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field
574
+ )
575
+ end
576
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
577
+
578
+ PRICE_ID =
579
+ T.let(
580
+ :price_id,
581
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
582
+ )
583
+ ITEM_ID =
584
+ T.let(
585
+ :item_id,
586
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
587
+ )
588
+ PRICE_TYPE =
589
+ T.let(
590
+ :price_type,
591
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
592
+ )
593
+ CURRENCY =
594
+ T.let(
595
+ :currency,
596
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
597
+ )
598
+ PRICING_UNIT_ID =
599
+ T.let(
600
+ :pricing_unit_id,
601
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
602
+ )
603
+
604
+ sig do
605
+ override.returns(
606
+ T::Array[
607
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
608
+ ]
609
+ )
610
+ end
611
+ def self.values
612
+ end
613
+ end
614
+
615
+ # Should prices that match the filter be included or excluded.
616
+ module Operator
617
+ extend Orb::Internal::Type::Enum
618
+
619
+ TaggedSymbol =
620
+ T.type_alias do
621
+ T.all(
622
+ Symbol,
623
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator
624
+ )
625
+ end
626
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
627
+
628
+ INCLUDES =
629
+ T.let(
630
+ :includes,
631
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
632
+ )
633
+ EXCLUDES =
634
+ T.let(
635
+ :excludes,
636
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
637
+ )
638
+
639
+ sig do
640
+ override.returns(
641
+ T::Array[
642
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
643
+ ]
644
+ )
645
+ end
646
+ def self.values
647
+ end
648
+ end
649
+ end
650
+ end
651
+
652
+ class PercentageDiscount < Orb::Internal::Type::BaseModel
653
+ OrHash =
654
+ T.type_alias do
655
+ T.any(
656
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount,
657
+ Orb::Internal::AnyHash
658
+ )
659
+ end
660
+
661
+ sig { returns(String) }
662
+ attr_accessor :id
663
+
664
+ sig { returns(Symbol) }
665
+ attr_accessor :adjustment_type
666
+
667
+ # The price IDs that this adjustment applies to.
668
+ sig { returns(T::Array[String]) }
669
+ attr_accessor :applies_to_price_ids
670
+
671
+ # The filters that determine which prices to apply this adjustment to.
672
+ sig do
673
+ returns(
674
+ T::Array[
675
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter
676
+ ]
677
+ )
678
+ end
679
+ attr_accessor :filters
680
+
681
+ # True for adjustments that apply to an entire invocice, false for adjustments
682
+ # that apply to only one price.
683
+ sig { returns(T::Boolean) }
684
+ attr_accessor :is_invoice_level
685
+
686
+ # The percentage (as a value between 0 and 1) by which to discount the price
687
+ # intervals this adjustment applies to in a given billing period.
688
+ sig { returns(Float) }
689
+ attr_accessor :percentage_discount
690
+
691
+ # The plan phase in which this adjustment is active.
692
+ sig { returns(T.nilable(Integer)) }
693
+ attr_accessor :plan_phase_order
694
+
695
+ # The reason for the adjustment.
696
+ sig { returns(T.nilable(String)) }
697
+ attr_accessor :reason
698
+
699
+ sig do
700
+ params(
701
+ id: String,
702
+ applies_to_price_ids: T::Array[String],
703
+ filters:
704
+ T::Array[
705
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::OrHash
706
+ ],
707
+ is_invoice_level: T::Boolean,
708
+ percentage_discount: Float,
709
+ plan_phase_order: T.nilable(Integer),
710
+ reason: T.nilable(String),
711
+ adjustment_type: Symbol
712
+ ).returns(T.attached_class)
713
+ end
714
+ def self.new(
715
+ id:,
716
+ # The price IDs that this adjustment applies to.
717
+ applies_to_price_ids:,
718
+ # The filters that determine which prices to apply this adjustment to.
719
+ filters:,
720
+ # True for adjustments that apply to an entire invocice, false for adjustments
721
+ # that apply to only one price.
722
+ is_invoice_level:,
723
+ # The percentage (as a value between 0 and 1) by which to discount the price
724
+ # intervals this adjustment applies to in a given billing period.
725
+ percentage_discount:,
726
+ # The plan phase in which this adjustment is active.
727
+ plan_phase_order:,
728
+ # The reason for the adjustment.
729
+ reason:,
730
+ adjustment_type: :percentage_discount
731
+ )
732
+ end
733
+
734
+ sig do
735
+ override.returns(
736
+ {
737
+ id: String,
738
+ adjustment_type: Symbol,
739
+ applies_to_price_ids: T::Array[String],
740
+ filters:
741
+ T::Array[
742
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter
743
+ ],
744
+ is_invoice_level: T::Boolean,
745
+ percentage_discount: Float,
746
+ plan_phase_order: T.nilable(Integer),
747
+ reason: T.nilable(String)
748
+ }
749
+ )
750
+ end
751
+ def to_hash
752
+ end
753
+
754
+ class Filter < Orb::Internal::Type::BaseModel
755
+ OrHash =
756
+ T.type_alias do
757
+ T.any(
758
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter,
759
+ Orb::Internal::AnyHash
760
+ )
761
+ end
762
+
763
+ # The property of the price to filter on.
764
+ sig do
765
+ returns(
766
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
767
+ )
768
+ end
769
+ attr_accessor :field
770
+
771
+ # Should prices that match the filter be included or excluded.
772
+ sig do
773
+ returns(
774
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
775
+ )
776
+ end
777
+ attr_accessor :operator
778
+
779
+ # The IDs or values that match this filter.
780
+ sig { returns(T::Array[String]) }
781
+ attr_accessor :values
782
+
783
+ sig do
784
+ params(
785
+ field:
786
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::OrSymbol,
787
+ operator:
788
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator::OrSymbol,
789
+ values: T::Array[String]
790
+ ).returns(T.attached_class)
791
+ end
792
+ def self.new(
793
+ # The property of the price to filter on.
794
+ field:,
795
+ # Should prices that match the filter be included or excluded.
796
+ operator:,
797
+ # The IDs or values that match this filter.
798
+ values:
799
+ )
800
+ end
801
+
802
+ sig do
803
+ override.returns(
804
+ {
805
+ field:
806
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol,
807
+ operator:
808
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol,
809
+ values: T::Array[String]
810
+ }
811
+ )
812
+ end
813
+ def to_hash
814
+ end
815
+
816
+ # The property of the price to filter on.
817
+ module Field
818
+ extend Orb::Internal::Type::Enum
819
+
820
+ TaggedSymbol =
821
+ T.type_alias do
822
+ T.all(
823
+ Symbol,
824
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field
825
+ )
826
+ end
827
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
828
+
829
+ PRICE_ID =
830
+ T.let(
831
+ :price_id,
832
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
833
+ )
834
+ ITEM_ID =
835
+ T.let(
836
+ :item_id,
837
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
838
+ )
839
+ PRICE_TYPE =
840
+ T.let(
841
+ :price_type,
842
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
843
+ )
844
+ CURRENCY =
845
+ T.let(
846
+ :currency,
847
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
848
+ )
849
+ PRICING_UNIT_ID =
850
+ T.let(
851
+ :pricing_unit_id,
852
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
853
+ )
854
+
855
+ sig do
856
+ override.returns(
857
+ T::Array[
858
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
859
+ ]
860
+ )
861
+ end
862
+ def self.values
863
+ end
864
+ end
865
+
866
+ # Should prices that match the filter be included or excluded.
867
+ module Operator
868
+ extend Orb::Internal::Type::Enum
869
+
870
+ TaggedSymbol =
871
+ T.type_alias do
872
+ T.all(
873
+ Symbol,
874
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator
875
+ )
876
+ end
877
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
878
+
879
+ INCLUDES =
880
+ T.let(
881
+ :includes,
882
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
883
+ )
884
+ EXCLUDES =
885
+ T.let(
886
+ :excludes,
887
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
888
+ )
889
+
890
+ sig do
891
+ override.returns(
892
+ T::Array[
893
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
894
+ ]
895
+ )
896
+ end
897
+ def self.values
898
+ end
899
+ end
900
+ end
901
+ end
902
+
903
+ class Minimum < Orb::Internal::Type::BaseModel
904
+ OrHash =
905
+ T.type_alias do
906
+ T.any(
907
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum,
908
+ Orb::Internal::AnyHash
909
+ )
910
+ end
911
+
912
+ sig { returns(String) }
913
+ attr_accessor :id
914
+
915
+ sig { returns(Symbol) }
916
+ attr_accessor :adjustment_type
917
+
918
+ # The price IDs that this adjustment applies to.
919
+ sig { returns(T::Array[String]) }
920
+ attr_accessor :applies_to_price_ids
921
+
922
+ # The filters that determine which prices to apply this adjustment to.
923
+ sig do
924
+ returns(
925
+ T::Array[
926
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter
927
+ ]
928
+ )
929
+ end
930
+ attr_accessor :filters
931
+
932
+ # True for adjustments that apply to an entire invocice, false for adjustments
933
+ # that apply to only one price.
934
+ sig { returns(T::Boolean) }
935
+ attr_accessor :is_invoice_level
936
+
937
+ # The item ID that revenue from this minimum will be attributed to.
938
+ sig { returns(String) }
939
+ attr_accessor :item_id
940
+
941
+ # The minimum amount to charge in a given billing period for the prices this
942
+ # adjustment applies to.
943
+ sig { returns(String) }
944
+ attr_accessor :minimum_amount
945
+
946
+ # The plan phase in which this adjustment is active.
947
+ sig { returns(T.nilable(Integer)) }
948
+ attr_accessor :plan_phase_order
949
+
950
+ # The reason for the adjustment.
951
+ sig { returns(T.nilable(String)) }
952
+ attr_accessor :reason
953
+
954
+ sig do
955
+ params(
956
+ id: String,
957
+ applies_to_price_ids: T::Array[String],
958
+ filters:
959
+ T::Array[
960
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::OrHash
961
+ ],
962
+ is_invoice_level: T::Boolean,
963
+ item_id: String,
964
+ minimum_amount: String,
965
+ plan_phase_order: T.nilable(Integer),
966
+ reason: T.nilable(String),
967
+ adjustment_type: Symbol
968
+ ).returns(T.attached_class)
969
+ end
970
+ def self.new(
971
+ id:,
972
+ # The price IDs that this adjustment applies to.
973
+ applies_to_price_ids:,
974
+ # The filters that determine which prices to apply this adjustment to.
975
+ filters:,
976
+ # True for adjustments that apply to an entire invocice, false for adjustments
977
+ # that apply to only one price.
978
+ is_invoice_level:,
979
+ # The item ID that revenue from this minimum will be attributed to.
980
+ item_id:,
981
+ # The minimum amount to charge in a given billing period for the prices this
982
+ # adjustment applies to.
983
+ minimum_amount:,
984
+ # The plan phase in which this adjustment is active.
985
+ plan_phase_order:,
986
+ # The reason for the adjustment.
987
+ reason:,
988
+ adjustment_type: :minimum
989
+ )
990
+ end
991
+
992
+ sig do
993
+ override.returns(
994
+ {
995
+ id: String,
996
+ adjustment_type: Symbol,
997
+ applies_to_price_ids: T::Array[String],
998
+ filters:
999
+ T::Array[
1000
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter
1001
+ ],
1002
+ is_invoice_level: T::Boolean,
1003
+ item_id: String,
1004
+ minimum_amount: String,
1005
+ plan_phase_order: T.nilable(Integer),
1006
+ reason: T.nilable(String)
1007
+ }
1008
+ )
1009
+ end
1010
+ def to_hash
1011
+ end
1012
+
1013
+ class Filter < Orb::Internal::Type::BaseModel
1014
+ OrHash =
1015
+ T.type_alias do
1016
+ T.any(
1017
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter,
1018
+ Orb::Internal::AnyHash
1019
+ )
1020
+ end
1021
+
1022
+ # The property of the price to filter on.
1023
+ sig do
1024
+ returns(
1025
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::TaggedSymbol
1026
+ )
1027
+ end
1028
+ attr_accessor :field
1029
+
1030
+ # Should prices that match the filter be included or excluded.
1031
+ sig do
1032
+ returns(
1033
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Operator::TaggedSymbol
1034
+ )
1035
+ end
1036
+ attr_accessor :operator
1037
+
1038
+ # The IDs or values that match this filter.
1039
+ sig { returns(T::Array[String]) }
1040
+ attr_accessor :values
1041
+
1042
+ sig do
1043
+ params(
1044
+ field:
1045
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::OrSymbol,
1046
+ operator:
1047
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Operator::OrSymbol,
1048
+ values: T::Array[String]
1049
+ ).returns(T.attached_class)
1050
+ end
1051
+ def self.new(
1052
+ # The property of the price to filter on.
1053
+ field:,
1054
+ # Should prices that match the filter be included or excluded.
1055
+ operator:,
1056
+ # The IDs or values that match this filter.
1057
+ values:
1058
+ )
1059
+ end
1060
+
1061
+ sig do
1062
+ override.returns(
1063
+ {
1064
+ field:
1065
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::TaggedSymbol,
1066
+ operator:
1067
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Operator::TaggedSymbol,
1068
+ values: T::Array[String]
1069
+ }
1070
+ )
1071
+ end
1072
+ def to_hash
1073
+ end
1074
+
1075
+ # The property of the price to filter on.
1076
+ module Field
1077
+ extend Orb::Internal::Type::Enum
1078
+
1079
+ TaggedSymbol =
1080
+ T.type_alias do
1081
+ T.all(
1082
+ Symbol,
1083
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field
1084
+ )
1085
+ end
1086
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1087
+
1088
+ PRICE_ID =
1089
+ T.let(
1090
+ :price_id,
1091
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::TaggedSymbol
1092
+ )
1093
+ ITEM_ID =
1094
+ T.let(
1095
+ :item_id,
1096
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::TaggedSymbol
1097
+ )
1098
+ PRICE_TYPE =
1099
+ T.let(
1100
+ :price_type,
1101
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::TaggedSymbol
1102
+ )
1103
+ CURRENCY =
1104
+ T.let(
1105
+ :currency,
1106
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::TaggedSymbol
1107
+ )
1108
+ PRICING_UNIT_ID =
1109
+ T.let(
1110
+ :pricing_unit_id,
1111
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::TaggedSymbol
1112
+ )
1113
+
1114
+ sig do
1115
+ override.returns(
1116
+ T::Array[
1117
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Field::TaggedSymbol
1118
+ ]
1119
+ )
1120
+ end
1121
+ def self.values
1122
+ end
1123
+ end
1124
+
1125
+ # Should prices that match the filter be included or excluded.
1126
+ module Operator
1127
+ extend Orb::Internal::Type::Enum
1128
+
1129
+ TaggedSymbol =
1130
+ T.type_alias do
1131
+ T.all(
1132
+ Symbol,
1133
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Operator
1134
+ )
1135
+ end
1136
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1137
+
1138
+ INCLUDES =
1139
+ T.let(
1140
+ :includes,
1141
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Operator::TaggedSymbol
1142
+ )
1143
+ EXCLUDES =
1144
+ T.let(
1145
+ :excludes,
1146
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Operator::TaggedSymbol
1147
+ )
1148
+
1149
+ sig do
1150
+ override.returns(
1151
+ T::Array[
1152
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Minimum::Filter::Operator::TaggedSymbol
1153
+ ]
1154
+ )
1155
+ end
1156
+ def self.values
1157
+ end
1158
+ end
1159
+ end
1160
+ end
1161
+
1162
+ class Maximum < Orb::Internal::Type::BaseModel
1163
+ OrHash =
1164
+ T.type_alias do
1165
+ T.any(
1166
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum,
1167
+ Orb::Internal::AnyHash
1168
+ )
1169
+ end
1170
+
1171
+ sig { returns(String) }
1172
+ attr_accessor :id
1173
+
1174
+ sig { returns(Symbol) }
1175
+ attr_accessor :adjustment_type
1176
+
1177
+ # The price IDs that this adjustment applies to.
1178
+ sig { returns(T::Array[String]) }
1179
+ attr_accessor :applies_to_price_ids
1180
+
1181
+ # The filters that determine which prices to apply this adjustment to.
1182
+ sig do
1183
+ returns(
1184
+ T::Array[
1185
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter
1186
+ ]
1187
+ )
1188
+ end
1189
+ attr_accessor :filters
1190
+
1191
+ # True for adjustments that apply to an entire invocice, false for adjustments
1192
+ # that apply to only one price.
1193
+ sig { returns(T::Boolean) }
1194
+ attr_accessor :is_invoice_level
1195
+
1196
+ # The maximum amount to charge in a given billing period for the prices this
1197
+ # adjustment applies to.
1198
+ sig { returns(String) }
1199
+ attr_accessor :maximum_amount
1200
+
1201
+ # The plan phase in which this adjustment is active.
1202
+ sig { returns(T.nilable(Integer)) }
1203
+ attr_accessor :plan_phase_order
1204
+
1205
+ # The reason for the adjustment.
1206
+ sig { returns(T.nilable(String)) }
1207
+ attr_accessor :reason
1208
+
1209
+ sig do
1210
+ params(
1211
+ id: String,
1212
+ applies_to_price_ids: T::Array[String],
1213
+ filters:
1214
+ T::Array[
1215
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::OrHash
1216
+ ],
1217
+ is_invoice_level: T::Boolean,
1218
+ maximum_amount: String,
1219
+ plan_phase_order: T.nilable(Integer),
1220
+ reason: T.nilable(String),
1221
+ adjustment_type: Symbol
1222
+ ).returns(T.attached_class)
1223
+ end
1224
+ def self.new(
1225
+ id:,
1226
+ # The price IDs that this adjustment applies to.
1227
+ applies_to_price_ids:,
1228
+ # The filters that determine which prices to apply this adjustment to.
1229
+ filters:,
1230
+ # True for adjustments that apply to an entire invocice, false for adjustments
1231
+ # that apply to only one price.
1232
+ is_invoice_level:,
1233
+ # The maximum amount to charge in a given billing period for the prices this
1234
+ # adjustment applies to.
1235
+ maximum_amount:,
1236
+ # The plan phase in which this adjustment is active.
1237
+ plan_phase_order:,
1238
+ # The reason for the adjustment.
1239
+ reason:,
1240
+ adjustment_type: :maximum
1241
+ )
1242
+ end
1243
+
1244
+ sig do
1245
+ override.returns(
1246
+ {
1247
+ id: String,
1248
+ adjustment_type: Symbol,
1249
+ applies_to_price_ids: T::Array[String],
1250
+ filters:
1251
+ T::Array[
1252
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter
1253
+ ],
1254
+ is_invoice_level: T::Boolean,
1255
+ maximum_amount: String,
1256
+ plan_phase_order: T.nilable(Integer),
1257
+ reason: T.nilable(String)
1258
+ }
1259
+ )
1260
+ end
1261
+ def to_hash
1262
+ end
1263
+
1264
+ class Filter < Orb::Internal::Type::BaseModel
1265
+ OrHash =
1266
+ T.type_alias do
1267
+ T.any(
1268
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter,
1269
+ Orb::Internal::AnyHash
1270
+ )
1271
+ end
1272
+
1273
+ # The property of the price to filter on.
1274
+ sig do
1275
+ returns(
1276
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::TaggedSymbol
1277
+ )
1278
+ end
1279
+ attr_accessor :field
1280
+
1281
+ # Should prices that match the filter be included or excluded.
1282
+ sig do
1283
+ returns(
1284
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Operator::TaggedSymbol
1285
+ )
1286
+ end
1287
+ attr_accessor :operator
1288
+
1289
+ # The IDs or values that match this filter.
1290
+ sig { returns(T::Array[String]) }
1291
+ attr_accessor :values
1292
+
1293
+ sig do
1294
+ params(
1295
+ field:
1296
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::OrSymbol,
1297
+ operator:
1298
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Operator::OrSymbol,
1299
+ values: T::Array[String]
1300
+ ).returns(T.attached_class)
1301
+ end
1302
+ def self.new(
1303
+ # The property of the price to filter on.
1304
+ field:,
1305
+ # Should prices that match the filter be included or excluded.
1306
+ operator:,
1307
+ # The IDs or values that match this filter.
1308
+ values:
1309
+ )
1310
+ end
1311
+
1312
+ sig do
1313
+ override.returns(
1314
+ {
1315
+ field:
1316
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::TaggedSymbol,
1317
+ operator:
1318
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Operator::TaggedSymbol,
1319
+ values: T::Array[String]
1320
+ }
1321
+ )
1322
+ end
1323
+ def to_hash
1324
+ end
1325
+
1326
+ # The property of the price to filter on.
1327
+ module Field
1328
+ extend Orb::Internal::Type::Enum
1329
+
1330
+ TaggedSymbol =
1331
+ T.type_alias do
1332
+ T.all(
1333
+ Symbol,
1334
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field
1335
+ )
1336
+ end
1337
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1338
+
1339
+ PRICE_ID =
1340
+ T.let(
1341
+ :price_id,
1342
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::TaggedSymbol
1343
+ )
1344
+ ITEM_ID =
1345
+ T.let(
1346
+ :item_id,
1347
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::TaggedSymbol
1348
+ )
1349
+ PRICE_TYPE =
1350
+ T.let(
1351
+ :price_type,
1352
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::TaggedSymbol
1353
+ )
1354
+ CURRENCY =
1355
+ T.let(
1356
+ :currency,
1357
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::TaggedSymbol
1358
+ )
1359
+ PRICING_UNIT_ID =
1360
+ T.let(
1361
+ :pricing_unit_id,
1362
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::TaggedSymbol
1363
+ )
1364
+
1365
+ sig do
1366
+ override.returns(
1367
+ T::Array[
1368
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Field::TaggedSymbol
1369
+ ]
1370
+ )
1371
+ end
1372
+ def self.values
1373
+ end
1374
+ end
1375
+
1376
+ # Should prices that match the filter be included or excluded.
1377
+ module Operator
1378
+ extend Orb::Internal::Type::Enum
1379
+
1380
+ TaggedSymbol =
1381
+ T.type_alias do
1382
+ T.all(
1383
+ Symbol,
1384
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Operator
1385
+ )
1386
+ end
1387
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1388
+
1389
+ INCLUDES =
1390
+ T.let(
1391
+ :includes,
1392
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Operator::TaggedSymbol
1393
+ )
1394
+ EXCLUDES =
1395
+ T.let(
1396
+ :excludes,
1397
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Operator::TaggedSymbol
1398
+ )
1399
+
1400
+ sig do
1401
+ override.returns(
1402
+ T::Array[
1403
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Maximum::Filter::Operator::TaggedSymbol
1404
+ ]
1405
+ )
1406
+ end
1407
+ def self.values
1408
+ end
1409
+ end
1410
+ end
1411
+ end
1412
+
1413
+ sig do
1414
+ override.returns(
1415
+ T::Array[
1416
+ Orb::Models::Plans::VersionCreateResponse::Adjustment::Variants
1417
+ ]
1418
+ )
1419
+ end
1420
+ def self.variants
1421
+ end
1422
+ end
1423
+
1424
+ class PlanPhase < Orb::Internal::Type::BaseModel
1425
+ OrHash =
1426
+ T.type_alias do
1427
+ T.any(
1428
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase,
1429
+ Orb::Internal::AnyHash
1430
+ )
1431
+ end
1432
+
1433
+ sig { returns(String) }
1434
+ attr_accessor :id
1435
+
1436
+ sig { returns(T.nilable(String)) }
1437
+ attr_accessor :description
1438
+
1439
+ # How many terms of length `duration_unit` this phase is active for. If null, this
1440
+ # phase is evergreen and active indefinitely
1441
+ sig { returns(T.nilable(Integer)) }
1442
+ attr_accessor :duration
1443
+
1444
+ sig do
1445
+ returns(
1446
+ T.nilable(
1447
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::TaggedSymbol
1448
+ )
1449
+ )
1450
+ end
1451
+ attr_accessor :duration_unit
1452
+
1453
+ sig { returns(String) }
1454
+ attr_accessor :name
1455
+
1456
+ # Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.
1457
+ sig { returns(Integer) }
1458
+ attr_accessor :order
1459
+
1460
+ sig do
1461
+ params(
1462
+ id: String,
1463
+ description: T.nilable(String),
1464
+ duration: T.nilable(Integer),
1465
+ duration_unit:
1466
+ T.nilable(
1467
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::OrSymbol
1468
+ ),
1469
+ name: String,
1470
+ order: Integer
1471
+ ).returns(T.attached_class)
1472
+ end
1473
+ def self.new(
1474
+ id:,
1475
+ description:,
1476
+ # How many terms of length `duration_unit` this phase is active for. If null, this
1477
+ # phase is evergreen and active indefinitely
1478
+ duration:,
1479
+ duration_unit:,
1480
+ name:,
1481
+ # Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.
1482
+ order:
1483
+ )
1484
+ end
1485
+
1486
+ sig do
1487
+ override.returns(
1488
+ {
1489
+ id: String,
1490
+ description: T.nilable(String),
1491
+ duration: T.nilable(Integer),
1492
+ duration_unit:
1493
+ T.nilable(
1494
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::TaggedSymbol
1495
+ ),
1496
+ name: String,
1497
+ order: Integer
1498
+ }
1499
+ )
1500
+ end
1501
+ def to_hash
1502
+ end
1503
+
1504
+ module DurationUnit
1505
+ extend Orb::Internal::Type::Enum
1506
+
1507
+ TaggedSymbol =
1508
+ T.type_alias do
1509
+ T.all(
1510
+ Symbol,
1511
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit
1512
+ )
1513
+ end
1514
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1515
+
1516
+ DAILY =
1517
+ T.let(
1518
+ :daily,
1519
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::TaggedSymbol
1520
+ )
1521
+ MONTHLY =
1522
+ T.let(
1523
+ :monthly,
1524
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::TaggedSymbol
1525
+ )
1526
+ QUARTERLY =
1527
+ T.let(
1528
+ :quarterly,
1529
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::TaggedSymbol
1530
+ )
1531
+ SEMI_ANNUAL =
1532
+ T.let(
1533
+ :semi_annual,
1534
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::TaggedSymbol
1535
+ )
1536
+ ANNUAL =
1537
+ T.let(
1538
+ :annual,
1539
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::TaggedSymbol
1540
+ )
1541
+
1542
+ sig do
1543
+ override.returns(
1544
+ T::Array[
1545
+ Orb::Models::Plans::VersionCreateResponse::PlanPhase::DurationUnit::TaggedSymbol
1546
+ ]
1547
+ )
1548
+ end
1549
+ def self.values
1550
+ end
1551
+ end
1552
+ end
1553
+ end
1554
+ end
1555
+ end
1556
+ end