orb-billing 0.1.0.pre.alpha.38 → 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 (390) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/orb/client.rb +4 -0
  4. data/lib/orb/internal/transport/base_client.rb +1 -1
  5. data/lib/orb/internal/transport/pooled_net_requester.rb +1 -1
  6. data/lib/orb/internal/type/base_model.rb +14 -17
  7. data/lib/orb/internal/type/converter.rb +20 -22
  8. data/lib/orb/internal/type/enum.rb +8 -8
  9. data/lib/orb/internal/util.rb +1 -5
  10. data/lib/orb/models/alert.rb +9 -9
  11. data/lib/orb/models/alert_create_for_customer_params.rb +3 -3
  12. data/lib/orb/models/alert_create_for_external_customer_params.rb +3 -3
  13. data/lib/orb/models/alert_create_for_subscription_params.rb +3 -3
  14. data/lib/orb/models/alert_list_params.rb +5 -5
  15. data/lib/orb/models/alert_update_params.rb +3 -3
  16. data/lib/orb/models/amount_discount.rb +1 -1
  17. data/lib/orb/models/billable_metric.rb +7 -7
  18. data/lib/orb/models/coupon.rb +7 -7
  19. data/lib/orb/models/coupon_create_params.rb +2 -2
  20. data/lib/orb/models/coupon_list_params.rb +2 -2
  21. data/lib/orb/models/coupons/subscription_list_params.rb +1 -1
  22. data/lib/orb/models/credit_note.rb +1 -1
  23. data/lib/orb/models/credit_note_list_params.rb +5 -5
  24. data/lib/orb/models/customer.rb +232 -232
  25. data/lib/orb/models/customer_create_params.rb +223 -223
  26. data/lib/orb/models/customer_list_params.rb +5 -5
  27. data/lib/orb/models/customer_update_by_external_id_params.rb +224 -224
  28. data/lib/orb/models/customer_update_params.rb +224 -224
  29. data/lib/orb/models/customers/balance_transaction_create_response.rb +2 -2
  30. data/lib/orb/models/customers/balance_transaction_list_params.rb +5 -5
  31. data/lib/orb/models/customers/balance_transaction_list_response.rb +2 -2
  32. data/lib/orb/models/customers/cost_list_by_external_id_params.rb +6 -6
  33. data/lib/orb/models/customers/cost_list_params.rb +6 -6
  34. data/lib/orb/models/customers/credit_list_by_external_id_params.rb +2 -2
  35. data/lib/orb/models/customers/credit_list_params.rb +2 -2
  36. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +20 -20
  37. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +22 -22
  38. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +20 -20
  39. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +22 -22
  40. data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +5 -5
  41. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +22 -22
  42. data/lib/orb/models/customers/credits/ledger_list_params.rb +5 -5
  43. data/lib/orb/models/customers/credits/ledger_list_response.rb +22 -22
  44. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +8 -8
  45. data/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb +7 -7
  46. data/lib/orb/models/customers/credits/top_up_create_params.rb +8 -8
  47. data/lib/orb/models/customers/credits/top_up_create_response.rb +7 -7
  48. data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +1 -1
  49. data/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb +7 -7
  50. data/lib/orb/models/customers/credits/top_up_list_params.rb +1 -1
  51. data/lib/orb/models/customers/credits/top_up_list_response.rb +7 -7
  52. data/lib/orb/models/dimensional_price_group.rb +7 -7
  53. data/lib/orb/models/dimensional_price_group_create_params.rb +2 -2
  54. data/lib/orb/models/dimensional_price_group_list_params.rb +1 -1
  55. data/lib/orb/models/event_ingest_params.rb +7 -7
  56. data/lib/orb/models/event_ingest_response.rb +4 -4
  57. data/lib/orb/models/event_search_params.rb +5 -5
  58. data/lib/orb/models/event_search_response.rb +8 -8
  59. data/lib/orb/models/event_update_params.rb +4 -4
  60. data/lib/orb/models/events/backfill_close_response.rb +7 -7
  61. data/lib/orb/models/events/backfill_create_params.rb +11 -11
  62. data/lib/orb/models/events/backfill_create_response.rb +7 -7
  63. data/lib/orb/models/events/backfill_fetch_response.rb +7 -7
  64. data/lib/orb/models/events/backfill_list_params.rb +1 -1
  65. data/lib/orb/models/events/backfill_list_response.rb +7 -7
  66. data/lib/orb/models/events/backfill_revert_response.rb +7 -7
  67. data/lib/orb/models/events/event_volumes.rb +1 -1
  68. data/lib/orb/models/events/volume_list_params.rb +7 -7
  69. data/lib/orb/models/invoice.rb +270 -270
  70. data/lib/orb/models/invoice_create_params.rb +12 -11
  71. data/lib/orb/models/invoice_fetch_upcoming_response.rb +266 -266
  72. data/lib/orb/models/invoice_issue_params.rb +4 -4
  73. data/lib/orb/models/invoice_line_item_create_params.rb +1 -1
  74. data/lib/orb/models/invoice_line_item_create_response.rb +27 -27
  75. data/lib/orb/models/invoice_list_params.rb +12 -12
  76. data/lib/orb/models/invoice_update_params.rb +2 -2
  77. data/lib/orb/models/item.rb +2 -2
  78. data/lib/orb/models/item_list_params.rb +1 -1
  79. data/lib/orb/models/metric_create_params.rb +2 -2
  80. data/lib/orb/models/metric_list_params.rb +5 -5
  81. data/lib/orb/models/metric_update_params.rb +2 -2
  82. data/lib/orb/models/percentage_discount.rb +2 -2
  83. data/lib/orb/models/plan.rb +35 -35
  84. data/lib/orb/models/plan_create_params.rb +267 -267
  85. data/lib/orb/models/plan_list_params.rb +5 -5
  86. data/lib/orb/models/plan_update_params.rb +4 -4
  87. data/lib/orb/models/plans/external_plan_id_update_params.rb +4 -4
  88. data/lib/orb/models/price.rb +158 -158
  89. data/lib/orb/models/price_create_params.rb +20 -20
  90. data/lib/orb/models/price_evaluate_params.rb +4 -4
  91. data/lib/orb/models/price_list_params.rb +1 -1
  92. data/lib/orb/models/price_update_params.rb +2 -2
  93. data/lib/orb/models/prices/external_price_id_update_params.rb +2 -2
  94. data/lib/orb/models/subscription.rb +114 -87
  95. data/lib/orb/models/subscription_cancel_params.rb +3 -3
  96. data/lib/orb/models/subscription_cancel_response.rb +150 -72
  97. data/lib/orb/models/subscription_change_apply_params.rb +33 -0
  98. data/lib/orb/models/subscription_change_apply_response.rb +1372 -0
  99. data/lib/orb/models/subscription_change_cancel_params.rb +19 -0
  100. data/lib/orb/models/subscription_change_cancel_response.rb +1372 -0
  101. data/lib/orb/models/subscription_change_retrieve_params.rb +19 -0
  102. data/lib/orb/models/subscription_change_retrieve_response.rb +1372 -0
  103. data/lib/orb/models/subscription_create_params.rb +641 -641
  104. data/lib/orb/models/subscription_create_response.rb +150 -72
  105. data/lib/orb/models/subscription_fetch_costs_params.rb +6 -6
  106. data/lib/orb/models/subscription_fetch_schedule_params.rb +5 -5
  107. data/lib/orb/models/subscription_fetch_schedule_response.rb +2 -2
  108. data/lib/orb/models/subscription_fetch_usage_params.rb +8 -8
  109. data/lib/orb/models/subscription_list_params.rb +5 -5
  110. data/lib/orb/models/subscription_price_intervals_params.rb +323 -323
  111. data/lib/orb/models/subscription_price_intervals_response.rb +152 -72
  112. data/lib/orb/models/subscription_schedule_plan_change_params.rb +651 -651
  113. data/lib/orb/models/subscription_schedule_plan_change_response.rb +152 -72
  114. data/lib/orb/models/subscription_trigger_phase_params.rb +3 -3
  115. data/lib/orb/models/subscription_trigger_phase_response.rb +152 -72
  116. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +152 -72
  117. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +153 -73
  118. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +152 -72
  119. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +8 -8
  120. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +152 -72
  121. data/lib/orb/models/subscription_update_params.rb +10 -10
  122. data/lib/orb/models/subscription_update_trial_params.rb +3 -3
  123. data/lib/orb/models/subscription_update_trial_response.rb +152 -72
  124. data/lib/orb/models/trial_discount.rb +1 -1
  125. data/lib/orb/models/usage_discount.rb +2 -2
  126. data/lib/orb/request_options.rb +7 -7
  127. data/lib/orb/resources/alerts.rb +38 -38
  128. data/lib/orb/resources/coupons/subscriptions.rb +3 -3
  129. data/lib/orb/resources/coupons.rb +9 -9
  130. data/lib/orb/resources/credit_notes.rb +8 -8
  131. data/lib/orb/resources/customers/balance_transactions.rb +26 -26
  132. data/lib/orb/resources/customers/costs.rb +232 -232
  133. data/lib/orb/resources/customers/credits/ledger.rb +344 -344
  134. data/lib/orb/resources/customers/credits/top_ups.rb +12 -12
  135. data/lib/orb/resources/customers/credits.rb +8 -8
  136. data/lib/orb/resources/customers.rb +59 -59
  137. data/lib/orb/resources/dimensional_price_groups.rb +6 -6
  138. data/lib/orb/resources/events/backfills.rb +49 -49
  139. data/lib/orb/resources/events/volume.rb +10 -10
  140. data/lib/orb/resources/events.rb +295 -295
  141. data/lib/orb/resources/invoice_line_items.rb +1 -1
  142. data/lib/orb/resources/invoices.rb +38 -38
  143. data/lib/orb/resources/items.rb +1 -1
  144. data/lib/orb/resources/metrics.rb +11 -11
  145. data/lib/orb/resources/plans/external_plan_id.rb +14 -14
  146. data/lib/orb/resources/plans.rb +22 -22
  147. data/lib/orb/resources/prices/external_price_id.rb +4 -4
  148. data/lib/orb/resources/prices.rb +30 -30
  149. data/lib/orb/resources/subscription_changes.rb +87 -0
  150. data/lib/orb/resources/subscriptions.rb +813 -813
  151. data/lib/orb/resources/top_level.rb +4 -4
  152. data/lib/orb/version.rb +1 -1
  153. data/lib/orb.rb +7 -0
  154. data/rbi/lib/orb/client.rbi +5 -4
  155. data/rbi/lib/orb/errors.rbi +3 -6
  156. data/rbi/lib/orb/internal/page.rbi +3 -6
  157. data/rbi/lib/orb/internal/transport/base_client.rbi +13 -27
  158. data/rbi/lib/orb/internal/transport/pooled_net_requester.rbi +7 -13
  159. data/rbi/lib/orb/internal/type/array_of.rbi +8 -16
  160. data/rbi/lib/orb/internal/type/base_model.rbi +45 -64
  161. data/rbi/lib/orb/internal/type/base_page.rbi +5 -10
  162. data/rbi/lib/orb/internal/type/boolean.rbi +4 -8
  163. data/rbi/lib/orb/internal/type/converter.rbi +25 -31
  164. data/rbi/lib/orb/internal/type/enum.rbi +14 -20
  165. data/rbi/lib/orb/internal/type/hash_of.rbi +8 -16
  166. data/rbi/lib/orb/internal/type/request_parameters.rbi +1 -2
  167. data/rbi/lib/orb/internal/type/union.rbi +10 -20
  168. data/rbi/lib/orb/internal/type/unknown.rbi +4 -8
  169. data/rbi/lib/orb/internal/util.rbi +34 -68
  170. data/rbi/lib/orb/internal.rbi +1 -1
  171. data/rbi/lib/orb/models/alert.rbi +21 -33
  172. data/rbi/lib/orb/models/alert_create_for_customer_params.rbi +8 -13
  173. data/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi +8 -13
  174. data/rbi/lib/orb/models/alert_create_for_subscription_params.rbi +8 -13
  175. data/rbi/lib/orb/models/alert_disable_params.rbi +2 -4
  176. data/rbi/lib/orb/models/alert_enable_params.rbi +2 -4
  177. data/rbi/lib/orb/models/alert_list_params.rbi +3 -6
  178. data/rbi/lib/orb/models/alert_retrieve_params.rbi +2 -4
  179. data/rbi/lib/orb/models/alert_update_params.rbi +7 -11
  180. data/rbi/lib/orb/models/amount_discount.rbi +4 -7
  181. data/rbi/lib/orb/models/billable_metric.rbi +10 -13
  182. data/rbi/lib/orb/models/billing_cycle_relative_date.rbi +1 -2
  183. data/rbi/lib/orb/models/coupon.rbi +9 -11
  184. data/rbi/lib/orb/models/coupon_archive_params.rbi +2 -4
  185. data/rbi/lib/orb/models/coupon_create_params.rbi +8 -14
  186. data/rbi/lib/orb/models/coupon_fetch_params.rbi +2 -4
  187. data/rbi/lib/orb/models/coupon_list_params.rbi +3 -4
  188. data/rbi/lib/orb/models/coupons/subscription_list_params.rbi +3 -5
  189. data/rbi/lib/orb/models/credit_note.rbi +22 -45
  190. data/rbi/lib/orb/models/credit_note_create_params.rbi +5 -10
  191. data/rbi/lib/orb/models/credit_note_fetch_params.rbi +2 -4
  192. data/rbi/lib/orb/models/credit_note_list_params.rbi +3 -6
  193. data/rbi/lib/orb/models/customer.rbi +256 -281
  194. data/rbi/lib/orb/models/customer_create_params.rbi +251 -276
  195. data/rbi/lib/orb/models/customer_delete_params.rbi +2 -4
  196. data/rbi/lib/orb/models/customer_fetch_by_external_id_params.rbi +2 -4
  197. data/rbi/lib/orb/models/customer_fetch_params.rbi +2 -4
  198. data/rbi/lib/orb/models/customer_list_params.rbi +3 -6
  199. data/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi +2 -4
  200. data/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rbi +2 -4
  201. data/rbi/lib/orb/models/customer_update_by_external_id_params.rbi +252 -277
  202. data/rbi/lib/orb/models/customer_update_params.rbi +252 -277
  203. data/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi +3 -6
  204. data/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi +10 -19
  205. data/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi +3 -6
  206. data/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi +10 -19
  207. data/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi +8 -10
  208. data/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi +6 -12
  209. data/rbi/lib/orb/models/customers/cost_list_params.rbi +8 -10
  210. data/rbi/lib/orb/models/customers/cost_list_response.rbi +6 -12
  211. data/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi +3 -4
  212. data/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi +2 -4
  213. data/rbi/lib/orb/models/customers/credit_list_params.rbi +3 -4
  214. data/rbi/lib/orb/models/customers/credit_list_response.rbi +2 -4
  215. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +26 -33
  216. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +79 -136
  217. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi +26 -33
  218. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi +78 -135
  219. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +5 -10
  220. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +79 -136
  221. data/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi +5 -10
  222. data/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi +74 -131
  223. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +13 -19
  224. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi +12 -18
  225. data/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi +13 -19
  226. data/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi +12 -18
  227. data/rbi/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi +2 -4
  228. data/rbi/lib/orb/models/customers/credits/top_up_delete_params.rbi +2 -4
  229. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +3 -5
  230. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi +12 -18
  231. data/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi +3 -5
  232. data/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi +12 -18
  233. data/rbi/lib/orb/models/dimensional_price_group.rbi +8 -9
  234. data/rbi/lib/orb/models/dimensional_price_group_create_params.rbi +4 -7
  235. data/rbi/lib/orb/models/dimensional_price_group_list_params.rbi +3 -5
  236. data/rbi/lib/orb/models/dimensional_price_group_retrieve_params.rbi +2 -4
  237. data/rbi/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi +2 -4
  238. data/rbi/lib/orb/models/dimensional_price_groups.rbi +2 -4
  239. data/rbi/lib/orb/models/discount.rbi +1 -2
  240. data/rbi/lib/orb/models/evaluate_price_group.rbi +3 -6
  241. data/rbi/lib/orb/models/event_deprecate_params.rbi +2 -4
  242. data/rbi/lib/orb/models/event_deprecate_response.rbi +2 -4
  243. data/rbi/lib/orb/models/event_ingest_params.rbi +10 -13
  244. data/rbi/lib/orb/models/event_ingest_response.rbi +10 -16
  245. data/rbi/lib/orb/models/event_search_params.rbi +7 -9
  246. data/rbi/lib/orb/models/event_search_response.rbi +11 -14
  247. data/rbi/lib/orb/models/event_update_params.rbi +5 -6
  248. data/rbi/lib/orb/models/event_update_response.rbi +2 -4
  249. data/rbi/lib/orb/models/events/backfill_close_params.rbi +2 -4
  250. data/rbi/lib/orb/models/events/backfill_close_response.rbi +10 -14
  251. data/rbi/lib/orb/models/events/backfill_create_params.rbi +13 -16
  252. data/rbi/lib/orb/models/events/backfill_create_response.rbi +10 -14
  253. data/rbi/lib/orb/models/events/backfill_fetch_params.rbi +2 -4
  254. data/rbi/lib/orb/models/events/backfill_fetch_response.rbi +10 -14
  255. data/rbi/lib/orb/models/events/backfill_list_params.rbi +3 -5
  256. data/rbi/lib/orb/models/events/backfill_list_response.rbi +10 -14
  257. data/rbi/lib/orb/models/events/backfill_revert_params.rbi +2 -4
  258. data/rbi/lib/orb/models/events/backfill_revert_response.rbi +10 -14
  259. data/rbi/lib/orb/models/events/event_volumes.rbi +5 -9
  260. data/rbi/lib/orb/models/events/volume_list_params.rbi +9 -11
  261. data/rbi/lib/orb/models/invoice.rbi +388 -465
  262. data/rbi/lib/orb/models/invoice_create_params.rbi +19 -26
  263. data/rbi/lib/orb/models/invoice_fetch_params.rbi +2 -4
  264. data/rbi/lib/orb/models/invoice_fetch_upcoming_params.rbi +2 -4
  265. data/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi +381 -460
  266. data/rbi/lib/orb/models/invoice_issue_params.rbi +6 -8
  267. data/rbi/lib/orb/models/invoice_level_discount.rbi +1 -2
  268. data/rbi/lib/orb/models/invoice_line_item_create_params.rbi +3 -5
  269. data/rbi/lib/orb/models/invoice_line_item_create_response.rbi +101 -143
  270. data/rbi/lib/orb/models/invoice_list_params.rbi +8 -13
  271. data/rbi/lib/orb/models/invoice_mark_paid_params.rbi +2 -4
  272. data/rbi/lib/orb/models/invoice_pay_params.rbi +2 -4
  273. data/rbi/lib/orb/models/invoice_update_params.rbi +4 -6
  274. data/rbi/lib/orb/models/invoice_void_params.rbi +2 -4
  275. data/rbi/lib/orb/models/item.rbi +7 -12
  276. data/rbi/lib/orb/models/item_create_params.rbi +2 -4
  277. data/rbi/lib/orb/models/item_fetch_params.rbi +2 -4
  278. data/rbi/lib/orb/models/item_list_params.rbi +3 -5
  279. data/rbi/lib/orb/models/item_update_params.rbi +5 -10
  280. data/rbi/lib/orb/models/metric_create_params.rbi +4 -6
  281. data/rbi/lib/orb/models/metric_fetch_params.rbi +2 -4
  282. data/rbi/lib/orb/models/metric_list_params.rbi +3 -6
  283. data/rbi/lib/orb/models/metric_update_params.rbi +4 -6
  284. data/rbi/lib/orb/models/pagination_metadata.rbi +2 -4
  285. data/rbi/lib/orb/models/percentage_discount.rbi +5 -8
  286. data/rbi/lib/orb/models/plan.rbi +180 -219
  287. data/rbi/lib/orb/models/plan_create_params.rbi +670 -951
  288. data/rbi/lib/orb/models/plan_fetch_params.rbi +2 -4
  289. data/rbi/lib/orb/models/plan_list_params.rbi +4 -8
  290. data/rbi/lib/orb/models/plan_update_params.rbi +6 -8
  291. data/rbi/lib/orb/models/plans/external_plan_id_fetch_params.rbi +2 -4
  292. data/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi +6 -8
  293. data/rbi/lib/orb/models/price.rbi +827 -1494
  294. data/rbi/lib/orb/models/price_create_params.rbi +60 -101
  295. data/rbi/lib/orb/models/price_evaluate_params.rbi +6 -9
  296. data/rbi/lib/orb/models/price_evaluate_response.rbi +2 -4
  297. data/rbi/lib/orb/models/price_fetch_params.rbi +2 -4
  298. data/rbi/lib/orb/models/price_list_params.rbi +3 -5
  299. data/rbi/lib/orb/models/price_update_params.rbi +4 -6
  300. data/rbi/lib/orb/models/prices/external_price_id_fetch_params.rbi +2 -4
  301. data/rbi/lib/orb/models/prices/external_price_id_update_params.rbi +4 -6
  302. data/rbi/lib/orb/models/subscription.rbi +167 -187
  303. data/rbi/lib/orb/models/subscription_cancel_params.rbi +5 -7
  304. data/rbi/lib/orb/models/subscription_cancel_response.rbi +224 -178
  305. data/rbi/lib/orb/models/subscription_change_apply_params.rbi +40 -0
  306. data/rbi/lib/orb/models/subscription_change_apply_response.rbi +1554 -0
  307. data/rbi/lib/orb/models/subscription_change_cancel_params.rbi +18 -0
  308. data/rbi/lib/orb/models/subscription_change_cancel_response.rbi +1565 -0
  309. data/rbi/lib/orb/models/subscription_change_retrieve_params.rbi +18 -0
  310. data/rbi/lib/orb/models/subscription_change_retrieve_response.rbi +1581 -0
  311. data/rbi/lib/orb/models/subscription_create_params.rbi +1372 -1968
  312. data/rbi/lib/orb/models/subscription_create_response.rbi +224 -178
  313. data/rbi/lib/orb/models/subscription_fetch_costs_params.rbi +8 -10
  314. data/rbi/lib/orb/models/subscription_fetch_costs_response.rbi +6 -12
  315. data/rbi/lib/orb/models/subscription_fetch_params.rbi +2 -4
  316. data/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi +3 -6
  317. data/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi +6 -10
  318. data/rbi/lib/orb/models/subscription_fetch_usage_params.rbi +12 -17
  319. data/rbi/lib/orb/models/subscription_list_params.rbi +4 -8
  320. data/rbi/lib/orb/models/subscription_price_intervals_params.rbi +772 -1124
  321. data/rbi/lib/orb/models/subscription_price_intervals_response.rbi +228 -178
  322. data/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi +1396 -1993
  323. data/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi +238 -182
  324. data/rbi/lib/orb/models/subscription_trigger_phase_params.rbi +5 -7
  325. data/rbi/lib/orb/models/subscription_trigger_phase_response.rbi +224 -178
  326. data/rbi/lib/orb/models/subscription_unschedule_cancellation_params.rbi +2 -4
  327. data/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi +238 -182
  328. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +2 -4
  329. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +265 -199
  330. data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rbi +2 -4
  331. data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +264 -198
  332. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi +11 -15
  333. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi +238 -182
  334. data/rbi/lib/orb/models/subscription_update_params.rbi +12 -15
  335. data/rbi/lib/orb/models/subscription_update_trial_params.rbi +6 -9
  336. data/rbi/lib/orb/models/subscription_update_trial_response.rbi +224 -178
  337. data/rbi/lib/orb/models/subscription_usage.rbi +24 -43
  338. data/rbi/lib/orb/models/subscriptions.rbi +2 -4
  339. data/rbi/lib/orb/models/top_level_ping_params.rbi +2 -4
  340. data/rbi/lib/orb/models/top_level_ping_response.rbi +2 -4
  341. data/rbi/lib/orb/models/trial_discount.rbi +4 -8
  342. data/rbi/lib/orb/models/usage_discount.rbi +5 -8
  343. data/rbi/lib/orb/request_options.rbi +9 -11
  344. data/rbi/lib/orb/resources/alerts.rbi +44 -60
  345. data/rbi/lib/orb/resources/coupons/subscriptions.rbi +6 -9
  346. data/rbi/lib/orb/resources/coupons.rbi +18 -25
  347. data/rbi/lib/orb/resources/credit_notes.rbi +9 -15
  348. data/rbi/lib/orb/resources/customers/balance_transactions.rbi +26 -31
  349. data/rbi/lib/orb/resources/customers/costs.rbi +241 -246
  350. data/rbi/lib/orb/resources/customers/credits/ledger.rbi +387 -396
  351. data/rbi/lib/orb/resources/customers/credits/top_ups.rbi +29 -40
  352. data/rbi/lib/orb/resources/customers/credits.rbi +15 -20
  353. data/rbi/lib/orb/resources/customers.rbi +407 -417
  354. data/rbi/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbi +2 -4
  355. data/rbi/lib/orb/resources/dimensional_price_groups.rbi +13 -19
  356. data/rbi/lib/orb/resources/events/backfills.rbi +61 -69
  357. data/rbi/lib/orb/resources/events/volume.rbi +19 -22
  358. data/rbi/lib/orb/resources/events.rbi +311 -319
  359. data/rbi/lib/orb/resources/invoice_line_items.rbi +4 -7
  360. data/rbi/lib/orb/resources/invoices.rbi +62 -76
  361. data/rbi/lib/orb/resources/items.rbi +7 -14
  362. data/rbi/lib/orb/resources/metrics.rbi +17 -25
  363. data/rbi/lib/orb/resources/plans/external_plan_id.rbi +21 -25
  364. data/rbi/lib/orb/resources/plans.rbi +63 -71
  365. data/rbi/lib/orb/resources/prices/external_price_id.rbi +9 -13
  366. data/rbi/lib/orb/resources/prices.rbi +77 -87
  367. data/rbi/lib/orb/resources/subscription_changes.rbi +61 -0
  368. data/rbi/lib/orb/resources/subscriptions.rbi +933 -963
  369. data/rbi/lib/orb/resources/top_level.rbi +6 -8
  370. data/sig/orb/client.rbs +2 -0
  371. data/sig/orb/models/subscription.rbs +14 -0
  372. data/sig/orb/models/subscription_cancel_response.rbs +47 -2
  373. data/sig/orb/models/subscription_change_apply_params.rbs +24 -0
  374. data/sig/orb/models/subscription_change_apply_response.rbs +784 -0
  375. data/sig/orb/models/subscription_change_cancel_params.rbs +15 -0
  376. data/sig/orb/models/subscription_change_cancel_response.rbs +784 -0
  377. data/sig/orb/models/subscription_change_retrieve_params.rbs +15 -0
  378. data/sig/orb/models/subscription_change_retrieve_response.rbs +784 -0
  379. data/sig/orb/models/subscription_create_response.rbs +47 -2
  380. data/sig/orb/models/subscription_price_intervals_response.rbs +47 -2
  381. data/sig/orb/models/subscription_schedule_plan_change_response.rbs +47 -2
  382. data/sig/orb/models/subscription_trigger_phase_response.rbs +47 -2
  383. data/sig/orb/models/subscription_unschedule_cancellation_response.rbs +47 -2
  384. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs +47 -2
  385. data/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs +47 -2
  386. data/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs +47 -2
  387. data/sig/orb/models/subscription_update_trial_response.rbs +47 -2
  388. data/sig/orb/resources/customers.rbs +2 -2
  389. data/sig/orb/resources/subscription_changes.rbs +24 -0
  390. metadata +23 -2
@@ -0,0 +1,1372 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::SubscriptionChanges#cancel
6
+ class SubscriptionChangeCancelResponse < Orb::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute expiration_time
13
+ # Subscription change will be cancelled at this time and can no longer be applied.
14
+ #
15
+ # @return [Time]
16
+ required :expiration_time, Time
17
+
18
+ # @!attribute status
19
+ #
20
+ # @return [Symbol, Orb::Models::SubscriptionChangeCancelResponse::Status]
21
+ required :status, enum: -> { Orb::Models::SubscriptionChangeCancelResponse::Status }
22
+
23
+ # @!attribute subscription
24
+ #
25
+ # @return [Orb::Models::SubscriptionChangeCancelResponse::Subscription, nil]
26
+ required :subscription, -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription }, nil?: true
27
+
28
+ # @!attribute applied_at
29
+ # When this change was applied.
30
+ #
31
+ # @return [Time, nil]
32
+ optional :applied_at, Time, nil?: true
33
+
34
+ # @!attribute cancelled_at
35
+ # When this change was cancelled.
36
+ #
37
+ # @return [Time, nil]
38
+ optional :cancelled_at, Time, nil?: true
39
+
40
+ # @!parse
41
+ # # A subscription change represents a desired new subscription / pending change to
42
+ # # an existing subscription. It is a way to first preview the effects on the
43
+ # # subscription as well as any changes/creation of invoices (see
44
+ # # `subscription.changed_resources`).
45
+ # #
46
+ # # @param id [String]
47
+ # # @param expiration_time [Time]
48
+ # # @param status [Symbol, Orb::Models::SubscriptionChangeCancelResponse::Status]
49
+ # # @param subscription [Orb::Models::SubscriptionChangeCancelResponse::Subscription, nil]
50
+ # # @param applied_at [Time, nil]
51
+ # # @param cancelled_at [Time, nil]
52
+ # #
53
+ # def initialize(id:, expiration_time:, status:, subscription:, applied_at: nil, cancelled_at: nil, **) = super
54
+
55
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
56
+
57
+ # @see Orb::Models::SubscriptionChangeCancelResponse#status
58
+ module Status
59
+ extend Orb::Internal::Type::Enum
60
+
61
+ PENDING = :pending
62
+ APPLIED = :applied
63
+ CANCELLED = :cancelled
64
+
65
+ finalize!
66
+
67
+ # @!parse
68
+ # # @return [Array<Symbol>]
69
+ # def self.values; end
70
+ end
71
+
72
+ # @see Orb::Models::SubscriptionChangeCancelResponse#subscription
73
+ class Subscription < Orb::Internal::Type::BaseModel
74
+ # @!attribute id
75
+ #
76
+ # @return [String]
77
+ required :id, String
78
+
79
+ # @!attribute active_plan_phase_order
80
+ # The current plan phase that is active, only if the subscription's plan has
81
+ # phases.
82
+ #
83
+ # @return [Integer, nil]
84
+ required :active_plan_phase_order, Integer, nil?: true
85
+
86
+ # @!attribute adjustment_intervals
87
+ # The adjustment intervals for this subscription sorted by the start_date of the
88
+ # adjustment interval.
89
+ #
90
+ # @return [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval>]
91
+ required :adjustment_intervals,
92
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval] }
93
+
94
+ # @!attribute auto_collection
95
+ # Determines whether issued invoices for this subscription will automatically be
96
+ # charged with the saved payment method on the due date. This property defaults to
97
+ # the plan's behavior. If null, defaults to the customer's setting.
98
+ #
99
+ # @return [Boolean, nil]
100
+ required :auto_collection, Orb::Internal::Type::Boolean, nil?: true
101
+
102
+ # @!attribute billing_cycle_anchor_configuration
103
+ #
104
+ # @return [Orb::Models::SubscriptionChangeCancelResponse::Subscription::BillingCycleAnchorConfiguration]
105
+ required :billing_cycle_anchor_configuration,
106
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::BillingCycleAnchorConfiguration }
107
+
108
+ # @!attribute billing_cycle_day
109
+ # The day of the month on which the billing cycle is anchored. If the maximum
110
+ # number of days in a month is greater than this value, the last day of the month
111
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
112
+ # period begins on the 30th.
113
+ #
114
+ # @return [Integer]
115
+ required :billing_cycle_day, Integer
116
+
117
+ # @!attribute created_at
118
+ #
119
+ # @return [Time]
120
+ required :created_at, Time
121
+
122
+ # @!attribute current_billing_period_end_date
123
+ # The end of the current billing period. This is an exclusive timestamp, such that
124
+ # the instant returned is not part of the billing period. Set to null for
125
+ # subscriptions that are not currently active.
126
+ #
127
+ # @return [Time, nil]
128
+ required :current_billing_period_end_date, Time, nil?: true
129
+
130
+ # @!attribute current_billing_period_start_date
131
+ # The start date of the current billing period. This is an inclusive timestamp;
132
+ # the instant returned is exactly the beginning of the billing period. Set to null
133
+ # if the subscription is not currently active.
134
+ #
135
+ # @return [Time, nil]
136
+ required :current_billing_period_start_date, Time, nil?: true
137
+
138
+ # @!attribute customer
139
+ # A customer is a buyer of your products, and the other party to the billing
140
+ # relationship.
141
+ #
142
+ # In Orb, customers are assigned system generated identifiers automatically, but
143
+ # it's often desirable to have these match existing identifiers in your system. To
144
+ # avoid having to denormalize Orb ID information, you can pass in an
145
+ # `external_customer_id` with your own identifier. See
146
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
147
+ # information about how these aliases work in Orb.
148
+ #
149
+ # In addition to having an identifier in your system, a customer may exist in a
150
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
151
+ # `payment_provider` enum field to express this mapping.
152
+ #
153
+ # A customer also has a timezone (from the standard
154
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
155
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
156
+ # information on what this timezone parameter influences within Orb.
157
+ #
158
+ # @return [Orb::Models::Customer]
159
+ required :customer, -> { Orb::Models::Customer }
160
+
161
+ # @!attribute default_invoice_memo
162
+ # Determines the default memo on this subscriptions' invoices. Note that if this
163
+ # is not provided, it is determined by the plan configuration.
164
+ #
165
+ # @return [String, nil]
166
+ required :default_invoice_memo, String, nil?: true
167
+
168
+ # @!attribute discount_intervals
169
+ # The discount intervals for this subscription sorted by the start_date.
170
+ #
171
+ # @return [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::AmountDiscountInterval, Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::PercentageDiscountInterval, Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::UsageDiscountInterval>]
172
+ required :discount_intervals,
173
+ -> { Orb::Internal::Type::ArrayOf[union: Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval] }
174
+
175
+ # @!attribute end_date
176
+ # The date Orb stops billing for this subscription.
177
+ #
178
+ # @return [Time, nil]
179
+ required :end_date, Time, nil?: true
180
+
181
+ # @!attribute fixed_fee_quantity_schedule
182
+ #
183
+ # @return [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::FixedFeeQuantitySchedule>]
184
+ required :fixed_fee_quantity_schedule,
185
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::SubscriptionChangeCancelResponse::Subscription::FixedFeeQuantitySchedule] }
186
+
187
+ # @!attribute invoicing_threshold
188
+ #
189
+ # @return [String, nil]
190
+ required :invoicing_threshold, String, nil?: true
191
+
192
+ # @!attribute maximum_intervals
193
+ # The maximum intervals for this subscription sorted by the start_date.
194
+ #
195
+ # @return [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::MaximumInterval>]
196
+ required :maximum_intervals,
197
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::SubscriptionChangeCancelResponse::Subscription::MaximumInterval] }
198
+
199
+ # @!attribute metadata
200
+ # User specified key-value pairs for the resource. If not present, this defaults
201
+ # to an empty dictionary. Individual keys can be removed by setting the value to
202
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
203
+ # `null`.
204
+ #
205
+ # @return [Hash{Symbol=>String}]
206
+ required :metadata, Orb::Internal::Type::HashOf[String]
207
+
208
+ # @!attribute minimum_intervals
209
+ # The minimum intervals for this subscription sorted by the start_date.
210
+ #
211
+ # @return [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::MinimumInterval>]
212
+ required :minimum_intervals,
213
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::SubscriptionChangeCancelResponse::Subscription::MinimumInterval] }
214
+
215
+ # @!attribute net_terms
216
+ # Determines the difference between the invoice issue date for subscription
217
+ # invoices as the date that they are due. A value of `0` here represents that the
218
+ # invoice is due on issue, whereas a value of `30` represents that the customer
219
+ # has a month to pay the invoice.
220
+ #
221
+ # @return [Integer]
222
+ required :net_terms, Integer
223
+
224
+ # @!attribute pending_subscription_change
225
+ # A pending subscription change if one exists on this subscription.
226
+ #
227
+ # @return [Orb::Models::SubscriptionChangeCancelResponse::Subscription::PendingSubscriptionChange, nil]
228
+ required :pending_subscription_change,
229
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::PendingSubscriptionChange },
230
+ nil?: true
231
+
232
+ # @!attribute plan
233
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
234
+ # subscribed to by a customer. Plans define the billing behavior of the
235
+ # subscription. You can see more about how to configure prices in the
236
+ # [Price resource](/reference/price).
237
+ #
238
+ # @return [Orb::Models::Plan]
239
+ required :plan, -> { Orb::Models::Plan }
240
+
241
+ # @!attribute price_intervals
242
+ # The price intervals for this subscription.
243
+ #
244
+ # @return [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::PriceInterval>]
245
+ required :price_intervals,
246
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::SubscriptionChangeCancelResponse::Subscription::PriceInterval] }
247
+
248
+ # @!attribute redeemed_coupon
249
+ #
250
+ # @return [Orb::Models::SubscriptionChangeCancelResponse::Subscription::RedeemedCoupon, nil]
251
+ required :redeemed_coupon,
252
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::RedeemedCoupon },
253
+ nil?: true
254
+
255
+ # @!attribute start_date
256
+ # The date Orb starts billing for this subscription.
257
+ #
258
+ # @return [Time]
259
+ required :start_date, Time
260
+
261
+ # @!attribute status
262
+ #
263
+ # @return [Symbol, Orb::Models::SubscriptionChangeCancelResponse::Subscription::Status]
264
+ required :status, enum: -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::Status }
265
+
266
+ # @!attribute trial_info
267
+ #
268
+ # @return [Orb::Models::SubscriptionChangeCancelResponse::Subscription::TrialInfo]
269
+ required :trial_info, -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::TrialInfo }
270
+
271
+ # @!attribute changed_resources
272
+ # The resources that were changed as part of this operation. Only present when
273
+ # fetched through the subscription changes API or if the
274
+ # `include_changed_resources` parameter was passed in the request.
275
+ #
276
+ # @return [Orb::Models::SubscriptionChangeCancelResponse::Subscription::ChangedResources, nil]
277
+ optional :changed_resources,
278
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::ChangedResources },
279
+ nil?: true
280
+
281
+ # @!parse
282
+ # # @param id [String]
283
+ # # @param active_plan_phase_order [Integer, nil]
284
+ # # @param adjustment_intervals [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval>]
285
+ # # @param auto_collection [Boolean, nil]
286
+ # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionChangeCancelResponse::Subscription::BillingCycleAnchorConfiguration]
287
+ # # @param billing_cycle_day [Integer]
288
+ # # @param created_at [Time]
289
+ # # @param current_billing_period_end_date [Time, nil]
290
+ # # @param current_billing_period_start_date [Time, nil]
291
+ # # @param customer [Orb::Models::Customer]
292
+ # # @param default_invoice_memo [String, nil]
293
+ # # @param discount_intervals [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::AmountDiscountInterval, Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::PercentageDiscountInterval, Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::UsageDiscountInterval>]
294
+ # # @param end_date [Time, nil]
295
+ # # @param fixed_fee_quantity_schedule [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::FixedFeeQuantitySchedule>]
296
+ # # @param invoicing_threshold [String, nil]
297
+ # # @param maximum_intervals [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::MaximumInterval>]
298
+ # # @param metadata [Hash{Symbol=>String}]
299
+ # # @param minimum_intervals [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::MinimumInterval>]
300
+ # # @param net_terms [Integer]
301
+ # # @param pending_subscription_change [Orb::Models::SubscriptionChangeCancelResponse::Subscription::PendingSubscriptionChange, nil]
302
+ # # @param plan [Orb::Models::Plan]
303
+ # # @param price_intervals [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::PriceInterval>]
304
+ # # @param redeemed_coupon [Orb::Models::SubscriptionChangeCancelResponse::Subscription::RedeemedCoupon, nil]
305
+ # # @param start_date [Time]
306
+ # # @param status [Symbol, Orb::Models::SubscriptionChangeCancelResponse::Subscription::Status]
307
+ # # @param trial_info [Orb::Models::SubscriptionChangeCancelResponse::Subscription::TrialInfo]
308
+ # # @param changed_resources [Orb::Models::SubscriptionChangeCancelResponse::Subscription::ChangedResources, nil]
309
+ # #
310
+ # def initialize(
311
+ # id:,
312
+ # active_plan_phase_order:,
313
+ # adjustment_intervals:,
314
+ # auto_collection:,
315
+ # billing_cycle_anchor_configuration:,
316
+ # billing_cycle_day:,
317
+ # created_at:,
318
+ # current_billing_period_end_date:,
319
+ # current_billing_period_start_date:,
320
+ # customer:,
321
+ # default_invoice_memo:,
322
+ # discount_intervals:,
323
+ # end_date:,
324
+ # fixed_fee_quantity_schedule:,
325
+ # invoicing_threshold:,
326
+ # maximum_intervals:,
327
+ # metadata:,
328
+ # minimum_intervals:,
329
+ # net_terms:,
330
+ # pending_subscription_change:,
331
+ # plan:,
332
+ # price_intervals:,
333
+ # redeemed_coupon:,
334
+ # start_date:,
335
+ # status:,
336
+ # trial_info:,
337
+ # changed_resources: nil,
338
+ # **
339
+ # )
340
+ # super
341
+ # end
342
+
343
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
344
+
345
+ class AdjustmentInterval < Orb::Internal::Type::BaseModel
346
+ # @!attribute id
347
+ #
348
+ # @return [String]
349
+ required :id, String
350
+
351
+ # @!attribute adjustment
352
+ #
353
+ # @return [Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseUsageDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseAmountDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhasePercentageDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMinimumAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMaximumAdjustment]
354
+ required :adjustment,
355
+ union: -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment }
356
+
357
+ # @!attribute applies_to_price_interval_ids
358
+ # The price interval IDs that this adjustment applies to.
359
+ #
360
+ # @return [Array<String>]
361
+ required :applies_to_price_interval_ids, Orb::Internal::Type::ArrayOf[String]
362
+
363
+ # @!attribute end_date
364
+ # The end date of the adjustment interval.
365
+ #
366
+ # @return [Time, nil]
367
+ required :end_date, Time, nil?: true
368
+
369
+ # @!attribute start_date
370
+ # The start date of the adjustment interval.
371
+ #
372
+ # @return [Time]
373
+ required :start_date, Time
374
+
375
+ # @!parse
376
+ # # @param id [String]
377
+ # # @param adjustment [Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseUsageDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseAmountDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhasePercentageDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMinimumAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMaximumAdjustment]
378
+ # # @param applies_to_price_interval_ids [Array<String>]
379
+ # # @param end_date [Time, nil]
380
+ # # @param start_date [Time]
381
+ # #
382
+ # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super
383
+
384
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
385
+
386
+ # @see Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval#adjustment
387
+ module Adjustment
388
+ extend Orb::Internal::Type::Union
389
+
390
+ discriminator :adjustment_type
391
+
392
+ variant :usage_discount,
393
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseUsageDiscountAdjustment }
394
+
395
+ variant :amount_discount,
396
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseAmountDiscountAdjustment }
397
+
398
+ variant :percentage_discount,
399
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhasePercentageDiscountAdjustment }
400
+
401
+ variant :minimum,
402
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMinimumAdjustment }
403
+
404
+ variant :maximum,
405
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMaximumAdjustment }
406
+
407
+ class PlanPhaseUsageDiscountAdjustment < Orb::Internal::Type::BaseModel
408
+ # @!attribute id
409
+ #
410
+ # @return [String]
411
+ required :id, String
412
+
413
+ # @!attribute adjustment_type
414
+ #
415
+ # @return [Symbol, :usage_discount]
416
+ required :adjustment_type, const: :usage_discount
417
+
418
+ # @!attribute applies_to_price_ids
419
+ # The price IDs that this adjustment applies to.
420
+ #
421
+ # @return [Array<String>]
422
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
423
+
424
+ # @!attribute is_invoice_level
425
+ # True for adjustments that apply to an entire invocice, false for adjustments
426
+ # that apply to only one price.
427
+ #
428
+ # @return [Boolean]
429
+ required :is_invoice_level, Orb::Internal::Type::Boolean
430
+
431
+ # @!attribute plan_phase_order
432
+ # The plan phase in which this adjustment is active.
433
+ #
434
+ # @return [Integer, nil]
435
+ required :plan_phase_order, Integer, nil?: true
436
+
437
+ # @!attribute reason
438
+ # The reason for the adjustment.
439
+ #
440
+ # @return [String, nil]
441
+ required :reason, String, nil?: true
442
+
443
+ # @!attribute usage_discount
444
+ # The number of usage units by which to discount the price this adjustment applies
445
+ # to in a given billing period.
446
+ #
447
+ # @return [Float]
448
+ required :usage_discount, Float
449
+
450
+ # @!parse
451
+ # # @param id [String]
452
+ # # @param applies_to_price_ids [Array<String>]
453
+ # # @param is_invoice_level [Boolean]
454
+ # # @param plan_phase_order [Integer, nil]
455
+ # # @param reason [String, nil]
456
+ # # @param usage_discount [Float]
457
+ # # @param adjustment_type [Symbol, :usage_discount]
458
+ # #
459
+ # def initialize(
460
+ # id:,
461
+ # applies_to_price_ids:,
462
+ # is_invoice_level:,
463
+ # plan_phase_order:,
464
+ # reason:,
465
+ # usage_discount:,
466
+ # adjustment_type: :usage_discount,
467
+ # **
468
+ # )
469
+ # super
470
+ # end
471
+
472
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
473
+ end
474
+
475
+ class PlanPhaseAmountDiscountAdjustment < Orb::Internal::Type::BaseModel
476
+ # @!attribute id
477
+ #
478
+ # @return [String]
479
+ required :id, String
480
+
481
+ # @!attribute adjustment_type
482
+ #
483
+ # @return [Symbol, :amount_discount]
484
+ required :adjustment_type, const: :amount_discount
485
+
486
+ # @!attribute amount_discount
487
+ # The amount by which to discount the prices this adjustment applies to in a given
488
+ # billing period.
489
+ #
490
+ # @return [String]
491
+ required :amount_discount, String
492
+
493
+ # @!attribute applies_to_price_ids
494
+ # The price IDs that this adjustment applies to.
495
+ #
496
+ # @return [Array<String>]
497
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
498
+
499
+ # @!attribute is_invoice_level
500
+ # True for adjustments that apply to an entire invocice, false for adjustments
501
+ # that apply to only one price.
502
+ #
503
+ # @return [Boolean]
504
+ required :is_invoice_level, Orb::Internal::Type::Boolean
505
+
506
+ # @!attribute plan_phase_order
507
+ # The plan phase in which this adjustment is active.
508
+ #
509
+ # @return [Integer, nil]
510
+ required :plan_phase_order, Integer, nil?: true
511
+
512
+ # @!attribute reason
513
+ # The reason for the adjustment.
514
+ #
515
+ # @return [String, nil]
516
+ required :reason, String, nil?: true
517
+
518
+ # @!parse
519
+ # # @param id [String]
520
+ # # @param amount_discount [String]
521
+ # # @param applies_to_price_ids [Array<String>]
522
+ # # @param is_invoice_level [Boolean]
523
+ # # @param plan_phase_order [Integer, nil]
524
+ # # @param reason [String, nil]
525
+ # # @param adjustment_type [Symbol, :amount_discount]
526
+ # #
527
+ # def initialize(
528
+ # id:,
529
+ # amount_discount:,
530
+ # applies_to_price_ids:,
531
+ # is_invoice_level:,
532
+ # plan_phase_order:,
533
+ # reason:,
534
+ # adjustment_type: :amount_discount,
535
+ # **
536
+ # )
537
+ # super
538
+ # end
539
+
540
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
541
+ end
542
+
543
+ class PlanPhasePercentageDiscountAdjustment < Orb::Internal::Type::BaseModel
544
+ # @!attribute id
545
+ #
546
+ # @return [String]
547
+ required :id, String
548
+
549
+ # @!attribute adjustment_type
550
+ #
551
+ # @return [Symbol, :percentage_discount]
552
+ required :adjustment_type, const: :percentage_discount
553
+
554
+ # @!attribute applies_to_price_ids
555
+ # The price IDs that this adjustment applies to.
556
+ #
557
+ # @return [Array<String>]
558
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
559
+
560
+ # @!attribute is_invoice_level
561
+ # True for adjustments that apply to an entire invocice, false for adjustments
562
+ # that apply to only one price.
563
+ #
564
+ # @return [Boolean]
565
+ required :is_invoice_level, Orb::Internal::Type::Boolean
566
+
567
+ # @!attribute percentage_discount
568
+ # The percentage (as a value between 0 and 1) by which to discount the price
569
+ # intervals this adjustment applies to in a given billing period.
570
+ #
571
+ # @return [Float]
572
+ required :percentage_discount, Float
573
+
574
+ # @!attribute plan_phase_order
575
+ # The plan phase in which this adjustment is active.
576
+ #
577
+ # @return [Integer, nil]
578
+ required :plan_phase_order, Integer, nil?: true
579
+
580
+ # @!attribute reason
581
+ # The reason for the adjustment.
582
+ #
583
+ # @return [String, nil]
584
+ required :reason, String, nil?: true
585
+
586
+ # @!parse
587
+ # # @param id [String]
588
+ # # @param applies_to_price_ids [Array<String>]
589
+ # # @param is_invoice_level [Boolean]
590
+ # # @param percentage_discount [Float]
591
+ # # @param plan_phase_order [Integer, nil]
592
+ # # @param reason [String, nil]
593
+ # # @param adjustment_type [Symbol, :percentage_discount]
594
+ # #
595
+ # def initialize(
596
+ # id:,
597
+ # applies_to_price_ids:,
598
+ # is_invoice_level:,
599
+ # percentage_discount:,
600
+ # plan_phase_order:,
601
+ # reason:,
602
+ # adjustment_type: :percentage_discount,
603
+ # **
604
+ # )
605
+ # super
606
+ # end
607
+
608
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
609
+ end
610
+
611
+ class PlanPhaseMinimumAdjustment < Orb::Internal::Type::BaseModel
612
+ # @!attribute id
613
+ #
614
+ # @return [String]
615
+ required :id, String
616
+
617
+ # @!attribute adjustment_type
618
+ #
619
+ # @return [Symbol, :minimum]
620
+ required :adjustment_type, const: :minimum
621
+
622
+ # @!attribute applies_to_price_ids
623
+ # The price IDs that this adjustment applies to.
624
+ #
625
+ # @return [Array<String>]
626
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
627
+
628
+ # @!attribute is_invoice_level
629
+ # True for adjustments that apply to an entire invocice, false for adjustments
630
+ # that apply to only one price.
631
+ #
632
+ # @return [Boolean]
633
+ required :is_invoice_level, Orb::Internal::Type::Boolean
634
+
635
+ # @!attribute item_id
636
+ # The item ID that revenue from this minimum will be attributed to.
637
+ #
638
+ # @return [String]
639
+ required :item_id, String
640
+
641
+ # @!attribute minimum_amount
642
+ # The minimum amount to charge in a given billing period for the prices this
643
+ # adjustment applies to.
644
+ #
645
+ # @return [String]
646
+ required :minimum_amount, String
647
+
648
+ # @!attribute plan_phase_order
649
+ # The plan phase in which this adjustment is active.
650
+ #
651
+ # @return [Integer, nil]
652
+ required :plan_phase_order, Integer, nil?: true
653
+
654
+ # @!attribute reason
655
+ # The reason for the adjustment.
656
+ #
657
+ # @return [String, nil]
658
+ required :reason, String, nil?: true
659
+
660
+ # @!parse
661
+ # # @param id [String]
662
+ # # @param applies_to_price_ids [Array<String>]
663
+ # # @param is_invoice_level [Boolean]
664
+ # # @param item_id [String]
665
+ # # @param minimum_amount [String]
666
+ # # @param plan_phase_order [Integer, nil]
667
+ # # @param reason [String, nil]
668
+ # # @param adjustment_type [Symbol, :minimum]
669
+ # #
670
+ # def initialize(
671
+ # id:,
672
+ # applies_to_price_ids:,
673
+ # is_invoice_level:,
674
+ # item_id:,
675
+ # minimum_amount:,
676
+ # plan_phase_order:,
677
+ # reason:,
678
+ # adjustment_type: :minimum,
679
+ # **
680
+ # )
681
+ # super
682
+ # end
683
+
684
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
685
+ end
686
+
687
+ class PlanPhaseMaximumAdjustment < Orb::Internal::Type::BaseModel
688
+ # @!attribute id
689
+ #
690
+ # @return [String]
691
+ required :id, String
692
+
693
+ # @!attribute adjustment_type
694
+ #
695
+ # @return [Symbol, :maximum]
696
+ required :adjustment_type, const: :maximum
697
+
698
+ # @!attribute applies_to_price_ids
699
+ # The price IDs that this adjustment applies to.
700
+ #
701
+ # @return [Array<String>]
702
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
703
+
704
+ # @!attribute is_invoice_level
705
+ # True for adjustments that apply to an entire invocice, false for adjustments
706
+ # that apply to only one price.
707
+ #
708
+ # @return [Boolean]
709
+ required :is_invoice_level, Orb::Internal::Type::Boolean
710
+
711
+ # @!attribute maximum_amount
712
+ # The maximum amount to charge in a given billing period for the prices this
713
+ # adjustment applies to.
714
+ #
715
+ # @return [String]
716
+ required :maximum_amount, String
717
+
718
+ # @!attribute plan_phase_order
719
+ # The plan phase in which this adjustment is active.
720
+ #
721
+ # @return [Integer, nil]
722
+ required :plan_phase_order, Integer, nil?: true
723
+
724
+ # @!attribute reason
725
+ # The reason for the adjustment.
726
+ #
727
+ # @return [String, nil]
728
+ required :reason, String, nil?: true
729
+
730
+ # @!parse
731
+ # # @param id [String]
732
+ # # @param applies_to_price_ids [Array<String>]
733
+ # # @param is_invoice_level [Boolean]
734
+ # # @param maximum_amount [String]
735
+ # # @param plan_phase_order [Integer, nil]
736
+ # # @param reason [String, nil]
737
+ # # @param adjustment_type [Symbol, :maximum]
738
+ # #
739
+ # def initialize(
740
+ # id:,
741
+ # applies_to_price_ids:,
742
+ # is_invoice_level:,
743
+ # maximum_amount:,
744
+ # plan_phase_order:,
745
+ # reason:,
746
+ # adjustment_type: :maximum,
747
+ # **
748
+ # )
749
+ # super
750
+ # end
751
+
752
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
753
+ end
754
+
755
+ # @!parse
756
+ # # @return [Array(Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseUsageDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseAmountDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhasePercentageDiscountAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMinimumAdjustment, Orb::Models::SubscriptionChangeCancelResponse::Subscription::AdjustmentInterval::Adjustment::PlanPhaseMaximumAdjustment)]
757
+ # def self.variants; end
758
+ end
759
+ end
760
+
761
+ # @see Orb::Models::SubscriptionChangeCancelResponse::Subscription#billing_cycle_anchor_configuration
762
+ class BillingCycleAnchorConfiguration < Orb::Internal::Type::BaseModel
763
+ # @!attribute day
764
+ # The day of the month on which the billing cycle is anchored. If the maximum
765
+ # number of days in a month is greater than this value, the last day of the month
766
+ # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
767
+ # period begins on the 30th.
768
+ #
769
+ # @return [Integer]
770
+ required :day, Integer
771
+
772
+ # @!attribute month
773
+ # The month on which the billing cycle is anchored (e.g. a quarterly price
774
+ # anchored in February would have cycles starting February, May, August, and
775
+ # November).
776
+ #
777
+ # @return [Integer, nil]
778
+ optional :month, Integer, nil?: true
779
+
780
+ # @!attribute year
781
+ # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
782
+ # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
783
+ #
784
+ # @return [Integer, nil]
785
+ optional :year, Integer, nil?: true
786
+
787
+ # @!parse
788
+ # # @param day [Integer]
789
+ # # @param month [Integer, nil]
790
+ # # @param year [Integer, nil]
791
+ # #
792
+ # def initialize(day:, month: nil, year: nil, **) = super
793
+
794
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
795
+ end
796
+
797
+ module DiscountInterval
798
+ extend Orb::Internal::Type::Union
799
+
800
+ discriminator :discount_type
801
+
802
+ variant :amount,
803
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::AmountDiscountInterval }
804
+
805
+ variant :percentage,
806
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::PercentageDiscountInterval }
807
+
808
+ variant :usage,
809
+ -> { Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::UsageDiscountInterval }
810
+
811
+ class AmountDiscountInterval < Orb::Internal::Type::BaseModel
812
+ # @!attribute amount_discount
813
+ # Only available if discount_type is `amount`.
814
+ #
815
+ # @return [String]
816
+ required :amount_discount, String
817
+
818
+ # @!attribute applies_to_price_ids
819
+ # The price ids that this discount interval applies to.
820
+ #
821
+ # @return [Array<String>]
822
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
823
+
824
+ # @!attribute applies_to_price_interval_ids
825
+ # The price interval ids that this discount interval applies to.
826
+ #
827
+ # @return [Array<String>]
828
+ required :applies_to_price_interval_ids, Orb::Internal::Type::ArrayOf[String]
829
+
830
+ # @!attribute discount_type
831
+ #
832
+ # @return [Symbol, :amount]
833
+ required :discount_type, const: :amount
834
+
835
+ # @!attribute end_date
836
+ # The end date of the discount interval.
837
+ #
838
+ # @return [Time, nil]
839
+ required :end_date, Time, nil?: true
840
+
841
+ # @!attribute start_date
842
+ # The start date of the discount interval.
843
+ #
844
+ # @return [Time]
845
+ required :start_date, Time
846
+
847
+ # @!parse
848
+ # # @param amount_discount [String]
849
+ # # @param applies_to_price_ids [Array<String>]
850
+ # # @param applies_to_price_interval_ids [Array<String>]
851
+ # # @param end_date [Time, nil]
852
+ # # @param start_date [Time]
853
+ # # @param discount_type [Symbol, :amount]
854
+ # #
855
+ # def initialize(
856
+ # amount_discount:,
857
+ # applies_to_price_ids:,
858
+ # applies_to_price_interval_ids:,
859
+ # end_date:,
860
+ # start_date:,
861
+ # discount_type: :amount,
862
+ # **
863
+ # )
864
+ # super
865
+ # end
866
+
867
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
868
+ end
869
+
870
+ class PercentageDiscountInterval < Orb::Internal::Type::BaseModel
871
+ # @!attribute applies_to_price_ids
872
+ # The price ids that this discount interval applies to.
873
+ #
874
+ # @return [Array<String>]
875
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
876
+
877
+ # @!attribute applies_to_price_interval_ids
878
+ # The price interval ids that this discount interval applies to.
879
+ #
880
+ # @return [Array<String>]
881
+ required :applies_to_price_interval_ids, Orb::Internal::Type::ArrayOf[String]
882
+
883
+ # @!attribute discount_type
884
+ #
885
+ # @return [Symbol, :percentage]
886
+ required :discount_type, const: :percentage
887
+
888
+ # @!attribute end_date
889
+ # The end date of the discount interval.
890
+ #
891
+ # @return [Time, nil]
892
+ required :end_date, Time, nil?: true
893
+
894
+ # @!attribute percentage_discount
895
+ # Only available if discount_type is `percentage`.This is a number between 0
896
+ # and 1.
897
+ #
898
+ # @return [Float]
899
+ required :percentage_discount, Float
900
+
901
+ # @!attribute start_date
902
+ # The start date of the discount interval.
903
+ #
904
+ # @return [Time]
905
+ required :start_date, Time
906
+
907
+ # @!parse
908
+ # # @param applies_to_price_ids [Array<String>]
909
+ # # @param applies_to_price_interval_ids [Array<String>]
910
+ # # @param end_date [Time, nil]
911
+ # # @param percentage_discount [Float]
912
+ # # @param start_date [Time]
913
+ # # @param discount_type [Symbol, :percentage]
914
+ # #
915
+ # def initialize(
916
+ # applies_to_price_ids:,
917
+ # applies_to_price_interval_ids:,
918
+ # end_date:,
919
+ # percentage_discount:,
920
+ # start_date:,
921
+ # discount_type: :percentage,
922
+ # **
923
+ # )
924
+ # super
925
+ # end
926
+
927
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
928
+ end
929
+
930
+ class UsageDiscountInterval < Orb::Internal::Type::BaseModel
931
+ # @!attribute applies_to_price_ids
932
+ # The price ids that this discount interval applies to.
933
+ #
934
+ # @return [Array<String>]
935
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
936
+
937
+ # @!attribute applies_to_price_interval_ids
938
+ # The price interval ids that this discount interval applies to.
939
+ #
940
+ # @return [Array<String>]
941
+ required :applies_to_price_interval_ids, Orb::Internal::Type::ArrayOf[String]
942
+
943
+ # @!attribute discount_type
944
+ #
945
+ # @return [Symbol, :usage]
946
+ required :discount_type, const: :usage
947
+
948
+ # @!attribute end_date
949
+ # The end date of the discount interval.
950
+ #
951
+ # @return [Time, nil]
952
+ required :end_date, Time, nil?: true
953
+
954
+ # @!attribute start_date
955
+ # The start date of the discount interval.
956
+ #
957
+ # @return [Time]
958
+ required :start_date, Time
959
+
960
+ # @!attribute usage_discount
961
+ # Only available if discount_type is `usage`. Number of usage units that this
962
+ # discount is for
963
+ #
964
+ # @return [Float]
965
+ required :usage_discount, Float
966
+
967
+ # @!parse
968
+ # # @param applies_to_price_ids [Array<String>]
969
+ # # @param applies_to_price_interval_ids [Array<String>]
970
+ # # @param end_date [Time, nil]
971
+ # # @param start_date [Time]
972
+ # # @param usage_discount [Float]
973
+ # # @param discount_type [Symbol, :usage]
974
+ # #
975
+ # def initialize(
976
+ # applies_to_price_ids:,
977
+ # applies_to_price_interval_ids:,
978
+ # end_date:,
979
+ # start_date:,
980
+ # usage_discount:,
981
+ # discount_type: :usage,
982
+ # **
983
+ # )
984
+ # super
985
+ # end
986
+
987
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
988
+ end
989
+
990
+ # @!parse
991
+ # # @return [Array(Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::AmountDiscountInterval, Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::PercentageDiscountInterval, Orb::Models::SubscriptionChangeCancelResponse::Subscription::DiscountInterval::UsageDiscountInterval)]
992
+ # def self.variants; end
993
+ end
994
+
995
+ class FixedFeeQuantitySchedule < Orb::Internal::Type::BaseModel
996
+ # @!attribute end_date
997
+ #
998
+ # @return [Time, nil]
999
+ required :end_date, Time, nil?: true
1000
+
1001
+ # @!attribute price_id
1002
+ #
1003
+ # @return [String]
1004
+ required :price_id, String
1005
+
1006
+ # @!attribute quantity
1007
+ #
1008
+ # @return [Float]
1009
+ required :quantity, Float
1010
+
1011
+ # @!attribute start_date
1012
+ #
1013
+ # @return [Time]
1014
+ required :start_date, Time
1015
+
1016
+ # @!parse
1017
+ # # @param end_date [Time, nil]
1018
+ # # @param price_id [String]
1019
+ # # @param quantity [Float]
1020
+ # # @param start_date [Time]
1021
+ # #
1022
+ # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super
1023
+
1024
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1025
+ end
1026
+
1027
+ class MaximumInterval < Orb::Internal::Type::BaseModel
1028
+ # @!attribute applies_to_price_ids
1029
+ # The price ids that this maximum interval applies to.
1030
+ #
1031
+ # @return [Array<String>]
1032
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
1033
+
1034
+ # @!attribute applies_to_price_interval_ids
1035
+ # The price interval ids that this maximum interval applies to.
1036
+ #
1037
+ # @return [Array<String>]
1038
+ required :applies_to_price_interval_ids, Orb::Internal::Type::ArrayOf[String]
1039
+
1040
+ # @!attribute end_date
1041
+ # The end date of the maximum interval.
1042
+ #
1043
+ # @return [Time, nil]
1044
+ required :end_date, Time, nil?: true
1045
+
1046
+ # @!attribute maximum_amount
1047
+ # The maximum amount to charge in a given billing period for the price intervals
1048
+ # this transform applies to.
1049
+ #
1050
+ # @return [String]
1051
+ required :maximum_amount, String
1052
+
1053
+ # @!attribute start_date
1054
+ # The start date of the maximum interval.
1055
+ #
1056
+ # @return [Time]
1057
+ required :start_date, Time
1058
+
1059
+ # @!parse
1060
+ # # @param applies_to_price_ids [Array<String>]
1061
+ # # @param applies_to_price_interval_ids [Array<String>]
1062
+ # # @param end_date [Time, nil]
1063
+ # # @param maximum_amount [String]
1064
+ # # @param start_date [Time]
1065
+ # #
1066
+ # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super
1067
+
1068
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1069
+ end
1070
+
1071
+ class MinimumInterval < Orb::Internal::Type::BaseModel
1072
+ # @!attribute applies_to_price_ids
1073
+ # The price ids that this minimum interval applies to.
1074
+ #
1075
+ # @return [Array<String>]
1076
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
1077
+
1078
+ # @!attribute applies_to_price_interval_ids
1079
+ # The price interval ids that this minimum interval applies to.
1080
+ #
1081
+ # @return [Array<String>]
1082
+ required :applies_to_price_interval_ids, Orb::Internal::Type::ArrayOf[String]
1083
+
1084
+ # @!attribute end_date
1085
+ # The end date of the minimum interval.
1086
+ #
1087
+ # @return [Time, nil]
1088
+ required :end_date, Time, nil?: true
1089
+
1090
+ # @!attribute minimum_amount
1091
+ # The minimum amount to charge in a given billing period for the price intervals
1092
+ # this minimum applies to.
1093
+ #
1094
+ # @return [String]
1095
+ required :minimum_amount, String
1096
+
1097
+ # @!attribute start_date
1098
+ # The start date of the minimum interval.
1099
+ #
1100
+ # @return [Time]
1101
+ required :start_date, Time
1102
+
1103
+ # @!parse
1104
+ # # @param applies_to_price_ids [Array<String>]
1105
+ # # @param applies_to_price_interval_ids [Array<String>]
1106
+ # # @param end_date [Time, nil]
1107
+ # # @param minimum_amount [String]
1108
+ # # @param start_date [Time]
1109
+ # #
1110
+ # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super
1111
+
1112
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1113
+ end
1114
+
1115
+ # @see Orb::Models::SubscriptionChangeCancelResponse::Subscription#pending_subscription_change
1116
+ class PendingSubscriptionChange < Orb::Internal::Type::BaseModel
1117
+ # @!attribute id
1118
+ #
1119
+ # @return [String]
1120
+ required :id, String
1121
+
1122
+ # @!parse
1123
+ # # A pending subscription change if one exists on this subscription.
1124
+ # #
1125
+ # # @param id [String]
1126
+ # #
1127
+ # def initialize(id:, **) = super
1128
+
1129
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1130
+ end
1131
+
1132
+ class PriceInterval < Orb::Internal::Type::BaseModel
1133
+ # @!attribute id
1134
+ #
1135
+ # @return [String]
1136
+ required :id, String
1137
+
1138
+ # @!attribute billing_cycle_day
1139
+ # The day of the month that Orb bills for this price
1140
+ #
1141
+ # @return [Integer]
1142
+ required :billing_cycle_day, Integer
1143
+
1144
+ # @!attribute current_billing_period_end_date
1145
+ # The end of the current billing period. This is an exclusive timestamp, such that
1146
+ # the instant returned is exactly the end of the billing period. Set to null if
1147
+ # this price interval is not currently active.
1148
+ #
1149
+ # @return [Time, nil]
1150
+ required :current_billing_period_end_date, Time, nil?: true
1151
+
1152
+ # @!attribute current_billing_period_start_date
1153
+ # The start date of the current billing period. This is an inclusive timestamp;
1154
+ # the instant returned is exactly the beginning of the billing period. Set to null
1155
+ # if this price interval is not currently active.
1156
+ #
1157
+ # @return [Time, nil]
1158
+ required :current_billing_period_start_date, Time, nil?: true
1159
+
1160
+ # @!attribute end_date
1161
+ # The end date of the price interval. This is the date that Orb stops billing for
1162
+ # this price.
1163
+ #
1164
+ # @return [Time, nil]
1165
+ required :end_date, Time, nil?: true
1166
+
1167
+ # @!attribute filter
1168
+ # An additional filter to apply to usage queries.
1169
+ #
1170
+ # @return [String, nil]
1171
+ required :filter, String, nil?: true
1172
+
1173
+ # @!attribute fixed_fee_quantity_transitions
1174
+ # The fixed fee quantity transitions for this price interval. This is only
1175
+ # relevant for fixed fees.
1176
+ #
1177
+ # @return [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::PriceInterval::FixedFeeQuantityTransition>, nil]
1178
+ required :fixed_fee_quantity_transitions,
1179
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::SubscriptionChangeCancelResponse::Subscription::PriceInterval::FixedFeeQuantityTransition] },
1180
+ nil?: true
1181
+
1182
+ # @!attribute price
1183
+ # The Price resource represents a price that can be billed on a subscription,
1184
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
1185
+ # take a quantity and determine an amount to bill.
1186
+ #
1187
+ # Orb supports a few different pricing models out of the box. Each of these models
1188
+ # is serialized differently in a given Price object. The model_type field
1189
+ # determines the key for the configuration object that is present.
1190
+ #
1191
+ # For more on the types of prices, see
1192
+ # [the core concepts documentation](/core-concepts#plan-and-price)
1193
+ #
1194
+ # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice, Orb::Models::Price::CumulativeGroupedBulkPrice]
1195
+ required :price, union: -> { Orb::Models::Price }
1196
+
1197
+ # @!attribute start_date
1198
+ # The start date of the price interval. This is the date that Orb starts billing
1199
+ # for this price.
1200
+ #
1201
+ # @return [Time]
1202
+ required :start_date, Time
1203
+
1204
+ # @!attribute usage_customer_ids
1205
+ # A list of customer IDs whose usage events will be aggregated and billed under
1206
+ # this price interval.
1207
+ #
1208
+ # @return [Array<String>, nil]
1209
+ required :usage_customer_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
1210
+
1211
+ # @!parse
1212
+ # # The Price Interval resource represents a period of time for which a price will
1213
+ # # bill on a subscription. A subscription’s price intervals define its billing
1214
+ # # behavior.
1215
+ # #
1216
+ # # @param id [String]
1217
+ # # @param billing_cycle_day [Integer]
1218
+ # # @param current_billing_period_end_date [Time, nil]
1219
+ # # @param current_billing_period_start_date [Time, nil]
1220
+ # # @param end_date [Time, nil]
1221
+ # # @param filter [String, nil]
1222
+ # # @param fixed_fee_quantity_transitions [Array<Orb::Models::SubscriptionChangeCancelResponse::Subscription::PriceInterval::FixedFeeQuantityTransition>, nil]
1223
+ # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice, Orb::Models::Price::CumulativeGroupedBulkPrice]
1224
+ # # @param start_date [Time]
1225
+ # # @param usage_customer_ids [Array<String>, nil]
1226
+ # #
1227
+ # def initialize(
1228
+ # id:,
1229
+ # billing_cycle_day:,
1230
+ # current_billing_period_end_date:,
1231
+ # current_billing_period_start_date:,
1232
+ # end_date:,
1233
+ # filter:,
1234
+ # fixed_fee_quantity_transitions:,
1235
+ # price:,
1236
+ # start_date:,
1237
+ # usage_customer_ids:,
1238
+ # **
1239
+ # )
1240
+ # super
1241
+ # end
1242
+
1243
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1244
+
1245
+ class FixedFeeQuantityTransition < Orb::Internal::Type::BaseModel
1246
+ # @!attribute effective_date
1247
+ #
1248
+ # @return [Time]
1249
+ required :effective_date, Time
1250
+
1251
+ # @!attribute price_id
1252
+ #
1253
+ # @return [String]
1254
+ required :price_id, String
1255
+
1256
+ # @!attribute quantity
1257
+ #
1258
+ # @return [Integer]
1259
+ required :quantity, Integer
1260
+
1261
+ # @!parse
1262
+ # # @param effective_date [Time]
1263
+ # # @param price_id [String]
1264
+ # # @param quantity [Integer]
1265
+ # #
1266
+ # def initialize(effective_date:, price_id:, quantity:, **) = super
1267
+
1268
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1269
+ end
1270
+ end
1271
+
1272
+ # @see Orb::Models::SubscriptionChangeCancelResponse::Subscription#redeemed_coupon
1273
+ class RedeemedCoupon < Orb::Internal::Type::BaseModel
1274
+ # @!attribute coupon_id
1275
+ #
1276
+ # @return [String]
1277
+ required :coupon_id, String
1278
+
1279
+ # @!attribute end_date
1280
+ #
1281
+ # @return [Time, nil]
1282
+ required :end_date, Time, nil?: true
1283
+
1284
+ # @!attribute start_date
1285
+ #
1286
+ # @return [Time]
1287
+ required :start_date, Time
1288
+
1289
+ # @!parse
1290
+ # # @param coupon_id [String]
1291
+ # # @param end_date [Time, nil]
1292
+ # # @param start_date [Time]
1293
+ # #
1294
+ # def initialize(coupon_id:, end_date:, start_date:, **) = super
1295
+
1296
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1297
+ end
1298
+
1299
+ # @see Orb::Models::SubscriptionChangeCancelResponse::Subscription#status
1300
+ module Status
1301
+ extend Orb::Internal::Type::Enum
1302
+
1303
+ ACTIVE = :active
1304
+ ENDED = :ended
1305
+ UPCOMING = :upcoming
1306
+
1307
+ finalize!
1308
+
1309
+ # @!parse
1310
+ # # @return [Array<Symbol>]
1311
+ # def self.values; end
1312
+ end
1313
+
1314
+ # @see Orb::Models::SubscriptionChangeCancelResponse::Subscription#trial_info
1315
+ class TrialInfo < Orb::Internal::Type::BaseModel
1316
+ # @!attribute end_date
1317
+ #
1318
+ # @return [Time, nil]
1319
+ required :end_date, Time, nil?: true
1320
+
1321
+ # @!parse
1322
+ # # @param end_date [Time, nil]
1323
+ # #
1324
+ # def initialize(end_date:, **) = super
1325
+
1326
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1327
+ end
1328
+
1329
+ # @see Orb::Models::SubscriptionChangeCancelResponse::Subscription#changed_resources
1330
+ class ChangedResources < Orb::Internal::Type::BaseModel
1331
+ # @!attribute created_credit_notes
1332
+ # The credit notes that were created as part of this operation.
1333
+ #
1334
+ # @return [Array<Orb::Models::CreditNote>]
1335
+ required :created_credit_notes, -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditNote] }
1336
+
1337
+ # @!attribute created_invoices
1338
+ # The invoices that were created as part of this operation.
1339
+ #
1340
+ # @return [Array<Orb::Models::Invoice>]
1341
+ required :created_invoices, -> { Orb::Internal::Type::ArrayOf[Orb::Models::Invoice] }
1342
+
1343
+ # @!attribute voided_credit_notes
1344
+ # The credit notes that were voided as part of this operation.
1345
+ #
1346
+ # @return [Array<Orb::Models::CreditNote>]
1347
+ required :voided_credit_notes, -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditNote] }
1348
+
1349
+ # @!attribute voided_invoices
1350
+ # The invoices that were voided as part of this operation.
1351
+ #
1352
+ # @return [Array<Orb::Models::Invoice>]
1353
+ required :voided_invoices, -> { Orb::Internal::Type::ArrayOf[Orb::Models::Invoice] }
1354
+
1355
+ # @!parse
1356
+ # # The resources that were changed as part of this operation. Only present when
1357
+ # # fetched through the subscription changes API or if the
1358
+ # # `include_changed_resources` parameter was passed in the request.
1359
+ # #
1360
+ # # @param created_credit_notes [Array<Orb::Models::CreditNote>]
1361
+ # # @param created_invoices [Array<Orb::Models::Invoice>]
1362
+ # # @param voided_credit_notes [Array<Orb::Models::CreditNote>]
1363
+ # # @param voided_invoices [Array<Orb::Models::Invoice>]
1364
+ # #
1365
+ # def initialize(created_credit_notes:, created_invoices:, voided_credit_notes:, voided_invoices:, **) = super
1366
+
1367
+ # def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1368
+ end
1369
+ end
1370
+ end
1371
+ end
1372
+ end