metronome-sdk 0.3.0 → 2.0.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 (363) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -0
  3. data/README.md +9 -9
  4. data/lib/metronome_sdk/errors.rb +25 -11
  5. data/lib/metronome_sdk/file_part.rb +10 -7
  6. data/lib/metronome_sdk/internal/body_cursor_page.rb +86 -0
  7. data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
  8. data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +86 -0
  9. data/lib/metronome_sdk/internal/transport/base_client.rb +12 -11
  10. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +8 -19
  11. data/lib/metronome_sdk/internal/type/base_model.rb +6 -13
  12. data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
  13. data/lib/metronome_sdk/internal/type/enum.rb +25 -0
  14. data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
  15. data/lib/metronome_sdk/internal/type/union.rb +11 -0
  16. data/lib/metronome_sdk/internal/util.rb +9 -8
  17. data/lib/metronome_sdk/models/base_threshold_commit.rb +36 -0
  18. data/lib/metronome_sdk/models/commit.rb +26 -170
  19. data/lib/metronome_sdk/models/commit_hierarchy_configuration.rb +98 -0
  20. data/lib/metronome_sdk/models/commit_rate.rb +48 -0
  21. data/lib/metronome_sdk/models/commit_specifier.rb +42 -0
  22. data/lib/metronome_sdk/models/commit_specifier_input.rb +42 -0
  23. data/lib/metronome_sdk/models/contract.rb +404 -0
  24. data/lib/metronome_sdk/models/contract_v2.rb +3169 -0
  25. data/lib/metronome_sdk/models/contract_without_amendments.rb +38 -1128
  26. data/lib/metronome_sdk/models/credit.rb +9 -156
  27. data/lib/metronome_sdk/models/discount.rb +2 -1
  28. data/lib/metronome_sdk/models/hierarchy_configuration.rb +173 -0
  29. data/lib/metronome_sdk/models/override.rb +6 -101
  30. data/lib/metronome_sdk/models/override_tier.rb +21 -0
  31. data/lib/metronome_sdk/models/overwrite_rate.rb +82 -0
  32. data/lib/metronome_sdk/models/payment_gate_config.rb +150 -0
  33. data/lib/metronome_sdk/models/payment_gate_config_v2.rb +150 -0
  34. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +100 -0
  35. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +102 -0
  36. data/lib/metronome_sdk/models/pro_service.rb +2 -1
  37. data/lib/metronome_sdk/models/recurring_commit_subscription_config.rb +51 -0
  38. data/lib/metronome_sdk/models/scheduled_charge.rb +2 -1
  39. data/lib/metronome_sdk/models/spend_threshold_configuration.rb +44 -0
  40. data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +44 -0
  41. data/lib/metronome_sdk/models/subscription.rb +311 -0
  42. data/lib/metronome_sdk/models/update_base_threshold_commit.rb +36 -0
  43. data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
  44. data/lib/metronome_sdk/models/v1/alert_create_params.rb +42 -42
  45. data/lib/metronome_sdk/models/v1/billable_metric_create_params.rb +1 -2
  46. data/lib/metronome_sdk/models/v1/billable_metric_list_response.rb +3 -3
  47. data/lib/metronome_sdk/models/v1/billable_metric_retrieve_response.rb +4 -7
  48. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +58 -411
  49. data/lib/metronome_sdk/models/v1/contract_create_historical_invoices_params.rb +7 -16
  50. data/lib/metronome_sdk/models/v1/contract_create_params.rb +315 -1459
  51. data/lib/metronome_sdk/models/v1/contract_list_balances_response.rb +6 -23
  52. data/lib/metronome_sdk/models/v1/contract_list_response.rb +3 -1153
  53. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_params.rb +2 -6
  54. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rb +5 -50
  55. data/lib/metronome_sdk/models/v1/contract_retrieve_response.rb +3 -1154
  56. data/lib/metronome_sdk/models/v1/contract_schedule_pro_services_invoice_params.rb +1 -3
  57. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +2 -1
  58. data/lib/metronome_sdk/models/v1/contracts/product_list_response.rb +8 -1
  59. data/lib/metronome_sdk/models/v1/contracts/product_retrieve_response.rb +8 -1
  60. data/lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb +1 -4
  61. data/lib/metronome_sdk/models/v1/contracts/rate_card_create_params.rb +4 -7
  62. data/lib/metronome_sdk/models/v1/contracts/rate_card_list_response.rb +10 -1
  63. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_params.rb +2 -6
  64. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rb +5 -50
  65. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rb +10 -1
  66. data/lib/metronome_sdk/models/v1/contracts/rate_card_update_params.rb +1 -3
  67. data/lib/metronome_sdk/models/v1/contracts/rate_cards/product_order_update_params.rb +1 -3
  68. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rb +6 -61
  69. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +3 -49
  70. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +4 -51
  71. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_params.rb +2 -6
  72. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rb +5 -49
  73. data/lib/metronome_sdk/models/v1/credit_grant_list_entries_response.rb +103 -123
  74. data/lib/metronome_sdk/models/v1/credit_grant_list_response.rb +3 -5
  75. data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +1 -3
  76. data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +41 -58
  77. data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +5 -1
  78. data/lib/metronome_sdk/models/v1/customer.rb +2 -1
  79. data/lib/metronome_sdk/models/v1/customer_create_params.rb +37 -11
  80. data/lib/metronome_sdk/models/v1/customer_detail.rb +11 -2
  81. data/lib/metronome_sdk/models/v1/customer_list_billable_metrics_response.rb +3 -3
  82. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +6 -18
  83. data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
  84. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rb +28 -0
  85. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +128 -0
  86. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +143 -0
  87. data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +4 -6
  88. data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
  89. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +37 -8
  90. data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +2 -0
  91. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +2 -0
  92. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +10 -60
  93. data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +6 -48
  94. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +48 -54
  95. data/lib/metronome_sdk/models/v1/customers/invoice.rb +197 -66
  96. data/lib/metronome_sdk/models/v1/customers/invoice_list_breakdowns_params.rb +1 -4
  97. data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
  98. data/lib/metronome_sdk/models/v1/customers/plan_add_params.rb +2 -6
  99. data/lib/metronome_sdk/models/v1/customers/plan_list_response.rb +2 -1
  100. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +4 -11
  101. data/lib/metronome_sdk/models/v1/payment.rb +151 -0
  102. data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
  103. data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
  104. data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
  105. data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
  106. data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
  107. data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
  108. data/lib/metronome_sdk/models/v1/plan_detail.rb +9 -5
  109. data/lib/metronome_sdk/models/v1/plan_list_charges_response.rb +2 -1
  110. data/lib/metronome_sdk/models/v1/plan_list_customers_response.rb +2 -1
  111. data/lib/metronome_sdk/models/v1/plan_list_response.rb +5 -1
  112. data/lib/metronome_sdk/models/v1/usage_ingest_params.rb +1 -4
  113. data/lib/metronome_sdk/models/v1/usage_list_params.rb +1 -3
  114. data/lib/metronome_sdk/models/v1/usage_list_response.rb +45 -62
  115. data/lib/metronome_sdk/models/v1/usage_search_response.rb +4 -7
  116. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +37 -58
  117. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +34 -49
  118. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +552 -2265
  119. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +417 -2317
  120. data/lib/metronome_sdk/models/v2/contract_list_response.rb +3 -4520
  121. data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +3 -4528
  122. data/lib/metronome_sdk/models.rb +38 -0
  123. data/lib/metronome_sdk/resources/v1/alerts.rb +90 -16
  124. data/lib/metronome_sdk/resources/v1/audit_logs.rb +39 -4
  125. data/lib/metronome_sdk/resources/v1/billable_metrics.rb +54 -4
  126. data/lib/metronome_sdk/resources/v1/contracts/products.rb +25 -6
  127. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rb +7 -2
  128. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +10 -2
  129. data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +109 -10
  130. data/lib/metronome_sdk/resources/v1/contracts.rb +255 -18
  131. data/lib/metronome_sdk/resources/v1/credit_grants.rb +2 -1
  132. data/lib/metronome_sdk/resources/v1/custom_fields.rb +51 -14
  133. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +127 -13
  134. data/lib/metronome_sdk/resources/v1/customers/commits.rb +119 -9
  135. data/lib/metronome_sdk/resources/v1/customers/credits.rb +104 -8
  136. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +179 -8
  137. data/lib/metronome_sdk/resources/v1/customers.rb +175 -15
  138. data/lib/metronome_sdk/resources/v1/dashboards.rb +29 -3
  139. data/lib/metronome_sdk/resources/v1/invoices.rb +23 -2
  140. data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
  141. data/lib/metronome_sdk/resources/v1/pricing_units.rb +6 -1
  142. data/lib/metronome_sdk/resources/v1/services.rb +6 -4
  143. data/lib/metronome_sdk/resources/v1/usage.rb +188 -13
  144. data/lib/metronome_sdk/resources/v1.rb +4 -0
  145. data/lib/metronome_sdk/resources/v2/contracts.rb +120 -18
  146. data/lib/metronome_sdk/version.rb +1 -1
  147. data/lib/metronome_sdk.rb +33 -3
  148. data/rbi/metronome_sdk/errors.rbi +31 -4
  149. data/rbi/metronome_sdk/file_part.rbi +1 -1
  150. data/rbi/metronome_sdk/internal/body_cursor_page.rbi +22 -0
  151. data/rbi/metronome_sdk/internal/cursor_page_without_limit.rbi +22 -0
  152. data/rbi/metronome_sdk/internal/transport/base_client.rbi +4 -5
  153. data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
  154. data/rbi/metronome_sdk/internal/util.rbi +1 -1
  155. data/rbi/metronome_sdk/models/base_threshold_commit.rbi +58 -0
  156. data/rbi/metronome_sdk/models/commit.rbi +26 -348
  157. data/rbi/metronome_sdk/models/commit_hierarchy_configuration.rbi +280 -0
  158. data/rbi/metronome_sdk/models/commit_rate.rbi +85 -0
  159. data/rbi/metronome_sdk/models/commit_specifier.rbi +71 -0
  160. data/rbi/metronome_sdk/models/commit_specifier_input.rbi +74 -0
  161. data/rbi/metronome_sdk/models/contract.rbi +768 -0
  162. data/rbi/metronome_sdk/models/contract_v2.rbi +6415 -0
  163. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +186 -2509
  164. data/rbi/metronome_sdk/models/credit.rbi +10 -348
  165. data/rbi/metronome_sdk/models/discount.rbi +2 -0
  166. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +424 -0
  167. data/rbi/metronome_sdk/models/override.rbi +8 -193
  168. data/rbi/metronome_sdk/models/override_tier.rbi +29 -0
  169. data/rbi/metronome_sdk/models/overwrite_rate.rbi +137 -0
  170. data/rbi/metronome_sdk/models/payment_gate_config.rbi +317 -0
  171. data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +326 -0
  172. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +183 -0
  173. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +188 -0
  174. data/rbi/metronome_sdk/models/pro_service.rbi +2 -0
  175. data/rbi/metronome_sdk/models/recurring_commit_subscription_config.rbi +125 -0
  176. data/rbi/metronome_sdk/models/scheduled_charge.rbi +2 -0
  177. data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +76 -0
  178. data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -0
  179. data/rbi/metronome_sdk/models/subscription.rbi +635 -0
  180. data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +61 -0
  181. data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
  182. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +57 -50
  183. data/rbi/metronome_sdk/models/v1/billable_metric_list_response.rbi +2 -0
  184. data/rbi/metronome_sdk/models/v1/billable_metric_retrieve_response.rbi +2 -0
  185. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +49 -768
  186. data/rbi/metronome_sdk/models/v1/contract_create_historical_invoices_params.rbi +2 -0
  187. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1843 -4119
  188. data/rbi/metronome_sdk/models/v1/contract_list_balances_response.rbi +8 -59
  189. data/rbi/metronome_sdk/models/v1/contract_list_response.rbi +5 -2420
  190. data/rbi/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbi +6 -129
  191. data/rbi/metronome_sdk/models/v1/contract_retrieve_response.rbi +4 -2419
  192. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +2 -0
  193. data/rbi/metronome_sdk/models/v1/contracts/product_list_response.rbi +2 -0
  194. data/rbi/metronome_sdk/models/v1/contracts/product_retrieve_response.rbi +2 -0
  195. data/rbi/metronome_sdk/models/v1/contracts/rate_card_create_params.rbi +2 -0
  196. data/rbi/metronome_sdk/models/v1/contracts/rate_card_list_response.rbi +2 -0
  197. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbi +6 -129
  198. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rbi +2 -0
  199. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbi +4 -129
  200. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +4 -129
  201. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +4 -129
  202. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbi +6 -129
  203. data/rbi/metronome_sdk/models/v1/credit_grant_list_entries_response.rbi +147 -198
  204. data/rbi/metronome_sdk/models/v1/credit_grant_list_response.rbi +2 -0
  205. data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +117 -165
  206. data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +8 -1
  207. data/rbi/metronome_sdk/models/v1/customer.rbi +2 -0
  208. data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +88 -3
  209. data/rbi/metronome_sdk/models/v1/customer_detail.rbi +10 -0
  210. data/rbi/metronome_sdk/models/v1/customer_list_billable_metrics_response.rbi +2 -0
  211. data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
  212. data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
  213. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbi +51 -0
  214. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +265 -0
  215. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +348 -0
  216. data/rbi/metronome_sdk/models/v1/customers/alert_list_params.rbi +4 -4
  217. data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
  218. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +68 -8
  219. data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +10 -0
  220. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +10 -0
  221. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +6 -90
  222. data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +6 -90
  223. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +54 -47
  224. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +316 -68
  225. data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
  226. data/rbi/metronome_sdk/models/v1/customers/plan_list_response.rbi +2 -0
  227. data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
  228. data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
  229. data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
  230. data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
  231. data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
  232. data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
  233. data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
  234. data/rbi/metronome_sdk/models/v1/plan_detail.rbi +2 -0
  235. data/rbi/metronome_sdk/models/v1/plan_list_charges_response.rbi +2 -0
  236. data/rbi/metronome_sdk/models/v1/plan_list_customers_response.rbi +2 -0
  237. data/rbi/metronome_sdk/models/v1/plan_list_response.rbi +8 -1
  238. data/rbi/metronome_sdk/models/v1/usage_list_response.rbi +45 -86
  239. data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +2 -0
  240. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +74 -76
  241. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +74 -76
  242. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +3875 -7234
  243. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1733 -6207
  244. data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +5 -9867
  245. data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +6 -9866
  246. data/rbi/metronome_sdk/models.rbi +44 -0
  247. data/rbi/metronome_sdk/resources/v1/alerts.rbi +101 -27
  248. data/rbi/metronome_sdk/resources/v1/audit_logs.rbi +39 -4
  249. data/rbi/metronome_sdk/resources/v1/billable_metrics.rbi +54 -4
  250. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +25 -5
  251. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rbi +7 -2
  252. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +10 -3
  253. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +109 -9
  254. data/rbi/metronome_sdk/resources/v1/contracts.rbi +258 -16
  255. data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +5 -1
  256. data/rbi/metronome_sdk/resources/v1/custom_fields.rbi +57 -14
  257. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +133 -11
  258. data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +119 -10
  259. data/rbi/metronome_sdk/resources/v1/customers/credits.rbi +104 -9
  260. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +159 -7
  261. data/rbi/metronome_sdk/resources/v1/customers.rbi +162 -14
  262. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +29 -3
  263. data/rbi/metronome_sdk/resources/v1/invoices.rbi +23 -2
  264. data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
  265. data/rbi/metronome_sdk/resources/v1/pricing_units.rbi +6 -1
  266. data/rbi/metronome_sdk/resources/v1/services.rbi +6 -4
  267. data/rbi/metronome_sdk/resources/v1/usage.rbi +191 -13
  268. data/rbi/metronome_sdk/resources/v1.rbi +3 -0
  269. data/rbi/metronome_sdk/resources/v2/contracts.rbi +134 -23
  270. data/sig/metronome_sdk/errors.rbs +7 -0
  271. data/sig/metronome_sdk/file_part.rbs +1 -1
  272. data/sig/metronome_sdk/internal/body_cursor_page.rbs +13 -0
  273. data/sig/metronome_sdk/internal/cursor_page_without_limit.rbs +13 -0
  274. data/sig/metronome_sdk/models/base_threshold_commit.rbs +26 -0
  275. data/sig/metronome_sdk/models/commit.rbs +17 -170
  276. data/sig/metronome_sdk/models/commit_hierarchy_configuration.rbs +117 -0
  277. data/sig/metronome_sdk/models/commit_rate.rbs +48 -0
  278. data/sig/metronome_sdk/models/commit_specifier.rbs +47 -0
  279. data/sig/metronome_sdk/models/commit_specifier_input.rbs +47 -0
  280. data/sig/metronome_sdk/models/contract.rbs +398 -0
  281. data/sig/metronome_sdk/models/contract_v2.rbs +3108 -0
  282. data/sig/metronome_sdk/models/contract_without_amendments.rbs +54 -976
  283. data/sig/metronome_sdk/models/credit.rbs +12 -170
  284. data/sig/metronome_sdk/models/hierarchy_configuration.rbs +152 -0
  285. data/sig/metronome_sdk/models/override.rbs +12 -101
  286. data/sig/metronome_sdk/models/override_tier.rbs +17 -0
  287. data/sig/metronome_sdk/models/overwrite_rate.rbs +78 -0
  288. data/sig/metronome_sdk/models/payment_gate_config.rbs +124 -0
  289. data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +124 -0
  290. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +82 -0
  291. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +82 -0
  292. data/sig/metronome_sdk/models/recurring_commit_subscription_config.rbs +51 -0
  293. data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +35 -0
  294. data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +35 -0
  295. data/sig/metronome_sdk/models/subscription.rbs +295 -0
  296. data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +28 -0
  297. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +4 -2
  298. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +26 -341
  299. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +219 -1184
  300. data/sig/metronome_sdk/models/v1/contract_list_balances_response.rbs +4 -25
  301. data/sig/metronome_sdk/models/v1/contract_list_response.rbs +4 -1041
  302. data/sig/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbs +6 -54
  303. data/sig/metronome_sdk/models/v1/contract_retrieve_response.rbs +4 -1041
  304. data/sig/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbs +6 -54
  305. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbs +6 -54
  306. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +6 -54
  307. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +6 -54
  308. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbs +6 -54
  309. data/sig/metronome_sdk/models/v1/credit_grant_list_entries_response.rbs +72 -94
  310. data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +53 -75
  311. data/sig/metronome_sdk/models/v1/customer_create_params.rbs +31 -4
  312. data/sig/metronome_sdk/models/v1/customer_detail.rbs +5 -0
  313. data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
  314. data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -4
  315. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbs +32 -0
  316. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +113 -0
  317. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +133 -0
  318. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +21 -0
  319. data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +7 -1
  320. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +6 -1
  321. data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +6 -50
  322. data/sig/metronome_sdk/models/v1/customers/credit_create_params.rbs +6 -50
  323. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +4 -2
  324. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +137 -24
  325. data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
  326. data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
  327. data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
  328. data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
  329. data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
  330. data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
  331. data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
  332. data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
  333. data/sig/metronome_sdk/models/v1/usage_list_response.rbs +33 -55
  334. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +28 -43
  335. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +28 -43
  336. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +412 -1793
  337. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +342 -2149
  338. data/sig/metronome_sdk/models/v2/contract_list_response.rbs +4 -4426
  339. data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +4 -4426
  340. data/sig/metronome_sdk/models.rbs +38 -0
  341. data/sig/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbs +1 -1
  342. data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -3
  343. data/sig/metronome_sdk/resources/v1/credit_grants.rbs +1 -1
  344. data/sig/metronome_sdk/resources/v1/custom_fields.rbs +1 -1
  345. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +2 -1
  346. data/sig/metronome_sdk/resources/v1/customers/commits.rbs +2 -2
  347. data/sig/metronome_sdk/resources/v1/customers/credits.rbs +2 -2
  348. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
  349. data/sig/metronome_sdk/resources/v1/customers.rbs +11 -0
  350. data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
  351. data/sig/metronome_sdk/resources/v1/usage.rbs +1 -1
  352. data/sig/metronome_sdk/resources/v1.rbs +2 -0
  353. data/sig/metronome_sdk/resources/v2/contracts.rbs +10 -4
  354. metadata +101 -11
  355. data/lib/metronome_sdk/models/v1/customers/alert_list_response.rb +0 -29
  356. data/lib/metronome_sdk/models/v1/customers/commit_list_response.rb +0 -26
  357. data/lib/metronome_sdk/models/v1/customers/credit_list_response.rb +0 -26
  358. data/rbi/metronome_sdk/models/v1/customers/alert_list_response.rbi +0 -46
  359. data/rbi/metronome_sdk/models/v1/customers/commit_list_response.rbi +0 -45
  360. data/rbi/metronome_sdk/models/v1/customers/credit_list_response.rbi +0 -45
  361. data/sig/metronome_sdk/models/v1/customers/alert_list_response.rbs +0 -29
  362. data/sig/metronome_sdk/models/v1/customers/commit_list_response.rbs +0 -26
  363. data/sig/metronome_sdk/models/v1/customers/credit_list_response.rbs +0 -26
@@ -8,16 +8,71 @@ module MetronomeSDK
8
8
  # Some parameter documentations has been truncated, see
9
9
  # {MetronomeSDK::Models::V1::Customers::AlertRetrieveParams} for more details.
10
10
  #
11
- # Get the customer alert status and alert information for the specified customer
12
- # and alert
13
- #
14
- # @overload retrieve(alert_id:, customer_id:, plans_or_contracts: nil, request_options: {})
15
- #
16
- # @param alert_id [String] The Metronome ID of the alert
11
+ # Retrieve the real-time evaluation status for a specific threshold
12
+ # notification-customer pair. This endpoint provides instant visibility into
13
+ # whether a customer has triggered a threshold notification condition, enabling
14
+ # you to monitor account health and take proactive action based on current
15
+ # threshold notification states.
16
+ #
17
+ # ### Use this endpoint to:
18
+ #
19
+ # - Check if a specific customer is currently violating an threshold notification
20
+ # (`in_alarm` status)
21
+ # - Verify threshold notification configuration details and threshold values for a
22
+ # customer
23
+ # - Monitor the evaluation state of newly created or recently modified threshold
24
+ # notification
25
+ # - Build dashboards or automated workflows that respond to specific threshold
26
+ # notification conditions
27
+ # - Validate threshold notification behavior before deploying to production
28
+ # customers
29
+ # - Integrate threshold notification status checks into customer support tools or
30
+ # admin interfaces
31
+ #
32
+ # ### Key response fields:
33
+ #
34
+ # A CustomerAlert object containing:
35
+ #
36
+ # - `customer_status`: The current evaluation state
37
+ #
38
+ # - `ok` - Customer is within acceptable thresholds
39
+ # - `in_alarm` - Customer has breached the threshold for the notification
40
+ # - `evaluating` - Notification is currently being evaluated (typically during
41
+ # initial setup)
42
+ # - `null` - Notification has been archived
43
+ # - `triggered_by`: Additional context about what caused the notification to
44
+ # trigger (when applicable)
45
+ # - alert: Complete threshold notification configuration including:
46
+ # - Notification ID, name, and type
47
+ # - Current threshold values and credit type information
48
+ # - Notification status (enabled, disabled, or archived)
49
+ # - Last update timestamp
50
+ # - Any applied filters (credit grant types, custom fields, group values)
51
+ #
52
+ # ### Usage guidelines:
53
+ #
54
+ # - Customer status: Returns the current evaluation state, not historical data.
55
+ # For threshold notification history, use webhook notifications or event logs
56
+ # - Required parameters: Both customer_id and alert_id must be valid UUIDs that
57
+ # exist in your organization
58
+ # - Archived notifications: Returns null for customer_status if the notification
59
+ # has been archived, but still includes the notification configuration details
60
+ # - Performance considerations: This endpoint queries live evaluation state,
61
+ # making it ideal for real-time monitoring but not for bulk status checks
62
+ # - Integration patterns: Best used for on-demand status checks in response to
63
+ # user actions or as part of targeted monitoring workflows
64
+ # - Error handling: Returns 404 if either the customer or alert_id doesn't exist
65
+ # or isn't accessible to your organization
66
+ #
67
+ # @overload retrieve(alert_id:, customer_id:, group_values: nil, plans_or_contracts: nil, request_options: {})
68
+ #
69
+ # @param alert_id [String] The Metronome ID of the threshold notification
17
70
  #
18
71
  # @param customer_id [String] The Metronome ID of the customer
19
72
  #
20
- # @param plans_or_contracts [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts] When parallel alerts are enabled during migration, this flag denotes whether to
73
+ # @param group_values [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>] Only present for `spend_threshold_reached` notifications. Retrieve the notificat
74
+ #
75
+ # @param plans_or_contracts [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts] When parallel threshold notifications are enabled during migration, this flag de
21
76
  #
22
77
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
23
78
  #
@@ -38,7 +93,37 @@ module MetronomeSDK
38
93
  # Some parameter documentations has been truncated, see
39
94
  # {MetronomeSDK::Models::V1::Customers::AlertListParams} for more details.
40
95
  #
41
- # Fetch all customer alert statuses and alert information for a customer
96
+ # Retrieve all threshold notification configurations and their current statuses
97
+ # for a specific customer in a single API call. This endpoint provides a
98
+ # comprehensive view of all threshold notification monitoring a customer account.
99
+ #
100
+ # ### Use this endpoint to:
101
+ #
102
+ # - Display all active threshold notifications for a customer in dashboards or
103
+ # admin panels
104
+ # - Quickly identify which threshold notifications a customer is currently
105
+ # triggering
106
+ # - Audit threshold notification coverage for specific accounts
107
+ # - Filter threshold notifications by status (enabled, disabled, or archived)
108
+ #
109
+ # ### Key response fields:
110
+ #
111
+ # - data: Array of CustomerAlert objects, each containing:
112
+ # - Current evaluation status (`ok`, `in_alarm`, `evaluating`, or `null`)
113
+ # - Complete threshold notification configuration and threshold details
114
+ # - Threshold notification metadata including type, name, and last update time
115
+ # - next_page: Pagination cursor for retrieving additional results
116
+ #
117
+ # ### Usage guidelines:
118
+ #
119
+ # - Default behavior: Returns only enabled threshold notifications unless
120
+ # `alert_statuses` filter is specified
121
+ # - Pagination: Use the `next_page` cursor to retrieve all results for customers
122
+ # with many notifications
123
+ # - Performance: Efficiently retrieves multiple threshold notification statuses in
124
+ # a single request instead of making individual calls
125
+ # - Filtering: Pass the `alert_statuses` array to include disabled or archived
126
+ # threshold notifications in results
42
127
  #
43
128
  # @overload list(customer_id:, next_page: nil, alert_statuses: nil, request_options: {})
44
129
  #
@@ -46,11 +131,11 @@ module MetronomeSDK
46
131
  #
47
132
  # @param next_page [String] Query param: Cursor that indicates where the next page of results should start.
48
133
  #
49
- # @param alert_statuses [Array<Symbol, MetronomeSDK::Models::V1::Customers::AlertListParams::AlertStatus>] Body param: Optionally filter by alert status. If absent, only enabled alerts wi
134
+ # @param alert_statuses [Array<Symbol, MetronomeSDK::Models::V1::Customers::AlertListParams::AlertStatus>] Body param: Optionally filter by threshold notification status. If absent, only
50
135
  #
51
136
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
52
137
  #
53
- # @return [MetronomeSDK::Models::V1::Customers::AlertListResponse]
138
+ # @return [MetronomeSDK::Internal::CursorPageWithoutLimit<MetronomeSDK::Models::V1::Customers::CustomerAlert>]
54
139
  #
55
140
  # @see MetronomeSDK::Models::V1::Customers::AlertListParams
56
141
  def list(params)
@@ -61,16 +146,45 @@ module MetronomeSDK
61
146
  path: "v1/customer-alerts/list",
62
147
  query: parsed.slice(*query_params),
63
148
  body: parsed.except(*query_params),
64
- model: MetronomeSDK::Models::V1::Customers::AlertListResponse,
149
+ page: MetronomeSDK::Internal::CursorPageWithoutLimit,
150
+ model: MetronomeSDK::V1::Customers::CustomerAlert,
65
151
  options: options
66
152
  )
67
153
  end
68
154
 
69
- # Reset state for an alert by customer id and force re-evaluation
155
+ # Force an immediate re-evaluation of a specific threshold notification for a
156
+ # customer, clearing any previous state and triggering a fresh assessment against
157
+ # current thresholds. This endpoint ensures threshold notification accuracy after
158
+ # configuration changes or data corrections.
159
+ #
160
+ # ### Use this endpoint to:
161
+ #
162
+ # - Clear false positive threshold notifications after fixing data issues
163
+ # - Re-evaluate threshold notifications after adjusting customer balances or
164
+ # credits
165
+ # - Test threshold notification behavior during development and debugging
166
+ # - Resolve stuck threshold notification that may be in an incorrect state
167
+ # - Trigger immediate evaluation after threshold modifications
168
+ #
169
+ # ### Key response fields:
170
+ #
171
+ # - 200 Success: Confirmation that the threshold notification has been reset and
172
+ # re-evaluation initiated
173
+ # - No response body is returned - the operation completes asynchronously
174
+ #
175
+ # ### Usage guidelines:
176
+ #
177
+ # - Immediate effect: Triggers re-evaluation instantly, which may result in new
178
+ # webhook notifications if thresholds are breached
179
+ # - State clearing: Removes any cached evaluation state, ensuring a fresh
180
+ # assessment
181
+ # - Use sparingly: Intended for exceptional cases, not routine operations
182
+ # - Asynchronous processing: The reset completes immediately, but re-evaluation
183
+ # happens in the background
70
184
  #
71
185
  # @overload reset(alert_id:, customer_id:, request_options: {})
72
186
  #
73
- # @param alert_id [String] The Metronome ID of the alert
187
+ # @param alert_id [String] The Metronome ID of the threshold notification
74
188
  #
75
189
  # @param customer_id [String] The Metronome ID of the customer
76
190
  #
@@ -8,7 +8,68 @@ module MetronomeSDK
8
8
  # Some parameter documentations has been truncated, see
9
9
  # {MetronomeSDK::Models::V1::Customers::CommitCreateParams} for more details.
10
10
  #
11
- # Create a new commit at the customer level.
11
+ # Creates customer-level commits that establish spending commitments for customers
12
+ # across their Metronome usage. Commits represent contracted spending obligations
13
+ # that can be either prepaid (paid upfront) or postpaid (billed later).
14
+ #
15
+ # Note: In most cases, you should add commitments directly to customer contracts
16
+ # using the contract/create or contract/edit APIs.
17
+ #
18
+ # ### Use this endpoint to:
19
+ #
20
+ # Use this endpoint when you need to establish customer-level spending commitments
21
+ # that can be applied across multiple contracts or scoped to specific contracts.
22
+ # Customer-level commits are ideal for:
23
+ #
24
+ # - Enterprise-wide minimum spending agreements that span multiple contracts
25
+ # - Multi-contract volume commitments with shared spending pools
26
+ # - Cross-contract discount tiers based on aggregate usage
27
+ #
28
+ # #### Commit type Requirements:
29
+ #
30
+ # - You must specify either "prepaid" or "postpaid" as the commit type:
31
+ # - Prepaid commits: Customer pays upfront; invoice_schedule is optional (if
32
+ # omitted, creates a commit without an invoice)
33
+ # - Postpaid commits: Customer pays when the commitment expires (the end of the
34
+ # access_schedule); invoice_schedule is required and must match access_schedule
35
+ # totals.
36
+ #
37
+ # #### Billing configuration:
38
+ #
39
+ # - invoice_contract_id is required for postpaid commits and for prepaid commits
40
+ # with billing (only optional for free prepaid commits)
41
+ # - For postpaid commits: access_schedule and invoice_schedule must have matching
42
+ # amounts
43
+ # - For postpaid commits: only one schedule item is allowed in both schedules.
44
+ #
45
+ # #### Scoping flexibility:
46
+ #
47
+ # Customer-level commits can be configured in a few ways:
48
+ #
49
+ # - Contract-specific: Use the `applicable_contract_ids` field to limit the commit
50
+ # to specific contracts
51
+ # - Cross-contract: Leave `applicable_contract_ids` empty to allow the commit to
52
+ # be used across all of the customer's contracts
53
+ #
54
+ # #### Product targeting:
55
+ #
56
+ # Commits can be scoped to specific products using applicable_product_ids,
57
+ # applicable_product_tags, or specifiers, or left unrestricted to apply to all
58
+ # products.
59
+ #
60
+ # #### Priority considerations:
61
+ #
62
+ # When multiple commits are applicable, the one with the lower priority value will
63
+ # be consumed first. If there is a tie, contract level commits and credits will be
64
+ # applied before customer level commits and credits. Plan your priority scheme
65
+ # carefully to ensure commits are applied in the desired order.
66
+ #
67
+ # ### Usage guidelines:
68
+ #
69
+ # ⚠️ Preferred Alternative: In most cases, you should add commits directly to
70
+ # contracts using the create contract or edit contract APIs instead of creating
71
+ # customer-level commits. Contract-level commits provide better organization and
72
+ # are the recommended approach for standard use cases.
12
73
  #
13
74
  # @overload create(access_schedule:, customer_id:, priority:, product_id:, type:, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, invoice_contract_id: nil, invoice_schedule: nil, name: nil, netsuite_sales_order_id: nil, rate_type: nil, salesforce_opportunity_id: nil, specifiers: nil, uniqueness_key: nil, request_options: {})
14
75
  #
@@ -28,7 +89,7 @@ module MetronomeSDK
28
89
  #
29
90
  # @param applicable_product_tags [Array<String>] Which tags the commit applies to. If applicable*product_ids, applicable_product*
30
91
  #
31
- # @param custom_fields [Hash{Symbol=>String}]
92
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
32
93
  #
33
94
  # @param description [String] Used only in UI/API. It is not exposed to end customers.
34
95
  #
@@ -44,7 +105,7 @@ module MetronomeSDK
44
105
  #
45
106
  # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
46
107
  #
47
- # @param specifiers [Array<MetronomeSDK::Models::V1::Customers::CommitCreateParams::Specifier>] List of filters that determine what kind of customer usage draws down a commit o
108
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
48
109
  #
49
110
  # @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a commit or credit i
50
111
  #
@@ -67,7 +128,49 @@ module MetronomeSDK
67
128
  # Some parameter documentations has been truncated, see
68
129
  # {MetronomeSDK::Models::V1::Customers::CommitListParams} for more details.
69
130
  #
70
- # List commits.
131
+ # Retrieve all commit agreements for a customer, including both prepaid and
132
+ # postpaid commitments. This endpoint provides comprehensive visibility into
133
+ # contractual spending obligations, enabling you to track commitment utilization
134
+ # and manage customer contracts effectively.
135
+ #
136
+ # ### Use this endpoint to:
137
+ #
138
+ # - Display commitment balances and utilization in customer dashboards
139
+ # - Track prepaid commitment drawdown and remaining balances
140
+ # - Monitor postpaid commitment progress toward minimum thresholds
141
+ # - Build commitment tracking and forecasting tools
142
+ # - Show commitment history with optional ledger details
143
+ # - Manage rollover balances between contract periods
144
+ #
145
+ # ### Key response fields:
146
+ #
147
+ # An array of Commit objects containing:
148
+ #
149
+ # - Commit type: PREPAID (pay upfront) or POSTPAID (pay at true-up)
150
+ # - Rate type: COMMIT_RATE (discounted) or LIST_RATE (standard pricing)
151
+ # - Access schedule: When commitment funds become available
152
+ # - Invoice schedule: When the customer is billed
153
+ # - Product targeting: Which product(s) usage is eligible to draw from this commit
154
+ # - Optional ledger entries: Transaction history (if `include_ledgers=true`)
155
+ # - Balance information: Current available amount (if `include_balance=true`)
156
+ # - Rollover settings: Fraction of unused amount that carries forward
157
+ #
158
+ # ### Usage guidelines:
159
+ #
160
+ # - Pagination: Results limited to 25 commits per page; use 'next_page' for more
161
+ # - Date filtering options:
162
+ # - `covering_date`: Commits active on a specific date
163
+ # - `starting_at`: Commits with access on/after a date
164
+ # - `effective_before`: Commits with access before a date (exclusive)
165
+ # - Scope options:
166
+ # - `include_contract_commits`: Include contract-level commits (not just
167
+ # customer-level)
168
+ # - `include_archived`: Include archived commits and commits from archived
169
+ # contracts
170
+ # - Performance considerations:
171
+ # - include_ledgers: Adds detailed transaction history (slower)
172
+ # - include_balance: Adds current balance calculation (slower)
173
+ # - Optional filtering: Use commit_id to retrieve a specific commit
71
174
  #
72
175
  # @overload list(customer_id:, commit_id: nil, covering_date: nil, effective_before: nil, include_archived: nil, include_balance: nil, include_contract_commits: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
73
176
  #
@@ -95,7 +198,7 @@ module MetronomeSDK
95
198
  #
96
199
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
97
200
  #
98
- # @return [MetronomeSDK::Models::V1::Customers::CommitListResponse]
201
+ # @return [MetronomeSDK::Internal::BodyCursorPage<MetronomeSDK::Models::Commit>]
99
202
  #
100
203
  # @see MetronomeSDK::Models::V1::Customers::CommitListParams
101
204
  def list(params)
@@ -104,7 +207,8 @@ module MetronomeSDK
104
207
  method: :post,
105
208
  path: "v1/contracts/customerCommits/list",
106
209
  body: parsed,
107
- model: MetronomeSDK::Models::V1::Customers::CommitListResponse,
210
+ page: MetronomeSDK::Internal::BodyCursorPage,
211
+ model: MetronomeSDK::Commit,
108
212
  options: options
109
213
  )
110
214
  end
@@ -113,9 +217,15 @@ module MetronomeSDK
113
217
  # {MetronomeSDK::Models::V1::Customers::CommitUpdateEndDateParams} for more
114
218
  # details.
115
219
  #
116
- # Pull forward the end date of a prepaid commit. Use the "edit a commit" endpoint
117
- # to extend the end date of a prepaid commit, or to make other edits to the
118
- # commit.
220
+ # Shortens the end date of a prepaid commit to terminate it earlier than
221
+ # originally scheduled. Use this endpoint when you need to cancel or reduce the
222
+ # duration of an existing prepaid commit. Only works with prepaid commit types and
223
+ # can only move the end date forward (earlier), not extend it.
224
+ #
225
+ # ### Usage guidelines:
226
+ #
227
+ # To extend commit end dates or make other comprehensive edits, use the 'edit
228
+ # commit' endpoint instead.
119
229
  #
120
230
  # @overload update_end_date(commit_id:, customer_id:, access_ending_before: nil, invoices_ending_before: nil, request_options: {})
121
231
  #
@@ -8,7 +8,55 @@ module MetronomeSDK
8
8
  # Some parameter documentations has been truncated, see
9
9
  # {MetronomeSDK::Models::V1::Customers::CreditCreateParams} for more details.
10
10
  #
11
- # Create a new credit at the customer level.
11
+ # Creates customer-level credits that provide spending allowances or free credit
12
+ # balances for customers across their Metronome usage. Note: In most cases, you
13
+ # should add credits directly to customer contracts using the contract/create or
14
+ # contract/edit APIs.
15
+ #
16
+ # ### Use this endpoint to:
17
+ #
18
+ # Use this endpoint when you need to provision credits directly at the customer
19
+ # level that can be applied across multiple contracts or scoped to specific
20
+ # contracts. Customer-level credits are ideal for:
21
+ #
22
+ # - Customer onboarding incentives that apply globally
23
+ # - Flexible spending allowances that aren't tied to a single contract
24
+ # - Migration scenarios where you need to preserve existing customer balances
25
+ #
26
+ # #### Scoping flexibility:
27
+ #
28
+ # Customer-level credits can be configured in two ways:
29
+ #
30
+ # - Contract-specific: Use the applicable_contract_ids field to limit the credit
31
+ # to specific contracts
32
+ # - Cross-contract: Leave applicable_contract_ids empty to allow the credit to be
33
+ # used across all of the customer's contracts
34
+ #
35
+ # #### Product Targeting:
36
+ #
37
+ # Credits can be scoped to specific products using `applicable_product_ids` or
38
+ # `applicable_product_tags`, or left unrestricted to apply to all products.
39
+ #
40
+ # #### Priority considerations:
41
+ #
42
+ # When multiple credits are applicable, the one with the lower priority value will
43
+ # be consumed first. If there is a tie, contract level commits and credits will be
44
+ # applied before customer level commits and credits. Plan your priority scheme
45
+ # carefully to ensure credits are applied in the desired order.
46
+ #
47
+ # #### Access Schedule Required:
48
+ #
49
+ # You must provide an `access_schedule` that defines when and how much credit
50
+ # becomes available to the customer over time. This usually is aligned to the
51
+ # contract schedule or starts immediately and is set to expire in the future.
52
+ #
53
+ # ### Usage Guidelines:
54
+ #
55
+ # ⚠️ Preferred Alternative: In most cases, you should add credits directly to
56
+ # contracts using the contract/create or contract/edit APIs instead of creating
57
+ # customer-level credits. Contract-level credits provide better organization, and
58
+ # are easier for finance teams to recognize revenue, and are the recommended
59
+ # approach for most use cases.
12
60
  #
13
61
  # @overload create(access_schedule:, customer_id:, priority:, product_id:, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, name: nil, netsuite_sales_order_id: nil, rate_type: nil, salesforce_opportunity_id: nil, specifiers: nil, uniqueness_key: nil, request_options: {})
14
62
  #
@@ -26,7 +74,7 @@ module MetronomeSDK
26
74
  #
27
75
  # @param applicable_product_tags [Array<String>] Which tags the credit applies to. If both applicable*product_ids and applicable*
28
76
  #
29
- # @param custom_fields [Hash{Symbol=>String}]
77
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
30
78
  #
31
79
  # @param description [String] Used only in UI/API. It is not exposed to end customers.
32
80
  #
@@ -38,7 +86,7 @@ module MetronomeSDK
38
86
  #
39
87
  # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
40
88
  #
41
- # @param specifiers [Array<MetronomeSDK::Models::V1::Customers::CreditCreateParams::Specifier>] List of filters that determine what kind of customer usage draws down a commit o
89
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
42
90
  #
43
91
  # @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a commit or credit i
44
92
  #
@@ -61,7 +109,50 @@ module MetronomeSDK
61
109
  # Some parameter documentations has been truncated, see
62
110
  # {MetronomeSDK::Models::V1::Customers::CreditListParams} for more details.
63
111
  #
64
- # List credits.
112
+ # Retrieve a detailed list of all credits available to a customer, including
113
+ # promotional credits and contract-specific credits. This endpoint provides
114
+ # comprehensive visibility into credit balances, access schedules, and usage
115
+ # rules, enabling you to build credit management interfaces and track available
116
+ # funding.
117
+ #
118
+ # ### Use this endpoint to:
119
+ #
120
+ # - Display all available credits in customer billing dashboards
121
+ # - Show credit balances and expiration dates
122
+ # - Track credit usage history with optional ledger details
123
+ # - Build credit management and reporting tools
124
+ # - Monitor promotional credit utilization • Support customer inquiries about
125
+ # available credits
126
+ #
127
+ # ### Key response fields:
128
+ #
129
+ # An array of Credit objects containing:
130
+ #
131
+ # - Credit details: Name, priority, and which applicable products/tags it applies
132
+ # to
133
+ # - Product ID: The `product_id` of the credit. This is for external mapping into
134
+ # your quote-to-cash stack, not the product it applies to.
135
+ # - Access schedule: When credits become available and expire
136
+ # - Optional ledger entries: Transaction history (if `include_ledgers=true`)
137
+ # - Balance information: Current available amount (if `include_balance=true`)
138
+ # - Metadata: Custom fields and usage specifiers
139
+ #
140
+ # ### Usage guidelines:
141
+ #
142
+ # - Pagination: Results limited to 25 commits per page; use next_page for more
143
+ # - Date filtering options:
144
+ # - `covering_date`: Credits active on a specific date
145
+ # - `starting_at`: Credits with access on/after a date
146
+ # - `effective_before`: Credits with access before a date (exclusive)
147
+ # - Scope options:
148
+ # - `include_contract_credits`: Include contract-level credits (not just
149
+ # customer-level)
150
+ # - `include_archived`: Include archived credits and credits from archived
151
+ # contracts
152
+ # - Performance considerations:
153
+ # - `include_ledgers`: Adds detailed transaction history (slower)
154
+ # - `include_balance`: Adds current balance calculation (slower)
155
+ # - Optional filtering: Use credit_id to retrieve a specific commit
65
156
  #
66
157
  # @overload list(customer_id:, covering_date: nil, credit_id: nil, effective_before: nil, include_archived: nil, include_balance: nil, include_contract_credits: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
67
158
  #
@@ -89,7 +180,7 @@ module MetronomeSDK
89
180
  #
90
181
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
91
182
  #
92
- # @return [MetronomeSDK::Models::V1::Customers::CreditListResponse]
183
+ # @return [MetronomeSDK::Internal::BodyCursorPage<MetronomeSDK::Models::Credit>]
93
184
  #
94
185
  # @see MetronomeSDK::Models::V1::Customers::CreditListParams
95
186
  def list(params)
@@ -98,7 +189,8 @@ module MetronomeSDK
98
189
  method: :post,
99
190
  path: "v1/contracts/customerCredits/list",
100
191
  body: parsed,
101
- model: MetronomeSDK::Models::V1::Customers::CreditListResponse,
192
+ page: MetronomeSDK::Internal::BodyCursorPage,
193
+ model: MetronomeSDK::Credit,
102
194
  options: options
103
195
  )
104
196
  end
@@ -107,8 +199,12 @@ module MetronomeSDK
107
199
  # {MetronomeSDK::Models::V1::Customers::CreditUpdateEndDateParams} for more
108
200
  # details.
109
201
  #
110
- # Pull forward the end date of a credit. Use the "edit a credit" endpoint to
111
- # extend the end date of a credit, or to make other edits to the credit.
202
+ # Shortens the end date of an existing customer credit to terminate it earlier
203
+ # than originally scheduled. Only allows moving end dates forward (earlier), not
204
+ # extending them.
205
+ #
206
+ # Note: To extend credit end dates or make comprehensive edits, use the 'edit
207
+ # credit' endpoint instead.
112
208
  #
113
209
  # @overload update_end_date(access_ending_before:, credit_id:, customer_id:, request_options: {})
114
210
  #