orb-billing 0.1.0.pre.alpha.37 → 0.1.0.pre.alpha.39

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