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
@@ -9,334 +9,601 @@ module Orb
9
9
  extend Orb::Internal::Type::RequestParameters::Converter
10
10
  include Orb::Internal::Type::RequestParameters
11
11
 
12
- # @!attribute amount
13
- # The number of credits to effect. Note that this is required for increment,
14
- # decrement or void operations.
15
- #
16
- # @return [Float]
17
- required :amount, Float
18
-
19
- # @!attribute entry_type
20
- #
21
- # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::EntryType]
22
- required :entry_type, enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::EntryType }
23
-
24
- # @!attribute currency
25
- # The currency or custom pricing unit to use for this ledger entry. If this is a
26
- # real-world currency, it must match the customer's invoicing currency.
27
- #
28
- # @return [String, nil]
29
- optional :currency, String, nil?: true
30
-
31
- # @!attribute description
32
- # Optional metadata that can be specified when adding ledger results via the API.
33
- # For example, this can be used to note an increment refers to trial credits, or
34
- # for noting corrections as a result of an incident, etc.
35
- #
36
- # @return [String, nil]
37
- optional :description, String, nil?: true
38
-
39
- # @!attribute effective_date
40
- # An ISO 8601 format date that denotes when this credit balance should become
41
- # available for use.
42
- #
43
- # @return [Time, nil]
44
- optional :effective_date, Time, nil?: true
45
-
46
- # @!attribute expiry_date
47
- # An ISO 8601 format date that identifies the origination credit block to expire
48
- #
49
- # @return [Time, nil]
50
- optional :expiry_date, Time, nil?: true
51
-
52
- # @!attribute filters
53
- # Optional filter to specify which items this credit block applies to. If not
54
- # specified, the block will apply to all items for the pricing unit.
55
- #
56
- # @return [Array<Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter>, nil]
57
- optional :filters,
58
- -> {
59
- Orb::Internal::Type::ArrayOf[Orb::Customers::Credits::LedgerCreateEntryParams::Filter]
60
- },
61
- nil?: true
62
-
63
- # @!attribute invoice_settings
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
- #
69
- # @return [Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, nil]
70
- optional :invoice_settings,
71
- -> { Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings },
72
- nil?: true
73
-
74
- # @!attribute metadata
75
- # User-specified key/value pairs for the resource. Individual keys can be removed
76
- # by setting the value to `null`, and the entire metadata mapping can be cleared
77
- # by setting `metadata` to `null`.
78
- #
79
- # @return [Hash{Symbol=>String, nil}, nil]
80
- optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
81
-
82
- # @!attribute per_unit_cost_basis
83
- # Can only be specified when entry_type=increment. How much, in the customer's
84
- # currency, a customer paid for a single credit in this block
85
- #
86
- # @return [String, nil]
87
- optional :per_unit_cost_basis, String, nil?: true
88
-
89
- # @!attribute target_expiry_date
90
- # A future date (specified in YYYY-MM-DD format) used for expiration change,
91
- # denoting when credits transferred (as part of a partial block expiration) should
92
- # expire.
93
- #
94
- # @return [Date]
95
- required :target_expiry_date, Date
96
-
97
- # @!attribute block_id
98
- # The ID of the block to reverse a decrement from.
12
+ # @!attribute customer_id
99
13
  #
100
14
  # @return [String]
101
- required :block_id, String
15
+ required :customer_id, String
102
16
 
103
- # @!attribute void_reason
104
- # Can only be specified when `entry_type=void`. The reason for the void.
105
- #
106
- # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::VoidReason, nil]
107
- optional :void_reason,
108
- enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason },
109
- nil?: true
110
-
111
- # @!method initialize(amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, filters: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
112
- # Some parameter documentations has been truncated, see
113
- # {Orb::Models::Customers::Credits::LedgerCreateEntryParams} for more details.
114
- #
115
- # @param amount [Float] The number of credits to effect. Note that this is required for increment, decre
116
- #
117
- # @param entry_type [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::EntryType]
118
- #
119
- # @param target_expiry_date [Date] A future date (specified in YYYY-MM-DD format) used for expiration change, denot
17
+ # @!attribute body
120
18
  #
121
- # @param block_id [String] The ID of the block to reverse a decrement from.
122
- #
123
- # @param currency [String, nil] The currency or custom pricing unit to use for this ledger entry. If this is a r
124
- #
125
- # @param description [String, nil] Optional metadata that can be specified when adding ledger results via the API.
126
- #
127
- # @param effective_date [Time, nil] An ISO 8601 format date that denotes when this credit balance should become avai
128
- #
129
- # @param expiry_date [Time, nil] An ISO 8601 format date that identifies the origination credit block to expire
130
- #
131
- # @param filters [Array<Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter>, nil] Optional filter to specify which items this credit block applies to. If not spec
132
- #
133
- # @param invoice_settings [Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, nil] Passing `invoice_settings` automatically generates an invoice for the newly adde
134
- #
135
- # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
136
- #
137
- # @param per_unit_cost_basis [String, nil] Can only be specified when entry_type=increment. How much, in the customer's cur
138
- #
139
- # @param void_reason [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::VoidReason, nil] Can only be specified when `entry_type=void`. The reason for the void.
140
- #
141
- # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
142
-
143
- module EntryType
144
- extend Orb::Internal::Type::Enum
19
+ # @return [Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Decrement, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Void, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Amendment]
20
+ required :body, union: -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body }
145
21
 
146
- AMENDMENT = :amendment
147
-
148
- # @!method self.values
149
- # @return [Array<Symbol>]
150
- end
22
+ # @!method initialize(customer_id:, body:, request_options: {})
23
+ # @param customer_id [String]
24
+ # @param body [Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Decrement, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Void, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Amendment]
25
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
151
26
 
152
- class Filter < Orb::Internal::Type::BaseModel
153
- # @!attribute field
154
- # The property of the price the block applies to. Only item_id is supported.
155
- #
156
- # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter::Field]
157
- required :field, enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Field }
158
-
159
- # @!attribute operator
160
- # Should prices that match the filter be included or excluded.
161
- #
162
- # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter::Operator]
163
- required :operator, enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator }
164
-
165
- # @!attribute values
166
- # The IDs or values that match this filter.
167
- #
168
- # @return [Array<String>]
169
- required :values, Orb::Internal::Type::ArrayOf[String]
170
-
171
- # @!method initialize(field:, operator:, values:)
172
- # A PriceFilter that only allows item_id field for block filters.
173
- #
174
- # @param field [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter::Field] The property of the price the block applies to. Only item_id is supported.
175
- #
176
- # @param operator [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter::Operator] Should prices that match the filter be included or excluded.
177
- #
178
- # @param values [Array<String>] The IDs or values that match this filter.
179
-
180
- # The property of the price the block applies to. Only item_id is supported.
181
- #
182
- # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter#field
183
- module Field
184
- extend Orb::Internal::Type::Enum
185
-
186
- ITEM_ID = :item_id
187
-
188
- # @!method self.values
189
- # @return [Array<Symbol>]
27
+ module Body
28
+ extend Orb::Internal::Type::Union
29
+
30
+ discriminator :entry_type
31
+
32
+ variant :increment, -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment }
33
+
34
+ variant :decrement, -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body::Decrement }
35
+
36
+ variant :expiration_change,
37
+ -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange }
38
+
39
+ variant :void, -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void }
40
+
41
+ variant :amendment, -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body::Amendment }
42
+
43
+ class Increment < Orb::Internal::Type::BaseModel
44
+ # @!attribute amount
45
+ # The number of credits to effect. Note that this is required for increment,
46
+ # decrement, void, or undo operations.
47
+ #
48
+ # @return [Float]
49
+ required :amount, Float
50
+
51
+ # @!attribute entry_type
52
+ #
53
+ # @return [Symbol, :increment]
54
+ required :entry_type, const: :increment
55
+
56
+ # @!attribute currency
57
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
58
+ # real-world currency, it must match the customer's invoicing currency.
59
+ #
60
+ # @return [String, nil]
61
+ optional :currency, String, nil?: true
62
+
63
+ # @!attribute description
64
+ # Optional metadata that can be specified when adding ledger results via the API.
65
+ # For example, this can be used to note an increment refers to trial credits, or
66
+ # for noting corrections as a result of an incident, etc.
67
+ #
68
+ # @return [String, nil]
69
+ optional :description, String, nil?: true
70
+
71
+ # @!attribute effective_date
72
+ # An ISO 8601 format date that denotes when this credit balance should become
73
+ # available for use.
74
+ #
75
+ # @return [Time, nil]
76
+ optional :effective_date, Time, nil?: true
77
+
78
+ # @!attribute expiry_date
79
+ # An ISO 8601 format date that denotes when this credit balance should expire.
80
+ #
81
+ # @return [Time, nil]
82
+ optional :expiry_date, Time, nil?: true
83
+
84
+ # @!attribute filters
85
+ # Optional filter to specify which items this credit block applies to. If not
86
+ # specified, the block will apply to all items for the pricing unit.
87
+ #
88
+ # @return [Array<Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter>, nil]
89
+ optional :filters,
90
+ -> {
91
+ Orb::Internal::Type::ArrayOf[Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter]
92
+ },
93
+ nil?: true
94
+
95
+ # @!attribute invoice_settings
96
+ # Passing `invoice_settings` automatically generates an invoice for the newly
97
+ # added credits. If `invoice_settings` is passed, you must specify
98
+ # per_unit_cost_basis, as the calculation of the invoice total is done on that
99
+ # basis.
100
+ #
101
+ # @return [Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings, nil]
102
+ optional :invoice_settings,
103
+ -> {
104
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings
105
+ },
106
+ nil?: true
107
+
108
+ # @!attribute metadata
109
+ # User-specified key/value pairs for the resource. Individual keys can be removed
110
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
111
+ # by setting `metadata` to `null`.
112
+ #
113
+ # @return [Hash{Symbol=>String, nil}, nil]
114
+ optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
115
+
116
+ # @!attribute per_unit_cost_basis
117
+ # Can only be specified when entry_type=increment. How much, in the customer's
118
+ # currency, a customer paid for a single credit in this block
119
+ #
120
+ # @return [String, nil]
121
+ optional :per_unit_cost_basis, String, nil?: true
122
+
123
+ # @!method initialize(amount:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, filters: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, entry_type: :increment)
124
+ # Some parameter documentations has been truncated, see
125
+ # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment} for
126
+ # more details.
127
+ #
128
+ # @param amount [Float] The number of credits to effect. Note that this is required for increment, decre
129
+ #
130
+ # @param currency [String, nil] The currency or custom pricing unit to use for this ledger entry. If this is a r
131
+ #
132
+ # @param description [String, nil] Optional metadata that can be specified when adding ledger results via the API.
133
+ #
134
+ # @param effective_date [Time, nil] An ISO 8601 format date that denotes when this credit balance should become avai
135
+ #
136
+ # @param expiry_date [Time, nil] An ISO 8601 format date that denotes when this credit balance should expire.
137
+ #
138
+ # @param filters [Array<Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter>, nil] Optional filter to specify which items this credit block applies to. If not spec
139
+ #
140
+ # @param invoice_settings [Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings, nil] Passing `invoice_settings` automatically generates an invoice for the newly adde
141
+ #
142
+ # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
143
+ #
144
+ # @param per_unit_cost_basis [String, nil] Can only be specified when entry_type=increment. How much, in the customer's cur
145
+ #
146
+ # @param entry_type [Symbol, :increment]
147
+
148
+ class Filter < Orb::Internal::Type::BaseModel
149
+ # @!attribute field
150
+ # The property of the price the block applies to. Only item_id is supported.
151
+ #
152
+ # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field]
153
+ required :field,
154
+ enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field }
155
+
156
+ # @!attribute operator
157
+ # Should prices that match the filter be included or excluded.
158
+ #
159
+ # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator]
160
+ required :operator,
161
+ enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator }
162
+
163
+ # @!attribute values
164
+ # The IDs or values that match this filter.
165
+ #
166
+ # @return [Array<String>]
167
+ required :values, Orb::Internal::Type::ArrayOf[String]
168
+
169
+ # @!method initialize(field:, operator:, values:)
170
+ # A PriceFilter that only allows item_id field for block filters.
171
+ #
172
+ # @param field [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Field] The property of the price the block applies to. Only item_id is supported.
173
+ #
174
+ # @param operator [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter::Operator] Should prices that match the filter be included or excluded.
175
+ #
176
+ # @param values [Array<String>] The IDs or values that match this filter.
177
+
178
+ # The property of the price the block applies to. Only item_id is supported.
179
+ #
180
+ # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter#field
181
+ module Field
182
+ extend Orb::Internal::Type::Enum
183
+
184
+ ITEM_ID = :item_id
185
+
186
+ # @!method self.values
187
+ # @return [Array<Symbol>]
188
+ end
189
+
190
+ # Should prices that match the filter be included or excluded.
191
+ #
192
+ # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::Filter#operator
193
+ module Operator
194
+ extend Orb::Internal::Type::Enum
195
+
196
+ INCLUDES = :includes
197
+ EXCLUDES = :excludes
198
+
199
+ # @!method self.values
200
+ # @return [Array<Symbol>]
201
+ end
202
+ end
203
+
204
+ # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment#invoice_settings
205
+ class InvoiceSettings < Orb::Internal::Type::BaseModel
206
+ # @!attribute auto_collection
207
+ # Whether the credits purchase invoice should auto collect with the customer's
208
+ # saved payment method.
209
+ #
210
+ # @return [Boolean]
211
+ required :auto_collection, Orb::Internal::Type::Boolean
212
+
213
+ # @!attribute custom_due_date
214
+ # An optional custom due date for the invoice. If not set, the due date will be
215
+ # calculated based on the `net_terms` value.
216
+ #
217
+ # @return [Date, Time, nil]
218
+ optional :custom_due_date,
219
+ union: -> {
220
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::CustomDueDate
221
+ },
222
+ nil?: true
223
+
224
+ # @!attribute invoice_date
225
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
226
+ # customer's timezone. If not provided, the invoice date will default to the
227
+ # credit block's effective date.
228
+ #
229
+ # @return [Date, Time, nil]
230
+ optional :invoice_date,
231
+ union: -> {
232
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings::InvoiceDate
233
+ },
234
+ nil?: true
235
+
236
+ # @!attribute item_id
237
+ # The ID of the Item to be used for the invoice line item. If not provided, a
238
+ # default 'Credits' item will be used.
239
+ #
240
+ # @return [String, nil]
241
+ optional :item_id, String, nil?: true
242
+
243
+ # @!attribute mark_as_paid
244
+ # If true, the new credits purchase invoice will be marked as paid.
245
+ #
246
+ # @return [Boolean, nil]
247
+ optional :mark_as_paid, Orb::Internal::Type::Boolean
248
+
249
+ # @!attribute memo
250
+ # An optional memo to display on the invoice.
251
+ #
252
+ # @return [String, nil]
253
+ optional :memo, String, nil?: true
254
+
255
+ # @!attribute net_terms
256
+ # The net terms determines the due date of the invoice. Due date is calculated
257
+ # based on the invoice or issuance date, depending on the account's configured due
258
+ # date calculation method. A value of '0' here represents that the invoice is due
259
+ # on issue, whereas a value of '30' represents that the customer has 30 days to
260
+ # pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
261
+ # both.
262
+ #
263
+ # @return [Integer, nil]
264
+ optional :net_terms, Integer, nil?: true
265
+
266
+ # @!attribute require_successful_payment
267
+ # If true, the new credit block will require that the corresponding invoice is
268
+ # paid before it can be drawn down from.
269
+ #
270
+ # @return [Boolean, nil]
271
+ optional :require_successful_payment, Orb::Internal::Type::Boolean
272
+
273
+ # @!method initialize(auto_collection:, custom_due_date: nil, invoice_date: nil, item_id: nil, mark_as_paid: nil, memo: nil, net_terms: nil, require_successful_payment: nil)
274
+ # Some parameter documentations has been truncated, see
275
+ # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings}
276
+ # for more details.
277
+ #
278
+ # Passing `invoice_settings` automatically generates an invoice for the newly
279
+ # added credits. If `invoice_settings` is passed, you must specify
280
+ # per_unit_cost_basis, as the calculation of the invoice total is done on that
281
+ # basis.
282
+ #
283
+ # @param auto_collection [Boolean] Whether the credits purchase invoice should auto collect with the customer's sav
284
+ #
285
+ # @param custom_due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca
286
+ #
287
+ # @param invoice_date [Date, Time, nil] An ISO 8601 format date that denotes when this invoice should be dated in the cu
288
+ #
289
+ # @param item_id [String, nil] The ID of the Item to be used for the invoice line item. If not provided, a defa
290
+ #
291
+ # @param mark_as_paid [Boolean] If true, the new credits purchase invoice will be marked as paid.
292
+ #
293
+ # @param memo [String, nil] An optional memo to display on the invoice.
294
+ #
295
+ # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas
296
+ #
297
+ # @param require_successful_payment [Boolean] If true, the new credit block will require that the corresponding invoice is pai
298
+
299
+ # An optional custom due date for the invoice. If not set, the due date will be
300
+ # calculated based on the `net_terms` value.
301
+ #
302
+ # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings#custom_due_date
303
+ module CustomDueDate
304
+ extend Orb::Internal::Type::Union
305
+
306
+ variant Date
307
+
308
+ variant Time
309
+
310
+ # @!method self.variants
311
+ # @return [Array(Date, Time)]
312
+ end
313
+
314
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
315
+ # customer's timezone. If not provided, the invoice date will default to the
316
+ # credit block's effective date.
317
+ #
318
+ # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment::InvoiceSettings#invoice_date
319
+ module InvoiceDate
320
+ extend Orb::Internal::Type::Union
321
+
322
+ variant Date
323
+
324
+ variant Time
325
+
326
+ # @!method self.variants
327
+ # @return [Array(Date, Time)]
328
+ end
329
+ end
190
330
  end
191
331
 
192
- # Should prices that match the filter be included or excluded.
193
- #
194
- # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter#operator
195
- module Operator
196
- extend Orb::Internal::Type::Enum
197
-
198
- INCLUDES = :includes
199
- EXCLUDES = :excludes
200
-
201
- # @!method self.values
202
- # @return [Array<Symbol>]
332
+ class Decrement < Orb::Internal::Type::BaseModel
333
+ # @!attribute amount
334
+ # The number of credits to effect. Note that this is required for increment,
335
+ # decrement, void, or undo operations.
336
+ #
337
+ # @return [Float]
338
+ required :amount, Float
339
+
340
+ # @!attribute entry_type
341
+ #
342
+ # @return [Symbol, :decrement]
343
+ required :entry_type, const: :decrement
344
+
345
+ # @!attribute currency
346
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
347
+ # real-world currency, it must match the customer's invoicing currency.
348
+ #
349
+ # @return [String, nil]
350
+ optional :currency, String, nil?: true
351
+
352
+ # @!attribute description
353
+ # Optional metadata that can be specified when adding ledger results via the API.
354
+ # For example, this can be used to note an increment refers to trial credits, or
355
+ # for noting corrections as a result of an incident, etc.
356
+ #
357
+ # @return [String, nil]
358
+ optional :description, String, nil?: true
359
+
360
+ # @!attribute metadata
361
+ # User-specified key/value pairs for the resource. Individual keys can be removed
362
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
363
+ # by setting `metadata` to `null`.
364
+ #
365
+ # @return [Hash{Symbol=>String, nil}, nil]
366
+ optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
367
+
368
+ # @!method initialize(amount:, currency: nil, description: nil, metadata: nil, entry_type: :decrement)
369
+ # Some parameter documentations has been truncated, see
370
+ # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Decrement} for
371
+ # more details.
372
+ #
373
+ # @param amount [Float] The number of credits to effect. Note that this is required for increment, decre
374
+ #
375
+ # @param currency [String, nil] The currency or custom pricing unit to use for this ledger entry. If this is a r
376
+ #
377
+ # @param description [String, nil] Optional metadata that can be specified when adding ledger results via the API.
378
+ #
379
+ # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
380
+ #
381
+ # @param entry_type [Symbol, :decrement]
203
382
  end
204
- end
205
383
 
206
- class InvoiceSettings < Orb::Internal::Type::BaseModel
207
- # @!attribute auto_collection
208
- # Whether the credits purchase invoice should auto collect with the customer's
209
- # saved payment method.
210
- #
211
- # @return [Boolean]
212
- required :auto_collection, Orb::Internal::Type::Boolean
213
-
214
- # @!attribute custom_due_date
215
- # An optional custom due date for the invoice. If not set, the due date will be
216
- # calculated based on the `net_terms` value.
217
- #
218
- # @return [Date, Time, nil]
219
- optional :custom_due_date,
220
- union: -> {
221
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate
222
- },
223
- nil?: true
224
-
225
- # @!attribute invoice_date
226
- # An ISO 8601 format date that denotes when this invoice should be dated in the
227
- # customer's timezone. If not provided, the invoice date will default to the
228
- # credit block's effective date.
229
- #
230
- # @return [Date, Time, nil]
231
- optional :invoice_date,
232
- union: -> {
233
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::InvoiceDate
234
- },
235
- nil?: true
236
-
237
- # @!attribute item_id
238
- # The ID of the Item to be used for the invoice line item. If not provided, a
239
- # default 'Credits' item will be used.
240
- #
241
- # @return [String, nil]
242
- optional :item_id, String, nil?: true
243
-
244
- # @!attribute mark_as_paid
245
- # If true, the new credits purchase invoice will be marked as paid.
246
- #
247
- # @return [Boolean, nil]
248
- optional :mark_as_paid, Orb::Internal::Type::Boolean
249
-
250
- # @!attribute memo
251
- # An optional memo to display on the invoice.
252
- #
253
- # @return [String, nil]
254
- optional :memo, String, nil?: true
255
-
256
- # @!attribute net_terms
257
- # The net terms determines the due date of the invoice. Due date is calculated
258
- # based on the invoice or issuance date, depending on the account's configured due
259
- # date calculation method. A value of '0' here represents that the invoice is due
260
- # on issue, whereas a value of '30' represents that the customer has 30 days to
261
- # pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
262
- # both.
263
- #
264
- # @return [Integer, nil]
265
- optional :net_terms, Integer, nil?: true
266
-
267
- # @!attribute require_successful_payment
268
- # If true, the new credit block will require that the corresponding invoice is
269
- # paid before it can be drawn down from.
270
- #
271
- # @return [Boolean, nil]
272
- optional :require_successful_payment, Orb::Internal::Type::Boolean
273
-
274
- # @!method initialize(auto_collection:, custom_due_date: nil, invoice_date: nil, item_id: nil, mark_as_paid: nil, memo: nil, net_terms: nil, require_successful_payment: nil)
275
- # Some parameter documentations has been truncated, see
276
- # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings} for
277
- # more details.
278
- #
279
- # Passing `invoice_settings` automatically generates an invoice for the newly
280
- # added credits. If `invoice_settings` is passed, you must specify
281
- # per_unit_cost_basis, as the calculation of the invoice total is done on that
282
- # basis.
283
- #
284
- # @param auto_collection [Boolean] Whether the credits purchase invoice should auto collect with the customer's sav
285
- #
286
- # @param custom_due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca
287
- #
288
- # @param invoice_date [Date, Time, nil] An ISO 8601 format date that denotes when this invoice should be dated in the cu
289
- #
290
- # @param item_id [String, nil] The ID of the Item to be used for the invoice line item. If not provided, a defa
291
- #
292
- # @param mark_as_paid [Boolean] If true, the new credits purchase invoice will be marked as paid.
293
- #
294
- # @param memo [String, nil] An optional memo to display on the invoice.
295
- #
296
- # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas
297
- #
298
- # @param require_successful_payment [Boolean] If true, the new credit block will require that the corresponding invoice is pai
299
-
300
- # An optional custom due date for the invoice. If not set, the due date will be
301
- # calculated based on the `net_terms` value.
302
- #
303
- # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings#custom_due_date
304
- module CustomDueDate
305
- extend Orb::Internal::Type::Union
306
-
307
- variant Date
308
-
309
- variant Time
310
-
311
- # @!method self.variants
312
- # @return [Array(Date, Time)]
384
+ class ExpirationChange < Orb::Internal::Type::BaseModel
385
+ # @!attribute entry_type
386
+ #
387
+ # @return [Symbol, :expiration_change]
388
+ required :entry_type, const: :expiration_change
389
+
390
+ # @!attribute target_expiry_date
391
+ # A future date (specified in YYYY-MM-DD format) used for expiration change,
392
+ # denoting when credits transferred (as part of a partial block expiration) should
393
+ # expire.
394
+ #
395
+ # @return [Date]
396
+ required :target_expiry_date, Date
397
+
398
+ # @!attribute amount
399
+ # The number of credits to effect. Note that this is required for increment,
400
+ # decrement, void, or undo operations.
401
+ #
402
+ # @return [Float, nil]
403
+ optional :amount, Float, nil?: true
404
+
405
+ # @!attribute block_id
406
+ # The ID of the block affected by an expiration_change, used to differentiate
407
+ # between multiple blocks with the same `expiry_date`.
408
+ #
409
+ # @return [String, nil]
410
+ optional :block_id, String, nil?: true
411
+
412
+ # @!attribute currency
413
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
414
+ # real-world currency, it must match the customer's invoicing currency.
415
+ #
416
+ # @return [String, nil]
417
+ optional :currency, String, nil?: true
418
+
419
+ # @!attribute description
420
+ # Optional metadata that can be specified when adding ledger results via the API.
421
+ # For example, this can be used to note an increment refers to trial credits, or
422
+ # for noting corrections as a result of an incident, etc.
423
+ #
424
+ # @return [String, nil]
425
+ optional :description, String, nil?: true
426
+
427
+ # @!attribute expiry_date
428
+ # An ISO 8601 format date that identifies the origination credit block to expire
429
+ #
430
+ # @return [Time, nil]
431
+ optional :expiry_date, Time, nil?: true
432
+
433
+ # @!attribute metadata
434
+ # User-specified key/value pairs for the resource. Individual keys can be removed
435
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
436
+ # by setting `metadata` to `null`.
437
+ #
438
+ # @return [Hash{Symbol=>String, nil}, nil]
439
+ optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
440
+
441
+ # @!method initialize(target_expiry_date:, amount: nil, block_id: nil, currency: nil, description: nil, expiry_date: nil, metadata: nil, entry_type: :expiration_change)
442
+ # Some parameter documentations has been truncated, see
443
+ # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange}
444
+ # for more details.
445
+ #
446
+ # @param target_expiry_date [Date] A future date (specified in YYYY-MM-DD format) used for expiration change, denot
447
+ #
448
+ # @param amount [Float, nil] The number of credits to effect. Note that this is required for increment, decre
449
+ #
450
+ # @param block_id [String, nil] The ID of the block affected by an expiration_change, used to differentiate betw
451
+ #
452
+ # @param currency [String, nil] The currency or custom pricing unit to use for this ledger entry. If this is a r
453
+ #
454
+ # @param description [String, nil] Optional metadata that can be specified when adding ledger results via the API.
455
+ #
456
+ # @param expiry_date [Time, nil] An ISO 8601 format date that identifies the origination credit block to expire
457
+ #
458
+ # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
459
+ #
460
+ # @param entry_type [Symbol, :expiration_change]
313
461
  end
314
462
 
315
- # An ISO 8601 format date that denotes when this invoice should be dated in the
316
- # customer's timezone. If not provided, the invoice date will default to the
317
- # credit block's effective date.
318
- #
319
- # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings#invoice_date
320
- module InvoiceDate
321
- extend Orb::Internal::Type::Union
322
-
323
- variant Date
324
-
325
- variant Time
326
-
327
- # @!method self.variants
328
- # @return [Array(Date, Time)]
463
+ class Void < Orb::Internal::Type::BaseModel
464
+ # @!attribute amount
465
+ # The number of credits to effect. Note that this is required for increment,
466
+ # decrement, void, or undo operations.
467
+ #
468
+ # @return [Float]
469
+ required :amount, Float
470
+
471
+ # @!attribute block_id
472
+ # The ID of the block to void.
473
+ #
474
+ # @return [String]
475
+ required :block_id, String
476
+
477
+ # @!attribute entry_type
478
+ #
479
+ # @return [Symbol, :void]
480
+ required :entry_type, const: :void
481
+
482
+ # @!attribute currency
483
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
484
+ # real-world currency, it must match the customer's invoicing currency.
485
+ #
486
+ # @return [String, nil]
487
+ optional :currency, String, nil?: true
488
+
489
+ # @!attribute description
490
+ # Optional metadata that can be specified when adding ledger results via the API.
491
+ # For example, this can be used to note an increment refers to trial credits, or
492
+ # for noting corrections as a result of an incident, etc.
493
+ #
494
+ # @return [String, nil]
495
+ optional :description, String, nil?: true
496
+
497
+ # @!attribute metadata
498
+ # User-specified key/value pairs for the resource. Individual keys can be removed
499
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
500
+ # by setting `metadata` to `null`.
501
+ #
502
+ # @return [Hash{Symbol=>String, nil}, nil]
503
+ optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
504
+
505
+ # @!attribute void_reason
506
+ # Can only be specified when `entry_type=void`. The reason for the void.
507
+ #
508
+ # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason, nil]
509
+ optional :void_reason,
510
+ enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason },
511
+ nil?: true
512
+
513
+ # @!method initialize(amount:, block_id:, currency: nil, description: nil, metadata: nil, void_reason: nil, entry_type: :void)
514
+ # Some parameter documentations has been truncated, see
515
+ # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Void} for more
516
+ # details.
517
+ #
518
+ # @param amount [Float] The number of credits to effect. Note that this is required for increment, decre
519
+ #
520
+ # @param block_id [String] The ID of the block to void.
521
+ #
522
+ # @param currency [String, nil] The currency or custom pricing unit to use for this ledger entry. If this is a r
523
+ #
524
+ # @param description [String, nil] Optional metadata that can be specified when adding ledger results via the API.
525
+ #
526
+ # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
527
+ #
528
+ # @param void_reason [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Void::VoidReason, nil] Can only be specified when `entry_type=void`. The reason for the void.
529
+ #
530
+ # @param entry_type [Symbol, :void]
531
+
532
+ # Can only be specified when `entry_type=void`. The reason for the void.
533
+ #
534
+ # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Void#void_reason
535
+ module VoidReason
536
+ extend Orb::Internal::Type::Enum
537
+
538
+ REFUND = :refund
539
+
540
+ # @!method self.values
541
+ # @return [Array<Symbol>]
542
+ end
329
543
  end
330
- end
331
-
332
- # Can only be specified when `entry_type=void`. The reason for the void.
333
- module VoidReason
334
- extend Orb::Internal::Type::Enum
335
544
 
336
- REFUND = :refund
545
+ class Amendment < Orb::Internal::Type::BaseModel
546
+ # @!attribute amount
547
+ # The number of credits to effect. Note that this is required for increment,
548
+ # decrement or void operations.
549
+ #
550
+ # @return [Float]
551
+ required :amount, Float
552
+
553
+ # @!attribute block_id
554
+ # The ID of the block to reverse a decrement from.
555
+ #
556
+ # @return [String]
557
+ required :block_id, String
558
+
559
+ # @!attribute entry_type
560
+ #
561
+ # @return [Symbol, :amendment]
562
+ required :entry_type, const: :amendment
563
+
564
+ # @!attribute currency
565
+ # The currency or custom pricing unit to use for this ledger entry. If this is a
566
+ # real-world currency, it must match the customer's invoicing currency.
567
+ #
568
+ # @return [String, nil]
569
+ optional :currency, String, nil?: true
570
+
571
+ # @!attribute description
572
+ # Optional metadata that can be specified when adding ledger results via the API.
573
+ # For example, this can be used to note an increment refers to trial credits, or
574
+ # for noting corrections as a result of an incident, etc.
575
+ #
576
+ # @return [String, nil]
577
+ optional :description, String, nil?: true
578
+
579
+ # @!attribute metadata
580
+ # User-specified key/value pairs for the resource. Individual keys can be removed
581
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
582
+ # by setting `metadata` to `null`.
583
+ #
584
+ # @return [Hash{Symbol=>String, nil}, nil]
585
+ optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
586
+
587
+ # @!method initialize(amount:, block_id:, currency: nil, description: nil, metadata: nil, entry_type: :amendment)
588
+ # Some parameter documentations has been truncated, see
589
+ # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Amendment} for
590
+ # more details.
591
+ #
592
+ # @param amount [Float] The number of credits to effect. Note that this is required for increment, decre
593
+ #
594
+ # @param block_id [String] The ID of the block to reverse a decrement from.
595
+ #
596
+ # @param currency [String, nil] The currency or custom pricing unit to use for this ledger entry. If this is a r
597
+ #
598
+ # @param description [String, nil] Optional metadata that can be specified when adding ledger results via the API.
599
+ #
600
+ # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
601
+ #
602
+ # @param entry_type [Symbol, :amendment]
603
+ end
337
604
 
338
- # @!method self.values
339
- # @return [Array<Symbol>]
605
+ # @!method self.variants
606
+ # @return [Array(Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Increment, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Decrement, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Void, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Body::Amendment)]
340
607
  end
341
608
  end
342
609
  end