orb-billing 0.1.0.pre.alpha.33

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 (635) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +169 -0
  3. data/lib/orb/client.rb +129 -0
  4. data/lib/orb/errors.rb +317 -0
  5. data/lib/orb/models/alert.rb +225 -0
  6. data/lib/orb/models/alert_create_for_customer_params.rb +77 -0
  7. data/lib/orb/models/alert_create_for_external_customer_params.rb +77 -0
  8. data/lib/orb/models/alert_create_for_subscription_params.rb +74 -0
  9. data/lib/orb/models/alert_disable_params.rb +26 -0
  10. data/lib/orb/models/alert_enable_params.rb +26 -0
  11. data/lib/orb/models/alert_list_params.rb +97 -0
  12. data/lib/orb/models/alert_retrieve_params.rb +19 -0
  13. data/lib/orb/models/alert_update_params.rb +46 -0
  14. data/lib/orb/models/amount_discount.rb +53 -0
  15. data/lib/orb/models/billable_metric.rb +76 -0
  16. data/lib/orb/models/billing_cycle_relative_date.rb +18 -0
  17. data/lib/orb/models/coupon.rb +86 -0
  18. data/lib/orb/models/coupon_archive_params.rb +19 -0
  19. data/lib/orb/models/coupon_create_params.rb +102 -0
  20. data/lib/orb/models/coupon_fetch_params.rb +19 -0
  21. data/lib/orb/models/coupon_list_params.rb +53 -0
  22. data/lib/orb/models/coupons/subscription_list_params.rb +40 -0
  23. data/lib/orb/models/credit_note.rb +522 -0
  24. data/lib/orb/models/credit_note_create_params.rb +77 -0
  25. data/lib/orb/models/credit_note_fetch_params.rb +19 -0
  26. data/lib/orb/models/credit_note_list_params.rb +73 -0
  27. data/lib/orb/models/customer.rb +872 -0
  28. data/lib/orb/models/customer_create_params.rb +843 -0
  29. data/lib/orb/models/customer_delete_params.rb +19 -0
  30. data/lib/orb/models/customer_fetch_by_external_id_params.rb +19 -0
  31. data/lib/orb/models/customer_fetch_params.rb +19 -0
  32. data/lib/orb/models/customer_list_params.rb +73 -0
  33. data/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb +19 -0
  34. data/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb +19 -0
  35. data/lib/orb/models/customer_update_by_external_id_params.rb +848 -0
  36. data/lib/orb/models/customer_update_params.rb +838 -0
  37. data/lib/orb/models/customers/balance_transaction_create_params.rb +53 -0
  38. data/lib/orb/models/customers/balance_transaction_create_response.rb +167 -0
  39. data/lib/orb/models/customers/balance_transaction_list_params.rb +75 -0
  40. data/lib/orb/models/customers/balance_transaction_list_response.rb +167 -0
  41. data/lib/orb/models/customers/cost_list_by_external_id_params.rb +69 -0
  42. data/lib/orb/models/customers/cost_list_by_external_id_response.rb +106 -0
  43. data/lib/orb/models/customers/cost_list_params.rb +69 -0
  44. data/lib/orb/models/customers/cost_list_response.rb +106 -0
  45. data/lib/orb/models/customers/credit_list_by_external_id_params.rb +59 -0
  46. data/lib/orb/models/customers/credit_list_by_external_id_response.rb +72 -0
  47. data/lib/orb/models/customers/credit_list_params.rb +59 -0
  48. data/lib/orb/models/customers/credit_list_response.rb +72 -0
  49. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +215 -0
  50. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +1311 -0
  51. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +214 -0
  52. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +1310 -0
  53. data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +141 -0
  54. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +1310 -0
  55. data/lib/orb/models/customers/credits/ledger_list_params.rb +141 -0
  56. data/lib/orb/models/customers/credits/ledger_list_response.rb +1306 -0
  57. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +159 -0
  58. data/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb +154 -0
  59. data/lib/orb/models/customers/credits/top_up_create_params.rb +158 -0
  60. data/lib/orb/models/customers/credits/top_up_create_response.rb +153 -0
  61. data/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb +29 -0
  62. data/lib/orb/models/customers/credits/top_up_delete_params.rb +29 -0
  63. data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +42 -0
  64. data/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb +154 -0
  65. data/lib/orb/models/customers/credits/top_up_list_params.rb +42 -0
  66. data/lib/orb/models/customers/credits/top_up_list_response.rb +153 -0
  67. data/lib/orb/models/dimensional_price_group.rb +64 -0
  68. data/lib/orb/models/dimensional_price_group_create_params.rb +63 -0
  69. data/lib/orb/models/dimensional_price_group_list_params.rb +38 -0
  70. data/lib/orb/models/dimensional_price_group_retrieve_params.rb +19 -0
  71. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb +21 -0
  72. data/lib/orb/models/dimensional_price_groups.rb +25 -0
  73. data/lib/orb/models/discount.rb +23 -0
  74. data/lib/orb/models/evaluate_price_group.rb +48 -0
  75. data/lib/orb/models/event_deprecate_params.rb +19 -0
  76. data/lib/orb/models/event_deprecate_response.rb +21 -0
  77. data/lib/orb/models/event_ingest_params.rb +100 -0
  78. data/lib/orb/models/event_ingest_response.rb +77 -0
  79. data/lib/orb/models/event_search_params.rb +45 -0
  80. data/lib/orb/models/event_search_response.rb +87 -0
  81. data/lib/orb/models/event_update_params.rb +58 -0
  82. data/lib/orb/models/event_update_response.rb +21 -0
  83. data/lib/orb/models/events/backfill_close_params.rb +21 -0
  84. data/lib/orb/models/events/backfill_close_response.rb +131 -0
  85. data/lib/orb/models/events/backfill_create_params.rb +97 -0
  86. data/lib/orb/models/events/backfill_create_response.rb +131 -0
  87. data/lib/orb/models/events/backfill_fetch_params.rb +21 -0
  88. data/lib/orb/models/events/backfill_fetch_response.rb +131 -0
  89. data/lib/orb/models/events/backfill_list_params.rb +40 -0
  90. data/lib/orb/models/events/backfill_list_response.rb +131 -0
  91. data/lib/orb/models/events/backfill_revert_params.rb +21 -0
  92. data/lib/orb/models/events/backfill_revert_response.rb +131 -0
  93. data/lib/orb/models/events/event_volumes.rb +54 -0
  94. data/lib/orb/models/events/volume_list_params.rb +64 -0
  95. data/lib/orb/models/invoice.rb +2218 -0
  96. data/lib/orb/models/invoice_create_params.rb +200 -0
  97. data/lib/orb/models/invoice_fetch_params.rb +19 -0
  98. data/lib/orb/models/invoice_fetch_upcoming_params.rb +25 -0
  99. data/lib/orb/models/invoice_fetch_upcoming_response.rb +2226 -0
  100. data/lib/orb/models/invoice_issue_params.rb +34 -0
  101. data/lib/orb/models/invoice_level_discount.rb +21 -0
  102. data/lib/orb/models/invoice_line_item_create_params.rb +62 -0
  103. data/lib/orb/models/invoice_line_item_create_response.rb +929 -0
  104. data/lib/orb/models/invoice_list_params.rb +197 -0
  105. data/lib/orb/models/invoice_mark_paid_params.rb +40 -0
  106. data/lib/orb/models/invoice_pay_params.rb +19 -0
  107. data/lib/orb/models/invoice_update_params.rb +28 -0
  108. data/lib/orb/models/invoice_void_params.rb +19 -0
  109. data/lib/orb/models/item.rb +82 -0
  110. data/lib/orb/models/item_create_params.rb +26 -0
  111. data/lib/orb/models/item_fetch_params.rb +19 -0
  112. data/lib/orb/models/item_list_params.rb +38 -0
  113. data/lib/orb/models/item_update_params.rb +73 -0
  114. data/lib/orb/models/metric_create_params.rb +56 -0
  115. data/lib/orb/models/metric_fetch_params.rb +19 -0
  116. data/lib/orb/models/metric_list_params.rb +73 -0
  117. data/lib/orb/models/metric_update_params.rb +28 -0
  118. data/lib/orb/models/pagination_metadata.rb +25 -0
  119. data/lib/orb/models/percentage_discount.rb +54 -0
  120. data/lib/orb/models/plan.rb +894 -0
  121. data/lib/orb/models/plan_create_params.rb +6702 -0
  122. data/lib/orb/models/plan_fetch_params.rb +19 -0
  123. data/lib/orb/models/plan_list_params.rb +100 -0
  124. data/lib/orb/models/plan_update_params.rb +37 -0
  125. data/lib/orb/models/plans/external_plan_id_fetch_params.rb +21 -0
  126. data/lib/orb/models/plans/external_plan_id_update_params.rb +39 -0
  127. data/lib/orb/models/price.rb +12229 -0
  128. data/lib/orb/models/price_create_params.rb +808 -0
  129. data/lib/orb/models/price_evaluate_params.rb +80 -0
  130. data/lib/orb/models/price_evaluate_response.rb +20 -0
  131. data/lib/orb/models/price_fetch_params.rb +19 -0
  132. data/lib/orb/models/price_list_params.rb +38 -0
  133. data/lib/orb/models/price_update_params.rb +28 -0
  134. data/lib/orb/models/prices/external_price_id_fetch_params.rb +21 -0
  135. data/lib/orb/models/prices/external_price_id_update_params.rb +30 -0
  136. data/lib/orb/models/subscription.rb +1233 -0
  137. data/lib/orb/models/subscription_cancel_params.rb +58 -0
  138. data/lib/orb/models/subscription_cancel_response.rb +1217 -0
  139. data/lib/orb/models/subscription_create_params.rb +15065 -0
  140. data/lib/orb/models/subscription_create_response.rb +1217 -0
  141. data/lib/orb/models/subscription_fetch_costs_params.rb +67 -0
  142. data/lib/orb/models/subscription_fetch_costs_response.rb +104 -0
  143. data/lib/orb/models/subscription_fetch_params.rb +19 -0
  144. data/lib/orb/models/subscription_fetch_schedule_params.rb +73 -0
  145. data/lib/orb/models/subscription_fetch_schedule_response.rb +68 -0
  146. data/lib/orb/models/subscription_fetch_usage_params.rb +135 -0
  147. data/lib/orb/models/subscription_list_params.rb +108 -0
  148. data/lib/orb/models/subscription_price_intervals_params.rb +8358 -0
  149. data/lib/orb/models/subscription_price_intervals_response.rb +1224 -0
  150. data/lib/orb/models/subscription_schedule_plan_change_params.rb +15088 -0
  151. data/lib/orb/models/subscription_schedule_plan_change_response.rb +1224 -0
  152. data/lib/orb/models/subscription_trigger_phase_params.rb +36 -0
  153. data/lib/orb/models/subscription_trigger_phase_response.rb +1224 -0
  154. data/lib/orb/models/subscription_unschedule_cancellation_params.rb +19 -0
  155. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +1224 -0
  156. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb +26 -0
  157. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +1228 -0
  158. data/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb +19 -0
  159. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +1224 -0
  160. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +90 -0
  161. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +1224 -0
  162. data/lib/orb/models/subscription_update_params.rb +74 -0
  163. data/lib/orb/models/subscription_update_trial_params.rb +59 -0
  164. data/lib/orb/models/subscription_update_trial_response.rb +1222 -0
  165. data/lib/orb/models/subscription_usage.rb +258 -0
  166. data/lib/orb/models/subscriptions.rb +25 -0
  167. data/lib/orb/models/top_level_ping_params.rb +19 -0
  168. data/lib/orb/models/top_level_ping_response.rb +20 -0
  169. data/lib/orb/models/trial_discount.rb +69 -0
  170. data/lib/orb/models/usage_discount.rb +54 -0
  171. data/lib/orb/page.rb +114 -0
  172. data/lib/orb/request_options.rb +75 -0
  173. data/lib/orb/resources/alerts.rb +239 -0
  174. data/lib/orb/resources/coupons/subscriptions.rb +43 -0
  175. data/lib/orb/resources/coupons.rb +115 -0
  176. data/lib/orb/resources/credit_notes.rb +87 -0
  177. data/lib/orb/resources/customers/balance_transactions.rb +96 -0
  178. data/lib/orb/resources/customers/costs.rb +298 -0
  179. data/lib/orb/resources/customers/credits/ledger.rb +527 -0
  180. data/lib/orb/resources/customers/credits/top_ups.rb +192 -0
  181. data/lib/orb/resources/customers/credits.rb +88 -0
  182. data/lib/orb/resources/customers.rb +321 -0
  183. data/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rb +38 -0
  184. data/lib/orb/resources/dimensional_price_groups.rb +93 -0
  185. data/lib/orb/resources/events/backfills.rb +174 -0
  186. data/lib/orb/resources/events/volume.rb +52 -0
  187. data/lib/orb/resources/events.rb +415 -0
  188. data/lib/orb/resources/invoice_line_items.rb +41 -0
  189. data/lib/orb/resources/invoices.rb +266 -0
  190. data/lib/orb/resources/items.rb +95 -0
  191. data/lib/orb/resources/metrics.rb +114 -0
  192. data/lib/orb/resources/plans/external_plan_id.rb +76 -0
  193. data/lib/orb/resources/plans.rb +133 -0
  194. data/lib/orb/resources/prices/external_price_id.rb +61 -0
  195. data/lib/orb/resources/prices.rb +197 -0
  196. data/lib/orb/resources/subscriptions.rb +1278 -0
  197. data/lib/orb/resources/top_level.rb +37 -0
  198. data/lib/orb/transport/base_client.rb +459 -0
  199. data/lib/orb/transport/pooled_net_requester.rb +182 -0
  200. data/lib/orb/type/array_of.rb +112 -0
  201. data/lib/orb/type/base_model.rb +367 -0
  202. data/lib/orb/type/base_page.rb +61 -0
  203. data/lib/orb/type/boolean_model.rb +52 -0
  204. data/lib/orb/type/converter.rb +217 -0
  205. data/lib/orb/type/enum.rb +101 -0
  206. data/lib/orb/type/hash_of.rb +132 -0
  207. data/lib/orb/type/request_parameters.rb +38 -0
  208. data/lib/orb/type/union.rb +225 -0
  209. data/lib/orb/type/unknown.rb +56 -0
  210. data/lib/orb/type.rb +23 -0
  211. data/lib/orb/util.rb +722 -0
  212. data/lib/orb/version.rb +5 -0
  213. data/lib/orb.rb +247 -0
  214. data/manifest.yaml +15 -0
  215. data/rbi/lib/orb/client.rbi +90 -0
  216. data/rbi/lib/orb/errors.rbi +246 -0
  217. data/rbi/lib/orb/models/alert.rbi +239 -0
  218. data/rbi/lib/orb/models/alert_create_for_customer_params.rbi +86 -0
  219. data/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi +88 -0
  220. data/rbi/lib/orb/models/alert_create_for_subscription_params.rbi +83 -0
  221. data/rbi/lib/orb/models/alert_disable_params.rbi +28 -0
  222. data/rbi/lib/orb/models/alert_enable_params.rbi +28 -0
  223. data/rbi/lib/orb/models/alert_list_params.rbi +95 -0
  224. data/rbi/lib/orb/models/alert_retrieve_params.rbi +20 -0
  225. data/rbi/lib/orb/models/alert_update_params.rbi +51 -0
  226. data/rbi/lib/orb/models/amount_discount.rbi +62 -0
  227. data/rbi/lib/orb/models/billable_metric.rbi +83 -0
  228. data/rbi/lib/orb/models/billing_cycle_relative_date.rbi +19 -0
  229. data/rbi/lib/orb/models/coupon.rbi +90 -0
  230. data/rbi/lib/orb/models/coupon_archive_params.rbi +20 -0
  231. data/rbi/lib/orb/models/coupon_create_params.rbi +120 -0
  232. data/rbi/lib/orb/models/coupon_fetch_params.rbi +20 -0
  233. data/rbi/lib/orb/models/coupon_list_params.rbi +59 -0
  234. data/rbi/lib/orb/models/coupons/subscription_list_params.rbi +41 -0
  235. data/rbi/lib/orb/models/credit_note.rbi +546 -0
  236. data/rbi/lib/orb/models/credit_note_create_params.rbi +84 -0
  237. data/rbi/lib/orb/models/credit_note_fetch_params.rbi +20 -0
  238. data/rbi/lib/orb/models/credit_note_list_params.rbi +74 -0
  239. data/rbi/lib/orb/models/customer.rbi +941 -0
  240. data/rbi/lib/orb/models/customer_create_params.rbi +923 -0
  241. data/rbi/lib/orb/models/customer_delete_params.rbi +20 -0
  242. data/rbi/lib/orb/models/customer_fetch_by_external_id_params.rbi +20 -0
  243. data/rbi/lib/orb/models/customer_fetch_params.rbi +20 -0
  244. data/rbi/lib/orb/models/customer_list_params.rbi +74 -0
  245. data/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi +20 -0
  246. data/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rbi +20 -0
  247. data/rbi/lib/orb/models/customer_update_by_external_id_params.rbi +945 -0
  248. data/rbi/lib/orb/models/customer_update_params.rbi +919 -0
  249. data/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi +64 -0
  250. data/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi +199 -0
  251. data/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi +76 -0
  252. data/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi +191 -0
  253. data/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi +86 -0
  254. data/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi +214 -0
  255. data/rbi/lib/orb/models/customers/cost_list_params.rbi +84 -0
  256. data/rbi/lib/orb/models/customers/cost_list_response.rbi +212 -0
  257. data/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi +64 -0
  258. data/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi +87 -0
  259. data/rbi/lib/orb/models/customers/credit_list_params.rbi +64 -0
  260. data/rbi/lib/orb/models/customers/credit_list_response.rbi +86 -0
  261. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +270 -0
  262. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +1670 -0
  263. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi +238 -0
  264. data/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi +1626 -0
  265. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +181 -0
  266. data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +1654 -0
  267. data/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi +144 -0
  268. data/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi +1588 -0
  269. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +196 -0
  270. data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi +198 -0
  271. data/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi +176 -0
  272. data/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi +175 -0
  273. data/rbi/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi +31 -0
  274. data/rbi/lib/orb/models/customers/credits/top_up_delete_params.rbi +28 -0
  275. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +49 -0
  276. data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi +188 -0
  277. data/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi +49 -0
  278. data/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi +168 -0
  279. data/rbi/lib/orb/models/dimensional_price_group.rbi +75 -0
  280. data/rbi/lib/orb/models/dimensional_price_group_create_params.rbi +66 -0
  281. data/rbi/lib/orb/models/dimensional_price_group_list_params.rbi +39 -0
  282. data/rbi/lib/orb/models/dimensional_price_group_retrieve_params.rbi +20 -0
  283. data/rbi/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi +22 -0
  284. data/rbi/lib/orb/models/dimensional_price_groups.rbi +35 -0
  285. data/rbi/lib/orb/models/discount.rbi +18 -0
  286. data/rbi/lib/orb/models/evaluate_price_group.rbi +45 -0
  287. data/rbi/lib/orb/models/event_deprecate_params.rbi +20 -0
  288. data/rbi/lib/orb/models/event_deprecate_response.rbi +19 -0
  289. data/rbi/lib/orb/models/event_ingest_params.rbi +120 -0
  290. data/rbi/lib/orb/models/event_ingest_response.rbi +79 -0
  291. data/rbi/lib/orb/models/event_search_params.rbi +53 -0
  292. data/rbi/lib/orb/models/event_search_response.rbi +100 -0
  293. data/rbi/lib/orb/models/event_update_params.rbi +71 -0
  294. data/rbi/lib/orb/models/event_update_response.rbi +19 -0
  295. data/rbi/lib/orb/models/events/backfill_close_params.rbi +22 -0
  296. data/rbi/lib/orb/models/events/backfill_close_response.rbi +127 -0
  297. data/rbi/lib/orb/models/events/backfill_create_params.rbi +97 -0
  298. data/rbi/lib/orb/models/events/backfill_create_response.rbi +128 -0
  299. data/rbi/lib/orb/models/events/backfill_fetch_params.rbi +22 -0
  300. data/rbi/lib/orb/models/events/backfill_fetch_response.rbi +127 -0
  301. data/rbi/lib/orb/models/events/backfill_list_params.rbi +41 -0
  302. data/rbi/lib/orb/models/events/backfill_list_response.rbi +127 -0
  303. data/rbi/lib/orb/models/events/backfill_revert_params.rbi +22 -0
  304. data/rbi/lib/orb/models/events/backfill_revert_response.rbi +128 -0
  305. data/rbi/lib/orb/models/events/event_volumes.rbi +47 -0
  306. data/rbi/lib/orb/models/events/volume_list_params.rbi +69 -0
  307. data/rbi/lib/orb/models/invoice.rbi +2466 -0
  308. data/rbi/lib/orb/models/invoice_create_params.rbi +230 -0
  309. data/rbi/lib/orb/models/invoice_fetch_params.rbi +20 -0
  310. data/rbi/lib/orb/models/invoice_fetch_upcoming_params.rbi +24 -0
  311. data/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi +2646 -0
  312. data/rbi/lib/orb/models/invoice_issue_params.rbi +32 -0
  313. data/rbi/lib/orb/models/invoice_level_discount.rbi +16 -0
  314. data/rbi/lib/orb/models/invoice_line_item_create_params.rbi +67 -0
  315. data/rbi/lib/orb/models/invoice_line_item_create_response.rbi +1164 -0
  316. data/rbi/lib/orb/models/invoice_list_params.rbi +187 -0
  317. data/rbi/lib/orb/models/invoice_mark_paid_params.rbi +48 -0
  318. data/rbi/lib/orb/models/invoice_pay_params.rbi +20 -0
  319. data/rbi/lib/orb/models/invoice_update_params.rbi +36 -0
  320. data/rbi/lib/orb/models/invoice_void_params.rbi +20 -0
  321. data/rbi/lib/orb/models/item.rbi +101 -0
  322. data/rbi/lib/orb/models/item_create_params.rbi +25 -0
  323. data/rbi/lib/orb/models/item_fetch_params.rbi +20 -0
  324. data/rbi/lib/orb/models/item_list_params.rbi +39 -0
  325. data/rbi/lib/orb/models/item_update_params.rbi +113 -0
  326. data/rbi/lib/orb/models/metric_create_params.rbi +62 -0
  327. data/rbi/lib/orb/models/metric_fetch_params.rbi +20 -0
  328. data/rbi/lib/orb/models/metric_list_params.rbi +74 -0
  329. data/rbi/lib/orb/models/metric_update_params.rbi +36 -0
  330. data/rbi/lib/orb/models/pagination_metadata.rbi +21 -0
  331. data/rbi/lib/orb/models/percentage_discount.rbi +63 -0
  332. data/rbi/lib/orb/models/plan.rbi +1071 -0
  333. data/rbi/lib/orb/models/plan_create_params.rbi +10069 -0
  334. data/rbi/lib/orb/models/plan_fetch_params.rbi +20 -0
  335. data/rbi/lib/orb/models/plan_list_params.rbi +100 -0
  336. data/rbi/lib/orb/models/plan_update_params.rbi +46 -0
  337. data/rbi/lib/orb/models/plans/external_plan_id_fetch_params.rbi +22 -0
  338. data/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi +48 -0
  339. data/rbi/lib/orb/models/price.rbi +15341 -0
  340. data/rbi/lib/orb/models/price_create_params.rbi +885 -0
  341. data/rbi/lib/orb/models/price_evaluate_params.rbi +81 -0
  342. data/rbi/lib/orb/models/price_evaluate_response.rbi +21 -0
  343. data/rbi/lib/orb/models/price_fetch_params.rbi +20 -0
  344. data/rbi/lib/orb/models/price_list_params.rbi +39 -0
  345. data/rbi/lib/orb/models/price_update_params.rbi +36 -0
  346. data/rbi/lib/orb/models/prices/external_price_id_fetch_params.rbi +22 -0
  347. data/rbi/lib/orb/models/prices/external_price_id_update_params.rbi +38 -0
  348. data/rbi/lib/orb/models/subscription.rbi +1381 -0
  349. data/rbi/lib/orb/models/subscription_cancel_params.rbi +75 -0
  350. data/rbi/lib/orb/models/subscription_cancel_response.rbi +1374 -0
  351. data/rbi/lib/orb/models/subscription_create_params.rbi +23422 -0
  352. data/rbi/lib/orb/models/subscription_create_response.rbi +1374 -0
  353. data/rbi/lib/orb/models/subscription_fetch_costs_params.rbi +82 -0
  354. data/rbi/lib/orb/models/subscription_fetch_costs_response.rbi +210 -0
  355. data/rbi/lib/orb/models/subscription_fetch_params.rbi +20 -0
  356. data/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi +74 -0
  357. data/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi +81 -0
  358. data/rbi/lib/orb/models/subscription_fetch_usage_params.rbi +137 -0
  359. data/rbi/lib/orb/models/subscription_list_params.rbi +108 -0
  360. data/rbi/lib/orb/models/subscription_price_intervals_params.rbi +12991 -0
  361. data/rbi/lib/orb/models/subscription_price_intervals_response.rbi +1387 -0
  362. data/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi +23589 -0
  363. data/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi +1390 -0
  364. data/rbi/lib/orb/models/subscription_trigger_phase_params.rbi +45 -0
  365. data/rbi/lib/orb/models/subscription_trigger_phase_response.rbi +1381 -0
  366. data/rbi/lib/orb/models/subscription_unschedule_cancellation_params.rbi +20 -0
  367. data/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi +1400 -0
  368. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +25 -0
  369. data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +1451 -0
  370. data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rbi +20 -0
  371. data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +1410 -0
  372. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi +104 -0
  373. data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi +1400 -0
  374. data/rbi/lib/orb/models/subscription_update_params.rbi +77 -0
  375. data/rbi/lib/orb/models/subscription_update_trial_params.rbi +63 -0
  376. data/rbi/lib/orb/models/subscription_update_trial_response.rbi +1378 -0
  377. data/rbi/lib/orb/models/subscription_usage.rbi +323 -0
  378. data/rbi/lib/orb/models/subscriptions.rbi +33 -0
  379. data/rbi/lib/orb/models/top_level_ping_params.rbi +20 -0
  380. data/rbi/lib/orb/models/top_level_ping_response.rbi +18 -0
  381. data/rbi/lib/orb/models/trial_discount.rbi +73 -0
  382. data/rbi/lib/orb/models/usage_discount.rbi +62 -0
  383. data/rbi/lib/orb/page.rbi +35 -0
  384. data/rbi/lib/orb/request_options.rbi +48 -0
  385. data/rbi/lib/orb/resources/alerts.rbi +216 -0
  386. data/rbi/lib/orb/resources/coupons/subscriptions.rbi +38 -0
  387. data/rbi/lib/orb/resources/coupons.rbi +96 -0
  388. data/rbi/lib/orb/resources/credit_notes.rbi +74 -0
  389. data/rbi/lib/orb/resources/customers/balance_transactions.rbi +92 -0
  390. data/rbi/lib/orb/resources/customers/costs.rbi +304 -0
  391. data/rbi/lib/orb/resources/customers/credits/ledger.rbi +645 -0
  392. data/rbi/lib/orb/resources/customers/credits/top_ups.rbi +180 -0
  393. data/rbi/lib/orb/resources/customers/credits.rbi +88 -0
  394. data/rbi/lib/orb/resources/customers.rbi +714 -0
  395. data/rbi/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbi +25 -0
  396. data/rbi/lib/orb/resources/dimensional_price_groups.rbi +78 -0
  397. data/rbi/lib/orb/resources/events/backfills.rbi +161 -0
  398. data/rbi/lib/orb/resources/events/volume.rbi +57 -0
  399. data/rbi/lib/orb/resources/events.rbi +408 -0
  400. data/rbi/lib/orb/resources/invoice_line_items.rbi +44 -0
  401. data/rbi/lib/orb/resources/invoices.rbi +262 -0
  402. data/rbi/lib/orb/resources/items.rbi +65 -0
  403. data/rbi/lib/orb/resources/metrics.rbi +102 -0
  404. data/rbi/lib/orb/resources/plans/external_plan_id.rbi +67 -0
  405. data/rbi/lib/orb/resources/plans.rbi +170 -0
  406. data/rbi/lib/orb/resources/prices/external_price_id.rbi +110 -0
  407. data/rbi/lib/orb/resources/prices.rbi +371 -0
  408. data/rbi/lib/orb/resources/subscriptions.rbi +1469 -0
  409. data/rbi/lib/orb/resources/top_level.rbi +25 -0
  410. data/rbi/lib/orb/transport/base_client.rbi +205 -0
  411. data/rbi/lib/orb/transport/pooled_net_requester.rbi +64 -0
  412. data/rbi/lib/orb/type/array_of.rbi +82 -0
  413. data/rbi/lib/orb/type/base_model.rbi +197 -0
  414. data/rbi/lib/orb/type/base_page.rbi +38 -0
  415. data/rbi/lib/orb/type/boolean_model.rbi +41 -0
  416. data/rbi/lib/orb/type/converter.rbi +95 -0
  417. data/rbi/lib/orb/type/enum.rbi +58 -0
  418. data/rbi/lib/orb/type/hash_of.rbi +86 -0
  419. data/rbi/lib/orb/type/request_parameters.rbi +20 -0
  420. data/rbi/lib/orb/type/union.rbi +66 -0
  421. data/rbi/lib/orb/type/unknown.rbi +37 -0
  422. data/rbi/lib/orb/type.rbi +23 -0
  423. data/rbi/lib/orb/util.rbi +278 -0
  424. data/rbi/lib/orb/version.rbi +5 -0
  425. data/sig/orb/client.rbs +53 -0
  426. data/sig/orb/errors.rbs +201 -0
  427. data/sig/orb/models/alert.rbs +142 -0
  428. data/sig/orb/models/alert_create_for_customer_params.rbs +56 -0
  429. data/sig/orb/models/alert_create_for_external_customer_params.rbs +56 -0
  430. data/sig/orb/models/alert_create_for_subscription_params.rbs +52 -0
  431. data/sig/orb/models/alert_disable_params.rbs +20 -0
  432. data/sig/orb/models/alert_enable_params.rbs +20 -0
  433. data/sig/orb/models/alert_list_params.rbs +57 -0
  434. data/sig/orb/models/alert_retrieve_params.rbs +14 -0
  435. data/sig/orb/models/alert_update_params.rbs +31 -0
  436. data/sig/orb/models/amount_discount.rbs +40 -0
  437. data/sig/orb/models/billable_metric.rbs +50 -0
  438. data/sig/orb/models/billing_cycle_relative_date.rbs +14 -0
  439. data/sig/orb/models/coupon.rbs +51 -0
  440. data/sig/orb/models/coupon_archive_params.rbs +14 -0
  441. data/sig/orb/models/coupon_create_params.rbs +77 -0
  442. data/sig/orb/models/coupon_fetch_params.rbs +14 -0
  443. data/sig/orb/models/coupon_list_params.rbs +37 -0
  444. data/sig/orb/models/coupons/subscription_list_params.rbs +27 -0
  445. data/sig/orb/models/credit_note.rbs +345 -0
  446. data/sig/orb/models/credit_note_create_params.rbs +57 -0
  447. data/sig/orb/models/credit_note_fetch_params.rbs +14 -0
  448. data/sig/orb/models/credit_note_list_params.rbs +45 -0
  449. data/sig/orb/models/customer.rbs +628 -0
  450. data/sig/orb/models/customer_create_params.rbs +624 -0
  451. data/sig/orb/models/customer_delete_params.rbs +14 -0
  452. data/sig/orb/models/customer_fetch_by_external_id_params.rbs +14 -0
  453. data/sig/orb/models/customer_fetch_params.rbs +14 -0
  454. data/sig/orb/models/customer_list_params.rbs +45 -0
  455. data/sig/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbs +15 -0
  456. data/sig/orb/models/customer_sync_payment_methods_from_gateway_params.rbs +15 -0
  457. data/sig/orb/models/customer_update_by_external_id_params.rbs +620 -0
  458. data/sig/orb/models/customer_update_params.rbs +620 -0
  459. data/sig/orb/models/customers/balance_transaction_create_params.rbs +44 -0
  460. data/sig/orb/models/customers/balance_transaction_create_response.rbs +114 -0
  461. data/sig/orb/models/customers/balance_transaction_list_params.rbs +47 -0
  462. data/sig/orb/models/customers/balance_transaction_list_response.rbs +114 -0
  463. data/sig/orb/models/customers/cost_list_by_external_id_params.rbs +48 -0
  464. data/sig/orb/models/customers/cost_list_by_external_id_response.rbs +82 -0
  465. data/sig/orb/models/customers/cost_list_params.rbs +48 -0
  466. data/sig/orb/models/customers/cost_list_response.rbs +80 -0
  467. data/sig/orb/models/customers/credit_list_by_external_id_params.rbs +41 -0
  468. data/sig/orb/models/customers/credit_list_by_external_id_response.rbs +55 -0
  469. data/sig/orb/models/customers/credit_list_params.rbs +41 -0
  470. data/sig/orb/models/customers/credit_list_response.rbs +55 -0
  471. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +120 -0
  472. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs +814 -0
  473. data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +120 -0
  474. data/sig/orb/models/customers/credits/ledger_create_entry_response.rbs +814 -0
  475. data/sig/orb/models/customers/credits/ledger_list_by_external_id_params.rbs +99 -0
  476. data/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs +814 -0
  477. data/sig/orb/models/customers/credits/ledger_list_params.rbs +99 -0
  478. data/sig/orb/models/customers/credits/ledger_list_response.rbs +814 -0
  479. data/sig/orb/models/customers/credits/top_up_create_by_external_id_params.rbs +95 -0
  480. data/sig/orb/models/customers/credits/top_up_create_by_external_id_response.rbs +90 -0
  481. data/sig/orb/models/customers/credits/top_up_create_params.rbs +95 -0
  482. data/sig/orb/models/customers/credits/top_up_create_response.rbs +90 -0
  483. data/sig/orb/models/customers/credits/top_up_delete_by_external_id_params.rbs +24 -0
  484. data/sig/orb/models/customers/credits/top_up_delete_params.rbs +24 -0
  485. data/sig/orb/models/customers/credits/top_up_list_by_external_id_params.rbs +29 -0
  486. data/sig/orb/models/customers/credits/top_up_list_by_external_id_response.rbs +90 -0
  487. data/sig/orb/models/customers/credits/top_up_list_params.rbs +29 -0
  488. data/sig/orb/models/customers/credits/top_up_list_response.rbs +90 -0
  489. data/sig/orb/models/dimensional_price_group.rbs +38 -0
  490. data/sig/orb/models/dimensional_price_group_create_params.rbs +39 -0
  491. data/sig/orb/models/dimensional_price_group_list_params.rbs +25 -0
  492. data/sig/orb/models/dimensional_price_group_retrieve_params.rbs +15 -0
  493. data/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbs +17 -0
  494. data/sig/orb/models/dimensional_price_groups.rbs +22 -0
  495. data/sig/orb/models/discount.rbs +15 -0
  496. data/sig/orb/models/evaluate_price_group.rbs +34 -0
  497. data/sig/orb/models/event_deprecate_params.rbs +14 -0
  498. data/sig/orb/models/event_deprecate_response.rbs +13 -0
  499. data/sig/orb/models/event_ingest_params.rbs +68 -0
  500. data/sig/orb/models/event_ingest_response.rbs +53 -0
  501. data/sig/orb/models/event_search_params.rbs +31 -0
  502. data/sig/orb/models/event_search_response.rbs +55 -0
  503. data/sig/orb/models/event_update_params.rbs +39 -0
  504. data/sig/orb/models/event_update_response.rbs +13 -0
  505. data/sig/orb/models/events/backfill_close_params.rbs +16 -0
  506. data/sig/orb/models/events/backfill_close_response.rbs +73 -0
  507. data/sig/orb/models/events/backfill_create_params.rbs +51 -0
  508. data/sig/orb/models/events/backfill_create_response.rbs +73 -0
  509. data/sig/orb/models/events/backfill_fetch_params.rbs +16 -0
  510. data/sig/orb/models/events/backfill_fetch_response.rbs +73 -0
  511. data/sig/orb/models/events/backfill_list_params.rbs +27 -0
  512. data/sig/orb/models/events/backfill_list_response.rbs +73 -0
  513. data/sig/orb/models/events/backfill_revert_params.rbs +16 -0
  514. data/sig/orb/models/events/backfill_revert_response.rbs +73 -0
  515. data/sig/orb/models/events/event_volumes.rbs +39 -0
  516. data/sig/orb/models/events/volume_list_params.rbs +41 -0
  517. data/sig/orb/models/invoice.rbs +1430 -0
  518. data/sig/orb/models/invoice_create_params.rbs +120 -0
  519. data/sig/orb/models/invoice_fetch_params.rbs +14 -0
  520. data/sig/orb/models/invoice_fetch_upcoming_params.rbs +20 -0
  521. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +1430 -0
  522. data/sig/orb/models/invoice_issue_params.rbs +21 -0
  523. data/sig/orb/models/invoice_level_discount.rbs +14 -0
  524. data/sig/orb/models/invoice_line_item_create_params.rbs +43 -0
  525. data/sig/orb/models/invoice_line_item_create_response.rbs +546 -0
  526. data/sig/orb/models/invoice_list_params.rbs +122 -0
  527. data/sig/orb/models/invoice_mark_paid_params.rbs +27 -0
  528. data/sig/orb/models/invoice_pay_params.rbs +14 -0
  529. data/sig/orb/models/invoice_update_params.rbs +20 -0
  530. data/sig/orb/models/invoice_void_params.rbs +14 -0
  531. data/sig/orb/models/item.rbs +72 -0
  532. data/sig/orb/models/item_create_params.rbs +19 -0
  533. data/sig/orb/models/item_fetch_params.rbs +14 -0
  534. data/sig/orb/models/item_list_params.rbs +25 -0
  535. data/sig/orb/models/item_update_params.rbs +69 -0
  536. data/sig/orb/models/metric_create_params.rbs +39 -0
  537. data/sig/orb/models/metric_fetch_params.rbs +14 -0
  538. data/sig/orb/models/metric_list_params.rbs +45 -0
  539. data/sig/orb/models/metric_update_params.rbs +20 -0
  540. data/sig/orb/models/pagination_metadata.rbs +15 -0
  541. data/sig/orb/models/percentage_discount.rbs +40 -0
  542. data/sig/orb/models/plan.rbs +529 -0
  543. data/sig/orb/models/plan_create_params.rbs +3991 -0
  544. data/sig/orb/models/plan_fetch_params.rbs +14 -0
  545. data/sig/orb/models/plan_list_params.rbs +65 -0
  546. data/sig/orb/models/plan_update_params.rbs +24 -0
  547. data/sig/orb/models/plans/external_plan_id_fetch_params.rbs +16 -0
  548. data/sig/orb/models/plans/external_plan_id_update_params.rbs +26 -0
  549. data/sig/orb/models/price.rbs +8108 -0
  550. data/sig/orb/models/price_create_params.rbs +520 -0
  551. data/sig/orb/models/price_evaluate_params.rbs +45 -0
  552. data/sig/orb/models/price_evaluate_response.rbs +14 -0
  553. data/sig/orb/models/price_fetch_params.rbs +14 -0
  554. data/sig/orb/models/price_list_params.rbs +25 -0
  555. data/sig/orb/models/price_update_params.rbs +20 -0
  556. data/sig/orb/models/prices/external_price_id_fetch_params.rbs +16 -0
  557. data/sig/orb/models/prices/external_price_id_update_params.rbs +22 -0
  558. data/sig/orb/models/subscription.rbs +687 -0
  559. data/sig/orb/models/subscription_cancel_params.rbs +44 -0
  560. data/sig/orb/models/subscription_cancel_response.rbs +687 -0
  561. data/sig/orb/models/subscription_create_params.rbs +9141 -0
  562. data/sig/orb/models/subscription_create_response.rbs +687 -0
  563. data/sig/orb/models/subscription_fetch_costs_params.rbs +46 -0
  564. data/sig/orb/models/subscription_fetch_costs_response.rbs +78 -0
  565. data/sig/orb/models/subscription_fetch_params.rbs +14 -0
  566. data/sig/orb/models/subscription_fetch_schedule_params.rbs +45 -0
  567. data/sig/orb/models/subscription_fetch_schedule_response.rbs +48 -0
  568. data/sig/orb/models/subscription_fetch_usage_params.rbs +80 -0
  569. data/sig/orb/models/subscription_list_params.rbs +69 -0
  570. data/sig/orb/models/subscription_price_intervals_params.rbs +5117 -0
  571. data/sig/orb/models/subscription_price_intervals_response.rbs +687 -0
  572. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +9133 -0
  573. data/sig/orb/models/subscription_schedule_plan_change_response.rbs +687 -0
  574. data/sig/orb/models/subscription_trigger_phase_params.rbs +24 -0
  575. data/sig/orb/models/subscription_trigger_phase_response.rbs +687 -0
  576. data/sig/orb/models/subscription_unschedule_cancellation_params.rbs +15 -0
  577. data/sig/orb/models/subscription_unschedule_cancellation_response.rbs +687 -0
  578. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbs +20 -0
  579. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs +687 -0
  580. data/sig/orb/models/subscription_unschedule_pending_plan_changes_params.rbs +15 -0
  581. data/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs +687 -0
  582. data/sig/orb/models/subscription_update_fixed_fee_quantity_params.rbs +55 -0
  583. data/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs +687 -0
  584. data/sig/orb/models/subscription_update_params.rbs +39 -0
  585. data/sig/orb/models/subscription_update_trial_params.rbs +39 -0
  586. data/sig/orb/models/subscription_update_trial_response.rbs +687 -0
  587. data/sig/orb/models/subscription_usage.rbs +196 -0
  588. data/sig/orb/models/subscriptions.rbs +22 -0
  589. data/sig/orb/models/top_level_ping_params.rbs +14 -0
  590. data/sig/orb/models/top_level_ping_response.rbs +13 -0
  591. data/sig/orb/models/trial_discount.rbs +44 -0
  592. data/sig/orb/models/usage_discount.rbs +40 -0
  593. data/sig/orb/page.rbs +22 -0
  594. data/sig/orb/request_options.rbs +32 -0
  595. data/sig/orb/resources/alerts.rbs +67 -0
  596. data/sig/orb/resources/coupons/subscriptions.rbs +16 -0
  597. data/sig/orb/resources/coupons.rbs +35 -0
  598. data/sig/orb/resources/credit_notes.rbs +29 -0
  599. data/sig/orb/resources/customers/balance_transactions.rbs +28 -0
  600. data/sig/orb/resources/customers/costs.rbs +27 -0
  601. data/sig/orb/resources/customers/credits/ledger.rbs +75 -0
  602. data/sig/orb/resources/customers/credits/top_ups.rbs +63 -0
  603. data/sig/orb/resources/customers/credits.rbs +31 -0
  604. data/sig/orb/resources/customers.rbs +114 -0
  605. data/sig/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbs +14 -0
  606. data/sig/orb/resources/dimensional_price_groups.rbs +29 -0
  607. data/sig/orb/resources/events/backfills.rbs +41 -0
  608. data/sig/orb/resources/events/volume.rbs +17 -0
  609. data/sig/orb/resources/events.rbs +40 -0
  610. data/sig/orb/resources/invoice_line_items.rbs +17 -0
  611. data/sig/orb/resources/invoices.rbs +84 -0
  612. data/sig/orb/resources/items.rbs +30 -0
  613. data/sig/orb/resources/metrics.rbs +37 -0
  614. data/sig/orb/resources/plans/external_plan_id.rbs +21 -0
  615. data/sig/orb/resources/plans.rbs +44 -0
  616. data/sig/orb/resources/prices/external_price_id.rbs +20 -0
  617. data/sig/orb/resources/prices.rbs +83 -0
  618. data/sig/orb/resources/subscriptions.rbs +194 -0
  619. data/sig/orb/resources/top_level.rbs +11 -0
  620. data/sig/orb/transport/base_client.rbs +110 -0
  621. data/sig/orb/transport/pooled_net_requester.rbs +39 -0
  622. data/sig/orb/type/array_of.rbs +36 -0
  623. data/sig/orb/type/base_model.rbs +77 -0
  624. data/sig/orb/type/base_page.rbs +22 -0
  625. data/sig/orb/type/boolean_model.rbs +18 -0
  626. data/sig/orb/type/converter.rbs +36 -0
  627. data/sig/orb/type/enum.rbs +22 -0
  628. data/sig/orb/type/hash_of.rbs +36 -0
  629. data/sig/orb/type/request_parameters.rbs +13 -0
  630. data/sig/orb/type/union.rbs +37 -0
  631. data/sig/orb/type/unknown.rbs +15 -0
  632. data/sig/orb/type.rbs +22 -0
  633. data/sig/orb/util.rbs +132 -0
  634. data/sig/orb/version.rbs +3 -0
  635. metadata +692 -0
@@ -0,0 +1,645 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Resources
5
+ class Customers
6
+ class Credits
7
+ class Ledger
8
+ # The credits ledger provides _auditing_ functionality over Orb's credits system
9
+ # with a list of actions that have taken place to modify a customer's credit
10
+ # balance. This [paginated endpoint](/api-reference/pagination) lists these
11
+ # entries, starting from the most recent ledger entry.
12
+ #
13
+ # More details on using Orb's real-time credit feature are
14
+ # [here](/product-catalog/prepurchase).
15
+ #
16
+ # There are four major types of modifications to credit balance, detailed below.
17
+ #
18
+ # ## Increment
19
+ #
20
+ # Credits (which optionally expire on a future date) can be added via the API
21
+ # ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action
22
+ # will always contain the total eligible starting and ending balance for the
23
+ # customer at the time the entry was added to the ledger.
24
+ #
25
+ # ## Decrement
26
+ #
27
+ # Deductions can occur as a result of an API call to create a ledger entry (see
28
+ # [Add Ledger Entry](create-ledger-entry)), or automatically as a result of
29
+ # incurring usage. Both ledger entries present the `decrement` entry type.
30
+ #
31
+ # As usage for a customer is reported into Orb, credits may be deducted according
32
+ # to the customer's plan configuration. An automated deduction of this type will
33
+ # result in a ledger entry, also with a starting and ending balance. In order to
34
+ # provide better tracing capabilities for automatic deductions, Orb always
35
+ # associates each automatic deduction with the `event_id` at the time of
36
+ # ingestion, used to pinpoint _why_ credit deduction took place and to ensure that
37
+ # credits are never deducted without an associated usage event.
38
+ #
39
+ # By default, Orb uses an algorithm that automatically deducts from the _soonest
40
+ # expiring credit block_ first in order to ensure that all credits are utilized
41
+ # appropriately. As an example, if trial credits with an expiration date of 2
42
+ # weeks from now are present for a customer, they will be used before any
43
+ # deductions take place from a non-expiring credit block.
44
+ #
45
+ # If there are multiple blocks with the same expiration date, Orb will deduct from
46
+ # the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost
47
+ # basis before paid credits with a $5.00 cost basis).
48
+ #
49
+ # It's also possible for a single usage event's deduction to _span_ credit blocks.
50
+ # In this case, Orb will deduct from the next block, ending at the credit block
51
+ # which consists of unexpiring credits. Each of these deductions will lead to a
52
+ # _separate_ ledger entry, one per credit block that is deducted from. By default,
53
+ # the customer's total credit balance in Orb can be negative as a result of a
54
+ # decrement.
55
+ #
56
+ # ## Expiration change
57
+ #
58
+ # The expiry of credits can be changed as a result of the API (See
59
+ # [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that
60
+ # specifies the balance as well as the initial and target expiry dates.
61
+ #
62
+ # Note that for this entry type, `starting_balance` will equal `ending_balance`,
63
+ # and the `amount` represents the balance transferred. The credit block linked to
64
+ # the ledger entry is the source credit block from which there was an expiration
65
+ # change
66
+ #
67
+ # ## Credits expiry
68
+ #
69
+ # When a set of credits expire on pre-set expiration date, the customer's balance
70
+ # automatically reflects this change and adds an entry to the ledger indicating
71
+ # this event. Note that credit expiry should always happen close to a date
72
+ # boundary in the customer's timezone.
73
+ #
74
+ # ## Void initiated
75
+ #
76
+ # Credit blocks can be voided via the API. The `amount` on this entry corresponds
77
+ # to the number of credits that were remaining in the block at time of void.
78
+ # `void_reason` will be populated if the void is created with a reason.
79
+ #
80
+ # ## Void
81
+ #
82
+ # When a set of credits is voided, the customer's balance automatically reflects
83
+ # this change and adds an entry to the ledger indicating this event.
84
+ #
85
+ # ## Amendment
86
+ #
87
+ # When credits are added to a customer's balance as a result of a correction, this
88
+ # entry will be added to the ledger to indicate the adjustment of credits.
89
+ sig do
90
+ params(
91
+ customer_id: String,
92
+ created_at_gt: T.nilable(Time),
93
+ created_at_gte: T.nilable(Time),
94
+ created_at_lt: T.nilable(Time),
95
+ created_at_lte: T.nilable(Time),
96
+ currency: T.nilable(String),
97
+ cursor: T.nilable(String),
98
+ entry_status: T.nilable(Orb::Models::Customers::Credits::LedgerListParams::EntryStatus::OrSymbol),
99
+ entry_type: T.nilable(Orb::Models::Customers::Credits::LedgerListParams::EntryType::OrSymbol),
100
+ limit: Integer,
101
+ minimum_amount: T.nilable(String),
102
+ request_options: T.nilable(T.any(Orb::RequestOptions, Orb::Util::AnyHash))
103
+ )
104
+ .returns(
105
+ Orb::Page[
106
+ T.any(
107
+ Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry,
108
+ Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry,
109
+ Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry,
110
+ Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry,
111
+ Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry,
112
+ Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry,
113
+ Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry
114
+ )
115
+ ]
116
+ )
117
+ end
118
+ def list(
119
+ customer_id,
120
+ created_at_gt: nil,
121
+ created_at_gte: nil,
122
+ created_at_lt: nil,
123
+ created_at_lte: nil,
124
+ # The ledger currency or custom pricing unit to use.
125
+ currency: nil,
126
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
127
+ # from the initial request.
128
+ cursor: nil,
129
+ entry_status: nil,
130
+ entry_type: nil,
131
+ # The number of items to fetch. Defaults to 20.
132
+ limit: nil,
133
+ minimum_amount: nil,
134
+ request_options: {}
135
+ )
136
+ end
137
+
138
+ # This endpoint allows you to create a new ledger entry for a specified customer's
139
+ # balance. This can be used to increment balance, deduct credits, and change the
140
+ # expiry date of existing credits.
141
+ #
142
+ # ## Effects of adding a ledger entry
143
+ #
144
+ # 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits)
145
+ # will return a credit block that represents the changes (i.e. balance changes
146
+ # or transfers).
147
+ # 2. A ledger entry will be added to the credits ledger for this customer, and
148
+ # therefore returned in the
149
+ # [View Credits Ledger](fetch-customer-credits-ledger) response as well as
150
+ # serialized in the response to this request. In the case of deductions without
151
+ # a specified block, multiple ledger entries may be created if the deduction
152
+ # spans credit blocks.
153
+ # 3. If `invoice_settings` is specified, an invoice will be created that reflects
154
+ # the cost of the credits (based on `amount` and `per_unit_cost_basis`).
155
+ #
156
+ # ## Adding credits
157
+ #
158
+ # Adding credits is done by creating an entry of type `increment`. This requires
159
+ # the caller to specify a number of credits as well as an optional expiry date in
160
+ # `YYYY-MM-DD` format. Orb also recommends specifying a description to assist with
161
+ # auditing. When adding credits, the caller can also specify a cost basis
162
+ # per-credit, to indicate how much in USD a customer paid for a single credit in a
163
+ # block. This can later be used for revenue recognition.
164
+ #
165
+ # The following snippet illustrates a sample request body to increment credits
166
+ # which will expire in January of 2022.
167
+ #
168
+ # ```json
169
+ # {
170
+ # "entry_type": "increment",
171
+ # "amount": 100,
172
+ # "expiry_date": "2022-12-28",
173
+ # "per_unit_cost_basis": "0.20",
174
+ # "description": "Purchased 100 credits"
175
+ # }
176
+ # ```
177
+ #
178
+ # Note that by default, Orb will always first increment any _negative_ balance in
179
+ # existing blocks before adding the remaining amount to the desired credit block.
180
+ #
181
+ # ### Invoicing for credits
182
+ #
183
+ # By default, Orb manipulates the credit ledger but does not charge for credits.
184
+ # However, if you pass `invoice_settings` in the body of this request, Orb will
185
+ # also generate a one-off invoice for the customer for the credits pre-purchase.
186
+ # Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
187
+ # on the invoice are calculated by multiplying the cost basis with the number of
188
+ # credit units added.
189
+ #
190
+ # ## Deducting Credits
191
+ #
192
+ # Orb allows you to deduct credits from a customer by creating an entry of type
193
+ # `decrement`. Orb matches the algorithm for automatic deductions for determining
194
+ # which credit blocks to decrement from. In the case that the deduction leads to
195
+ # multiple ledger entries, the response from this endpoint will be the final
196
+ # deduction. Orb also optionally allows specifying a description to assist with
197
+ # auditing.
198
+ #
199
+ # The following snippet illustrates a sample request body to decrement credits.
200
+ #
201
+ # ```json
202
+ # {
203
+ # "entry_type": "decrement",
204
+ # "amount": 20,
205
+ # "description": "Removing excess credits"
206
+ # }
207
+ # ```
208
+ #
209
+ # ## Changing credits expiry
210
+ #
211
+ # If you'd like to change when existing credits expire, you should create a ledger
212
+ # entry of type `expiration_change`. For this entry, the required parameter
213
+ # `expiry_date` identifies the _originating_ block, and the required parameter
214
+ # `target_expiry_date` identifies when the transferred credits should now expire.
215
+ # A new credit block will be created with expiry date `target_expiry_date`, with
216
+ # the same cost basis data as the original credit block, if present.
217
+ #
218
+ # Note that the balance of the block with the given `expiry_date` must be at least
219
+ # equal to the desired transfer amount determined by the `amount` parameter.
220
+ #
221
+ # The following snippet illustrates a sample request body to extend the expiration
222
+ # date of credits by one year:
223
+ #
224
+ # ```json
225
+ # {
226
+ # "entry_type": "expiration_change",
227
+ # "amount": 10,
228
+ # "expiry_date": "2022-12-28",
229
+ # "block_id": "UiUhFWeLHPrBY4Ad",
230
+ # "target_expiry_date": "2023-12-28",
231
+ # "description": "Extending credit validity"
232
+ # }
233
+ # ```
234
+ #
235
+ # ## Voiding credits
236
+ #
237
+ # If you'd like to void a credit block, create a ledger entry of type `void`. For
238
+ # this entry, `block_id` is required to identify the block, and `amount` indicates
239
+ # how many credits to void, up to the block's initial balance. Pass in a
240
+ # `void_reason` of `refund` if the void is due to a refund.
241
+ #
242
+ # ## Amendment
243
+ #
244
+ # If you'd like to undo a decrement on a credit block, create a ledger entry of
245
+ # type `amendment`. For this entry, `block_id` is required to identify the block
246
+ # that was originally decremented from, and `amount` indicates how many credits to
247
+ # return to the customer, up to the block's initial balance.
248
+ sig do
249
+ params(
250
+ customer_id: String,
251
+ amount: Float,
252
+ entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryParams::EntryType::OrSymbol,
253
+ expiry_date: T.nilable(Time),
254
+ target_expiry_date: Date,
255
+ block_id: String,
256
+ currency: T.nilable(String),
257
+ description: T.nilable(String),
258
+ effective_date: T.nilable(Time),
259
+ invoice_settings: T.nilable(
260
+ T.any(Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, Orb::Util::AnyHash)
261
+ ),
262
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
263
+ per_unit_cost_basis: T.nilable(String),
264
+ void_reason: T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryParams::VoidReason::OrSymbol),
265
+ request_options: T.nilable(T.any(Orb::RequestOptions, Orb::Util::AnyHash))
266
+ )
267
+ .returns(
268
+ T.any(
269
+ Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry,
270
+ Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry,
271
+ Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry,
272
+ Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry,
273
+ Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry,
274
+ Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry,
275
+ Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry
276
+ )
277
+ )
278
+ end
279
+ def create_entry(
280
+ customer_id,
281
+ # The number of credits to effect. Note that this is required for increment,
282
+ # decrement or void operations.
283
+ amount:,
284
+ entry_type:,
285
+ # An ISO 8601 format date that identifies the origination credit block to expire
286
+ expiry_date:,
287
+ # A future date (specified in YYYY-MM-DD format) used for expiration change,
288
+ # denoting when credits transferred (as part of a partial block expiration) should
289
+ # expire.
290
+ target_expiry_date:,
291
+ # The ID of the block to reverse a decrement from.
292
+ block_id:,
293
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
294
+ # real-world currency, it must match the customer's invoicing currency.
295
+ currency: nil,
296
+ # Optional metadata that can be specified when adding ledger results via the API.
297
+ # For example, this can be used to note an increment refers to trial credits, or
298
+ # for noting corrections as a result of an incident, etc.
299
+ description: nil,
300
+ # An ISO 8601 format date that denotes when this credit balance should become
301
+ # available for use.
302
+ effective_date: nil,
303
+ # Passing `invoice_settings` automatically generates an invoice for the newly
304
+ # added credits. If `invoice_settings` is passed, you must specify
305
+ # per_unit_cost_basis, as the calculation of the invoice total is done on that
306
+ # basis.
307
+ invoice_settings: nil,
308
+ # User-specified key/value pairs for the resource. Individual keys can be removed
309
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
310
+ # by setting `metadata` to `null`.
311
+ metadata: nil,
312
+ # Can only be specified when entry_type=increment. How much, in the customer's
313
+ # currency, a customer paid for a single credit in this block
314
+ per_unit_cost_basis: nil,
315
+ # Can only be specified when `entry_type=void`. The reason for the void.
316
+ void_reason: nil,
317
+ request_options: {}
318
+ )
319
+ end
320
+
321
+ # This endpoint allows you to create a new ledger entry for a specified customer's
322
+ # balance. This can be used to increment balance, deduct credits, and change the
323
+ # expiry date of existing credits.
324
+ #
325
+ # ## Effects of adding a ledger entry
326
+ #
327
+ # 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits)
328
+ # will return a credit block that represents the changes (i.e. balance changes
329
+ # or transfers).
330
+ # 2. A ledger entry will be added to the credits ledger for this customer, and
331
+ # therefore returned in the
332
+ # [View Credits Ledger](fetch-customer-credits-ledger) response as well as
333
+ # serialized in the response to this request. In the case of deductions without
334
+ # a specified block, multiple ledger entries may be created if the deduction
335
+ # spans credit blocks.
336
+ # 3. If `invoice_settings` is specified, an invoice will be created that reflects
337
+ # the cost of the credits (based on `amount` and `per_unit_cost_basis`).
338
+ #
339
+ # ## Adding credits
340
+ #
341
+ # Adding credits is done by creating an entry of type `increment`. This requires
342
+ # the caller to specify a number of credits as well as an optional expiry date in
343
+ # `YYYY-MM-DD` format. Orb also recommends specifying a description to assist with
344
+ # auditing. When adding credits, the caller can also specify a cost basis
345
+ # per-credit, to indicate how much in USD a customer paid for a single credit in a
346
+ # block. This can later be used for revenue recognition.
347
+ #
348
+ # The following snippet illustrates a sample request body to increment credits
349
+ # which will expire in January of 2022.
350
+ #
351
+ # ```json
352
+ # {
353
+ # "entry_type": "increment",
354
+ # "amount": 100,
355
+ # "expiry_date": "2022-12-28",
356
+ # "per_unit_cost_basis": "0.20",
357
+ # "description": "Purchased 100 credits"
358
+ # }
359
+ # ```
360
+ #
361
+ # Note that by default, Orb will always first increment any _negative_ balance in
362
+ # existing blocks before adding the remaining amount to the desired credit block.
363
+ #
364
+ # ### Invoicing for credits
365
+ #
366
+ # By default, Orb manipulates the credit ledger but does not charge for credits.
367
+ # However, if you pass `invoice_settings` in the body of this request, Orb will
368
+ # also generate a one-off invoice for the customer for the credits pre-purchase.
369
+ # Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
370
+ # on the invoice are calculated by multiplying the cost basis with the number of
371
+ # credit units added.
372
+ #
373
+ # ## Deducting Credits
374
+ #
375
+ # Orb allows you to deduct credits from a customer by creating an entry of type
376
+ # `decrement`. Orb matches the algorithm for automatic deductions for determining
377
+ # which credit blocks to decrement from. In the case that the deduction leads to
378
+ # multiple ledger entries, the response from this endpoint will be the final
379
+ # deduction. Orb also optionally allows specifying a description to assist with
380
+ # auditing.
381
+ #
382
+ # The following snippet illustrates a sample request body to decrement credits.
383
+ #
384
+ # ```json
385
+ # {
386
+ # "entry_type": "decrement",
387
+ # "amount": 20,
388
+ # "description": "Removing excess credits"
389
+ # }
390
+ # ```
391
+ #
392
+ # ## Changing credits expiry
393
+ #
394
+ # If you'd like to change when existing credits expire, you should create a ledger
395
+ # entry of type `expiration_change`. For this entry, the required parameter
396
+ # `expiry_date` identifies the _originating_ block, and the required parameter
397
+ # `target_expiry_date` identifies when the transferred credits should now expire.
398
+ # A new credit block will be created with expiry date `target_expiry_date`, with
399
+ # the same cost basis data as the original credit block, if present.
400
+ #
401
+ # Note that the balance of the block with the given `expiry_date` must be at least
402
+ # equal to the desired transfer amount determined by the `amount` parameter.
403
+ #
404
+ # The following snippet illustrates a sample request body to extend the expiration
405
+ # date of credits by one year:
406
+ #
407
+ # ```json
408
+ # {
409
+ # "entry_type": "expiration_change",
410
+ # "amount": 10,
411
+ # "expiry_date": "2022-12-28",
412
+ # "block_id": "UiUhFWeLHPrBY4Ad",
413
+ # "target_expiry_date": "2023-12-28",
414
+ # "description": "Extending credit validity"
415
+ # }
416
+ # ```
417
+ #
418
+ # ## Voiding credits
419
+ #
420
+ # If you'd like to void a credit block, create a ledger entry of type `void`. For
421
+ # this entry, `block_id` is required to identify the block, and `amount` indicates
422
+ # how many credits to void, up to the block's initial balance. Pass in a
423
+ # `void_reason` of `refund` if the void is due to a refund.
424
+ #
425
+ # ## Amendment
426
+ #
427
+ # If you'd like to undo a decrement on a credit block, create a ledger entry of
428
+ # type `amendment`. For this entry, `block_id` is required to identify the block
429
+ # that was originally decremented from, and `amount` indicates how many credits to
430
+ # return to the customer, up to the block's initial balance.
431
+ sig do
432
+ params(
433
+ external_customer_id: String,
434
+ amount: Float,
435
+ entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::EntryType::OrSymbol,
436
+ expiry_date: T.nilable(Time),
437
+ target_expiry_date: Date,
438
+ block_id: String,
439
+ currency: T.nilable(String),
440
+ description: T.nilable(String),
441
+ effective_date: T.nilable(Time),
442
+ invoice_settings: T.nilable(
443
+ T.any(
444
+ Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings,
445
+ Orb::Util::AnyHash
446
+ )
447
+ ),
448
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
449
+ per_unit_cost_basis: T.nilable(String),
450
+ void_reason: T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::VoidReason::OrSymbol),
451
+ request_options: T.nilable(T.any(Orb::RequestOptions, Orb::Util::AnyHash))
452
+ )
453
+ .returns(
454
+ T.any(
455
+ Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry,
456
+ Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry,
457
+ Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry,
458
+ Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry,
459
+ Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry,
460
+ Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry,
461
+ Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry
462
+ )
463
+ )
464
+ end
465
+ def create_entry_by_external_id(
466
+ external_customer_id,
467
+ # The number of credits to effect. Note that this is required for increment,
468
+ # decrement or void operations.
469
+ amount:,
470
+ entry_type:,
471
+ # An ISO 8601 format date that identifies the origination credit block to expire
472
+ expiry_date:,
473
+ # A future date (specified in YYYY-MM-DD format) used for expiration change,
474
+ # denoting when credits transferred (as part of a partial block expiration) should
475
+ # expire.
476
+ target_expiry_date:,
477
+ # The ID of the block to reverse a decrement from.
478
+ block_id:,
479
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
480
+ # real-world currency, it must match the customer's invoicing currency.
481
+ currency: nil,
482
+ # Optional metadata that can be specified when adding ledger results via the API.
483
+ # For example, this can be used to note an increment refers to trial credits, or
484
+ # for noting corrections as a result of an incident, etc.
485
+ description: nil,
486
+ # An ISO 8601 format date that denotes when this credit balance should become
487
+ # available for use.
488
+ effective_date: nil,
489
+ # Passing `invoice_settings` automatically generates an invoice for the newly
490
+ # added credits. If `invoice_settings` is passed, you must specify
491
+ # per_unit_cost_basis, as the calculation of the invoice total is done on that
492
+ # basis.
493
+ invoice_settings: nil,
494
+ # User-specified key/value pairs for the resource. Individual keys can be removed
495
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
496
+ # by setting `metadata` to `null`.
497
+ metadata: nil,
498
+ # Can only be specified when entry_type=increment. How much, in the customer's
499
+ # currency, a customer paid for a single credit in this block
500
+ per_unit_cost_basis: nil,
501
+ # Can only be specified when `entry_type=void`. The reason for the void.
502
+ void_reason: nil,
503
+ request_options: {}
504
+ )
505
+ end
506
+
507
+ # The credits ledger provides _auditing_ functionality over Orb's credits system
508
+ # with a list of actions that have taken place to modify a customer's credit
509
+ # balance. This [paginated endpoint](/api-reference/pagination) lists these
510
+ # entries, starting from the most recent ledger entry.
511
+ #
512
+ # More details on using Orb's real-time credit feature are
513
+ # [here](/product-catalog/prepurchase).
514
+ #
515
+ # There are four major types of modifications to credit balance, detailed below.
516
+ #
517
+ # ## Increment
518
+ #
519
+ # Credits (which optionally expire on a future date) can be added via the API
520
+ # ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action
521
+ # will always contain the total eligible starting and ending balance for the
522
+ # customer at the time the entry was added to the ledger.
523
+ #
524
+ # ## Decrement
525
+ #
526
+ # Deductions can occur as a result of an API call to create a ledger entry (see
527
+ # [Add Ledger Entry](create-ledger-entry)), or automatically as a result of
528
+ # incurring usage. Both ledger entries present the `decrement` entry type.
529
+ #
530
+ # As usage for a customer is reported into Orb, credits may be deducted according
531
+ # to the customer's plan configuration. An automated deduction of this type will
532
+ # result in a ledger entry, also with a starting and ending balance. In order to
533
+ # provide better tracing capabilities for automatic deductions, Orb always
534
+ # associates each automatic deduction with the `event_id` at the time of
535
+ # ingestion, used to pinpoint _why_ credit deduction took place and to ensure that
536
+ # credits are never deducted without an associated usage event.
537
+ #
538
+ # By default, Orb uses an algorithm that automatically deducts from the _soonest
539
+ # expiring credit block_ first in order to ensure that all credits are utilized
540
+ # appropriately. As an example, if trial credits with an expiration date of 2
541
+ # weeks from now are present for a customer, they will be used before any
542
+ # deductions take place from a non-expiring credit block.
543
+ #
544
+ # If there are multiple blocks with the same expiration date, Orb will deduct from
545
+ # the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost
546
+ # basis before paid credits with a $5.00 cost basis).
547
+ #
548
+ # It's also possible for a single usage event's deduction to _span_ credit blocks.
549
+ # In this case, Orb will deduct from the next block, ending at the credit block
550
+ # which consists of unexpiring credits. Each of these deductions will lead to a
551
+ # _separate_ ledger entry, one per credit block that is deducted from. By default,
552
+ # the customer's total credit balance in Orb can be negative as a result of a
553
+ # decrement.
554
+ #
555
+ # ## Expiration change
556
+ #
557
+ # The expiry of credits can be changed as a result of the API (See
558
+ # [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that
559
+ # specifies the balance as well as the initial and target expiry dates.
560
+ #
561
+ # Note that for this entry type, `starting_balance` will equal `ending_balance`,
562
+ # and the `amount` represents the balance transferred. The credit block linked to
563
+ # the ledger entry is the source credit block from which there was an expiration
564
+ # change
565
+ #
566
+ # ## Credits expiry
567
+ #
568
+ # When a set of credits expire on pre-set expiration date, the customer's balance
569
+ # automatically reflects this change and adds an entry to the ledger indicating
570
+ # this event. Note that credit expiry should always happen close to a date
571
+ # boundary in the customer's timezone.
572
+ #
573
+ # ## Void initiated
574
+ #
575
+ # Credit blocks can be voided via the API. The `amount` on this entry corresponds
576
+ # to the number of credits that were remaining in the block at time of void.
577
+ # `void_reason` will be populated if the void is created with a reason.
578
+ #
579
+ # ## Void
580
+ #
581
+ # When a set of credits is voided, the customer's balance automatically reflects
582
+ # this change and adds an entry to the ledger indicating this event.
583
+ #
584
+ # ## Amendment
585
+ #
586
+ # When credits are added to a customer's balance as a result of a correction, this
587
+ # entry will be added to the ledger to indicate the adjustment of credits.
588
+ sig do
589
+ params(
590
+ external_customer_id: String,
591
+ created_at_gt: T.nilable(Time),
592
+ created_at_gte: T.nilable(Time),
593
+ created_at_lt: T.nilable(Time),
594
+ created_at_lte: T.nilable(Time),
595
+ currency: T.nilable(String),
596
+ cursor: T.nilable(String),
597
+ entry_status: T.nilable(Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryStatus::OrSymbol),
598
+ entry_type: T.nilable(Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryType::OrSymbol),
599
+ limit: Integer,
600
+ minimum_amount: T.nilable(String),
601
+ request_options: T.nilable(T.any(Orb::RequestOptions, Orb::Util::AnyHash))
602
+ )
603
+ .returns(
604
+ Orb::Page[
605
+ T.any(
606
+ Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry,
607
+ Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry,
608
+ Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry,
609
+ Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry,
610
+ Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry,
611
+ Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry,
612
+ Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry
613
+ )
614
+ ]
615
+ )
616
+ end
617
+ def list_by_external_id(
618
+ external_customer_id,
619
+ created_at_gt: nil,
620
+ created_at_gte: nil,
621
+ created_at_lt: nil,
622
+ created_at_lte: nil,
623
+ # The ledger currency or custom pricing unit to use.
624
+ currency: nil,
625
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
626
+ # from the initial request.
627
+ cursor: nil,
628
+ entry_status: nil,
629
+ entry_type: nil,
630
+ # The number of items to fetch. Defaults to 20.
631
+ limit: nil,
632
+ minimum_amount: nil,
633
+ request_options: {}
634
+ )
635
+ end
636
+
637
+ # @api private
638
+ sig { params(client: Orb::Client).returns(T.attached_class) }
639
+ def self.new(client:)
640
+ end
641
+ end
642
+ end
643
+ end
644
+ end
645
+ end