orb-billing 0.2.0 → 0.3.0

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 (374) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +59 -49
  4. data/lib/orb/client.rb +4 -4
  5. data/lib/orb/file_part.rb +55 -0
  6. data/lib/orb/internal/page.rb +4 -8
  7. data/lib/orb/internal/transport/base_client.rb +7 -7
  8. data/lib/orb/internal/transport/pooled_net_requester.rb +2 -2
  9. data/lib/orb/internal/type/array_of.rb +11 -0
  10. data/lib/orb/internal/type/base_model.rb +32 -14
  11. data/lib/orb/internal/type/base_page.rb +9 -1
  12. data/lib/orb/internal/type/boolean.rb +4 -0
  13. data/lib/orb/internal/type/converter.rb +4 -1
  14. data/lib/orb/internal/type/enum.rb +9 -5
  15. data/lib/orb/internal/type/{io_like.rb → file_input.rb} +33 -15
  16. data/lib/orb/internal/type/hash_of.rb +11 -0
  17. data/lib/orb/internal/type/request_parameters.rb +1 -2
  18. data/lib/orb/internal/type/union.rb +10 -1
  19. data/lib/orb/internal/type/unknown.rb +4 -0
  20. data/lib/orb/internal/util.rb +69 -61
  21. data/lib/orb/internal.rb +0 -1
  22. data/lib/orb/models/alert.rb +68 -71
  23. data/lib/orb/models/alert_create_for_customer_params.rb +20 -25
  24. data/lib/orb/models/alert_create_for_external_customer_params.rb +20 -25
  25. data/lib/orb/models/alert_create_for_subscription_params.rb +20 -25
  26. data/lib/orb/models/alert_disable_params.rb +5 -9
  27. data/lib/orb/models/alert_enable_params.rb +5 -9
  28. data/lib/orb/models/alert_list_params.rb +26 -36
  29. data/lib/orb/models/alert_retrieve_params.rb +3 -8
  30. data/lib/orb/models/alert_update_params.rb +14 -18
  31. data/lib/orb/models/amount_discount.rb +14 -14
  32. data/lib/orb/models/billable_metric.rb +23 -20
  33. data/lib/orb/models/billing_cycle_relative_date.rb +2 -5
  34. data/lib/orb/models/coupon.rb +28 -21
  35. data/lib/orb/models/coupon_archive_params.rb +3 -8
  36. data/lib/orb/models/coupon_create_params.rb +24 -29
  37. data/lib/orb/models/coupon_fetch_params.rb +3 -8
  38. data/lib/orb/models/coupon_list_params.rb +17 -17
  39. data/lib/orb/models/coupons/subscription_list_params.rb +12 -15
  40. data/lib/orb/models/credit_note.rb +100 -166
  41. data/lib/orb/models/credit_note_create_params.rb +15 -23
  42. data/lib/orb/models/credit_note_fetch_params.rb +3 -8
  43. data/lib/orb/models/credit_note_list_params.rb +20 -30
  44. data/lib/orb/models/customer.rb +224 -271
  45. data/lib/orb/models/customer_create_params.rb +211 -252
  46. data/lib/orb/models/customer_delete_params.rb +3 -8
  47. data/lib/orb/models/customer_fetch_by_external_id_params.rb +3 -8
  48. data/lib/orb/models/customer_fetch_params.rb +3 -8
  49. data/lib/orb/models/customer_list_params.rb +20 -30
  50. data/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb +3 -8
  51. data/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb +3 -8
  52. data/lib/orb/models/customer_update_by_external_id_params.rb +207 -250
  53. data/lib/orb/models/customer_update_params.rb +207 -250
  54. data/lib/orb/models/customers/balance_transaction_create_params.rb +11 -16
  55. data/lib/orb/models/customers/balance_transaction_create_response.rb +33 -51
  56. data/lib/orb/models/customers/balance_transaction_list_params.rb +20 -30
  57. data/lib/orb/models/customers/balance_transaction_list_response.rb +33 -51
  58. data/lib/orb/models/customers/cost_list_by_external_id_params.rb +17 -17
  59. data/lib/orb/models/customers/cost_list_by_external_id_response.rb +22 -26
  60. data/lib/orb/models/customers/cost_list_params.rb +17 -17
  61. data/lib/orb/models/customers/cost_list_response.rb +22 -26
  62. data/lib/orb/models/customers/credit_list_by_external_id_params.rb +18 -22
  63. data/lib/orb/models/customers/credit_list_by_external_id_response.rb +10 -17
  64. data/lib/orb/models/customers/credit_list_params.rb +18 -22
  65. data/lib/orb/models/customers/credit_list_response.rb +10 -17
  66. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +64 -66
  67. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +300 -406
  68. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +63 -66
  69. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +300 -406
  70. data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +33 -48
  71. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +300 -406
  72. data/lib/orb/models/customers/credits/ledger_list_params.rb +32 -48
  73. data/lib/orb/models/customers/credits/ledger_list_response.rb +300 -406
  74. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +47 -50
  75. data/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb +43 -46
  76. data/lib/orb/models/customers/credits/top_up_create_params.rb +46 -50
  77. data/lib/orb/models/customers/credits/top_up_create_response.rb +42 -46
  78. data/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb +4 -9
  79. data/lib/orb/models/customers/credits/top_up_delete_params.rb +4 -9
  80. data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +12 -15
  81. data/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb +43 -46
  82. data/lib/orb/models/customers/credits/top_up_list_params.rb +12 -15
  83. data/lib/orb/models/customers/credits/top_up_list_response.rb +42 -46
  84. data/lib/orb/models/dimensional_price_group.rb +21 -15
  85. data/lib/orb/models/dimensional_price_group_create_params.rb +17 -23
  86. data/lib/orb/models/dimensional_price_group_list_params.rb +12 -15
  87. data/lib/orb/models/dimensional_price_group_retrieve_params.rb +3 -8
  88. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb +3 -8
  89. data/lib/orb/models/dimensional_price_groups.rb +3 -7
  90. data/lib/orb/models/discount.rb +2 -3
  91. data/lib/orb/models/evaluate_price_group.rb +8 -11
  92. data/lib/orb/models/event_deprecate_params.rb +3 -8
  93. data/lib/orb/models/event_deprecate_response.rb +2 -6
  94. data/lib/orb/models/event_ingest_params.rb +33 -27
  95. data/lib/orb/models/event_ingest_response.rb +23 -24
  96. data/lib/orb/models/event_search_params.rb +15 -11
  97. data/lib/orb/models/event_search_response.rb +27 -22
  98. data/lib/orb/models/event_update_params.rb +19 -13
  99. data/lib/orb/models/event_update_response.rb +2 -6
  100. data/lib/orb/models/events/backfill_close_params.rb +3 -8
  101. data/lib/orb/models/events/backfill_close_response.rb +34 -39
  102. data/lib/orb/models/events/backfill_create_params.rb +28 -32
  103. data/lib/orb/models/events/backfill_create_response.rb +34 -39
  104. data/lib/orb/models/events/backfill_fetch_params.rb +3 -8
  105. data/lib/orb/models/events/backfill_fetch_response.rb +34 -39
  106. data/lib/orb/models/events/backfill_list_params.rb +12 -15
  107. data/lib/orb/models/events/backfill_list_response.rb +34 -39
  108. data/lib/orb/models/events/backfill_revert_params.rb +3 -8
  109. data/lib/orb/models/events/backfill_revert_response.rb +34 -39
  110. data/lib/orb/models/events/event_volumes.rb +11 -17
  111. data/lib/orb/models/events/volume_list_params.rb +19 -22
  112. data/lib/orb/models/invoice.rb +589 -637
  113. data/lib/orb/models/invoice_create_params.rb +52 -61
  114. data/lib/orb/models/invoice_fetch_params.rb +3 -8
  115. data/lib/orb/models/invoice_fetch_upcoming_params.rb +4 -9
  116. data/lib/orb/models/invoice_fetch_upcoming_response.rb +584 -631
  117. data/lib/orb/models/invoice_issue_params.rb +10 -14
  118. data/lib/orb/models/invoice_level_discount.rb +2 -3
  119. data/lib/orb/models/invoice_line_item_create_params.rb +19 -14
  120. data/lib/orb/models/invoice_line_item_create_response.rb +247 -269
  121. data/lib/orb/models/invoice_list_params.rb +51 -66
  122. data/lib/orb/models/invoice_mark_paid_params.rb +9 -11
  123. data/lib/orb/models/invoice_pay_params.rb +3 -8
  124. data/lib/orb/models/invoice_update_params.rb +9 -9
  125. data/lib/orb/models/invoice_void_params.rb +3 -8
  126. data/lib/orb/models/item.rb +14 -25
  127. data/lib/orb/models/item_create_params.rb +5 -9
  128. data/lib/orb/models/item_fetch_params.rb +3 -8
  129. data/lib/orb/models/item_list_params.rb +12 -15
  130. data/lib/orb/models/item_update_params.rb +10 -22
  131. data/lib/orb/models/metric_create_params.rb +17 -13
  132. data/lib/orb/models/metric_fetch_params.rb +3 -8
  133. data/lib/orb/models/metric_list_params.rb +20 -30
  134. data/lib/orb/models/metric_update_params.rb +9 -9
  135. data/lib/orb/models/pagination_metadata.rb +3 -7
  136. data/lib/orb/models/percentage_discount.rb +15 -14
  137. data/lib/orb/models/plan.rb +250 -279
  138. data/lib/orb/models/plan_create_params.rb +1623 -1984
  139. data/lib/orb/models/plan_fetch_params.rb +3 -8
  140. data/lib/orb/models/plan_list_params.rb +25 -42
  141. data/lib/orb/models/plan_update_params.rb +12 -10
  142. data/lib/orb/models/plans/external_plan_id_fetch_params.rb +3 -8
  143. data/lib/orb/models/plans/external_plan_id_update_params.rb +12 -10
  144. data/lib/orb/models/price.rb +2709 -3820
  145. data/lib/orb/models/price_create_params.rb +203 -244
  146. data/lib/orb/models/price_evaluate_params.rb +21 -30
  147. data/lib/orb/models/price_evaluate_response.rb +2 -6
  148. data/lib/orb/models/price_fetch_params.rb +3 -8
  149. data/lib/orb/models/price_list_params.rb +12 -15
  150. data/lib/orb/models/price_update_params.rb +9 -9
  151. data/lib/orb/models/prices/external_price_id_fetch_params.rb +3 -8
  152. data/lib/orb/models/prices/external_price_id_update_params.rb +9 -9
  153. data/lib/orb/models/subscription.rb +343 -382
  154. data/lib/orb/models/subscription_cancel_params.rb +16 -16
  155. data/lib/orb/models/subscription_cancel_response.rb +339 -377
  156. data/lib/orb/models/subscription_change_apply_params.rb +7 -10
  157. data/lib/orb/models/subscription_change_apply_response.rb +365 -398
  158. data/lib/orb/models/subscription_change_cancel_params.rb +3 -8
  159. data/lib/orb/models/subscription_change_cancel_response.rb +365 -398
  160. data/lib/orb/models/subscription_change_retrieve_params.rb +3 -8
  161. data/lib/orb/models/subscription_change_retrieve_response.rb +366 -398
  162. data/lib/orb/models/subscription_create_params.rb +3771 -4402
  163. data/lib/orb/models/subscription_create_response.rb +339 -377
  164. data/lib/orb/models/subscription_fetch_costs_params.rb +17 -17
  165. data/lib/orb/models/subscription_fetch_costs_response.rb +22 -26
  166. data/lib/orb/models/subscription_fetch_params.rb +3 -8
  167. data/lib/orb/models/subscription_fetch_schedule_params.rb +20 -30
  168. data/lib/orb/models/subscription_fetch_schedule_response.rb +15 -17
  169. data/lib/orb/models/subscription_fetch_usage_params.rb +32 -43
  170. data/lib/orb/models/subscription_list_params.rb +28 -41
  171. data/lib/orb/models/subscription_price_intervals_params.rb +2018 -2472
  172. data/lib/orb/models/subscription_price_intervals_response.rb +342 -377
  173. data/lib/orb/models/subscription_schedule_plan_change_params.rb +3764 -4392
  174. data/lib/orb/models/subscription_schedule_plan_change_response.rb +342 -377
  175. data/lib/orb/models/subscription_trigger_phase_params.rb +12 -10
  176. data/lib/orb/models/subscription_trigger_phase_response.rb +341 -377
  177. data/lib/orb/models/subscription_unschedule_cancellation_params.rb +3 -8
  178. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +342 -377
  179. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb +5 -9
  180. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +343 -377
  181. data/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb +3 -8
  182. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +343 -377
  183. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +22 -33
  184. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +342 -377
  185. data/lib/orb/models/subscription_update_params.rb +21 -23
  186. data/lib/orb/models/subscription_update_trial_params.rb +15 -18
  187. data/lib/orb/models/subscription_update_trial_response.rb +341 -377
  188. data/lib/orb/models/subscription_usage.rb +37 -80
  189. data/lib/orb/models/subscriptions.rb +3 -7
  190. data/lib/orb/models/top_level_ping_params.rb +3 -8
  191. data/lib/orb/models/top_level_ping_response.rb +2 -6
  192. data/lib/orb/models/trial_discount.rb +16 -24
  193. data/lib/orb/models/usage_discount.rb +15 -14
  194. data/lib/orb/request_options.rb +3 -4
  195. data/lib/orb/resources/alerts.rb +48 -17
  196. data/lib/orb/resources/coupons/subscriptions.rb +9 -2
  197. data/lib/orb/resources/coupons.rb +25 -7
  198. data/lib/orb/resources/credit_notes.rb +17 -4
  199. data/lib/orb/resources/customers/balance_transactions.rb +18 -3
  200. data/lib/orb/resources/customers/costs.rb +26 -8
  201. data/lib/orb/resources/customers/credits/ledger.rb +108 -28
  202. data/lib/orb/resources/customers/credits/top_ups.rb +67 -20
  203. data/lib/orb/resources/customers/credits.rb +28 -8
  204. data/lib/orb/resources/customers.rb +135 -36
  205. data/lib/orb/resources/dimensional_price_groups.rb +19 -4
  206. data/lib/orb/resources/events/backfills.rb +32 -9
  207. data/lib/orb/resources/events/volume.rb +14 -4
  208. data/lib/orb/resources/events.rb +40 -11
  209. data/lib/orb/resources/invoice_line_items.rb +16 -6
  210. data/lib/orb/resources/invoices.rb +77 -17
  211. data/lib/orb/resources/items.rb +10 -3
  212. data/lib/orb/resources/metrics.rb +33 -8
  213. data/lib/orb/resources/plans/external_plan_id.rb +10 -2
  214. data/lib/orb/resources/plans.rb +47 -11
  215. data/lib/orb/resources/prices/external_price_id.rb +7 -1
  216. data/lib/orb/resources/prices.rb +97 -22
  217. data/lib/orb/resources/subscription_changes.rb +5 -2
  218. data/lib/orb/resources/subscriptions.rb +292 -78
  219. data/lib/orb/version.rb +1 -1
  220. data/lib/orb.rb +2 -10
  221. data/rbi/lib/orb/client.rbi +4 -4
  222. data/rbi/lib/orb/file_part.rbi +34 -0
  223. data/rbi/lib/orb/internal/transport/base_client.rbi +17 -3
  224. data/rbi/lib/orb/internal/type/array_of.rbi +3 -0
  225. data/rbi/lib/orb/internal/type/base_model.rbi +7 -1
  226. data/rbi/lib/orb/internal/type/base_page.rbi +2 -0
  227. data/rbi/lib/orb/internal/type/enum.rbi +3 -6
  228. data/rbi/lib/orb/internal/type/{io_like.rbi → file_input.rbi} +5 -2
  229. data/rbi/lib/orb/internal/type/hash_of.rbi +3 -0
  230. data/rbi/lib/orb/internal/type/union.rbi +3 -0
  231. data/rbi/lib/orb/internal/util.rbi +24 -19
  232. data/rbi/lib/orb/internal.rbi +0 -1
  233. data/rbi/lib/orb/models/alert.rbi +28 -8
  234. data/rbi/lib/orb/models/alert_create_for_customer_params.rbi +16 -6
  235. data/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi +16 -6
  236. data/rbi/lib/orb/models/alert_create_for_subscription_params.rbi +16 -6
  237. data/rbi/lib/orb/models/alert_disable_params.rbi +5 -2
  238. data/rbi/lib/orb/models/alert_enable_params.rbi +5 -2
  239. data/rbi/lib/orb/models/alert_list_params.rbi +6 -0
  240. data/rbi/lib/orb/models/alert_update_params.rbi +11 -4
  241. data/rbi/lib/orb/models/amount_discount.rbi +10 -4
  242. data/rbi/lib/orb/models/billable_metric.rbi +16 -3
  243. data/rbi/lib/orb/models/billing_cycle_relative_date.rbi +1 -1
  244. data/rbi/lib/orb/models/coupon.rbi +10 -3
  245. data/rbi/lib/orb/models/coupon_create_params.rbi +6 -3
  246. data/rbi/lib/orb/models/coupon_list_params.rbi +13 -3
  247. data/rbi/lib/orb/models/coupons/subscription_list_params.rbi +8 -2
  248. data/rbi/lib/orb/models/credit_note.rbi +44 -12
  249. data/rbi/lib/orb/models/credit_note_create_params.rbi +15 -6
  250. data/rbi/lib/orb/models/credit_note_list_params.rbi +3 -0
  251. data/rbi/lib/orb/models/customer.rbi +130 -11
  252. data/rbi/lib/orb/models/customer_create_params.rbi +142 -8
  253. data/rbi/lib/orb/models/customer_list_params.rbi +3 -0
  254. data/rbi/lib/orb/models/customer_update_by_external_id_params.rbi +140 -8
  255. data/rbi/lib/orb/models/customer_update_params.rbi +140 -8
  256. data/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi +8 -4
  257. data/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi +18 -8
  258. data/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi +3 -0
  259. data/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi +18 -8
  260. data/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi +9 -5
  261. data/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi +21 -4
  262. data/rbi/lib/orb/models/customers/cost_list_params.rbi +9 -5
  263. data/rbi/lib/orb/models/customers/cost_list_response.rbi +21 -4
  264. data/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi +13 -3
  265. data/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi +1 -2
  266. data/rbi/lib/orb/models/customers/credit_list_params.rbi +13 -3
  267. data/rbi/lib/orb/models/customers/credit_list_response.rbi +1 -2
  268. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +40 -18
  269. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +35 -56
  270. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi +40 -6
  271. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi +35 -56
  272. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +6 -16
  273. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +35 -56
  274. data/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi +6 -4
  275. data/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi +35 -56
  276. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +27 -10
  277. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi +25 -10
  278. data/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi +27 -4
  279. data/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi +25 -10
  280. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +8 -2
  281. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi +25 -10
  282. data/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi +8 -2
  283. data/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi +25 -4
  284. data/rbi/lib/orb/models/dimensional_price_group.rbi +11 -3
  285. data/rbi/lib/orb/models/dimensional_price_group_create_params.rbi +4 -0
  286. data/rbi/lib/orb/models/dimensional_price_group_list_params.rbi +8 -2
  287. data/rbi/lib/orb/models/evaluate_price_group.rbi +8 -2
  288. data/rbi/lib/orb/models/event_deprecate_response.rbi +4 -2
  289. data/rbi/lib/orb/models/event_ingest_params.rbi +22 -5
  290. data/rbi/lib/orb/models/event_ingest_response.rbi +15 -4
  291. data/rbi/lib/orb/models/event_search_params.rbi +14 -2
  292. data/rbi/lib/orb/models/event_search_response.rbi +14 -3
  293. data/rbi/lib/orb/models/event_update_params.rbi +10 -3
  294. data/rbi/lib/orb/models/event_update_response.rbi +4 -2
  295. data/rbi/lib/orb/models/events/backfill_close_response.rbi +14 -2
  296. data/rbi/lib/orb/models/events/backfill_create_params.rbi +18 -0
  297. data/rbi/lib/orb/models/events/backfill_create_response.rbi +14 -2
  298. data/rbi/lib/orb/models/events/backfill_fetch_response.rbi +14 -2
  299. data/rbi/lib/orb/models/events/backfill_list_params.rbi +8 -2
  300. data/rbi/lib/orb/models/events/backfill_list_response.rbi +14 -2
  301. data/rbi/lib/orb/models/events/backfill_revert_response.rbi +14 -2
  302. data/rbi/lib/orb/models/events/event_volumes.rbi +6 -2
  303. data/rbi/lib/orb/models/events/volume_list_params.rbi +18 -2
  304. data/rbi/lib/orb/models/invoice.rbi +375 -46
  305. data/rbi/lib/orb/models/invoice_create_params.rbi +38 -6
  306. data/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi +375 -66
  307. data/rbi/lib/orb/models/invoice_issue_params.rbi +9 -2
  308. data/rbi/lib/orb/models/invoice_line_item_create_params.rbi +16 -2
  309. data/rbi/lib/orb/models/invoice_line_item_create_response.rbi +141 -20
  310. data/rbi/lib/orb/models/invoice_list_params.rbi +9 -2
  311. data/rbi/lib/orb/models/invoice_mark_paid_params.rbi +9 -2
  312. data/rbi/lib/orb/models/invoice_update_params.rbi +7 -2
  313. data/rbi/lib/orb/models/item.rbi +1 -2
  314. data/rbi/lib/orb/models/item_create_params.rbi +5 -2
  315. data/rbi/lib/orb/models/item_list_params.rbi +8 -2
  316. data/rbi/lib/orb/models/item_update_params.rbi +1 -8
  317. data/rbi/lib/orb/models/metric_create_params.rbi +15 -2
  318. data/rbi/lib/orb/models/metric_list_params.rbi +3 -0
  319. data/rbi/lib/orb/models/metric_update_params.rbi +7 -2
  320. data/rbi/lib/orb/models/percentage_discount.rbi +11 -4
  321. data/rbi/lib/orb/models/plan.rbi +102 -15
  322. data/rbi/lib/orb/models/plan_create_params.rbi +997 -679
  323. data/rbi/lib/orb/models/plan_list_params.rbi +5 -1
  324. data/rbi/lib/orb/models/plan_update_params.rbi +11 -2
  325. data/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi +11 -2
  326. data/rbi/lib/orb/models/price.rbi +717 -688
  327. data/rbi/lib/orb/models/price_create_params.rbi +137 -53
  328. data/rbi/lib/orb/models/price_evaluate_params.rbi +10 -0
  329. data/rbi/lib/orb/models/price_list_params.rbi +8 -2
  330. data/rbi/lib/orb/models/price_update_params.rbi +7 -2
  331. data/rbi/lib/orb/models/prices/external_price_id_update_params.rbi +7 -2
  332. data/rbi/lib/orb/models/subscription.rbi +174 -11
  333. data/rbi/lib/orb/models/subscription_cancel_params.rbi +8 -5
  334. data/rbi/lib/orb/models/subscription_cancel_response.rbi +187 -14
  335. data/rbi/lib/orb/models/subscription_change_apply_params.rbi +7 -2
  336. data/rbi/lib/orb/models/subscription_change_apply_response.rbi +199 -18
  337. data/rbi/lib/orb/models/subscription_change_cancel_response.rbi +199 -18
  338. data/rbi/lib/orb/models/subscription_change_retrieve_response.rbi +199 -18
  339. data/rbi/lib/orb/models/subscription_create_params.rbi +2282 -1536
  340. data/rbi/lib/orb/models/subscription_create_response.rbi +187 -14
  341. data/rbi/lib/orb/models/subscription_fetch_costs_params.rbi +9 -5
  342. data/rbi/lib/orb/models/subscription_fetch_costs_response.rbi +21 -4
  343. data/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi +3 -0
  344. data/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi +8 -2
  345. data/rbi/lib/orb/models/subscription_fetch_usage_params.rbi +13 -4
  346. data/rbi/lib/orb/models/subscription_list_params.rbi +4 -2
  347. data/rbi/lib/orb/models/subscription_price_intervals_params.rbi +1228 -861
  348. data/rbi/lib/orb/models/subscription_price_intervals_response.rbi +187 -14
  349. data/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi +2288 -1544
  350. data/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi +187 -14
  351. data/rbi/lib/orb/models/subscription_trigger_phase_params.rbi +10 -2
  352. data/rbi/lib/orb/models/subscription_trigger_phase_response.rbi +187 -14
  353. data/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi +187 -14
  354. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +5 -2
  355. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +187 -20
  356. data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +187 -14
  357. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi +11 -2
  358. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi +187 -14
  359. data/rbi/lib/orb/models/subscription_update_params.rbi +15 -0
  360. data/rbi/lib/orb/models/subscription_update_trial_params.rbi +11 -5
  361. data/rbi/lib/orb/models/subscription_update_trial_response.rbi +187 -14
  362. data/rbi/lib/orb/models/subscription_usage.rbi +2 -16
  363. data/rbi/lib/orb/models/trial_discount.rbi +5 -1
  364. data/rbi/lib/orb/models/usage_discount.rbi +11 -3
  365. data/sig/orb/file_part.rbs +21 -0
  366. data/sig/orb/internal/transport/base_client.rbs +9 -3
  367. data/sig/orb/internal/type/array_of.rbs +2 -0
  368. data/sig/orb/internal/type/base_model.rbs +4 -0
  369. data/sig/orb/internal/type/enum.rbs +2 -2
  370. data/sig/orb/internal/type/{io_like.rbs → file_input.rbs} +1 -1
  371. data/sig/orb/internal/type/hash_of.rbs +2 -0
  372. data/sig/orb/internal/type/union.rbs +2 -0
  373. data/sig/orb/internal/util.rbs +14 -12
  374. metadata +8 -5
@@ -376,45 +376,199 @@ module Orb
376
376
  end
377
377
  def self.new(
378
378
  id:,
379
+ # This is the final amount required to be charged to the customer and reflects the
380
+ # application of the customer balance to the `total` of the invoice.
379
381
  amount_due:,
380
382
  auto_collection:,
381
383
  billing_address:,
384
+ # The creation time of the resource in Orb.
382
385
  created_at:,
386
+ # A list of credit notes associated with the invoice
383
387
  credit_notes:,
388
+ # An ISO 4217 currency string or `credits`
384
389
  currency:,
385
390
  customer:,
386
391
  customer_balance_transactions:,
392
+ # Tax IDs are commonly required to be displayed on customer invoices, which are
393
+ # added to the headers of invoices.
394
+ #
395
+ # ### Supported Tax ID Countries and Types
396
+ #
397
+ # | Country | Type | Description |
398
+ # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
399
+ # | Andorra | `ad_nrt` | Andorran NRT Number |
400
+ # | Argentina | `ar_cuit` | Argentinian Tax ID Number |
401
+ # | Australia | `au_abn` | Australian Business Number (AU ABN) |
402
+ # | Australia | `au_arn` | Australian Taxation Office Reference Number |
403
+ # | Austria | `eu_vat` | European VAT Number |
404
+ # | Bahrain | `bh_vat` | Bahraini VAT Number |
405
+ # | Belgium | `eu_vat` | European VAT Number |
406
+ # | Bolivia | `bo_tin` | Bolivian Tax ID |
407
+ # | Brazil | `br_cnpj` | Brazilian CNPJ Number |
408
+ # | Brazil | `br_cpf` | Brazilian CPF Number |
409
+ # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
410
+ # | Bulgaria | `eu_vat` | European VAT Number |
411
+ # | Canada | `ca_bn` | Canadian BN |
412
+ # | Canada | `ca_gst_hst` | Canadian GST/HST Number |
413
+ # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
414
+ # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
415
+ # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
416
+ # | Canada | `ca_qst` | Canadian QST Number (Québec) |
417
+ # | Chile | `cl_tin` | Chilean TIN |
418
+ # | China | `cn_tin` | Chinese Tax ID |
419
+ # | Colombia | `co_nit` | Colombian NIT Number |
420
+ # | Costa Rica | `cr_tin` | Costa Rican Tax ID |
421
+ # | Croatia | `eu_vat` | European VAT Number |
422
+ # | Cyprus | `eu_vat` | European VAT Number |
423
+ # | Czech Republic | `eu_vat` | European VAT Number |
424
+ # | Denmark | `eu_vat` | European VAT Number |
425
+ # | Dominican Republic | `do_rcn` | Dominican RCN Number |
426
+ # | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
427
+ # | Egypt | `eg_tin` | Egyptian Tax Identification Number |
428
+ # | El Salvador | `sv_nit` | El Salvadorian NIT Number |
429
+ # | Estonia | `eu_vat` | European VAT Number |
430
+ # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
431
+ # | Finland | `eu_vat` | European VAT Number |
432
+ # | France | `eu_vat` | European VAT Number |
433
+ # | Georgia | `ge_vat` | Georgian VAT |
434
+ # | Germany | `eu_vat` | European VAT Number |
435
+ # | Greece | `eu_vat` | European VAT Number |
436
+ # | Hong Kong | `hk_br` | Hong Kong BR Number |
437
+ # | Hungary | `eu_vat` | European VAT Number |
438
+ # | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
439
+ # | Iceland | `is_vat` | Icelandic VAT |
440
+ # | India | `in_gst` | Indian GST Number |
441
+ # | Indonesia | `id_npwp` | Indonesian NPWP Number |
442
+ # | Ireland | `eu_vat` | European VAT Number |
443
+ # | Israel | `il_vat` | Israel VAT |
444
+ # | Italy | `eu_vat` | European VAT Number |
445
+ # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
446
+ # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
447
+ # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
448
+ # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
449
+ # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
450
+ # | Latvia | `eu_vat` | European VAT Number |
451
+ # | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
452
+ # | Lithuania | `eu_vat` | European VAT Number |
453
+ # | Luxembourg | `eu_vat` | European VAT Number |
454
+ # | Malaysia | `my_frp` | Malaysian FRP Number |
455
+ # | Malaysia | `my_itn` | Malaysian ITN |
456
+ # | Malaysia | `my_sst` | Malaysian SST Number |
457
+ # | Malta | `eu_vat ` | European VAT Number |
458
+ # | Mexico | `mx_rfc` | Mexican RFC Number |
459
+ # | Netherlands | `eu_vat` | European VAT Number |
460
+ # | New Zealand | `nz_gst` | New Zealand GST Number |
461
+ # | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
462
+ # | Norway | `no_vat` | Norwegian VAT Number |
463
+ # | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
464
+ # | Oman | `om_vat` | Omani VAT Number |
465
+ # | Peru | `pe_ruc` | Peruvian RUC Number |
466
+ # | Philippines | `ph_tin ` | Philippines Tax Identification Number |
467
+ # | Poland | `eu_vat` | European VAT Number |
468
+ # | Portugal | `eu_vat` | European VAT Number |
469
+ # | Romania | `eu_vat` | European VAT Number |
470
+ # | Romania | `ro_tin` | Romanian Tax ID Number |
471
+ # | Russia | `ru_inn` | Russian INN |
472
+ # | Russia | `ru_kpp` | Russian KPP |
473
+ # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
474
+ # | Serbia | `rs_pib` | Serbian PIB Number |
475
+ # | Singapore | `sg_gst` | Singaporean GST |
476
+ # | Singapore | `sg_uen` | Singaporean UEN |
477
+ # | Slovakia | `eu_vat` | European VAT Number |
478
+ # | Slovenia | `eu_vat` | European VAT Number |
479
+ # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
480
+ # | South Africa | `za_vat` | South African VAT Number |
481
+ # | South Korea | `kr_brn` | Korean BRN |
482
+ # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
483
+ # | Spain | `eu_vat` | European VAT Number |
484
+ # | Sweden | `eu_vat` | European VAT Number |
485
+ # | Switzerland | `ch_vat` | Switzerland VAT Number |
486
+ # | Taiwan | `tw_vat` | Taiwanese VAT |
487
+ # | Thailand | `th_vat` | Thai VAT |
488
+ # | Turkey | `tr_tin` | Turkish Tax Identification Number |
489
+ # | Ukraine | `ua_vat` | Ukrainian VAT |
490
+ # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
491
+ # | United Kingdom | `eu_vat` | Northern Ireland VAT Number |
492
+ # | United Kingdom | `gb_vat` | United Kingdom VAT Number |
493
+ # | United States | `us_ein` | United States EIN |
494
+ # | Uruguay | `uy_ruc` | Uruguayan RUC Number |
495
+ # | Venezuela | `ve_rif` | Venezuelan RIF Number |
496
+ # | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
387
497
  customer_tax_id:,
498
+ # This field is deprecated in favor of `discounts`. If a `discounts` list is
499
+ # provided, the first discount in the list will be returned. If the list is empty,
500
+ # `None` will be returned.
388
501
  discount:,
389
502
  discounts:,
503
+ # When the invoice payment is due. The due date is null if the invoice is not yet
504
+ # finalized.
390
505
  due_date:,
506
+ # If the invoice has a status of `draft`, this will be the time that the invoice
507
+ # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
508
+ # true, the invoice will automatically begin issuing at this time.
391
509
  eligible_to_issue_at:,
510
+ # A URL for the customer-facing invoice portal. This URL expires 30 days after the
511
+ # invoice's due date, or 60 days after being re-generated through the UI.
392
512
  hosted_invoice_url:,
513
+ # The scheduled date of the invoice
393
514
  invoice_date:,
515
+ # Automatically generated invoice number to help track and reconcile invoices.
516
+ # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
517
+ # account or customer.
394
518
  invoice_number:,
519
+ # The link to download the PDF representation of the `Invoice`.
395
520
  invoice_pdf:,
396
521
  invoice_source:,
522
+ # If the invoice failed to issue, this will be the last time it failed to issue
523
+ # (even if it is now in a different state.)
397
524
  issue_failed_at:,
525
+ # If the invoice has been issued, this will be the time it transitioned to
526
+ # `issued` (even if it is now in a different state.)
398
527
  issued_at:,
528
+ # The breakdown of prices in this invoice.
399
529
  line_items:,
400
530
  maximum:,
401
531
  maximum_amount:,
532
+ # Free-form text which is available on the invoice PDF and the Orb invoice portal.
402
533
  memo:,
534
+ # User specified key-value pairs for the resource. If not present, this defaults
535
+ # to an empty dictionary. Individual keys can be removed by setting the value to
536
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
537
+ # `null`.
403
538
  metadata:,
404
539
  minimum:,
405
540
  minimum_amount:,
541
+ # If the invoice has a status of `paid`, this gives a timestamp when the invoice
542
+ # was paid.
406
543
  paid_at:,
544
+ # A list of payment attempts associated with the invoice
407
545
  payment_attempts:,
546
+ # If payment was attempted on this invoice but failed, this will be the time of
547
+ # the most recent attempt.
408
548
  payment_failed_at:,
549
+ # If payment was attempted on this invoice, this will be the start time of the
550
+ # most recent attempt. This field is especially useful for delayed-notification
551
+ # payment mechanisms (like bank transfers), where payment can take 3 days or more.
409
552
  payment_started_at:,
553
+ # If the invoice is in draft, this timestamp will reflect when the invoice is
554
+ # scheduled to be issued.
410
555
  scheduled_issue_at:,
411
556
  shipping_address:,
412
557
  status:,
413
558
  subscription:,
559
+ # The total before any discounts and minimums are applied.
414
560
  subtotal:,
561
+ # If the invoice failed to sync, this will be the last time an external invoicing
562
+ # provider sync was attempted. This field will always be `null` for invoices using
563
+ # Orb Invoicing.
415
564
  sync_failed_at:,
565
+ # The total after any minimums and discounts have been applied.
416
566
  total:,
567
+ # If the invoice has a status of `void`, this gives a timestamp when the invoice
568
+ # was voided.
417
569
  voided_at:,
570
+ # This is true if the invoice will be automatically issued in the future, and
571
+ # false otherwise.
418
572
  will_auto_issue:
419
573
  ); end
420
574
  sig do
@@ -500,8 +654,23 @@ module Orb
500
654
  )
501
655
  .returns(T.attached_class)
502
656
  end
503
- def self.new(enabled:, next_attempt_at:, num_attempts:, previously_attempted_at:); end
504
-
657
+ def self.new(
658
+ # True only if auto-collection is enabled for this invoice.
659
+ enabled:,
660
+ # If the invoice is scheduled for auto-collection, this field will reflect when
661
+ # the next attempt will occur. If dunning has been exhausted, or auto-collection
662
+ # is not enabled for this invoice, this field will be `null`.
663
+ next_attempt_at:,
664
+ # Number of auto-collection payment attempts.
665
+ num_attempts:,
666
+ # If Orb has ever attempted payment auto-collection for this invoice, this field
667
+ # will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
668
+ # this can be used to tell whether the invoice is currently in dunning (that is,
669
+ # `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
670
+ # if dunning has been exhausted (`previously_attempted_at` is non-null, but
671
+ # `next_attempt_time` is null).
672
+ previously_attempted_at:
673
+ ); end
505
674
  sig do
506
675
  override
507
676
  .returns(
@@ -601,8 +770,18 @@ module Orb
601
770
  )
602
771
  .returns(T.attached_class)
603
772
  end
604
- def self.new(id:, credit_note_number:, memo:, reason:, total:, type:, voided_at:); end
605
-
773
+ def self.new(
774
+ id:,
775
+ credit_note_number:,
776
+ # An optional memo supplied on the credit note.
777
+ memo:,
778
+ reason:,
779
+ total:,
780
+ type:,
781
+ # If the credit note has a status of `void`, this gives a timestamp when the
782
+ # credit note was voided.
783
+ voided_at:
784
+ ); end
606
785
  sig do
607
786
  override
608
787
  .returns(
@@ -705,14 +884,22 @@ module Orb
705
884
  .returns(T.attached_class)
706
885
  end
707
886
  def self.new(
887
+ # A unique id for this transaction.
708
888
  id:,
709
889
  action:,
890
+ # The value of the amount changed in the transaction.
710
891
  amount:,
892
+ # The creation time of this transaction.
711
893
  created_at:,
712
894
  credit_note:,
895
+ # An optional description provided for manual customer balance adjustments.
713
896
  description:,
897
+ # The new value of the customer's balance prior to the transaction, in the
898
+ # customer's currency.
714
899
  ending_balance:,
715
900
  invoice:,
901
+ # The original value of the customer's balance prior to the transaction, in the
902
+ # customer's currency.
716
903
  starting_balance:,
717
904
  type:
718
905
  ); end
@@ -739,8 +926,7 @@ module Orb
739
926
  extend Orb::Internal::Type::Enum
740
927
 
741
928
  TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::Invoice::CustomerBalanceTransaction::Action) }
742
- OrSymbol =
743
- T.type_alias { T.any(Symbol, String, Orb::Models::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol) }
929
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
744
930
 
745
931
  APPLIED_TO_INVOICE =
746
932
  T.let(:applied_to_invoice, Orb::Models::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol)
@@ -771,8 +957,10 @@ module Orb
771
957
  attr_accessor :id
772
958
 
773
959
  sig { params(id: String).returns(T.attached_class) }
774
- def self.new(id:); end
775
-
960
+ def self.new(
961
+ # The id of the Credit note
962
+ id:
963
+ ); end
776
964
  sig { override.returns({id: String}) }
777
965
  def to_hash; end
778
966
  end
@@ -783,8 +971,10 @@ module Orb
783
971
  attr_accessor :id
784
972
 
785
973
  sig { params(id: String).returns(T.attached_class) }
786
- def self.new(id:); end
787
-
974
+ def self.new(
975
+ # The Invoice id
976
+ id:
977
+ ); end
788
978
  sig { override.returns({id: String}) }
789
979
  def to_hash; end
790
980
  end
@@ -793,8 +983,7 @@ module Orb
793
983
  extend Orb::Internal::Type::Enum
794
984
 
795
985
  TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::Invoice::CustomerBalanceTransaction::Type) }
796
- OrSymbol =
797
- T.type_alias { T.any(Symbol, String, Orb::Models::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol) }
986
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
798
987
 
799
988
  INCREMENT = T.let(:increment, Orb::Models::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol)
800
989
  DECREMENT = T.let(:decrement, Orb::Models::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol)
@@ -945,8 +1134,7 @@ module Orb
945
1134
  extend Orb::Internal::Type::Enum
946
1135
 
947
1136
  TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::Invoice::CustomerTaxID::Country) }
948
- OrSymbol =
949
- T.type_alias { T.any(Symbol, String, Orb::Models::Invoice::CustomerTaxID::Country::TaggedSymbol) }
1137
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
950
1138
 
951
1139
  AD = T.let(:AD, Orb::Models::Invoice::CustomerTaxID::Country::TaggedSymbol)
952
1140
  AE = T.let(:AE, Orb::Models::Invoice::CustomerTaxID::Country::TaggedSymbol)
@@ -1035,8 +1223,7 @@ module Orb
1035
1223
  extend Orb::Internal::Type::Enum
1036
1224
 
1037
1225
  TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::Invoice::CustomerTaxID::Type) }
1038
- OrSymbol =
1039
- T.type_alias { T.any(Symbol, String, Orb::Models::Invoice::CustomerTaxID::Type::TaggedSymbol) }
1226
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1040
1227
 
1041
1228
  AD_NRT = T.let(:ad_nrt, Orb::Models::Invoice::CustomerTaxID::Type::TaggedSymbol)
1042
1229
  AE_TRN = T.let(:ae_trn, Orb::Models::Invoice::CustomerTaxID::Type::TaggedSymbol)
@@ -1119,7 +1306,7 @@ module Orb
1119
1306
  extend Orb::Internal::Type::Enum
1120
1307
 
1121
1308
  TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::Invoice::InvoiceSource) }
1122
- OrSymbol = T.type_alias { T.any(Symbol, String, Orb::Models::Invoice::InvoiceSource::TaggedSymbol) }
1309
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1123
1310
 
1124
1311
  SUBSCRIPTION = T.let(:subscription, Orb::Models::Invoice::InvoiceSource::TaggedSymbol)
1125
1312
  PARTIAL = T.let(:partial, Orb::Models::Invoice::InvoiceSource::TaggedSymbol)
@@ -1392,27 +1579,65 @@ module Orb
1392
1579
  .returns(T.attached_class)
1393
1580
  end
1394
1581
  def self.new(
1582
+ # A unique ID for this line item.
1395
1583
  id:,
1584
+ # The line amount after any adjustments and before overage conversion, credits and
1585
+ # partial invoicing.
1396
1586
  adjusted_subtotal:,
1587
+ # All adjustments applied to the line item in the order they were applied based on
1588
+ # invoice calculations (ie. usage discounts -> amount discounts -> percentage
1589
+ # discounts -> minimums -> maximums).
1397
1590
  adjustments:,
1591
+ # The final amount for a line item after all adjustments and pre paid credits have
1592
+ # been applied.
1398
1593
  amount:,
1594
+ # The number of prepaid credits applied.
1399
1595
  credits_applied:,
1400
1596
  discount:,
1597
+ # The end date of the range of time applied for this line item's price.
1401
1598
  end_date:,
1599
+ # An additional filter that was used to calculate the usage for this line item.
1402
1600
  filter:,
1601
+ # [DEPRECATED] For configured prices that are split by a grouping key, this will
1602
+ # be populated with the key and a value. The `amount` and `subtotal` will be the
1603
+ # values for this particular grouping.
1403
1604
  grouping:,
1605
+ # This field is deprecated in favor of `adjustments`.
1404
1606
  maximum:,
1607
+ # This field is deprecated in favor of `adjustments`.
1405
1608
  maximum_amount:,
1609
+ # This field is deprecated in favor of `adjustments`.
1406
1610
  minimum:,
1611
+ # This field is deprecated in favor of `adjustments`.
1407
1612
  minimum_amount:,
1613
+ # The name of the price associated with this line item.
1408
1614
  name:,
1615
+ # Any amount applied from a partial invoice
1409
1616
  partially_invoiced_amount:,
1617
+ # The Price resource represents a price that can be billed on a subscription,
1618
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
1619
+ # take a quantity and determine an amount to bill.
1620
+ #
1621
+ # Orb supports a few different pricing models out of the box. Each of these models
1622
+ # is serialized differently in a given Price object. The model_type field
1623
+ # determines the key for the configuration object that is present.
1624
+ #
1625
+ # For more on the types of prices, see
1626
+ # [the core concepts documentation](/core-concepts#plan-and-price)
1410
1627
  price:,
1628
+ # Either the fixed fee quantity or the usage during the service period.
1411
1629
  quantity:,
1630
+ # The start date of the range of time applied for this line item's price.
1412
1631
  start_date:,
1632
+ # For complex pricing structures, the line item can be broken down further in
1633
+ # `sub_line_items`.
1413
1634
  sub_line_items:,
1635
+ # The line amount before before any adjustments.
1414
1636
  subtotal:,
1637
+ # An array of tax rates and their incurred tax amounts. Empty if no tax
1638
+ # integration is configured.
1415
1639
  tax_amounts:,
1640
+ # A list of customer ids that were used to calculate the usage for this line item.
1416
1641
  usage_customer_ids:
1417
1642
  ); end
1418
1643
  sig do
@@ -1544,10 +1769,17 @@ module Orb
1544
1769
  end
1545
1770
  def self.new(
1546
1771
  id:,
1772
+ # The value applied by an adjustment.
1547
1773
  amount:,
1774
+ # The price IDs that this adjustment applies to.
1548
1775
  applies_to_price_ids:,
1776
+ # True for adjustments that apply to an entire invocice, false for adjustments
1777
+ # that apply to only one price.
1549
1778
  is_invoice_level:,
1779
+ # The reason for the adjustment.
1550
1780
  reason:,
1781
+ # The number of usage units by which to discount the price this adjustment applies
1782
+ # to in a given billing period.
1551
1783
  usage_discount:,
1552
1784
  adjustment_type: :usage_discount
1553
1785
  ); end
@@ -1611,10 +1843,17 @@ module Orb
1611
1843
  end
1612
1844
  def self.new(
1613
1845
  id:,
1846
+ # The value applied by an adjustment.
1614
1847
  amount:,
1848
+ # The amount by which to discount the prices this adjustment applies to in a given
1849
+ # billing period.
1615
1850
  amount_discount:,
1851
+ # The price IDs that this adjustment applies to.
1616
1852
  applies_to_price_ids:,
1853
+ # True for adjustments that apply to an entire invocice, false for adjustments
1854
+ # that apply to only one price.
1617
1855
  is_invoice_level:,
1856
+ # The reason for the adjustment.
1618
1857
  reason:,
1619
1858
  adjustment_type: :amount_discount
1620
1859
  ); end
@@ -1678,10 +1917,17 @@ module Orb
1678
1917
  end
1679
1918
  def self.new(
1680
1919
  id:,
1920
+ # The value applied by an adjustment.
1681
1921
  amount:,
1922
+ # The price IDs that this adjustment applies to.
1682
1923
  applies_to_price_ids:,
1924
+ # True for adjustments that apply to an entire invocice, false for adjustments
1925
+ # that apply to only one price.
1683
1926
  is_invoice_level:,
1927
+ # The percentage (as a value between 0 and 1) by which to discount the price
1928
+ # intervals this adjustment applies to in a given billing period.
1684
1929
  percentage_discount:,
1930
+ # The reason for the adjustment.
1685
1931
  reason:,
1686
1932
  adjustment_type: :percentage_discount
1687
1933
  ); end
@@ -1750,11 +1996,19 @@ module Orb
1750
1996
  end
1751
1997
  def self.new(
1752
1998
  id:,
1999
+ # The value applied by an adjustment.
1753
2000
  amount:,
2001
+ # The price IDs that this adjustment applies to.
1754
2002
  applies_to_price_ids:,
2003
+ # True for adjustments that apply to an entire invocice, false for adjustments
2004
+ # that apply to only one price.
1755
2005
  is_invoice_level:,
2006
+ # The item ID that revenue from this minimum will be attributed to.
1756
2007
  item_id:,
2008
+ # The minimum amount to charge in a given billing period for the prices this
2009
+ # adjustment applies to.
1757
2010
  minimum_amount:,
2011
+ # The reason for the adjustment.
1758
2012
  reason:,
1759
2013
  adjustment_type: :minimum
1760
2014
  ); end
@@ -1819,10 +2073,17 @@ module Orb
1819
2073
  end
1820
2074
  def self.new(
1821
2075
  id:,
2076
+ # The value applied by an adjustment.
1822
2077
  amount:,
2078
+ # The price IDs that this adjustment applies to.
1823
2079
  applies_to_price_ids:,
2080
+ # True for adjustments that apply to an entire invocice, false for adjustments
2081
+ # that apply to only one price.
1824
2082
  is_invoice_level:,
2083
+ # The maximum amount to charge in a given billing period for the prices this
2084
+ # adjustment applies to.
1825
2085
  maximum_amount:,
2086
+ # The reason for the adjustment.
1826
2087
  reason:,
1827
2088
  adjustment_type: :maximum
1828
2089
  ); end
@@ -1866,8 +2127,13 @@ module Orb
1866
2127
  sig do
1867
2128
  params(applies_to_price_ids: T::Array[String], maximum_amount: String).returns(T.attached_class)
1868
2129
  end
1869
- def self.new(applies_to_price_ids:, maximum_amount:); end
1870
-
2130
+ def self.new(
2131
+ # List of price_ids that this maximum amount applies to. For plan/plan phase
2132
+ # maximums, this can be a subset of prices.
2133
+ applies_to_price_ids:,
2134
+ # Maximum amount applied
2135
+ maximum_amount:
2136
+ ); end
1871
2137
  sig { override.returns({applies_to_price_ids: T::Array[String], maximum_amount: String}) }
1872
2138
  def to_hash; end
1873
2139
  end
@@ -1886,8 +2152,13 @@ module Orb
1886
2152
  sig do
1887
2153
  params(applies_to_price_ids: T::Array[String], minimum_amount: String).returns(T.attached_class)
1888
2154
  end
1889
- def self.new(applies_to_price_ids:, minimum_amount:); end
1890
-
2155
+ def self.new(
2156
+ # List of price_ids that this minimum amount applies to. For plan/plan phase
2157
+ # minimums, this can be a subset of prices.
2158
+ applies_to_price_ids:,
2159
+ # Minimum amount applied
2160
+ minimum_amount:
2161
+ ); end
1891
2162
  sig { override.returns({applies_to_price_ids: T::Array[String], minimum_amount: String}) }
1892
2163
  def to_hash; end
1893
2164
  end
@@ -1952,8 +2223,15 @@ module Orb
1952
2223
  )
1953
2224
  .returns(T.attached_class)
1954
2225
  end
1955
- def self.new(amount:, grouping:, matrix_config:, name:, quantity:, type: :matrix); end
1956
-
2226
+ def self.new(
2227
+ # The total amount for this sub line item.
2228
+ amount:,
2229
+ grouping:,
2230
+ matrix_config:,
2231
+ name:,
2232
+ quantity:,
2233
+ type: :matrix
2234
+ ); end
1957
2235
  sig do
1958
2236
  override
1959
2237
  .returns(
@@ -1978,8 +2256,11 @@ module Orb
1978
2256
  attr_accessor :value
1979
2257
 
1980
2258
  sig { params(key: String, value: T.nilable(String)).returns(T.attached_class) }
1981
- def self.new(key:, value:); end
1982
-
2259
+ def self.new(
2260
+ key:,
2261
+ # No value indicates the default group
2262
+ value:
2263
+ ); end
1983
2264
  sig { override.returns({key: String, value: T.nilable(String)}) }
1984
2265
  def to_hash; end
1985
2266
  end
@@ -1990,8 +2271,10 @@ module Orb
1990
2271
  attr_accessor :dimension_values
1991
2272
 
1992
2273
  sig { params(dimension_values: T::Array[T.nilable(String)]).returns(T.attached_class) }
1993
- def self.new(dimension_values:); end
1994
-
2274
+ def self.new(
2275
+ # The ordered dimension values for this line item.
2276
+ dimension_values:
2277
+ ); end
1995
2278
  sig { override.returns({dimension_values: T::Array[T.nilable(String)]}) }
1996
2279
  def to_hash; end
1997
2280
  end
@@ -2048,8 +2331,15 @@ module Orb
2048
2331
  )
2049
2332
  .returns(T.attached_class)
2050
2333
  end
2051
- def self.new(amount:, grouping:, name:, quantity:, tier_config:, type: :tier); end
2052
-
2334
+ def self.new(
2335
+ # The total amount for this sub line item.
2336
+ amount:,
2337
+ grouping:,
2338
+ name:,
2339
+ quantity:,
2340
+ tier_config:,
2341
+ type: :tier
2342
+ ); end
2053
2343
  sig do
2054
2344
  override
2055
2345
  .returns(
@@ -2074,8 +2364,11 @@ module Orb
2074
2364
  attr_accessor :value
2075
2365
 
2076
2366
  sig { params(key: String, value: T.nilable(String)).returns(T.attached_class) }
2077
- def self.new(key:, value:); end
2078
-
2367
+ def self.new(
2368
+ key:,
2369
+ # No value indicates the default group
2370
+ value:
2371
+ ); end
2079
2372
  sig { override.returns({key: String, value: T.nilable(String)}) }
2080
2373
  def to_hash; end
2081
2374
  end
@@ -2143,8 +2436,14 @@ module Orb
2143
2436
  )
2144
2437
  .returns(T.attached_class)
2145
2438
  end
2146
- def self.new(amount:, grouping:, name:, quantity:, type: :"'null'"); end
2147
-
2439
+ def self.new(
2440
+ # The total amount for this sub line item.
2441
+ amount:,
2442
+ grouping:,
2443
+ name:,
2444
+ quantity:,
2445
+ type: :"'null'"
2446
+ ); end
2148
2447
  sig do
2149
2448
  override
2150
2449
  .returns(
@@ -2168,8 +2467,11 @@ module Orb
2168
2467
  attr_accessor :value
2169
2468
 
2170
2469
  sig { params(key: String, value: T.nilable(String)).returns(T.attached_class) }
2171
- def self.new(key:, value:); end
2172
-
2470
+ def self.new(
2471
+ key:,
2472
+ # No value indicates the default group
2473
+ value:
2474
+ ); end
2173
2475
  sig { override.returns({key: String, value: T.nilable(String)}) }
2174
2476
  def to_hash; end
2175
2477
  end
@@ -2201,8 +2503,14 @@ module Orb
2201
2503
  params(amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String))
2202
2504
  .returns(T.attached_class)
2203
2505
  end
2204
- def self.new(amount:, tax_rate_description:, tax_rate_percentage:); end
2205
-
2506
+ def self.new(
2507
+ # The amount of additional tax incurred by this tax rate.
2508
+ amount:,
2509
+ # The human-readable description of the applied tax rate.
2510
+ tax_rate_description:,
2511
+ # The tax rate percentage, out of 100.
2512
+ tax_rate_percentage:
2513
+ ); end
2206
2514
  sig do
2207
2515
  override.returns(
2208
2516
  {
@@ -2229,8 +2537,13 @@ module Orb
2229
2537
  sig do
2230
2538
  params(applies_to_price_ids: T::Array[String], maximum_amount: String).returns(T.attached_class)
2231
2539
  end
2232
- def self.new(applies_to_price_ids:, maximum_amount:); end
2233
-
2540
+ def self.new(
2541
+ # List of price_ids that this maximum amount applies to. For plan/plan phase
2542
+ # maximums, this can be a subset of prices.
2543
+ applies_to_price_ids:,
2544
+ # Maximum amount applied
2545
+ maximum_amount:
2546
+ ); end
2234
2547
  sig { override.returns({applies_to_price_ids: T::Array[String], maximum_amount: String}) }
2235
2548
  def to_hash; end
2236
2549
  end
@@ -2248,8 +2561,13 @@ module Orb
2248
2561
  sig do
2249
2562
  params(applies_to_price_ids: T::Array[String], minimum_amount: String).returns(T.attached_class)
2250
2563
  end
2251
- def self.new(applies_to_price_ids:, minimum_amount:); end
2252
-
2564
+ def self.new(
2565
+ # List of price_ids that this minimum amount applies to. For plan/plan phase
2566
+ # minimums, this can be a subset of prices.
2567
+ applies_to_price_ids:,
2568
+ # Minimum amount applied
2569
+ minimum_amount:
2570
+ ); end
2253
2571
  sig { override.returns({applies_to_price_ids: T::Array[String], minimum_amount: String}) }
2254
2572
  def to_hash; end
2255
2573
  end
@@ -2290,8 +2608,20 @@ module Orb
2290
2608
  )
2291
2609
  .returns(T.attached_class)
2292
2610
  end
2293
- def self.new(id:, amount:, created_at:, payment_provider:, payment_provider_id:, succeeded:); end
2294
-
2611
+ def self.new(
2612
+ # The ID of the payment attempt.
2613
+ id:,
2614
+ # The amount of the payment attempt.
2615
+ amount:,
2616
+ # The time at which the payment attempt was created.
2617
+ created_at:,
2618
+ # The payment provider that attempted to collect the payment.
2619
+ payment_provider:,
2620
+ # The ID of the payment attempt in the payment provider.
2621
+ payment_provider_id:,
2622
+ # Whether the payment attempt succeeded.
2623
+ succeeded:
2624
+ ); end
2295
2625
  sig do
2296
2626
  override
2297
2627
  .returns(
@@ -2312,8 +2642,7 @@ module Orb
2312
2642
  extend Orb::Internal::Type::Enum
2313
2643
 
2314
2644
  TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::Invoice::PaymentAttempt::PaymentProvider) }
2315
- OrSymbol =
2316
- T.type_alias { T.any(Symbol, String, Orb::Models::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol) }
2645
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2317
2646
 
2318
2647
  STRIPE = T.let(:stripe, Orb::Models::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol)
2319
2648
 
@@ -2374,7 +2703,7 @@ module Orb
2374
2703
  extend Orb::Internal::Type::Enum
2375
2704
 
2376
2705
  TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::Invoice::Status) }
2377
- OrSymbol = T.type_alias { T.any(Symbol, String, Orb::Models::Invoice::Status::TaggedSymbol) }
2706
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2378
2707
 
2379
2708
  ISSUED = T.let(:issued, Orb::Models::Invoice::Status::TaggedSymbol)
2380
2709
  PAID = T.let(:paid, Orb::Models::Invoice::Status::TaggedSymbol)