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::Subscription::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
 
@@ -34,9 +34,9 @@ module Orb
34
34
  attr_writer :billing_cycle_anchor_configuration
35
35
 
36
36
  # The day of the month on which the billing cycle is anchored. If the maximum
37
- # number of days in a month is greater than this value, the last day of the month
38
- # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
39
- # period begins on the 30th.
37
+ # number of days in a month is greater than this value, the last day of the month
38
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
39
+ # period begins on the 30th.
40
40
  sig { returns(Integer) }
41
41
  attr_accessor :billing_cycle_day
42
42
 
@@ -44,35 +44,35 @@ module Orb
44
44
  attr_accessor :created_at
45
45
 
46
46
  # The end of the current billing period. This is an exclusive timestamp, such that
47
- # the instant returned is not part of the billing period. Set to null for
48
- # subscriptions that are not currently active.
47
+ # the instant returned is not part of the billing period. Set to null for
48
+ # subscriptions that are not currently active.
49
49
  sig { returns(T.nilable(Time)) }
50
50
  attr_accessor :current_billing_period_end_date
51
51
 
52
52
  # The start date of the current billing period. This is an inclusive timestamp;
53
- # the instant returned is exactly the beginning of the billing period. Set to null
54
- # if the subscription is not currently active.
53
+ # the instant returned is exactly the beginning of the billing period. Set to null
54
+ # if the subscription is not currently active.
55
55
  sig { returns(T.nilable(Time)) }
56
56
  attr_accessor :current_billing_period_start_date
57
57
 
58
58
  # A customer is a buyer of your products, and the other party to the billing
59
- # relationship.
59
+ # relationship.
60
60
  #
61
- # In Orb, customers are assigned system generated identifiers automatically, but
62
- # it's often desirable to have these match existing identifiers in your system. To
63
- # avoid having to denormalize Orb ID information, you can pass in an
64
- # `external_customer_id` with your own identifier. See
65
- # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
66
- # information about how these aliases work in Orb.
61
+ # In Orb, customers are assigned system generated identifiers automatically, but
62
+ # it's often desirable to have these match existing identifiers in your system. To
63
+ # avoid having to denormalize Orb ID information, you can pass in an
64
+ # `external_customer_id` with your own identifier. See
65
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
66
+ # information about how these aliases work in Orb.
67
67
  #
68
- # In addition to having an identifier in your system, a customer may exist in a
69
- # payment provider solution like Stripe. Use the `payment_provider_id` and the
70
- # `payment_provider` enum field to express this mapping.
68
+ # In addition to having an identifier in your system, a customer may exist in a
69
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
70
+ # `payment_provider` enum field to express this mapping.
71
71
  #
72
- # A customer also has a timezone (from the standard
73
- # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
74
- # your account's timezone. See [Timezone localization](/essentials/timezones) for
75
- # information on what this timezone parameter influences within Orb.
72
+ # A customer also has a timezone (from the standard
73
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
74
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
75
+ # information on what this timezone parameter influences within Orb.
76
76
  sig { returns(Orb::Models::Customer) }
77
77
  attr_reader :customer
78
78
 
@@ -80,7 +80,7 @@ module Orb
80
80
  attr_writer :customer
81
81
 
82
82
  # Determines the default memo on this subscriptions' invoices. Note that if this
83
- # is not provided, it is determined by the plan configuration.
83
+ # is not provided, it is determined by the plan configuration.
84
84
  sig { returns(T.nilable(String)) }
85
85
  attr_accessor :default_invoice_memo
86
86
 
@@ -88,11 +88,11 @@ module Orb
88
88
  sig do
89
89
  returns(
90
90
  T::Array[
91
- T.any(
92
- Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval,
93
- Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval,
94
- Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval
95
- )
91
+ T.any(
92
+ Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval,
93
+ Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval,
94
+ Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval
95
+ )
96
96
  ]
97
97
  )
98
98
  end
@@ -113,9 +113,9 @@ module Orb
113
113
  attr_accessor :maximum_intervals
114
114
 
115
115
  # User specified key-value pairs for the resource. If not present, this defaults
116
- # to an empty dictionary. Individual keys can be removed by setting the value to
117
- # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
118
- # `null`.
116
+ # to an empty dictionary. Individual keys can be removed by setting the value to
117
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
118
+ # `null`.
119
119
  sig { returns(T::Hash[Symbol, String]) }
120
120
  attr_accessor :metadata
121
121
 
@@ -124,16 +124,28 @@ module Orb
124
124
  attr_accessor :minimum_intervals
125
125
 
126
126
  # Determines the difference between the invoice issue date for subscription
127
- # invoices as the date that they are due. A value of `0` here represents that the
128
- # invoice is due on issue, whereas a value of `30` represents that the customer
129
- # has a month to pay the invoice.
127
+ # invoices as the date that they are due. A value of `0` here represents that the
128
+ # invoice is due on issue, whereas a value of `30` represents that the customer
129
+ # has a month to pay the invoice.
130
130
  sig { returns(Integer) }
131
131
  attr_accessor :net_terms
132
132
 
133
+ # A pending subscription change if one exists on this subscription.
134
+ sig { returns(T.nilable(Orb::Models::Subscription::PendingSubscriptionChange)) }
135
+ attr_reader :pending_subscription_change
136
+
137
+ sig do
138
+ params(
139
+ pending_subscription_change: T.nilable(T.any(Orb::Models::Subscription::PendingSubscriptionChange, Orb::Internal::AnyHash))
140
+ )
141
+ .void
142
+ end
143
+ attr_writer :pending_subscription_change
144
+
133
145
  # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
134
- # subscribed to by a customer. Plans define the billing behavior of the
135
- # subscription. You can see more about how to configure prices in the
136
- # [Price resource](/reference/price).
146
+ # subscribed to by a customer. Plans define the billing behavior of the
147
+ # subscription. You can see more about how to configure prices in the
148
+ # [Price resource](/reference/price).
137
149
  sig { returns(Orb::Models::Plan) }
138
150
  attr_reader :plan
139
151
 
@@ -169,24 +181,24 @@ module Orb
169
181
  attr_writer :trial_info
170
182
 
171
183
  # A [subscription](/core-concepts#subscription) represents the purchase of a plan
172
- # by a customer.
184
+ # by a customer.
173
185
  #
174
- # By default, subscriptions begin on the day that they're created and renew
175
- # automatically for each billing cycle at the cadence that's configured in the
176
- # plan definition.
186
+ # By default, subscriptions begin on the day that they're created and renew
187
+ # automatically for each billing cycle at the cadence that's configured in the
188
+ # plan definition.
177
189
  #
178
- # Subscriptions also default to **beginning of month alignment**, which means the
179
- # first invoice issued for the subscription will have pro-rated charges between
180
- # the `start_date` and the first of the following month. Subsequent billing
181
- # periods will always start and end on a month boundary (e.g. subsequent month
182
- # starts for monthly billing).
190
+ # Subscriptions also default to **beginning of month alignment**, which means the
191
+ # first invoice issued for the subscription will have pro-rated charges between
192
+ # the `start_date` and the first of the following month. Subsequent billing
193
+ # periods will always start and end on a month boundary (e.g. subsequent month
194
+ # starts for monthly billing).
183
195
  #
184
- # Depending on the plan configuration, any _flat_ recurring fees will be billed
185
- # either at the beginning (in-advance) or end (in-arrears) of each billing cycle.
186
- # Plans default to **in-advance billing**. Usage-based fees are billed in arrears
187
- # as usage is accumulated. In the normal course of events, you can expect an
188
- # invoice to contain usage-based charges for the previous period, and a recurring
189
- # fee for the following period.
196
+ # Depending on the plan configuration, any _flat_ recurring fees will be billed
197
+ # either at the beginning (in-advance) or end (in-arrears) of each billing cycle.
198
+ # Plans default to **in-advance billing**. Usage-based fees are billed in arrears
199
+ # as usage is accumulated. In the normal course of events, you can expect an
200
+ # invoice to contain usage-based charges for the previous period, and a recurring
201
+ # fee for the following period.
190
202
  sig do
191
203
  params(
192
204
  id: String,
@@ -201,12 +213,12 @@ module Orb
201
213
  customer: T.any(Orb::Models::Customer, Orb::Internal::AnyHash),
202
214
  default_invoice_memo: T.nilable(String),
203
215
  discount_intervals: T::Array[
204
- T.any(
205
- Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval,
206
- Orb::Internal::AnyHash,
207
- Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval,
208
- Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval
209
- )
216
+ T.any(
217
+ Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval,
218
+ Orb::Internal::AnyHash,
219
+ Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval,
220
+ Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval
221
+ )
210
222
  ],
211
223
  end_date: T.nilable(Time),
212
224
  fixed_fee_quantity_schedule: T::Array[T.any(Orb::Models::Subscription::FixedFeeQuantitySchedule, Orb::Internal::AnyHash)],
@@ -215,6 +227,7 @@ module Orb
215
227
  metadata: T::Hash[Symbol, String],
216
228
  minimum_intervals: T::Array[T.any(Orb::Models::Subscription::MinimumInterval, Orb::Internal::AnyHash)],
217
229
  net_terms: Integer,
230
+ pending_subscription_change: T.nilable(T.any(Orb::Models::Subscription::PendingSubscriptionChange, Orb::Internal::AnyHash)),
218
231
  plan: T.any(Orb::Models::Plan, Orb::Internal::AnyHash),
219
232
  price_intervals: T::Array[T.any(Orb::Models::Subscription::PriceInterval, Orb::Internal::AnyHash)],
220
233
  redeemed_coupon: T.nilable(T.any(Orb::Models::Subscription::RedeemedCoupon, Orb::Internal::AnyHash)),
@@ -244,15 +257,14 @@ module Orb
244
257
  metadata:,
245
258
  minimum_intervals:,
246
259
  net_terms:,
260
+ pending_subscription_change:,
247
261
  plan:,
248
262
  price_intervals:,
249
263
  redeemed_coupon:,
250
264
  start_date:,
251
265
  status:,
252
266
  trial_info:
253
- )
254
- end
255
-
267
+ ); end
256
268
  sig do
257
269
  override
258
270
  .returns(
@@ -269,11 +281,11 @@ module Orb
269
281
  customer: Orb::Models::Customer,
270
282
  default_invoice_memo: T.nilable(String),
271
283
  discount_intervals: T::Array[
272
- T.any(
273
- Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval,
274
- Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval,
275
- Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval
276
- )
284
+ T.any(
285
+ Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval,
286
+ Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval,
287
+ Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval
288
+ )
277
289
  ],
278
290
  end_date: T.nilable(Time),
279
291
  fixed_fee_quantity_schedule: T::Array[Orb::Models::Subscription::FixedFeeQuantitySchedule],
@@ -282,6 +294,7 @@ module Orb
282
294
  metadata: T::Hash[Symbol, String],
283
295
  minimum_intervals: T::Array[Orb::Models::Subscription::MinimumInterval],
284
296
  net_terms: Integer,
297
+ pending_subscription_change: T.nilable(Orb::Models::Subscription::PendingSubscriptionChange),
285
298
  plan: Orb::Models::Plan,
286
299
  price_intervals: T::Array[Orb::Models::Subscription::PriceInterval],
287
300
  redeemed_coupon: T.nilable(Orb::Models::Subscription::RedeemedCoupon),
@@ -291,8 +304,7 @@ module Orb
291
304
  }
292
305
  )
293
306
  end
294
- def to_hash
295
- end
307
+ def to_hash; end
296
308
 
297
309
  class AdjustmentInterval < Orb::Internal::Type::BaseModel
298
310
  sig { returns(String) }
@@ -340,8 +352,7 @@ module Orb
340
352
  )
341
353
  .returns(T.attached_class)
342
354
  end
343
- def self.new(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:)
344
- end
355
+ def self.new(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end
345
356
 
346
357
  sig do
347
358
  override
@@ -361,8 +372,7 @@ module Orb
361
372
  }
362
373
  )
363
374
  end
364
- def to_hash
365
- end
375
+ def to_hash; end
366
376
 
367
377
  module Adjustment
368
378
  extend Orb::Internal::Type::Union
@@ -379,7 +389,7 @@ module Orb
379
389
  attr_accessor :applies_to_price_ids
380
390
 
381
391
  # True for adjustments that apply to an entire invocice, false for adjustments
382
- # that apply to only one price.
392
+ # that apply to only one price.
383
393
  sig { returns(T::Boolean) }
384
394
  attr_accessor :is_invoice_level
385
395
 
@@ -392,7 +402,7 @@ module Orb
392
402
  attr_accessor :reason
393
403
 
394
404
  # The number of usage units by which to discount the price this adjustment applies
395
- # to in a given billing period.
405
+ # to in a given billing period.
396
406
  sig { returns(Float) }
397
407
  attr_accessor :usage_discount
398
408
 
@@ -416,9 +426,7 @@ module Orb
416
426
  reason:,
417
427
  usage_discount:,
418
428
  adjustment_type: :usage_discount
419
- )
420
- end
421
-
429
+ ); end
422
430
  sig do
423
431
  override
424
432
  .returns(
@@ -433,8 +441,7 @@ module Orb
433
441
  }
434
442
  )
435
443
  end
436
- def to_hash
437
- end
444
+ def to_hash; end
438
445
  end
439
446
 
440
447
  class PlanPhaseAmountDiscountAdjustment < Orb::Internal::Type::BaseModel
@@ -445,7 +452,7 @@ module Orb
445
452
  attr_accessor :adjustment_type
446
453
 
447
454
  # The amount by which to discount the prices this adjustment applies to in a given
448
- # billing period.
455
+ # billing period.
449
456
  sig { returns(String) }
450
457
  attr_accessor :amount_discount
451
458
 
@@ -454,7 +461,7 @@ module Orb
454
461
  attr_accessor :applies_to_price_ids
455
462
 
456
463
  # True for adjustments that apply to an entire invocice, false for adjustments
457
- # that apply to only one price.
464
+ # that apply to only one price.
458
465
  sig { returns(T::Boolean) }
459
466
  attr_accessor :is_invoice_level
460
467
 
@@ -486,9 +493,7 @@ module Orb
486
493
  plan_phase_order:,
487
494
  reason:,
488
495
  adjustment_type: :amount_discount
489
- )
490
- end
491
-
496
+ ); end
492
497
  sig do
493
498
  override
494
499
  .returns(
@@ -503,8 +508,7 @@ module Orb
503
508
  }
504
509
  )
505
510
  end
506
- def to_hash
507
- end
511
+ def to_hash; end
508
512
  end
509
513
 
510
514
  class PlanPhasePercentageDiscountAdjustment < Orb::Internal::Type::BaseModel
@@ -519,12 +523,12 @@ module Orb
519
523
  attr_accessor :applies_to_price_ids
520
524
 
521
525
  # True for adjustments that apply to an entire invocice, false for adjustments
522
- # that apply to only one price.
526
+ # that apply to only one price.
523
527
  sig { returns(T::Boolean) }
524
528
  attr_accessor :is_invoice_level
525
529
 
526
530
  # The percentage (as a value between 0 and 1) by which to discount the price
527
- # intervals this adjustment applies to in a given billing period.
531
+ # intervals this adjustment applies to in a given billing period.
528
532
  sig { returns(Float) }
529
533
  attr_accessor :percentage_discount
530
534
 
@@ -556,9 +560,7 @@ module Orb
556
560
  plan_phase_order:,
557
561
  reason:,
558
562
  adjustment_type: :percentage_discount
559
- )
560
- end
561
-
563
+ ); end
562
564
  sig do
563
565
  override
564
566
  .returns(
@@ -573,8 +575,7 @@ module Orb
573
575
  }
574
576
  )
575
577
  end
576
- def to_hash
577
- end
578
+ def to_hash; end
578
579
  end
579
580
 
580
581
  class PlanPhaseMinimumAdjustment < Orb::Internal::Type::BaseModel
@@ -589,7 +590,7 @@ module Orb
589
590
  attr_accessor :applies_to_price_ids
590
591
 
591
592
  # True for adjustments that apply to an entire invocice, false for adjustments
592
- # that apply to only one price.
593
+ # that apply to only one price.
593
594
  sig { returns(T::Boolean) }
594
595
  attr_accessor :is_invoice_level
595
596
 
@@ -598,7 +599,7 @@ module Orb
598
599
  attr_accessor :item_id
599
600
 
600
601
  # The minimum amount to charge in a given billing period for the prices this
601
- # adjustment applies to.
602
+ # adjustment applies to.
602
603
  sig { returns(String) }
603
604
  attr_accessor :minimum_amount
604
605
 
@@ -632,9 +633,7 @@ module Orb
632
633
  plan_phase_order:,
633
634
  reason:,
634
635
  adjustment_type: :minimum
635
- )
636
- end
637
-
636
+ ); end
638
637
  sig do
639
638
  override
640
639
  .returns(
@@ -650,8 +649,7 @@ module Orb
650
649
  }
651
650
  )
652
651
  end
653
- def to_hash
654
- end
652
+ def to_hash; end
655
653
  end
656
654
 
657
655
  class PlanPhaseMaximumAdjustment < Orb::Internal::Type::BaseModel
@@ -666,12 +664,12 @@ module Orb
666
664
  attr_accessor :applies_to_price_ids
667
665
 
668
666
  # True for adjustments that apply to an entire invocice, false for adjustments
669
- # that apply to only one price.
667
+ # that apply to only one price.
670
668
  sig { returns(T::Boolean) }
671
669
  attr_accessor :is_invoice_level
672
670
 
673
671
  # The maximum amount to charge in a given billing period for the prices this
674
- # adjustment applies to.
672
+ # adjustment applies to.
675
673
  sig { returns(String) }
676
674
  attr_accessor :maximum_amount
677
675
 
@@ -703,9 +701,7 @@ module Orb
703
701
  plan_phase_order:,
704
702
  reason:,
705
703
  adjustment_type: :maximum
706
- )
707
- end
708
-
704
+ ); end
709
705
  sig do
710
706
  override
711
707
  .returns(
@@ -720,8 +716,7 @@ module Orb
720
716
  }
721
717
  )
722
718
  end
723
- def to_hash
724
- end
719
+ def to_hash; end
725
720
  end
726
721
 
727
722
  sig do
@@ -730,39 +725,36 @@ module Orb
730
725
  [Orb::Models::Subscription::AdjustmentInterval::Adjustment::PlanPhaseUsageDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PlanPhaseAmountDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PlanPhasePercentageDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMinimumAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMaximumAdjustment]
731
726
  )
732
727
  end
733
- def self.variants
734
- end
728
+ def self.variants; end
735
729
  end
736
730
  end
737
731
 
738
732
  class BillingCycleAnchorConfiguration < Orb::Internal::Type::BaseModel
739
733
  # The day of the month on which the billing cycle is anchored. If the maximum
740
- # number of days in a month is greater than this value, the last day of the month
741
- # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
742
- # period begins on the 30th.
734
+ # number of days in a month is greater than this value, the last day of the month
735
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
736
+ # period begins on the 30th.
743
737
  sig { returns(Integer) }
744
738
  attr_accessor :day
745
739
 
746
740
  # The month on which the billing cycle is anchored (e.g. a quarterly price
747
- # anchored in February would have cycles starting February, May, August, and
748
- # November).
741
+ # anchored in February would have cycles starting February, May, August, and
742
+ # November).
749
743
  sig { returns(T.nilable(Integer)) }
750
744
  attr_accessor :month
751
745
 
752
746
  # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
753
- # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
747
+ # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
754
748
  sig { returns(T.nilable(Integer)) }
755
749
  attr_accessor :year
756
750
 
757
751
  sig do
758
752
  params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).returns(T.attached_class)
759
753
  end
760
- def self.new(day:, month: nil, year: nil)
761
- end
754
+ def self.new(day:, month: nil, year: nil); end
762
755
 
763
756
  sig { override.returns({day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)}) }
764
- def to_hash
765
- end
757
+ def to_hash; end
766
758
  end
767
759
 
768
760
  module DiscountInterval
@@ -810,9 +802,7 @@ module Orb
810
802
  end_date:,
811
803
  start_date:,
812
804
  discount_type: :amount
813
- )
814
- end
815
-
805
+ ); end
816
806
  sig do
817
807
  override
818
808
  .returns(
@@ -826,8 +816,7 @@ module Orb
826
816
  }
827
817
  )
828
818
  end
829
- def to_hash
830
- end
819
+ def to_hash; end
831
820
  end
832
821
 
833
822
  class PercentageDiscountInterval < Orb::Internal::Type::BaseModel
@@ -847,7 +836,7 @@ module Orb
847
836
  attr_accessor :end_date
848
837
 
849
838
  # Only available if discount_type is `percentage`.This is a number between 0
850
- # and 1.
839
+ # and 1.
851
840
  sig { returns(Float) }
852
841
  attr_accessor :percentage_discount
853
842
 
@@ -873,9 +862,7 @@ module Orb
873
862
  percentage_discount:,
874
863
  start_date:,
875
864
  discount_type: :percentage
876
- )
877
- end
878
-
865
+ ); end
879
866
  sig do
880
867
  override
881
868
  .returns(
@@ -889,8 +876,7 @@ module Orb
889
876
  }
890
877
  )
891
878
  end
892
- def to_hash
893
- end
879
+ def to_hash; end
894
880
  end
895
881
 
896
882
  class UsageDiscountInterval < Orb::Internal::Type::BaseModel
@@ -914,7 +900,7 @@ module Orb
914
900
  attr_accessor :start_date
915
901
 
916
902
  # Only available if discount_type is `usage`. Number of usage units that this
917
- # discount is for
903
+ # discount is for
918
904
  sig { returns(Float) }
919
905
  attr_accessor :usage_discount
920
906
 
@@ -936,9 +922,7 @@ module Orb
936
922
  start_date:,
937
923
  usage_discount:,
938
924
  discount_type: :usage
939
- )
940
- end
941
-
925
+ ); end
942
926
  sig do
943
927
  override
944
928
  .returns(
@@ -952,8 +936,7 @@ module Orb
952
936
  }
953
937
  )
954
938
  end
955
- def to_hash
956
- end
939
+ def to_hash; end
957
940
  end
958
941
 
959
942
  sig do
@@ -962,8 +945,7 @@ module Orb
962
945
  [Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval, Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval, Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval]
963
946
  )
964
947
  end
965
- def self.variants
966
- end
948
+ def self.variants; end
967
949
  end
968
950
 
969
951
  class FixedFeeQuantitySchedule < Orb::Internal::Type::BaseModel
@@ -983,14 +965,12 @@ module Orb
983
965
  params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time)
984
966
  .returns(T.attached_class)
985
967
  end
986
- def self.new(end_date:, price_id:, quantity:, start_date:)
987
- end
968
+ def self.new(end_date:, price_id:, quantity:, start_date:); end
988
969
 
989
970
  sig do
990
971
  override.returns({end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time})
991
972
  end
992
- def to_hash
993
- end
973
+ def to_hash; end
994
974
  end
995
975
 
996
976
  class MaximumInterval < Orb::Internal::Type::BaseModel
@@ -1007,7 +987,7 @@ module Orb
1007
987
  attr_accessor :end_date
1008
988
 
1009
989
  # The maximum amount to charge in a given billing period for the price intervals
1010
- # this transform applies to.
990
+ # this transform applies to.
1011
991
  sig { returns(String) }
1012
992
  attr_accessor :maximum_amount
1013
993
 
@@ -1046,8 +1026,7 @@ module Orb
1046
1026
  }
1047
1027
  )
1048
1028
  end
1049
- def to_hash
1050
- end
1029
+ def to_hash; end
1051
1030
  end
1052
1031
 
1053
1032
  class MinimumInterval < Orb::Internal::Type::BaseModel
@@ -1064,7 +1043,7 @@ module Orb
1064
1043
  attr_accessor :end_date
1065
1044
 
1066
1045
  # The minimum amount to charge in a given billing period for the price intervals
1067
- # this minimum applies to.
1046
+ # this minimum applies to.
1068
1047
  sig { returns(String) }
1069
1048
  attr_accessor :minimum_amount
1070
1049
 
@@ -1103,8 +1082,19 @@ module Orb
1103
1082
  }
1104
1083
  )
1105
1084
  end
1106
- def to_hash
1107
- end
1085
+ def to_hash; end
1086
+ end
1087
+
1088
+ class PendingSubscriptionChange < Orb::Internal::Type::BaseModel
1089
+ sig { returns(String) }
1090
+ attr_accessor :id
1091
+
1092
+ # A pending subscription change if one exists on this subscription.
1093
+ sig { params(id: String).returns(T.attached_class) }
1094
+ def self.new(id:); end
1095
+
1096
+ sig { override.returns({id: String}) }
1097
+ def to_hash; end
1108
1098
  end
1109
1099
 
1110
1100
  class PriceInterval < Orb::Internal::Type::BaseModel
@@ -1116,19 +1106,19 @@ module Orb
1116
1106
  attr_accessor :billing_cycle_day
1117
1107
 
1118
1108
  # The end of the current billing period. This is an exclusive timestamp, such that
1119
- # the instant returned is exactly the end of the billing period. Set to null if
1120
- # this price interval is not currently active.
1109
+ # the instant returned is exactly the end of the billing period. Set to null if
1110
+ # this price interval is not currently active.
1121
1111
  sig { returns(T.nilable(Time)) }
1122
1112
  attr_accessor :current_billing_period_end_date
1123
1113
 
1124
1114
  # The start date of the current billing period. This is an inclusive timestamp;
1125
- # the instant returned is exactly the beginning of the billing period. Set to null
1126
- # if this price interval is not currently active.
1115
+ # the instant returned is exactly the beginning of the billing period. Set to null
1116
+ # if this price interval is not currently active.
1127
1117
  sig { returns(T.nilable(Time)) }
1128
1118
  attr_accessor :current_billing_period_start_date
1129
1119
 
1130
1120
  # The end date of the price interval. This is the date that Orb stops billing for
1131
- # this price.
1121
+ # this price.
1132
1122
  sig { returns(T.nilable(Time)) }
1133
1123
  attr_accessor :end_date
1134
1124
 
@@ -1137,20 +1127,20 @@ module Orb
1137
1127
  attr_accessor :filter
1138
1128
 
1139
1129
  # The fixed fee quantity transitions for this price interval. This is only
1140
- # relevant for fixed fees.
1130
+ # relevant for fixed fees.
1141
1131
  sig { returns(T.nilable(T::Array[Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition])) }
1142
1132
  attr_accessor :fixed_fee_quantity_transitions
1143
1133
 
1144
1134
  # The Price resource represents a price that can be billed on a subscription,
1145
- # resulting in a charge on an invoice in the form of an invoice line item. Prices
1146
- # take a quantity and determine an amount to bill.
1135
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
1136
+ # take a quantity and determine an amount to bill.
1147
1137
  #
1148
- # Orb supports a few different pricing models out of the box. Each of these models
1149
- # is serialized differently in a given Price object. The model_type field
1150
- # determines the key for the configuration object that is present.
1138
+ # Orb supports a few different pricing models out of the box. Each of these models
1139
+ # is serialized differently in a given Price object. The model_type field
1140
+ # determines the key for the configuration object that is present.
1151
1141
  #
1152
- # For more on the types of prices, see
1153
- # [the core concepts documentation](/core-concepts#plan-and-price)
1142
+ # For more on the types of prices, see
1143
+ # [the core concepts documentation](/core-concepts#plan-and-price)
1154
1144
  sig do
1155
1145
  returns(
1156
1146
  T.any(
@@ -1188,18 +1178,18 @@ module Orb
1188
1178
  attr_accessor :price
1189
1179
 
1190
1180
  # The start date of the price interval. This is the date that Orb starts billing
1191
- # for this price.
1181
+ # for this price.
1192
1182
  sig { returns(Time) }
1193
1183
  attr_accessor :start_date
1194
1184
 
1195
1185
  # A list of customer IDs whose usage events will be aggregated and billed under
1196
- # this price interval.
1186
+ # this price interval.
1197
1187
  sig { returns(T.nilable(T::Array[String])) }
1198
1188
  attr_accessor :usage_customer_ids
1199
1189
 
1200
1190
  # The Price Interval resource represents a period of time for which a price will
1201
- # bill on a subscription. A subscription’s price intervals define its billing
1202
- # behavior.
1191
+ # bill on a subscription. A subscription’s price intervals define its billing
1192
+ # behavior.
1203
1193
  sig do
1204
1194
  params(
1205
1195
  id: String,
@@ -1258,9 +1248,7 @@ module Orb
1258
1248
  price:,
1259
1249
  start_date:,
1260
1250
  usage_customer_ids:
1261
- )
1262
- end
1263
-
1251
+ ); end
1264
1252
  sig do
1265
1253
  override
1266
1254
  .returns(
@@ -1307,8 +1295,7 @@ module Orb
1307
1295
  }
1308
1296
  )
1309
1297
  end
1310
- def to_hash
1311
- end
1298
+ def to_hash; end
1312
1299
 
1313
1300
  class FixedFeeQuantityTransition < Orb::Internal::Type::BaseModel
1314
1301
  sig { returns(Time) }
@@ -1321,12 +1308,10 @@ module Orb
1321
1308
  attr_accessor :quantity
1322
1309
 
1323
1310
  sig { params(effective_date: Time, price_id: String, quantity: Integer).returns(T.attached_class) }
1324
- def self.new(effective_date:, price_id:, quantity:)
1325
- end
1311
+ def self.new(effective_date:, price_id:, quantity:); end
1326
1312
 
1327
1313
  sig { override.returns({effective_date: Time, price_id: String, quantity: Integer}) }
1328
- def to_hash
1329
- end
1314
+ def to_hash; end
1330
1315
  end
1331
1316
  end
1332
1317
 
@@ -1343,12 +1328,10 @@ module Orb
1343
1328
  sig do
1344
1329
  params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).returns(T.attached_class)
1345
1330
  end
1346
- def self.new(coupon_id:, end_date:, start_date:)
1347
- end
1331
+ def self.new(coupon_id:, end_date:, start_date:); end
1348
1332
 
1349
1333
  sig { override.returns({coupon_id: String, end_date: T.nilable(Time), start_date: Time}) }
1350
- def to_hash
1351
- end
1334
+ def to_hash; end
1352
1335
  end
1353
1336
 
1354
1337
  module Status
@@ -1362,8 +1345,7 @@ module Orb
1362
1345
  UPCOMING = T.let(:upcoming, Orb::Models::Subscription::Status::TaggedSymbol)
1363
1346
 
1364
1347
  sig { override.returns(T::Array[Orb::Models::Subscription::Status::TaggedSymbol]) }
1365
- def self.values
1366
- end
1348
+ def self.values; end
1367
1349
  end
1368
1350
 
1369
1351
  class TrialInfo < Orb::Internal::Type::BaseModel
@@ -1371,12 +1353,10 @@ module Orb
1371
1353
  attr_accessor :end_date
1372
1354
 
1373
1355
  sig { params(end_date: T.nilable(Time)).returns(T.attached_class) }
1374
- def self.new(end_date:)
1375
- end
1356
+ def self.new(end_date:); end
1376
1357
 
1377
1358
  sig { override.returns({end_date: T.nilable(Time)}) }
1378
- def to_hash
1379
- end
1359
+ def to_hash; end
1380
1360
  end
1381
1361
  end
1382
1362
  end