orb-billing 0.3.2 → 0.5.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 (246) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -0
  3. data/README.md +95 -55
  4. data/lib/orb/client.rb +4 -4
  5. data/lib/orb/errors.rb +1 -1
  6. data/lib/orb/internal/transport/base_client.rb +74 -5
  7. data/lib/orb/internal/transport/pooled_net_requester.rb +17 -1
  8. data/lib/orb/internal/type/array_of.rb +1 -1
  9. data/lib/orb/internal/type/base_model.rb +70 -30
  10. data/lib/orb/internal/type/converter.rb +18 -0
  11. data/lib/orb/internal/type/enum.rb +1 -0
  12. data/lib/orb/internal/type/hash_of.rb +1 -1
  13. data/lib/orb/internal/type/union.rb +1 -0
  14. data/lib/orb/internal/util.rb +56 -0
  15. data/lib/orb/internal.rb +6 -0
  16. data/lib/orb/models/coupon.rb +4 -0
  17. data/lib/orb/models/coupon_create_params.rb +6 -0
  18. data/lib/orb/models/customer_create_params.rb +9 -0
  19. data/lib/orb/models/customer_update_by_external_id_params.rb +9 -0
  20. data/lib/orb/models/customer_update_params.rb +9 -0
  21. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +14 -0
  22. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +14 -0
  23. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +14 -0
  24. data/lib/orb/models/customers/credits/ledger_list_response.rb +14 -0
  25. data/lib/orb/models/discount.rb +6 -0
  26. data/lib/orb/models/evaluate_price_group.rb +4 -0
  27. data/lib/orb/models/invoice.rb +22 -0
  28. data/lib/orb/models/invoice_fetch_upcoming_response.rb +22 -0
  29. data/lib/orb/models/invoice_level_discount.rb +4 -0
  30. data/lib/orb/models/invoice_line_item_create_response.rb +22 -0
  31. data/lib/orb/models/plan.rb +12 -0
  32. data/lib/orb/models/plan_create_params.rb +32 -0
  33. data/lib/orb/models/price.rb +35 -0
  34. data/lib/orb/models/subscription.rb +22 -0
  35. data/lib/orb/models/subscription_cancel_response.rb +22 -0
  36. data/lib/orb/models/subscription_change_apply_response.rb +22 -0
  37. data/lib/orb/models/subscription_change_cancel_response.rb +22 -0
  38. data/lib/orb/models/subscription_change_retrieve_response.rb +22 -0
  39. data/lib/orb/models/subscription_create_params.rb +88 -0
  40. data/lib/orb/models/subscription_create_response.rb +22 -0
  41. data/lib/orb/models/subscription_price_intervals_params.rb +89 -0
  42. data/lib/orb/models/subscription_price_intervals_response.rb +22 -0
  43. data/lib/orb/models/subscription_schedule_plan_change_params.rb +88 -0
  44. data/lib/orb/models/subscription_schedule_plan_change_response.rb +22 -0
  45. data/lib/orb/models/subscription_trigger_phase_response.rb +22 -0
  46. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +22 -0
  47. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +22 -0
  48. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +22 -0
  49. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +22 -0
  50. data/lib/orb/models/subscription_update_trial_params.rb +4 -0
  51. data/lib/orb/models/subscription_update_trial_response.rb +22 -0
  52. data/lib/orb/models/subscription_usage.rb +9 -0
  53. data/lib/orb/models.rb +24 -0
  54. data/lib/orb/request_options.rb +4 -0
  55. data/lib/orb/version.rb +1 -1
  56. data/lib/orb.rb +2 -0
  57. data/rbi/orb/internal/page.rbi +2 -1
  58. data/rbi/orb/internal/transport/base_client.rbi +31 -8
  59. data/rbi/orb/internal/transport/pooled_net_requester.rbi +10 -5
  60. data/rbi/orb/internal/type/base_model.rbi +31 -15
  61. data/rbi/orb/internal/type/base_page.rbi +1 -1
  62. data/rbi/orb/internal/type/converter.rbi +2 -0
  63. data/rbi/orb/internal/type/enum.rbi +1 -0
  64. data/rbi/orb/internal/type/union.rbi +1 -0
  65. data/rbi/orb/internal/util.rbi +28 -7
  66. data/rbi/orb/internal.rbi +2 -0
  67. data/rbi/orb/models/alert.rbi +13 -6
  68. data/rbi/orb/models/alert_create_for_customer_params.rbi +11 -2
  69. data/rbi/orb/models/alert_create_for_external_customer_params.rbi +14 -2
  70. data/rbi/orb/models/alert_create_for_subscription_params.rbi +11 -2
  71. data/rbi/orb/models/alert_disable_params.rbi +2 -1
  72. data/rbi/orb/models/alert_enable_params.rbi +2 -1
  73. data/rbi/orb/models/alert_list_params.rbi +2 -1
  74. data/rbi/orb/models/alert_retrieve_params.rbi +2 -1
  75. data/rbi/orb/models/alert_update_params.rbi +6 -2
  76. data/rbi/orb/models/amount_discount.rbi +2 -1
  77. data/rbi/orb/models/billable_metric.rbi +2 -1
  78. data/rbi/orb/models/coupon.rbi +1 -1
  79. data/rbi/orb/models/coupon_archive_params.rbi +2 -1
  80. data/rbi/orb/models/coupon_create_params.rbi +16 -3
  81. data/rbi/orb/models/coupon_fetch_params.rbi +2 -1
  82. data/rbi/orb/models/coupon_list_params.rbi +2 -1
  83. data/rbi/orb/models/coupons/subscription_list_params.rbi +4 -1
  84. data/rbi/orb/models/credit_note.rbi +45 -9
  85. data/rbi/orb/models/credit_note_create_params.rbi +8 -2
  86. data/rbi/orb/models/credit_note_fetch_params.rbi +4 -1
  87. data/rbi/orb/models/credit_note_list_params.rbi +4 -1
  88. data/rbi/orb/models/customer.rbi +41 -10
  89. data/rbi/orb/models/customer_create_params.rbi +61 -10
  90. data/rbi/orb/models/customer_delete_params.rbi +4 -1
  91. data/rbi/orb/models/customer_fetch_by_external_id_params.rbi +4 -1
  92. data/rbi/orb/models/customer_fetch_params.rbi +2 -1
  93. data/rbi/orb/models/customer_list_params.rbi +2 -1
  94. data/rbi/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi +7 -1
  95. data/rbi/orb/models/customer_sync_payment_methods_from_gateway_params.rbi +7 -1
  96. data/rbi/orb/models/customer_update_by_external_id_params.rbi +67 -10
  97. data/rbi/orb/models/customer_update_params.rbi +61 -10
  98. data/rbi/orb/models/customers/balance_transaction_create_params.rbi +7 -1
  99. data/rbi/orb/models/customers/balance_transaction_create_response.rbi +21 -3
  100. data/rbi/orb/models/customers/balance_transaction_list_params.rbi +7 -1
  101. data/rbi/orb/models/customers/balance_transaction_list_response.rbi +21 -3
  102. data/rbi/orb/models/customers/cost_list_by_external_id_params.rbi +7 -1
  103. data/rbi/orb/models/customers/cost_list_by_external_id_response.rbi +21 -3
  104. data/rbi/orb/models/customers/cost_list_params.rbi +4 -1
  105. data/rbi/orb/models/customers/cost_list_response.rbi +21 -3
  106. data/rbi/orb/models/customers/credit_list_by_external_id_params.rbi +7 -1
  107. data/rbi/orb/models/customers/credit_list_by_external_id_response.rbi +7 -1
  108. data/rbi/orb/models/customers/credit_list_params.rbi +4 -1
  109. data/rbi/orb/models/customers/credit_list_response.rbi +7 -1
  110. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +14 -2
  111. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +133 -21
  112. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +14 -2
  113. data/rbi/orb/models/customers/credits/ledger_create_entry_response.rbi +133 -21
  114. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +7 -1
  115. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +133 -21
  116. data/rbi/orb/models/customers/credits/ledger_list_params.rbi +7 -1
  117. data/rbi/orb/models/customers/credits/ledger_list_response.rbi +133 -21
  118. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +14 -2
  119. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_response.rbi +14 -2
  120. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +14 -2
  121. data/rbi/orb/models/customers/credits/top_up_create_response.rbi +14 -2
  122. data/rbi/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi +7 -1
  123. data/rbi/orb/models/customers/credits/top_up_delete_params.rbi +7 -1
  124. data/rbi/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +7 -1
  125. data/rbi/orb/models/customers/credits/top_up_list_by_external_id_response.rbi +14 -2
  126. data/rbi/orb/models/customers/credits/top_up_list_params.rbi +7 -1
  127. data/rbi/orb/models/customers/credits/top_up_list_response.rbi +14 -2
  128. data/rbi/orb/models/dimensional_price_group.rbi +4 -1
  129. data/rbi/orb/models/dimensional_price_group_create_params.rbi +4 -1
  130. data/rbi/orb/models/dimensional_price_group_list_params.rbi +4 -1
  131. data/rbi/orb/models/dimensional_price_group_retrieve_params.rbi +7 -1
  132. data/rbi/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi +7 -1
  133. data/rbi/orb/models/dimensional_price_groups.rbi +4 -1
  134. data/rbi/orb/models/evaluate_price_group.rbi +2 -1
  135. data/rbi/orb/models/event_deprecate_params.rbi +4 -1
  136. data/rbi/orb/models/event_deprecate_response.rbi +4 -1
  137. data/rbi/orb/models/event_ingest_params.rbi +6 -2
  138. data/rbi/orb/models/event_ingest_response.rbi +18 -3
  139. data/rbi/orb/models/event_search_params.rbi +2 -1
  140. data/rbi/orb/models/event_search_response.rbi +11 -2
  141. data/rbi/orb/models/event_update_params.rbi +2 -1
  142. data/rbi/orb/models/event_update_response.rbi +4 -1
  143. data/rbi/orb/models/events/backfill_close_params.rbi +4 -1
  144. data/rbi/orb/models/events/backfill_close_response.rbi +7 -1
  145. data/rbi/orb/models/events/backfill_create_params.rbi +4 -1
  146. data/rbi/orb/models/events/backfill_create_response.rbi +7 -1
  147. data/rbi/orb/models/events/backfill_fetch_params.rbi +4 -1
  148. data/rbi/orb/models/events/backfill_fetch_response.rbi +7 -1
  149. data/rbi/orb/models/events/backfill_list_params.rbi +4 -1
  150. data/rbi/orb/models/events/backfill_list_response.rbi +7 -1
  151. data/rbi/orb/models/events/backfill_revert_params.rbi +4 -1
  152. data/rbi/orb/models/events/backfill_revert_response.rbi +7 -1
  153. data/rbi/orb/models/events/event_volumes.rbi +8 -2
  154. data/rbi/orb/models/events/volume_list_params.rbi +4 -1
  155. data/rbi/orb/models/invoice.rbi +156 -31
  156. data/rbi/orb/models/invoice_create_params.rbi +13 -3
  157. data/rbi/orb/models/invoice_fetch_params.rbi +2 -1
  158. data/rbi/orb/models/invoice_fetch_upcoming_params.rbi +4 -1
  159. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +212 -31
  160. data/rbi/orb/models/invoice_issue_params.rbi +2 -1
  161. data/rbi/orb/models/invoice_line_item_create_params.rbi +4 -1
  162. data/rbi/orb/models/invoice_line_item_create_response.rbi +119 -17
  163. data/rbi/orb/models/invoice_list_params.rbi +2 -1
  164. data/rbi/orb/models/invoice_mark_paid_params.rbi +4 -1
  165. data/rbi/orb/models/invoice_pay_params.rbi +2 -1
  166. data/rbi/orb/models/invoice_update_params.rbi +2 -1
  167. data/rbi/orb/models/invoice_void_params.rbi +2 -1
  168. data/rbi/orb/models/item.rbi +5 -2
  169. data/rbi/orb/models/item_create_params.rbi +2 -1
  170. data/rbi/orb/models/item_fetch_params.rbi +2 -1
  171. data/rbi/orb/models/item_list_params.rbi +2 -1
  172. data/rbi/orb/models/item_update_params.rbi +9 -2
  173. data/rbi/orb/models/metric_create_params.rbi +2 -1
  174. data/rbi/orb/models/metric_fetch_params.rbi +2 -1
  175. data/rbi/orb/models/metric_list_params.rbi +2 -1
  176. data/rbi/orb/models/metric_update_params.rbi +2 -1
  177. data/rbi/orb/models/pagination_metadata.rbi +2 -1
  178. data/rbi/orb/models/percentage_discount.rbi +2 -1
  179. data/rbi/orb/models/plan.rbi +50 -14
  180. data/rbi/orb/models/plan_create_params.rbi +604 -89
  181. data/rbi/orb/models/plan_fetch_params.rbi +2 -1
  182. data/rbi/orb/models/plan_list_params.rbi +2 -1
  183. data/rbi/orb/models/plan_update_params.rbi +2 -1
  184. data/rbi/orb/models/plans/external_plan_id_fetch_params.rbi +4 -1
  185. data/rbi/orb/models/plans/external_plan_id_update_params.rbi +7 -1
  186. data/rbi/orb/models/price.rbi +1624 -270
  187. data/rbi/orb/models/price_create_params.rbi +100 -18
  188. data/rbi/orb/models/price_evaluate_params.rbi +2 -1
  189. data/rbi/orb/models/price_evaluate_response.rbi +4 -1
  190. data/rbi/orb/models/price_fetch_params.rbi +2 -1
  191. data/rbi/orb/models/price_list_params.rbi +2 -1
  192. data/rbi/orb/models/price_update_params.rbi +2 -1
  193. data/rbi/orb/models/prices/external_price_id_fetch_params.rbi +7 -1
  194. data/rbi/orb/models/prices/external_price_id_update_params.rbi +7 -1
  195. data/rbi/orb/models/subscription.rbi +109 -19
  196. data/rbi/orb/models/subscription_cancel_params.rbi +4 -1
  197. data/rbi/orb/models/subscription_cancel_response.rbi +137 -20
  198. data/rbi/orb/models/subscription_change_apply_params.rbi +4 -1
  199. data/rbi/orb/models/subscription_change_apply_response.rbi +142 -21
  200. data/rbi/orb/models/subscription_change_cancel_params.rbi +4 -1
  201. data/rbi/orb/models/subscription_change_cancel_response.rbi +142 -21
  202. data/rbi/orb/models/subscription_change_retrieve_params.rbi +4 -1
  203. data/rbi/orb/models/subscription_change_retrieve_response.rbi +142 -21
  204. data/rbi/orb/models/subscription_create_params.rbi +1257 -198
  205. data/rbi/orb/models/subscription_create_response.rbi +137 -20
  206. data/rbi/orb/models/subscription_fetch_costs_params.rbi +4 -1
  207. data/rbi/orb/models/subscription_fetch_costs_response.rbi +21 -3
  208. data/rbi/orb/models/subscription_fetch_params.rbi +4 -1
  209. data/rbi/orb/models/subscription_fetch_schedule_params.rbi +4 -1
  210. data/rbi/orb/models/subscription_fetch_schedule_response.rbi +14 -2
  211. data/rbi/orb/models/subscription_fetch_usage_params.rbi +4 -1
  212. data/rbi/orb/models/subscription_list_params.rbi +4 -1
  213. data/rbi/orb/models/subscription_price_intervals_params.rbi +731 -115
  214. data/rbi/orb/models/subscription_price_intervals_response.rbi +140 -20
  215. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +1260 -198
  216. data/rbi/orb/models/subscription_schedule_plan_change_response.rbi +140 -20
  217. data/rbi/orb/models/subscription_trigger_phase_params.rbi +4 -1
  218. data/rbi/orb/models/subscription_trigger_phase_response.rbi +140 -20
  219. data/rbi/orb/models/subscription_unschedule_cancellation_params.rbi +7 -1
  220. data/rbi/orb/models/subscription_unschedule_cancellation_response.rbi +140 -20
  221. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +7 -1
  222. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +140 -20
  223. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_params.rbi +7 -1
  224. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +140 -20
  225. data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +7 -1
  226. data/rbi/orb/models/subscription_update_fixed_fee_quantity_response.rbi +140 -20
  227. data/rbi/orb/models/subscription_update_params.rbi +4 -1
  228. data/rbi/orb/models/subscription_update_trial_params.rbi +4 -1
  229. data/rbi/orb/models/subscription_update_trial_response.rbi +140 -20
  230. data/rbi/orb/models/subscription_usage.rbi +63 -9
  231. data/rbi/orb/models/subscriptions.rbi +2 -1
  232. data/rbi/orb/models/top_level_ping_params.rbi +2 -1
  233. data/rbi/orb/models/top_level_ping_response.rbi +4 -1
  234. data/rbi/orb/models/trial_discount.rbi +2 -1
  235. data/rbi/orb/models/usage_discount.rbi +2 -1
  236. data/rbi/orb/request_options.rbi +1 -1
  237. data/sig/orb/internal/transport/base_client.rbs +16 -1
  238. data/sig/orb/internal/transport/pooled_net_requester.rbs +4 -0
  239. data/sig/orb/internal/type/base_model.rbs +11 -5
  240. data/sig/orb/internal/type/base_page.rbs +1 -1
  241. data/sig/orb/internal/type/converter.rbs +2 -0
  242. data/sig/orb/internal/type/enum.rbs +1 -0
  243. data/sig/orb/internal/type/union.rbs +1 -0
  244. data/sig/orb/internal/util.rbs +13 -0
  245. data/sig/orb/internal.rbs +2 -0
  246. metadata +2 -2
@@ -3,7 +3,13 @@
3
3
  module Orb
4
4
  module Models
5
5
  class SubscriptionUpdateTrialResponse < Orb::Internal::Type::BaseModel
6
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Orb::Models::SubscriptionUpdateTrialResponse,
10
+ Orb::Internal::AnyHash
11
+ )
12
+ end
7
13
 
8
14
  sig { returns(String) }
9
15
  attr_accessor :id
@@ -486,7 +492,13 @@ module Orb
486
492
  end
487
493
 
488
494
  class AdjustmentInterval < Orb::Internal::Type::BaseModel
489
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
495
+ OrHash =
496
+ T.type_alias do
497
+ T.any(
498
+ Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval,
499
+ Orb::Internal::AnyHash
500
+ )
501
+ end
490
502
 
491
503
  sig { returns(String) }
492
504
  attr_accessor :id
@@ -580,7 +592,13 @@ module Orb
580
592
  end
581
593
 
582
594
  class UsageDiscount < Orb::Internal::Type::BaseModel
583
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
595
+ OrHash =
596
+ T.type_alias do
597
+ T.any(
598
+ Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscount,
599
+ Orb::Internal::AnyHash
600
+ )
601
+ end
584
602
 
585
603
  sig { returns(String) }
586
604
  attr_accessor :id
@@ -657,7 +675,13 @@ module Orb
657
675
  end
658
676
 
659
677
  class AmountDiscount < Orb::Internal::Type::BaseModel
660
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
678
+ OrHash =
679
+ T.type_alias do
680
+ T.any(
681
+ Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscount,
682
+ Orb::Internal::AnyHash
683
+ )
684
+ end
661
685
 
662
686
  sig { returns(String) }
663
687
  attr_accessor :id
@@ -734,7 +758,13 @@ module Orb
734
758
  end
735
759
 
736
760
  class PercentageDiscount < Orb::Internal::Type::BaseModel
737
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
761
+ OrHash =
762
+ T.type_alias do
763
+ T.any(
764
+ Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscount,
765
+ Orb::Internal::AnyHash
766
+ )
767
+ end
738
768
 
739
769
  sig { returns(String) }
740
770
  attr_accessor :id
@@ -811,7 +841,13 @@ module Orb
811
841
  end
812
842
 
813
843
  class Minimum < Orb::Internal::Type::BaseModel
814
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
844
+ OrHash =
845
+ T.type_alias do
846
+ T.any(
847
+ Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::Minimum,
848
+ Orb::Internal::AnyHash
849
+ )
850
+ end
815
851
 
816
852
  sig { returns(String) }
817
853
  attr_accessor :id
@@ -896,7 +932,13 @@ module Orb
896
932
  end
897
933
 
898
934
  class Maximum < Orb::Internal::Type::BaseModel
899
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
935
+ OrHash =
936
+ T.type_alias do
937
+ T.any(
938
+ Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::Maximum,
939
+ Orb::Internal::AnyHash
940
+ )
941
+ end
900
942
 
901
943
  sig { returns(String) }
902
944
  attr_accessor :id
@@ -985,7 +1027,13 @@ module Orb
985
1027
  end
986
1028
 
987
1029
  class BillingCycleAnchorConfiguration < Orb::Internal::Type::BaseModel
988
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1030
+ OrHash =
1031
+ T.type_alias do
1032
+ T.any(
1033
+ Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration,
1034
+ Orb::Internal::AnyHash
1035
+ )
1036
+ end
989
1037
 
990
1038
  # The day of the month on which the billing cycle is anchored. If the maximum
991
1039
  # number of days in a month is greater than this value, the last day of the month
@@ -1054,7 +1102,13 @@ module Orb
1054
1102
  end
1055
1103
 
1056
1104
  class Amount < Orb::Internal::Type::BaseModel
1057
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1105
+ OrHash =
1106
+ T.type_alias do
1107
+ T.any(
1108
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::Amount,
1109
+ Orb::Internal::AnyHash
1110
+ )
1111
+ end
1058
1112
 
1059
1113
  # Only available if discount_type is `amount`.
1060
1114
  sig { returns(String) }
@@ -1121,7 +1175,13 @@ module Orb
1121
1175
  end
1122
1176
 
1123
1177
  class Percentage < Orb::Internal::Type::BaseModel
1124
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1178
+ OrHash =
1179
+ T.type_alias do
1180
+ T.any(
1181
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::Percentage,
1182
+ Orb::Internal::AnyHash
1183
+ )
1184
+ end
1125
1185
 
1126
1186
  # The price ids that this discount interval applies to.
1127
1187
  sig { returns(T::Array[String]) }
@@ -1190,7 +1250,13 @@ module Orb
1190
1250
  end
1191
1251
 
1192
1252
  class Usage < Orb::Internal::Type::BaseModel
1193
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1253
+ OrHash =
1254
+ T.type_alias do
1255
+ T.any(
1256
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::Usage,
1257
+ Orb::Internal::AnyHash
1258
+ )
1259
+ end
1194
1260
 
1195
1261
  # The price ids that this discount interval applies to.
1196
1262
  sig { returns(T::Array[String]) }
@@ -1270,7 +1336,13 @@ module Orb
1270
1336
  end
1271
1337
 
1272
1338
  class FixedFeeQuantitySchedule < Orb::Internal::Type::BaseModel
1273
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1339
+ OrHash =
1340
+ T.type_alias do
1341
+ T.any(
1342
+ Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule,
1343
+ Orb::Internal::AnyHash
1344
+ )
1345
+ end
1274
1346
 
1275
1347
  sig { returns(T.nilable(Time)) }
1276
1348
  attr_accessor :end_date
@@ -1310,7 +1382,13 @@ module Orb
1310
1382
  end
1311
1383
 
1312
1384
  class MaximumInterval < Orb::Internal::Type::BaseModel
1313
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1385
+ OrHash =
1386
+ T.type_alias do
1387
+ T.any(
1388
+ Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval,
1389
+ Orb::Internal::AnyHash
1390
+ )
1391
+ end
1314
1392
 
1315
1393
  # The price ids that this maximum interval applies to.
1316
1394
  sig { returns(T::Array[String]) }
@@ -1373,7 +1451,13 @@ module Orb
1373
1451
  end
1374
1452
 
1375
1453
  class MinimumInterval < Orb::Internal::Type::BaseModel
1376
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1454
+ OrHash =
1455
+ T.type_alias do
1456
+ T.any(
1457
+ Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval,
1458
+ Orb::Internal::AnyHash
1459
+ )
1460
+ end
1377
1461
 
1378
1462
  # The price ids that this minimum interval applies to.
1379
1463
  sig { returns(T::Array[String]) }
@@ -1436,7 +1520,13 @@ module Orb
1436
1520
  end
1437
1521
 
1438
1522
  class PendingSubscriptionChange < Orb::Internal::Type::BaseModel
1439
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1523
+ OrHash =
1524
+ T.type_alias do
1525
+ T.any(
1526
+ Orb::Models::SubscriptionUpdateTrialResponse::PendingSubscriptionChange,
1527
+ Orb::Internal::AnyHash
1528
+ )
1529
+ end
1440
1530
 
1441
1531
  sig { returns(String) }
1442
1532
  attr_accessor :id
@@ -1452,7 +1542,13 @@ module Orb
1452
1542
  end
1453
1543
 
1454
1544
  class PriceInterval < Orb::Internal::Type::BaseModel
1455
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1545
+ OrHash =
1546
+ T.type_alias do
1547
+ T.any(
1548
+ Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval,
1549
+ Orb::Internal::AnyHash
1550
+ )
1551
+ end
1456
1552
 
1457
1553
  sig { returns(String) }
1458
1554
  attr_accessor :id
@@ -1698,7 +1794,13 @@ module Orb
1698
1794
  end
1699
1795
 
1700
1796
  class FixedFeeQuantityTransition < Orb::Internal::Type::BaseModel
1701
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1797
+ OrHash =
1798
+ T.type_alias do
1799
+ T.any(
1800
+ Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition,
1801
+ Orb::Internal::AnyHash
1802
+ )
1803
+ end
1702
1804
 
1703
1805
  sig { returns(Time) }
1704
1806
  attr_accessor :effective_date
@@ -1730,7 +1832,13 @@ module Orb
1730
1832
  end
1731
1833
 
1732
1834
  class RedeemedCoupon < Orb::Internal::Type::BaseModel
1733
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1835
+ OrHash =
1836
+ T.type_alias do
1837
+ T.any(
1838
+ Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon,
1839
+ Orb::Internal::AnyHash
1840
+ )
1841
+ end
1734
1842
 
1735
1843
  sig { returns(String) }
1736
1844
  attr_accessor :coupon_id
@@ -1797,7 +1905,13 @@ module Orb
1797
1905
  end
1798
1906
 
1799
1907
  class TrialInfo < Orb::Internal::Type::BaseModel
1800
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1908
+ OrHash =
1909
+ T.type_alias do
1910
+ T.any(
1911
+ Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo,
1912
+ Orb::Internal::AnyHash
1913
+ )
1914
+ end
1801
1915
 
1802
1916
  sig { returns(T.nilable(Time)) }
1803
1917
  attr_accessor :end_date
@@ -1812,7 +1926,13 @@ module Orb
1812
1926
  end
1813
1927
 
1814
1928
  class ChangedResources < Orb::Internal::Type::BaseModel
1815
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
1929
+ OrHash =
1930
+ T.type_alias do
1931
+ T.any(
1932
+ Orb::Models::SubscriptionUpdateTrialResponse::ChangedResources,
1933
+ Orb::Internal::AnyHash
1934
+ )
1935
+ end
1816
1936
 
1817
1937
  # The credit notes that were created as part of this operation.
1818
1938
  sig { returns(T::Array[Orb::CreditNote]) }
@@ -14,7 +14,13 @@ module Orb
14
14
  end
15
15
 
16
16
  class UngroupedSubscriptionUsage < Orb::Internal::Type::BaseModel
17
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
17
+ OrHash =
18
+ T.type_alias do
19
+ T.any(
20
+ Orb::SubscriptionUsage::UngroupedSubscriptionUsage,
21
+ Orb::Internal::AnyHash
22
+ )
23
+ end
18
24
 
19
25
  sig do
20
26
  returns(
@@ -48,7 +54,13 @@ module Orb
48
54
  end
49
55
 
50
56
  class Data < Orb::Internal::Type::BaseModel
51
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
57
+ OrHash =
58
+ T.type_alias do
59
+ T.any(
60
+ Orb::SubscriptionUsage::UngroupedSubscriptionUsage::Data,
61
+ Orb::Internal::AnyHash
62
+ )
63
+ end
52
64
 
53
65
  sig do
54
66
  returns(
@@ -114,7 +126,13 @@ module Orb
114
126
  end
115
127
 
116
128
  class BillableMetric < Orb::Internal::Type::BaseModel
117
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
129
+ OrHash =
130
+ T.type_alias do
131
+ T.any(
132
+ Orb::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric,
133
+ Orb::Internal::AnyHash
134
+ )
135
+ end
118
136
 
119
137
  sig { returns(String) }
120
138
  attr_accessor :id
@@ -132,7 +150,13 @@ module Orb
132
150
  end
133
151
 
134
152
  class Usage < Orb::Internal::Type::BaseModel
135
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
153
+ OrHash =
154
+ T.type_alias do
155
+ T.any(
156
+ Orb::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage,
157
+ Orb::Internal::AnyHash
158
+ )
159
+ end
136
160
 
137
161
  sig { returns(Float) }
138
162
  attr_accessor :quantity
@@ -199,7 +223,13 @@ module Orb
199
223
  end
200
224
 
201
225
  class GroupedSubscriptionUsage < Orb::Internal::Type::BaseModel
202
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
226
+ OrHash =
227
+ T.type_alias do
228
+ T.any(
229
+ Orb::SubscriptionUsage::GroupedSubscriptionUsage,
230
+ Orb::Internal::AnyHash
231
+ )
232
+ end
203
233
 
204
234
  sig do
205
235
  returns(
@@ -245,7 +275,13 @@ module Orb
245
275
  end
246
276
 
247
277
  class Data < Orb::Internal::Type::BaseModel
248
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
278
+ OrHash =
279
+ T.type_alias do
280
+ T.any(
281
+ Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data,
282
+ Orb::Internal::AnyHash
283
+ )
284
+ end
249
285
 
250
286
  sig do
251
287
  returns(
@@ -330,7 +366,13 @@ module Orb
330
366
  end
331
367
 
332
368
  class BillableMetric < Orb::Internal::Type::BaseModel
333
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
369
+ OrHash =
370
+ T.type_alias do
371
+ T.any(
372
+ Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric,
373
+ Orb::Internal::AnyHash
374
+ )
375
+ end
334
376
 
335
377
  sig { returns(String) }
336
378
  attr_accessor :id
@@ -348,7 +390,13 @@ module Orb
348
390
  end
349
391
 
350
392
  class MetricGroup < Orb::Internal::Type::BaseModel
351
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
393
+ OrHash =
394
+ T.type_alias do
395
+ T.any(
396
+ Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup,
397
+ Orb::Internal::AnyHash
398
+ )
399
+ end
352
400
 
353
401
  sig { returns(String) }
354
402
  attr_accessor :property_key
@@ -372,7 +420,13 @@ module Orb
372
420
  end
373
421
 
374
422
  class Usage < Orb::Internal::Type::BaseModel
375
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
423
+ OrHash =
424
+ T.type_alias do
425
+ T.any(
426
+ Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage,
427
+ Orb::Internal::AnyHash
428
+ )
429
+ end
376
430
 
377
431
  sig { returns(Float) }
378
432
  attr_accessor :quantity
@@ -3,7 +3,8 @@
3
3
  module Orb
4
4
  module Models
5
5
  class SubscriptionsAPI < Orb::Internal::Type::BaseModel
6
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
6
+ OrHash =
7
+ T.type_alias { T.any(Orb::SubscriptionsAPI, Orb::Internal::AnyHash) }
7
8
 
8
9
  sig { returns(T::Array[Orb::Subscription]) }
9
10
  attr_accessor :data
@@ -6,7 +6,8 @@ module Orb
6
6
  extend Orb::Internal::Type::RequestParameters::Converter
7
7
  include Orb::Internal::Type::RequestParameters
8
8
 
9
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
9
+ OrHash =
10
+ T.type_alias { T.any(Orb::TopLevelPingParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  sig do
12
13
  params(request_options: Orb::RequestOptions::OrHash).returns(
@@ -3,7 +3,10 @@
3
3
  module Orb
4
4
  module Models
5
5
  class TopLevelPingResponse < Orb::Internal::Type::BaseModel
6
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Orb::Models::TopLevelPingResponse, Orb::Internal::AnyHash)
9
+ end
7
10
 
8
11
  sig { returns(String) }
9
12
  attr_accessor :response
@@ -3,7 +3,8 @@
3
3
  module Orb
4
4
  module Models
5
5
  class TrialDiscount < Orb::Internal::Type::BaseModel
6
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
6
+ OrHash =
7
+ T.type_alias { T.any(Orb::TrialDiscount, Orb::Internal::AnyHash) }
7
8
 
8
9
  # List of price_ids that this discount applies to. For plan/plan phase discounts,
9
10
  # this can be a subset of prices.
@@ -3,7 +3,8 @@
3
3
  module Orb
4
4
  module Models
5
5
  class UsageDiscount < Orb::Internal::Type::BaseModel
6
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
6
+ OrHash =
7
+ T.type_alias { T.any(Orb::UsageDiscount, Orb::Internal::AnyHash) }
7
8
 
8
9
  # List of price_ids that this discount applies to. For plan/plan phase discounts,
9
10
  # this can be a subset of prices.
@@ -7,7 +7,7 @@ module Orb
7
7
  # When making a request, you can pass an actual {RequestOptions} instance, or
8
8
  # simply pass a Hash with symbol keys matching the attributes on this class.
9
9
  class RequestOptions < Orb::Internal::Type::BaseModel
10
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
10
+ OrHash = T.type_alias { T.any(Orb::RequestOptions, Orb::Internal::AnyHash) }
11
11
 
12
12
  # @api private
13
13
  sig { params(opts: Orb::RequestOptions::OrHash).void }
@@ -2,6 +2,8 @@ module Orb
2
2
  module Internal
3
3
  module Transport
4
4
  class BaseClient
5
+ extend Orb::Internal::Util::SorbetRuntimeSupport
6
+
5
7
  type request_components =
6
8
  {
7
9
  method: Symbol,
@@ -20,7 +22,6 @@ module Orb
20
22
  model: Orb::Internal::Type::Converter::input?,
21
23
  options: Orb::request_opts?
22
24
  }
23
-
24
25
  type request_input =
25
26
  {
26
27
  method: Symbol,
@@ -55,6 +56,20 @@ module Orb
55
56
  stream: Enumerable[String]?
56
57
  ) -> void
57
58
 
59
+ attr_reader base_url: URI::Generic
60
+
61
+ attr_reader timeout: Float
62
+
63
+ attr_reader max_retries: Integer
64
+
65
+ attr_reader initial_retry_delay: Float
66
+
67
+ attr_reader max_retry_delay: Float
68
+
69
+ attr_reader headers: ::Hash[String, String]
70
+
71
+ attr_reader idempotency_header: String?
72
+
58
73
  # @api private
59
74
  attr_reader requester: Orb::Internal::Transport::PooledNetRequester
60
75
 
@@ -2,6 +2,8 @@ module Orb
2
2
  module Internal
3
3
  module Transport
4
4
  class PooledNetRequester
5
+ extend Orb::Internal::Util::SorbetRuntimeSupport
6
+
5
7
  type request =
6
8
  {
7
9
  method: Symbol,
@@ -13,6 +15,8 @@ module Orb
13
15
 
14
16
  KEEP_ALIVE_TIMEOUT: 30
15
17
 
18
+ DEFAULT_MAX_CONNECTIONS: Integer
19
+
16
20
  def self.connect: (URI::Generic url) -> top
17
21
 
18
22
  def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
@@ -3,10 +3,13 @@ module Orb
3
3
  module Type
4
4
  class BaseModel
5
5
  extend Orb::Internal::Type::Converter
6
+ extend Orb::Internal::Util::SorbetRuntimeSupport
6
7
 
7
8
  type known_field =
8
9
  { mode: (:coerce | :dump)?, required: bool, nilable: bool }
9
10
 
11
+ def self.inherited: (self child) -> void
12
+
10
13
  def self.known_fields: -> ::Hash[Symbol, (Orb::Internal::Type::BaseModel::known_field
11
14
  & { type_fn: (^-> Orb::Internal::Type::Converter::input) })]
12
15
 
@@ -65,23 +68,26 @@ module Orb
65
68
  state: Orb::Internal::Type::Converter::dump_state
66
69
  ) -> (::Hash[top, top] | top)
67
70
 
71
+ def self.recursively_to_h: (
72
+ Orb::Internal::Type::BaseModel model,
73
+ convert: bool
74
+ ) -> ::Hash[Symbol, top]
75
+
68
76
  def []: (Symbol key) -> top?
69
77
 
70
78
  def to_h: -> ::Hash[Symbol, top]
71
79
 
72
80
  alias to_hash to_h
73
81
 
74
- def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top]
82
+ def deep_to_h: -> ::Hash[Symbol, top]
75
83
 
76
- def self.walk: (
77
- Orb::Internal::Type::BaseModel model
78
- ) -> ::Hash[Symbol, top]
84
+ def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top]
79
85
 
80
86
  def to_json: (*top a) -> String
81
87
 
82
88
  def to_yaml: (*top a) -> String
83
89
 
84
- def initialize: (?::Hash[Symbol, top] | self data) -> void
90
+ def initialize: (?::Hash[Symbol, top] | instance data) -> void
85
91
 
86
92
  def self.inspect: (?depth: Integer) -> String
87
93
 
@@ -4,7 +4,7 @@ module Orb
4
4
  module BasePage[Elem]
5
5
  def next_page?: -> bool
6
6
 
7
- def next_page: -> self
7
+ def next_page: -> instance
8
8
 
9
9
  def auto_paging_each: { (Elem arg0) -> void } -> void
10
10
 
@@ -2,6 +2,8 @@ module Orb
2
2
  module Internal
3
3
  module Type
4
4
  module Converter
5
+ extend Orb::Internal::Util::SorbetRuntimeSupport
6
+
5
7
  type input = Orb::Internal::Type::Converter | Class
6
8
 
7
9
  type coerce_state =
@@ -3,6 +3,7 @@ module Orb
3
3
  module Type
4
4
  module Enum
5
5
  include Orb::Internal::Type::Converter
6
+ include Orb::Internal::Util::SorbetRuntimeSupport
6
7
 
7
8
  def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)]
8
9
 
@@ -3,6 +3,7 @@ module Orb
3
3
  module Type
4
4
  module Union
5
5
  include Orb::Internal::Type::Converter
6
+ include Orb::Internal::Util::SorbetRuntimeSupport
6
7
 
7
8
  private def self.known_variants: -> ::Array[[Symbol?, (^-> Orb::Internal::Type::Converter::input)]]
8
9
 
@@ -1,6 +1,8 @@
1
1
  module Orb
2
2
  module Internal
3
3
  module Util
4
+ extend Orb::Internal::Util::SorbetRuntimeSupport
5
+
4
6
  def self?.monotonic_secs: -> Float
5
7
 
6
8
  def self?.arch: -> String
@@ -155,6 +157,17 @@ module Orb
155
157
  def self?.decode_sse: (
156
158
  Enumerable[String] lines
157
159
  ) -> Enumerable[Orb::Internal::Util::server_sent_event]
160
+
161
+ module SorbetRuntimeSupport
162
+ class MissingSorbetRuntimeError < ::RuntimeError
163
+ end
164
+
165
+ private def sorbet_runtime_constants: -> ::Hash[Symbol, top]
166
+
167
+ def const_missing: (Symbol name) -> void
168
+
169
+ def define_sorbet_constant!: (Symbol name) { -> top } -> void
170
+ end
158
171
  end
159
172
  end
160
173
  end
data/sig/orb/internal.rbs CHANGED
@@ -1,5 +1,7 @@
1
1
  module Orb
2
2
  module Internal
3
+ extend Orb::Internal::Util::SorbetRuntimeSupport
4
+
3
5
  OMIT: Object
4
6
  end
5
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orb-billing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-07 00:00:00.000000000 Z
11
+ date: 2025-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool