orb-billing 1.54.0 → 1.56.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 (150) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +7 -0
  5. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +496 -6
  6. data/lib/orb/models/beta_create_plan_version_params.rb +496 -6
  7. data/lib/orb/models/changed_subscription_resources.rb +2 -2
  8. data/lib/orb/models/credit_block_accounting_sync_failed_webhook_event.rb +4 -4
  9. data/lib/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rb +4 -4
  10. data/lib/orb/models/credit_block_list_invoices_response.rb +4 -4
  11. data/lib/orb/models/credit_block_retrieve_response.rb +4 -4
  12. data/lib/orb/models/credit_block_update_response.rb +4 -4
  13. data/lib/orb/models/customer_credit_ledger_incremented_webhook_event.rb +4 -4
  14. data/lib/orb/models/dimensional_price_groups/price_create_response.rb +2 -2
  15. data/lib/orb/models/invoice.rb +2 -2
  16. data/lib/orb/models/invoice_edited_webhook_event.rb +2 -2
  17. data/lib/orb/models/invoice_fetch_upcoming_response.rb +2 -2
  18. data/lib/orb/models/invoice_line_item_create_response.rb +2 -2
  19. data/lib/orb/models/metric_update_params.rb +4 -3
  20. data/lib/orb/models/migration_cancel_params.rb +20 -0
  21. data/lib/orb/models/migration_cancel_response.rb +133 -0
  22. data/lib/orb/models/migration_create_params.rb +159 -0
  23. data/lib/orb/models/migration_create_response.rb +133 -0
  24. data/lib/orb/models/migration_list_params.rb +48 -0
  25. data/lib/orb/models/migration_list_response.rb +133 -0
  26. data/lib/orb/models/migration_retrieve_params.rb +20 -0
  27. data/lib/orb/models/migration_retrieve_response.rb +133 -0
  28. data/lib/orb/models/migration_subscription.rb +75 -0
  29. data/lib/orb/models/migrations/subscription_list_params.rb +74 -0
  30. data/lib/orb/models/per_price_cost.rb +2 -2
  31. data/lib/orb/models/plan.rb +2 -2
  32. data/lib/orb/models/plan_create_params.rb +246 -3
  33. data/lib/orb/models/plan_version.rb +2 -2
  34. data/lib/orb/models/plans/migration_cancel_response.rb +28 -8
  35. data/lib/orb/models/plans/migration_list_response.rb +28 -8
  36. data/lib/orb/models/plans/migration_retrieve_response.rb +28 -8
  37. data/lib/orb/models/price.rb +416 -1
  38. data/lib/orb/models/price_create_params.rb +231 -3
  39. data/lib/orb/models/price_edited_webhook_event.rb +2 -2
  40. data/lib/orb/models/price_evaluate_multiple_params.rb +238 -3
  41. data/lib/orb/models/price_evaluate_preview_events_params.rb +238 -3
  42. data/lib/orb/models/price_interval.rb +2 -2
  43. data/lib/orb/models/subscription_create_params.rb +495 -6
  44. data/lib/orb/models/subscription_price_intervals_params.rb +238 -3
  45. data/lib/orb/models/subscription_schedule_plan_change_params.rb +496 -6
  46. data/lib/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rb +4 -4
  47. data/lib/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rb +4 -4
  48. data/lib/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rb +4 -4
  49. data/lib/orb/models/webhooks/invoice_edited_standard_webhook_event.rb +2 -2
  50. data/lib/orb/models/webhooks/price_edited_standard_webhook_event.rb +2 -2
  51. data/lib/orb/models.rb +12 -0
  52. data/lib/orb/resources/credit_blocks.rb +1 -1
  53. data/lib/orb/resources/dimensional_price_groups/prices.rb +1 -1
  54. data/lib/orb/resources/metrics.rb +11 -10
  55. data/lib/orb/resources/migrations/subscriptions.rb +60 -0
  56. data/lib/orb/resources/migrations.rb +153 -0
  57. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  58. data/lib/orb/resources/prices.rb +5 -5
  59. data/lib/orb/version.rb +1 -1
  60. data/lib/orb.rb +12 -0
  61. data/rbi/orb/client.rbi +6 -0
  62. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +2939 -2129
  63. data/rbi/orb/models/beta_create_plan_version_params.rbi +2937 -2127
  64. data/rbi/orb/models/changed_subscription_resources.rbi +2 -1
  65. data/rbi/orb/models/credit_block_accounting_sync_failed_webhook_event.rbi +5 -5
  66. data/rbi/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbi +5 -5
  67. data/rbi/orb/models/credit_block_list_invoices_response.rbi +5 -5
  68. data/rbi/orb/models/credit_block_retrieve_response.rbi +5 -5
  69. data/rbi/orb/models/credit_block_update_response.rbi +5 -5
  70. data/rbi/orb/models/customer_credit_ledger_incremented_webhook_event.rbi +5 -5
  71. data/rbi/orb/models/dimensional_price_groups/price_create_response.rbi +2 -1
  72. data/rbi/orb/models/invoice.rbi +2 -1
  73. data/rbi/orb/models/invoice_edited_webhook_event.rbi +2 -1
  74. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +2 -1
  75. data/rbi/orb/models/invoice_line_item_create_response.rbi +2 -1
  76. data/rbi/orb/models/metric_update_params.rbi +6 -4
  77. data/rbi/orb/models/migration_cancel_params.rbi +35 -0
  78. data/rbi/orb/models/migration_cancel_response.rbi +218 -0
  79. data/rbi/orb/models/migration_create_params.rbi +248 -0
  80. data/rbi/orb/models/migration_create_response.rbi +218 -0
  81. data/rbi/orb/models/migration_list_params.rbi +66 -0
  82. data/rbi/orb/models/migration_list_response.rbi +214 -0
  83. data/rbi/orb/models/migration_retrieve_params.rbi +35 -0
  84. data/rbi/orb/models/migration_retrieve_response.rbi +221 -0
  85. data/rbi/orb/models/migration_subscription.rbi +112 -0
  86. data/rbi/orb/models/migrations/subscription_list_params.rbi +147 -0
  87. data/rbi/orb/models/per_price_cost.rbi +2 -1
  88. data/rbi/orb/models/plan.rbi +2 -1
  89. data/rbi/orb/models/plan_create_params.rbi +409 -4
  90. data/rbi/orb/models/plan_version.rbi +2 -1
  91. data/rbi/orb/models/plans/migration_cancel_response.rbi +36 -12
  92. data/rbi/orb/models/plans/migration_list_response.rbi +36 -12
  93. data/rbi/orb/models/plans/migration_retrieve_response.rbi +36 -12
  94. data/rbi/orb/models/price.rbi +716 -1
  95. data/rbi/orb/models/price_create_params.rbi +397 -4
  96. data/rbi/orb/models/price_edited_webhook_event.rbi +2 -1
  97. data/rbi/orb/models/price_evaluate_multiple_params.rbi +397 -4
  98. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +397 -4
  99. data/rbi/orb/models/price_interval.rbi +2 -1
  100. data/rbi/orb/models/subscription_create_params.rbi +2676 -1866
  101. data/rbi/orb/models/subscription_price_intervals_params.rbi +397 -4
  102. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +2686 -1876
  103. data/rbi/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbi +5 -5
  104. data/rbi/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbi +5 -5
  105. data/rbi/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbi +5 -5
  106. data/rbi/orb/models/webhooks/invoice_edited_standard_webhook_event.rbi +2 -1
  107. data/rbi/orb/models/webhooks/price_edited_standard_webhook_event.rbi +2 -1
  108. data/rbi/orb/models.rbi +12 -0
  109. data/rbi/orb/resources/credit_blocks.rbi +1 -1
  110. data/rbi/orb/resources/metrics.rbi +13 -11
  111. data/rbi/orb/resources/migrations/subscriptions.rbi +54 -0
  112. data/rbi/orb/resources/migrations.rbi +130 -0
  113. data/rbi/orb/resources/prices.rbi +2 -1
  114. data/sig/orb/client.rbs +2 -0
  115. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +322 -0
  116. data/sig/orb/models/beta_create_plan_version_params.rbs +322 -0
  117. data/sig/orb/models/credit_block_accounting_sync_failed_webhook_event.rbs +2 -2
  118. data/sig/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbs +2 -2
  119. data/sig/orb/models/credit_block_list_invoices_response.rbs +2 -2
  120. data/sig/orb/models/credit_block_retrieve_response.rbs +2 -2
  121. data/sig/orb/models/credit_block_update_response.rbs +2 -2
  122. data/sig/orb/models/customer_credit_ledger_incremented_webhook_event.rbs +2 -2
  123. data/sig/orb/models/migration_cancel_params.rbs +23 -0
  124. data/sig/orb/models/migration_cancel_response.rbs +84 -0
  125. data/sig/orb/models/migration_create_params.rbs +126 -0
  126. data/sig/orb/models/migration_create_response.rbs +84 -0
  127. data/sig/orb/models/migration_list_params.rbs +43 -0
  128. data/sig/orb/models/migration_list_response.rbs +84 -0
  129. data/sig/orb/models/migration_retrieve_params.rbs +23 -0
  130. data/sig/orb/models/migration_retrieve_response.rbs +84 -0
  131. data/sig/orb/models/migration_subscription.rbs +54 -0
  132. data/sig/orb/models/migrations/subscription_list_params.rbs +64 -0
  133. data/sig/orb/models/plan_create_params.rbs +161 -0
  134. data/sig/orb/models/plans/migration_cancel_response.rbs +17 -4
  135. data/sig/orb/models/plans/migration_list_response.rbs +17 -4
  136. data/sig/orb/models/plans/migration_retrieve_response.rbs +17 -4
  137. data/sig/orb/models/price.rbs +305 -0
  138. data/sig/orb/models/price_create_params.rbs +151 -0
  139. data/sig/orb/models/price_evaluate_multiple_params.rbs +156 -0
  140. data/sig/orb/models/price_evaluate_preview_events_params.rbs +156 -0
  141. data/sig/orb/models/subscription_create_params.rbs +322 -0
  142. data/sig/orb/models/subscription_price_intervals_params.rbs +156 -0
  143. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +322 -0
  144. data/sig/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbs +2 -2
  145. data/sig/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbs +2 -2
  146. data/sig/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbs +2 -2
  147. data/sig/orb/models.rbs +12 -0
  148. data/sig/orb/resources/migrations/subscriptions.rbs +18 -0
  149. data/sig/orb/resources/migrations.rbs +44 -0
  150. metadata +37 -1
@@ -1492,7 +1492,8 @@ module Orb
1492
1492
  Orb::Price::MeteredAllowance::OrHash,
1493
1493
  Orb::Price::MinimumComposite::OrHash,
1494
1494
  Orb::Price::Percent::OrHash,
1495
- Orb::Price::EventOutput::OrHash
1495
+ Orb::Price::EventOutput::OrHash,
1496
+ Orb::Price::UnitWithMultiplier::OrHash
1496
1497
  ),
1497
1498
  quantity: Float,
1498
1499
  start_date: Time,
@@ -334,7 +334,7 @@ module Orb
334
334
  sig { returns(T.nilable(String)) }
335
335
  attr_accessor :per_unit_cost_basis
336
336
 
337
- # `void` means the credit block was deleted. A voided block's `balance` is
337
+ # A deleted credit block keeps its historical fields, and its `balance` is
338
338
  # always 0.
339
339
  sig do
340
340
  returns(
@@ -432,7 +432,7 @@ module Orb
432
432
  # `null`.
433
433
  metadata:,
434
434
  per_unit_cost_basis:,
435
- # `void` means the credit block was deleted. A voided block's `balance` is
435
+ # A deleted credit block keeps its historical fields, and its `balance` is
436
436
  # always 0.
437
437
  status:,
438
438
  # The credit allocation that funded a block. Extends the allocation resource
@@ -673,7 +673,7 @@ module Orb
673
673
  end
674
674
  end
675
675
 
676
- # `void` means the credit block was deleted. A voided block's `balance` is
676
+ # A deleted credit block keeps its historical fields, and its `balance` is
677
677
  # always 0.
678
678
  module Status
679
679
  extend Orb::Internal::Type::Enum
@@ -697,9 +697,9 @@ module Orb
697
697
  :pending_payment,
698
698
  Orb::CreditBlockAccountingSyncFailedWebhookEvent::Block::Status::TaggedSymbol
699
699
  )
700
- VOID =
700
+ DELETED =
701
701
  T.let(
702
- :void,
702
+ :deleted,
703
703
  Orb::CreditBlockAccountingSyncFailedWebhookEvent::Block::Status::TaggedSymbol
704
704
  )
705
705
 
@@ -338,7 +338,7 @@ module Orb
338
338
  sig { returns(T.nilable(String)) }
339
339
  attr_accessor :per_unit_cost_basis
340
340
 
341
- # `void` means the credit block was deleted. A voided block's `balance` is
341
+ # A deleted credit block keeps its historical fields, and its `balance` is
342
342
  # always 0.
343
343
  sig do
344
344
  returns(
@@ -436,7 +436,7 @@ module Orb
436
436
  # `null`.
437
437
  metadata:,
438
438
  per_unit_cost_basis:,
439
- # `void` means the credit block was deleted. A voided block's `balance` is
439
+ # A deleted credit block keeps its historical fields, and its `balance` is
440
440
  # always 0.
441
441
  status:,
442
442
  # The credit allocation that funded a block. Extends the allocation resource
@@ -677,7 +677,7 @@ module Orb
677
677
  end
678
678
  end
679
679
 
680
- # `void` means the credit block was deleted. A voided block's `balance` is
680
+ # A deleted credit block keeps its historical fields, and its `balance` is
681
681
  # always 0.
682
682
  module Status
683
683
  extend Orb::Internal::Type::Enum
@@ -701,9 +701,9 @@ module Orb
701
701
  :pending_payment,
702
702
  Orb::CreditBlockAccountingSyncSucceededWebhookEvent::Block::Status::TaggedSymbol
703
703
  )
704
- VOID =
704
+ DELETED =
705
705
  T.let(
706
- :void,
706
+ :deleted,
707
707
  Orb::CreditBlockAccountingSyncSucceededWebhookEvent::Block::Status::TaggedSymbol
708
708
  )
709
709
 
@@ -110,7 +110,7 @@ module Orb
110
110
  sig { returns(T.nilable(String)) }
111
111
  attr_accessor :per_unit_cost_basis
112
112
 
113
- # `void` means the credit block was deleted. A voided block's `balance` is
113
+ # A deleted credit block keeps its historical fields, and its `balance` is
114
114
  # always 0.
115
115
  sig do
116
116
  returns(
@@ -208,7 +208,7 @@ module Orb
208
208
  # `null`.
209
209
  metadata:,
210
210
  per_unit_cost_basis:,
211
- # `void` means the credit block was deleted. A voided block's `balance` is
211
+ # A deleted credit block keeps its historical fields, and its `balance` is
212
212
  # always 0.
213
213
  status:,
214
214
  # The credit allocation that funded a block. Extends the allocation resource
@@ -449,7 +449,7 @@ module Orb
449
449
  end
450
450
  end
451
451
 
452
- # `void` means the credit block was deleted. A voided block's `balance` is
452
+ # A deleted credit block keeps its historical fields, and its `balance` is
453
453
  # always 0.
454
454
  module Status
455
455
  extend Orb::Internal::Type::Enum
@@ -473,9 +473,9 @@ module Orb
473
473
  :pending_payment,
474
474
  Orb::Models::CreditBlockListInvoicesResponse::Block::Status::TaggedSymbol
475
475
  )
476
- VOID =
476
+ DELETED =
477
477
  T.let(
478
- :void,
478
+ :deleted,
479
479
  Orb::Models::CreditBlockListInvoicesResponse::Block::Status::TaggedSymbol
480
480
  )
481
481
 
@@ -53,7 +53,7 @@ module Orb
53
53
  sig { returns(T.nilable(String)) }
54
54
  attr_accessor :per_unit_cost_basis
55
55
 
56
- # `void` means the credit block was deleted. A voided block's `balance` is
56
+ # A deleted credit block keeps its historical fields, and its `balance` is
57
57
  # always 0.
58
58
  sig do
59
59
  returns(Orb::Models::CreditBlockRetrieveResponse::Status::TaggedSymbol)
@@ -142,7 +142,7 @@ module Orb
142
142
  # `null`.
143
143
  metadata:,
144
144
  per_unit_cost_basis:,
145
- # `void` means the credit block was deleted. A voided block's `balance` is
145
+ # A deleted credit block keeps its historical fields, and its `balance` is
146
146
  # always 0.
147
147
  status:,
148
148
  # The credit allocation that funded a block. Extends the allocation resource
@@ -380,7 +380,7 @@ module Orb
380
380
  end
381
381
  end
382
382
 
383
- # `void` means the credit block was deleted. A voided block's `balance` is
383
+ # A deleted credit block keeps its historical fields, and its `balance` is
384
384
  # always 0.
385
385
  module Status
386
386
  extend Orb::Internal::Type::Enum
@@ -401,9 +401,9 @@ module Orb
401
401
  :pending_payment,
402
402
  Orb::Models::CreditBlockRetrieveResponse::Status::TaggedSymbol
403
403
  )
404
- VOID =
404
+ DELETED =
405
405
  T.let(
406
- :void,
406
+ :deleted,
407
407
  Orb::Models::CreditBlockRetrieveResponse::Status::TaggedSymbol
408
408
  )
409
409
 
@@ -48,7 +48,7 @@ module Orb
48
48
  sig { returns(T.nilable(String)) }
49
49
  attr_accessor :per_unit_cost_basis
50
50
 
51
- # `void` means the credit block was deleted. A voided block's `balance` is
51
+ # A deleted credit block keeps its historical fields, and its `balance` is
52
52
  # always 0.
53
53
  sig do
54
54
  returns(Orb::Models::CreditBlockUpdateResponse::Status::TaggedSymbol)
@@ -137,7 +137,7 @@ module Orb
137
137
  # `null`.
138
138
  metadata:,
139
139
  per_unit_cost_basis:,
140
- # `void` means the credit block was deleted. A voided block's `balance` is
140
+ # A deleted credit block keeps its historical fields, and its `balance` is
141
141
  # always 0.
142
142
  status:,
143
143
  # The credit allocation that funded a block. Extends the allocation resource
@@ -375,7 +375,7 @@ module Orb
375
375
  end
376
376
  end
377
377
 
378
- # `void` means the credit block was deleted. A voided block's `balance` is
378
+ # A deleted credit block keeps its historical fields, and its `balance` is
379
379
  # always 0.
380
380
  module Status
381
381
  extend Orb::Internal::Type::Enum
@@ -396,9 +396,9 @@ module Orb
396
396
  :pending_payment,
397
397
  Orb::Models::CreditBlockUpdateResponse::Status::TaggedSymbol
398
398
  )
399
- VOID =
399
+ DELETED =
400
400
  T.let(
401
- :void,
401
+ :deleted,
402
402
  Orb::Models::CreditBlockUpdateResponse::Status::TaggedSymbol
403
403
  )
404
404
 
@@ -298,7 +298,7 @@ module Orb
298
298
  sig { returns(T.nilable(String)) }
299
299
  attr_accessor :per_unit_cost_basis
300
300
 
301
- # `void` means the credit block was deleted. A voided block's `balance` is
301
+ # A deleted credit block keeps its historical fields, and its `balance` is
302
302
  # always 0.
303
303
  sig do
304
304
  returns(
@@ -396,7 +396,7 @@ module Orb
396
396
  # `null`.
397
397
  metadata:,
398
398
  per_unit_cost_basis:,
399
- # `void` means the credit block was deleted. A voided block's `balance` is
399
+ # A deleted credit block keeps its historical fields, and its `balance` is
400
400
  # always 0.
401
401
  status:,
402
402
  # The credit allocation that funded a block. Extends the allocation resource
@@ -637,7 +637,7 @@ module Orb
637
637
  end
638
638
  end
639
639
 
640
- # `void` means the credit block was deleted. A voided block's `balance` is
640
+ # A deleted credit block keeps its historical fields, and its `balance` is
641
641
  # always 0.
642
642
  module Status
643
643
  extend Orb::Internal::Type::Enum
@@ -661,9 +661,9 @@ module Orb
661
661
  :pending_payment,
662
662
  Orb::CustomerCreditLedgerIncrementedWebhookEvent::Properties::Block::Status::TaggedSymbol
663
663
  )
664
- VOID =
664
+ DELETED =
665
665
  T.let(
666
- :void,
666
+ :deleted,
667
667
  Orb::CustomerCreditLedgerIncrementedWebhookEvent::Properties::Block::Status::TaggedSymbol
668
668
  )
669
669
 
@@ -56,7 +56,8 @@ module Orb
56
56
  Orb::Price::MeteredAllowance::OrHash,
57
57
  Orb::Price::MinimumComposite::OrHash,
58
58
  Orb::Price::Percent::OrHash,
59
- Orb::Price::EventOutput::OrHash
59
+ Orb::Price::EventOutput::OrHash,
60
+ Orb::Price::UnitWithMultiplier::OrHash
60
61
  )
61
62
  ]
62
63
  ).returns(T.attached_class)
@@ -1297,7 +1297,8 @@ module Orb
1297
1297
  Orb::Price::MeteredAllowance::OrHash,
1298
1298
  Orb::Price::MinimumComposite::OrHash,
1299
1299
  Orb::Price::Percent::OrHash,
1300
- Orb::Price::EventOutput::OrHash
1300
+ Orb::Price::EventOutput::OrHash,
1301
+ Orb::Price::UnitWithMultiplier::OrHash
1301
1302
  ),
1302
1303
  quantity: Float,
1303
1304
  start_date: Time,
@@ -469,7 +469,8 @@ module Orb
469
469
  Orb::Price::MeteredAllowance::OrHash,
470
470
  Orb::Price::MinimumComposite::OrHash,
471
471
  Orb::Price::Percent::OrHash,
472
- Orb::Price::EventOutput::OrHash
472
+ Orb::Price::EventOutput::OrHash,
473
+ Orb::Price::UnitWithMultiplier::OrHash
473
474
  ),
474
475
  quantity: Float,
475
476
  start_date: Time,
@@ -1400,7 +1400,8 @@ module Orb
1400
1400
  Orb::Price::MeteredAllowance::OrHash,
1401
1401
  Orb::Price::MinimumComposite::OrHash,
1402
1402
  Orb::Price::Percent::OrHash,
1403
- Orb::Price::EventOutput::OrHash
1403
+ Orb::Price::EventOutput::OrHash,
1404
+ Orb::Price::UnitWithMultiplier::OrHash
1404
1405
  ),
1405
1406
  quantity: Float,
1406
1407
  start_date: Time,
@@ -167,7 +167,8 @@ module Orb
167
167
  Orb::Price::MeteredAllowance::OrHash,
168
168
  Orb::Price::MinimumComposite::OrHash,
169
169
  Orb::Price::Percent::OrHash,
170
- Orb::Price::EventOutput::OrHash
170
+ Orb::Price::EventOutput::OrHash,
171
+ Orb::Price::UnitWithMultiplier::OrHash
171
172
  ),
172
173
  quantity: Float,
173
174
  start_date: Time,
@@ -16,8 +16,9 @@ module Orb
16
16
  sig { returns(T.nilable(String)) }
17
17
  attr_accessor :description
18
18
 
19
- # The id of the item to associate the metric with. Can only be changed while the
20
- # metric is in `draft` status.
19
+ # The id of the item to associate the metric with. Prices created on the metric
20
+ # afterwards use the new item; existing prices keep the item they were created
21
+ # with.
21
22
  sig { returns(T.nilable(String)) }
22
23
  attr_accessor :item_id
23
24
 
@@ -52,8 +53,9 @@ module Orb
52
53
  metric_id:,
53
54
  # A description of the metric.
54
55
  description: nil,
55
- # The id of the item to associate the metric with. Can only be changed while the
56
- # metric is in `draft` status.
56
+ # The id of the item to associate the metric with. Prices created on the metric
57
+ # afterwards use the new item; existing prices keep the item they were created
58
+ # with.
57
59
  item_id: nil,
58
60
  # User-specified key/value pairs for the resource. Individual keys can be removed
59
61
  # by setting the value to `null`, and the entire metadata mapping can be cleared
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ class MigrationCancelParams < Orb::Internal::Type::BaseModel
6
+ extend Orb::Internal::Type::RequestParameters::Converter
7
+ include Orb::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Orb::MigrationCancelParams, Orb::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :migration_id
16
+
17
+ sig do
18
+ params(
19
+ migration_id: String,
20
+ request_options: Orb::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(migration_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { migration_id: String, request_options: Orb::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,218 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ class MigrationCancelResponse < Orb::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Orb::Models::MigrationCancelResponse, Orb::Internal::AnyHash)
9
+ end
10
+
11
+ # Unique identifier for this plan version change.
12
+ sig { returns(String) }
13
+ attr_accessor :id
14
+
15
+ # When the migration takes effect. Can be a specific date/time, 'start_of_term' or
16
+ # 'end_of_term' when scheduled to be at the start or end of the current billing
17
+ # period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
18
+ # start of the current or next invoice.
19
+ sig do
20
+ returns(
21
+ T.nilable(
22
+ Orb::Models::MigrationCancelResponse::EffectiveTime::Variants
23
+ )
24
+ )
25
+ end
26
+ attr_accessor :effective_time
27
+
28
+ # When the migration completed or was canceled, or null if it is still in
29
+ # progress.
30
+ sig { returns(T.nilable(Time)) }
31
+ attr_accessor :ended_at
32
+
33
+ # The ID of the plan being migrated.
34
+ sig { returns(String) }
35
+ attr_accessor :plan_id
36
+
37
+ # When Orb began migrating the plan's subscriptions. Null if the migration has not
38
+ # begun, or was canceled before it began.
39
+ sig { returns(T.nilable(Time)) }
40
+ attr_accessor :started_at
41
+
42
+ # Current status of the migration: 'not_started', 'in_progress', 'completed',
43
+ # 'action_needed', or 'canceled'.
44
+ sig do
45
+ returns(Orb::Models::MigrationCancelResponse::Status::TaggedSymbol)
46
+ end
47
+ attr_accessor :status
48
+
49
+ # The plan version subscriptions are migrated to.
50
+ sig { returns(Integer) }
51
+ attr_accessor :target_plan_version_number
52
+
53
+ # A migration moves a plan's subscriptions onto one of the plan's versions. Each
54
+ # subscription is migrated asynchronously, either immediately or at a scheduled
55
+ # time, and the migration reports its overall status as it progresses.
56
+ sig do
57
+ params(
58
+ id: String,
59
+ effective_time:
60
+ T.nilable(
61
+ T.any(
62
+ Date,
63
+ Time,
64
+ Orb::Models::MigrationCancelResponse::EffectiveTime::OrSymbol
65
+ )
66
+ ),
67
+ ended_at: T.nilable(Time),
68
+ plan_id: String,
69
+ started_at: T.nilable(Time),
70
+ status: Orb::Models::MigrationCancelResponse::Status::OrSymbol,
71
+ target_plan_version_number: Integer
72
+ ).returns(T.attached_class)
73
+ end
74
+ def self.new(
75
+ # Unique identifier for this plan version change.
76
+ id:,
77
+ # When the migration takes effect. Can be a specific date/time, 'start_of_term' or
78
+ # 'end_of_term' when scheduled to be at the start or end of the current billing
79
+ # period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
80
+ # start of the current or next invoice.
81
+ effective_time:,
82
+ # When the migration completed or was canceled, or null if it is still in
83
+ # progress.
84
+ ended_at:,
85
+ # The ID of the plan being migrated.
86
+ plan_id:,
87
+ # When Orb began migrating the plan's subscriptions. Null if the migration has not
88
+ # begun, or was canceled before it began.
89
+ started_at:,
90
+ # Current status of the migration: 'not_started', 'in_progress', 'completed',
91
+ # 'action_needed', or 'canceled'.
92
+ status:,
93
+ # The plan version subscriptions are migrated to.
94
+ target_plan_version_number:
95
+ )
96
+ end
97
+
98
+ sig do
99
+ override.returns(
100
+ {
101
+ id: String,
102
+ effective_time:
103
+ T.nilable(
104
+ Orb::Models::MigrationCancelResponse::EffectiveTime::Variants
105
+ ),
106
+ ended_at: T.nilable(Time),
107
+ plan_id: String,
108
+ started_at: T.nilable(Time),
109
+ status: Orb::Models::MigrationCancelResponse::Status::TaggedSymbol,
110
+ target_plan_version_number: Integer
111
+ }
112
+ )
113
+ end
114
+ def to_hash
115
+ end
116
+
117
+ # When the migration takes effect. Can be a specific date/time, 'start_of_term' or
118
+ # 'end_of_term' when scheduled to be at the start or end of the current billing
119
+ # period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
120
+ # start of the current or next invoice.
121
+ module EffectiveTime
122
+ extend Orb::Internal::Type::Union
123
+
124
+ Variants =
125
+ T.type_alias do
126
+ T.any(
127
+ Date,
128
+ Time,
129
+ Orb::Models::MigrationCancelResponse::EffectiveTime::TaggedSymbol
130
+ )
131
+ end
132
+
133
+ sig do
134
+ override.returns(
135
+ T::Array[
136
+ Orb::Models::MigrationCancelResponse::EffectiveTime::Variants
137
+ ]
138
+ )
139
+ end
140
+ def self.variants
141
+ end
142
+
143
+ TaggedSymbol =
144
+ T.type_alias do
145
+ T.all(Symbol, Orb::Models::MigrationCancelResponse::EffectiveTime)
146
+ end
147
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
148
+
149
+ START_OF_TERM =
150
+ T.let(
151
+ :start_of_term,
152
+ Orb::Models::MigrationCancelResponse::EffectiveTime::TaggedSymbol
153
+ )
154
+ END_OF_TERM =
155
+ T.let(
156
+ :end_of_term,
157
+ Orb::Models::MigrationCancelResponse::EffectiveTime::TaggedSymbol
158
+ )
159
+ START_OF_INVOICE =
160
+ T.let(
161
+ :start_of_invoice,
162
+ Orb::Models::MigrationCancelResponse::EffectiveTime::TaggedSymbol
163
+ )
164
+ END_OF_INVOICE =
165
+ T.let(
166
+ :end_of_invoice,
167
+ Orb::Models::MigrationCancelResponse::EffectiveTime::TaggedSymbol
168
+ )
169
+ end
170
+
171
+ # Current status of the migration: 'not_started', 'in_progress', 'completed',
172
+ # 'action_needed', or 'canceled'.
173
+ module Status
174
+ extend Orb::Internal::Type::Enum
175
+
176
+ TaggedSymbol =
177
+ T.type_alias do
178
+ T.all(Symbol, Orb::Models::MigrationCancelResponse::Status)
179
+ end
180
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
181
+
182
+ NOT_STARTED =
183
+ T.let(
184
+ :not_started,
185
+ Orb::Models::MigrationCancelResponse::Status::TaggedSymbol
186
+ )
187
+ IN_PROGRESS =
188
+ T.let(
189
+ :in_progress,
190
+ Orb::Models::MigrationCancelResponse::Status::TaggedSymbol
191
+ )
192
+ COMPLETED =
193
+ T.let(
194
+ :completed,
195
+ Orb::Models::MigrationCancelResponse::Status::TaggedSymbol
196
+ )
197
+ ACTION_NEEDED =
198
+ T.let(
199
+ :action_needed,
200
+ Orb::Models::MigrationCancelResponse::Status::TaggedSymbol
201
+ )
202
+ CANCELED =
203
+ T.let(
204
+ :canceled,
205
+ Orb::Models::MigrationCancelResponse::Status::TaggedSymbol
206
+ )
207
+
208
+ sig do
209
+ override.returns(
210
+ T::Array[Orb::Models::MigrationCancelResponse::Status::TaggedSymbol]
211
+ )
212
+ end
213
+ def self.values
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end