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
@@ -4,6 +4,8 @@ module Orb
4
4
  module Internal
5
5
  # @api private
6
6
  module Util
7
+ extend Orb::Internal::Util::SorbetRuntimeSupport
8
+
7
9
  # @api private
8
10
  sig { returns(Float) }
9
11
  def self.monotonic_secs
@@ -168,7 +170,7 @@ module Orb
168
170
  end
169
171
  end
170
172
 
171
- ParsedUriShape =
173
+ ParsedUri =
172
174
  T.type_alias do
173
175
  {
174
176
  scheme: T.nilable(String),
@@ -183,7 +185,7 @@ module Orb
183
185
  # @api private
184
186
  sig do
185
187
  params(url: T.any(URI::Generic, String)).returns(
186
- Orb::Internal::Util::ParsedUriShape
188
+ Orb::Internal::Util::ParsedUri
187
189
  )
188
190
  end
189
191
  def parse_uri(url)
@@ -191,9 +193,7 @@ module Orb
191
193
 
192
194
  # @api private
193
195
  sig do
194
- params(parsed: Orb::Internal::Util::ParsedUriShape).returns(
195
- URI::Generic
196
- )
196
+ params(parsed: Orb::Internal::Util::ParsedUri).returns(URI::Generic)
197
197
  end
198
198
  def unparse_uri(parsed)
199
199
  end
@@ -201,8 +201,8 @@ module Orb
201
201
  # @api private
202
202
  sig do
203
203
  params(
204
- lhs: Orb::Internal::Util::ParsedUriShape,
205
- rhs: Orb::Internal::Util::ParsedUriShape
204
+ lhs: Orb::Internal::Util::ParsedUri,
205
+ rhs: Orb::Internal::Util::ParsedUri
206
206
  ).returns(URI::Generic)
207
207
  end
208
208
  def join_parsed_uri(lhs, rhs)
@@ -419,6 +419,27 @@ module Orb
419
419
  def decode_sse(lines)
420
420
  end
421
421
  end
422
+
423
+ # @api private
424
+ module SorbetRuntimeSupport
425
+ class MissingSorbetRuntimeError < ::RuntimeError
426
+ end
427
+
428
+ # @api private
429
+ sig { returns(T::Hash[Symbol, T.anything]) }
430
+ private def sorbet_runtime_constants
431
+ end
432
+
433
+ # @api private
434
+ sig { params(name: Symbol).void }
435
+ def const_missing(name)
436
+ end
437
+
438
+ # @api private
439
+ sig { params(name: Symbol, blk: T.proc.returns(T.anything)).void }
440
+ def define_sorbet_constant!(name, &blk)
441
+ end
442
+ end
422
443
  end
423
444
  end
424
445
  end
data/rbi/orb/internal.rbi CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Orb
4
4
  module Internal
5
+ extend Orb::Internal::Util::SorbetRuntimeSupport
6
+
5
7
  # Due to the current WIP status of Shapes support in Sorbet, types referencing
6
8
  # this alias might be refined in the future.
7
9
  AnyHash = T.type_alias { T::Hash[Symbol, T.anything] }
@@ -3,7 +3,7 @@
3
3
  module Orb
4
4
  module Models
5
5
  class Alert < Orb::Internal::Type::BaseModel
6
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
6
+ OrHash = T.type_alias { T.any(Orb::Alert, Orb::Internal::AnyHash) }
7
7
 
8
8
  # Also referred to as alert_id in this documentation.
9
9
  sig { returns(String) }
@@ -124,7 +124,8 @@ module Orb
124
124
  end
125
125
 
126
126
  class Customer < Orb::Internal::Type::BaseModel
127
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
127
+ OrHash =
128
+ T.type_alias { T.any(Orb::Alert::Customer, Orb::Internal::AnyHash) }
128
129
 
129
130
  sig { returns(String) }
130
131
  attr_accessor :id
@@ -151,7 +152,8 @@ module Orb
151
152
  end
152
153
 
153
154
  class Metric < Orb::Internal::Type::BaseModel
154
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
155
+ OrHash =
156
+ T.type_alias { T.any(Orb::Alert::Metric, Orb::Internal::AnyHash) }
155
157
 
156
158
  sig { returns(String) }
157
159
  attr_accessor :id
@@ -167,7 +169,8 @@ module Orb
167
169
  end
168
170
 
169
171
  class Plan < Orb::Internal::Type::BaseModel
170
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
172
+ OrHash =
173
+ T.type_alias { T.any(Orb::Alert::Plan, Orb::Internal::AnyHash) }
171
174
 
172
175
  sig { returns(T.nilable(String)) }
173
176
  attr_accessor :id
@@ -219,7 +222,10 @@ module Orb
219
222
  end
220
223
 
221
224
  class Subscription < Orb::Internal::Type::BaseModel
222
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
225
+ OrHash =
226
+ T.type_alias do
227
+ T.any(Orb::Alert::Subscription, Orb::Internal::AnyHash)
228
+ end
223
229
 
224
230
  sig { returns(String) }
225
231
  attr_accessor :id
@@ -235,7 +241,8 @@ module Orb
235
241
  end
236
242
 
237
243
  class Threshold < Orb::Internal::Type::BaseModel
238
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
244
+ OrHash =
245
+ T.type_alias { T.any(Orb::Alert::Threshold, Orb::Internal::AnyHash) }
239
246
 
240
247
  # The value at which an alert will fire. For credit balance alerts, the alert will
241
248
  # fire at or below this value. For usage and cost alerts, the alert will fire at
@@ -6,7 +6,10 @@ 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 do
11
+ T.any(Orb::AlertCreateForCustomerParams, Orb::Internal::AnyHash)
12
+ end
10
13
 
11
14
  # The case sensitive currency or custom pricing unit to use for this alert.
12
15
  sig { returns(String) }
@@ -96,7 +99,13 @@ module Orb
96
99
  end
97
100
 
98
101
  class Threshold < Orb::Internal::Type::BaseModel
99
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
102
+ OrHash =
103
+ T.type_alias do
104
+ T.any(
105
+ Orb::AlertCreateForCustomerParams::Threshold,
106
+ Orb::Internal::AnyHash
107
+ )
108
+ end
100
109
 
101
110
  # The value at which an alert will fire. For credit balance alerts, the alert will
102
111
  # fire at or below this value. For usage and cost alerts, the alert will fire at
@@ -6,7 +6,13 @@ 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 do
11
+ T.any(
12
+ Orb::AlertCreateForExternalCustomerParams,
13
+ Orb::Internal::AnyHash
14
+ )
15
+ end
10
16
 
11
17
  # The case sensitive currency or custom pricing unit to use for this alert.
12
18
  sig { returns(String) }
@@ -104,7 +110,13 @@ module Orb
104
110
  end
105
111
 
106
112
  class Threshold < Orb::Internal::Type::BaseModel
107
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
113
+ OrHash =
114
+ T.type_alias do
115
+ T.any(
116
+ Orb::AlertCreateForExternalCustomerParams::Threshold,
117
+ Orb::Internal::AnyHash
118
+ )
119
+ end
108
120
 
109
121
  # The value at which an alert will fire. For credit balance alerts, the alert will
110
122
  # fire at or below this value. For usage and cost alerts, the alert will fire at
@@ -6,7 +6,10 @@ 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 do
11
+ T.any(Orb::AlertCreateForSubscriptionParams, Orb::Internal::AnyHash)
12
+ end
10
13
 
11
14
  # The thresholds that define the values at which the alert will be triggered.
12
15
  sig do
@@ -57,7 +60,13 @@ module Orb
57
60
  end
58
61
 
59
62
  class Threshold < Orb::Internal::Type::BaseModel
60
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
63
+ OrHash =
64
+ T.type_alias do
65
+ T.any(
66
+ Orb::AlertCreateForSubscriptionParams::Threshold,
67
+ Orb::Internal::AnyHash
68
+ )
69
+ end
61
70
 
62
71
  # The value at which an alert will fire. For credit balance alerts, the alert will
63
72
  # fire at or below this value. For usage and cost alerts, the alert will fire at
@@ -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::AlertDisableParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  # Used to update the status of a plan alert scoped to this subscription_id
12
13
  sig { returns(T.nilable(String)) }
@@ -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::AlertEnableParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  # Used to update the status of a plan alert scoped to this subscription_id
12
13
  sig { returns(T.nilable(String)) }
@@ -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::AlertListParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  sig { returns(T.nilable(Time)) }
12
13
  attr_accessor :created_at_gt
@@ -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::AlertRetrieveParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  sig do
12
13
  params(request_options: Orb::RequestOptions::OrHash).returns(
@@ -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::AlertUpdateParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  # The thresholds that define the values at which the alert will be triggered.
12
13
  sig { returns(T::Array[Orb::AlertUpdateParams::Threshold]) }
@@ -37,7 +38,10 @@ module Orb
37
38
  end
38
39
 
39
40
  class Threshold < Orb::Internal::Type::BaseModel
40
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
41
+ OrHash =
42
+ T.type_alias do
43
+ T.any(Orb::AlertUpdateParams::Threshold, Orb::Internal::AnyHash)
44
+ end
41
45
 
42
46
  # The value at which an alert will fire. For credit balance alerts, the alert will
43
47
  # fire at or below this value. For usage and cost alerts, the alert will fire at
@@ -3,7 +3,8 @@
3
3
  module Orb
4
4
  module Models
5
5
  class AmountDiscount < 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::AmountDiscount, Orb::Internal::AnyHash) }
7
8
 
8
9
  # Only available if discount_type is `amount`.
9
10
  sig { returns(String) }
@@ -3,7 +3,8 @@
3
3
  module Orb
4
4
  module Models
5
5
  class BillableMetric < 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::BillableMetric, Orb::Internal::AnyHash) }
7
8
 
8
9
  sig { returns(String) }
9
10
  attr_accessor :id
@@ -3,7 +3,7 @@
3
3
  module Orb
4
4
  module Models
5
5
  class Coupon < Orb::Internal::Type::BaseModel
6
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
6
+ OrHash = T.type_alias { T.any(Orb::Coupon, Orb::Internal::AnyHash) }
7
7
 
8
8
  # Also referred to as coupon_id in this documentation.
9
9
  sig { returns(String) }
@@ -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::CouponArchiveParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  sig do
12
13
  params(request_options: Orb::RequestOptions::OrHash).returns(
@@ -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::CouponCreateParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  sig do
12
13
  returns(
@@ -89,7 +90,13 @@ module Orb
89
90
  end
90
91
 
91
92
  class Percentage < Orb::Internal::Type::BaseModel
92
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
93
+ OrHash =
94
+ T.type_alias do
95
+ T.any(
96
+ Orb::CouponCreateParams::Discount::Percentage,
97
+ Orb::Internal::AnyHash
98
+ )
99
+ end
93
100
 
94
101
  sig { returns(Symbol) }
95
102
  attr_accessor :discount_type
@@ -115,7 +122,13 @@ module Orb
115
122
  end
116
123
 
117
124
  class Amount < Orb::Internal::Type::BaseModel
118
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
125
+ OrHash =
126
+ T.type_alias do
127
+ T.any(
128
+ Orb::CouponCreateParams::Discount::Amount,
129
+ Orb::Internal::AnyHash
130
+ )
131
+ end
119
132
 
120
133
  sig { returns(String) }
121
134
  attr_accessor :amount_discount
@@ -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::CouponFetchParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  sig do
12
13
  params(request_options: Orb::RequestOptions::OrHash).returns(
@@ -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::CouponListParams, Orb::Internal::AnyHash) }
10
11
 
11
12
  # Cursor for pagination. This can be populated by the `next_cursor` value returned
12
13
  # from the initial request.
@@ -7,7 +7,10 @@ module Orb
7
7
  extend Orb::Internal::Type::RequestParameters::Converter
8
8
  include Orb::Internal::Type::RequestParameters
9
9
 
10
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(Orb::Coupons::SubscriptionListParams, Orb::Internal::AnyHash)
13
+ end
11
14
 
12
15
  # Cursor for pagination. This can be populated by the `next_cursor` value returned
13
16
  # from the initial request.
@@ -3,7 +3,7 @@
3
3
  module Orb
4
4
  module Models
5
5
  class CreditNote < Orb::Internal::Type::BaseModel
6
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
6
+ OrHash = T.type_alias { T.any(Orb::CreditNote, Orb::Internal::AnyHash) }
7
7
 
8
8
  # The Orb id of this credit note.
9
9
  sig { returns(String) }
@@ -165,7 +165,10 @@ module Orb
165
165
  end
166
166
 
167
167
  class Customer < Orb::Internal::Type::BaseModel
168
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
168
+ OrHash =
169
+ T.type_alias do
170
+ T.any(Orb::CreditNote::Customer, Orb::Internal::AnyHash)
171
+ end
169
172
 
170
173
  sig { returns(String) }
171
174
  attr_accessor :id
@@ -191,7 +194,10 @@ module Orb
191
194
  end
192
195
 
193
196
  class LineItem < Orb::Internal::Type::BaseModel
194
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
197
+ OrHash =
198
+ T.type_alias do
199
+ T.any(Orb::CreditNote::LineItem, Orb::Internal::AnyHash)
200
+ end
195
201
 
196
202
  # The Orb id of this resource.
197
203
  sig { returns(String) }
@@ -284,7 +290,13 @@ module Orb
284
290
  end
285
291
 
286
292
  class TaxAmount < Orb::Internal::Type::BaseModel
287
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
293
+ OrHash =
294
+ T.type_alias do
295
+ T.any(
296
+ Orb::CreditNote::LineItem::TaxAmount,
297
+ Orb::Internal::AnyHash
298
+ )
299
+ end
288
300
 
289
301
  # The amount of additional tax incurred by this tax rate.
290
302
  sig { returns(String) }
@@ -329,7 +341,10 @@ module Orb
329
341
  end
330
342
 
331
343
  class Discount < Orb::Internal::Type::BaseModel
332
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
344
+ OrHash =
345
+ T.type_alias do
346
+ T.any(Orb::CreditNote::LineItem::Discount, Orb::Internal::AnyHash)
347
+ end
333
348
 
334
349
  sig { returns(String) }
335
350
  attr_accessor :id
@@ -430,7 +445,13 @@ module Orb
430
445
  end
431
446
 
432
447
  class MaximumAmountAdjustment < Orb::Internal::Type::BaseModel
433
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
448
+ OrHash =
449
+ T.type_alias do
450
+ T.any(
451
+ Orb::CreditNote::MaximumAmountAdjustment,
452
+ Orb::Internal::AnyHash
453
+ )
454
+ end
434
455
 
435
456
  sig { returns(String) }
436
457
  attr_accessor :amount_applied
@@ -532,7 +553,13 @@ module Orb
532
553
  end
533
554
 
534
555
  class AppliesToPrice < Orb::Internal::Type::BaseModel
535
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
556
+ OrHash =
557
+ T.type_alias do
558
+ T.any(
559
+ Orb::CreditNote::MaximumAmountAdjustment::AppliesToPrice,
560
+ Orb::Internal::AnyHash
561
+ )
562
+ end
536
563
 
537
564
  sig { returns(String) }
538
565
  attr_accessor :id
@@ -588,7 +615,10 @@ module Orb
588
615
  end
589
616
 
590
617
  class Discount < Orb::Internal::Type::BaseModel
591
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
618
+ OrHash =
619
+ T.type_alias do
620
+ T.any(Orb::CreditNote::Discount, Orb::Internal::AnyHash)
621
+ end
592
622
 
593
623
  sig { returns(String) }
594
624
  attr_accessor :amount_applied
@@ -671,7 +701,13 @@ module Orb
671
701
  end
672
702
 
673
703
  class AppliesToPrice < Orb::Internal::Type::BaseModel
674
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
704
+ OrHash =
705
+ T.type_alias do
706
+ T.any(
707
+ Orb::CreditNote::Discount::AppliesToPrice,
708
+ Orb::Internal::AnyHash
709
+ )
710
+ end
675
711
 
676
712
  sig { returns(String) }
677
713
  attr_accessor :id
@@ -6,7 +6,10 @@ 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 do
11
+ T.any(Orb::CreditNoteCreateParams, Orb::Internal::AnyHash)
12
+ end
10
13
 
11
14
  sig { returns(T::Array[Orb::CreditNoteCreateParams::LineItem]) }
12
15
  attr_accessor :line_items
@@ -51,7 +54,10 @@ module Orb
51
54
  end
52
55
 
53
56
  class LineItem < Orb::Internal::Type::BaseModel
54
- OrHash = T.type_alias { T.any(T.self_type, Orb::Internal::AnyHash) }
57
+ OrHash =
58
+ T.type_alias do
59
+ T.any(Orb::CreditNoteCreateParams::LineItem, Orb::Internal::AnyHash)
60
+ end
55
61
 
56
62
  # The total amount in the invoice's currency to credit this line item.
57
63
  sig { returns(String) }
@@ -6,7 +6,10 @@ 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 do
11
+ T.any(Orb::CreditNoteFetchParams, Orb::Internal::AnyHash)
12
+ end
10
13
 
11
14
  sig do
12
15
  params(request_options: Orb::RequestOptions::OrHash).returns(
@@ -6,7 +6,10 @@ 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 do
11
+ T.any(Orb::CreditNoteListParams, Orb::Internal::AnyHash)
12
+ end
10
13
 
11
14
  sig { returns(T.nilable(Time)) }
12
15
  attr_accessor :created_at_gt