orb-billing 0.1.0.pre.alpha.38 → 0.1.1

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 (409) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -2
  3. data/lib/orb/client.rb +4 -0
  4. data/lib/orb/internal/transport/base_client.rb +2 -2
  5. data/lib/orb/internal/transport/pooled_net_requester.rb +15 -6
  6. data/lib/orb/internal/type/array_of.rb +12 -2
  7. data/lib/orb/internal/type/base_model.rb +23 -22
  8. data/lib/orb/internal/type/boolean.rb +5 -1
  9. data/lib/orb/internal/type/converter.rb +62 -39
  10. data/lib/orb/internal/type/enum.rb +13 -9
  11. data/lib/orb/internal/type/hash_of.rb +6 -2
  12. data/lib/orb/internal/type/io_like.rb +75 -0
  13. data/lib/orb/internal/type/request_parameters.rb +11 -2
  14. data/lib/orb/internal/type/union.rb +7 -3
  15. data/lib/orb/internal/type/unknown.rb +5 -1
  16. data/lib/orb/internal/util.rb +81 -26
  17. data/lib/orb/models/alert.rb +9 -9
  18. data/lib/orb/models/alert_create_for_customer_params.rb +3 -3
  19. data/lib/orb/models/alert_create_for_external_customer_params.rb +3 -3
  20. data/lib/orb/models/alert_create_for_subscription_params.rb +3 -3
  21. data/lib/orb/models/alert_list_params.rb +5 -5
  22. data/lib/orb/models/alert_update_params.rb +3 -3
  23. data/lib/orb/models/amount_discount.rb +1 -1
  24. data/lib/orb/models/billable_metric.rb +7 -7
  25. data/lib/orb/models/coupon.rb +7 -7
  26. data/lib/orb/models/coupon_create_params.rb +2 -2
  27. data/lib/orb/models/coupon_list_params.rb +2 -2
  28. data/lib/orb/models/coupons/subscription_list_params.rb +1 -1
  29. data/lib/orb/models/credit_note.rb +1 -1
  30. data/lib/orb/models/credit_note_list_params.rb +5 -5
  31. data/lib/orb/models/customer.rb +232 -232
  32. data/lib/orb/models/customer_create_params.rb +223 -223
  33. data/lib/orb/models/customer_list_params.rb +5 -5
  34. data/lib/orb/models/customer_update_by_external_id_params.rb +224 -224
  35. data/lib/orb/models/customer_update_params.rb +224 -224
  36. data/lib/orb/models/customers/balance_transaction_create_response.rb +2 -2
  37. data/lib/orb/models/customers/balance_transaction_list_params.rb +5 -5
  38. data/lib/orb/models/customers/balance_transaction_list_response.rb +2 -2
  39. data/lib/orb/models/customers/cost_list_by_external_id_params.rb +6 -6
  40. data/lib/orb/models/customers/cost_list_params.rb +6 -6
  41. data/lib/orb/models/customers/credit_list_by_external_id_params.rb +2 -2
  42. data/lib/orb/models/customers/credit_list_params.rb +2 -2
  43. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +20 -20
  44. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +22 -22
  45. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +20 -20
  46. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +22 -22
  47. data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +5 -5
  48. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +22 -22
  49. data/lib/orb/models/customers/credits/ledger_list_params.rb +5 -5
  50. data/lib/orb/models/customers/credits/ledger_list_response.rb +22 -22
  51. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +8 -8
  52. data/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb +7 -7
  53. data/lib/orb/models/customers/credits/top_up_create_params.rb +8 -8
  54. data/lib/orb/models/customers/credits/top_up_create_response.rb +7 -7
  55. data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +1 -1
  56. data/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb +7 -7
  57. data/lib/orb/models/customers/credits/top_up_list_params.rb +1 -1
  58. data/lib/orb/models/customers/credits/top_up_list_response.rb +7 -7
  59. data/lib/orb/models/dimensional_price_group.rb +7 -7
  60. data/lib/orb/models/dimensional_price_group_create_params.rb +2 -2
  61. data/lib/orb/models/dimensional_price_group_list_params.rb +1 -1
  62. data/lib/orb/models/event_ingest_params.rb +7 -7
  63. data/lib/orb/models/event_ingest_response.rb +4 -4
  64. data/lib/orb/models/event_search_params.rb +5 -5
  65. data/lib/orb/models/event_search_response.rb +8 -8
  66. data/lib/orb/models/event_update_params.rb +4 -4
  67. data/lib/orb/models/events/backfill_close_response.rb +7 -7
  68. data/lib/orb/models/events/backfill_create_params.rb +11 -11
  69. data/lib/orb/models/events/backfill_create_response.rb +7 -7
  70. data/lib/orb/models/events/backfill_fetch_response.rb +7 -7
  71. data/lib/orb/models/events/backfill_list_params.rb +1 -1
  72. data/lib/orb/models/events/backfill_list_response.rb +7 -7
  73. data/lib/orb/models/events/backfill_revert_response.rb +7 -7
  74. data/lib/orb/models/events/event_volumes.rb +1 -1
  75. data/lib/orb/models/events/volume_list_params.rb +7 -7
  76. data/lib/orb/models/invoice.rb +270 -270
  77. data/lib/orb/models/invoice_create_params.rb +12 -11
  78. data/lib/orb/models/invoice_fetch_upcoming_response.rb +266 -266
  79. data/lib/orb/models/invoice_issue_params.rb +4 -4
  80. data/lib/orb/models/invoice_line_item_create_params.rb +1 -1
  81. data/lib/orb/models/invoice_line_item_create_response.rb +27 -27
  82. data/lib/orb/models/invoice_list_params.rb +12 -12
  83. data/lib/orb/models/invoice_update_params.rb +2 -2
  84. data/lib/orb/models/item.rb +2 -2
  85. data/lib/orb/models/item_list_params.rb +1 -1
  86. data/lib/orb/models/metric_create_params.rb +2 -2
  87. data/lib/orb/models/metric_list_params.rb +5 -5
  88. data/lib/orb/models/metric_update_params.rb +2 -2
  89. data/lib/orb/models/percentage_discount.rb +2 -2
  90. data/lib/orb/models/plan.rb +35 -35
  91. data/lib/orb/models/plan_create_params.rb +267 -267
  92. data/lib/orb/models/plan_list_params.rb +5 -5
  93. data/lib/orb/models/plan_update_params.rb +4 -4
  94. data/lib/orb/models/plans/external_plan_id_update_params.rb +4 -4
  95. data/lib/orb/models/price.rb +158 -158
  96. data/lib/orb/models/price_create_params.rb +20 -20
  97. data/lib/orb/models/price_evaluate_params.rb +4 -4
  98. data/lib/orb/models/price_list_params.rb +1 -1
  99. data/lib/orb/models/price_update_params.rb +2 -2
  100. data/lib/orb/models/prices/external_price_id_update_params.rb +2 -2
  101. data/lib/orb/models/subscription.rb +114 -87
  102. data/lib/orb/models/subscription_cancel_params.rb +3 -3
  103. data/lib/orb/models/subscription_cancel_response.rb +150 -72
  104. data/lib/orb/models/subscription_change_apply_params.rb +33 -0
  105. data/lib/orb/models/subscription_change_apply_response.rb +1372 -0
  106. data/lib/orb/models/subscription_change_cancel_params.rb +19 -0
  107. data/lib/orb/models/subscription_change_cancel_response.rb +1372 -0
  108. data/lib/orb/models/subscription_change_retrieve_params.rb +19 -0
  109. data/lib/orb/models/subscription_change_retrieve_response.rb +1372 -0
  110. data/lib/orb/models/subscription_create_params.rb +641 -641
  111. data/lib/orb/models/subscription_create_response.rb +150 -72
  112. data/lib/orb/models/subscription_fetch_costs_params.rb +6 -6
  113. data/lib/orb/models/subscription_fetch_schedule_params.rb +5 -5
  114. data/lib/orb/models/subscription_fetch_schedule_response.rb +2 -2
  115. data/lib/orb/models/subscription_fetch_usage_params.rb +8 -8
  116. data/lib/orb/models/subscription_list_params.rb +5 -5
  117. data/lib/orb/models/subscription_price_intervals_params.rb +323 -323
  118. data/lib/orb/models/subscription_price_intervals_response.rb +152 -72
  119. data/lib/orb/models/subscription_schedule_plan_change_params.rb +651 -651
  120. data/lib/orb/models/subscription_schedule_plan_change_response.rb +152 -72
  121. data/lib/orb/models/subscription_trigger_phase_params.rb +3 -3
  122. data/lib/orb/models/subscription_trigger_phase_response.rb +152 -72
  123. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +152 -72
  124. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +153 -73
  125. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +152 -72
  126. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +8 -8
  127. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +152 -72
  128. data/lib/orb/models/subscription_update_params.rb +10 -10
  129. data/lib/orb/models/subscription_update_trial_params.rb +3 -3
  130. data/lib/orb/models/subscription_update_trial_response.rb +152 -72
  131. data/lib/orb/models/trial_discount.rb +1 -1
  132. data/lib/orb/models/usage_discount.rb +2 -2
  133. data/lib/orb/request_options.rb +7 -7
  134. data/lib/orb/resources/alerts.rb +38 -38
  135. data/lib/orb/resources/coupons/subscriptions.rb +3 -3
  136. data/lib/orb/resources/coupons.rb +9 -9
  137. data/lib/orb/resources/credit_notes.rb +8 -8
  138. data/lib/orb/resources/customers/balance_transactions.rb +26 -26
  139. data/lib/orb/resources/customers/costs.rb +232 -232
  140. data/lib/orb/resources/customers/credits/ledger.rb +344 -344
  141. data/lib/orb/resources/customers/credits/top_ups.rb +12 -12
  142. data/lib/orb/resources/customers/credits.rb +8 -8
  143. data/lib/orb/resources/customers.rb +59 -59
  144. data/lib/orb/resources/dimensional_price_groups.rb +6 -6
  145. data/lib/orb/resources/events/backfills.rb +49 -49
  146. data/lib/orb/resources/events/volume.rb +10 -10
  147. data/lib/orb/resources/events.rb +295 -295
  148. data/lib/orb/resources/invoice_line_items.rb +1 -1
  149. data/lib/orb/resources/invoices.rb +38 -38
  150. data/lib/orb/resources/items.rb +1 -1
  151. data/lib/orb/resources/metrics.rb +11 -11
  152. data/lib/orb/resources/plans/external_plan_id.rb +14 -14
  153. data/lib/orb/resources/plans.rb +22 -22
  154. data/lib/orb/resources/prices/external_price_id.rb +4 -4
  155. data/lib/orb/resources/prices.rb +30 -30
  156. data/lib/orb/resources/subscription_changes.rb +87 -0
  157. data/lib/orb/resources/subscriptions.rb +813 -813
  158. data/lib/orb/resources/top_level.rb +4 -4
  159. data/lib/orb/version.rb +1 -1
  160. data/lib/orb.rb +8 -0
  161. data/rbi/lib/orb/client.rbi +5 -4
  162. data/rbi/lib/orb/errors.rbi +3 -6
  163. data/rbi/lib/orb/internal/page.rbi +3 -6
  164. data/rbi/lib/orb/internal/transport/base_client.rbi +13 -27
  165. data/rbi/lib/orb/internal/transport/pooled_net_requester.rbi +8 -14
  166. data/rbi/lib/orb/internal/type/array_of.rbi +14 -18
  167. data/rbi/lib/orb/internal/type/base_model.rbi +51 -66
  168. data/rbi/lib/orb/internal/type/base_page.rbi +5 -10
  169. data/rbi/lib/orb/internal/type/boolean.rbi +12 -10
  170. data/rbi/lib/orb/internal/type/converter.rbi +44 -37
  171. data/rbi/lib/orb/internal/type/enum.rbi +24 -21
  172. data/rbi/lib/orb/internal/type/hash_of.rbi +13 -18
  173. data/rbi/lib/orb/internal/type/io_like.rbi +49 -0
  174. data/rbi/lib/orb/internal/type/request_parameters.rbi +1 -2
  175. data/rbi/lib/orb/internal/type/union.rbi +19 -21
  176. data/rbi/lib/orb/internal/type/unknown.rbi +10 -9
  177. data/rbi/lib/orb/internal/util.rbi +67 -70
  178. data/rbi/lib/orb/internal.rbi +1 -1
  179. data/rbi/lib/orb/models/alert.rbi +21 -33
  180. data/rbi/lib/orb/models/alert_create_for_customer_params.rbi +8 -13
  181. data/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi +8 -13
  182. data/rbi/lib/orb/models/alert_create_for_subscription_params.rbi +8 -13
  183. data/rbi/lib/orb/models/alert_disable_params.rbi +2 -4
  184. data/rbi/lib/orb/models/alert_enable_params.rbi +2 -4
  185. data/rbi/lib/orb/models/alert_list_params.rbi +3 -6
  186. data/rbi/lib/orb/models/alert_retrieve_params.rbi +2 -4
  187. data/rbi/lib/orb/models/alert_update_params.rbi +7 -11
  188. data/rbi/lib/orb/models/amount_discount.rbi +4 -7
  189. data/rbi/lib/orb/models/billable_metric.rbi +10 -13
  190. data/rbi/lib/orb/models/billing_cycle_relative_date.rbi +1 -2
  191. data/rbi/lib/orb/models/coupon.rbi +9 -11
  192. data/rbi/lib/orb/models/coupon_archive_params.rbi +2 -4
  193. data/rbi/lib/orb/models/coupon_create_params.rbi +8 -14
  194. data/rbi/lib/orb/models/coupon_fetch_params.rbi +2 -4
  195. data/rbi/lib/orb/models/coupon_list_params.rbi +3 -4
  196. data/rbi/lib/orb/models/coupons/subscription_list_params.rbi +3 -5
  197. data/rbi/lib/orb/models/credit_note.rbi +22 -45
  198. data/rbi/lib/orb/models/credit_note_create_params.rbi +5 -10
  199. data/rbi/lib/orb/models/credit_note_fetch_params.rbi +2 -4
  200. data/rbi/lib/orb/models/credit_note_list_params.rbi +3 -6
  201. data/rbi/lib/orb/models/customer.rbi +256 -281
  202. data/rbi/lib/orb/models/customer_create_params.rbi +251 -276
  203. data/rbi/lib/orb/models/customer_delete_params.rbi +2 -4
  204. data/rbi/lib/orb/models/customer_fetch_by_external_id_params.rbi +2 -4
  205. data/rbi/lib/orb/models/customer_fetch_params.rbi +2 -4
  206. data/rbi/lib/orb/models/customer_list_params.rbi +3 -6
  207. data/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi +2 -4
  208. data/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rbi +2 -4
  209. data/rbi/lib/orb/models/customer_update_by_external_id_params.rbi +252 -277
  210. data/rbi/lib/orb/models/customer_update_params.rbi +252 -277
  211. data/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi +3 -6
  212. data/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi +10 -19
  213. data/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi +3 -6
  214. data/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi +10 -19
  215. data/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi +8 -10
  216. data/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi +6 -12
  217. data/rbi/lib/orb/models/customers/cost_list_params.rbi +8 -10
  218. data/rbi/lib/orb/models/customers/cost_list_response.rbi +6 -12
  219. data/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi +3 -4
  220. data/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi +2 -4
  221. data/rbi/lib/orb/models/customers/credit_list_params.rbi +3 -4
  222. data/rbi/lib/orb/models/customers/credit_list_response.rbi +2 -4
  223. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +26 -33
  224. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +79 -136
  225. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi +26 -33
  226. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi +78 -135
  227. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +5 -10
  228. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +79 -136
  229. data/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi +5 -10
  230. data/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi +74 -131
  231. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +13 -19
  232. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi +12 -18
  233. data/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi +13 -19
  234. data/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi +12 -18
  235. data/rbi/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi +2 -4
  236. data/rbi/lib/orb/models/customers/credits/top_up_delete_params.rbi +2 -4
  237. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +3 -5
  238. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi +12 -18
  239. data/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi +3 -5
  240. data/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi +12 -18
  241. data/rbi/lib/orb/models/dimensional_price_group.rbi +8 -9
  242. data/rbi/lib/orb/models/dimensional_price_group_create_params.rbi +4 -7
  243. data/rbi/lib/orb/models/dimensional_price_group_list_params.rbi +3 -5
  244. data/rbi/lib/orb/models/dimensional_price_group_retrieve_params.rbi +2 -4
  245. data/rbi/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi +2 -4
  246. data/rbi/lib/orb/models/dimensional_price_groups.rbi +2 -4
  247. data/rbi/lib/orb/models/discount.rbi +1 -2
  248. data/rbi/lib/orb/models/evaluate_price_group.rbi +3 -6
  249. data/rbi/lib/orb/models/event_deprecate_params.rbi +2 -4
  250. data/rbi/lib/orb/models/event_deprecate_response.rbi +2 -4
  251. data/rbi/lib/orb/models/event_ingest_params.rbi +10 -13
  252. data/rbi/lib/orb/models/event_ingest_response.rbi +10 -16
  253. data/rbi/lib/orb/models/event_search_params.rbi +7 -9
  254. data/rbi/lib/orb/models/event_search_response.rbi +11 -14
  255. data/rbi/lib/orb/models/event_update_params.rbi +5 -6
  256. data/rbi/lib/orb/models/event_update_response.rbi +2 -4
  257. data/rbi/lib/orb/models/events/backfill_close_params.rbi +2 -4
  258. data/rbi/lib/orb/models/events/backfill_close_response.rbi +10 -14
  259. data/rbi/lib/orb/models/events/backfill_create_params.rbi +13 -16
  260. data/rbi/lib/orb/models/events/backfill_create_response.rbi +10 -14
  261. data/rbi/lib/orb/models/events/backfill_fetch_params.rbi +2 -4
  262. data/rbi/lib/orb/models/events/backfill_fetch_response.rbi +10 -14
  263. data/rbi/lib/orb/models/events/backfill_list_params.rbi +3 -5
  264. data/rbi/lib/orb/models/events/backfill_list_response.rbi +10 -14
  265. data/rbi/lib/orb/models/events/backfill_revert_params.rbi +2 -4
  266. data/rbi/lib/orb/models/events/backfill_revert_response.rbi +10 -14
  267. data/rbi/lib/orb/models/events/event_volumes.rbi +5 -9
  268. data/rbi/lib/orb/models/events/volume_list_params.rbi +9 -11
  269. data/rbi/lib/orb/models/invoice.rbi +388 -465
  270. data/rbi/lib/orb/models/invoice_create_params.rbi +19 -26
  271. data/rbi/lib/orb/models/invoice_fetch_params.rbi +2 -4
  272. data/rbi/lib/orb/models/invoice_fetch_upcoming_params.rbi +2 -4
  273. data/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi +381 -460
  274. data/rbi/lib/orb/models/invoice_issue_params.rbi +6 -8
  275. data/rbi/lib/orb/models/invoice_level_discount.rbi +1 -2
  276. data/rbi/lib/orb/models/invoice_line_item_create_params.rbi +3 -5
  277. data/rbi/lib/orb/models/invoice_line_item_create_response.rbi +101 -143
  278. data/rbi/lib/orb/models/invoice_list_params.rbi +8 -13
  279. data/rbi/lib/orb/models/invoice_mark_paid_params.rbi +2 -4
  280. data/rbi/lib/orb/models/invoice_pay_params.rbi +2 -4
  281. data/rbi/lib/orb/models/invoice_update_params.rbi +4 -6
  282. data/rbi/lib/orb/models/invoice_void_params.rbi +2 -4
  283. data/rbi/lib/orb/models/item.rbi +7 -12
  284. data/rbi/lib/orb/models/item_create_params.rbi +2 -4
  285. data/rbi/lib/orb/models/item_fetch_params.rbi +2 -4
  286. data/rbi/lib/orb/models/item_list_params.rbi +3 -5
  287. data/rbi/lib/orb/models/item_update_params.rbi +5 -10
  288. data/rbi/lib/orb/models/metric_create_params.rbi +4 -6
  289. data/rbi/lib/orb/models/metric_fetch_params.rbi +2 -4
  290. data/rbi/lib/orb/models/metric_list_params.rbi +3 -6
  291. data/rbi/lib/orb/models/metric_update_params.rbi +4 -6
  292. data/rbi/lib/orb/models/pagination_metadata.rbi +2 -4
  293. data/rbi/lib/orb/models/percentage_discount.rbi +5 -8
  294. data/rbi/lib/orb/models/plan.rbi +180 -219
  295. data/rbi/lib/orb/models/plan_create_params.rbi +670 -951
  296. data/rbi/lib/orb/models/plan_fetch_params.rbi +2 -4
  297. data/rbi/lib/orb/models/plan_list_params.rbi +4 -8
  298. data/rbi/lib/orb/models/plan_update_params.rbi +6 -8
  299. data/rbi/lib/orb/models/plans/external_plan_id_fetch_params.rbi +2 -4
  300. data/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi +6 -8
  301. data/rbi/lib/orb/models/price.rbi +827 -1494
  302. data/rbi/lib/orb/models/price_create_params.rbi +60 -101
  303. data/rbi/lib/orb/models/price_evaluate_params.rbi +6 -9
  304. data/rbi/lib/orb/models/price_evaluate_response.rbi +2 -4
  305. data/rbi/lib/orb/models/price_fetch_params.rbi +2 -4
  306. data/rbi/lib/orb/models/price_list_params.rbi +3 -5
  307. data/rbi/lib/orb/models/price_update_params.rbi +4 -6
  308. data/rbi/lib/orb/models/prices/external_price_id_fetch_params.rbi +2 -4
  309. data/rbi/lib/orb/models/prices/external_price_id_update_params.rbi +4 -6
  310. data/rbi/lib/orb/models/subscription.rbi +167 -187
  311. data/rbi/lib/orb/models/subscription_cancel_params.rbi +5 -7
  312. data/rbi/lib/orb/models/subscription_cancel_response.rbi +224 -178
  313. data/rbi/lib/orb/models/subscription_change_apply_params.rbi +40 -0
  314. data/rbi/lib/orb/models/subscription_change_apply_response.rbi +1554 -0
  315. data/rbi/lib/orb/models/subscription_change_cancel_params.rbi +18 -0
  316. data/rbi/lib/orb/models/subscription_change_cancel_response.rbi +1565 -0
  317. data/rbi/lib/orb/models/subscription_change_retrieve_params.rbi +18 -0
  318. data/rbi/lib/orb/models/subscription_change_retrieve_response.rbi +1581 -0
  319. data/rbi/lib/orb/models/subscription_create_params.rbi +1372 -1968
  320. data/rbi/lib/orb/models/subscription_create_response.rbi +224 -178
  321. data/rbi/lib/orb/models/subscription_fetch_costs_params.rbi +8 -10
  322. data/rbi/lib/orb/models/subscription_fetch_costs_response.rbi +6 -12
  323. data/rbi/lib/orb/models/subscription_fetch_params.rbi +2 -4
  324. data/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi +3 -6
  325. data/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi +6 -10
  326. data/rbi/lib/orb/models/subscription_fetch_usage_params.rbi +12 -17
  327. data/rbi/lib/orb/models/subscription_list_params.rbi +4 -8
  328. data/rbi/lib/orb/models/subscription_price_intervals_params.rbi +772 -1124
  329. data/rbi/lib/orb/models/subscription_price_intervals_response.rbi +228 -178
  330. data/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi +1396 -1993
  331. data/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi +238 -182
  332. data/rbi/lib/orb/models/subscription_trigger_phase_params.rbi +5 -7
  333. data/rbi/lib/orb/models/subscription_trigger_phase_response.rbi +224 -178
  334. data/rbi/lib/orb/models/subscription_unschedule_cancellation_params.rbi +2 -4
  335. data/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi +238 -182
  336. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +2 -4
  337. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +265 -199
  338. data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rbi +2 -4
  339. data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +264 -198
  340. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi +11 -15
  341. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi +238 -182
  342. data/rbi/lib/orb/models/subscription_update_params.rbi +12 -15
  343. data/rbi/lib/orb/models/subscription_update_trial_params.rbi +6 -9
  344. data/rbi/lib/orb/models/subscription_update_trial_response.rbi +224 -178
  345. data/rbi/lib/orb/models/subscription_usage.rbi +24 -43
  346. data/rbi/lib/orb/models/subscriptions.rbi +2 -4
  347. data/rbi/lib/orb/models/top_level_ping_params.rbi +2 -4
  348. data/rbi/lib/orb/models/top_level_ping_response.rbi +2 -4
  349. data/rbi/lib/orb/models/trial_discount.rbi +4 -8
  350. data/rbi/lib/orb/models/usage_discount.rbi +5 -8
  351. data/rbi/lib/orb/request_options.rbi +9 -11
  352. data/rbi/lib/orb/resources/alerts.rbi +44 -60
  353. data/rbi/lib/orb/resources/coupons/subscriptions.rbi +6 -9
  354. data/rbi/lib/orb/resources/coupons.rbi +18 -25
  355. data/rbi/lib/orb/resources/credit_notes.rbi +9 -15
  356. data/rbi/lib/orb/resources/customers/balance_transactions.rbi +26 -31
  357. data/rbi/lib/orb/resources/customers/costs.rbi +241 -246
  358. data/rbi/lib/orb/resources/customers/credits/ledger.rbi +387 -396
  359. data/rbi/lib/orb/resources/customers/credits/top_ups.rbi +29 -40
  360. data/rbi/lib/orb/resources/customers/credits.rbi +15 -20
  361. data/rbi/lib/orb/resources/customers.rbi +407 -417
  362. data/rbi/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbi +2 -4
  363. data/rbi/lib/orb/resources/dimensional_price_groups.rbi +13 -19
  364. data/rbi/lib/orb/resources/events/backfills.rbi +61 -69
  365. data/rbi/lib/orb/resources/events/volume.rbi +19 -22
  366. data/rbi/lib/orb/resources/events.rbi +311 -319
  367. data/rbi/lib/orb/resources/invoice_line_items.rbi +4 -7
  368. data/rbi/lib/orb/resources/invoices.rbi +62 -76
  369. data/rbi/lib/orb/resources/items.rbi +7 -14
  370. data/rbi/lib/orb/resources/metrics.rbi +17 -25
  371. data/rbi/lib/orb/resources/plans/external_plan_id.rbi +21 -25
  372. data/rbi/lib/orb/resources/plans.rbi +63 -71
  373. data/rbi/lib/orb/resources/prices/external_price_id.rbi +9 -13
  374. data/rbi/lib/orb/resources/prices.rbi +77 -87
  375. data/rbi/lib/orb/resources/subscription_changes.rbi +61 -0
  376. data/rbi/lib/orb/resources/subscriptions.rbi +933 -963
  377. data/rbi/lib/orb/resources/top_level.rbi +6 -8
  378. data/sig/orb/client.rbs +2 -0
  379. data/sig/orb/internal/transport/pooled_net_requester.rbs +1 -1
  380. data/sig/orb/internal/type/array_of.rbs +5 -2
  381. data/sig/orb/internal/type/base_model.rbs +5 -2
  382. data/sig/orb/internal/type/boolean.rbs +5 -2
  383. data/sig/orb/internal/type/converter.rbs +11 -5
  384. data/sig/orb/internal/type/enum.rbs +5 -2
  385. data/sig/orb/internal/type/hash_of.rbs +5 -2
  386. data/sig/orb/internal/type/io_like.rbs +23 -0
  387. data/sig/orb/internal/type/union.rbs +5 -2
  388. data/sig/orb/internal/type/unknown.rbs +5 -2
  389. data/sig/orb/internal/util.rbs +17 -2
  390. data/sig/orb/models/subscription.rbs +14 -0
  391. data/sig/orb/models/subscription_cancel_response.rbs +47 -2
  392. data/sig/orb/models/subscription_change_apply_params.rbs +24 -0
  393. data/sig/orb/models/subscription_change_apply_response.rbs +784 -0
  394. data/sig/orb/models/subscription_change_cancel_params.rbs +15 -0
  395. data/sig/orb/models/subscription_change_cancel_response.rbs +784 -0
  396. data/sig/orb/models/subscription_change_retrieve_params.rbs +15 -0
  397. data/sig/orb/models/subscription_change_retrieve_response.rbs +784 -0
  398. data/sig/orb/models/subscription_create_response.rbs +47 -2
  399. data/sig/orb/models/subscription_price_intervals_response.rbs +47 -2
  400. data/sig/orb/models/subscription_schedule_plan_change_response.rbs +47 -2
  401. data/sig/orb/models/subscription_trigger_phase_response.rbs +47 -2
  402. data/sig/orb/models/subscription_unschedule_cancellation_response.rbs +47 -2
  403. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs +47 -2
  404. data/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs +47 -2
  405. data/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs +47 -2
  406. data/sig/orb/models/subscription_update_trial_response.rbs +47 -2
  407. data/sig/orb/resources/customers.rbs +2 -2
  408. data/sig/orb/resources/subscription_changes.rbs +24 -0
  409. metadata +28 -4
@@ -7,18 +7,18 @@ module Orb
7
7
  attr_accessor :id
8
8
 
9
9
  # The current plan phase that is active, only if the subscription's plan has
10
- # phases.
10
+ # phases.
11
11
  sig { returns(T.nilable(Integer)) }
12
12
  attr_accessor :active_plan_phase_order
13
13
 
14
14
  # The adjustment intervals for this subscription sorted by the start_date of the
15
- # adjustment interval.
15
+ # adjustment interval.
16
16
  sig { returns(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval]) }
17
17
  attr_accessor :adjustment_intervals
18
18
 
19
19
  # Determines whether issued invoices for this subscription will automatically be
20
- # charged with the saved payment method on the due date. This property defaults to
21
- # the plan's behavior. If null, defaults to the customer's setting.
20
+ # charged with the saved payment method on the due date. This property defaults to
21
+ # the plan's behavior. If null, defaults to the customer's setting.
22
22
  sig { returns(T.nilable(T::Boolean)) }
23
23
  attr_accessor :auto_collection
24
24
 
@@ -37,9 +37,9 @@ module Orb
37
37
  attr_writer :billing_cycle_anchor_configuration
38
38
 
39
39
  # The day of the month on which the billing cycle is anchored. If the maximum
40
- # number of days in a month is greater than this value, the last day of the month
41
- # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
42
- # period begins on the 30th.
40
+ # number of days in a month is greater than this value, the last day of the month
41
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
42
+ # period begins on the 30th.
43
43
  sig { returns(Integer) }
44
44
  attr_accessor :billing_cycle_day
45
45
 
@@ -47,35 +47,35 @@ module Orb
47
47
  attr_accessor :created_at
48
48
 
49
49
  # The end of the current billing period. This is an exclusive timestamp, such that
50
- # the instant returned is not part of the billing period. Set to null for
51
- # subscriptions that are not currently active.
50
+ # the instant returned is not part of the billing period. Set to null for
51
+ # subscriptions that are not currently active.
52
52
  sig { returns(T.nilable(Time)) }
53
53
  attr_accessor :current_billing_period_end_date
54
54
 
55
55
  # The start date of the current billing period. This is an inclusive timestamp;
56
- # the instant returned is exactly the beginning of the billing period. Set to null
57
- # if the subscription is not currently active.
56
+ # the instant returned is exactly the beginning of the billing period. Set to null
57
+ # if the subscription is not currently active.
58
58
  sig { returns(T.nilable(Time)) }
59
59
  attr_accessor :current_billing_period_start_date
60
60
 
61
61
  # A customer is a buyer of your products, and the other party to the billing
62
- # relationship.
62
+ # relationship.
63
63
  #
64
- # In Orb, customers are assigned system generated identifiers automatically, but
65
- # it's often desirable to have these match existing identifiers in your system. To
66
- # avoid having to denormalize Orb ID information, you can pass in an
67
- # `external_customer_id` with your own identifier. See
68
- # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
69
- # information about how these aliases work in Orb.
64
+ # In Orb, customers are assigned system generated identifiers automatically, but
65
+ # it's often desirable to have these match existing identifiers in your system. To
66
+ # avoid having to denormalize Orb ID information, you can pass in an
67
+ # `external_customer_id` with your own identifier. See
68
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
69
+ # information about how these aliases work in Orb.
70
70
  #
71
- # In addition to having an identifier in your system, a customer may exist in a
72
- # payment provider solution like Stripe. Use the `payment_provider_id` and the
73
- # `payment_provider` enum field to express this mapping.
71
+ # In addition to having an identifier in your system, a customer may exist in a
72
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
73
+ # `payment_provider` enum field to express this mapping.
74
74
  #
75
- # A customer also has a timezone (from the standard
76
- # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
77
- # your account's timezone. See [Timezone localization](/essentials/timezones) for
78
- # information on what this timezone parameter influences within Orb.
75
+ # A customer also has a timezone (from the standard
76
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
77
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
78
+ # information on what this timezone parameter influences within Orb.
79
79
  sig { returns(Orb::Models::Customer) }
80
80
  attr_reader :customer
81
81
 
@@ -83,7 +83,7 @@ module Orb
83
83
  attr_writer :customer
84
84
 
85
85
  # Determines the default memo on this subscriptions' invoices. Note that if this
86
- # is not provided, it is determined by the plan configuration.
86
+ # is not provided, it is determined by the plan configuration.
87
87
  sig { returns(T.nilable(String)) }
88
88
  attr_accessor :default_invoice_memo
89
89
 
@@ -91,11 +91,11 @@ module Orb
91
91
  sig do
92
92
  returns(
93
93
  T::Array[
94
- T.any(
95
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval,
96
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval,
97
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval
98
- )
94
+ T.any(
95
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval,
96
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval,
97
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval
98
+ )
99
99
  ]
100
100
  )
101
101
  end
@@ -116,9 +116,9 @@ module Orb
116
116
  attr_accessor :maximum_intervals
117
117
 
118
118
  # User specified key-value pairs for the resource. If not present, this defaults
119
- # to an empty dictionary. Individual keys can be removed by setting the value to
120
- # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
121
- # `null`.
119
+ # to an empty dictionary. Individual keys can be removed by setting the value to
120
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
121
+ # `null`.
122
122
  sig { returns(T::Hash[Symbol, String]) }
123
123
  attr_accessor :metadata
124
124
 
@@ -127,16 +127,30 @@ module Orb
127
127
  attr_accessor :minimum_intervals
128
128
 
129
129
  # Determines the difference between the invoice issue date for subscription
130
- # invoices as the date that they are due. A value of `0` here represents that the
131
- # invoice is due on issue, whereas a value of `30` represents that the customer
132
- # has a month to pay the invoice.
130
+ # invoices as the date that they are due. A value of `0` here represents that the
131
+ # invoice is due on issue, whereas a value of `30` represents that the customer
132
+ # has a month to pay the invoice.
133
133
  sig { returns(Integer) }
134
134
  attr_accessor :net_terms
135
135
 
136
+ # A pending subscription change if one exists on this subscription.
137
+ sig { returns(T.nilable(Orb::Models::SubscriptionTriggerPhaseResponse::PendingSubscriptionChange)) }
138
+ attr_reader :pending_subscription_change
139
+
140
+ sig do
141
+ params(
142
+ pending_subscription_change: T.nilable(
143
+ T.any(Orb::Models::SubscriptionTriggerPhaseResponse::PendingSubscriptionChange, Orb::Internal::AnyHash)
144
+ )
145
+ )
146
+ .void
147
+ end
148
+ attr_writer :pending_subscription_change
149
+
136
150
  # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
137
- # subscribed to by a customer. Plans define the billing behavior of the
138
- # subscription. You can see more about how to configure prices in the
139
- # [Price resource](/reference/price).
151
+ # subscribed to by a customer. Plans define the billing behavior of the
152
+ # subscription. You can see more about how to configure prices in the
153
+ # [Price resource](/reference/price).
140
154
  sig { returns(Orb::Models::Plan) }
141
155
  attr_reader :plan
142
156
 
@@ -176,6 +190,20 @@ module Orb
176
190
  end
177
191
  attr_writer :trial_info
178
192
 
193
+ # The resources that were changed as part of this operation. Only present when
194
+ # fetched through the subscription changes API or if the
195
+ # `include_changed_resources` parameter was passed in the request.
196
+ sig { returns(T.nilable(Orb::Models::SubscriptionTriggerPhaseResponse::ChangedResources)) }
197
+ attr_reader :changed_resources
198
+
199
+ sig do
200
+ params(
201
+ changed_resources: T.nilable(T.any(Orb::Models::SubscriptionTriggerPhaseResponse::ChangedResources, Orb::Internal::AnyHash))
202
+ )
203
+ .void
204
+ end
205
+ attr_writer :changed_resources
206
+
179
207
  sig do
180
208
  params(
181
209
  id: String,
@@ -193,12 +221,12 @@ module Orb
193
221
  customer: T.any(Orb::Models::Customer, Orb::Internal::AnyHash),
194
222
  default_invoice_memo: T.nilable(String),
195
223
  discount_intervals: T::Array[
196
- T.any(
197
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval,
198
- Orb::Internal::AnyHash,
199
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval,
200
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval
201
- )
224
+ T.any(
225
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval,
226
+ Orb::Internal::AnyHash,
227
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval,
228
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval
229
+ )
202
230
  ],
203
231
  end_date: T.nilable(Time),
204
232
  fixed_fee_quantity_schedule: T::Array[T.any(Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule, Orb::Internal::AnyHash)],
@@ -207,12 +235,16 @@ module Orb
207
235
  metadata: T::Hash[Symbol, String],
208
236
  minimum_intervals: T::Array[T.any(Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval, Orb::Internal::AnyHash)],
209
237
  net_terms: Integer,
238
+ pending_subscription_change: T.nilable(
239
+ T.any(Orb::Models::SubscriptionTriggerPhaseResponse::PendingSubscriptionChange, Orb::Internal::AnyHash)
240
+ ),
210
241
  plan: T.any(Orb::Models::Plan, Orb::Internal::AnyHash),
211
242
  price_intervals: T::Array[T.any(Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval, Orb::Internal::AnyHash)],
212
243
  redeemed_coupon: T.nilable(T.any(Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon, Orb::Internal::AnyHash)),
213
244
  start_date: Time,
214
245
  status: Orb::Models::SubscriptionTriggerPhaseResponse::Status::OrSymbol,
215
- trial_info: T.any(Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo, Orb::Internal::AnyHash)
246
+ trial_info: T.any(Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo, Orb::Internal::AnyHash),
247
+ changed_resources: T.nilable(T.any(Orb::Models::SubscriptionTriggerPhaseResponse::ChangedResources, Orb::Internal::AnyHash))
216
248
  )
217
249
  .returns(T.attached_class)
218
250
  end
@@ -236,15 +268,15 @@ module Orb
236
268
  metadata:,
237
269
  minimum_intervals:,
238
270
  net_terms:,
271
+ pending_subscription_change:,
239
272
  plan:,
240
273
  price_intervals:,
241
274
  redeemed_coupon:,
242
275
  start_date:,
243
276
  status:,
244
- trial_info:
245
- )
246
- end
247
-
277
+ trial_info:,
278
+ changed_resources: nil
279
+ ); end
248
280
  sig do
249
281
  override
250
282
  .returns(
@@ -261,11 +293,11 @@ module Orb
261
293
  customer: Orb::Models::Customer,
262
294
  default_invoice_memo: T.nilable(String),
263
295
  discount_intervals: T::Array[
264
- T.any(
265
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval,
266
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval,
267
- Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval
268
- )
296
+ T.any(
297
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval,
298
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval,
299
+ Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval
300
+ )
269
301
  ],
270
302
  end_date: T.nilable(Time),
271
303
  fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule],
@@ -274,17 +306,18 @@ module Orb
274
306
  metadata: T::Hash[Symbol, String],
275
307
  minimum_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval],
276
308
  net_terms: Integer,
309
+ pending_subscription_change: T.nilable(Orb::Models::SubscriptionTriggerPhaseResponse::PendingSubscriptionChange),
277
310
  plan: Orb::Models::Plan,
278
311
  price_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval],
279
312
  redeemed_coupon: T.nilable(Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon),
280
313
  start_date: Time,
281
314
  status: Orb::Models::SubscriptionTriggerPhaseResponse::Status::TaggedSymbol,
282
- trial_info: Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo
315
+ trial_info: Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo,
316
+ changed_resources: T.nilable(Orb::Models::SubscriptionTriggerPhaseResponse::ChangedResources)
283
317
  }
284
318
  )
285
319
  end
286
- def to_hash
287
- end
320
+ def to_hash; end
288
321
 
289
322
  class AdjustmentInterval < Orb::Internal::Type::BaseModel
290
323
  sig { returns(String) }
@@ -332,8 +365,7 @@ module Orb
332
365
  )
333
366
  .returns(T.attached_class)
334
367
  end
335
- def self.new(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:)
336
- end
368
+ def self.new(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end
337
369
 
338
370
  sig do
339
371
  override
@@ -353,8 +385,7 @@ module Orb
353
385
  }
354
386
  )
355
387
  end
356
- def to_hash
357
- end
388
+ def to_hash; end
358
389
 
359
390
  module Adjustment
360
391
  extend Orb::Internal::Type::Union
@@ -371,7 +402,7 @@ module Orb
371
402
  attr_accessor :applies_to_price_ids
372
403
 
373
404
  # True for adjustments that apply to an entire invocice, false for adjustments
374
- # that apply to only one price.
405
+ # that apply to only one price.
375
406
  sig { returns(T::Boolean) }
376
407
  attr_accessor :is_invoice_level
377
408
 
@@ -384,7 +415,7 @@ module Orb
384
415
  attr_accessor :reason
385
416
 
386
417
  # The number of usage units by which to discount the price this adjustment applies
387
- # to in a given billing period.
418
+ # to in a given billing period.
388
419
  sig { returns(Float) }
389
420
  attr_accessor :usage_discount
390
421
 
@@ -408,9 +439,7 @@ module Orb
408
439
  reason:,
409
440
  usage_discount:,
410
441
  adjustment_type: :usage_discount
411
- )
412
- end
413
-
442
+ ); end
414
443
  sig do
415
444
  override
416
445
  .returns(
@@ -425,8 +454,7 @@ module Orb
425
454
  }
426
455
  )
427
456
  end
428
- def to_hash
429
- end
457
+ def to_hash; end
430
458
  end
431
459
 
432
460
  class PlanPhaseAmountDiscountAdjustment < Orb::Internal::Type::BaseModel
@@ -437,7 +465,7 @@ module Orb
437
465
  attr_accessor :adjustment_type
438
466
 
439
467
  # The amount by which to discount the prices this adjustment applies to in a given
440
- # billing period.
468
+ # billing period.
441
469
  sig { returns(String) }
442
470
  attr_accessor :amount_discount
443
471
 
@@ -446,7 +474,7 @@ module Orb
446
474
  attr_accessor :applies_to_price_ids
447
475
 
448
476
  # True for adjustments that apply to an entire invocice, false for adjustments
449
- # that apply to only one price.
477
+ # that apply to only one price.
450
478
  sig { returns(T::Boolean) }
451
479
  attr_accessor :is_invoice_level
452
480
 
@@ -478,9 +506,7 @@ module Orb
478
506
  plan_phase_order:,
479
507
  reason:,
480
508
  adjustment_type: :amount_discount
481
- )
482
- end
483
-
509
+ ); end
484
510
  sig do
485
511
  override
486
512
  .returns(
@@ -495,8 +521,7 @@ module Orb
495
521
  }
496
522
  )
497
523
  end
498
- def to_hash
499
- end
524
+ def to_hash; end
500
525
  end
501
526
 
502
527
  class PlanPhasePercentageDiscountAdjustment < Orb::Internal::Type::BaseModel
@@ -511,12 +536,12 @@ module Orb
511
536
  attr_accessor :applies_to_price_ids
512
537
 
513
538
  # True for adjustments that apply to an entire invocice, false for adjustments
514
- # that apply to only one price.
539
+ # that apply to only one price.
515
540
  sig { returns(T::Boolean) }
516
541
  attr_accessor :is_invoice_level
517
542
 
518
543
  # The percentage (as a value between 0 and 1) by which to discount the price
519
- # intervals this adjustment applies to in a given billing period.
544
+ # intervals this adjustment applies to in a given billing period.
520
545
  sig { returns(Float) }
521
546
  attr_accessor :percentage_discount
522
547
 
@@ -548,9 +573,7 @@ module Orb
548
573
  plan_phase_order:,
549
574
  reason:,
550
575
  adjustment_type: :percentage_discount
551
- )
552
- end
553
-
576
+ ); end
554
577
  sig do
555
578
  override
556
579
  .returns(
@@ -565,8 +588,7 @@ module Orb
565
588
  }
566
589
  )
567
590
  end
568
- def to_hash
569
- end
591
+ def to_hash; end
570
592
  end
571
593
 
572
594
  class PlanPhaseMinimumAdjustment < Orb::Internal::Type::BaseModel
@@ -581,7 +603,7 @@ module Orb
581
603
  attr_accessor :applies_to_price_ids
582
604
 
583
605
  # True for adjustments that apply to an entire invocice, false for adjustments
584
- # that apply to only one price.
606
+ # that apply to only one price.
585
607
  sig { returns(T::Boolean) }
586
608
  attr_accessor :is_invoice_level
587
609
 
@@ -590,7 +612,7 @@ module Orb
590
612
  attr_accessor :item_id
591
613
 
592
614
  # The minimum amount to charge in a given billing period for the prices this
593
- # adjustment applies to.
615
+ # adjustment applies to.
594
616
  sig { returns(String) }
595
617
  attr_accessor :minimum_amount
596
618
 
@@ -624,9 +646,7 @@ module Orb
624
646
  plan_phase_order:,
625
647
  reason:,
626
648
  adjustment_type: :minimum
627
- )
628
- end
629
-
649
+ ); end
630
650
  sig do
631
651
  override
632
652
  .returns(
@@ -642,8 +662,7 @@ module Orb
642
662
  }
643
663
  )
644
664
  end
645
- def to_hash
646
- end
665
+ def to_hash; end
647
666
  end
648
667
 
649
668
  class PlanPhaseMaximumAdjustment < Orb::Internal::Type::BaseModel
@@ -658,12 +677,12 @@ module Orb
658
677
  attr_accessor :applies_to_price_ids
659
678
 
660
679
  # True for adjustments that apply to an entire invocice, false for adjustments
661
- # that apply to only one price.
680
+ # that apply to only one price.
662
681
  sig { returns(T::Boolean) }
663
682
  attr_accessor :is_invoice_level
664
683
 
665
684
  # The maximum amount to charge in a given billing period for the prices this
666
- # adjustment applies to.
685
+ # adjustment applies to.
667
686
  sig { returns(String) }
668
687
  attr_accessor :maximum_amount
669
688
 
@@ -695,9 +714,7 @@ module Orb
695
714
  plan_phase_order:,
696
715
  reason:,
697
716
  adjustment_type: :maximum
698
- )
699
- end
700
-
717
+ ); end
701
718
  sig do
702
719
  override
703
720
  .returns(
@@ -712,8 +729,7 @@ module Orb
712
729
  }
713
730
  )
714
731
  end
715
- def to_hash
716
- end
732
+ def to_hash; end
717
733
  end
718
734
 
719
735
  sig do
@@ -722,39 +738,36 @@ module Orb
722
738
  [Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PlanPhaseUsageDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PlanPhaseAmountDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PlanPhasePercentageDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PlanPhaseMinimumAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PlanPhaseMaximumAdjustment]
723
739
  )
724
740
  end
725
- def self.variants
726
- end
741
+ def self.variants; end
727
742
  end
728
743
  end
729
744
 
730
745
  class BillingCycleAnchorConfiguration < Orb::Internal::Type::BaseModel
731
746
  # The day of the month on which the billing cycle is anchored. If the maximum
732
- # number of days in a month is greater than this value, the last day of the month
733
- # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
734
- # period begins on the 30th.
747
+ # number of days in a month is greater than this value, the last day of the month
748
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
749
+ # period begins on the 30th.
735
750
  sig { returns(Integer) }
736
751
  attr_accessor :day
737
752
 
738
753
  # The month on which the billing cycle is anchored (e.g. a quarterly price
739
- # anchored in February would have cycles starting February, May, August, and
740
- # November).
754
+ # anchored in February would have cycles starting February, May, August, and
755
+ # November).
741
756
  sig { returns(T.nilable(Integer)) }
742
757
  attr_accessor :month
743
758
 
744
759
  # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
745
- # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
760
+ # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
746
761
  sig { returns(T.nilable(Integer)) }
747
762
  attr_accessor :year
748
763
 
749
764
  sig do
750
765
  params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).returns(T.attached_class)
751
766
  end
752
- def self.new(day:, month: nil, year: nil)
753
- end
767
+ def self.new(day:, month: nil, year: nil); end
754
768
 
755
769
  sig { override.returns({day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)}) }
756
- def to_hash
757
- end
770
+ def to_hash; end
758
771
  end
759
772
 
760
773
  module DiscountInterval
@@ -802,9 +815,7 @@ module Orb
802
815
  end_date:,
803
816
  start_date:,
804
817
  discount_type: :amount
805
- )
806
- end
807
-
818
+ ); end
808
819
  sig do
809
820
  override
810
821
  .returns(
@@ -818,8 +829,7 @@ module Orb
818
829
  }
819
830
  )
820
831
  end
821
- def to_hash
822
- end
832
+ def to_hash; end
823
833
  end
824
834
 
825
835
  class PercentageDiscountInterval < Orb::Internal::Type::BaseModel
@@ -839,7 +849,7 @@ module Orb
839
849
  attr_accessor :end_date
840
850
 
841
851
  # Only available if discount_type is `percentage`.This is a number between 0
842
- # and 1.
852
+ # and 1.
843
853
  sig { returns(Float) }
844
854
  attr_accessor :percentage_discount
845
855
 
@@ -865,9 +875,7 @@ module Orb
865
875
  percentage_discount:,
866
876
  start_date:,
867
877
  discount_type: :percentage
868
- )
869
- end
870
-
878
+ ); end
871
879
  sig do
872
880
  override
873
881
  .returns(
@@ -881,8 +889,7 @@ module Orb
881
889
  }
882
890
  )
883
891
  end
884
- def to_hash
885
- end
892
+ def to_hash; end
886
893
  end
887
894
 
888
895
  class UsageDiscountInterval < Orb::Internal::Type::BaseModel
@@ -906,7 +913,7 @@ module Orb
906
913
  attr_accessor :start_date
907
914
 
908
915
  # Only available if discount_type is `usage`. Number of usage units that this
909
- # discount is for
916
+ # discount is for
910
917
  sig { returns(Float) }
911
918
  attr_accessor :usage_discount
912
919
 
@@ -928,9 +935,7 @@ module Orb
928
935
  start_date:,
929
936
  usage_discount:,
930
937
  discount_type: :usage
931
- )
932
- end
933
-
938
+ ); end
934
939
  sig do
935
940
  override
936
941
  .returns(
@@ -944,8 +949,7 @@ module Orb
944
949
  }
945
950
  )
946
951
  end
947
- def to_hash
948
- end
952
+ def to_hash; end
949
953
  end
950
954
 
951
955
  sig do
@@ -954,8 +958,7 @@ module Orb
954
958
  [Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval, Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval, Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval]
955
959
  )
956
960
  end
957
- def self.variants
958
- end
961
+ def self.variants; end
959
962
  end
960
963
 
961
964
  class FixedFeeQuantitySchedule < Orb::Internal::Type::BaseModel
@@ -975,14 +978,12 @@ module Orb
975
978
  params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time)
976
979
  .returns(T.attached_class)
977
980
  end
978
- def self.new(end_date:, price_id:, quantity:, start_date:)
979
- end
981
+ def self.new(end_date:, price_id:, quantity:, start_date:); end
980
982
 
981
983
  sig do
982
984
  override.returns({end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time})
983
985
  end
984
- def to_hash
985
- end
986
+ def to_hash; end
986
987
  end
987
988
 
988
989
  class MaximumInterval < Orb::Internal::Type::BaseModel
@@ -999,7 +1000,7 @@ module Orb
999
1000
  attr_accessor :end_date
1000
1001
 
1001
1002
  # The maximum amount to charge in a given billing period for the price intervals
1002
- # this transform applies to.
1003
+ # this transform applies to.
1003
1004
  sig { returns(String) }
1004
1005
  attr_accessor :maximum_amount
1005
1006
 
@@ -1038,8 +1039,7 @@ module Orb
1038
1039
  }
1039
1040
  )
1040
1041
  end
1041
- def to_hash
1042
- end
1042
+ def to_hash; end
1043
1043
  end
1044
1044
 
1045
1045
  class MinimumInterval < Orb::Internal::Type::BaseModel
@@ -1056,7 +1056,7 @@ module Orb
1056
1056
  attr_accessor :end_date
1057
1057
 
1058
1058
  # The minimum amount to charge in a given billing period for the price intervals
1059
- # this minimum applies to.
1059
+ # this minimum applies to.
1060
1060
  sig { returns(String) }
1061
1061
  attr_accessor :minimum_amount
1062
1062
 
@@ -1095,8 +1095,19 @@ module Orb
1095
1095
  }
1096
1096
  )
1097
1097
  end
1098
- def to_hash
1099
- end
1098
+ def to_hash; end
1099
+ end
1100
+
1101
+ class PendingSubscriptionChange < Orb::Internal::Type::BaseModel
1102
+ sig { returns(String) }
1103
+ attr_accessor :id
1104
+
1105
+ # A pending subscription change if one exists on this subscription.
1106
+ sig { params(id: String).returns(T.attached_class) }
1107
+ def self.new(id:); end
1108
+
1109
+ sig { override.returns({id: String}) }
1110
+ def to_hash; end
1100
1111
  end
1101
1112
 
1102
1113
  class PriceInterval < Orb::Internal::Type::BaseModel
@@ -1108,19 +1119,19 @@ module Orb
1108
1119
  attr_accessor :billing_cycle_day
1109
1120
 
1110
1121
  # The end of the current billing period. This is an exclusive timestamp, such that
1111
- # the instant returned is exactly the end of the billing period. Set to null if
1112
- # this price interval is not currently active.
1122
+ # the instant returned is exactly the end of the billing period. Set to null if
1123
+ # this price interval is not currently active.
1113
1124
  sig { returns(T.nilable(Time)) }
1114
1125
  attr_accessor :current_billing_period_end_date
1115
1126
 
1116
1127
  # The start date of the current billing period. This is an inclusive timestamp;
1117
- # the instant returned is exactly the beginning of the billing period. Set to null
1118
- # if this price interval is not currently active.
1128
+ # the instant returned is exactly the beginning of the billing period. Set to null
1129
+ # if this price interval is not currently active.
1119
1130
  sig { returns(T.nilable(Time)) }
1120
1131
  attr_accessor :current_billing_period_start_date
1121
1132
 
1122
1133
  # The end date of the price interval. This is the date that Orb stops billing for
1123
- # this price.
1134
+ # this price.
1124
1135
  sig { returns(T.nilable(Time)) }
1125
1136
  attr_accessor :end_date
1126
1137
 
@@ -1129,7 +1140,7 @@ module Orb
1129
1140
  attr_accessor :filter
1130
1141
 
1131
1142
  # The fixed fee quantity transitions for this price interval. This is only
1132
- # relevant for fixed fees.
1143
+ # relevant for fixed fees.
1133
1144
  sig do
1134
1145
  returns(
1135
1146
  T.nilable(
@@ -1140,15 +1151,15 @@ module Orb
1140
1151
  attr_accessor :fixed_fee_quantity_transitions
1141
1152
 
1142
1153
  # The Price resource represents a price that can be billed on a subscription,
1143
- # resulting in a charge on an invoice in the form of an invoice line item. Prices
1144
- # take a quantity and determine an amount to bill.
1154
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
1155
+ # take a quantity and determine an amount to bill.
1145
1156
  #
1146
- # Orb supports a few different pricing models out of the box. Each of these models
1147
- # is serialized differently in a given Price object. The model_type field
1148
- # determines the key for the configuration object that is present.
1157
+ # Orb supports a few different pricing models out of the box. Each of these models
1158
+ # is serialized differently in a given Price object. The model_type field
1159
+ # determines the key for the configuration object that is present.
1149
1160
  #
1150
- # For more on the types of prices, see
1151
- # [the core concepts documentation](/core-concepts#plan-and-price)
1161
+ # For more on the types of prices, see
1162
+ # [the core concepts documentation](/core-concepts#plan-and-price)
1152
1163
  sig do
1153
1164
  returns(
1154
1165
  T.any(
@@ -1186,18 +1197,18 @@ module Orb
1186
1197
  attr_accessor :price
1187
1198
 
1188
1199
  # The start date of the price interval. This is the date that Orb starts billing
1189
- # for this price.
1200
+ # for this price.
1190
1201
  sig { returns(Time) }
1191
1202
  attr_accessor :start_date
1192
1203
 
1193
1204
  # A list of customer IDs whose usage events will be aggregated and billed under
1194
- # this price interval.
1205
+ # this price interval.
1195
1206
  sig { returns(T.nilable(T::Array[String])) }
1196
1207
  attr_accessor :usage_customer_ids
1197
1208
 
1198
1209
  # The Price Interval resource represents a period of time for which a price will
1199
- # bill on a subscription. A subscription’s price intervals define its billing
1200
- # behavior.
1210
+ # bill on a subscription. A subscription’s price intervals define its billing
1211
+ # behavior.
1201
1212
  sig do
1202
1213
  params(
1203
1214
  id: String,
@@ -1208,10 +1219,10 @@ module Orb
1208
1219
  filter: T.nilable(String),
1209
1220
  fixed_fee_quantity_transitions: T.nilable(
1210
1221
  T::Array[
1211
- T.any(
1212
- Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition,
1213
- Orb::Internal::AnyHash
1214
- )
1222
+ T.any(
1223
+ Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition,
1224
+ Orb::Internal::AnyHash
1225
+ )
1215
1226
  ]
1216
1227
  ),
1217
1228
  price: T.any(
@@ -1261,9 +1272,7 @@ module Orb
1261
1272
  price:,
1262
1273
  start_date:,
1263
1274
  usage_customer_ids:
1264
- )
1265
- end
1266
-
1275
+ ); end
1267
1276
  sig do
1268
1277
  override
1269
1278
  .returns(
@@ -1312,8 +1321,7 @@ module Orb
1312
1321
  }
1313
1322
  )
1314
1323
  end
1315
- def to_hash
1316
- end
1324
+ def to_hash; end
1317
1325
 
1318
1326
  class FixedFeeQuantityTransition < Orb::Internal::Type::BaseModel
1319
1327
  sig { returns(Time) }
@@ -1326,12 +1334,10 @@ module Orb
1326
1334
  attr_accessor :quantity
1327
1335
 
1328
1336
  sig { params(effective_date: Time, price_id: String, quantity: Integer).returns(T.attached_class) }
1329
- def self.new(effective_date:, price_id:, quantity:)
1330
- end
1337
+ def self.new(effective_date:, price_id:, quantity:); end
1331
1338
 
1332
1339
  sig { override.returns({effective_date: Time, price_id: String, quantity: Integer}) }
1333
- def to_hash
1334
- end
1340
+ def to_hash; end
1335
1341
  end
1336
1342
  end
1337
1343
 
@@ -1348,12 +1354,10 @@ module Orb
1348
1354
  sig do
1349
1355
  params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).returns(T.attached_class)
1350
1356
  end
1351
- def self.new(coupon_id:, end_date:, start_date:)
1352
- end
1357
+ def self.new(coupon_id:, end_date:, start_date:); end
1353
1358
 
1354
1359
  sig { override.returns({coupon_id: String, end_date: T.nilable(Time), start_date: Time}) }
1355
- def to_hash
1356
- end
1360
+ def to_hash; end
1357
1361
  end
1358
1362
 
1359
1363
  module Status
@@ -1368,8 +1372,7 @@ module Orb
1368
1372
  UPCOMING = T.let(:upcoming, Orb::Models::SubscriptionTriggerPhaseResponse::Status::TaggedSymbol)
1369
1373
 
1370
1374
  sig { override.returns(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::Status::TaggedSymbol]) }
1371
- def self.values
1372
- end
1375
+ def self.values; end
1373
1376
  end
1374
1377
 
1375
1378
  class TrialInfo < Orb::Internal::Type::BaseModel
@@ -1377,12 +1380,55 @@ module Orb
1377
1380
  attr_accessor :end_date
1378
1381
 
1379
1382
  sig { params(end_date: T.nilable(Time)).returns(T.attached_class) }
1380
- def self.new(end_date:)
1381
- end
1383
+ def self.new(end_date:); end
1382
1384
 
1383
1385
  sig { override.returns({end_date: T.nilable(Time)}) }
1384
- def to_hash
1386
+ def to_hash; end
1387
+ end
1388
+
1389
+ class ChangedResources < Orb::Internal::Type::BaseModel
1390
+ # The credit notes that were created as part of this operation.
1391
+ sig { returns(T::Array[Orb::Models::CreditNote]) }
1392
+ attr_accessor :created_credit_notes
1393
+
1394
+ # The invoices that were created as part of this operation.
1395
+ sig { returns(T::Array[Orb::Models::Invoice]) }
1396
+ attr_accessor :created_invoices
1397
+
1398
+ # The credit notes that were voided as part of this operation.
1399
+ sig { returns(T::Array[Orb::Models::CreditNote]) }
1400
+ attr_accessor :voided_credit_notes
1401
+
1402
+ # The invoices that were voided as part of this operation.
1403
+ sig { returns(T::Array[Orb::Models::Invoice]) }
1404
+ attr_accessor :voided_invoices
1405
+
1406
+ # The resources that were changed as part of this operation. Only present when
1407
+ # fetched through the subscription changes API or if the
1408
+ # `include_changed_resources` parameter was passed in the request.
1409
+ sig do
1410
+ params(
1411
+ created_credit_notes: T::Array[T.any(Orb::Models::CreditNote, Orb::Internal::AnyHash)],
1412
+ created_invoices: T::Array[T.any(Orb::Models::Invoice, Orb::Internal::AnyHash)],
1413
+ voided_credit_notes: T::Array[T.any(Orb::Models::CreditNote, Orb::Internal::AnyHash)],
1414
+ voided_invoices: T::Array[T.any(Orb::Models::Invoice, Orb::Internal::AnyHash)]
1415
+ )
1416
+ .returns(T.attached_class)
1417
+ end
1418
+ def self.new(created_credit_notes:, created_invoices:, voided_credit_notes:, voided_invoices:); end
1419
+
1420
+ sig do
1421
+ override
1422
+ .returns(
1423
+ {
1424
+ created_credit_notes: T::Array[Orb::Models::CreditNote],
1425
+ created_invoices: T::Array[Orb::Models::Invoice],
1426
+ voided_credit_notes: T::Array[Orb::Models::CreditNote],
1427
+ voided_invoices: T::Array[Orb::Models::Invoice]
1428
+ }
1429
+ )
1385
1430
  end
1431
+ def to_hash; end
1386
1432
  end
1387
1433
  end
1388
1434
  end