orb-billing 1.13.0 → 1.14.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 (356) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +43 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +7 -0
  5. data/lib/orb/internal/util.rb +22 -7
  6. data/lib/orb/models/alert.rb +10 -1
  7. data/lib/orb/models/alert_create_for_customer_params.rb +8 -1
  8. data/lib/orb/models/alert_create_for_external_customer_params.rb +8 -1
  9. data/lib/orb/models/alert_create_for_subscription_params.rb +29 -1
  10. data/lib/orb/models/alert_disable_params.rb +8 -1
  11. data/lib/orb/models/alert_enable_params.rb +8 -1
  12. data/lib/orb/models/alert_retrieve_params.rb +7 -1
  13. data/lib/orb/models/alert_update_params.rb +8 -1
  14. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +17769 -414
  15. data/lib/orb/models/beta/external_plan_id_fetch_plan_version_params.rb +7 -1
  16. data/lib/orb/models/beta/external_plan_id_set_default_plan_version_params.rb +8 -1
  17. data/lib/orb/models/beta_create_plan_version_params.rb +17633 -406
  18. data/lib/orb/models/beta_fetch_plan_version_params.rb +7 -1
  19. data/lib/orb/models/beta_set_default_plan_version_params.rb +8 -1
  20. data/lib/orb/models/coupon_archive_params.rb +7 -1
  21. data/lib/orb/models/coupon_fetch_params.rb +7 -1
  22. data/lib/orb/models/coupons/subscription_list_params.rb +8 -1
  23. data/lib/orb/models/credit_block_delete_params.rb +7 -1
  24. data/lib/orb/models/credit_block_list_invoices_params.rb +7 -1
  25. data/lib/orb/models/credit_block_retrieve_params.rb +7 -1
  26. data/lib/orb/models/credit_note_fetch_params.rb +7 -1
  27. data/lib/orb/models/customer.rb +13 -1
  28. data/lib/orb/models/customer_create_params.rb +12 -1
  29. data/lib/orb/models/customer_delete_params.rb +7 -1
  30. data/lib/orb/models/customer_fetch_by_external_id_params.rb +7 -1
  31. data/lib/orb/models/customer_fetch_params.rb +7 -1
  32. data/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb +7 -1
  33. data/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb +7 -1
  34. data/lib/orb/models/customer_update_by_external_id_params.rb +25 -5
  35. data/lib/orb/models/customer_update_params.rb +25 -5
  36. data/lib/orb/models/customers/balance_transaction_create_params.rb +8 -1
  37. data/lib/orb/models/customers/balance_transaction_list_params.rb +8 -1
  38. data/lib/orb/models/customers/cost_list_by_external_id_params.rb +8 -1
  39. data/lib/orb/models/customers/cost_list_params.rb +8 -1
  40. data/lib/orb/models/customers/credit_list_by_external_id_params.rb +8 -1
  41. data/lib/orb/models/customers/credit_list_params.rb +8 -1
  42. data/lib/orb/models/customers/credits/decrement_ledger_entry.rb +5 -1
  43. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +582 -315
  44. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +580 -313
  45. data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +8 -1
  46. data/lib/orb/models/customers/credits/ledger_list_params.rb +8 -1
  47. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +8 -1
  48. data/lib/orb/models/customers/credits/top_up_create_params.rb +8 -1
  49. data/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb +7 -1
  50. data/lib/orb/models/customers/credits/top_up_delete_params.rb +7 -1
  51. data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +8 -1
  52. data/lib/orb/models/customers/credits/top_up_list_params.rb +8 -1
  53. data/lib/orb/models/dimensional_price_group_retrieve_params.rb +7 -1
  54. data/lib/orb/models/dimensional_price_group_update_params.rb +8 -1
  55. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb +7 -1
  56. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rb +8 -1
  57. data/lib/orb/models/event_deprecate_params.rb +7 -1
  58. data/lib/orb/models/event_update_params.rb +8 -1
  59. data/lib/orb/models/events/backfill_close_params.rb +7 -1
  60. data/lib/orb/models/events/backfill_fetch_params.rb +7 -1
  61. data/lib/orb/models/events/backfill_revert_params.rb +7 -1
  62. data/lib/orb/models/invoice_delete_line_item_params.rb +7 -1
  63. data/lib/orb/models/invoice_fetch_params.rb +7 -1
  64. data/lib/orb/models/invoice_issue_params.rb +8 -1
  65. data/lib/orb/models/invoice_issue_summary_params.rb +8 -1
  66. data/lib/orb/models/invoice_mark_paid_params.rb +8 -1
  67. data/lib/orb/models/invoice_pay_params.rb +16 -1
  68. data/lib/orb/models/invoice_update_params.rb +8 -1
  69. data/lib/orb/models/invoice_void_params.rb +7 -1
  70. data/lib/orb/models/item_archive_params.rb +7 -1
  71. data/lib/orb/models/item_fetch_params.rb +7 -1
  72. data/lib/orb/models/item_update_params.rb +8 -1
  73. data/lib/orb/models/license_deactivate_params.rb +8 -1
  74. data/lib/orb/models/license_retrieve_by_external_id_params.rb +8 -1
  75. data/lib/orb/models/license_retrieve_params.rb +7 -1
  76. data/lib/orb/models/license_type_retrieve_params.rb +7 -1
  77. data/lib/orb/models/licenses/external_license_get_usage_params.rb +8 -1
  78. data/lib/orb/models/licenses/usage_get_usage_params.rb +8 -1
  79. data/lib/orb/models/metric_fetch_params.rb +7 -1
  80. data/lib/orb/models/metric_update_params.rb +8 -1
  81. data/lib/orb/models/plan_create_params.rb +8502 -1
  82. data/lib/orb/models/plan_fetch_params.rb +7 -1
  83. data/lib/orb/models/plan_update_params.rb +8 -1
  84. data/lib/orb/models/plans/external_plan_id_fetch_params.rb +7 -1
  85. data/lib/orb/models/plans/external_plan_id_update_params.rb +8 -1
  86. data/lib/orb/models/plans/migration_cancel_params.rb +7 -1
  87. data/lib/orb/models/plans/migration_list_params.rb +8 -1
  88. data/lib/orb/models/plans/migration_retrieve_params.rb +7 -1
  89. data/lib/orb/models/price.rb +248 -31
  90. data/lib/orb/models/price_create_params.rb +949 -1321
  91. data/lib/orb/models/price_evaluate_params.rb +8 -1
  92. data/lib/orb/models/price_fetch_params.rb +7 -1
  93. data/lib/orb/models/price_update_params.rb +8 -1
  94. data/lib/orb/models/prices/external_price_id_fetch_params.rb +7 -1
  95. data/lib/orb/models/prices/external_price_id_update_params.rb +8 -1
  96. data/lib/orb/models/subscription_cancel_params.rb +8 -1
  97. data/lib/orb/models/subscription_change_apply_params.rb +8 -1
  98. data/lib/orb/models/subscription_change_cancel_params.rb +7 -1
  99. data/lib/orb/models/subscription_change_retrieve_params.rb +7 -1
  100. data/lib/orb/models/subscription_fetch_costs_params.rb +8 -1
  101. data/lib/orb/models/subscription_fetch_params.rb +7 -1
  102. data/lib/orb/models/subscription_fetch_schedule_params.rb +8 -1
  103. data/lib/orb/models/subscription_fetch_usage_params.rb +8 -1
  104. data/lib/orb/models/subscription_price_intervals_params.rb +8 -1
  105. data/lib/orb/models/subscription_redeem_coupon_params.rb +8 -1
  106. data/lib/orb/models/subscription_schedule_plan_change_params.rb +8 -1
  107. data/lib/orb/models/subscription_trigger_phase_params.rb +8 -1
  108. data/lib/orb/models/subscription_unschedule_cancellation_params.rb +7 -1
  109. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb +8 -1
  110. data/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb +7 -1
  111. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +8 -1
  112. data/lib/orb/models/subscription_update_params.rb +8 -1
  113. data/lib/orb/models/subscription_update_trial_params.rb +8 -1
  114. data/lib/orb/resources/alerts.rb +8 -1
  115. data/lib/orb/resources/coupons.rb +1 -2
  116. data/lib/orb/resources/credit_blocks.rb +11 -8
  117. data/lib/orb/resources/customers/credits/ledger.rb +12 -67
  118. data/lib/orb/resources/customers.rb +6 -5
  119. data/lib/orb/resources/events/backfills.rb +3 -4
  120. data/lib/orb/resources/invoices.rb +12 -5
  121. data/lib/orb/resources/prices.rb +9 -100
  122. data/lib/orb/resources/subscriptions.rb +4 -4
  123. data/lib/orb/version.rb +1 -1
  124. data/rbi/orb/client.rbi +6 -0
  125. data/rbi/orb/internal/util.rbi +8 -0
  126. data/rbi/orb/models/alert.rbi +10 -0
  127. data/rbi/orb/models/alert_create_for_customer_params.rbi +6 -0
  128. data/rbi/orb/models/alert_create_for_external_customer_params.rbi +6 -0
  129. data/rbi/orb/models/alert_create_for_subscription_params.rbi +26 -0
  130. data/rbi/orb/models/alert_disable_params.rbi +6 -0
  131. data/rbi/orb/models/alert_enable_params.rbi +6 -0
  132. data/rbi/orb/models/alert_retrieve_params.rbi +13 -5
  133. data/rbi/orb/models/alert_update_params.rbi +6 -0
  134. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +30163 -889
  135. data/rbi/orb/models/beta/external_plan_id_fetch_plan_version_params.rbi +10 -2
  136. data/rbi/orb/models/beta/external_plan_id_set_default_plan_version_params.rbi +10 -1
  137. data/rbi/orb/models/beta_create_plan_version_params.rbi +30126 -884
  138. data/rbi/orb/models/beta_fetch_plan_version_params.rbi +10 -2
  139. data/rbi/orb/models/beta_set_default_plan_version_params.rbi +10 -1
  140. data/rbi/orb/models/coupon_archive_params.rbi +13 -5
  141. data/rbi/orb/models/coupon_fetch_params.rbi +13 -5
  142. data/rbi/orb/models/coupons/subscription_list_params.rbi +6 -0
  143. data/rbi/orb/models/credit_block_delete_params.rbi +13 -5
  144. data/rbi/orb/models/credit_block_list_invoices_params.rbi +13 -5
  145. data/rbi/orb/models/credit_block_retrieve_params.rbi +13 -5
  146. data/rbi/orb/models/credit_note_fetch_params.rbi +13 -5
  147. data/rbi/orb/models/customer.rbi +22 -0
  148. data/rbi/orb/models/customer_create_params.rbi +17 -0
  149. data/rbi/orb/models/customer_delete_params.rbi +13 -5
  150. data/rbi/orb/models/customer_fetch_by_external_id_params.rbi +13 -5
  151. data/rbi/orb/models/customer_fetch_params.rbi +13 -5
  152. data/rbi/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi +13 -5
  153. data/rbi/orb/models/customer_sync_payment_methods_from_gateway_params.rbi +13 -5
  154. data/rbi/orb/models/customer_update_by_external_id_params.rbi +31 -4
  155. data/rbi/orb/models/customer_update_params.rbi +31 -4
  156. data/rbi/orb/models/customers/balance_transaction_create_params.rbi +6 -0
  157. data/rbi/orb/models/customers/balance_transaction_list_params.rbi +6 -0
  158. data/rbi/orb/models/customers/cost_list_by_external_id_params.rbi +6 -0
  159. data/rbi/orb/models/customers/cost_list_params.rbi +6 -0
  160. data/rbi/orb/models/customers/credit_list_by_external_id_params.rbi +6 -0
  161. data/rbi/orb/models/customers/credit_list_params.rbi +6 -0
  162. data/rbi/orb/models/customers/credits/decrement_ledger_entry.rbi +4 -0
  163. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +861 -478
  164. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +861 -478
  165. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +6 -0
  166. data/rbi/orb/models/customers/credits/ledger_list_params.rbi +6 -0
  167. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +6 -0
  168. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +6 -0
  169. data/rbi/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi +6 -1
  170. data/rbi/orb/models/customers/credits/top_up_delete_params.rbi +10 -2
  171. data/rbi/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +6 -0
  172. data/rbi/orb/models/customers/credits/top_up_list_params.rbi +6 -0
  173. data/rbi/orb/models/dimensional_price_group_retrieve_params.rbi +16 -5
  174. data/rbi/orb/models/dimensional_price_group_update_params.rbi +6 -0
  175. data/rbi/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi +16 -5
  176. data/rbi/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rbi +6 -0
  177. data/rbi/orb/models/event_deprecate_params.rbi +13 -5
  178. data/rbi/orb/models/event_update_params.rbi +6 -0
  179. data/rbi/orb/models/events/backfill_close_params.rbi +13 -5
  180. data/rbi/orb/models/events/backfill_fetch_params.rbi +13 -5
  181. data/rbi/orb/models/events/backfill_revert_params.rbi +13 -5
  182. data/rbi/orb/models/invoice_delete_line_item_params.rbi +10 -2
  183. data/rbi/orb/models/invoice_fetch_params.rbi +13 -5
  184. data/rbi/orb/models/invoice_issue_params.rbi +10 -1
  185. data/rbi/orb/models/invoice_issue_summary_params.rbi +10 -1
  186. data/rbi/orb/models/invoice_mark_paid_params.rbi +6 -0
  187. data/rbi/orb/models/invoice_pay_params.rbi +27 -5
  188. data/rbi/orb/models/invoice_update_params.rbi +6 -0
  189. data/rbi/orb/models/invoice_void_params.rbi +13 -5
  190. data/rbi/orb/models/item_archive_params.rbi +13 -5
  191. data/rbi/orb/models/item_fetch_params.rbi +13 -5
  192. data/rbi/orb/models/item_update_params.rbi +6 -0
  193. data/rbi/orb/models/license_deactivate_params.rbi +10 -1
  194. data/rbi/orb/models/license_retrieve_by_external_id_params.rbi +6 -0
  195. data/rbi/orb/models/license_retrieve_params.rbi +13 -5
  196. data/rbi/orb/models/license_type_retrieve_params.rbi +13 -5
  197. data/rbi/orb/models/licenses/external_license_get_usage_params.rbi +6 -0
  198. data/rbi/orb/models/licenses/usage_get_usage_params.rbi +6 -0
  199. data/rbi/orb/models/metric_fetch_params.rbi +13 -5
  200. data/rbi/orb/models/metric_update_params.rbi +6 -0
  201. data/rbi/orb/models/plan_create_params.rbi +14618 -0
  202. data/rbi/orb/models/plan_fetch_params.rbi +13 -5
  203. data/rbi/orb/models/plan_update_params.rbi +6 -0
  204. data/rbi/orb/models/plans/external_plan_id_fetch_params.rbi +13 -5
  205. data/rbi/orb/models/plans/external_plan_id_update_params.rbi +6 -0
  206. data/rbi/orb/models/plans/migration_cancel_params.rbi +10 -2
  207. data/rbi/orb/models/plans/migration_list_params.rbi +6 -0
  208. data/rbi/orb/models/plans/migration_retrieve_params.rbi +10 -2
  209. data/rbi/orb/models/price.rbi +186 -0
  210. data/rbi/orb/models/price_create_params.rbi +1778 -2590
  211. data/rbi/orb/models/price_evaluate_params.rbi +6 -0
  212. data/rbi/orb/models/price_fetch_params.rbi +13 -5
  213. data/rbi/orb/models/price_update_params.rbi +6 -0
  214. data/rbi/orb/models/prices/external_price_id_fetch_params.rbi +13 -5
  215. data/rbi/orb/models/prices/external_price_id_update_params.rbi +6 -0
  216. data/rbi/orb/models/subscription_cancel_params.rbi +6 -0
  217. data/rbi/orb/models/subscription_change_apply_params.rbi +6 -0
  218. data/rbi/orb/models/subscription_change_cancel_params.rbi +16 -5
  219. data/rbi/orb/models/subscription_change_retrieve_params.rbi +16 -5
  220. data/rbi/orb/models/subscription_fetch_costs_params.rbi +6 -0
  221. data/rbi/orb/models/subscription_fetch_params.rbi +13 -5
  222. data/rbi/orb/models/subscription_fetch_schedule_params.rbi +6 -0
  223. data/rbi/orb/models/subscription_fetch_usage_params.rbi +6 -0
  224. data/rbi/orb/models/subscription_price_intervals_params.rbi +6 -0
  225. data/rbi/orb/models/subscription_redeem_coupon_params.rbi +6 -0
  226. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +6 -0
  227. data/rbi/orb/models/subscription_trigger_phase_params.rbi +6 -0
  228. data/rbi/orb/models/subscription_unschedule_cancellation_params.rbi +13 -5
  229. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +10 -1
  230. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_params.rbi +13 -5
  231. data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +6 -0
  232. data/rbi/orb/models/subscription_update_params.rbi +6 -0
  233. data/rbi/orb/models/subscription_update_trial_params.rbi +6 -0
  234. data/rbi/orb/resources/alerts.rbi +8 -0
  235. data/rbi/orb/resources/coupons.rbi +1 -2
  236. data/rbi/orb/resources/credit_blocks.rbi +10 -7
  237. data/rbi/orb/resources/customers/credits/ledger.rbi +22 -132
  238. data/rbi/orb/resources/customers.rbi +12 -7
  239. data/rbi/orb/resources/events/backfills.rbi +3 -4
  240. data/rbi/orb/resources/invoices.rbi +11 -3
  241. data/rbi/orb/resources/prices.rbi +35 -184
  242. data/rbi/orb/resources/subscriptions.rbi +4 -4
  243. data/sig/orb/client.rbs +3 -0
  244. data/sig/orb/internal/util.rbs +4 -0
  245. data/sig/orb/models/alert.rbs +5 -0
  246. data/sig/orb/models/alert_create_for_customer_params.rbs +5 -0
  247. data/sig/orb/models/alert_create_for_external_customer_params.rbs +5 -0
  248. data/sig/orb/models/alert_create_for_subscription_params.rbs +16 -1
  249. data/sig/orb/models/alert_disable_params.rbs +6 -1
  250. data/sig/orb/models/alert_enable_params.rbs +6 -1
  251. data/sig/orb/models/alert_retrieve_params.rbs +9 -3
  252. data/sig/orb/models/alert_update_params.rbs +5 -1
  253. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +12092 -373
  254. data/sig/orb/models/beta/external_plan_id_fetch_plan_version_params.rbs +6 -1
  255. data/sig/orb/models/beta/external_plan_id_set_default_plan_version_params.rbs +6 -1
  256. data/sig/orb/models/beta_create_plan_version_params.rbs +12075 -370
  257. data/sig/orb/models/beta_fetch_plan_version_params.rbs +10 -2
  258. data/sig/orb/models/beta_set_default_plan_version_params.rbs +10 -2
  259. data/sig/orb/models/coupon_archive_params.rbs +12 -3
  260. data/sig/orb/models/coupon_fetch_params.rbs +12 -3
  261. data/sig/orb/models/coupons/subscription_list_params.rbs +5 -1
  262. data/sig/orb/models/credit_block_delete_params.rbs +8 -3
  263. data/sig/orb/models/credit_block_list_invoices_params.rbs +8 -3
  264. data/sig/orb/models/credit_block_retrieve_params.rbs +8 -3
  265. data/sig/orb/models/credit_note_fetch_params.rbs +11 -3
  266. data/sig/orb/models/customer.rbs +14 -2
  267. data/sig/orb/models/customer_create_params.rbs +12 -1
  268. data/sig/orb/models/customer_delete_params.rbs +12 -3
  269. data/sig/orb/models/customer_fetch_by_external_id_params.rbs +11 -3
  270. data/sig/orb/models/customer_fetch_params.rbs +12 -3
  271. data/sig/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbs +11 -3
  272. data/sig/orb/models/customer_sync_payment_methods_from_gateway_params.rbs +11 -3
  273. data/sig/orb/models/customer_update_by_external_id_params.rbs +17 -1
  274. data/sig/orb/models/customer_update_params.rbs +17 -1
  275. data/sig/orb/models/customers/balance_transaction_create_params.rbs +5 -0
  276. data/sig/orb/models/customers/balance_transaction_list_params.rbs +5 -0
  277. data/sig/orb/models/customers/cost_list_by_external_id_params.rbs +5 -0
  278. data/sig/orb/models/customers/cost_list_params.rbs +5 -0
  279. data/sig/orb/models/customers/credit_list_by_external_id_params.rbs +5 -0
  280. data/sig/orb/models/customers/credit_list_params.rbs +5 -0
  281. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +345 -157
  282. data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +345 -157
  283. data/sig/orb/models/customers/credits/ledger_list_by_external_id_params.rbs +5 -0
  284. data/sig/orb/models/customers/credits/ledger_list_params.rbs +5 -0
  285. data/sig/orb/models/customers/credits/top_up_create_by_external_id_params.rbs +5 -0
  286. data/sig/orb/models/customers/credits/top_up_create_params.rbs +5 -0
  287. data/sig/orb/models/customers/credits/top_up_delete_by_external_id_params.rbs +5 -1
  288. data/sig/orb/models/customers/credits/top_up_delete_params.rbs +6 -1
  289. data/sig/orb/models/customers/credits/top_up_list_by_external_id_params.rbs +5 -1
  290. data/sig/orb/models/customers/credits/top_up_list_params.rbs +5 -1
  291. data/sig/orb/models/dimensional_price_group_retrieve_params.rbs +12 -3
  292. data/sig/orb/models/dimensional_price_group_update_params.rbs +5 -0
  293. data/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbs +12 -3
  294. data/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rbs +5 -0
  295. data/sig/orb/models/event_deprecate_params.rbs +9 -3
  296. data/sig/orb/models/event_update_params.rbs +5 -0
  297. data/sig/orb/models/events/backfill_close_params.rbs +11 -3
  298. data/sig/orb/models/events/backfill_fetch_params.rbs +11 -3
  299. data/sig/orb/models/events/backfill_revert_params.rbs +11 -3
  300. data/sig/orb/models/invoice_delete_line_item_params.rbs +6 -1
  301. data/sig/orb/models/invoice_fetch_params.rbs +12 -3
  302. data/sig/orb/models/invoice_issue_params.rbs +6 -1
  303. data/sig/orb/models/invoice_issue_summary_params.rbs +6 -1
  304. data/sig/orb/models/invoice_mark_paid_params.rbs +10 -1
  305. data/sig/orb/models/invoice_pay_params.rbs +17 -3
  306. data/sig/orb/models/invoice_update_params.rbs +5 -0
  307. data/sig/orb/models/invoice_void_params.rbs +12 -3
  308. data/sig/orb/models/item_archive_params.rbs +9 -3
  309. data/sig/orb/models/item_fetch_params.rbs +9 -3
  310. data/sig/orb/models/item_update_params.rbs +5 -0
  311. data/sig/orb/models/license_deactivate_params.rbs +10 -2
  312. data/sig/orb/models/license_retrieve_by_external_id_params.rbs +9 -1
  313. data/sig/orb/models/license_retrieve_params.rbs +11 -3
  314. data/sig/orb/models/license_type_retrieve_params.rbs +11 -3
  315. data/sig/orb/models/licenses/external_license_get_usage_params.rbs +5 -0
  316. data/sig/orb/models/licenses/usage_get_usage_params.rbs +5 -0
  317. data/sig/orb/models/metric_fetch_params.rbs +12 -3
  318. data/sig/orb/models/metric_update_params.rbs +5 -1
  319. data/sig/orb/models/plan_create_params.rbs +5850 -0
  320. data/sig/orb/models/plan_fetch_params.rbs +9 -3
  321. data/sig/orb/models/plan_update_params.rbs +9 -1
  322. data/sig/orb/models/plans/external_plan_id_fetch_params.rbs +11 -3
  323. data/sig/orb/models/plans/external_plan_id_update_params.rbs +9 -1
  324. data/sig/orb/models/plans/migration_cancel_params.rbs +6 -1
  325. data/sig/orb/models/plans/migration_list_params.rbs +5 -1
  326. data/sig/orb/models/plans/migration_retrieve_params.rbs +6 -1
  327. data/sig/orb/models/price.rbs +155 -0
  328. data/sig/orb/models/price_create_params.rbs +616 -1011
  329. data/sig/orb/models/price_evaluate_params.rbs +5 -0
  330. data/sig/orb/models/price_fetch_params.rbs +9 -3
  331. data/sig/orb/models/price_update_params.rbs +5 -1
  332. data/sig/orb/models/prices/external_price_id_fetch_params.rbs +11 -3
  333. data/sig/orb/models/prices/external_price_id_update_params.rbs +5 -1
  334. data/sig/orb/models/subscription_cancel_params.rbs +5 -0
  335. data/sig/orb/models/subscription_change_apply_params.rbs +5 -0
  336. data/sig/orb/models/subscription_change_cancel_params.rbs +12 -3
  337. data/sig/orb/models/subscription_change_retrieve_params.rbs +12 -3
  338. data/sig/orb/models/subscription_fetch_costs_params.rbs +5 -0
  339. data/sig/orb/models/subscription_fetch_params.rbs +11 -3
  340. data/sig/orb/models/subscription_fetch_schedule_params.rbs +5 -0
  341. data/sig/orb/models/subscription_fetch_usage_params.rbs +5 -0
  342. data/sig/orb/models/subscription_price_intervals_params.rbs +5 -0
  343. data/sig/orb/models/subscription_redeem_coupon_params.rbs +5 -0
  344. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +5 -0
  345. data/sig/orb/models/subscription_trigger_phase_params.rbs +9 -1
  346. data/sig/orb/models/subscription_unschedule_cancellation_params.rbs +11 -3
  347. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbs +10 -2
  348. data/sig/orb/models/subscription_unschedule_pending_plan_changes_params.rbs +11 -3
  349. data/sig/orb/models/subscription_update_fixed_fee_quantity_params.rbs +5 -0
  350. data/sig/orb/models/subscription_update_params.rbs +5 -0
  351. data/sig/orb/models/subscription_update_trial_params.rbs +5 -0
  352. data/sig/orb/resources/alerts.rbs +2 -0
  353. data/sig/orb/resources/customers/credits/ledger.rbs +2 -26
  354. data/sig/orb/resources/invoices.rbs +1 -0
  355. data/sig/orb/resources/prices.rbs +1 -48
  356. metadata +2 -2
@@ -16,206 +16,50 @@ module Orb
16
16
  )
17
17
  end
18
18
 
19
- # The number of credits to effect. Note that this is required for increment,
20
- # decrement or void operations.
21
- sig { returns(Float) }
22
- attr_accessor :amount
23
-
24
- sig do
25
- returns(
26
- Orb::Customers::Credits::LedgerCreateEntryParams::EntryType::OrSymbol
27
- )
28
- end
29
- attr_accessor :entry_type
30
-
31
- # The currency or custom pricing unit to use for this ledger entry. If this is a
32
- # real-world currency, it must match the customer's invoicing currency.
33
- sig { returns(T.nilable(String)) }
34
- attr_accessor :currency
35
-
36
- # Optional metadata that can be specified when adding ledger results via the API.
37
- # For example, this can be used to note an increment refers to trial credits, or
38
- # for noting corrections as a result of an incident, etc.
39
- sig { returns(T.nilable(String)) }
40
- attr_accessor :description
41
-
42
- # An ISO 8601 format date that denotes when this credit balance should become
43
- # available for use.
44
- sig { returns(T.nilable(Time)) }
45
- attr_accessor :effective_date
46
-
47
- # An ISO 8601 format date that identifies the origination credit block to expire
48
- sig { returns(T.nilable(Time)) }
49
- attr_accessor :expiry_date
50
-
51
- # Optional filter to specify which items this credit block applies to. If not
52
- # specified, the block will apply to all items for the pricing unit.
53
- sig do
54
- returns(
55
- T.nilable(
56
- T::Array[
57
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter
58
- ]
59
- )
60
- )
61
- end
62
- attr_accessor :filters
63
-
64
- # Passing `invoice_settings` automatically generates an invoice for the newly
65
- # added credits. If `invoice_settings` is passed, you must specify
66
- # per_unit_cost_basis, as the calculation of the invoice total is done on that
67
- # basis.
68
- sig do
69
- returns(
70
- T.nilable(
71
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings
72
- )
73
- )
74
- end
75
- attr_reader :invoice_settings
76
-
77
- sig do
78
- params(
79
- invoice_settings:
80
- T.nilable(
81
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::OrHash
82
- )
83
- ).void
84
- end
85
- attr_writer :invoice_settings
86
-
87
- # User-specified key/value pairs for the resource. Individual keys can be removed
88
- # by setting the value to `null`, and the entire metadata mapping can be cleared
89
- # by setting `metadata` to `null`.
90
- sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
91
- attr_accessor :metadata
92
-
93
- # Can only be specified when entry_type=increment. How much, in the customer's
94
- # currency, a customer paid for a single credit in this block
95
- sig { returns(T.nilable(String)) }
96
- attr_accessor :per_unit_cost_basis
97
-
98
- # A future date (specified in YYYY-MM-DD format) used for expiration change,
99
- # denoting when credits transferred (as part of a partial block expiration) should
100
- # expire.
101
- sig { returns(Date) }
102
- attr_accessor :target_expiry_date
103
-
104
- # The ID of the block to reverse a decrement from.
105
19
  sig { returns(String) }
106
- attr_accessor :block_id
20
+ attr_accessor :customer_id
107
21
 
108
- # Can only be specified when `entry_type=void`. The reason for the void.
109
22
  sig do
110
23
  returns(
111
- T.nilable(
112
- Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason::OrSymbol
24
+ T.any(
25
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment,
26
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Decrement,
27
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange,
28
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void,
29
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Amendment
113
30
  )
114
31
  )
115
32
  end
116
- attr_accessor :void_reason
33
+ attr_accessor :body
117
34
 
118
35
  sig do
119
36
  params(
120
- amount: Float,
121
- entry_type:
122
- Orb::Customers::Credits::LedgerCreateEntryParams::EntryType::OrSymbol,
123
- target_expiry_date: Date,
124
- block_id: String,
125
- currency: T.nilable(String),
126
- description: T.nilable(String),
127
- effective_date: T.nilable(Time),
128
- expiry_date: T.nilable(Time),
129
- filters:
130
- T.nilable(
131
- T::Array[
132
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::OrHash
133
- ]
134
- ),
135
- invoice_settings:
136
- T.nilable(
137
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::OrHash
138
- ),
139
- metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
140
- per_unit_cost_basis: T.nilable(String),
141
- void_reason:
142
- T.nilable(
143
- Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason::OrSymbol
37
+ customer_id: String,
38
+ body:
39
+ T.any(
40
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::OrHash,
41
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Decrement::OrHash,
42
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange::OrHash,
43
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::OrHash,
44
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Amendment::OrHash
144
45
  ),
145
46
  request_options: Orb::RequestOptions::OrHash
146
47
  ).returns(T.attached_class)
147
48
  end
148
- def self.new(
149
- # The number of credits to effect. Note that this is required for increment,
150
- # decrement or void operations.
151
- amount:,
152
- entry_type:,
153
- # A future date (specified in YYYY-MM-DD format) used for expiration change,
154
- # denoting when credits transferred (as part of a partial block expiration) should
155
- # expire.
156
- target_expiry_date:,
157
- # The ID of the block to reverse a decrement from.
158
- block_id:,
159
- # The currency or custom pricing unit to use for this ledger entry. If this is a
160
- # real-world currency, it must match the customer's invoicing currency.
161
- currency: nil,
162
- # Optional metadata that can be specified when adding ledger results via the API.
163
- # For example, this can be used to note an increment refers to trial credits, or
164
- # for noting corrections as a result of an incident, etc.
165
- description: nil,
166
- # An ISO 8601 format date that denotes when this credit balance should become
167
- # available for use.
168
- effective_date: nil,
169
- # An ISO 8601 format date that identifies the origination credit block to expire
170
- expiry_date: nil,
171
- # Optional filter to specify which items this credit block applies to. If not
172
- # specified, the block will apply to all items for the pricing unit.
173
- filters: nil,
174
- # Passing `invoice_settings` automatically generates an invoice for the newly
175
- # added credits. If `invoice_settings` is passed, you must specify
176
- # per_unit_cost_basis, as the calculation of the invoice total is done on that
177
- # basis.
178
- invoice_settings: nil,
179
- # User-specified key/value pairs for the resource. Individual keys can be removed
180
- # by setting the value to `null`, and the entire metadata mapping can be cleared
181
- # by setting `metadata` to `null`.
182
- metadata: nil,
183
- # Can only be specified when entry_type=increment. How much, in the customer's
184
- # currency, a customer paid for a single credit in this block
185
- per_unit_cost_basis: nil,
186
- # Can only be specified when `entry_type=void`. The reason for the void.
187
- void_reason: nil,
188
- request_options: {}
189
- )
49
+ def self.new(customer_id:, body:, request_options: {})
190
50
  end
191
51
 
192
52
  sig do
193
53
  override.returns(
194
54
  {
195
- amount: Float,
196
- entry_type:
197
- Orb::Customers::Credits::LedgerCreateEntryParams::EntryType::OrSymbol,
198
- currency: T.nilable(String),
199
- description: T.nilable(String),
200
- effective_date: T.nilable(Time),
201
- expiry_date: T.nilable(Time),
202
- filters:
203
- T.nilable(
204
- T::Array[
205
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter
206
- ]
207
- ),
208
- invoice_settings:
209
- T.nilable(
210
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings
211
- ),
212
- metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
213
- per_unit_cost_basis: T.nilable(String),
214
- target_expiry_date: Date,
215
- block_id: String,
216
- void_reason:
217
- T.nilable(
218
- Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason::OrSymbol
55
+ customer_id: String,
56
+ body:
57
+ T.any(
58
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment,
59
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Decrement,
60
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange,
61
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void,
62
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Amendment
219
63
  ),
220
64
  request_options: Orb::RequestOptions
221
65
  }
@@ -224,375 +68,914 @@ module Orb
224
68
  def to_hash
225
69
  end
226
70
 
227
- module EntryType
228
- extend Orb::Internal::Type::Enum
71
+ module Body
72
+ extend Orb::Internal::Type::Union
229
73
 
230
- TaggedSymbol =
74
+ Variants =
231
75
  T.type_alias do
232
- T.all(
233
- Symbol,
234
- Orb::Customers::Credits::LedgerCreateEntryParams::EntryType
76
+ T.any(
77
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment,
78
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Decrement,
79
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange,
80
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void,
81
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Amendment
235
82
  )
236
83
  end
237
- OrSymbol = T.type_alias { T.any(Symbol, String) }
238
84
 
239
- AMENDMENT =
240
- T.let(
241
- :amendment,
242
- Orb::Customers::Credits::LedgerCreateEntryParams::EntryType::TaggedSymbol
243
- )
85
+ class Increment < Orb::Internal::Type::BaseModel
86
+ OrHash =
87
+ T.type_alias do
88
+ T.any(
89
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment,
90
+ Orb::Internal::AnyHash
91
+ )
92
+ end
244
93
 
245
- sig do
246
- override.returns(
247
- T::Array[
248
- Orb::Customers::Credits::LedgerCreateEntryParams::EntryType::TaggedSymbol
249
- ]
250
- )
251
- end
252
- def self.values
253
- end
254
- end
94
+ # The number of credits to effect. Note that this is required for increment,
95
+ # decrement, void, or undo operations.
96
+ sig { returns(Float) }
97
+ attr_accessor :amount
255
98
 
256
- class Filter < Orb::Internal::Type::BaseModel
257
- OrHash =
258
- T.type_alias do
259
- T.any(
260
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter,
261
- Orb::Internal::AnyHash
99
+ sig { returns(Symbol) }
100
+ attr_accessor :entry_type
101
+
102
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
103
+ # real-world currency, it must match the customer's invoicing currency.
104
+ sig { returns(T.nilable(String)) }
105
+ attr_accessor :currency
106
+
107
+ # Optional metadata that can be specified when adding ledger results via the API.
108
+ # For example, this can be used to note an increment refers to trial credits, or
109
+ # for noting corrections as a result of an incident, etc.
110
+ sig { returns(T.nilable(String)) }
111
+ attr_accessor :description
112
+
113
+ # An ISO 8601 format date that denotes when this credit balance should become
114
+ # available for use.
115
+ sig { returns(T.nilable(Time)) }
116
+ attr_accessor :effective_date
117
+
118
+ # An ISO 8601 format date that denotes when this credit balance should expire.
119
+ sig { returns(T.nilable(Time)) }
120
+ attr_accessor :expiry_date
121
+
122
+ # Optional filter to specify which items this credit block applies to. If not
123
+ # specified, the block will apply to all items for the pricing unit.
124
+ sig do
125
+ returns(
126
+ T.nilable(
127
+ T::Array[
128
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter
129
+ ]
130
+ )
262
131
  )
263
132
  end
133
+ attr_accessor :filters
264
134
 
265
- # The property of the price the block applies to. Only item_id is supported.
266
- sig do
267
- returns(
268
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Field::OrSymbol
269
- )
270
- end
271
- attr_accessor :field
135
+ # Passing `invoice_settings` automatically generates an invoice for the newly
136
+ # added credits. If `invoice_settings` is passed, you must specify
137
+ # per_unit_cost_basis, as the calculation of the invoice total is done on that
138
+ # basis.
139
+ sig do
140
+ returns(
141
+ T.nilable(
142
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings
143
+ )
144
+ )
145
+ end
146
+ attr_reader :invoice_settings
272
147
 
273
- # Should prices that match the filter be included or excluded.
274
- sig do
275
- returns(
276
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator::OrSymbol
277
- )
278
- end
279
- attr_accessor :operator
148
+ sig do
149
+ params(
150
+ invoice_settings:
151
+ T.nilable(
152
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::OrHash
153
+ )
154
+ ).void
155
+ end
156
+ attr_writer :invoice_settings
280
157
 
281
- # The IDs or values that match this filter.
282
- sig { returns(T::Array[String]) }
283
- attr_accessor :values
158
+ # User-specified key/value pairs for the resource. Individual keys can be removed
159
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
160
+ # by setting `metadata` to `null`.
161
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
162
+ attr_accessor :metadata
284
163
 
285
- # A PriceFilter that only allows item_id field for block filters.
286
- sig do
287
- params(
288
- field:
289
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Field::OrSymbol,
290
- operator:
291
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator::OrSymbol,
292
- values: T::Array[String]
293
- ).returns(T.attached_class)
294
- end
295
- def self.new(
296
- # The property of the price the block applies to. Only item_id is supported.
297
- field:,
298
- # Should prices that match the filter be included or excluded.
299
- operator:,
300
- # The IDs or values that match this filter.
301
- values:
302
- )
303
- end
164
+ # Can only be specified when entry_type=increment. How much, in the customer's
165
+ # currency, a customer paid for a single credit in this block
166
+ sig { returns(T.nilable(String)) }
167
+ attr_accessor :per_unit_cost_basis
304
168
 
305
- sig do
306
- override.returns(
307
- {
308
- field:
309
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Field::OrSymbol,
310
- operator:
311
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator::OrSymbol,
312
- values: T::Array[String]
313
- }
169
+ sig do
170
+ params(
171
+ amount: Float,
172
+ currency: T.nilable(String),
173
+ description: T.nilable(String),
174
+ effective_date: T.nilable(Time),
175
+ expiry_date: T.nilable(Time),
176
+ filters:
177
+ T.nilable(
178
+ T::Array[
179
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::OrHash
180
+ ]
181
+ ),
182
+ invoice_settings:
183
+ T.nilable(
184
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::OrHash
185
+ ),
186
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
187
+ per_unit_cost_basis: T.nilable(String),
188
+ entry_type: Symbol
189
+ ).returns(T.attached_class)
190
+ end
191
+ def self.new(
192
+ # The number of credits to effect. Note that this is required for increment,
193
+ # decrement, void, or undo operations.
194
+ amount:,
195
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
196
+ # real-world currency, it must match the customer's invoicing currency.
197
+ currency: nil,
198
+ # Optional metadata that can be specified when adding ledger results via the API.
199
+ # For example, this can be used to note an increment refers to trial credits, or
200
+ # for noting corrections as a result of an incident, etc.
201
+ description: nil,
202
+ # An ISO 8601 format date that denotes when this credit balance should become
203
+ # available for use.
204
+ effective_date: nil,
205
+ # An ISO 8601 format date that denotes when this credit balance should expire.
206
+ expiry_date: nil,
207
+ # Optional filter to specify which items this credit block applies to. If not
208
+ # specified, the block will apply to all items for the pricing unit.
209
+ filters: nil,
210
+ # Passing `invoice_settings` automatically generates an invoice for the newly
211
+ # added credits. If `invoice_settings` is passed, you must specify
212
+ # per_unit_cost_basis, as the calculation of the invoice total is done on that
213
+ # basis.
214
+ invoice_settings: nil,
215
+ # User-specified key/value pairs for the resource. Individual keys can be removed
216
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
217
+ # by setting `metadata` to `null`.
218
+ metadata: nil,
219
+ # Can only be specified when entry_type=increment. How much, in the customer's
220
+ # currency, a customer paid for a single credit in this block
221
+ per_unit_cost_basis: nil,
222
+ entry_type: :increment
314
223
  )
315
- end
316
- def to_hash
317
- end
224
+ end
318
225
 
319
- # The property of the price the block applies to. Only item_id is supported.
320
- module Field
321
- extend Orb::Internal::Type::Enum
226
+ sig do
227
+ override.returns(
228
+ {
229
+ amount: Float,
230
+ entry_type: Symbol,
231
+ currency: T.nilable(String),
232
+ description: T.nilable(String),
233
+ effective_date: T.nilable(Time),
234
+ expiry_date: T.nilable(Time),
235
+ filters:
236
+ T.nilable(
237
+ T::Array[
238
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter
239
+ ]
240
+ ),
241
+ invoice_settings:
242
+ T.nilable(
243
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings
244
+ ),
245
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
246
+ per_unit_cost_basis: T.nilable(String)
247
+ }
248
+ )
249
+ end
250
+ def to_hash
251
+ end
322
252
 
323
- TaggedSymbol =
324
- T.type_alias do
325
- T.all(
326
- Symbol,
327
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Field
253
+ class Filter < Orb::Internal::Type::BaseModel
254
+ OrHash =
255
+ T.type_alias do
256
+ T.any(
257
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter,
258
+ Orb::Internal::AnyHash
259
+ )
260
+ end
261
+
262
+ # The property of the price the block applies to. Only item_id is supported.
263
+ sig do
264
+ returns(
265
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field::OrSymbol
328
266
  )
329
267
  end
330
- OrSymbol = T.type_alias { T.any(Symbol, String) }
268
+ attr_accessor :field
331
269
 
332
- ITEM_ID =
333
- T.let(
334
- :item_id,
335
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Field::TaggedSymbol
270
+ # Should prices that match the filter be included or excluded.
271
+ sig do
272
+ returns(
273
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator::OrSymbol
274
+ )
275
+ end
276
+ attr_accessor :operator
277
+
278
+ # The IDs or values that match this filter.
279
+ sig { returns(T::Array[String]) }
280
+ attr_accessor :values
281
+
282
+ # A PriceFilter that only allows item_id field for block filters.
283
+ sig do
284
+ params(
285
+ field:
286
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field::OrSymbol,
287
+ operator:
288
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator::OrSymbol,
289
+ values: T::Array[String]
290
+ ).returns(T.attached_class)
291
+ end
292
+ def self.new(
293
+ # The property of the price the block applies to. Only item_id is supported.
294
+ field:,
295
+ # Should prices that match the filter be included or excluded.
296
+ operator:,
297
+ # The IDs or values that match this filter.
298
+ values:
336
299
  )
300
+ end
337
301
 
338
- sig do
339
- override.returns(
340
- T::Array[
341
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Field::TaggedSymbol
342
- ]
343
- )
302
+ sig do
303
+ override.returns(
304
+ {
305
+ field:
306
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field::OrSymbol,
307
+ operator:
308
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator::OrSymbol,
309
+ values: T::Array[String]
310
+ }
311
+ )
312
+ end
313
+ def to_hash
314
+ end
315
+
316
+ # The property of the price the block applies to. Only item_id is supported.
317
+ module Field
318
+ extend Orb::Internal::Type::Enum
319
+
320
+ TaggedSymbol =
321
+ T.type_alias do
322
+ T.all(
323
+ Symbol,
324
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field
325
+ )
326
+ end
327
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
328
+
329
+ ITEM_ID =
330
+ T.let(
331
+ :item_id,
332
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field::TaggedSymbol
333
+ )
334
+
335
+ sig do
336
+ override.returns(
337
+ T::Array[
338
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field::TaggedSymbol
339
+ ]
340
+ )
341
+ end
342
+ def self.values
343
+ end
344
+ end
345
+
346
+ # Should prices that match the filter be included or excluded.
347
+ module Operator
348
+ extend Orb::Internal::Type::Enum
349
+
350
+ TaggedSymbol =
351
+ T.type_alias do
352
+ T.all(
353
+ Symbol,
354
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator
355
+ )
356
+ end
357
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
358
+
359
+ INCLUDES =
360
+ T.let(
361
+ :includes,
362
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator::TaggedSymbol
363
+ )
364
+ EXCLUDES =
365
+ T.let(
366
+ :excludes,
367
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator::TaggedSymbol
368
+ )
369
+
370
+ sig do
371
+ override.returns(
372
+ T::Array[
373
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator::TaggedSymbol
374
+ ]
375
+ )
376
+ end
377
+ def self.values
378
+ end
379
+ end
344
380
  end
345
- def self.values
381
+
382
+ class InvoiceSettings < Orb::Internal::Type::BaseModel
383
+ OrHash =
384
+ T.type_alias do
385
+ T.any(
386
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings,
387
+ Orb::Internal::AnyHash
388
+ )
389
+ end
390
+
391
+ # Whether the credits purchase invoice should auto collect with the customer's
392
+ # saved payment method.
393
+ sig { returns(T::Boolean) }
394
+ attr_accessor :auto_collection
395
+
396
+ # An optional custom due date for the invoice. If not set, the due date will be
397
+ # calculated based on the `net_terms` value.
398
+ sig do
399
+ returns(
400
+ T.nilable(
401
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::CustomDueDate::Variants
402
+ )
403
+ )
404
+ end
405
+ attr_accessor :custom_due_date
406
+
407
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
408
+ # customer's timezone. If not provided, the invoice date will default to the
409
+ # credit block's effective date.
410
+ sig do
411
+ returns(
412
+ T.nilable(
413
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::InvoiceDate::Variants
414
+ )
415
+ )
416
+ end
417
+ attr_accessor :invoice_date
418
+
419
+ # The ID of the Item to be used for the invoice line item. If not provided, a
420
+ # default 'Credits' item will be used.
421
+ sig { returns(T.nilable(String)) }
422
+ attr_accessor :item_id
423
+
424
+ # If true, the new credits purchase invoice will be marked as paid.
425
+ sig { returns(T.nilable(T::Boolean)) }
426
+ attr_reader :mark_as_paid
427
+
428
+ sig { params(mark_as_paid: T::Boolean).void }
429
+ attr_writer :mark_as_paid
430
+
431
+ # An optional memo to display on the invoice.
432
+ sig { returns(T.nilable(String)) }
433
+ attr_accessor :memo
434
+
435
+ # The net terms determines the due date of the invoice. Due date is calculated
436
+ # based on the invoice or issuance date, depending on the account's configured due
437
+ # date calculation method. A value of '0' here represents that the invoice is due
438
+ # on issue, whereas a value of '30' represents that the customer has 30 days to
439
+ # pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
440
+ # both.
441
+ sig { returns(T.nilable(Integer)) }
442
+ attr_accessor :net_terms
443
+
444
+ # If true, the new credit block will require that the corresponding invoice is
445
+ # paid before it can be drawn down from.
446
+ sig { returns(T.nilable(T::Boolean)) }
447
+ attr_reader :require_successful_payment
448
+
449
+ sig { params(require_successful_payment: T::Boolean).void }
450
+ attr_writer :require_successful_payment
451
+
452
+ # Passing `invoice_settings` automatically generates an invoice for the newly
453
+ # added credits. If `invoice_settings` is passed, you must specify
454
+ # per_unit_cost_basis, as the calculation of the invoice total is done on that
455
+ # basis.
456
+ sig do
457
+ params(
458
+ auto_collection: T::Boolean,
459
+ custom_due_date:
460
+ T.nilable(
461
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::CustomDueDate::Variants
462
+ ),
463
+ invoice_date:
464
+ T.nilable(
465
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::InvoiceDate::Variants
466
+ ),
467
+ item_id: T.nilable(String),
468
+ mark_as_paid: T::Boolean,
469
+ memo: T.nilable(String),
470
+ net_terms: T.nilable(Integer),
471
+ require_successful_payment: T::Boolean
472
+ ).returns(T.attached_class)
473
+ end
474
+ def self.new(
475
+ # Whether the credits purchase invoice should auto collect with the customer's
476
+ # saved payment method.
477
+ auto_collection:,
478
+ # An optional custom due date for the invoice. If not set, the due date will be
479
+ # calculated based on the `net_terms` value.
480
+ custom_due_date: nil,
481
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
482
+ # customer's timezone. If not provided, the invoice date will default to the
483
+ # credit block's effective date.
484
+ invoice_date: nil,
485
+ # The ID of the Item to be used for the invoice line item. If not provided, a
486
+ # default 'Credits' item will be used.
487
+ item_id: nil,
488
+ # If true, the new credits purchase invoice will be marked as paid.
489
+ mark_as_paid: nil,
490
+ # An optional memo to display on the invoice.
491
+ memo: nil,
492
+ # The net terms determines the due date of the invoice. Due date is calculated
493
+ # based on the invoice or issuance date, depending on the account's configured due
494
+ # date calculation method. A value of '0' here represents that the invoice is due
495
+ # on issue, whereas a value of '30' represents that the customer has 30 days to
496
+ # pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
497
+ # both.
498
+ net_terms: nil,
499
+ # If true, the new credit block will require that the corresponding invoice is
500
+ # paid before it can be drawn down from.
501
+ require_successful_payment: nil
502
+ )
503
+ end
504
+
505
+ sig do
506
+ override.returns(
507
+ {
508
+ auto_collection: T::Boolean,
509
+ custom_due_date:
510
+ T.nilable(
511
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::CustomDueDate::Variants
512
+ ),
513
+ invoice_date:
514
+ T.nilable(
515
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::InvoiceDate::Variants
516
+ ),
517
+ item_id: T.nilable(String),
518
+ mark_as_paid: T::Boolean,
519
+ memo: T.nilable(String),
520
+ net_terms: T.nilable(Integer),
521
+ require_successful_payment: T::Boolean
522
+ }
523
+ )
524
+ end
525
+ def to_hash
526
+ end
527
+
528
+ # An optional custom due date for the invoice. If not set, the due date will be
529
+ # calculated based on the `net_terms` value.
530
+ module CustomDueDate
531
+ extend Orb::Internal::Type::Union
532
+
533
+ Variants = T.type_alias { T.any(Date, Time) }
534
+
535
+ sig do
536
+ override.returns(
537
+ T::Array[
538
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::CustomDueDate::Variants
539
+ ]
540
+ )
541
+ end
542
+ def self.variants
543
+ end
544
+ end
545
+
546
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
547
+ # customer's timezone. If not provided, the invoice date will default to the
548
+ # credit block's effective date.
549
+ module InvoiceDate
550
+ extend Orb::Internal::Type::Union
551
+
552
+ Variants = T.type_alias { T.any(Date, Time) }
553
+
554
+ sig do
555
+ override.returns(
556
+ T::Array[
557
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::InvoiceDate::Variants
558
+ ]
559
+ )
560
+ end
561
+ def self.variants
562
+ end
563
+ end
346
564
  end
347
565
  end
348
566
 
349
- # Should prices that match the filter be included or excluded.
350
- module Operator
351
- extend Orb::Internal::Type::Enum
352
-
353
- TaggedSymbol =
567
+ class Decrement < Orb::Internal::Type::BaseModel
568
+ OrHash =
354
569
  T.type_alias do
355
- T.all(
356
- Symbol,
357
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator
570
+ T.any(
571
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Decrement,
572
+ Orb::Internal::AnyHash
358
573
  )
359
574
  end
360
- OrSymbol = T.type_alias { T.any(Symbol, String) }
361
575
 
362
- INCLUDES =
363
- T.let(
364
- :includes,
365
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator::TaggedSymbol
366
- )
367
- EXCLUDES =
368
- T.let(
369
- :excludes,
370
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator::TaggedSymbol
371
- )
576
+ # The number of credits to effect. Note that this is required for increment,
577
+ # decrement, void, or undo operations.
578
+ sig { returns(Float) }
579
+ attr_accessor :amount
580
+
581
+ sig { returns(Symbol) }
582
+ attr_accessor :entry_type
583
+
584
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
585
+ # real-world currency, it must match the customer's invoicing currency.
586
+ sig { returns(T.nilable(String)) }
587
+ attr_accessor :currency
588
+
589
+ # Optional metadata that can be specified when adding ledger results via the API.
590
+ # For example, this can be used to note an increment refers to trial credits, or
591
+ # for noting corrections as a result of an incident, etc.
592
+ sig { returns(T.nilable(String)) }
593
+ attr_accessor :description
594
+
595
+ # User-specified key/value pairs for the resource. Individual keys can be removed
596
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
597
+ # by setting `metadata` to `null`.
598
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
599
+ attr_accessor :metadata
600
+
601
+ sig do
602
+ params(
603
+ amount: Float,
604
+ currency: T.nilable(String),
605
+ description: T.nilable(String),
606
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
607
+ entry_type: Symbol
608
+ ).returns(T.attached_class)
609
+ end
610
+ def self.new(
611
+ # The number of credits to effect. Note that this is required for increment,
612
+ # decrement, void, or undo operations.
613
+ amount:,
614
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
615
+ # real-world currency, it must match the customer's invoicing currency.
616
+ currency: nil,
617
+ # Optional metadata that can be specified when adding ledger results via the API.
618
+ # For example, this can be used to note an increment refers to trial credits, or
619
+ # for noting corrections as a result of an incident, etc.
620
+ description: nil,
621
+ # User-specified key/value pairs for the resource. Individual keys can be removed
622
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
623
+ # by setting `metadata` to `null`.
624
+ metadata: nil,
625
+ entry_type: :decrement
626
+ )
627
+ end
372
628
 
373
629
  sig do
374
630
  override.returns(
375
- T::Array[
376
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator::TaggedSymbol
377
- ]
631
+ {
632
+ amount: Float,
633
+ entry_type: Symbol,
634
+ currency: T.nilable(String),
635
+ description: T.nilable(String),
636
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
637
+ }
378
638
  )
379
639
  end
380
- def self.values
640
+ def to_hash
381
641
  end
382
642
  end
383
- end
384
643
 
385
- class InvoiceSettings < Orb::Internal::Type::BaseModel
386
- OrHash =
387
- T.type_alias do
388
- T.any(
389
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings,
390
- Orb::Internal::AnyHash
391
- )
392
- end
644
+ class ExpirationChange < Orb::Internal::Type::BaseModel
645
+ OrHash =
646
+ T.type_alias do
647
+ T.any(
648
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange,
649
+ Orb::Internal::AnyHash
650
+ )
651
+ end
393
652
 
394
- # Whether the credits purchase invoice should auto collect with the customer's
395
- # saved payment method.
396
- sig { returns(T::Boolean) }
397
- attr_accessor :auto_collection
653
+ sig { returns(Symbol) }
654
+ attr_accessor :entry_type
655
+
656
+ # A future date (specified in YYYY-MM-DD format) used for expiration change,
657
+ # denoting when credits transferred (as part of a partial block expiration) should
658
+ # expire.
659
+ sig { returns(Date) }
660
+ attr_accessor :target_expiry_date
661
+
662
+ # The number of credits to effect. Note that this is required for increment,
663
+ # decrement, void, or undo operations.
664
+ sig { returns(T.nilable(Float)) }
665
+ attr_accessor :amount
666
+
667
+ # The ID of the block affected by an expiration_change, used to differentiate
668
+ # between multiple blocks with the same `expiry_date`.
669
+ sig { returns(T.nilable(String)) }
670
+ attr_accessor :block_id
671
+
672
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
673
+ # real-world currency, it must match the customer's invoicing currency.
674
+ sig { returns(T.nilable(String)) }
675
+ attr_accessor :currency
676
+
677
+ # Optional metadata that can be specified when adding ledger results via the API.
678
+ # For example, this can be used to note an increment refers to trial credits, or
679
+ # for noting corrections as a result of an incident, etc.
680
+ sig { returns(T.nilable(String)) }
681
+ attr_accessor :description
682
+
683
+ # An ISO 8601 format date that identifies the origination credit block to expire
684
+ sig { returns(T.nilable(Time)) }
685
+ attr_accessor :expiry_date
686
+
687
+ # User-specified key/value pairs for the resource. Individual keys can be removed
688
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
689
+ # by setting `metadata` to `null`.
690
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
691
+ attr_accessor :metadata
398
692
 
399
- # An optional custom due date for the invoice. If not set, the due date will be
400
- # calculated based on the `net_terms` value.
401
- sig do
402
- returns(
403
- T.nilable(
404
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate::Variants
405
- )
693
+ sig do
694
+ params(
695
+ target_expiry_date: Date,
696
+ amount: T.nilable(Float),
697
+ block_id: T.nilable(String),
698
+ currency: T.nilable(String),
699
+ description: T.nilable(String),
700
+ expiry_date: T.nilable(Time),
701
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
702
+ entry_type: Symbol
703
+ ).returns(T.attached_class)
704
+ end
705
+ def self.new(
706
+ # A future date (specified in YYYY-MM-DD format) used for expiration change,
707
+ # denoting when credits transferred (as part of a partial block expiration) should
708
+ # expire.
709
+ target_expiry_date:,
710
+ # The number of credits to effect. Note that this is required for increment,
711
+ # decrement, void, or undo operations.
712
+ amount: nil,
713
+ # The ID of the block affected by an expiration_change, used to differentiate
714
+ # between multiple blocks with the same `expiry_date`.
715
+ block_id: nil,
716
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
717
+ # real-world currency, it must match the customer's invoicing currency.
718
+ currency: nil,
719
+ # Optional metadata that can be specified when adding ledger results via the API.
720
+ # For example, this can be used to note an increment refers to trial credits, or
721
+ # for noting corrections as a result of an incident, etc.
722
+ description: nil,
723
+ # An ISO 8601 format date that identifies the origination credit block to expire
724
+ expiry_date: nil,
725
+ # User-specified key/value pairs for the resource. Individual keys can be removed
726
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
727
+ # by setting `metadata` to `null`.
728
+ metadata: nil,
729
+ entry_type: :expiration_change
406
730
  )
407
- end
408
- attr_accessor :custom_due_date
731
+ end
409
732
 
410
- # An ISO 8601 format date that denotes when this invoice should be dated in the
411
- # customer's timezone. If not provided, the invoice date will default to the
412
- # credit block's effective date.
413
- sig do
414
- returns(
415
- T.nilable(
416
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::InvoiceDate::Variants
733
+ sig do
734
+ override.returns(
735
+ {
736
+ entry_type: Symbol,
737
+ target_expiry_date: Date,
738
+ amount: T.nilable(Float),
739
+ block_id: T.nilable(String),
740
+ currency: T.nilable(String),
741
+ description: T.nilable(String),
742
+ expiry_date: T.nilable(Time),
743
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
744
+ }
417
745
  )
418
- )
746
+ end
747
+ def to_hash
748
+ end
419
749
  end
420
- attr_accessor :invoice_date
421
-
422
- # The ID of the Item to be used for the invoice line item. If not provided, a
423
- # default 'Credits' item will be used.
424
- sig { returns(T.nilable(String)) }
425
- attr_accessor :item_id
426
-
427
- # If true, the new credits purchase invoice will be marked as paid.
428
- sig { returns(T.nilable(T::Boolean)) }
429
- attr_reader :mark_as_paid
430
-
431
- sig { params(mark_as_paid: T::Boolean).void }
432
- attr_writer :mark_as_paid
433
-
434
- # An optional memo to display on the invoice.
435
- sig { returns(T.nilable(String)) }
436
- attr_accessor :memo
437
-
438
- # The net terms determines the due date of the invoice. Due date is calculated
439
- # based on the invoice or issuance date, depending on the account's configured due
440
- # date calculation method. A value of '0' here represents that the invoice is due
441
- # on issue, whereas a value of '30' represents that the customer has 30 days to
442
- # pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
443
- # both.
444
- sig { returns(T.nilable(Integer)) }
445
- attr_accessor :net_terms
446
-
447
- # If true, the new credit block will require that the corresponding invoice is
448
- # paid before it can be drawn down from.
449
- sig { returns(T.nilable(T::Boolean)) }
450
- attr_reader :require_successful_payment
451
-
452
- sig { params(require_successful_payment: T::Boolean).void }
453
- attr_writer :require_successful_payment
454
-
455
- # Passing `invoice_settings` automatically generates an invoice for the newly
456
- # added credits. If `invoice_settings` is passed, you must specify
457
- # per_unit_cost_basis, as the calculation of the invoice total is done on that
458
- # basis.
459
- sig do
460
- params(
461
- auto_collection: T::Boolean,
462
- custom_due_date:
463
- T.nilable(
464
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate::Variants
465
- ),
466
- invoice_date:
750
+
751
+ class Void < Orb::Internal::Type::BaseModel
752
+ OrHash =
753
+ T.type_alias do
754
+ T.any(
755
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void,
756
+ Orb::Internal::AnyHash
757
+ )
758
+ end
759
+
760
+ # The number of credits to effect. Note that this is required for increment,
761
+ # decrement, void, or undo operations.
762
+ sig { returns(Float) }
763
+ attr_accessor :amount
764
+
765
+ # The ID of the block to void.
766
+ sig { returns(String) }
767
+ attr_accessor :block_id
768
+
769
+ sig { returns(Symbol) }
770
+ attr_accessor :entry_type
771
+
772
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
773
+ # real-world currency, it must match the customer's invoicing currency.
774
+ sig { returns(T.nilable(String)) }
775
+ attr_accessor :currency
776
+
777
+ # Optional metadata that can be specified when adding ledger results via the API.
778
+ # For example, this can be used to note an increment refers to trial credits, or
779
+ # for noting corrections as a result of an incident, etc.
780
+ sig { returns(T.nilable(String)) }
781
+ attr_accessor :description
782
+
783
+ # User-specified key/value pairs for the resource. Individual keys can be removed
784
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
785
+ # by setting `metadata` to `null`.
786
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
787
+ attr_accessor :metadata
788
+
789
+ # Can only be specified when `entry_type=void`. The reason for the void.
790
+ sig do
791
+ returns(
467
792
  T.nilable(
468
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::InvoiceDate::Variants
469
- ),
470
- item_id: T.nilable(String),
471
- mark_as_paid: T::Boolean,
472
- memo: T.nilable(String),
473
- net_terms: T.nilable(Integer),
474
- require_successful_payment: T::Boolean
475
- ).returns(T.attached_class)
476
- end
477
- def self.new(
478
- # Whether the credits purchase invoice should auto collect with the customer's
479
- # saved payment method.
480
- auto_collection:,
481
- # An optional custom due date for the invoice. If not set, the due date will be
482
- # calculated based on the `net_terms` value.
483
- custom_due_date: nil,
484
- # An ISO 8601 format date that denotes when this invoice should be dated in the
485
- # customer's timezone. If not provided, the invoice date will default to the
486
- # credit block's effective date.
487
- invoice_date: nil,
488
- # The ID of the Item to be used for the invoice line item. If not provided, a
489
- # default 'Credits' item will be used.
490
- item_id: nil,
491
- # If true, the new credits purchase invoice will be marked as paid.
492
- mark_as_paid: nil,
493
- # An optional memo to display on the invoice.
494
- memo: nil,
495
- # The net terms determines the due date of the invoice. Due date is calculated
496
- # based on the invoice or issuance date, depending on the account's configured due
497
- # date calculation method. A value of '0' here represents that the invoice is due
498
- # on issue, whereas a value of '30' represents that the customer has 30 days to
499
- # pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
500
- # both.
501
- net_terms: nil,
502
- # If true, the new credit block will require that the corresponding invoice is
503
- # paid before it can be drawn down from.
504
- require_successful_payment: nil
505
- )
506
- end
793
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason::OrSymbol
794
+ )
795
+ )
796
+ end
797
+ attr_accessor :void_reason
507
798
 
508
- sig do
509
- override.returns(
510
- {
511
- auto_collection: T::Boolean,
512
- custom_due_date:
513
- T.nilable(
514
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate::Variants
515
- ),
516
- invoice_date:
799
+ sig do
800
+ params(
801
+ amount: Float,
802
+ block_id: String,
803
+ currency: T.nilable(String),
804
+ description: T.nilable(String),
805
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
806
+ void_reason:
517
807
  T.nilable(
518
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::InvoiceDate::Variants
808
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason::OrSymbol
519
809
  ),
520
- item_id: T.nilable(String),
521
- mark_as_paid: T::Boolean,
522
- memo: T.nilable(String),
523
- net_terms: T.nilable(Integer),
524
- require_successful_payment: T::Boolean
525
- }
810
+ entry_type: Symbol
811
+ ).returns(T.attached_class)
812
+ end
813
+ def self.new(
814
+ # The number of credits to effect. Note that this is required for increment,
815
+ # decrement, void, or undo operations.
816
+ amount:,
817
+ # The ID of the block to void.
818
+ block_id:,
819
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
820
+ # real-world currency, it must match the customer's invoicing currency.
821
+ currency: nil,
822
+ # Optional metadata that can be specified when adding ledger results via the API.
823
+ # For example, this can be used to note an increment refers to trial credits, or
824
+ # for noting corrections as a result of an incident, etc.
825
+ description: nil,
826
+ # User-specified key/value pairs for the resource. Individual keys can be removed
827
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
828
+ # by setting `metadata` to `null`.
829
+ metadata: nil,
830
+ # Can only be specified when `entry_type=void`. The reason for the void.
831
+ void_reason: nil,
832
+ entry_type: :void
526
833
  )
527
- end
528
- def to_hash
529
- end
530
-
531
- # An optional custom due date for the invoice. If not set, the due date will be
532
- # calculated based on the `net_terms` value.
533
- module CustomDueDate
534
- extend Orb::Internal::Type::Union
535
-
536
- Variants = T.type_alias { T.any(Date, Time) }
834
+ end
537
835
 
538
836
  sig do
539
837
  override.returns(
540
- T::Array[
541
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate::Variants
542
- ]
838
+ {
839
+ amount: Float,
840
+ block_id: String,
841
+ entry_type: Symbol,
842
+ currency: T.nilable(String),
843
+ description: T.nilable(String),
844
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
845
+ void_reason:
846
+ T.nilable(
847
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason::OrSymbol
848
+ )
849
+ }
543
850
  )
544
851
  end
545
- def self.variants
852
+ def to_hash
853
+ end
854
+
855
+ # Can only be specified when `entry_type=void`. The reason for the void.
856
+ module VoidReason
857
+ extend Orb::Internal::Type::Enum
858
+
859
+ TaggedSymbol =
860
+ T.type_alias do
861
+ T.all(
862
+ Symbol,
863
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason
864
+ )
865
+ end
866
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
867
+
868
+ REFUND =
869
+ T.let(
870
+ :refund,
871
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason::TaggedSymbol
872
+ )
873
+
874
+ sig do
875
+ override.returns(
876
+ T::Array[
877
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason::TaggedSymbol
878
+ ]
879
+ )
880
+ end
881
+ def self.values
882
+ end
546
883
  end
547
884
  end
548
885
 
549
- # An ISO 8601 format date that denotes when this invoice should be dated in the
550
- # customer's timezone. If not provided, the invoice date will default to the
551
- # credit block's effective date.
552
- module InvoiceDate
553
- extend Orb::Internal::Type::Union
886
+ class Amendment < Orb::Internal::Type::BaseModel
887
+ OrHash =
888
+ T.type_alias do
889
+ T.any(
890
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Amendment,
891
+ Orb::Internal::AnyHash
892
+ )
893
+ end
894
+
895
+ # The number of credits to effect. Note that this is required for increment,
896
+ # decrement or void operations.
897
+ sig { returns(Float) }
898
+ attr_accessor :amount
899
+
900
+ # The ID of the block to reverse a decrement from.
901
+ sig { returns(String) }
902
+ attr_accessor :block_id
903
+
904
+ sig { returns(Symbol) }
905
+ attr_accessor :entry_type
906
+
907
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
908
+ # real-world currency, it must match the customer's invoicing currency.
909
+ sig { returns(T.nilable(String)) }
910
+ attr_accessor :currency
911
+
912
+ # Optional metadata that can be specified when adding ledger results via the API.
913
+ # For example, this can be used to note an increment refers to trial credits, or
914
+ # for noting corrections as a result of an incident, etc.
915
+ sig { returns(T.nilable(String)) }
916
+ attr_accessor :description
554
917
 
555
- Variants = T.type_alias { T.any(Date, Time) }
918
+ # User-specified key/value pairs for the resource. Individual keys can be removed
919
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
920
+ # by setting `metadata` to `null`.
921
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
922
+ attr_accessor :metadata
556
923
 
557
924
  sig do
558
- override.returns(
559
- T::Array[
560
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::InvoiceDate::Variants
561
- ]
562
- )
925
+ params(
926
+ amount: Float,
927
+ block_id: String,
928
+ currency: T.nilable(String),
929
+ description: T.nilable(String),
930
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
931
+ entry_type: Symbol
932
+ ).returns(T.attached_class)
563
933
  end
564
- def self.variants
934
+ def self.new(
935
+ # The number of credits to effect. Note that this is required for increment,
936
+ # decrement or void operations.
937
+ amount:,
938
+ # The ID of the block to reverse a decrement from.
939
+ block_id:,
940
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
941
+ # real-world currency, it must match the customer's invoicing currency.
942
+ currency: nil,
943
+ # Optional metadata that can be specified when adding ledger results via the API.
944
+ # For example, this can be used to note an increment refers to trial credits, or
945
+ # for noting corrections as a result of an incident, etc.
946
+ description: nil,
947
+ # User-specified key/value pairs for the resource. Individual keys can be removed
948
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
949
+ # by setting `metadata` to `null`.
950
+ metadata: nil,
951
+ entry_type: :amendment
952
+ )
565
953
  end
566
- end
567
- end
568
-
569
- # Can only be specified when `entry_type=void`. The reason for the void.
570
- module VoidReason
571
- extend Orb::Internal::Type::Enum
572
954
 
573
- TaggedSymbol =
574
- T.type_alias do
575
- T.all(
576
- Symbol,
577
- Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason
955
+ sig do
956
+ override.returns(
957
+ {
958
+ amount: Float,
959
+ block_id: String,
960
+ entry_type: Symbol,
961
+ currency: T.nilable(String),
962
+ description: T.nilable(String),
963
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
964
+ }
578
965
  )
579
966
  end
580
- OrSymbol = T.type_alias { T.any(Symbol, String) }
581
-
582
- REFUND =
583
- T.let(
584
- :refund,
585
- Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason::TaggedSymbol
586
- )
967
+ def to_hash
968
+ end
969
+ end
587
970
 
588
971
  sig do
589
972
  override.returns(
590
973
  T::Array[
591
- Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason::TaggedSymbol
974
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Variants
592
975
  ]
593
976
  )
594
977
  end
595
- def self.values
978
+ def self.variants
596
979
  end
597
980
  end
598
981
  end