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::SubscriptionUpdateTrialResponse::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::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval,
96
- Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval,
97
- Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval
98
- )
94
+ T.any(
95
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval,
96
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval,
97
+ Orb::Models::SubscriptionUpdateTrialResponse::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::SubscriptionUpdateTrialResponse::PendingSubscriptionChange)) }
138
+ attr_reader :pending_subscription_change
139
+
140
+ sig do
141
+ params(
142
+ pending_subscription_change: T.nilable(
143
+ T.any(Orb::Models::SubscriptionUpdateTrialResponse::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
 
@@ -174,6 +188,20 @@ module Orb
174
188
  end
175
189
  attr_writer :trial_info
176
190
 
191
+ # The resources that were changed as part of this operation. Only present when
192
+ # fetched through the subscription changes API or if the
193
+ # `include_changed_resources` parameter was passed in the request.
194
+ sig { returns(T.nilable(Orb::Models::SubscriptionUpdateTrialResponse::ChangedResources)) }
195
+ attr_reader :changed_resources
196
+
197
+ sig do
198
+ params(
199
+ changed_resources: T.nilable(T.any(Orb::Models::SubscriptionUpdateTrialResponse::ChangedResources, Orb::Internal::AnyHash))
200
+ )
201
+ .void
202
+ end
203
+ attr_writer :changed_resources
204
+
177
205
  sig do
178
206
  params(
179
207
  id: String,
@@ -191,12 +219,12 @@ module Orb
191
219
  customer: T.any(Orb::Models::Customer, Orb::Internal::AnyHash),
192
220
  default_invoice_memo: T.nilable(String),
193
221
  discount_intervals: T::Array[
194
- T.any(
195
- Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval,
196
- Orb::Internal::AnyHash,
197
- Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval,
198
- Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval
199
- )
222
+ T.any(
223
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval,
224
+ Orb::Internal::AnyHash,
225
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval,
226
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval
227
+ )
200
228
  ],
201
229
  end_date: T.nilable(Time),
202
230
  fixed_fee_quantity_schedule: T::Array[T.any(Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule, Orb::Internal::AnyHash)],
@@ -205,12 +233,16 @@ module Orb
205
233
  metadata: T::Hash[Symbol, String],
206
234
  minimum_intervals: T::Array[T.any(Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval, Orb::Internal::AnyHash)],
207
235
  net_terms: Integer,
236
+ pending_subscription_change: T.nilable(
237
+ T.any(Orb::Models::SubscriptionUpdateTrialResponse::PendingSubscriptionChange, Orb::Internal::AnyHash)
238
+ ),
208
239
  plan: T.any(Orb::Models::Plan, Orb::Internal::AnyHash),
209
240
  price_intervals: T::Array[T.any(Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval, Orb::Internal::AnyHash)],
210
241
  redeemed_coupon: T.nilable(T.any(Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon, Orb::Internal::AnyHash)),
211
242
  start_date: Time,
212
243
  status: Orb::Models::SubscriptionUpdateTrialResponse::Status::OrSymbol,
213
- trial_info: T.any(Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo, Orb::Internal::AnyHash)
244
+ trial_info: T.any(Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo, Orb::Internal::AnyHash),
245
+ changed_resources: T.nilable(T.any(Orb::Models::SubscriptionUpdateTrialResponse::ChangedResources, Orb::Internal::AnyHash))
214
246
  )
215
247
  .returns(T.attached_class)
216
248
  end
@@ -234,15 +266,15 @@ module Orb
234
266
  metadata:,
235
267
  minimum_intervals:,
236
268
  net_terms:,
269
+ pending_subscription_change:,
237
270
  plan:,
238
271
  price_intervals:,
239
272
  redeemed_coupon:,
240
273
  start_date:,
241
274
  status:,
242
- trial_info:
243
- )
244
- end
245
-
275
+ trial_info:,
276
+ changed_resources: nil
277
+ ); end
246
278
  sig do
247
279
  override
248
280
  .returns(
@@ -259,11 +291,11 @@ module Orb
259
291
  customer: Orb::Models::Customer,
260
292
  default_invoice_memo: T.nilable(String),
261
293
  discount_intervals: T::Array[
262
- T.any(
263
- Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval,
264
- Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval,
265
- Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval
266
- )
294
+ T.any(
295
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval,
296
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval,
297
+ Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval
298
+ )
267
299
  ],
268
300
  end_date: T.nilable(Time),
269
301
  fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule],
@@ -272,17 +304,18 @@ module Orb
272
304
  metadata: T::Hash[Symbol, String],
273
305
  minimum_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval],
274
306
  net_terms: Integer,
307
+ pending_subscription_change: T.nilable(Orb::Models::SubscriptionUpdateTrialResponse::PendingSubscriptionChange),
275
308
  plan: Orb::Models::Plan,
276
309
  price_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval],
277
310
  redeemed_coupon: T.nilable(Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon),
278
311
  start_date: Time,
279
312
  status: Orb::Models::SubscriptionUpdateTrialResponse::Status::TaggedSymbol,
280
- trial_info: Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo
313
+ trial_info: Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo,
314
+ changed_resources: T.nilable(Orb::Models::SubscriptionUpdateTrialResponse::ChangedResources)
281
315
  }
282
316
  )
283
317
  end
284
- def to_hash
285
- end
318
+ def to_hash; end
286
319
 
287
320
  class AdjustmentInterval < Orb::Internal::Type::BaseModel
288
321
  sig { returns(String) }
@@ -330,8 +363,7 @@ module Orb
330
363
  )
331
364
  .returns(T.attached_class)
332
365
  end
333
- def self.new(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:)
334
- end
366
+ def self.new(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end
335
367
 
336
368
  sig do
337
369
  override
@@ -351,8 +383,7 @@ module Orb
351
383
  }
352
384
  )
353
385
  end
354
- def to_hash
355
- end
386
+ def to_hash; end
356
387
 
357
388
  module Adjustment
358
389
  extend Orb::Internal::Type::Union
@@ -369,7 +400,7 @@ module Orb
369
400
  attr_accessor :applies_to_price_ids
370
401
 
371
402
  # True for adjustments that apply to an entire invocice, false for adjustments
372
- # that apply to only one price.
403
+ # that apply to only one price.
373
404
  sig { returns(T::Boolean) }
374
405
  attr_accessor :is_invoice_level
375
406
 
@@ -382,7 +413,7 @@ module Orb
382
413
  attr_accessor :reason
383
414
 
384
415
  # The number of usage units by which to discount the price this adjustment applies
385
- # to in a given billing period.
416
+ # to in a given billing period.
386
417
  sig { returns(Float) }
387
418
  attr_accessor :usage_discount
388
419
 
@@ -406,9 +437,7 @@ module Orb
406
437
  reason:,
407
438
  usage_discount:,
408
439
  adjustment_type: :usage_discount
409
- )
410
- end
411
-
440
+ ); end
412
441
  sig do
413
442
  override
414
443
  .returns(
@@ -423,8 +452,7 @@ module Orb
423
452
  }
424
453
  )
425
454
  end
426
- def to_hash
427
- end
455
+ def to_hash; end
428
456
  end
429
457
 
430
458
  class PlanPhaseAmountDiscountAdjustment < Orb::Internal::Type::BaseModel
@@ -435,7 +463,7 @@ module Orb
435
463
  attr_accessor :adjustment_type
436
464
 
437
465
  # The amount by which to discount the prices this adjustment applies to in a given
438
- # billing period.
466
+ # billing period.
439
467
  sig { returns(String) }
440
468
  attr_accessor :amount_discount
441
469
 
@@ -444,7 +472,7 @@ module Orb
444
472
  attr_accessor :applies_to_price_ids
445
473
 
446
474
  # True for adjustments that apply to an entire invocice, false for adjustments
447
- # that apply to only one price.
475
+ # that apply to only one price.
448
476
  sig { returns(T::Boolean) }
449
477
  attr_accessor :is_invoice_level
450
478
 
@@ -476,9 +504,7 @@ module Orb
476
504
  plan_phase_order:,
477
505
  reason:,
478
506
  adjustment_type: :amount_discount
479
- )
480
- end
481
-
507
+ ); end
482
508
  sig do
483
509
  override
484
510
  .returns(
@@ -493,8 +519,7 @@ module Orb
493
519
  }
494
520
  )
495
521
  end
496
- def to_hash
497
- end
522
+ def to_hash; end
498
523
  end
499
524
 
500
525
  class PlanPhasePercentageDiscountAdjustment < Orb::Internal::Type::BaseModel
@@ -509,12 +534,12 @@ module Orb
509
534
  attr_accessor :applies_to_price_ids
510
535
 
511
536
  # True for adjustments that apply to an entire invocice, false for adjustments
512
- # that apply to only one price.
537
+ # that apply to only one price.
513
538
  sig { returns(T::Boolean) }
514
539
  attr_accessor :is_invoice_level
515
540
 
516
541
  # The percentage (as a value between 0 and 1) by which to discount the price
517
- # intervals this adjustment applies to in a given billing period.
542
+ # intervals this adjustment applies to in a given billing period.
518
543
  sig { returns(Float) }
519
544
  attr_accessor :percentage_discount
520
545
 
@@ -546,9 +571,7 @@ module Orb
546
571
  plan_phase_order:,
547
572
  reason:,
548
573
  adjustment_type: :percentage_discount
549
- )
550
- end
551
-
574
+ ); end
552
575
  sig do
553
576
  override
554
577
  .returns(
@@ -563,8 +586,7 @@ module Orb
563
586
  }
564
587
  )
565
588
  end
566
- def to_hash
567
- end
589
+ def to_hash; end
568
590
  end
569
591
 
570
592
  class PlanPhaseMinimumAdjustment < Orb::Internal::Type::BaseModel
@@ -579,7 +601,7 @@ module Orb
579
601
  attr_accessor :applies_to_price_ids
580
602
 
581
603
  # True for adjustments that apply to an entire invocice, false for adjustments
582
- # that apply to only one price.
604
+ # that apply to only one price.
583
605
  sig { returns(T::Boolean) }
584
606
  attr_accessor :is_invoice_level
585
607
 
@@ -588,7 +610,7 @@ module Orb
588
610
  attr_accessor :item_id
589
611
 
590
612
  # The minimum amount to charge in a given billing period for the prices this
591
- # adjustment applies to.
613
+ # adjustment applies to.
592
614
  sig { returns(String) }
593
615
  attr_accessor :minimum_amount
594
616
 
@@ -622,9 +644,7 @@ module Orb
622
644
  plan_phase_order:,
623
645
  reason:,
624
646
  adjustment_type: :minimum
625
- )
626
- end
627
-
647
+ ); end
628
648
  sig do
629
649
  override
630
650
  .returns(
@@ -640,8 +660,7 @@ module Orb
640
660
  }
641
661
  )
642
662
  end
643
- def to_hash
644
- end
663
+ def to_hash; end
645
664
  end
646
665
 
647
666
  class PlanPhaseMaximumAdjustment < Orb::Internal::Type::BaseModel
@@ -656,12 +675,12 @@ module Orb
656
675
  attr_accessor :applies_to_price_ids
657
676
 
658
677
  # True for adjustments that apply to an entire invocice, false for adjustments
659
- # that apply to only one price.
678
+ # that apply to only one price.
660
679
  sig { returns(T::Boolean) }
661
680
  attr_accessor :is_invoice_level
662
681
 
663
682
  # The maximum amount to charge in a given billing period for the prices this
664
- # adjustment applies to.
683
+ # adjustment applies to.
665
684
  sig { returns(String) }
666
685
  attr_accessor :maximum_amount
667
686
 
@@ -693,9 +712,7 @@ module Orb
693
712
  plan_phase_order:,
694
713
  reason:,
695
714
  adjustment_type: :maximum
696
- )
697
- end
698
-
715
+ ); end
699
716
  sig do
700
717
  override
701
718
  .returns(
@@ -710,8 +727,7 @@ module Orb
710
727
  }
711
728
  )
712
729
  end
713
- def to_hash
714
- end
730
+ def to_hash; end
715
731
  end
716
732
 
717
733
  sig do
@@ -720,39 +736,36 @@ module Orb
720
736
  [Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PlanPhaseUsageDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PlanPhaseAmountDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PlanPhasePercentageDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PlanPhaseMinimumAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PlanPhaseMaximumAdjustment]
721
737
  )
722
738
  end
723
- def self.variants
724
- end
739
+ def self.variants; end
725
740
  end
726
741
  end
727
742
 
728
743
  class BillingCycleAnchorConfiguration < Orb::Internal::Type::BaseModel
729
744
  # The day of the month on which the billing cycle is anchored. If the maximum
730
- # number of days in a month is greater than this value, the last day of the month
731
- # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
732
- # period begins on the 30th.
745
+ # number of days in a month is greater than this value, the last day of the month
746
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
747
+ # period begins on the 30th.
733
748
  sig { returns(Integer) }
734
749
  attr_accessor :day
735
750
 
736
751
  # The month on which the billing cycle is anchored (e.g. a quarterly price
737
- # anchored in February would have cycles starting February, May, August, and
738
- # November).
752
+ # anchored in February would have cycles starting February, May, August, and
753
+ # November).
739
754
  sig { returns(T.nilable(Integer)) }
740
755
  attr_accessor :month
741
756
 
742
757
  # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
743
- # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
758
+ # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
744
759
  sig { returns(T.nilable(Integer)) }
745
760
  attr_accessor :year
746
761
 
747
762
  sig do
748
763
  params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).returns(T.attached_class)
749
764
  end
750
- def self.new(day:, month: nil, year: nil)
751
- end
765
+ def self.new(day:, month: nil, year: nil); end
752
766
 
753
767
  sig { override.returns({day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)}) }
754
- def to_hash
755
- end
768
+ def to_hash; end
756
769
  end
757
770
 
758
771
  module DiscountInterval
@@ -800,9 +813,7 @@ module Orb
800
813
  end_date:,
801
814
  start_date:,
802
815
  discount_type: :amount
803
- )
804
- end
805
-
816
+ ); end
806
817
  sig do
807
818
  override
808
819
  .returns(
@@ -816,8 +827,7 @@ module Orb
816
827
  }
817
828
  )
818
829
  end
819
- def to_hash
820
- end
830
+ def to_hash; end
821
831
  end
822
832
 
823
833
  class PercentageDiscountInterval < Orb::Internal::Type::BaseModel
@@ -837,7 +847,7 @@ module Orb
837
847
  attr_accessor :end_date
838
848
 
839
849
  # Only available if discount_type is `percentage`.This is a number between 0
840
- # and 1.
850
+ # and 1.
841
851
  sig { returns(Float) }
842
852
  attr_accessor :percentage_discount
843
853
 
@@ -863,9 +873,7 @@ module Orb
863
873
  percentage_discount:,
864
874
  start_date:,
865
875
  discount_type: :percentage
866
- )
867
- end
868
-
876
+ ); end
869
877
  sig do
870
878
  override
871
879
  .returns(
@@ -879,8 +887,7 @@ module Orb
879
887
  }
880
888
  )
881
889
  end
882
- def to_hash
883
- end
890
+ def to_hash; end
884
891
  end
885
892
 
886
893
  class UsageDiscountInterval < Orb::Internal::Type::BaseModel
@@ -904,7 +911,7 @@ module Orb
904
911
  attr_accessor :start_date
905
912
 
906
913
  # Only available if discount_type is `usage`. Number of usage units that this
907
- # discount is for
914
+ # discount is for
908
915
  sig { returns(Float) }
909
916
  attr_accessor :usage_discount
910
917
 
@@ -926,9 +933,7 @@ module Orb
926
933
  start_date:,
927
934
  usage_discount:,
928
935
  discount_type: :usage
929
- )
930
- end
931
-
936
+ ); end
932
937
  sig do
933
938
  override
934
939
  .returns(
@@ -942,8 +947,7 @@ module Orb
942
947
  }
943
948
  )
944
949
  end
945
- def to_hash
946
- end
950
+ def to_hash; end
947
951
  end
948
952
 
949
953
  sig do
@@ -952,8 +956,7 @@ module Orb
952
956
  [Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval, Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval, Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval]
953
957
  )
954
958
  end
955
- def self.variants
956
- end
959
+ def self.variants; end
957
960
  end
958
961
 
959
962
  class FixedFeeQuantitySchedule < Orb::Internal::Type::BaseModel
@@ -973,14 +976,12 @@ module Orb
973
976
  params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time)
974
977
  .returns(T.attached_class)
975
978
  end
976
- def self.new(end_date:, price_id:, quantity:, start_date:)
977
- end
979
+ def self.new(end_date:, price_id:, quantity:, start_date:); end
978
980
 
979
981
  sig do
980
982
  override.returns({end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time})
981
983
  end
982
- def to_hash
983
- end
984
+ def to_hash; end
984
985
  end
985
986
 
986
987
  class MaximumInterval < Orb::Internal::Type::BaseModel
@@ -997,7 +998,7 @@ module Orb
997
998
  attr_accessor :end_date
998
999
 
999
1000
  # The maximum amount to charge in a given billing period for the price intervals
1000
- # this transform applies to.
1001
+ # this transform applies to.
1001
1002
  sig { returns(String) }
1002
1003
  attr_accessor :maximum_amount
1003
1004
 
@@ -1036,8 +1037,7 @@ module Orb
1036
1037
  }
1037
1038
  )
1038
1039
  end
1039
- def to_hash
1040
- end
1040
+ def to_hash; end
1041
1041
  end
1042
1042
 
1043
1043
  class MinimumInterval < Orb::Internal::Type::BaseModel
@@ -1054,7 +1054,7 @@ module Orb
1054
1054
  attr_accessor :end_date
1055
1055
 
1056
1056
  # The minimum amount to charge in a given billing period for the price intervals
1057
- # this minimum applies to.
1057
+ # this minimum applies to.
1058
1058
  sig { returns(String) }
1059
1059
  attr_accessor :minimum_amount
1060
1060
 
@@ -1093,8 +1093,19 @@ module Orb
1093
1093
  }
1094
1094
  )
1095
1095
  end
1096
- def to_hash
1097
- end
1096
+ def to_hash; end
1097
+ end
1098
+
1099
+ class PendingSubscriptionChange < Orb::Internal::Type::BaseModel
1100
+ sig { returns(String) }
1101
+ attr_accessor :id
1102
+
1103
+ # A pending subscription change if one exists on this subscription.
1104
+ sig { params(id: String).returns(T.attached_class) }
1105
+ def self.new(id:); end
1106
+
1107
+ sig { override.returns({id: String}) }
1108
+ def to_hash; end
1098
1109
  end
1099
1110
 
1100
1111
  class PriceInterval < Orb::Internal::Type::BaseModel
@@ -1106,19 +1117,19 @@ module Orb
1106
1117
  attr_accessor :billing_cycle_day
1107
1118
 
1108
1119
  # The end of the current billing period. This is an exclusive timestamp, such that
1109
- # the instant returned is exactly the end of the billing period. Set to null if
1110
- # this price interval is not currently active.
1120
+ # the instant returned is exactly the end of the billing period. Set to null if
1121
+ # this price interval is not currently active.
1111
1122
  sig { returns(T.nilable(Time)) }
1112
1123
  attr_accessor :current_billing_period_end_date
1113
1124
 
1114
1125
  # The start date of the current billing period. This is an inclusive timestamp;
1115
- # the instant returned is exactly the beginning of the billing period. Set to null
1116
- # if this price interval is not currently active.
1126
+ # the instant returned is exactly the beginning of the billing period. Set to null
1127
+ # if this price interval is not currently active.
1117
1128
  sig { returns(T.nilable(Time)) }
1118
1129
  attr_accessor :current_billing_period_start_date
1119
1130
 
1120
1131
  # The end date of the price interval. This is the date that Orb stops billing for
1121
- # this price.
1132
+ # this price.
1122
1133
  sig { returns(T.nilable(Time)) }
1123
1134
  attr_accessor :end_date
1124
1135
 
@@ -1127,7 +1138,7 @@ module Orb
1127
1138
  attr_accessor :filter
1128
1139
 
1129
1140
  # The fixed fee quantity transitions for this price interval. This is only
1130
- # relevant for fixed fees.
1141
+ # relevant for fixed fees.
1131
1142
  sig do
1132
1143
  returns(
1133
1144
  T.nilable(
@@ -1138,15 +1149,15 @@ module Orb
1138
1149
  attr_accessor :fixed_fee_quantity_transitions
1139
1150
 
1140
1151
  # The Price resource represents a price that can be billed on a subscription,
1141
- # resulting in a charge on an invoice in the form of an invoice line item. Prices
1142
- # take a quantity and determine an amount to bill.
1152
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
1153
+ # take a quantity and determine an amount to bill.
1143
1154
  #
1144
- # Orb supports a few different pricing models out of the box. Each of these models
1145
- # is serialized differently in a given Price object. The model_type field
1146
- # determines the key for the configuration object that is present.
1155
+ # Orb supports a few different pricing models out of the box. Each of these models
1156
+ # is serialized differently in a given Price object. The model_type field
1157
+ # determines the key for the configuration object that is present.
1147
1158
  #
1148
- # For more on the types of prices, see
1149
- # [the core concepts documentation](/core-concepts#plan-and-price)
1159
+ # For more on the types of prices, see
1160
+ # [the core concepts documentation](/core-concepts#plan-and-price)
1150
1161
  sig do
1151
1162
  returns(
1152
1163
  T.any(
@@ -1184,18 +1195,18 @@ module Orb
1184
1195
  attr_accessor :price
1185
1196
 
1186
1197
  # The start date of the price interval. This is the date that Orb starts billing
1187
- # for this price.
1198
+ # for this price.
1188
1199
  sig { returns(Time) }
1189
1200
  attr_accessor :start_date
1190
1201
 
1191
1202
  # A list of customer IDs whose usage events will be aggregated and billed under
1192
- # this price interval.
1203
+ # this price interval.
1193
1204
  sig { returns(T.nilable(T::Array[String])) }
1194
1205
  attr_accessor :usage_customer_ids
1195
1206
 
1196
1207
  # The Price Interval resource represents a period of time for which a price will
1197
- # bill on a subscription. A subscription’s price intervals define its billing
1198
- # behavior.
1208
+ # bill on a subscription. A subscription’s price intervals define its billing
1209
+ # behavior.
1199
1210
  sig do
1200
1211
  params(
1201
1212
  id: String,
@@ -1206,10 +1217,10 @@ module Orb
1206
1217
  filter: T.nilable(String),
1207
1218
  fixed_fee_quantity_transitions: T.nilable(
1208
1219
  T::Array[
1209
- T.any(
1210
- Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition,
1211
- Orb::Internal::AnyHash
1212
- )
1220
+ T.any(
1221
+ Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition,
1222
+ Orb::Internal::AnyHash
1223
+ )
1213
1224
  ]
1214
1225
  ),
1215
1226
  price: T.any(
@@ -1259,9 +1270,7 @@ module Orb
1259
1270
  price:,
1260
1271
  start_date:,
1261
1272
  usage_customer_ids:
1262
- )
1263
- end
1264
-
1273
+ ); end
1265
1274
  sig do
1266
1275
  override
1267
1276
  .returns(
@@ -1310,8 +1319,7 @@ module Orb
1310
1319
  }
1311
1320
  )
1312
1321
  end
1313
- def to_hash
1314
- end
1322
+ def to_hash; end
1315
1323
 
1316
1324
  class FixedFeeQuantityTransition < Orb::Internal::Type::BaseModel
1317
1325
  sig { returns(Time) }
@@ -1324,12 +1332,10 @@ module Orb
1324
1332
  attr_accessor :quantity
1325
1333
 
1326
1334
  sig { params(effective_date: Time, price_id: String, quantity: Integer).returns(T.attached_class) }
1327
- def self.new(effective_date:, price_id:, quantity:)
1328
- end
1335
+ def self.new(effective_date:, price_id:, quantity:); end
1329
1336
 
1330
1337
  sig { override.returns({effective_date: Time, price_id: String, quantity: Integer}) }
1331
- def to_hash
1332
- end
1338
+ def to_hash; end
1333
1339
  end
1334
1340
  end
1335
1341
 
@@ -1346,12 +1352,10 @@ module Orb
1346
1352
  sig do
1347
1353
  params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).returns(T.attached_class)
1348
1354
  end
1349
- def self.new(coupon_id:, end_date:, start_date:)
1350
- end
1355
+ def self.new(coupon_id:, end_date:, start_date:); end
1351
1356
 
1352
1357
  sig { override.returns({coupon_id: String, end_date: T.nilable(Time), start_date: Time}) }
1353
- def to_hash
1354
- end
1358
+ def to_hash; end
1355
1359
  end
1356
1360
 
1357
1361
  module Status
@@ -1366,8 +1370,7 @@ module Orb
1366
1370
  UPCOMING = T.let(:upcoming, Orb::Models::SubscriptionUpdateTrialResponse::Status::TaggedSymbol)
1367
1371
 
1368
1372
  sig { override.returns(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::Status::TaggedSymbol]) }
1369
- def self.values
1370
- end
1373
+ def self.values; end
1371
1374
  end
1372
1375
 
1373
1376
  class TrialInfo < Orb::Internal::Type::BaseModel
@@ -1375,12 +1378,55 @@ module Orb
1375
1378
  attr_accessor :end_date
1376
1379
 
1377
1380
  sig { params(end_date: T.nilable(Time)).returns(T.attached_class) }
1378
- def self.new(end_date:)
1379
- end
1381
+ def self.new(end_date:); end
1380
1382
 
1381
1383
  sig { override.returns({end_date: T.nilable(Time)}) }
1382
- def to_hash
1384
+ def to_hash; end
1385
+ end
1386
+
1387
+ class ChangedResources < Orb::Internal::Type::BaseModel
1388
+ # The credit notes that were created as part of this operation.
1389
+ sig { returns(T::Array[Orb::Models::CreditNote]) }
1390
+ attr_accessor :created_credit_notes
1391
+
1392
+ # The invoices that were created as part of this operation.
1393
+ sig { returns(T::Array[Orb::Models::Invoice]) }
1394
+ attr_accessor :created_invoices
1395
+
1396
+ # The credit notes that were voided as part of this operation.
1397
+ sig { returns(T::Array[Orb::Models::CreditNote]) }
1398
+ attr_accessor :voided_credit_notes
1399
+
1400
+ # The invoices that were voided as part of this operation.
1401
+ sig { returns(T::Array[Orb::Models::Invoice]) }
1402
+ attr_accessor :voided_invoices
1403
+
1404
+ # The resources that were changed as part of this operation. Only present when
1405
+ # fetched through the subscription changes API or if the
1406
+ # `include_changed_resources` parameter was passed in the request.
1407
+ sig do
1408
+ params(
1409
+ created_credit_notes: T::Array[T.any(Orb::Models::CreditNote, Orb::Internal::AnyHash)],
1410
+ created_invoices: T::Array[T.any(Orb::Models::Invoice, Orb::Internal::AnyHash)],
1411
+ voided_credit_notes: T::Array[T.any(Orb::Models::CreditNote, Orb::Internal::AnyHash)],
1412
+ voided_invoices: T::Array[T.any(Orb::Models::Invoice, Orb::Internal::AnyHash)]
1413
+ )
1414
+ .returns(T.attached_class)
1415
+ end
1416
+ def self.new(created_credit_notes:, created_invoices:, voided_credit_notes:, voided_invoices:); end
1417
+
1418
+ sig do
1419
+ override
1420
+ .returns(
1421
+ {
1422
+ created_credit_notes: T::Array[Orb::Models::CreditNote],
1423
+ created_invoices: T::Array[Orb::Models::Invoice],
1424
+ voided_credit_notes: T::Array[Orb::Models::CreditNote],
1425
+ voided_invoices: T::Array[Orb::Models::Invoice]
1426
+ }
1427
+ )
1383
1428
  end
1429
+ def to_hash; end
1384
1430
  end
1385
1431
  end
1386
1432
  end