orb-billing 0.6.0 → 0.7.0

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