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
@@ -1185,9 +1185,29 @@ module Orb
1185
1185
  sig { returns(String) }
1186
1186
  attr_accessor :currency
1187
1187
 
1188
+ # The custom expiration for the allocation.
1189
+ sig do
1190
+ returns(
1191
+ T.nilable(
1192
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration
1193
+ )
1194
+ )
1195
+ end
1196
+ attr_reader :custom_expiration
1197
+
1198
+ sig do
1199
+ params(
1200
+ custom_expiration:
1201
+ T.nilable(
1202
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::OrHash
1203
+ )
1204
+ ).void
1205
+ end
1206
+ attr_writer :custom_expiration
1207
+
1188
1208
  # Whether the allocated amount should expire at the end of the cadence or roll
1189
- # over to the next period.
1190
- sig { returns(T::Boolean) }
1209
+ # over to the next period. Set to null if using custom_expiration.
1210
+ sig { returns(T.nilable(T::Boolean)) }
1191
1211
  attr_accessor :expires_at_end_of_cadence
1192
1212
 
1193
1213
  # The definition of a new allocation price to create and add to the subscription.
@@ -1197,7 +1217,11 @@ module Orb
1197
1217
  cadence:
1198
1218
  Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::Cadence::OrSymbol,
1199
1219
  currency: String,
1200
- expires_at_end_of_cadence: T::Boolean
1220
+ custom_expiration:
1221
+ T.nilable(
1222
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::OrHash
1223
+ ),
1224
+ expires_at_end_of_cadence: T.nilable(T::Boolean)
1201
1225
  ).returns(T.attached_class)
1202
1226
  end
1203
1227
  def self.new(
@@ -1208,9 +1232,11 @@ module Orb
1208
1232
  # An ISO 4217 currency string or a custom pricing unit identifier in which to bill
1209
1233
  # this price.
1210
1234
  currency:,
1235
+ # The custom expiration for the allocation.
1236
+ custom_expiration: nil,
1211
1237
  # Whether the allocated amount should expire at the end of the cadence or roll
1212
- # over to the next period.
1213
- expires_at_end_of_cadence:
1238
+ # over to the next period. Set to null if using custom_expiration.
1239
+ expires_at_end_of_cadence: nil
1214
1240
  )
1215
1241
  end
1216
1242
 
@@ -1221,7 +1247,11 @@ module Orb
1221
1247
  cadence:
1222
1248
  Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::Cadence::OrSymbol,
1223
1249
  currency: String,
1224
- expires_at_end_of_cadence: T::Boolean
1250
+ custom_expiration:
1251
+ T.nilable(
1252
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration
1253
+ ),
1254
+ expires_at_end_of_cadence: T.nilable(T::Boolean)
1225
1255
  }
1226
1256
  )
1227
1257
  end
@@ -1282,6 +1312,83 @@ module Orb
1282
1312
  def self.values
1283
1313
  end
1284
1314
  end
1315
+
1316
+ class CustomExpiration < Orb::Internal::Type::BaseModel
1317
+ OrHash =
1318
+ T.type_alias do
1319
+ T.any(
1320
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration,
1321
+ Orb::Internal::AnyHash
1322
+ )
1323
+ end
1324
+
1325
+ sig { returns(Integer) }
1326
+ attr_accessor :duration
1327
+
1328
+ sig do
1329
+ returns(
1330
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::DurationUnit::OrSymbol
1331
+ )
1332
+ end
1333
+ attr_accessor :duration_unit
1334
+
1335
+ # The custom expiration for the allocation.
1336
+ sig do
1337
+ params(
1338
+ duration: Integer,
1339
+ duration_unit:
1340
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::DurationUnit::OrSymbol
1341
+ ).returns(T.attached_class)
1342
+ end
1343
+ def self.new(duration:, duration_unit:)
1344
+ end
1345
+
1346
+ sig do
1347
+ override.returns(
1348
+ {
1349
+ duration: Integer,
1350
+ duration_unit:
1351
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::DurationUnit::OrSymbol
1352
+ }
1353
+ )
1354
+ end
1355
+ def to_hash
1356
+ end
1357
+
1358
+ module DurationUnit
1359
+ extend Orb::Internal::Type::Enum
1360
+
1361
+ TaggedSymbol =
1362
+ T.type_alias do
1363
+ T.all(
1364
+ Symbol,
1365
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::DurationUnit
1366
+ )
1367
+ end
1368
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1369
+
1370
+ DAY =
1371
+ T.let(
1372
+ :day,
1373
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::DurationUnit::TaggedSymbol
1374
+ )
1375
+ MONTH =
1376
+ T.let(
1377
+ :month,
1378
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::DurationUnit::TaggedSymbol
1379
+ )
1380
+
1381
+ sig do
1382
+ override.returns(
1383
+ T::Array[
1384
+ Orb::SubscriptionSchedulePlanChangeParams::AddPrice::AllocationPrice::CustomExpiration::DurationUnit::TaggedSymbol
1385
+ ]
1386
+ )
1387
+ end
1388
+ def self.values
1389
+ end
1390
+ end
1391
+ end
1285
1392
  end
1286
1393
 
1287
1394
  class Discount < Orb::Internal::Type::BaseModel
@@ -17984,9 +18091,29 @@ module Orb
17984
18091
  sig { returns(String) }
17985
18092
  attr_accessor :currency
17986
18093
 
18094
+ # The custom expiration for the allocation.
18095
+ sig do
18096
+ returns(
18097
+ T.nilable(
18098
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration
18099
+ )
18100
+ )
18101
+ end
18102
+ attr_reader :custom_expiration
18103
+
18104
+ sig do
18105
+ params(
18106
+ custom_expiration:
18107
+ T.nilable(
18108
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::OrHash
18109
+ )
18110
+ ).void
18111
+ end
18112
+ attr_writer :custom_expiration
18113
+
17987
18114
  # Whether the allocated amount should expire at the end of the cadence or roll
17988
- # over to the next period.
17989
- sig { returns(T::Boolean) }
18115
+ # over to the next period. Set to null if using custom_expiration.
18116
+ sig { returns(T.nilable(T::Boolean)) }
17990
18117
  attr_accessor :expires_at_end_of_cadence
17991
18118
 
17992
18119
  # The definition of a new allocation price to create and add to the subscription.
@@ -17996,7 +18123,11 @@ module Orb
17996
18123
  cadence:
17997
18124
  Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::Cadence::OrSymbol,
17998
18125
  currency: String,
17999
- expires_at_end_of_cadence: T::Boolean
18126
+ custom_expiration:
18127
+ T.nilable(
18128
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::OrHash
18129
+ ),
18130
+ expires_at_end_of_cadence: T.nilable(T::Boolean)
18000
18131
  ).returns(T.attached_class)
18001
18132
  end
18002
18133
  def self.new(
@@ -18007,9 +18138,11 @@ module Orb
18007
18138
  # An ISO 4217 currency string or a custom pricing unit identifier in which to bill
18008
18139
  # this price.
18009
18140
  currency:,
18141
+ # The custom expiration for the allocation.
18142
+ custom_expiration: nil,
18010
18143
  # Whether the allocated amount should expire at the end of the cadence or roll
18011
- # over to the next period.
18012
- expires_at_end_of_cadence:
18144
+ # over to the next period. Set to null if using custom_expiration.
18145
+ expires_at_end_of_cadence: nil
18013
18146
  )
18014
18147
  end
18015
18148
 
@@ -18020,7 +18153,11 @@ module Orb
18020
18153
  cadence:
18021
18154
  Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::Cadence::OrSymbol,
18022
18155
  currency: String,
18023
- expires_at_end_of_cadence: T::Boolean
18156
+ custom_expiration:
18157
+ T.nilable(
18158
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration
18159
+ ),
18160
+ expires_at_end_of_cadence: T.nilable(T::Boolean)
18024
18161
  }
18025
18162
  )
18026
18163
  end
@@ -18081,6 +18218,83 @@ module Orb
18081
18218
  def self.values
18082
18219
  end
18083
18220
  end
18221
+
18222
+ class CustomExpiration < Orb::Internal::Type::BaseModel
18223
+ OrHash =
18224
+ T.type_alias do
18225
+ T.any(
18226
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration,
18227
+ Orb::Internal::AnyHash
18228
+ )
18229
+ end
18230
+
18231
+ sig { returns(Integer) }
18232
+ attr_accessor :duration
18233
+
18234
+ sig do
18235
+ returns(
18236
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::DurationUnit::OrSymbol
18237
+ )
18238
+ end
18239
+ attr_accessor :duration_unit
18240
+
18241
+ # The custom expiration for the allocation.
18242
+ sig do
18243
+ params(
18244
+ duration: Integer,
18245
+ duration_unit:
18246
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::DurationUnit::OrSymbol
18247
+ ).returns(T.attached_class)
18248
+ end
18249
+ def self.new(duration:, duration_unit:)
18250
+ end
18251
+
18252
+ sig do
18253
+ override.returns(
18254
+ {
18255
+ duration: Integer,
18256
+ duration_unit:
18257
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::DurationUnit::OrSymbol
18258
+ }
18259
+ )
18260
+ end
18261
+ def to_hash
18262
+ end
18263
+
18264
+ module DurationUnit
18265
+ extend Orb::Internal::Type::Enum
18266
+
18267
+ TaggedSymbol =
18268
+ T.type_alias do
18269
+ T.all(
18270
+ Symbol,
18271
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::DurationUnit
18272
+ )
18273
+ end
18274
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
18275
+
18276
+ DAY =
18277
+ T.let(
18278
+ :day,
18279
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::DurationUnit::TaggedSymbol
18280
+ )
18281
+ MONTH =
18282
+ T.let(
18283
+ :month,
18284
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::DurationUnit::TaggedSymbol
18285
+ )
18286
+
18287
+ sig do
18288
+ override.returns(
18289
+ T::Array[
18290
+ Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::AllocationPrice::CustomExpiration::DurationUnit::TaggedSymbol
18291
+ ]
18292
+ )
18293
+ end
18294
+ def self.values
18295
+ end
18296
+ end
18297
+ end
18084
18298
  end
18085
18299
 
18086
18300
  class Discount < Orb::Internal::Type::BaseModel
data/rbi/orb/models.rbi CHANGED
@@ -23,6 +23,14 @@ module Orb
23
23
 
24
24
  AmountDiscount = Orb::Models::AmountDiscount
25
25
 
26
+ Beta = Orb::Models::Beta
27
+
28
+ BetaCreatePlanVersionParams = Orb::Models::BetaCreatePlanVersionParams
29
+
30
+ BetaFetchPlanVersionParams = Orb::Models::BetaFetchPlanVersionParams
31
+
32
+ BetaSetDefaultPlanVersionParams = Orb::Models::BetaSetDefaultPlanVersionParams
33
+
26
34
  BillableMetric = Orb::Models::BillableMetric
27
35
 
28
36
  BillingCycleRelativeDate = Orb::Models::BillingCycleRelativeDate
@@ -158,14 +166,18 @@ module Orb
158
166
 
159
167
  Plans = Orb::Models::Plans
160
168
 
161
- PlanSetDefaultVersionParams = Orb::Models::PlanSetDefaultVersionParams
162
-
163
169
  PlanUpdateParams = Orb::Models::PlanUpdateParams
164
170
 
171
+ PlanVersion = Orb::Models::PlanVersion
172
+
173
+ PlanVersionPhase = Orb::Models::PlanVersionPhase
174
+
165
175
  Price = Orb::Models::Price
166
176
 
167
177
  PriceCreateParams = Orb::Models::PriceCreateParams
168
178
 
179
+ PriceEvaluateMultipleParams = Orb::Models::PriceEvaluateMultipleParams
180
+
169
181
  PriceEvaluateParams = Orb::Models::PriceEvaluateParams
170
182
 
171
183
  PriceFetchParams = Orb::Models::PriceFetchParams
@@ -2,50 +2,58 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
- class Plans
6
- class Versions
5
+ class Beta
6
+ class ExternalPlanID
7
7
  # This API endpoint is in beta and its interface may change. It is recommended for
8
8
  # use only in test mode.
9
9
  #
10
10
  # This endpoint allows the creation of a new plan version for an existing plan.
11
11
  sig do
12
12
  params(
13
- plan_id: String,
13
+ external_plan_id: String,
14
14
  version: Integer,
15
15
  add_adjustments:
16
16
  T.nilable(
17
- T::Array[Orb::Plans::VersionCreateParams::AddAdjustment::OrHash]
17
+ T::Array[
18
+ Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddAdjustment::OrHash
19
+ ]
18
20
  ),
19
21
  add_prices:
20
22
  T.nilable(
21
- T::Array[Orb::Plans::VersionCreateParams::AddPrice::OrHash]
23
+ T::Array[
24
+ Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::OrHash
25
+ ]
22
26
  ),
23
27
  remove_adjustments:
24
28
  T.nilable(
25
29
  T::Array[
26
- Orb::Plans::VersionCreateParams::RemoveAdjustment::OrHash
30
+ Orb::Beta::ExternalPlanIDCreatePlanVersionParams::RemoveAdjustment::OrHash
27
31
  ]
28
32
  ),
29
33
  remove_prices:
30
34
  T.nilable(
31
- T::Array[Orb::Plans::VersionCreateParams::RemovePrice::OrHash]
35
+ T::Array[
36
+ Orb::Beta::ExternalPlanIDCreatePlanVersionParams::RemovePrice::OrHash
37
+ ]
32
38
  ),
33
39
  replace_adjustments:
34
40
  T.nilable(
35
41
  T::Array[
36
- Orb::Plans::VersionCreateParams::ReplaceAdjustment::OrHash
42
+ Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment::OrHash
37
43
  ]
38
44
  ),
39
45
  replace_prices:
40
46
  T.nilable(
41
- T::Array[Orb::Plans::VersionCreateParams::ReplacePrice::OrHash]
47
+ T::Array[
48
+ Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::OrHash
49
+ ]
42
50
  ),
43
51
  set_as_default: T.nilable(T::Boolean),
44
52
  request_options: Orb::RequestOptions::OrHash
45
- ).returns(Orb::Models::Plans::VersionCreateResponse)
53
+ ).returns(Orb::PlanVersion)
46
54
  end
47
- def create(
48
- plan_id,
55
+ def create_plan_version(
56
+ external_plan_id,
49
57
  # New version number.
50
58
  version:,
51
59
  # Additional adjustments to be added to the plan.
@@ -74,11 +82,30 @@ module Orb
74
82
  sig do
75
83
  params(
76
84
  version: String,
77
- plan_id: String,
85
+ external_plan_id: String,
78
86
  request_options: Orb::RequestOptions::OrHash
79
- ).returns(Orb::Models::Plans::VersionRetrieveResponse)
87
+ ).returns(Orb::PlanVersion)
88
+ end
89
+ def fetch_plan_version(version, external_plan_id:, request_options: {})
80
90
  end
81
- def retrieve(version, plan_id:, request_options: {})
91
+
92
+ # This API endpoint is in beta and its interface may change. It is recommended for
93
+ # use only in test mode.
94
+ #
95
+ # This endpoint allows setting the default version of a plan.
96
+ sig do
97
+ params(
98
+ external_plan_id: String,
99
+ version: Integer,
100
+ request_options: Orb::RequestOptions::OrHash
101
+ ).returns(Orb::Plan)
102
+ end
103
+ def set_default_plan_version(
104
+ external_plan_id,
105
+ # Plan version to set as the default.
106
+ version:,
107
+ request_options: {}
108
+ )
82
109
  end
83
110
 
84
111
  # @api private
@@ -0,0 +1,111 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Resources
5
+ class Beta
6
+ sig { returns(Orb::Resources::Beta::ExternalPlanID) }
7
+ attr_reader :external_plan_id
8
+
9
+ # This API endpoint is in beta and its interface may change. It is recommended for
10
+ # use only in test mode.
11
+ #
12
+ # This endpoint allows the creation of a new plan version for an existing plan.
13
+ sig do
14
+ params(
15
+ plan_id: String,
16
+ version: Integer,
17
+ add_adjustments:
18
+ T.nilable(
19
+ T::Array[Orb::BetaCreatePlanVersionParams::AddAdjustment::OrHash]
20
+ ),
21
+ add_prices:
22
+ T.nilable(
23
+ T::Array[Orb::BetaCreatePlanVersionParams::AddPrice::OrHash]
24
+ ),
25
+ remove_adjustments:
26
+ T.nilable(
27
+ T::Array[
28
+ Orb::BetaCreatePlanVersionParams::RemoveAdjustment::OrHash
29
+ ]
30
+ ),
31
+ remove_prices:
32
+ T.nilable(
33
+ T::Array[Orb::BetaCreatePlanVersionParams::RemovePrice::OrHash]
34
+ ),
35
+ replace_adjustments:
36
+ T.nilable(
37
+ T::Array[
38
+ Orb::BetaCreatePlanVersionParams::ReplaceAdjustment::OrHash
39
+ ]
40
+ ),
41
+ replace_prices:
42
+ T.nilable(
43
+ T::Array[Orb::BetaCreatePlanVersionParams::ReplacePrice::OrHash]
44
+ ),
45
+ set_as_default: T.nilable(T::Boolean),
46
+ request_options: Orb::RequestOptions::OrHash
47
+ ).returns(Orb::PlanVersion)
48
+ end
49
+ def create_plan_version(
50
+ plan_id,
51
+ # New version number.
52
+ version:,
53
+ # Additional adjustments to be added to the plan.
54
+ add_adjustments: nil,
55
+ # Additional prices to be added to the plan.
56
+ add_prices: nil,
57
+ # Adjustments to be removed from the plan.
58
+ remove_adjustments: nil,
59
+ # Prices to be removed from the plan.
60
+ remove_prices: nil,
61
+ # Adjustments to be replaced with additional adjustments on the plan.
62
+ replace_adjustments: nil,
63
+ # Prices to be replaced with additional prices on the plan.
64
+ replace_prices: nil,
65
+ # Set this new plan version as the default
66
+ set_as_default: nil,
67
+ request_options: {}
68
+ )
69
+ end
70
+
71
+ # This API endpoint is in beta and its interface may change. It is recommended for
72
+ # use only in test mode.
73
+ #
74
+ # This endpoint is used to fetch a plan version. It returns the phases, prices,
75
+ # and adjustments present on this version of the plan.
76
+ sig do
77
+ params(
78
+ version: String,
79
+ plan_id: String,
80
+ request_options: Orb::RequestOptions::OrHash
81
+ ).returns(Orb::PlanVersion)
82
+ end
83
+ def fetch_plan_version(version, plan_id:, request_options: {})
84
+ end
85
+
86
+ # This API endpoint is in beta and its interface may change. It is recommended for
87
+ # use only in test mode.
88
+ #
89
+ # This endpoint allows setting the default version of a plan.
90
+ sig do
91
+ params(
92
+ plan_id: String,
93
+ version: Integer,
94
+ request_options: Orb::RequestOptions::OrHash
95
+ ).returns(Orb::Plan)
96
+ end
97
+ def set_default_plan_version(
98
+ plan_id,
99
+ # Plan version to set as the default.
100
+ version:,
101
+ request_options: {}
102
+ )
103
+ end
104
+
105
+ # @api private
106
+ sig { params(client: Orb::Client).returns(T.attached_class) }
107
+ def self.new(client:)
108
+ end
109
+ end
110
+ end
111
+ end
@@ -4,9 +4,6 @@ module Orb
4
4
  module Resources
5
5
  class Plans
6
6
  class ExternalPlanID
7
- sig { returns(Orb::Resources::Plans::ExternalPlanID::Versions) }
8
- attr_reader :versions
9
-
10
7
  # This endpoint can be used to update the `external_plan_id`, and `metadata` of an
11
8
  # existing plan.
12
9
  #
@@ -58,25 +55,6 @@ module Orb
58
55
  def fetch(external_plan_id, request_options: {})
59
56
  end
60
57
 
61
- # This API endpoint is in beta and its interface may change. It is recommended for
62
- # use only in test mode.
63
- #
64
- # This endpoint allows setting the default version of a plan.
65
- sig do
66
- params(
67
- external_plan_id: String,
68
- version: Integer,
69
- request_options: Orb::RequestOptions::OrHash
70
- ).returns(Orb::Plan)
71
- end
72
- def set_default_version(
73
- external_plan_id,
74
- # Plan version to set as the default.
75
- version:,
76
- request_options: {}
77
- )
78
- end
79
-
80
58
  # @api private
81
59
  sig { params(client: Orb::Client).returns(T.attached_class) }
82
60
  def self.new(client:)
@@ -6,9 +6,6 @@ module Orb
6
6
  sig { returns(Orb::Resources::Plans::ExternalPlanID) }
7
7
  attr_reader :external_plan_id
8
8
 
9
- sig { returns(Orb::Resources::Plans::Versions) }
10
- attr_reader :versions
11
-
12
9
  # This endpoint allows creation of plans including their prices.
13
10
  sig do
14
11
  params(
@@ -166,25 +163,6 @@ module Orb
166
163
  def fetch(plan_id, request_options: {})
167
164
  end
168
165
 
169
- # This API endpoint is in beta and its interface may change. It is recommended for
170
- # use only in test mode.
171
- #
172
- # This endpoint allows setting the default version of a plan.
173
- sig do
174
- params(
175
- plan_id: String,
176
- version: Integer,
177
- request_options: Orb::RequestOptions::OrHash
178
- ).returns(Orb::Plan)
179
- end
180
- def set_default_version(
181
- plan_id,
182
- # Plan version to set as the default.
183
- version:,
184
- request_options: {}
185
- )
186
- end
187
-
188
166
  # @api private
189
167
  sig { params(client: Orb::Client).returns(T.attached_class) }
190
168
  def self.new(client:)