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
@@ -34,10 +34,10 @@ module Orb
34
34
  end
35
35
 
36
36
  # This endpoint allows you to update the `metadata` property on an invoice. If you
37
- # pass null for the metadata value, it will clear any existing metadata for that
38
- # invoice.
37
+ # pass null for the metadata value, it will clear any existing metadata for that
38
+ # invoice.
39
39
  #
40
- # `metadata` can be modified regardless of invoice state.
40
+ # `metadata` can be modified regardless of invoice state.
41
41
  #
42
42
  # @overload update(invoice_id, metadata: nil, request_options: {})
43
43
  #
@@ -60,18 +60,18 @@ module Orb
60
60
  end
61
61
 
62
62
  # This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an
63
- # account in a list format.
63
+ # account in a list format.
64
64
  #
65
- # The list of invoices is ordered starting from the most recently issued invoice
66
- # date. The response also includes
67
- # [`pagination_metadata`](/api-reference/pagination), which lets the caller
68
- # retrieve the next page of results if they exist.
65
+ # The list of invoices is ordered starting from the most recently issued invoice
66
+ # date. The response also includes
67
+ # [`pagination_metadata`](/api-reference/pagination), which lets the caller
68
+ # retrieve the next page of results if they exist.
69
69
  #
70
- # By default, this only returns invoices that are `issued`, `paid`, or `synced`.
70
+ # By default, this only returns invoices that are `issued`, `paid`, or `synced`.
71
71
  #
72
- # When fetching any `draft` invoices, this returns the last-computed invoice
73
- # values for each draft invoice, which may not always be up-to-date since Orb
74
- # regularly refreshes invoices asynchronously.
72
+ # When fetching any `draft` invoices, this returns the last-computed invoice
73
+ # values for each draft invoice, which may not always be up-to-date since Orb
74
+ # regularly refreshes invoices asynchronously.
75
75
  #
76
76
  # @overload list(amount: nil, amount_gt: nil, amount_lt: nil, cursor: nil, customer_id: nil, date_type: nil, due_date: nil, due_date_window: nil, due_date_gt: nil, due_date_lt: nil, external_customer_id: nil, invoice_date_gt: nil, invoice_date_gte: nil, invoice_date_lt: nil, invoice_date_lte: nil, is_recurring: nil, limit: nil, status: nil, subscription_id: nil, request_options: {})
77
77
  #
@@ -104,7 +104,16 @@ module Orb
104
104
  @client.request(
105
105
  method: :get,
106
106
  path: "invoices",
107
- query: parsed,
107
+ query: parsed.transform_keys(
108
+ amount_gt: "amount[gt]",
109
+ amount_lt: "amount[lt]",
110
+ due_date_gt: "due_date[gt]",
111
+ due_date_lt: "due_date[lt]",
112
+ invoice_date_gt: "invoice_date[gt]",
113
+ invoice_date_gte: "invoice_date[gte]",
114
+ invoice_date_lt: "invoice_date[lt]",
115
+ invoice_date_lte: "invoice_date[lte]"
116
+ ),
108
117
  page: Orb::Internal::Page,
109
118
  model: Orb::Models::Invoice,
110
119
  options: options
@@ -112,7 +121,7 @@ module Orb
112
121
  end
113
122
 
114
123
  # This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an
115
- # identifier.
124
+ # identifier.
116
125
  #
117
126
  # @overload fetch(invoice_id, request_options: {})
118
127
  #
@@ -132,8 +141,8 @@ module Orb
132
141
  end
133
142
 
134
143
  # This endpoint can be used to fetch the upcoming
135
- # [invoice](/core-concepts#invoice) for the current billing period given a
136
- # subscription.
144
+ # [invoice](/core-concepts#invoice) for the current billing period given a
145
+ # subscription.
137
146
  #
138
147
  # @overload fetch_upcoming(subscription_id:, request_options: {})
139
148
  #
@@ -155,11 +164,11 @@ module Orb
155
164
  end
156
165
 
157
166
  # This endpoint allows an eligible invoice to be issued manually. This is only
158
- # possible with invoices where status is `draft`, `will_auto_issue` is false, and
159
- # an `eligible_to_issue_at` is a time in the past. Issuing an invoice could
160
- # possibly trigger side effects, some of which could be customer-visible (e.g.
161
- # sending emails, auto-collecting payment, syncing the invoice to external
162
- # providers, etc).
167
+ # possible with invoices where status is `draft`, `will_auto_issue` is false, and
168
+ # an `eligible_to_issue_at` is a time in the past. Issuing an invoice could
169
+ # possibly trigger side effects, some of which could be customer-visible (e.g.
170
+ # sending emails, auto-collecting payment, syncing the invoice to external
171
+ # providers, etc).
163
172
  #
164
173
  # @overload issue(invoice_id, synchronous: nil, request_options: {})
165
174
  #
@@ -182,7 +191,7 @@ module Orb
182
191
  end
183
192
 
184
193
  # This endpoint allows an invoice's status to be set the `paid` status. This can
185
- # only be done to invoices that are in the `issued` status.
194
+ # only be done to invoices that are in the `issued` status.
186
195
  #
187
196
  # @overload mark_paid(invoice_id, payment_received_date:, external_id: nil, notes: nil, request_options: {})
188
197
  #
@@ -207,7 +216,7 @@ module Orb
207
216
  end
208
217
 
209
218
  # This endpoint collects payment for an invoice using the customer's default
210
- # payment method. This action can only be taken on invoices with status "issued".
219
+ # payment method. This action can only be taken on invoices with status "issued".
211
220
  #
212
221
  # @overload pay(invoice_id, request_options: {})
213
222
  #
@@ -227,16 +236,16 @@ module Orb
227
236
  end
228
237
 
229
238
  # This endpoint allows an invoice's status to be set the `void` status. This can
230
- # only be done to invoices that are in the `issued` status.
239
+ # only be done to invoices that are in the `issued` status.
231
240
  #
232
- # If the associated invoice has used the customer balance to change the amount
233
- # due, the customer balance operation will be reverted. For example, if the
234
- # invoice used $10 of customer balance, that amount will be added back to the
235
- # customer balance upon voiding.
241
+ # If the associated invoice has used the customer balance to change the amount
242
+ # due, the customer balance operation will be reverted. For example, if the
243
+ # invoice used $10 of customer balance, that amount will be added back to the
244
+ # customer balance upon voiding.
236
245
  #
237
- # If the invoice was used to purchase a credit block, but the invoice is not yet
238
- # paid, the credit block will be voided. If the invoice was created due to a
239
- # top-up, the top-up will be disabled.
246
+ # If the invoice was used to purchase a credit block, but the invoice is not yet
247
+ # paid, the credit block will be voided. If the invoice was created due to a
248
+ # top-up, the top-up will be disabled.
240
249
  #
241
250
  # @overload void(invoice_id, request_options: {})
242
251
  #
@@ -42,7 +42,7 @@ module Orb
42
42
  end
43
43
 
44
44
  # This endpoint returns a list of all Items, ordered in descending order by
45
- # creation time.
45
+ # creation time.
46
46
  #
47
47
  # @overload list(cursor: nil, limit: nil, request_options: {})
48
48
  #
@@ -4,8 +4,8 @@ module Orb
4
4
  module Resources
5
5
  class Metrics
6
6
  # This endpoint is used to create a [metric](/core-concepts###metric) using a SQL
7
- # string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a
8
- # description of constructing SQL queries with examples.
7
+ # string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a
8
+ # description of constructing SQL queries with examples.
9
9
  #
10
10
  # @overload create(description:, item_id:, name:, sql:, metadata: nil, request_options: {})
11
11
  #
@@ -31,8 +31,8 @@ module Orb
31
31
  end
32
32
 
33
33
  # This endpoint allows you to update the `metadata` property on a metric. If you
34
- # pass `null` for the metadata value, it will clear any existing metadata for that
35
- # invoice.
34
+ # pass `null` for the metadata value, it will clear any existing metadata for that
35
+ # invoice.
36
36
  #
37
37
  # @overload update(metric_id, metadata: nil, request_options: {})
38
38
  #
@@ -55,8 +55,8 @@ module Orb
55
55
  end
56
56
 
57
57
  # This endpoint is used to fetch [metric](/core-concepts##metric) details given a
58
- # metric identifier. It returns information about the metrics including its name,
59
- # description, and item.
58
+ # metric identifier. It returns information about the metrics including its name,
59
+ # description, and item.
60
60
  #
61
61
  # @overload list(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, limit: nil, request_options: {})
62
62
  #
@@ -76,7 +76,12 @@ module Orb
76
76
  @client.request(
77
77
  method: :get,
78
78
  path: "metrics",
79
- query: parsed,
79
+ query: parsed.transform_keys(
80
+ created_at_gt: "created_at[gt]",
81
+ created_at_gte: "created_at[gte]",
82
+ created_at_lt: "created_at[lt]",
83
+ created_at_lte: "created_at[lte]"
84
+ ),
80
85
  page: Orb::Internal::Page,
81
86
  model: Orb::Models::BillableMetric,
82
87
  options: options
@@ -84,7 +89,7 @@ module Orb
84
89
  end
85
90
 
86
91
  # This endpoint is used to list [metrics](/core-concepts#metric). It returns
87
- # information about the metrics including its name, description, and item.
92
+ # information about the metrics including its name, description, and item.
88
93
  #
89
94
  # @overload fetch(metric_id, request_options: {})
90
95
  #
@@ -5,9 +5,9 @@ module Orb
5
5
  class Plans
6
6
  class ExternalPlanID
7
7
  # This endpoint can be used to update the `external_plan_id`, and `metadata` of an
8
- # existing plan.
8
+ # existing plan.
9
9
  #
10
- # Other fields on a customer are currently immutable.
10
+ # Other fields on a customer are currently immutable.
11
11
  #
12
12
  # @overload update(other_external_plan_id, external_plan_id: nil, metadata: nil, request_options: {})
13
13
  #
@@ -31,21 +31,21 @@ module Orb
31
31
  end
32
32
 
33
33
  # This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details
34
- # given an external_plan_id identifier. It returns information about the prices
35
- # included in the plan and their configuration, as well as the product that the
36
- # plan is attached to.
34
+ # given an external_plan_id identifier. It returns information about the prices
35
+ # included in the plan and their configuration, as well as the product that the
36
+ # plan is attached to.
37
37
  #
38
- # If multiple plans are found to contain the specified external_plan_id, the
39
- # active plans will take priority over archived ones, and among those, the
40
- # endpoint will return the most recently created plan.
38
+ # If multiple plans are found to contain the specified external_plan_id, the
39
+ # active plans will take priority over archived ones, and among those, the
40
+ # endpoint will return the most recently created plan.
41
41
  #
42
- # ## Serialized prices
42
+ # ## Serialized prices
43
43
  #
44
- # Orb supports a few different pricing models out of the box. Each of these models
45
- # is serialized differently in a given [Price](/core-concepts#plan-and-price)
46
- # object. The `model_type` field determines the key for the configuration object
47
- # that is present. A detailed explanation of price types can be found in the
48
- # [Price schema](/core-concepts#plan-and-price). "
44
+ # Orb supports a few different pricing models out of the box. Each of these models
45
+ # is serialized differently in a given [Price](/core-concepts#plan-and-price)
46
+ # object. The `model_type` field determines the key for the configuration object
47
+ # that is present. A detailed explanation of price types can be found in the
48
+ # [Price schema](/core-concepts#plan-and-price). "
49
49
  #
50
50
  # @overload fetch(external_plan_id, request_options: {})
51
51
  #
@@ -29,9 +29,9 @@ module Orb
29
29
  end
30
30
 
31
31
  # This endpoint can be used to update the `external_plan_id`, and `metadata` of an
32
- # existing plan.
32
+ # existing plan.
33
33
  #
34
- # Other fields on a customer are currently immutable.
34
+ # Other fields on a customer are currently immutable.
35
35
  #
36
36
  # @overload update(plan_id, external_plan_id: nil, metadata: nil, request_options: {})
37
37
  #
@@ -55,10 +55,10 @@ module Orb
55
55
  end
56
56
 
57
57
  # This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for
58
- # an account in a list format. The list of plans is ordered starting from the most
59
- # recently created plan. The response also includes
60
- # [`pagination_metadata`](/api-reference/pagination), which lets the caller
61
- # retrieve the next page of results if they exist.
58
+ # an account in a list format. The list of plans is ordered starting from the most
59
+ # recently created plan. The response also includes
60
+ # [`pagination_metadata`](/api-reference/pagination), which lets the caller
61
+ # retrieve the next page of results if they exist.
62
62
  #
63
63
  # @overload list(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, limit: nil, status: nil, request_options: {})
64
64
  #
@@ -79,7 +79,12 @@ module Orb
79
79
  @client.request(
80
80
  method: :get,
81
81
  path: "plans",
82
- query: parsed,
82
+ query: parsed.transform_keys(
83
+ created_at_gt: "created_at[gt]",
84
+ created_at_gte: "created_at[gte]",
85
+ created_at_lt: "created_at[lt]",
86
+ created_at_lte: "created_at[lte]"
87
+ ),
83
88
  page: Orb::Internal::Page,
84
89
  model: Orb::Models::Plan,
85
90
  options: options
@@ -87,22 +92,22 @@ module Orb
87
92
  end
88
93
 
89
94
  # This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details
90
- # given a plan identifier. It returns information about the prices included in the
91
- # plan and their configuration, as well as the product that the plan is attached
92
- # to.
95
+ # given a plan identifier. It returns information about the prices included in the
96
+ # plan and their configuration, as well as the product that the plan is attached
97
+ # to.
93
98
  #
94
- # ## Serialized prices
99
+ # ## Serialized prices
95
100
  #
96
- # Orb supports a few different pricing models out of the box. Each of these models
97
- # is serialized differently in a given [Price](/core-concepts#plan-and-price)
98
- # object. The `model_type` field determines the key for the configuration object
99
- # that is present. A detailed explanation of price types can be found in the
100
- # [Price schema](/core-concepts#plan-and-price).
101
+ # Orb supports a few different pricing models out of the box. Each of these models
102
+ # is serialized differently in a given [Price](/core-concepts#plan-and-price)
103
+ # object. The `model_type` field determines the key for the configuration object
104
+ # that is present. A detailed explanation of price types can be found in the
105
+ # [Price schema](/core-concepts#plan-and-price).
101
106
  #
102
- # ## Phases
107
+ # ## Phases
103
108
  #
104
- # Orb supports plan phases, also known as contract ramps. For plans with phases,
105
- # the serialized prices refer to all prices across all phases.
109
+ # Orb supports plan phases, also known as contract ramps. For plans with phases,
110
+ # the serialized prices refer to all prices across all phases.
106
111
  #
107
112
  # @overload fetch(plan_id, request_options: {})
108
113
  #
@@ -5,8 +5,8 @@ module Orb
5
5
  class Prices
6
6
  class ExternalPriceID
7
7
  # This endpoint allows you to update the `metadata` property on a price. If you
8
- # pass null for the metadata value, it will clear any existing metadata for that
9
- # price.
8
+ # pass null for the metadata value, it will clear any existing metadata for that
9
+ # price.
10
10
  #
11
11
  # @overload update(external_price_id, metadata: nil, request_options: {})
12
12
  #
@@ -29,8 +29,8 @@ module Orb
29
29
  end
30
30
 
31
31
  # This endpoint returns a price given an external price id. See the
32
- # [price creation API](/api-reference/price/create-price) for more information
33
- # about external price aliases.
32
+ # [price creation API](/api-reference/price/create-price) for more information
33
+ # about external price aliases.
34
34
  #
35
35
  # @overload fetch(external_price_id, request_options: {})
36
36
  #
@@ -7,15 +7,15 @@ module Orb
7
7
  attr_reader :external_price_id
8
8
 
9
9
  # This endpoint is used to create a [price](/product-catalog/price-configuration).
10
- # A price created using this endpoint is always an add-on, meaning that it’s not
11
- # associated with a specific plan and can instead be individually added to
12
- # subscriptions, including subscriptions on different plans.
10
+ # A price created using this endpoint is always an add-on, meaning that it’s not
11
+ # associated with a specific plan and can instead be individually added to
12
+ # subscriptions, including subscriptions on different plans.
13
13
  #
14
- # An `external_price_id` can be optionally specified as an alias to allow
15
- # ergonomic interaction with prices in the Orb API.
14
+ # An `external_price_id` can be optionally specified as an alias to allow
15
+ # ergonomic interaction with prices in the Orb API.
16
16
  #
17
- # See the [Price resource](/product-catalog/price-configuration) for the
18
- # specification of different price model configurations possible in this endpoint.
17
+ # See the [Price resource](/product-catalog/price-configuration) for the
18
+ # specification of different price model configurations possible in this endpoint.
19
19
  #
20
20
  # @overload create(cadence:, currency:, item_id:, model_type:, name:, unit_config:, package_config:, matrix_config:, matrix_with_allocation_config:, tiered_config:, tiered_bps_config:, bps_config:, bulk_bps_config:, bulk_config:, threshold_total_amount_config:, tiered_package_config:, grouped_tiered_config:, max_group_tiered_package_config:, tiered_with_minimum_config:, package_with_allocation_config:, tiered_package_with_minimum_config:, unit_with_percent_config:, tiered_with_proration_config:, unit_with_proration_config:, grouped_allocation_config:, grouped_with_prorated_minimum_config:, grouped_with_metered_minimum_config:, matrix_with_display_name_config:, bulk_with_proration_config:, grouped_tiered_package_config:, scalable_matrix_with_unit_pricing_config:, scalable_matrix_with_tiered_pricing_config:, cumulative_grouped_bulk_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, request_options: {})
21
21
  #
@@ -72,8 +72,8 @@ module Orb
72
72
  end
73
73
 
74
74
  # This endpoint allows you to update the `metadata` property on a price. If you
75
- # pass null for the metadata value, it will clear any existing metadata for that
76
- # price.
75
+ # pass null for the metadata value, it will clear any existing metadata for that
76
+ # price.
77
77
  #
78
78
  # @overload update(price_id, metadata: nil, request_options: {})
79
79
  #
@@ -96,7 +96,7 @@ module Orb
96
96
  end
97
97
 
98
98
  # This endpoint is used to list all add-on prices created using the
99
- # [price creation endpoint](/api-reference/price/create-price).
99
+ # [price creation endpoint](/api-reference/price/create-price).
100
100
  #
101
101
  # @overload list(cursor: nil, limit: nil, request_options: {})
102
102
  #
@@ -120,26 +120,26 @@ module Orb
120
120
  end
121
121
 
122
122
  # This endpoint is used to evaluate the output of a price for a given customer and
123
- # time range. It enables filtering and grouping the output using
124
- # [computed properties](/extensibility/advanced-metrics#computed-properties),
125
- # supporting the following workflows:
126
- #
127
- # 1. Showing detailed usage and costs to the end customer.
128
- # 2. Auditing subtotals on invoice line items.
129
- #
130
- # For these workflows, the expressiveness of computed properties in both the
131
- # filters and grouping is critical. For example, if you'd like to show your
132
- # customer their usage grouped by hour and another property, you can do so with
133
- # the following `grouping_keys`:
134
- # `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd
135
- # like to examine a customer's usage for a specific property value, you can do so
136
- # with the following `filter`:
137
- # `my_property = 'foo' AND my_other_property = 'bar'`.
138
- #
139
- # By default, the start of the time range must be no more than 100 days ago and
140
- # the length of the results must be no greater than 1000. Note that this is a POST
141
- # endpoint rather than a GET endpoint because it employs a JSON body rather than
142
- # query parameters.
123
+ # time range. It enables filtering and grouping the output using
124
+ # [computed properties](/extensibility/advanced-metrics#computed-properties),
125
+ # supporting the following workflows:
126
+ #
127
+ # 1. Showing detailed usage and costs to the end customer.
128
+ # 2. Auditing subtotals on invoice line items.
129
+ #
130
+ # For these workflows, the expressiveness of computed properties in both the
131
+ # filters and grouping is critical. For example, if you'd like to show your
132
+ # customer their usage grouped by hour and another property, you can do so with
133
+ # the following `grouping_keys`:
134
+ # `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd
135
+ # like to examine a customer's usage for a specific property value, you can do so
136
+ # with the following `filter`:
137
+ # `my_property = 'foo' AND my_other_property = 'bar'`.
138
+ #
139
+ # By default, the start of the time range must be no more than 100 days ago and
140
+ # the length of the results must be no greater than 1000. Note that this is a POST
141
+ # endpoint rather than a GET endpoint because it employs a JSON body rather than
142
+ # query parameters.
143
143
  #
144
144
  # @overload evaluate(price_id, timeframe_end:, timeframe_start:, customer_id: nil, external_customer_id: nil, filter: nil, grouping_keys: nil, request_options: {})
145
145
  #
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Resources
5
+ class SubscriptionChanges
6
+ # This endpoint returns a subscription change given an identifier.
7
+ #
8
+ # A subscription change is created by including
9
+ # `Create-Pending-Subscription-Change: True` in the header of a subscription
10
+ # mutation API call (e.g.
11
+ # [create subscription endpoint](/api-reference/subscription/create-subscription),
12
+ # [schedule plan change endpoint](/api-reference/subscription/schedule-plan-change),
13
+ # ...). The subscription change will be referenced by the
14
+ # `pending_subscription_change` field in the response.
15
+ #
16
+ # @overload retrieve(subscription_change_id, request_options: {})
17
+ #
18
+ # @param subscription_change_id [String]
19
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
20
+ #
21
+ # @return [Orb::Models::SubscriptionChangeRetrieveResponse]
22
+ #
23
+ # @see Orb::Models::SubscriptionChangeRetrieveParams
24
+ def retrieve(subscription_change_id, params = {})
25
+ @client.request(
26
+ method: :get,
27
+ path: ["subscription_changes/%1$s", subscription_change_id],
28
+ model: Orb::Models::SubscriptionChangeRetrieveResponse,
29
+ options: params[:request_options]
30
+ )
31
+ end
32
+
33
+ # Apply a subscription change to perform the intended action. If a positive amount
34
+ # is passed with a request to this endpoint, any eligible invoices that were
35
+ # created will be issued immediately if they only contain in-advance fees.
36
+ #
37
+ # @overload apply(subscription_change_id, description: nil, previously_collected_amount: nil, request_options: {})
38
+ #
39
+ # @param subscription_change_id [String]
40
+ # @param description [String, nil]
41
+ # @param previously_collected_amount [String, nil]
42
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
43
+ #
44
+ # @return [Orb::Models::SubscriptionChangeApplyResponse]
45
+ #
46
+ # @see Orb::Models::SubscriptionChangeApplyParams
47
+ def apply(subscription_change_id, params = {})
48
+ parsed, options = Orb::Models::SubscriptionChangeApplyParams.dump_request(params)
49
+ @client.request(
50
+ method: :post,
51
+ path: ["subscription_changes/%1$s/apply", subscription_change_id],
52
+ body: parsed,
53
+ model: Orb::Models::SubscriptionChangeApplyResponse,
54
+ options: options
55
+ )
56
+ end
57
+
58
+ # Cancel a subscription change. The change can no longer be applied. A
59
+ # subscription can only have one "pending" change at a time - use this endpoint to
60
+ # cancel an existing change before creating a new one.
61
+ #
62
+ # @overload cancel(subscription_change_id, request_options: {})
63
+ #
64
+ # @param subscription_change_id [String]
65
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
66
+ #
67
+ # @return [Orb::Models::SubscriptionChangeCancelResponse]
68
+ #
69
+ # @see Orb::Models::SubscriptionChangeCancelParams
70
+ def cancel(subscription_change_id, params = {})
71
+ @client.request(
72
+ method: :post,
73
+ path: ["subscription_changes/%1$s/cancel", subscription_change_id],
74
+ model: Orb::Models::SubscriptionChangeCancelResponse,
75
+ options: params[:request_options]
76
+ )
77
+ end
78
+
79
+ # @api private
80
+ #
81
+ # @param client [Orb::Client]
82
+ def initialize(client:)
83
+ @client = client
84
+ end
85
+ end
86
+ end
87
+ end