orb-billing 0.6.0 → 0.8.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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +4 -0
  5. data/lib/orb/models/{plans/version_create_params.rb → beta/external_plan_id_create_plan_version_params.rb} +1980 -1744
  6. data/lib/orb/models/beta/external_plan_id_fetch_plan_version_params.rb +22 -0
  7. data/lib/orb/models/{plans/external_plan_id_set_default_version_params.rb → beta/external_plan_id_set_default_plan_version_params.rb} +3 -3
  8. data/lib/orb/models/beta_create_plan_version_params.rb +17844 -0
  9. data/lib/orb/models/beta_fetch_plan_version_params.rb +20 -0
  10. data/lib/orb/models/{plan_set_default_version_params.rb → beta_set_default_plan_version_params.rb} +2 -2
  11. data/lib/orb/models/plan_version.rb +735 -0
  12. data/lib/orb/models/plan_version_phase.rb +70 -0
  13. data/lib/orb/models/price.rb +1114 -28
  14. data/lib/orb/models/price_evaluate_multiple_params.rb +8620 -0
  15. data/lib/orb/models/price_evaluate_multiple_response.rb +51 -0
  16. data/lib/orb/models/price_evaluate_params.rb +21 -8529
  17. data/lib/orb/models/price_evaluate_response.rb +3 -38
  18. data/lib/orb/models/subscription_create_params.rb +96 -10
  19. data/lib/orb/models/subscription_price_intervals_params.rb +48 -5
  20. data/lib/orb/models/subscription_schedule_plan_change_params.rb +100 -10
  21. data/lib/orb/models.rb +14 -2
  22. data/lib/orb/resources/beta/external_plan_id.rb +113 -0
  23. data/lib/orb/resources/beta.rb +115 -0
  24. data/lib/orb/resources/plans/external_plan_id.rb +0 -31
  25. data/lib/orb/resources/plans.rb +0 -31
  26. data/lib/orb/resources/prices.rb +69 -8
  27. data/lib/orb/version.rb +1 -1
  28. data/lib/orb.rb +12 -12
  29. data/rbi/orb/client.rbi +3 -0
  30. data/rbi/orb/models/{plans/version_create_params.rbi → beta/external_plan_id_create_plan_version_params.rbi} +3042 -2783
  31. data/rbi/orb/models/{plans/version_retrieve_params.rbi → beta/external_plan_id_fetch_plan_version_params.rbi} +10 -7
  32. data/rbi/orb/models/{plans/external_plan_id_set_default_version_params.rbi → beta/external_plan_id_set_default_plan_version_params.rbi} +3 -3
  33. data/rbi/orb/models/beta_create_plan_version_params.rbi +32809 -0
  34. data/rbi/orb/models/beta_fetch_plan_version_params.rbi +35 -0
  35. data/rbi/orb/models/{plan_set_default_version_params.rbi → beta_set_default_plan_version_params.rbi} +2 -2
  36. data/rbi/orb/models/plan_version.rbi +1367 -0
  37. data/rbi/orb/models/plan_version_phase.rbi +99 -0
  38. data/rbi/orb/models/price.rbi +3220 -184
  39. data/rbi/orb/models/price_evaluate_multiple_params.rbi +15764 -0
  40. data/rbi/orb/models/price_evaluate_multiple_response.rbi +96 -0
  41. data/rbi/orb/models/price_evaluate_params.rbi +25 -15684
  42. data/rbi/orb/models/price_evaluate_response.rbi +5 -68
  43. data/rbi/orb/models/subscription_create_params.rbi +226 -12
  44. data/rbi/orb/models/subscription_price_intervals_params.rbi +113 -6
  45. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +226 -12
  46. data/rbi/orb/models.rbi +14 -2
  47. data/rbi/orb/resources/{plans/versions.rbi → beta/external_plan_id.rbi} +42 -15
  48. data/rbi/orb/resources/beta.rbi +111 -0
  49. data/rbi/orb/resources/plans/external_plan_id.rbi +0 -22
  50. data/rbi/orb/resources/plans.rbi +0 -22
  51. data/rbi/orb/resources/prices.rbi +66 -4
  52. data/sig/orb/client.rbs +2 -0
  53. data/sig/orb/models/{plans/version_create_params.rbs → beta/external_plan_id_create_plan_version_params.rbs} +1847 -1771
  54. data/sig/orb/models/{plans/version_retrieve_params.rbs → beta/external_plan_id_fetch_plan_version_params.rbs} +7 -7
  55. data/sig/orb/models/{plans/external_plan_id_set_default_version_params.rbs → beta/external_plan_id_set_default_plan_version_params.rbs} +3 -3
  56. data/sig/orb/models/beta_create_plan_version_params.rbs +12953 -0
  57. data/sig/orb/models/beta_fetch_plan_version_params.rbs +20 -0
  58. data/sig/orb/models/{plan_set_default_version_params.rbs → beta_set_default_plan_version_params.rbs} +2 -2
  59. data/sig/orb/models/plan_version.rbs +583 -0
  60. data/sig/orb/models/plan_version_phase.rbs +60 -0
  61. data/sig/orb/models/price.rbs +1430 -86
  62. data/sig/orb/models/price_evaluate_multiple_params.rbs +6230 -0
  63. data/sig/orb/models/price_evaluate_multiple_response.rbs +50 -0
  64. data/sig/orb/models/price_evaluate_params.rbs +10 -6187
  65. data/sig/orb/models/price_evaluate_response.rbs +4 -41
  66. data/sig/orb/models/subscription_create_params.rbs +84 -8
  67. data/sig/orb/models/subscription_price_intervals_params.rbs +42 -4
  68. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +84 -8
  69. data/sig/orb/models.rbs +14 -2
  70. data/sig/orb/resources/beta/external_plan_id.rbs +34 -0
  71. data/sig/orb/resources/beta.rbs +34 -0
  72. data/sig/orb/resources/plans/external_plan_id.rbs +0 -8
  73. data/sig/orb/resources/plans.rbs +0 -8
  74. data/sig/orb/resources/prices.rbs +13 -2
  75. metadata +38 -38
  76. data/lib/orb/models/plans/external_plan_id/version_create_params.rb +0 -17948
  77. data/lib/orb/models/plans/external_plan_id/version_create_response.rb +0 -819
  78. data/lib/orb/models/plans/external_plan_id/version_retrieve_params.rb +0 -24
  79. data/lib/orb/models/plans/external_plan_id/version_retrieve_response.rb +0 -819
  80. data/lib/orb/models/plans/version_create_response.rb +0 -814
  81. data/lib/orb/models/plans/version_retrieve_params.rb +0 -22
  82. data/lib/orb/models/plans/version_retrieve_response.rb +0 -814
  83. data/lib/orb/resources/plans/external_plan_id/versions.rb +0 -88
  84. data/lib/orb/resources/plans/versions.rb +0 -86
  85. data/rbi/orb/models/plans/external_plan_id/version_create_params.rbi +0 -32668
  86. data/rbi/orb/models/plans/external_plan_id/version_create_response.rbi +0 -1562
  87. data/rbi/orb/models/plans/external_plan_id/version_retrieve_params.rbi +0 -42
  88. data/rbi/orb/models/plans/external_plan_id/version_retrieve_response.rbi +0 -1562
  89. data/rbi/orb/models/plans/version_create_response.rbi +0 -1556
  90. data/rbi/orb/models/plans/version_retrieve_response.rbi +0 -1558
  91. data/rbi/orb/resources/plans/external_plan_id/versions.rbi +0 -103
  92. data/sig/orb/models/plans/external_plan_id/version_create_params.rbs +0 -12923
  93. data/sig/orb/models/plans/external_plan_id/version_create_response.rbs +0 -664
  94. data/sig/orb/models/plans/external_plan_id/version_retrieve_params.rbs +0 -27
  95. data/sig/orb/models/plans/external_plan_id/version_retrieve_response.rbs +0 -664
  96. data/sig/orb/models/plans/version_create_response.rbs +0 -662
  97. data/sig/orb/models/plans/version_retrieve_response.rbs +0 -662
  98. data/sig/orb/resources/plans/external_plan_id/versions.rbs +0 -30
  99. data/sig/orb/resources/plans/versions.rbs +0 -28
@@ -0,0 +1,735 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Beta#create_plan_version
6
+ class PlanVersion < Orb::Internal::Type::BaseModel
7
+ # @!attribute adjustments
8
+ # Adjustments for this plan. If the plan has phases, this includes adjustments
9
+ # across all phases of the plan.
10
+ #
11
+ # @return [Array<Orb::Models::PlanVersion::Adjustment::UsageDiscount, Orb::Models::PlanVersion::Adjustment::AmountDiscount, Orb::Models::PlanVersion::Adjustment::PercentageDiscount, Orb::Models::PlanVersion::Adjustment::Minimum, Orb::Models::PlanVersion::Adjustment::Maximum>]
12
+ required :adjustments, -> { Orb::Internal::Type::ArrayOf[union: Orb::PlanVersion::Adjustment] }
13
+
14
+ # @!attribute created_at
15
+ #
16
+ # @return [Time]
17
+ required :created_at, Time
18
+
19
+ # @!attribute plan_phases
20
+ #
21
+ # @return [Array<Orb::Models::PlanVersionPhase>, nil]
22
+ required :plan_phases, -> { Orb::Internal::Type::ArrayOf[Orb::PlanVersionPhase] }, nil?: true
23
+
24
+ # @!attribute prices
25
+ # Prices for this plan. If the plan has phases, this includes prices across all
26
+ # phases of the plan.
27
+ #
28
+ # @return [Array<Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBps, Orb::Models::Price::Bps, Orb::Models::Price::BulkBps, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk>]
29
+ required :prices, -> { Orb::Internal::Type::ArrayOf[union: Orb::Price] }
30
+
31
+ # @!attribute version
32
+ #
33
+ # @return [Integer]
34
+ required :version, Integer
35
+
36
+ # @!method initialize(adjustments:, created_at:, plan_phases:, prices:, version:)
37
+ # Some parameter documentations has been truncated, see {Orb::Models::PlanVersion}
38
+ # for more details.
39
+ #
40
+ # The PlanVersion resource represents the prices and adjustments present on a
41
+ # specific version of a plan.
42
+ #
43
+ # @param adjustments [Array<Orb::Models::PlanVersion::Adjustment::UsageDiscount, Orb::Models::PlanVersion::Adjustment::AmountDiscount, Orb::Models::PlanVersion::Adjustment::PercentageDiscount, Orb::Models::PlanVersion::Adjustment::Minimum, Orb::Models::PlanVersion::Adjustment::Maximum>] Adjustments for this plan. If the plan has phases, this includes adjustments acr
44
+ #
45
+ # @param created_at [Time]
46
+ #
47
+ # @param plan_phases [Array<Orb::Models::PlanVersionPhase>, nil]
48
+ #
49
+ # @param prices [Array<Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBps, Orb::Models::Price::Bps, Orb::Models::Price::BulkBps, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk>] Prices for this plan. If the plan has phases, this includes prices across all ph
50
+ #
51
+ # @param version [Integer]
52
+
53
+ module Adjustment
54
+ extend Orb::Internal::Type::Union
55
+
56
+ discriminator :adjustment_type
57
+
58
+ variant :usage_discount, -> { Orb::PlanVersion::Adjustment::UsageDiscount }
59
+
60
+ variant :amount_discount, -> { Orb::PlanVersion::Adjustment::AmountDiscount }
61
+
62
+ variant :percentage_discount, -> { Orb::PlanVersion::Adjustment::PercentageDiscount }
63
+
64
+ variant :minimum, -> { Orb::PlanVersion::Adjustment::Minimum }
65
+
66
+ variant :maximum, -> { Orb::PlanVersion::Adjustment::Maximum }
67
+
68
+ class UsageDiscount < Orb::Internal::Type::BaseModel
69
+ # @!attribute id
70
+ #
71
+ # @return [String]
72
+ required :id, String
73
+
74
+ # @!attribute adjustment_type
75
+ #
76
+ # @return [Symbol, :usage_discount]
77
+ required :adjustment_type, const: :usage_discount
78
+
79
+ # @!attribute applies_to_price_ids
80
+ # @deprecated
81
+ #
82
+ # The price IDs that this adjustment applies to.
83
+ #
84
+ # @return [Array<String>]
85
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
86
+
87
+ # @!attribute filters
88
+ # The filters that determine which prices to apply this adjustment to.
89
+ #
90
+ # @return [Array<Orb::Models::PlanVersion::Adjustment::UsageDiscount::Filter>]
91
+ required :filters,
92
+ -> { Orb::Internal::Type::ArrayOf[Orb::PlanVersion::Adjustment::UsageDiscount::Filter] }
93
+
94
+ # @!attribute is_invoice_level
95
+ # True for adjustments that apply to an entire invocice, false for adjustments
96
+ # that apply to only one price.
97
+ #
98
+ # @return [Boolean]
99
+ required :is_invoice_level, Orb::Internal::Type::Boolean
100
+
101
+ # @!attribute plan_phase_order
102
+ # The plan phase in which this adjustment is active.
103
+ #
104
+ # @return [Integer, nil]
105
+ required :plan_phase_order, Integer, nil?: true
106
+
107
+ # @!attribute reason
108
+ # The reason for the adjustment.
109
+ #
110
+ # @return [String, nil]
111
+ required :reason, String, nil?: true
112
+
113
+ # @!attribute usage_discount
114
+ # The number of usage units by which to discount the price this adjustment applies
115
+ # to in a given billing period.
116
+ #
117
+ # @return [Float]
118
+ required :usage_discount, Float
119
+
120
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, plan_phase_order:, reason:, usage_discount:, adjustment_type: :usage_discount)
121
+ # Some parameter documentations has been truncated, see
122
+ # {Orb::Models::PlanVersion::Adjustment::UsageDiscount} for more details.
123
+ #
124
+ # @param id [String]
125
+ #
126
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
127
+ #
128
+ # @param filters [Array<Orb::Models::PlanVersion::Adjustment::UsageDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
129
+ #
130
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
131
+ #
132
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
133
+ #
134
+ # @param reason [String, nil] The reason for the adjustment.
135
+ #
136
+ # @param usage_discount [Float] The number of usage units by which to discount the price this adjustment applies
137
+ #
138
+ # @param adjustment_type [Symbol, :usage_discount]
139
+
140
+ class Filter < Orb::Internal::Type::BaseModel
141
+ # @!attribute field
142
+ # The property of the price to filter on.
143
+ #
144
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::UsageDiscount::Filter::Field]
145
+ required :field, enum: -> { Orb::PlanVersion::Adjustment::UsageDiscount::Filter::Field }
146
+
147
+ # @!attribute operator
148
+ # Should prices that match the filter be included or excluded.
149
+ #
150
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::UsageDiscount::Filter::Operator]
151
+ required :operator, enum: -> { Orb::PlanVersion::Adjustment::UsageDiscount::Filter::Operator }
152
+
153
+ # @!attribute values
154
+ # The IDs or values that match this filter.
155
+ #
156
+ # @return [Array<String>]
157
+ required :values, Orb::Internal::Type::ArrayOf[String]
158
+
159
+ # @!method initialize(field:, operator:, values:)
160
+ # @param field [Symbol, Orb::Models::PlanVersion::Adjustment::UsageDiscount::Filter::Field] The property of the price to filter on.
161
+ #
162
+ # @param operator [Symbol, Orb::Models::PlanVersion::Adjustment::UsageDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
163
+ #
164
+ # @param values [Array<String>] The IDs or values that match this filter.
165
+
166
+ # The property of the price to filter on.
167
+ #
168
+ # @see Orb::Models::PlanVersion::Adjustment::UsageDiscount::Filter#field
169
+ module Field
170
+ extend Orb::Internal::Type::Enum
171
+
172
+ PRICE_ID = :price_id
173
+ ITEM_ID = :item_id
174
+ PRICE_TYPE = :price_type
175
+ CURRENCY = :currency
176
+ PRICING_UNIT_ID = :pricing_unit_id
177
+
178
+ # @!method self.values
179
+ # @return [Array<Symbol>]
180
+ end
181
+
182
+ # Should prices that match the filter be included or excluded.
183
+ #
184
+ # @see Orb::Models::PlanVersion::Adjustment::UsageDiscount::Filter#operator
185
+ module Operator
186
+ extend Orb::Internal::Type::Enum
187
+
188
+ INCLUDES = :includes
189
+ EXCLUDES = :excludes
190
+
191
+ # @!method self.values
192
+ # @return [Array<Symbol>]
193
+ end
194
+ end
195
+ end
196
+
197
+ class AmountDiscount < Orb::Internal::Type::BaseModel
198
+ # @!attribute id
199
+ #
200
+ # @return [String]
201
+ required :id, String
202
+
203
+ # @!attribute adjustment_type
204
+ #
205
+ # @return [Symbol, :amount_discount]
206
+ required :adjustment_type, const: :amount_discount
207
+
208
+ # @!attribute amount_discount
209
+ # The amount by which to discount the prices this adjustment applies to in a given
210
+ # billing period.
211
+ #
212
+ # @return [String]
213
+ required :amount_discount, String
214
+
215
+ # @!attribute applies_to_price_ids
216
+ # @deprecated
217
+ #
218
+ # The price IDs that this adjustment applies to.
219
+ #
220
+ # @return [Array<String>]
221
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
222
+
223
+ # @!attribute filters
224
+ # The filters that determine which prices to apply this adjustment to.
225
+ #
226
+ # @return [Array<Orb::Models::PlanVersion::Adjustment::AmountDiscount::Filter>]
227
+ required :filters,
228
+ -> { Orb::Internal::Type::ArrayOf[Orb::PlanVersion::Adjustment::AmountDiscount::Filter] }
229
+
230
+ # @!attribute is_invoice_level
231
+ # True for adjustments that apply to an entire invocice, false for adjustments
232
+ # that apply to only one price.
233
+ #
234
+ # @return [Boolean]
235
+ required :is_invoice_level, Orb::Internal::Type::Boolean
236
+
237
+ # @!attribute plan_phase_order
238
+ # The plan phase in which this adjustment is active.
239
+ #
240
+ # @return [Integer, nil]
241
+ required :plan_phase_order, Integer, nil?: true
242
+
243
+ # @!attribute reason
244
+ # The reason for the adjustment.
245
+ #
246
+ # @return [String, nil]
247
+ required :reason, String, nil?: true
248
+
249
+ # @!method initialize(id:, amount_discount:, applies_to_price_ids:, filters:, is_invoice_level:, plan_phase_order:, reason:, adjustment_type: :amount_discount)
250
+ # Some parameter documentations has been truncated, see
251
+ # {Orb::Models::PlanVersion::Adjustment::AmountDiscount} for more details.
252
+ #
253
+ # @param id [String]
254
+ #
255
+ # @param amount_discount [String] The amount by which to discount the prices this adjustment applies to in a given
256
+ #
257
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
258
+ #
259
+ # @param filters [Array<Orb::Models::PlanVersion::Adjustment::AmountDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
260
+ #
261
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
262
+ #
263
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
264
+ #
265
+ # @param reason [String, nil] The reason for the adjustment.
266
+ #
267
+ # @param adjustment_type [Symbol, :amount_discount]
268
+
269
+ class Filter < Orb::Internal::Type::BaseModel
270
+ # @!attribute field
271
+ # The property of the price to filter on.
272
+ #
273
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::AmountDiscount::Filter::Field]
274
+ required :field, enum: -> { Orb::PlanVersion::Adjustment::AmountDiscount::Filter::Field }
275
+
276
+ # @!attribute operator
277
+ # Should prices that match the filter be included or excluded.
278
+ #
279
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::AmountDiscount::Filter::Operator]
280
+ required :operator, enum: -> { Orb::PlanVersion::Adjustment::AmountDiscount::Filter::Operator }
281
+
282
+ # @!attribute values
283
+ # The IDs or values that match this filter.
284
+ #
285
+ # @return [Array<String>]
286
+ required :values, Orb::Internal::Type::ArrayOf[String]
287
+
288
+ # @!method initialize(field:, operator:, values:)
289
+ # @param field [Symbol, Orb::Models::PlanVersion::Adjustment::AmountDiscount::Filter::Field] The property of the price to filter on.
290
+ #
291
+ # @param operator [Symbol, Orb::Models::PlanVersion::Adjustment::AmountDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
292
+ #
293
+ # @param values [Array<String>] The IDs or values that match this filter.
294
+
295
+ # The property of the price to filter on.
296
+ #
297
+ # @see Orb::Models::PlanVersion::Adjustment::AmountDiscount::Filter#field
298
+ module Field
299
+ extend Orb::Internal::Type::Enum
300
+
301
+ PRICE_ID = :price_id
302
+ ITEM_ID = :item_id
303
+ PRICE_TYPE = :price_type
304
+ CURRENCY = :currency
305
+ PRICING_UNIT_ID = :pricing_unit_id
306
+
307
+ # @!method self.values
308
+ # @return [Array<Symbol>]
309
+ end
310
+
311
+ # Should prices that match the filter be included or excluded.
312
+ #
313
+ # @see Orb::Models::PlanVersion::Adjustment::AmountDiscount::Filter#operator
314
+ module Operator
315
+ extend Orb::Internal::Type::Enum
316
+
317
+ INCLUDES = :includes
318
+ EXCLUDES = :excludes
319
+
320
+ # @!method self.values
321
+ # @return [Array<Symbol>]
322
+ end
323
+ end
324
+ end
325
+
326
+ class PercentageDiscount < Orb::Internal::Type::BaseModel
327
+ # @!attribute id
328
+ #
329
+ # @return [String]
330
+ required :id, String
331
+
332
+ # @!attribute adjustment_type
333
+ #
334
+ # @return [Symbol, :percentage_discount]
335
+ required :adjustment_type, const: :percentage_discount
336
+
337
+ # @!attribute applies_to_price_ids
338
+ # @deprecated
339
+ #
340
+ # The price IDs that this adjustment applies to.
341
+ #
342
+ # @return [Array<String>]
343
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
344
+
345
+ # @!attribute filters
346
+ # The filters that determine which prices to apply this adjustment to.
347
+ #
348
+ # @return [Array<Orb::Models::PlanVersion::Adjustment::PercentageDiscount::Filter>]
349
+ required :filters,
350
+ -> {
351
+ Orb::Internal::Type::ArrayOf[Orb::PlanVersion::Adjustment::PercentageDiscount::Filter]
352
+ }
353
+
354
+ # @!attribute is_invoice_level
355
+ # True for adjustments that apply to an entire invocice, false for adjustments
356
+ # that apply to only one price.
357
+ #
358
+ # @return [Boolean]
359
+ required :is_invoice_level, Orb::Internal::Type::Boolean
360
+
361
+ # @!attribute percentage_discount
362
+ # The percentage (as a value between 0 and 1) by which to discount the price
363
+ # intervals this adjustment applies to in a given billing period.
364
+ #
365
+ # @return [Float]
366
+ required :percentage_discount, Float
367
+
368
+ # @!attribute plan_phase_order
369
+ # The plan phase in which this adjustment is active.
370
+ #
371
+ # @return [Integer, nil]
372
+ required :plan_phase_order, Integer, nil?: true
373
+
374
+ # @!attribute reason
375
+ # The reason for the adjustment.
376
+ #
377
+ # @return [String, nil]
378
+ required :reason, String, nil?: true
379
+
380
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, percentage_discount:, plan_phase_order:, reason:, adjustment_type: :percentage_discount)
381
+ # Some parameter documentations has been truncated, see
382
+ # {Orb::Models::PlanVersion::Adjustment::PercentageDiscount} for more details.
383
+ #
384
+ # @param id [String]
385
+ #
386
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
387
+ #
388
+ # @param filters [Array<Orb::Models::PlanVersion::Adjustment::PercentageDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
389
+ #
390
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
391
+ #
392
+ # @param percentage_discount [Float] The percentage (as a value between 0 and 1) by which to discount the price inter
393
+ #
394
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
395
+ #
396
+ # @param reason [String, nil] The reason for the adjustment.
397
+ #
398
+ # @param adjustment_type [Symbol, :percentage_discount]
399
+
400
+ class Filter < Orb::Internal::Type::BaseModel
401
+ # @!attribute field
402
+ # The property of the price to filter on.
403
+ #
404
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::PercentageDiscount::Filter::Field]
405
+ required :field, enum: -> { Orb::PlanVersion::Adjustment::PercentageDiscount::Filter::Field }
406
+
407
+ # @!attribute operator
408
+ # Should prices that match the filter be included or excluded.
409
+ #
410
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::PercentageDiscount::Filter::Operator]
411
+ required :operator,
412
+ enum: -> {
413
+ Orb::PlanVersion::Adjustment::PercentageDiscount::Filter::Operator
414
+ }
415
+
416
+ # @!attribute values
417
+ # The IDs or values that match this filter.
418
+ #
419
+ # @return [Array<String>]
420
+ required :values, Orb::Internal::Type::ArrayOf[String]
421
+
422
+ # @!method initialize(field:, operator:, values:)
423
+ # @param field [Symbol, Orb::Models::PlanVersion::Adjustment::PercentageDiscount::Filter::Field] The property of the price to filter on.
424
+ #
425
+ # @param operator [Symbol, Orb::Models::PlanVersion::Adjustment::PercentageDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
426
+ #
427
+ # @param values [Array<String>] The IDs or values that match this filter.
428
+
429
+ # The property of the price to filter on.
430
+ #
431
+ # @see Orb::Models::PlanVersion::Adjustment::PercentageDiscount::Filter#field
432
+ module Field
433
+ extend Orb::Internal::Type::Enum
434
+
435
+ PRICE_ID = :price_id
436
+ ITEM_ID = :item_id
437
+ PRICE_TYPE = :price_type
438
+ CURRENCY = :currency
439
+ PRICING_UNIT_ID = :pricing_unit_id
440
+
441
+ # @!method self.values
442
+ # @return [Array<Symbol>]
443
+ end
444
+
445
+ # Should prices that match the filter be included or excluded.
446
+ #
447
+ # @see Orb::Models::PlanVersion::Adjustment::PercentageDiscount::Filter#operator
448
+ module Operator
449
+ extend Orb::Internal::Type::Enum
450
+
451
+ INCLUDES = :includes
452
+ EXCLUDES = :excludes
453
+
454
+ # @!method self.values
455
+ # @return [Array<Symbol>]
456
+ end
457
+ end
458
+ end
459
+
460
+ class Minimum < Orb::Internal::Type::BaseModel
461
+ # @!attribute id
462
+ #
463
+ # @return [String]
464
+ required :id, String
465
+
466
+ # @!attribute adjustment_type
467
+ #
468
+ # @return [Symbol, :minimum]
469
+ required :adjustment_type, const: :minimum
470
+
471
+ # @!attribute applies_to_price_ids
472
+ # @deprecated
473
+ #
474
+ # The price IDs that this adjustment applies to.
475
+ #
476
+ # @return [Array<String>]
477
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
478
+
479
+ # @!attribute filters
480
+ # The filters that determine which prices to apply this adjustment to.
481
+ #
482
+ # @return [Array<Orb::Models::PlanVersion::Adjustment::Minimum::Filter>]
483
+ required :filters,
484
+ -> {
485
+ Orb::Internal::Type::ArrayOf[Orb::PlanVersion::Adjustment::Minimum::Filter]
486
+ }
487
+
488
+ # @!attribute is_invoice_level
489
+ # True for adjustments that apply to an entire invocice, false for adjustments
490
+ # that apply to only one price.
491
+ #
492
+ # @return [Boolean]
493
+ required :is_invoice_level, Orb::Internal::Type::Boolean
494
+
495
+ # @!attribute item_id
496
+ # The item ID that revenue from this minimum will be attributed to.
497
+ #
498
+ # @return [String]
499
+ required :item_id, String
500
+
501
+ # @!attribute minimum_amount
502
+ # The minimum amount to charge in a given billing period for the prices this
503
+ # adjustment applies to.
504
+ #
505
+ # @return [String]
506
+ required :minimum_amount, String
507
+
508
+ # @!attribute plan_phase_order
509
+ # The plan phase in which this adjustment is active.
510
+ #
511
+ # @return [Integer, nil]
512
+ required :plan_phase_order, Integer, nil?: true
513
+
514
+ # @!attribute reason
515
+ # The reason for the adjustment.
516
+ #
517
+ # @return [String, nil]
518
+ required :reason, String, nil?: true
519
+
520
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, item_id:, minimum_amount:, plan_phase_order:, reason:, adjustment_type: :minimum)
521
+ # Some parameter documentations has been truncated, see
522
+ # {Orb::Models::PlanVersion::Adjustment::Minimum} for more details.
523
+ #
524
+ # @param id [String]
525
+ #
526
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
527
+ #
528
+ # @param filters [Array<Orb::Models::PlanVersion::Adjustment::Minimum::Filter>] The filters that determine which prices to apply this adjustment to.
529
+ #
530
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
531
+ #
532
+ # @param item_id [String] The item ID that revenue from this minimum will be attributed to.
533
+ #
534
+ # @param minimum_amount [String] The minimum amount to charge in a given billing period for the prices this adjus
535
+ #
536
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
537
+ #
538
+ # @param reason [String, nil] The reason for the adjustment.
539
+ #
540
+ # @param adjustment_type [Symbol, :minimum]
541
+
542
+ class Filter < Orb::Internal::Type::BaseModel
543
+ # @!attribute field
544
+ # The property of the price to filter on.
545
+ #
546
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::Minimum::Filter::Field]
547
+ required :field, enum: -> { Orb::PlanVersion::Adjustment::Minimum::Filter::Field }
548
+
549
+ # @!attribute operator
550
+ # Should prices that match the filter be included or excluded.
551
+ #
552
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::Minimum::Filter::Operator]
553
+ required :operator, enum: -> { Orb::PlanVersion::Adjustment::Minimum::Filter::Operator }
554
+
555
+ # @!attribute values
556
+ # The IDs or values that match this filter.
557
+ #
558
+ # @return [Array<String>]
559
+ required :values, Orb::Internal::Type::ArrayOf[String]
560
+
561
+ # @!method initialize(field:, operator:, values:)
562
+ # @param field [Symbol, Orb::Models::PlanVersion::Adjustment::Minimum::Filter::Field] The property of the price to filter on.
563
+ #
564
+ # @param operator [Symbol, Orb::Models::PlanVersion::Adjustment::Minimum::Filter::Operator] Should prices that match the filter be included or excluded.
565
+ #
566
+ # @param values [Array<String>] The IDs or values that match this filter.
567
+
568
+ # The property of the price to filter on.
569
+ #
570
+ # @see Orb::Models::PlanVersion::Adjustment::Minimum::Filter#field
571
+ module Field
572
+ extend Orb::Internal::Type::Enum
573
+
574
+ PRICE_ID = :price_id
575
+ ITEM_ID = :item_id
576
+ PRICE_TYPE = :price_type
577
+ CURRENCY = :currency
578
+ PRICING_UNIT_ID = :pricing_unit_id
579
+
580
+ # @!method self.values
581
+ # @return [Array<Symbol>]
582
+ end
583
+
584
+ # Should prices that match the filter be included or excluded.
585
+ #
586
+ # @see Orb::Models::PlanVersion::Adjustment::Minimum::Filter#operator
587
+ module Operator
588
+ extend Orb::Internal::Type::Enum
589
+
590
+ INCLUDES = :includes
591
+ EXCLUDES = :excludes
592
+
593
+ # @!method self.values
594
+ # @return [Array<Symbol>]
595
+ end
596
+ end
597
+ end
598
+
599
+ class Maximum < Orb::Internal::Type::BaseModel
600
+ # @!attribute id
601
+ #
602
+ # @return [String]
603
+ required :id, String
604
+
605
+ # @!attribute adjustment_type
606
+ #
607
+ # @return [Symbol, :maximum]
608
+ required :adjustment_type, const: :maximum
609
+
610
+ # @!attribute applies_to_price_ids
611
+ # @deprecated
612
+ #
613
+ # The price IDs that this adjustment applies to.
614
+ #
615
+ # @return [Array<String>]
616
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
617
+
618
+ # @!attribute filters
619
+ # The filters that determine which prices to apply this adjustment to.
620
+ #
621
+ # @return [Array<Orb::Models::PlanVersion::Adjustment::Maximum::Filter>]
622
+ required :filters,
623
+ -> {
624
+ Orb::Internal::Type::ArrayOf[Orb::PlanVersion::Adjustment::Maximum::Filter]
625
+ }
626
+
627
+ # @!attribute is_invoice_level
628
+ # True for adjustments that apply to an entire invocice, false for adjustments
629
+ # that apply to only one price.
630
+ #
631
+ # @return [Boolean]
632
+ required :is_invoice_level, Orb::Internal::Type::Boolean
633
+
634
+ # @!attribute maximum_amount
635
+ # The maximum amount to charge in a given billing period for the prices this
636
+ # adjustment applies to.
637
+ #
638
+ # @return [String]
639
+ required :maximum_amount, String
640
+
641
+ # @!attribute plan_phase_order
642
+ # The plan phase in which this adjustment is active.
643
+ #
644
+ # @return [Integer, nil]
645
+ required :plan_phase_order, Integer, nil?: true
646
+
647
+ # @!attribute reason
648
+ # The reason for the adjustment.
649
+ #
650
+ # @return [String, nil]
651
+ required :reason, String, nil?: true
652
+
653
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, maximum_amount:, plan_phase_order:, reason:, adjustment_type: :maximum)
654
+ # Some parameter documentations has been truncated, see
655
+ # {Orb::Models::PlanVersion::Adjustment::Maximum} for more details.
656
+ #
657
+ # @param id [String]
658
+ #
659
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
660
+ #
661
+ # @param filters [Array<Orb::Models::PlanVersion::Adjustment::Maximum::Filter>] The filters that determine which prices to apply this adjustment to.
662
+ #
663
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
664
+ #
665
+ # @param maximum_amount [String] The maximum amount to charge in a given billing period for the prices this adjus
666
+ #
667
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
668
+ #
669
+ # @param reason [String, nil] The reason for the adjustment.
670
+ #
671
+ # @param adjustment_type [Symbol, :maximum]
672
+
673
+ class Filter < Orb::Internal::Type::BaseModel
674
+ # @!attribute field
675
+ # The property of the price to filter on.
676
+ #
677
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::Maximum::Filter::Field]
678
+ required :field, enum: -> { Orb::PlanVersion::Adjustment::Maximum::Filter::Field }
679
+
680
+ # @!attribute operator
681
+ # Should prices that match the filter be included or excluded.
682
+ #
683
+ # @return [Symbol, Orb::Models::PlanVersion::Adjustment::Maximum::Filter::Operator]
684
+ required :operator, enum: -> { Orb::PlanVersion::Adjustment::Maximum::Filter::Operator }
685
+
686
+ # @!attribute values
687
+ # The IDs or values that match this filter.
688
+ #
689
+ # @return [Array<String>]
690
+ required :values, Orb::Internal::Type::ArrayOf[String]
691
+
692
+ # @!method initialize(field:, operator:, values:)
693
+ # @param field [Symbol, Orb::Models::PlanVersion::Adjustment::Maximum::Filter::Field] The property of the price to filter on.
694
+ #
695
+ # @param operator [Symbol, Orb::Models::PlanVersion::Adjustment::Maximum::Filter::Operator] Should prices that match the filter be included or excluded.
696
+ #
697
+ # @param values [Array<String>] The IDs or values that match this filter.
698
+
699
+ # The property of the price to filter on.
700
+ #
701
+ # @see Orb::Models::PlanVersion::Adjustment::Maximum::Filter#field
702
+ module Field
703
+ extend Orb::Internal::Type::Enum
704
+
705
+ PRICE_ID = :price_id
706
+ ITEM_ID = :item_id
707
+ PRICE_TYPE = :price_type
708
+ CURRENCY = :currency
709
+ PRICING_UNIT_ID = :pricing_unit_id
710
+
711
+ # @!method self.values
712
+ # @return [Array<Symbol>]
713
+ end
714
+
715
+ # Should prices that match the filter be included or excluded.
716
+ #
717
+ # @see Orb::Models::PlanVersion::Adjustment::Maximum::Filter#operator
718
+ module Operator
719
+ extend Orb::Internal::Type::Enum
720
+
721
+ INCLUDES = :includes
722
+ EXCLUDES = :excludes
723
+
724
+ # @!method self.values
725
+ # @return [Array<Symbol>]
726
+ end
727
+ end
728
+ end
729
+
730
+ # @!method self.variants
731
+ # @return [Array(Orb::Models::PlanVersion::Adjustment::UsageDiscount, Orb::Models::PlanVersion::Adjustment::AmountDiscount, Orb::Models::PlanVersion::Adjustment::PercentageDiscount, Orb::Models::PlanVersion::Adjustment::Minimum, Orb::Models::PlanVersion::Adjustment::Maximum)]
732
+ end
733
+ end
734
+ end
735
+ end