orb-billing 0.1.3 → 0.3.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 (381) hide show
  1. checksums.yaml +4 -4
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +65 -0
  4. data/README.md +61 -51
  5. data/lib/orb/client.rb +7 -6
  6. data/lib/orb/file_part.rb +55 -0
  7. data/lib/orb/internal/page.rb +37 -39
  8. data/lib/orb/internal/transport/base_client.rb +21 -11
  9. data/lib/orb/internal/transport/pooled_net_requester.rb +3 -3
  10. data/lib/orb/internal/type/array_of.rb +28 -2
  11. data/lib/orb/internal/type/base_model.rb +83 -21
  12. data/lib/orb/internal/type/base_page.rb +10 -1
  13. data/lib/orb/internal/type/boolean.rb +6 -0
  14. data/lib/orb/internal/type/converter.rb +28 -1
  15. data/lib/orb/internal/type/enum.rb +28 -8
  16. data/lib/orb/internal/type/{io_like.rb → file_input.rb} +35 -15
  17. data/lib/orb/internal/type/hash_of.rb +28 -2
  18. data/lib/orb/internal/type/request_parameters.rb +1 -2
  19. data/lib/orb/internal/type/union.rb +27 -4
  20. data/lib/orb/internal/type/unknown.rb +6 -0
  21. data/lib/orb/internal/util.rb +105 -70
  22. data/lib/orb/internal.rb +5 -2
  23. data/lib/orb/models/alert.rb +68 -71
  24. data/lib/orb/models/alert_create_for_customer_params.rb +20 -25
  25. data/lib/orb/models/alert_create_for_external_customer_params.rb +20 -25
  26. data/lib/orb/models/alert_create_for_subscription_params.rb +20 -25
  27. data/lib/orb/models/alert_disable_params.rb +5 -9
  28. data/lib/orb/models/alert_enable_params.rb +5 -9
  29. data/lib/orb/models/alert_list_params.rb +26 -36
  30. data/lib/orb/models/alert_retrieve_params.rb +3 -8
  31. data/lib/orb/models/alert_update_params.rb +14 -18
  32. data/lib/orb/models/amount_discount.rb +14 -14
  33. data/lib/orb/models/billable_metric.rb +23 -20
  34. data/lib/orb/models/billing_cycle_relative_date.rb +2 -5
  35. data/lib/orb/models/coupon.rb +28 -21
  36. data/lib/orb/models/coupon_archive_params.rb +3 -8
  37. data/lib/orb/models/coupon_create_params.rb +24 -29
  38. data/lib/orb/models/coupon_fetch_params.rb +3 -8
  39. data/lib/orb/models/coupon_list_params.rb +17 -17
  40. data/lib/orb/models/coupons/subscription_list_params.rb +12 -15
  41. data/lib/orb/models/credit_note.rb +100 -166
  42. data/lib/orb/models/credit_note_create_params.rb +15 -23
  43. data/lib/orb/models/credit_note_fetch_params.rb +3 -8
  44. data/lib/orb/models/credit_note_list_params.rb +20 -30
  45. data/lib/orb/models/customer.rb +224 -271
  46. data/lib/orb/models/customer_create_params.rb +211 -252
  47. data/lib/orb/models/customer_delete_params.rb +3 -8
  48. data/lib/orb/models/customer_fetch_by_external_id_params.rb +3 -8
  49. data/lib/orb/models/customer_fetch_params.rb +3 -8
  50. data/lib/orb/models/customer_list_params.rb +20 -30
  51. data/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb +3 -8
  52. data/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb +3 -8
  53. data/lib/orb/models/customer_update_by_external_id_params.rb +207 -250
  54. data/lib/orb/models/customer_update_params.rb +207 -250
  55. data/lib/orb/models/customers/balance_transaction_create_params.rb +11 -16
  56. data/lib/orb/models/customers/balance_transaction_create_response.rb +33 -51
  57. data/lib/orb/models/customers/balance_transaction_list_params.rb +20 -30
  58. data/lib/orb/models/customers/balance_transaction_list_response.rb +33 -51
  59. data/lib/orb/models/customers/cost_list_by_external_id_params.rb +17 -17
  60. data/lib/orb/models/customers/cost_list_by_external_id_response.rb +22 -26
  61. data/lib/orb/models/customers/cost_list_params.rb +17 -17
  62. data/lib/orb/models/customers/cost_list_response.rb +22 -26
  63. data/lib/orb/models/customers/credit_list_by_external_id_params.rb +18 -22
  64. data/lib/orb/models/customers/credit_list_by_external_id_response.rb +10 -17
  65. data/lib/orb/models/customers/credit_list_params.rb +18 -22
  66. data/lib/orb/models/customers/credit_list_response.rb +10 -17
  67. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +64 -66
  68. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +300 -406
  69. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +63 -66
  70. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +300 -406
  71. data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +33 -48
  72. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +300 -406
  73. data/lib/orb/models/customers/credits/ledger_list_params.rb +32 -48
  74. data/lib/orb/models/customers/credits/ledger_list_response.rb +300 -406
  75. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +47 -50
  76. data/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb +43 -46
  77. data/lib/orb/models/customers/credits/top_up_create_params.rb +46 -50
  78. data/lib/orb/models/customers/credits/top_up_create_response.rb +42 -46
  79. data/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb +4 -9
  80. data/lib/orb/models/customers/credits/top_up_delete_params.rb +4 -9
  81. data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +12 -15
  82. data/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb +43 -46
  83. data/lib/orb/models/customers/credits/top_up_list_params.rb +12 -15
  84. data/lib/orb/models/customers/credits/top_up_list_response.rb +42 -46
  85. data/lib/orb/models/dimensional_price_group.rb +21 -15
  86. data/lib/orb/models/dimensional_price_group_create_params.rb +17 -23
  87. data/lib/orb/models/dimensional_price_group_list_params.rb +12 -15
  88. data/lib/orb/models/dimensional_price_group_retrieve_params.rb +3 -8
  89. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb +3 -8
  90. data/lib/orb/models/dimensional_price_groups.rb +3 -7
  91. data/lib/orb/models/discount.rb +2 -3
  92. data/lib/orb/models/evaluate_price_group.rb +8 -11
  93. data/lib/orb/models/event_deprecate_params.rb +3 -8
  94. data/lib/orb/models/event_deprecate_response.rb +2 -6
  95. data/lib/orb/models/event_ingest_params.rb +33 -27
  96. data/lib/orb/models/event_ingest_response.rb +23 -24
  97. data/lib/orb/models/event_search_params.rb +15 -11
  98. data/lib/orb/models/event_search_response.rb +27 -22
  99. data/lib/orb/models/event_update_params.rb +19 -13
  100. data/lib/orb/models/event_update_response.rb +2 -6
  101. data/lib/orb/models/events/backfill_close_params.rb +3 -8
  102. data/lib/orb/models/events/backfill_close_response.rb +34 -39
  103. data/lib/orb/models/events/backfill_create_params.rb +28 -32
  104. data/lib/orb/models/events/backfill_create_response.rb +34 -39
  105. data/lib/orb/models/events/backfill_fetch_params.rb +3 -8
  106. data/lib/orb/models/events/backfill_fetch_response.rb +34 -39
  107. data/lib/orb/models/events/backfill_list_params.rb +12 -15
  108. data/lib/orb/models/events/backfill_list_response.rb +34 -39
  109. data/lib/orb/models/events/backfill_revert_params.rb +3 -8
  110. data/lib/orb/models/events/backfill_revert_response.rb +34 -39
  111. data/lib/orb/models/events/event_volumes.rb +11 -17
  112. data/lib/orb/models/events/volume_list_params.rb +19 -22
  113. data/lib/orb/models/invoice.rb +589 -637
  114. data/lib/orb/models/invoice_create_params.rb +52 -61
  115. data/lib/orb/models/invoice_fetch_params.rb +3 -8
  116. data/lib/orb/models/invoice_fetch_upcoming_params.rb +4 -9
  117. data/lib/orb/models/invoice_fetch_upcoming_response.rb +584 -631
  118. data/lib/orb/models/invoice_issue_params.rb +10 -14
  119. data/lib/orb/models/invoice_level_discount.rb +2 -3
  120. data/lib/orb/models/invoice_line_item_create_params.rb +19 -14
  121. data/lib/orb/models/invoice_line_item_create_response.rb +247 -269
  122. data/lib/orb/models/invoice_list_params.rb +51 -66
  123. data/lib/orb/models/invoice_mark_paid_params.rb +9 -11
  124. data/lib/orb/models/invoice_pay_params.rb +3 -8
  125. data/lib/orb/models/invoice_update_params.rb +9 -9
  126. data/lib/orb/models/invoice_void_params.rb +3 -8
  127. data/lib/orb/models/item.rb +14 -25
  128. data/lib/orb/models/item_create_params.rb +5 -9
  129. data/lib/orb/models/item_fetch_params.rb +3 -8
  130. data/lib/orb/models/item_list_params.rb +12 -15
  131. data/lib/orb/models/item_update_params.rb +10 -22
  132. data/lib/orb/models/metric_create_params.rb +17 -13
  133. data/lib/orb/models/metric_fetch_params.rb +3 -8
  134. data/lib/orb/models/metric_list_params.rb +20 -30
  135. data/lib/orb/models/metric_update_params.rb +9 -9
  136. data/lib/orb/models/pagination_metadata.rb +3 -7
  137. data/lib/orb/models/percentage_discount.rb +15 -14
  138. data/lib/orb/models/plan.rb +250 -279
  139. data/lib/orb/models/plan_create_params.rb +1623 -1984
  140. data/lib/orb/models/plan_fetch_params.rb +3 -8
  141. data/lib/orb/models/plan_list_params.rb +25 -42
  142. data/lib/orb/models/plan_update_params.rb +12 -10
  143. data/lib/orb/models/plans/external_plan_id_fetch_params.rb +3 -8
  144. data/lib/orb/models/plans/external_plan_id_update_params.rb +12 -10
  145. data/lib/orb/models/price.rb +2709 -3820
  146. data/lib/orb/models/price_create_params.rb +203 -244
  147. data/lib/orb/models/price_evaluate_params.rb +21 -30
  148. data/lib/orb/models/price_evaluate_response.rb +2 -6
  149. data/lib/orb/models/price_fetch_params.rb +3 -8
  150. data/lib/orb/models/price_list_params.rb +12 -15
  151. data/lib/orb/models/price_update_params.rb +9 -9
  152. data/lib/orb/models/prices/external_price_id_fetch_params.rb +3 -8
  153. data/lib/orb/models/prices/external_price_id_update_params.rb +9 -9
  154. data/lib/orb/models/subscription.rb +343 -382
  155. data/lib/orb/models/subscription_cancel_params.rb +16 -16
  156. data/lib/orb/models/subscription_cancel_response.rb +339 -377
  157. data/lib/orb/models/subscription_change_apply_params.rb +7 -10
  158. data/lib/orb/models/subscription_change_apply_response.rb +365 -398
  159. data/lib/orb/models/subscription_change_cancel_params.rb +3 -8
  160. data/lib/orb/models/subscription_change_cancel_response.rb +365 -398
  161. data/lib/orb/models/subscription_change_retrieve_params.rb +3 -8
  162. data/lib/orb/models/subscription_change_retrieve_response.rb +366 -398
  163. data/lib/orb/models/subscription_create_params.rb +3771 -4402
  164. data/lib/orb/models/subscription_create_response.rb +339 -377
  165. data/lib/orb/models/subscription_fetch_costs_params.rb +17 -17
  166. data/lib/orb/models/subscription_fetch_costs_response.rb +22 -26
  167. data/lib/orb/models/subscription_fetch_params.rb +3 -8
  168. data/lib/orb/models/subscription_fetch_schedule_params.rb +20 -30
  169. data/lib/orb/models/subscription_fetch_schedule_response.rb +15 -17
  170. data/lib/orb/models/subscription_fetch_usage_params.rb +32 -43
  171. data/lib/orb/models/subscription_list_params.rb +28 -41
  172. data/lib/orb/models/subscription_price_intervals_params.rb +2018 -2472
  173. data/lib/orb/models/subscription_price_intervals_response.rb +342 -377
  174. data/lib/orb/models/subscription_schedule_plan_change_params.rb +3764 -4392
  175. data/lib/orb/models/subscription_schedule_plan_change_response.rb +342 -377
  176. data/lib/orb/models/subscription_trigger_phase_params.rb +12 -10
  177. data/lib/orb/models/subscription_trigger_phase_response.rb +341 -377
  178. data/lib/orb/models/subscription_unschedule_cancellation_params.rb +3 -8
  179. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +342 -377
  180. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb +5 -9
  181. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +343 -377
  182. data/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb +3 -8
  183. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +343 -377
  184. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +22 -33
  185. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +342 -377
  186. data/lib/orb/models/subscription_update_params.rb +21 -23
  187. data/lib/orb/models/subscription_update_trial_params.rb +15 -18
  188. data/lib/orb/models/subscription_update_trial_response.rb +341 -377
  189. data/lib/orb/models/subscription_usage.rb +37 -80
  190. data/lib/orb/models/subscriptions.rb +3 -7
  191. data/lib/orb/models/top_level_ping_params.rb +3 -8
  192. data/lib/orb/models/top_level_ping_response.rb +2 -6
  193. data/lib/orb/models/trial_discount.rb +16 -24
  194. data/lib/orb/models/usage_discount.rb +15 -14
  195. data/lib/orb/request_options.rb +3 -4
  196. data/lib/orb/resources/alerts.rb +48 -17
  197. data/lib/orb/resources/coupons/subscriptions.rb +9 -2
  198. data/lib/orb/resources/coupons.rb +25 -7
  199. data/lib/orb/resources/credit_notes.rb +17 -4
  200. data/lib/orb/resources/customers/balance_transactions.rb +18 -3
  201. data/lib/orb/resources/customers/costs.rb +26 -8
  202. data/lib/orb/resources/customers/credits/ledger.rb +108 -28
  203. data/lib/orb/resources/customers/credits/top_ups.rb +67 -20
  204. data/lib/orb/resources/customers/credits.rb +28 -8
  205. data/lib/orb/resources/customers.rb +135 -36
  206. data/lib/orb/resources/dimensional_price_groups.rb +19 -4
  207. data/lib/orb/resources/events/backfills.rb +32 -9
  208. data/lib/orb/resources/events/volume.rb +14 -4
  209. data/lib/orb/resources/events.rb +40 -11
  210. data/lib/orb/resources/invoice_line_items.rb +16 -6
  211. data/lib/orb/resources/invoices.rb +77 -17
  212. data/lib/orb/resources/items.rb +10 -3
  213. data/lib/orb/resources/metrics.rb +33 -8
  214. data/lib/orb/resources/plans/external_plan_id.rb +10 -2
  215. data/lib/orb/resources/plans.rb +47 -11
  216. data/lib/orb/resources/prices/external_price_id.rb +7 -1
  217. data/lib/orb/resources/prices.rb +97 -22
  218. data/lib/orb/resources/subscription_changes.rb +5 -2
  219. data/lib/orb/resources/subscriptions.rb +292 -78
  220. data/lib/orb/version.rb +1 -1
  221. data/lib/orb.rb +2 -10
  222. data/rbi/lib/orb/client.rbi +7 -6
  223. data/rbi/lib/orb/file_part.rbi +34 -0
  224. data/rbi/lib/orb/internal/page.rbi +1 -0
  225. data/rbi/lib/orb/internal/transport/base_client.rbi +18 -3
  226. data/rbi/lib/orb/internal/type/array_of.rbi +15 -9
  227. data/rbi/lib/orb/internal/type/base_model.rbi +22 -0
  228. data/rbi/lib/orb/internal/type/base_page.rbi +2 -0
  229. data/rbi/lib/orb/internal/type/boolean.rbi +4 -5
  230. data/rbi/lib/orb/internal/type/converter.rbi +8 -0
  231. data/rbi/lib/orb/internal/type/enum.rbi +7 -6
  232. data/rbi/lib/orb/internal/type/{io_like.rbi → file_input.rbi} +9 -7
  233. data/rbi/lib/orb/internal/type/hash_of.rbi +15 -9
  234. data/rbi/lib/orb/internal/type/union.rbi +7 -0
  235. data/rbi/lib/orb/internal/type/unknown.rbi +4 -5
  236. data/rbi/lib/orb/internal/util.rbi +39 -19
  237. data/rbi/lib/orb/internal.rbi +1 -2
  238. data/rbi/lib/orb/models/alert.rbi +28 -8
  239. data/rbi/lib/orb/models/alert_create_for_customer_params.rbi +16 -6
  240. data/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi +16 -6
  241. data/rbi/lib/orb/models/alert_create_for_subscription_params.rbi +16 -6
  242. data/rbi/lib/orb/models/alert_disable_params.rbi +5 -2
  243. data/rbi/lib/orb/models/alert_enable_params.rbi +5 -2
  244. data/rbi/lib/orb/models/alert_list_params.rbi +6 -0
  245. data/rbi/lib/orb/models/alert_update_params.rbi +11 -4
  246. data/rbi/lib/orb/models/amount_discount.rbi +10 -4
  247. data/rbi/lib/orb/models/billable_metric.rbi +16 -3
  248. data/rbi/lib/orb/models/billing_cycle_relative_date.rbi +1 -1
  249. data/rbi/lib/orb/models/coupon.rbi +10 -3
  250. data/rbi/lib/orb/models/coupon_create_params.rbi +6 -3
  251. data/rbi/lib/orb/models/coupon_list_params.rbi +13 -3
  252. data/rbi/lib/orb/models/coupons/subscription_list_params.rbi +8 -2
  253. data/rbi/lib/orb/models/credit_note.rbi +44 -12
  254. data/rbi/lib/orb/models/credit_note_create_params.rbi +15 -6
  255. data/rbi/lib/orb/models/credit_note_list_params.rbi +3 -0
  256. data/rbi/lib/orb/models/customer.rbi +130 -11
  257. data/rbi/lib/orb/models/customer_create_params.rbi +142 -8
  258. data/rbi/lib/orb/models/customer_list_params.rbi +3 -0
  259. data/rbi/lib/orb/models/customer_update_by_external_id_params.rbi +140 -8
  260. data/rbi/lib/orb/models/customer_update_params.rbi +140 -8
  261. data/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi +8 -4
  262. data/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi +18 -8
  263. data/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi +3 -0
  264. data/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi +18 -8
  265. data/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi +9 -5
  266. data/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi +21 -4
  267. data/rbi/lib/orb/models/customers/cost_list_params.rbi +9 -5
  268. data/rbi/lib/orb/models/customers/cost_list_response.rbi +21 -4
  269. data/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi +13 -3
  270. data/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi +1 -2
  271. data/rbi/lib/orb/models/customers/credit_list_params.rbi +13 -3
  272. data/rbi/lib/orb/models/customers/credit_list_response.rbi +1 -2
  273. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +40 -18
  274. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +35 -56
  275. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi +40 -6
  276. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi +35 -56
  277. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +6 -16
  278. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +35 -56
  279. data/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi +6 -4
  280. data/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi +35 -56
  281. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +27 -10
  282. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi +25 -10
  283. data/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi +27 -4
  284. data/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi +25 -10
  285. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +8 -2
  286. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi +25 -10
  287. data/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi +8 -2
  288. data/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi +25 -4
  289. data/rbi/lib/orb/models/dimensional_price_group.rbi +11 -3
  290. data/rbi/lib/orb/models/dimensional_price_group_create_params.rbi +4 -0
  291. data/rbi/lib/orb/models/dimensional_price_group_list_params.rbi +8 -2
  292. data/rbi/lib/orb/models/evaluate_price_group.rbi +8 -2
  293. data/rbi/lib/orb/models/event_deprecate_response.rbi +4 -2
  294. data/rbi/lib/orb/models/event_ingest_params.rbi +22 -5
  295. data/rbi/lib/orb/models/event_ingest_response.rbi +15 -4
  296. data/rbi/lib/orb/models/event_search_params.rbi +14 -2
  297. data/rbi/lib/orb/models/event_search_response.rbi +14 -3
  298. data/rbi/lib/orb/models/event_update_params.rbi +10 -3
  299. data/rbi/lib/orb/models/event_update_response.rbi +4 -2
  300. data/rbi/lib/orb/models/events/backfill_close_response.rbi +14 -2
  301. data/rbi/lib/orb/models/events/backfill_create_params.rbi +18 -0
  302. data/rbi/lib/orb/models/events/backfill_create_response.rbi +14 -2
  303. data/rbi/lib/orb/models/events/backfill_fetch_response.rbi +14 -2
  304. data/rbi/lib/orb/models/events/backfill_list_params.rbi +8 -2
  305. data/rbi/lib/orb/models/events/backfill_list_response.rbi +14 -2
  306. data/rbi/lib/orb/models/events/backfill_revert_response.rbi +14 -2
  307. data/rbi/lib/orb/models/events/event_volumes.rbi +6 -2
  308. data/rbi/lib/orb/models/events/volume_list_params.rbi +18 -2
  309. data/rbi/lib/orb/models/invoice.rbi +375 -46
  310. data/rbi/lib/orb/models/invoice_create_params.rbi +38 -6
  311. data/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi +375 -66
  312. data/rbi/lib/orb/models/invoice_issue_params.rbi +9 -2
  313. data/rbi/lib/orb/models/invoice_line_item_create_params.rbi +16 -2
  314. data/rbi/lib/orb/models/invoice_line_item_create_response.rbi +141 -20
  315. data/rbi/lib/orb/models/invoice_list_params.rbi +9 -2
  316. data/rbi/lib/orb/models/invoice_mark_paid_params.rbi +9 -2
  317. data/rbi/lib/orb/models/invoice_update_params.rbi +7 -2
  318. data/rbi/lib/orb/models/item.rbi +1 -2
  319. data/rbi/lib/orb/models/item_create_params.rbi +5 -2
  320. data/rbi/lib/orb/models/item_list_params.rbi +8 -2
  321. data/rbi/lib/orb/models/item_update_params.rbi +1 -8
  322. data/rbi/lib/orb/models/metric_create_params.rbi +15 -2
  323. data/rbi/lib/orb/models/metric_list_params.rbi +3 -0
  324. data/rbi/lib/orb/models/metric_update_params.rbi +7 -2
  325. data/rbi/lib/orb/models/percentage_discount.rbi +11 -4
  326. data/rbi/lib/orb/models/plan.rbi +102 -15
  327. data/rbi/lib/orb/models/plan_create_params.rbi +997 -679
  328. data/rbi/lib/orb/models/plan_list_params.rbi +5 -1
  329. data/rbi/lib/orb/models/plan_update_params.rbi +11 -2
  330. data/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi +11 -2
  331. data/rbi/lib/orb/models/price.rbi +717 -688
  332. data/rbi/lib/orb/models/price_create_params.rbi +137 -53
  333. data/rbi/lib/orb/models/price_evaluate_params.rbi +10 -0
  334. data/rbi/lib/orb/models/price_list_params.rbi +8 -2
  335. data/rbi/lib/orb/models/price_update_params.rbi +7 -2
  336. data/rbi/lib/orb/models/prices/external_price_id_update_params.rbi +7 -2
  337. data/rbi/lib/orb/models/subscription.rbi +174 -11
  338. data/rbi/lib/orb/models/subscription_cancel_params.rbi +8 -5
  339. data/rbi/lib/orb/models/subscription_cancel_response.rbi +187 -14
  340. data/rbi/lib/orb/models/subscription_change_apply_params.rbi +7 -2
  341. data/rbi/lib/orb/models/subscription_change_apply_response.rbi +199 -18
  342. data/rbi/lib/orb/models/subscription_change_cancel_response.rbi +199 -18
  343. data/rbi/lib/orb/models/subscription_change_retrieve_response.rbi +199 -18
  344. data/rbi/lib/orb/models/subscription_create_params.rbi +2282 -1536
  345. data/rbi/lib/orb/models/subscription_create_response.rbi +187 -14
  346. data/rbi/lib/orb/models/subscription_fetch_costs_params.rbi +9 -5
  347. data/rbi/lib/orb/models/subscription_fetch_costs_response.rbi +21 -4
  348. data/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi +3 -0
  349. data/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi +8 -2
  350. data/rbi/lib/orb/models/subscription_fetch_usage_params.rbi +13 -4
  351. data/rbi/lib/orb/models/subscription_list_params.rbi +4 -2
  352. data/rbi/lib/orb/models/subscription_price_intervals_params.rbi +1228 -861
  353. data/rbi/lib/orb/models/subscription_price_intervals_response.rbi +187 -14
  354. data/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi +2288 -1544
  355. data/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi +187 -14
  356. data/rbi/lib/orb/models/subscription_trigger_phase_params.rbi +10 -2
  357. data/rbi/lib/orb/models/subscription_trigger_phase_response.rbi +187 -14
  358. data/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi +187 -14
  359. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +5 -2
  360. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +187 -20
  361. data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +187 -14
  362. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi +11 -2
  363. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi +187 -14
  364. data/rbi/lib/orb/models/subscription_update_params.rbi +15 -0
  365. data/rbi/lib/orb/models/subscription_update_trial_params.rbi +11 -5
  366. data/rbi/lib/orb/models/subscription_update_trial_response.rbi +187 -14
  367. data/rbi/lib/orb/models/subscription_usage.rbi +2 -16
  368. data/rbi/lib/orb/models/trial_discount.rbi +5 -1
  369. data/rbi/lib/orb/models/usage_discount.rbi +11 -3
  370. data/sig/orb/file_part.rbs +21 -0
  371. data/sig/orb/internal/transport/base_client.rbs +9 -3
  372. data/sig/orb/internal/type/array_of.rbs +4 -0
  373. data/sig/orb/internal/type/base_model.rbs +12 -0
  374. data/sig/orb/internal/type/converter.rbs +4 -0
  375. data/sig/orb/internal/type/enum.rbs +4 -2
  376. data/sig/orb/internal/type/{io_like.rbs → file_input.rbs} +1 -1
  377. data/sig/orb/internal/type/hash_of.rbs +4 -0
  378. data/sig/orb/internal/type/union.rbs +4 -0
  379. data/sig/orb/internal/util.rbs +16 -12
  380. data/sig/orb/internal.rbs +1 -1
  381. metadata +9 -5
@@ -47,8 +47,17 @@ module Orb
47
47
  )
48
48
  .returns(T.attached_class)
49
49
  end
50
- def self.new(id:, expiration_time:, status:, subscription:, applied_at: nil, cancelled_at: nil); end
51
-
50
+ def self.new(
51
+ id:,
52
+ # Subscription change will be cancelled at this time and can no longer be applied.
53
+ expiration_time:,
54
+ status:,
55
+ subscription:,
56
+ # When this change was applied.
57
+ applied_at: nil,
58
+ # When this change was cancelled.
59
+ cancelled_at: nil
60
+ ); end
52
61
  sig do
53
62
  override
54
63
  .returns(
@@ -68,8 +77,7 @@ module Orb
68
77
  extend Orb::Internal::Type::Enum
69
78
 
70
79
  TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::SubscriptionChangeApplyResponse::Status) }
71
- OrSymbol =
72
- T.type_alias { T.any(Symbol, String, Orb::Models::SubscriptionChangeApplyResponse::Status::TaggedSymbol) }
80
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
73
81
 
74
82
  PENDING = T.let(:pending, Orb::Models::SubscriptionChangeApplyResponse::Status::TaggedSymbol)
75
83
  APPLIED = T.let(:applied, Orb::Models::SubscriptionChangeApplyResponse::Status::TaggedSymbol)
@@ -357,31 +365,90 @@ module Orb
357
365
  end
358
366
  def self.new(
359
367
  id:,
368
+ # The current plan phase that is active, only if the subscription's plan has
369
+ # phases.
360
370
  active_plan_phase_order:,
371
+ # The adjustment intervals for this subscription sorted by the start_date of the
372
+ # adjustment interval.
361
373
  adjustment_intervals:,
374
+ # Determines whether issued invoices for this subscription will automatically be
375
+ # charged with the saved payment method on the due date. This property defaults to
376
+ # the plan's behavior. If null, defaults to the customer's setting.
362
377
  auto_collection:,
363
378
  billing_cycle_anchor_configuration:,
379
+ # The day of the month on which the billing cycle is anchored. If the maximum
380
+ # number of days in a month is greater than this value, the last day of the month
381
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
382
+ # period begins on the 30th.
364
383
  billing_cycle_day:,
365
384
  created_at:,
385
+ # The end of the current billing period. This is an exclusive timestamp, such that
386
+ # the instant returned is not part of the billing period. Set to null for
387
+ # subscriptions that are not currently active.
366
388
  current_billing_period_end_date:,
389
+ # The start date of the current billing period. This is an inclusive timestamp;
390
+ # the instant returned is exactly the beginning of the billing period. Set to null
391
+ # if the subscription is not currently active.
367
392
  current_billing_period_start_date:,
393
+ # A customer is a buyer of your products, and the other party to the billing
394
+ # relationship.
395
+ #
396
+ # In Orb, customers are assigned system generated identifiers automatically, but
397
+ # it's often desirable to have these match existing identifiers in your system. To
398
+ # avoid having to denormalize Orb ID information, you can pass in an
399
+ # `external_customer_id` with your own identifier. See
400
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
401
+ # information about how these aliases work in Orb.
402
+ #
403
+ # In addition to having an identifier in your system, a customer may exist in a
404
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
405
+ # `payment_provider` enum field to express this mapping.
406
+ #
407
+ # A customer also has a timezone (from the standard
408
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
409
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
410
+ # information on what this timezone parameter influences within Orb.
368
411
  customer:,
412
+ # Determines the default memo on this subscriptions' invoices. Note that if this
413
+ # is not provided, it is determined by the plan configuration.
369
414
  default_invoice_memo:,
415
+ # The discount intervals for this subscription sorted by the start_date.
370
416
  discount_intervals:,
417
+ # The date Orb stops billing for this subscription.
371
418
  end_date:,
372
419
  fixed_fee_quantity_schedule:,
373
420
  invoicing_threshold:,
421
+ # The maximum intervals for this subscription sorted by the start_date.
374
422
  maximum_intervals:,
423
+ # User specified key-value pairs for the resource. If not present, this defaults
424
+ # to an empty dictionary. Individual keys can be removed by setting the value to
425
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
426
+ # `null`.
375
427
  metadata:,
428
+ # The minimum intervals for this subscription sorted by the start_date.
376
429
  minimum_intervals:,
430
+ # Determines the difference between the invoice issue date for subscription
431
+ # invoices as the date that they are due. A value of `0` here represents that the
432
+ # invoice is due on issue, whereas a value of `30` represents that the customer
433
+ # has a month to pay the invoice.
377
434
  net_terms:,
435
+ # A pending subscription change if one exists on this subscription.
378
436
  pending_subscription_change:,
437
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
438
+ # subscribed to by a customer. Plans define the billing behavior of the
439
+ # subscription. You can see more about how to configure prices in the
440
+ # [Price resource](/reference/price).
379
441
  plan:,
442
+ # The price intervals for this subscription.
380
443
  price_intervals:,
381
444
  redeemed_coupon:,
445
+ # The date Orb starts billing for this subscription.
382
446
  start_date:,
383
447
  status:,
384
448
  trial_info:,
449
+ # The resources that were changed as part of this operation. Only present when
450
+ # fetched through the subscription changes API or if the
451
+ # `include_changed_resources` parameter was passed in the request.
385
452
  changed_resources: nil
386
453
  ); end
387
454
  sig do
@@ -472,8 +539,16 @@ module Orb
472
539
  )
473
540
  .returns(T.attached_class)
474
541
  end
475
- def self.new(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end
476
-
542
+ def self.new(
543
+ id:,
544
+ adjustment:,
545
+ # The price interval IDs that this adjustment applies to.
546
+ applies_to_price_interval_ids:,
547
+ # The end date of the adjustment interval.
548
+ end_date:,
549
+ # The start date of the adjustment interval.
550
+ start_date:
551
+ ); end
477
552
  sig do
478
553
  override
479
554
  .returns(
@@ -540,10 +615,17 @@ module Orb
540
615
  end
541
616
  def self.new(
542
617
  id:,
618
+ # The price IDs that this adjustment applies to.
543
619
  applies_to_price_ids:,
620
+ # True for adjustments that apply to an entire invocice, false for adjustments
621
+ # that apply to only one price.
544
622
  is_invoice_level:,
623
+ # The plan phase in which this adjustment is active.
545
624
  plan_phase_order:,
625
+ # The reason for the adjustment.
546
626
  reason:,
627
+ # The number of usage units by which to discount the price this adjustment applies
628
+ # to in a given billing period.
547
629
  usage_discount:,
548
630
  adjustment_type: :usage_discount
549
631
  ); end
@@ -607,10 +689,17 @@ module Orb
607
689
  end
608
690
  def self.new(
609
691
  id:,
692
+ # The amount by which to discount the prices this adjustment applies to in a given
693
+ # billing period.
610
694
  amount_discount:,
695
+ # The price IDs that this adjustment applies to.
611
696
  applies_to_price_ids:,
697
+ # True for adjustments that apply to an entire invocice, false for adjustments
698
+ # that apply to only one price.
612
699
  is_invoice_level:,
700
+ # The plan phase in which this adjustment is active.
613
701
  plan_phase_order:,
702
+ # The reason for the adjustment.
614
703
  reason:,
615
704
  adjustment_type: :amount_discount
616
705
  ); end
@@ -674,10 +763,17 @@ module Orb
674
763
  end
675
764
  def self.new(
676
765
  id:,
766
+ # The price IDs that this adjustment applies to.
677
767
  applies_to_price_ids:,
768
+ # True for adjustments that apply to an entire invocice, false for adjustments
769
+ # that apply to only one price.
678
770
  is_invoice_level:,
771
+ # The percentage (as a value between 0 and 1) by which to discount the price
772
+ # intervals this adjustment applies to in a given billing period.
679
773
  percentage_discount:,
774
+ # The plan phase in which this adjustment is active.
680
775
  plan_phase_order:,
776
+ # The reason for the adjustment.
681
777
  reason:,
682
778
  adjustment_type: :percentage_discount
683
779
  ); end
@@ -746,11 +842,19 @@ module Orb
746
842
  end
747
843
  def self.new(
748
844
  id:,
845
+ # The price IDs that this adjustment applies to.
749
846
  applies_to_price_ids:,
847
+ # True for adjustments that apply to an entire invocice, false for adjustments
848
+ # that apply to only one price.
750
849
  is_invoice_level:,
850
+ # The item ID that revenue from this minimum will be attributed to.
751
851
  item_id:,
852
+ # The minimum amount to charge in a given billing period for the prices this
853
+ # adjustment applies to.
752
854
  minimum_amount:,
855
+ # The plan phase in which this adjustment is active.
753
856
  plan_phase_order:,
857
+ # The reason for the adjustment.
754
858
  reason:,
755
859
  adjustment_type: :minimum
756
860
  ); end
@@ -815,10 +919,17 @@ module Orb
815
919
  end
816
920
  def self.new(
817
921
  id:,
922
+ # The price IDs that this adjustment applies to.
818
923
  applies_to_price_ids:,
924
+ # True for adjustments that apply to an entire invocice, false for adjustments
925
+ # that apply to only one price.
819
926
  is_invoice_level:,
927
+ # The maximum amount to charge in a given billing period for the prices this
928
+ # adjustment applies to.
820
929
  maximum_amount:,
930
+ # The plan phase in which this adjustment is active.
821
931
  plan_phase_order:,
932
+ # The reason for the adjustment.
822
933
  reason:,
823
934
  adjustment_type: :maximum
824
935
  ); end
@@ -875,8 +986,20 @@ module Orb
875
986
  year: T.nilable(Integer)
876
987
  ).returns(T.attached_class)
877
988
  end
878
- def self.new(day:, month: nil, year: nil); end
879
-
989
+ def self.new(
990
+ # The day of the month on which the billing cycle is anchored. If the maximum
991
+ # number of days in a month is greater than this value, the last day of the month
992
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
993
+ # period begins on the 30th.
994
+ day:,
995
+ # The month on which the billing cycle is anchored (e.g. a quarterly price
996
+ # anchored in February would have cycles starting February, May, August, and
997
+ # November).
998
+ month: nil,
999
+ # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
1000
+ # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
1001
+ year: nil
1002
+ ); end
880
1003
  sig { override.returns({day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)}) }
881
1004
  def to_hash; end
882
1005
  end
@@ -920,10 +1043,15 @@ module Orb
920
1043
  .returns(T.attached_class)
921
1044
  end
922
1045
  def self.new(
1046
+ # Only available if discount_type is `amount`.
923
1047
  amount_discount:,
1048
+ # The price ids that this discount interval applies to.
924
1049
  applies_to_price_ids:,
1050
+ # The price interval ids that this discount interval applies to.
925
1051
  applies_to_price_interval_ids:,
1052
+ # The end date of the discount interval.
926
1053
  end_date:,
1054
+ # The start date of the discount interval.
927
1055
  start_date:,
928
1056
  discount_type: :amount
929
1057
  ); end
@@ -980,10 +1108,16 @@ module Orb
980
1108
  .returns(T.attached_class)
981
1109
  end
982
1110
  def self.new(
1111
+ # The price ids that this discount interval applies to.
983
1112
  applies_to_price_ids:,
1113
+ # The price interval ids that this discount interval applies to.
984
1114
  applies_to_price_interval_ids:,
1115
+ # The end date of the discount interval.
985
1116
  end_date:,
1117
+ # Only available if discount_type is `percentage`.This is a number between 0
1118
+ # and 1.
986
1119
  percentage_discount:,
1120
+ # The start date of the discount interval.
987
1121
  start_date:,
988
1122
  discount_type: :percentage
989
1123
  ); end
@@ -1040,10 +1174,16 @@ module Orb
1040
1174
  .returns(T.attached_class)
1041
1175
  end
1042
1176
  def self.new(
1177
+ # The price ids that this discount interval applies to.
1043
1178
  applies_to_price_ids:,
1179
+ # The price interval ids that this discount interval applies to.
1044
1180
  applies_to_price_interval_ids:,
1181
+ # The end date of the discount interval.
1045
1182
  end_date:,
1183
+ # The start date of the discount interval.
1046
1184
  start_date:,
1185
+ # Only available if discount_type is `usage`. Number of usage units that this
1186
+ # discount is for
1047
1187
  usage_discount:,
1048
1188
  discount_type: :usage
1049
1189
  ); end
@@ -1130,14 +1270,18 @@ module Orb
1130
1270
  .returns(T.attached_class)
1131
1271
  end
1132
1272
  def self.new(
1273
+ # The price ids that this maximum interval applies to.
1133
1274
  applies_to_price_ids:,
1275
+ # The price interval ids that this maximum interval applies to.
1134
1276
  applies_to_price_interval_ids:,
1277
+ # The end date of the maximum interval.
1135
1278
  end_date:,
1279
+ # The maximum amount to charge in a given billing period for the price intervals
1280
+ # this transform applies to.
1136
1281
  maximum_amount:,
1282
+ # The start date of the maximum interval.
1137
1283
  start_date:
1138
- )
1139
- end
1140
-
1284
+ ); end
1141
1285
  sig do
1142
1286
  override
1143
1287
  .returns(
@@ -1186,14 +1330,18 @@ module Orb
1186
1330
  .returns(T.attached_class)
1187
1331
  end
1188
1332
  def self.new(
1333
+ # The price ids that this minimum interval applies to.
1189
1334
  applies_to_price_ids:,
1335
+ # The price interval ids that this minimum interval applies to.
1190
1336
  applies_to_price_interval_ids:,
1337
+ # The end date of the minimum interval.
1191
1338
  end_date:,
1339
+ # The minimum amount to charge in a given billing period for the price intervals
1340
+ # this minimum applies to.
1192
1341
  minimum_amount:,
1342
+ # The start date of the minimum interval.
1193
1343
  start_date:
1194
- )
1195
- end
1196
-
1344
+ ); end
1197
1345
  sig do
1198
1346
  override
1199
1347
  .returns(
@@ -1374,14 +1522,40 @@ module Orb
1374
1522
  end
1375
1523
  def self.new(
1376
1524
  id:,
1525
+ # The day of the month that Orb bills for this price
1377
1526
  billing_cycle_day:,
1527
+ # The end of the current billing period. This is an exclusive timestamp, such that
1528
+ # the instant returned is exactly the end of the billing period. Set to null if
1529
+ # this price interval is not currently active.
1378
1530
  current_billing_period_end_date:,
1531
+ # The start date of the current billing period. This is an inclusive timestamp;
1532
+ # the instant returned is exactly the beginning of the billing period. Set to null
1533
+ # if this price interval is not currently active.
1379
1534
  current_billing_period_start_date:,
1535
+ # The end date of the price interval. This is the date that Orb stops billing for
1536
+ # this price.
1380
1537
  end_date:,
1538
+ # An additional filter to apply to usage queries.
1381
1539
  filter:,
1540
+ # The fixed fee quantity transitions for this price interval. This is only
1541
+ # relevant for fixed fees.
1382
1542
  fixed_fee_quantity_transitions:,
1543
+ # The Price resource represents a price that can be billed on a subscription,
1544
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
1545
+ # take a quantity and determine an amount to bill.
1546
+ #
1547
+ # Orb supports a few different pricing models out of the box. Each of these models
1548
+ # is serialized differently in a given Price object. The model_type field
1549
+ # determines the key for the configuration object that is present.
1550
+ #
1551
+ # For more on the types of prices, see
1552
+ # [the core concepts documentation](/core-concepts#plan-and-price)
1383
1553
  price:,
1554
+ # The start date of the price interval. This is the date that Orb starts billing
1555
+ # for this price.
1384
1556
  start_date:,
1557
+ # A list of customer IDs whose usage events will be aggregated and billed under
1558
+ # this price interval.
1385
1559
  usage_customer_ids:
1386
1560
  ); end
1387
1561
  sig do
@@ -1478,8 +1652,7 @@ module Orb
1478
1652
 
1479
1653
  TaggedSymbol =
1480
1654
  T.type_alias { T.all(Symbol, Orb::Models::SubscriptionChangeApplyResponse::Subscription::Status) }
1481
- OrSymbol =
1482
- T.type_alias { T.any(Symbol, String, Orb::Models::SubscriptionChangeApplyResponse::Subscription::Status::TaggedSymbol) }
1655
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1483
1656
 
1484
1657
  ACTIVE = T.let(:active, Orb::Models::SubscriptionChangeApplyResponse::Subscription::Status::TaggedSymbol)
1485
1658
  ENDED = T.let(:ended, Orb::Models::SubscriptionChangeApplyResponse::Subscription::Status::TaggedSymbol)
@@ -1533,8 +1706,16 @@ module Orb
1533
1706
  )
1534
1707
  .returns(T.attached_class)
1535
1708
  end
1536
- def self.new(created_credit_notes:, created_invoices:, voided_credit_notes:, voided_invoices:); end
1537
-
1709
+ def self.new(
1710
+ # The credit notes that were created as part of this operation.
1711
+ created_credit_notes:,
1712
+ # The invoices that were created as part of this operation.
1713
+ created_invoices:,
1714
+ # The credit notes that were voided as part of this operation.
1715
+ voided_credit_notes:,
1716
+ # The invoices that were voided as part of this operation.
1717
+ voided_invoices:
1718
+ ); end
1538
1719
  sig do
1539
1720
  override
1540
1721
  .returns(