metronome-sdk 0.3.0 → 1.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 (308) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/README.md +9 -9
  4. data/lib/metronome_sdk/internal/body_cursor_page.rb +86 -0
  5. data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +86 -0
  6. data/lib/metronome_sdk/internal/transport/base_client.rb +1 -4
  7. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +1 -9
  8. data/lib/metronome_sdk/internal/type/base_model.rb +6 -13
  9. data/lib/metronome_sdk/internal/type/union.rb +11 -0
  10. data/lib/metronome_sdk/internal/util.rb +1 -1
  11. data/lib/metronome_sdk/models/base_threshold_commit.rb +36 -0
  12. data/lib/metronome_sdk/models/commit.rb +26 -170
  13. data/lib/metronome_sdk/models/commit_hierarchy_configuration.rb +98 -0
  14. data/lib/metronome_sdk/models/commit_rate.rb +48 -0
  15. data/lib/metronome_sdk/models/commit_specifier.rb +42 -0
  16. data/lib/metronome_sdk/models/commit_specifier_input.rb +42 -0
  17. data/lib/metronome_sdk/models/contract.rb +404 -0
  18. data/lib/metronome_sdk/models/contract_v2.rb +2919 -0
  19. data/lib/metronome_sdk/models/contract_without_amendments.rb +36 -1126
  20. data/lib/metronome_sdk/models/credit.rb +9 -156
  21. data/lib/metronome_sdk/models/discount.rb +2 -1
  22. data/lib/metronome_sdk/models/hierarchy_configuration.rb +76 -0
  23. data/lib/metronome_sdk/models/override.rb +6 -101
  24. data/lib/metronome_sdk/models/override_tier.rb +21 -0
  25. data/lib/metronome_sdk/models/overwrite_rate.rb +82 -0
  26. data/lib/metronome_sdk/models/payment_gate_config.rb +149 -0
  27. data/lib/metronome_sdk/models/payment_gate_config_v2.rb +149 -0
  28. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +100 -0
  29. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +102 -0
  30. data/lib/metronome_sdk/models/pro_service.rb +2 -1
  31. data/lib/metronome_sdk/models/recurring_commit_subscription_config.rb +51 -0
  32. data/lib/metronome_sdk/models/scheduled_charge.rb +2 -1
  33. data/lib/metronome_sdk/models/spend_threshold_configuration.rb +44 -0
  34. data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +44 -0
  35. data/lib/metronome_sdk/models/subscription.rb +227 -0
  36. data/lib/metronome_sdk/models/update_base_threshold_commit.rb +36 -0
  37. data/lib/metronome_sdk/models/v1/alert_create_params.rb +4 -6
  38. data/lib/metronome_sdk/models/v1/billable_metric_create_params.rb +1 -2
  39. data/lib/metronome_sdk/models/v1/billable_metric_list_response.rb +3 -3
  40. data/lib/metronome_sdk/models/v1/billable_metric_retrieve_response.rb +4 -7
  41. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +57 -411
  42. data/lib/metronome_sdk/models/v1/contract_create_historical_invoices_params.rb +7 -16
  43. data/lib/metronome_sdk/models/v1/contract_create_params.rb +236 -1478
  44. data/lib/metronome_sdk/models/v1/contract_list_balances_response.rb +6 -23
  45. data/lib/metronome_sdk/models/v1/contract_list_response.rb +3 -1153
  46. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_params.rb +2 -6
  47. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rb +5 -50
  48. data/lib/metronome_sdk/models/v1/contract_retrieve_response.rb +3 -1154
  49. data/lib/metronome_sdk/models/v1/contract_schedule_pro_services_invoice_params.rb +1 -3
  50. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +2 -1
  51. data/lib/metronome_sdk/models/v1/contracts/product_list_response.rb +8 -1
  52. data/lib/metronome_sdk/models/v1/contracts/product_retrieve_response.rb +8 -1
  53. data/lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb +1 -4
  54. data/lib/metronome_sdk/models/v1/contracts/rate_card_create_params.rb +4 -7
  55. data/lib/metronome_sdk/models/v1/contracts/rate_card_list_response.rb +10 -1
  56. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_params.rb +2 -6
  57. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rb +5 -50
  58. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rb +10 -1
  59. data/lib/metronome_sdk/models/v1/contracts/rate_card_update_params.rb +1 -3
  60. data/lib/metronome_sdk/models/v1/contracts/rate_cards/product_order_update_params.rb +1 -3
  61. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rb +6 -61
  62. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +3 -49
  63. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +4 -51
  64. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_params.rb +2 -6
  65. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rb +5 -49
  66. data/lib/metronome_sdk/models/v1/credit_grant_list_entries_response.rb +103 -123
  67. data/lib/metronome_sdk/models/v1/credit_grant_list_response.rb +3 -5
  68. data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +1 -3
  69. data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +41 -58
  70. data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +5 -1
  71. data/lib/metronome_sdk/models/v1/customer.rb +2 -1
  72. data/lib/metronome_sdk/models/v1/customer_create_params.rb +37 -11
  73. data/lib/metronome_sdk/models/v1/customer_detail.rb +2 -1
  74. data/lib/metronome_sdk/models/v1/customer_list_billable_metrics_response.rb +3 -3
  75. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +1 -3
  76. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rb +28 -0
  77. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +128 -0
  78. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +143 -0
  79. data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +1 -3
  80. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +30 -1
  81. data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +2 -0
  82. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +2 -0
  83. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +10 -60
  84. data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +6 -48
  85. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +8 -16
  86. data/lib/metronome_sdk/models/v1/customers/invoice.rb +61 -48
  87. data/lib/metronome_sdk/models/v1/customers/invoice_list_breakdowns_params.rb +1 -4
  88. data/lib/metronome_sdk/models/v1/customers/plan_add_params.rb +2 -6
  89. data/lib/metronome_sdk/models/v1/customers/plan_list_response.rb +2 -1
  90. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +4 -11
  91. data/lib/metronome_sdk/models/v1/plan_detail.rb +9 -5
  92. data/lib/metronome_sdk/models/v1/plan_list_charges_response.rb +2 -1
  93. data/lib/metronome_sdk/models/v1/plan_list_customers_response.rb +2 -1
  94. data/lib/metronome_sdk/models/v1/plan_list_response.rb +5 -1
  95. data/lib/metronome_sdk/models/v1/usage_ingest_params.rb +1 -4
  96. data/lib/metronome_sdk/models/v1/usage_list_params.rb +1 -3
  97. data/lib/metronome_sdk/models/v1/usage_list_response.rb +45 -62
  98. data/lib/metronome_sdk/models/v1/usage_search_response.rb +4 -7
  99. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +29 -58
  100. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +26 -49
  101. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +414 -2310
  102. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +337 -2424
  103. data/lib/metronome_sdk/models/v2/contract_list_response.rb +3 -4520
  104. data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +3 -4528
  105. data/lib/metronome_sdk/models.rb +38 -0
  106. data/lib/metronome_sdk/resources/v1/alerts.rb +72 -2
  107. data/lib/metronome_sdk/resources/v1/audit_logs.rb +39 -4
  108. data/lib/metronome_sdk/resources/v1/billable_metrics.rb +54 -4
  109. data/lib/metronome_sdk/resources/v1/contracts/products.rb +25 -6
  110. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rb +7 -2
  111. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +10 -2
  112. data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +109 -10
  113. data/lib/metronome_sdk/resources/v1/contracts.rb +254 -18
  114. data/lib/metronome_sdk/resources/v1/credit_grants.rb +2 -1
  115. data/lib/metronome_sdk/resources/v1/custom_fields.rb +51 -14
  116. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +103 -8
  117. data/lib/metronome_sdk/resources/v1/customers/commits.rb +119 -9
  118. data/lib/metronome_sdk/resources/v1/customers/credits.rb +104 -8
  119. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +124 -8
  120. data/lib/metronome_sdk/resources/v1/customers.rb +169 -12
  121. data/lib/metronome_sdk/resources/v1/dashboards.rb +29 -3
  122. data/lib/metronome_sdk/resources/v1/invoices.rb +23 -2
  123. data/lib/metronome_sdk/resources/v1/pricing_units.rb +6 -1
  124. data/lib/metronome_sdk/resources/v1/services.rb +6 -4
  125. data/lib/metronome_sdk/resources/v1/usage.rb +185 -12
  126. data/lib/metronome_sdk/resources/v2/contracts.rb +114 -18
  127. data/lib/metronome_sdk/version.rb +1 -1
  128. data/lib/metronome_sdk.rb +24 -3
  129. data/rbi/metronome_sdk/errors.rbi +2 -2
  130. data/rbi/metronome_sdk/internal/body_cursor_page.rbi +22 -0
  131. data/rbi/metronome_sdk/internal/cursor_page_without_limit.rbi +22 -0
  132. data/rbi/metronome_sdk/models/base_threshold_commit.rbi +58 -0
  133. data/rbi/metronome_sdk/models/commit.rbi +26 -348
  134. data/rbi/metronome_sdk/models/commit_hierarchy_configuration.rbi +280 -0
  135. data/rbi/metronome_sdk/models/commit_rate.rbi +85 -0
  136. data/rbi/metronome_sdk/models/commit_specifier.rbi +71 -0
  137. data/rbi/metronome_sdk/models/commit_specifier_input.rbi +74 -0
  138. data/rbi/metronome_sdk/models/contract.rbi +768 -0
  139. data/rbi/metronome_sdk/models/contract_v2.rbi +5822 -0
  140. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +184 -2507
  141. data/rbi/metronome_sdk/models/credit.rbi +10 -348
  142. data/rbi/metronome_sdk/models/discount.rbi +2 -0
  143. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +180 -0
  144. data/rbi/metronome_sdk/models/override.rbi +8 -193
  145. data/rbi/metronome_sdk/models/override_tier.rbi +29 -0
  146. data/rbi/metronome_sdk/models/overwrite_rate.rbi +137 -0
  147. data/rbi/metronome_sdk/models/payment_gate_config.rbi +312 -0
  148. data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +321 -0
  149. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +183 -0
  150. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +188 -0
  151. data/rbi/metronome_sdk/models/pro_service.rbi +2 -0
  152. data/rbi/metronome_sdk/models/recurring_commit_subscription_config.rbi +125 -0
  153. data/rbi/metronome_sdk/models/scheduled_charge.rbi +2 -0
  154. data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +76 -0
  155. data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -0
  156. data/rbi/metronome_sdk/models/subscription.rbi +460 -0
  157. data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +61 -0
  158. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +6 -3
  159. data/rbi/metronome_sdk/models/v1/billable_metric_list_response.rbi +2 -0
  160. data/rbi/metronome_sdk/models/v1/billable_metric_retrieve_response.rbi +2 -0
  161. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +44 -768
  162. data/rbi/metronome_sdk/models/v1/contract_create_historical_invoices_params.rbi +2 -0
  163. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1550 -4079
  164. data/rbi/metronome_sdk/models/v1/contract_list_balances_response.rbi +8 -59
  165. data/rbi/metronome_sdk/models/v1/contract_list_response.rbi +5 -2420
  166. data/rbi/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbi +6 -129
  167. data/rbi/metronome_sdk/models/v1/contract_retrieve_response.rbi +4 -2419
  168. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +2 -0
  169. data/rbi/metronome_sdk/models/v1/contracts/product_list_response.rbi +2 -0
  170. data/rbi/metronome_sdk/models/v1/contracts/product_retrieve_response.rbi +2 -0
  171. data/rbi/metronome_sdk/models/v1/contracts/rate_card_create_params.rbi +2 -0
  172. data/rbi/metronome_sdk/models/v1/contracts/rate_card_list_response.rbi +2 -0
  173. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbi +6 -129
  174. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rbi +2 -0
  175. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbi +4 -129
  176. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +4 -129
  177. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +4 -129
  178. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbi +6 -129
  179. data/rbi/metronome_sdk/models/v1/credit_grant_list_entries_response.rbi +147 -198
  180. data/rbi/metronome_sdk/models/v1/credit_grant_list_response.rbi +2 -0
  181. data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +117 -165
  182. data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +8 -1
  183. data/rbi/metronome_sdk/models/v1/customer.rbi +2 -0
  184. data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +88 -3
  185. data/rbi/metronome_sdk/models/v1/customer_detail.rbi +2 -0
  186. data/rbi/metronome_sdk/models/v1/customer_list_billable_metrics_response.rbi +2 -0
  187. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbi +51 -0
  188. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +265 -0
  189. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +348 -0
  190. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +60 -0
  191. data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +10 -0
  192. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +10 -0
  193. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +6 -90
  194. data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +6 -90
  195. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +6 -3
  196. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +70 -10
  197. data/rbi/metronome_sdk/models/v1/customers/plan_list_response.rbi +2 -0
  198. data/rbi/metronome_sdk/models/v1/plan_detail.rbi +2 -0
  199. data/rbi/metronome_sdk/models/v1/plan_list_charges_response.rbi +2 -0
  200. data/rbi/metronome_sdk/models/v1/plan_list_customers_response.rbi +2 -0
  201. data/rbi/metronome_sdk/models/v1/plan_list_response.rbi +8 -1
  202. data/rbi/metronome_sdk/models/v1/usage_list_response.rbi +45 -86
  203. data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +2 -0
  204. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +56 -76
  205. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +56 -76
  206. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +3419 -7270
  207. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1140 -6062
  208. data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +5 -9867
  209. data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +6 -9866
  210. data/rbi/metronome_sdk/models.rbi +44 -0
  211. data/rbi/metronome_sdk/resources/v1/alerts.rbi +72 -2
  212. data/rbi/metronome_sdk/resources/v1/audit_logs.rbi +39 -4
  213. data/rbi/metronome_sdk/resources/v1/billable_metrics.rbi +54 -4
  214. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +25 -5
  215. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rbi +7 -2
  216. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +10 -3
  217. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +109 -9
  218. data/rbi/metronome_sdk/resources/v1/contracts.rbi +257 -16
  219. data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +5 -1
  220. data/rbi/metronome_sdk/resources/v1/custom_fields.rbi +57 -14
  221. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +108 -5
  222. data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +119 -10
  223. data/rbi/metronome_sdk/resources/v1/customers/credits.rbi +104 -9
  224. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +123 -7
  225. data/rbi/metronome_sdk/resources/v1/customers.rbi +156 -11
  226. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +29 -3
  227. data/rbi/metronome_sdk/resources/v1/invoices.rbi +23 -2
  228. data/rbi/metronome_sdk/resources/v1/pricing_units.rbi +6 -1
  229. data/rbi/metronome_sdk/resources/v1/services.rbi +6 -4
  230. data/rbi/metronome_sdk/resources/v1/usage.rbi +188 -12
  231. data/rbi/metronome_sdk/resources/v2/contracts.rbi +120 -23
  232. data/sig/metronome_sdk/internal/body_cursor_page.rbs +13 -0
  233. data/sig/metronome_sdk/internal/cursor_page_without_limit.rbs +13 -0
  234. data/sig/metronome_sdk/models/base_threshold_commit.rbs +26 -0
  235. data/sig/metronome_sdk/models/commit.rbs +17 -170
  236. data/sig/metronome_sdk/models/commit_hierarchy_configuration.rbs +117 -0
  237. data/sig/metronome_sdk/models/commit_rate.rbs +48 -0
  238. data/sig/metronome_sdk/models/commit_specifier.rbs +47 -0
  239. data/sig/metronome_sdk/models/commit_specifier_input.rbs +47 -0
  240. data/sig/metronome_sdk/models/contract.rbs +398 -0
  241. data/sig/metronome_sdk/models/contract_v2.rbs +2881 -0
  242. data/sig/metronome_sdk/models/contract_without_amendments.rbs +54 -976
  243. data/sig/metronome_sdk/models/credit.rbs +12 -170
  244. data/sig/metronome_sdk/models/hierarchy_configuration.rbs +71 -0
  245. data/sig/metronome_sdk/models/override.rbs +12 -101
  246. data/sig/metronome_sdk/models/override_tier.rbs +17 -0
  247. data/sig/metronome_sdk/models/overwrite_rate.rbs +78 -0
  248. data/sig/metronome_sdk/models/payment_gate_config.rbs +123 -0
  249. data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +123 -0
  250. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +82 -0
  251. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +82 -0
  252. data/sig/metronome_sdk/models/recurring_commit_subscription_config.rbs +51 -0
  253. data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +35 -0
  254. data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +35 -0
  255. data/sig/metronome_sdk/models/subscription.rbs +215 -0
  256. data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +28 -0
  257. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +4 -2
  258. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +24 -340
  259. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +168 -1219
  260. data/sig/metronome_sdk/models/v1/contract_list_balances_response.rbs +4 -25
  261. data/sig/metronome_sdk/models/v1/contract_list_response.rbs +4 -1041
  262. data/sig/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbs +6 -54
  263. data/sig/metronome_sdk/models/v1/contract_retrieve_response.rbs +4 -1041
  264. data/sig/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbs +6 -54
  265. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbs +6 -54
  266. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +6 -54
  267. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +6 -54
  268. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbs +6 -54
  269. data/sig/metronome_sdk/models/v1/credit_grant_list_entries_response.rbs +72 -94
  270. data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +53 -75
  271. data/sig/metronome_sdk/models/v1/customer_create_params.rbs +31 -4
  272. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbs +32 -0
  273. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +113 -0
  274. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +133 -0
  275. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +21 -0
  276. data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +7 -1
  277. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +6 -1
  278. data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +6 -50
  279. data/sig/metronome_sdk/models/v1/customers/credit_create_params.rbs +6 -50
  280. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +4 -2
  281. data/sig/metronome_sdk/models/v1/usage_list_response.rbs +33 -55
  282. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +19 -43
  283. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +19 -43
  284. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +361 -1917
  285. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +242 -2252
  286. data/sig/metronome_sdk/models/v2/contract_list_response.rbs +4 -4426
  287. data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +4 -4426
  288. data/sig/metronome_sdk/models.rbs +38 -0
  289. data/sig/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbs +1 -1
  290. data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -3
  291. data/sig/metronome_sdk/resources/v1/credit_grants.rbs +1 -1
  292. data/sig/metronome_sdk/resources/v1/custom_fields.rbs +1 -1
  293. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +2 -1
  294. data/sig/metronome_sdk/resources/v1/customers/commits.rbs +2 -2
  295. data/sig/metronome_sdk/resources/v1/customers/credits.rbs +2 -2
  296. data/sig/metronome_sdk/resources/v1/customers.rbs +11 -0
  297. data/sig/metronome_sdk/resources/v1/usage.rbs +1 -1
  298. data/sig/metronome_sdk/resources/v2/contracts.rbs +7 -4
  299. metadata +74 -11
  300. data/lib/metronome_sdk/models/v1/customers/alert_list_response.rb +0 -29
  301. data/lib/metronome_sdk/models/v1/customers/commit_list_response.rb +0 -26
  302. data/lib/metronome_sdk/models/v1/customers/credit_list_response.rb +0 -26
  303. data/rbi/metronome_sdk/models/v1/customers/alert_list_response.rbi +0 -46
  304. data/rbi/metronome_sdk/models/v1/customers/commit_list_response.rbi +0 -45
  305. data/rbi/metronome_sdk/models/v1/customers/credit_list_response.rbi +0 -45
  306. data/sig/metronome_sdk/models/v1/customers/alert_list_response.rbs +0 -29
  307. data/sig/metronome_sdk/models/v1/customers/commit_list_response.rbs +0 -26
  308. data/sig/metronome_sdk/models/v1/customers/credit_list_response.rbs +0 -26
@@ -8,15 +8,58 @@ 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: {})
11
+ # Retrieve the real-time evaluation status for a specific alert-customer pair.
12
+ # This endpoint provides instant visibility into whether a customer has triggered
13
+ # an alert condition, enabling you to monitor account health and take proactive
14
+ # action based on current alert states.
15
+ #
16
+ # ### Use this endpoint to:
17
+ #
18
+ # - Check if a specific customer is currently violating an alert threshold
19
+ # (`in_alarm` status)
20
+ # - Verify alert configuration details and threshold values for a customer
21
+ # - Integrate alert status checks into customer support tools or admin interfaces
22
+ #
23
+ # ### Key response fields:
24
+ #
25
+ # A CustomerAlert object containing:
26
+ #
27
+ # - `customer_status`: The current evaluation state
28
+ #
29
+ # - `ok` - Customer is within acceptable thresholds
30
+ # - `in_alarm`- Customer has breached the alert threshold
31
+ # - `evaluating` - Alert has yet to be evaluated (typically due to a customer or
32
+ # alert having just been created)
33
+ # - `null` - Alert has been archived
34
+ # - `triggered_by`: Additional context about what caused the alert to trigger
35
+ # (when applicable)
36
+ # - alert: Complete alert configuration including:
37
+ # - Alert ID, name, and type
38
+ # - Current threshold values and credit type information
39
+ # - Alert status (enabled, disabled, or archived)
40
+ # - Last update timestamp
41
+ # - Any applied filters (credit grant types, custom fields, group values)
42
+ #
43
+ # ### Usage guidelines:
44
+ #
45
+ # - Customer status: Returns the current evaluation state, not historical data.
46
+ # For alert history, use webhook notifications or event logs
47
+ # - Archived alerts: Returns null for customer_status if the alert has been
48
+ # archived, but still includes the alert configuration details
49
+ # - Integration patterns: This endpoint can be used to check a customer's alert
50
+ # status, but shouldn't be scraped. You should instead rely on the webhook
51
+ # notification to understand when customers are moved to IN_ALARM.
52
+ # - Error handling: Returns 404 if either the customer or alert ID doesn't exist
53
+ # or isn't accessible to your organization
54
+ #
55
+ # @overload retrieve(alert_id:, customer_id:, group_values: nil, plans_or_contracts: nil, request_options: {})
15
56
  #
16
57
  # @param alert_id [String] The Metronome ID of the alert
17
58
  #
18
59
  # @param customer_id [String] The Metronome ID of the customer
19
60
  #
61
+ # @param group_values [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>] Only present for `spend_threshold_reached` alerts. Retrieve the alert for a spec
62
+ #
20
63
  # @param plans_or_contracts [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts] When parallel alerts are enabled during migration, this flag denotes whether to
21
64
  #
22
65
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -38,7 +81,31 @@ module MetronomeSDK
38
81
  # Some parameter documentations has been truncated, see
39
82
  # {MetronomeSDK::Models::V1::Customers::AlertListParams} for more details.
40
83
  #
41
- # Fetch all customer alert statuses and alert information for a customer
84
+ # Retrieve all alert configurations and their current statuses for a specific
85
+ # customer in a single API call. This endpoint provides a comprehensive view of
86
+ # all alerts monitoring a customer account.
87
+ #
88
+ # ### Use this endpoint to:
89
+ #
90
+ # - Display all active alerts for a customer in dashboards or admin panels
91
+ # - Quickly identify which alerts a customer is currently triggering
92
+ # - Audit alert coverage for specific accounts
93
+ # - Filter alerts by status (enabled, disabled, or archived)
94
+ #
95
+ # ### Key response fields:
96
+ #
97
+ # - data: Array of CustomerAlert objects, each containing:
98
+ # - Current evaluation status (`ok`, `in_alarm`, `evaluating`, or `null`)
99
+ # - Complete alert configuration and threshold details
100
+ # - Alert metadata including type, name, and last update time
101
+ # - `next_page`: Pagination cursor for retrieving additional results
102
+ #
103
+ # ### Usage guidelines:
104
+ #
105
+ # - Default behavior: Returns only enabled alerts unless alert_statuses filter is
106
+ # specified
107
+ # - Pagination: Use the `next_page` cursor to retrieve all results for customers
108
+ # with many alerts
42
109
  #
43
110
  # @overload list(customer_id:, next_page: nil, alert_statuses: nil, request_options: {})
44
111
  #
@@ -50,7 +117,7 @@ module MetronomeSDK
50
117
  #
51
118
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
52
119
  #
53
- # @return [MetronomeSDK::Models::V1::Customers::AlertListResponse]
120
+ # @return [MetronomeSDK::Internal::CursorPageWithoutLimit<MetronomeSDK::Models::V1::Customers::CustomerAlert>]
54
121
  #
55
122
  # @see MetronomeSDK::Models::V1::Customers::AlertListParams
56
123
  def list(params)
@@ -61,12 +128,40 @@ module MetronomeSDK
61
128
  path: "v1/customer-alerts/list",
62
129
  query: parsed.slice(*query_params),
63
130
  body: parsed.except(*query_params),
64
- model: MetronomeSDK::Models::V1::Customers::AlertListResponse,
131
+ page: MetronomeSDK::Internal::CursorPageWithoutLimit,
132
+ model: MetronomeSDK::V1::Customers::CustomerAlert,
65
133
  options: options
66
134
  )
67
135
  end
68
136
 
69
- # Reset state for an alert by customer id and force re-evaluation
137
+ # Force an immediate re-evaluation of a specific alert for a customer, clearing
138
+ # any previous state and triggering a fresh assessment against current thresholds.
139
+ # This endpoint ensures alert accuracy after configuration changes or data
140
+ # corrections.
141
+ #
142
+ # ### Use this endpoint to:
143
+ #
144
+ # - Clear false positive alerts after fixing data issues
145
+ # - Re-evaluate alerts after adjusting customer balances or credits
146
+ # - Test alert behavior during development and debugging
147
+ # - Resolve stuck alerts that may be in an incorrect state
148
+ # - Trigger immediate evaluation after threshold modifications
149
+ #
150
+ # ### Key response fields:
151
+ #
152
+ # - 200 Success: Confirmation that the alert has been reset and re-evaluation
153
+ # initiated
154
+ # - No response body is returned - the operation completes asynchronously
155
+ #
156
+ # ### Usage guidelines:
157
+ #
158
+ # - Immediate effect: Triggers re-evaluation instantly, which may result in new
159
+ # webhook notifications if thresholds are breached
160
+ # - State clearing: Removes any cached evaluation state, ensuring a fresh
161
+ # assessment
162
+ # - Use sparingly: Intended for exceptional cases, not routine operations
163
+ # - Asynchronous processing: The reset completes immediately, but re-evaluation
164
+ # happens in the background
70
165
  #
71
166
  # @overload reset(alert_id:, customer_id:, request_options: {})
72
167
  #
@@ -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
  #
@@ -8,7 +8,46 @@ module MetronomeSDK
8
8
  # Some parameter documentations has been truncated, see
9
9
  # {MetronomeSDK::Models::V1::Customers::InvoiceRetrieveParams} for more details.
10
10
  #
11
- # Fetch a specific invoice for a given customer.
11
+ # Retrieve detailed information for a specific invoice by its unique identifier.
12
+ # This endpoint returns comprehensive invoice data including line items, applied
13
+ # credits, totals, and billing period details for both finalized and draft
14
+ # invoices.
15
+ #
16
+ # ### Use this endpoint to:
17
+ #
18
+ # - Display historical invoice details in customer-facing dashboards or billing
19
+ # portals.
20
+ # - Retrieve current month draft invoices to show customers their month-to-date
21
+ # spend.
22
+ # - Access finalized invoices for historical billing records and payment
23
+ # reconciliation.
24
+ # - Validate customer pricing and credit applications for customer support
25
+ # queries.
26
+ #
27
+ # ### Key response fields:
28
+ #
29
+ # Invoice status (DRAFT, FINALIZED, VOID) Billing period start and end dates Total
30
+ # amount and amount due after credits Detailed line items broken down by:
31
+ #
32
+ # - Customer and contract information
33
+ # - Invoice line item type
34
+ # - Product/service name and ID
35
+ # - Quantity consumed
36
+ # - Unit and total price
37
+ # - Time period for usage-based charges
38
+ # - Applied credits or prepaid commitments
39
+ #
40
+ # ### Usage guidelines:
41
+ #
42
+ # - Draft invoices update in real-time as usage is reported and may change before
43
+ # finalization
44
+ # - The response includes both usage-based line items (e.g., API calls, data
45
+ # processed) and scheduled charges (e.g., monthly subscriptions, commitment
46
+ # fees)
47
+ # - Credit and commitment applications are shown as separate line items with
48
+ # negative amounts
49
+ # - For voided invoices, the response will indicate VOID status but retain all
50
+ # original line item details
12
51
  #
13
52
  # @overload retrieve(customer_id:, invoice_id:, skip_zero_qty_line_items: nil, request_options: {})
14
53
  #
@@ -45,8 +84,52 @@ module MetronomeSDK
45
84
  # Some parameter documentations has been truncated, see
46
85
  # {MetronomeSDK::Models::V1::Customers::InvoiceListParams} for more details.
47
86
  #
48
- # List all invoices for a given customer, optionally filtered by status, date
49
- # range, and/or credit type.
87
+ # Retrieves a paginated list of invoices for a specific customer, with flexible
88
+ # filtering options to narrow results by status, date range, credit type, and
89
+ # more. This endpoint provides a comprehensive view of a customer's billing
90
+ # history and current charges, supporting both real-time billing dashboards and
91
+ # historical reporting needs.
92
+ #
93
+ # ### Use this endpoint to:
94
+ #
95
+ # - Display historical invoice details in customer-facing dashboards or billing
96
+ # portals.
97
+ # - Retrieve current month draft invoices to show customers their month-to-date
98
+ # spend.
99
+ # - Access finalized invoices for historical billing records and payment
100
+ # reconciliation.
101
+ # - Validate customer pricing and credit applications for customer support
102
+ # queries.
103
+ # - Generate financial reports by filtering invoices within specific date ranges
104
+ #
105
+ # ### Key response fields:
106
+ #
107
+ # Array of invoice objects containing:
108
+ #
109
+ # - Invoice ID and status (DRAFT, FINALIZED, VOID)
110
+ # - Invoice type (USAGE, SCHEDULED)
111
+ # - Billing period start and end dates
112
+ # - Issue date and due date
113
+ # - Total amount, subtotal, and amount due
114
+ # - Applied credits summary
115
+ # - Contract ID reference
116
+ # - External billing provider status (if integrated with Stripe, etc.)
117
+ # - Pagination metadata `next_page` cursor
118
+ #
119
+ # ### Usage guidelines:
120
+ #
121
+ # - The endpoint returns invoice summaries; use the Get Invoice endpoint for
122
+ # detailed line items
123
+ # - Draft invoices are continuously updated as new usage is reported and will show
124
+ # real-time spend
125
+ # - Results are ordered by creation date descending by default (newest first)
126
+ # - When filtering by date range, the filter applies to the billing period, not
127
+ # the issue date
128
+ # - For customers with many invoices, implement pagination to ensure all results
129
+ # are retrieved External billing provider statuses (like Stripe payment status)
130
+ # are included when applicable
131
+ # - Voided invoices are included in results by default unless filtered out by
132
+ # status
50
133
  #
51
134
  # @overload list(customer_id:, credit_type_id: nil, ending_before: nil, limit: nil, next_page: nil, skip_zero_qty_line_items: nil, sort: nil, starting_on: nil, status: nil, request_options: {})
52
135
  #
@@ -134,11 +217,44 @@ module MetronomeSDK
134
217
  # {MetronomeSDK::Models::V1::Customers::InvoiceListBreakdownsParams} for more
135
218
  # details.
136
219
  #
137
- # List daily or hourly invoice breakdowns for a given customer, optionally
138
- # filtered by status, date range, and/or credit type. Important considerations:
139
- #
140
- # - If we receive backdated usage after an invoice has been finalized, the
141
- # backdated usage will be included in the response and usage numbers may differ.
220
+ # Retrieve granular time-series breakdowns of invoice data at hourly or daily
221
+ # intervals. This endpoint transforms standard invoices into detailed timelines,
222
+ # enabling you to track usage patterns, identify consumption spikes, and provide
223
+ # customers with transparency into their billing details throughout the billing
224
+ # period.
225
+ #
226
+ # ### Use this endpoint to:
227
+ #
228
+ # - Build usage analytics dashboards showing daily or hourly consumption trends
229
+ # - Identify peak usage periods for capacity planning and cost optimization
230
+ # - Generate detailed billing reports for finance teams and customer success
231
+ # - Troubleshoot billing disputes by examining usage patterns at specific times
232
+ # - Power real-time cost monitoring and alerting systems
233
+ #
234
+ # ### Key response fields:
235
+ #
236
+ # An array of BreakdownInvoice objects, each containing:
237
+ #
238
+ # - All standard invoice fields (ID, customer, commit, line items, totals, status)
239
+ # - Line items with quantities and costs for that specific period
240
+ # - `breakdown_start_timestamp`: Start of the specific time window
241
+ # - `breakdown_end_timestamp`: End of the specific time window
242
+ # - `next_page`: Pagination cursor for large result sets
243
+ #
244
+ # ### Usage guidelines:
245
+ #
246
+ # - Time granularity: Set `window_size` to hour or day based on your analysis
247
+ # needs
248
+ # - Response limits: Daily breakdowns return up to 35 days; hourly breakdowns
249
+ # return up to 24 hours per request
250
+ # - Date filtering: Use `starting_on` and `ending_before` to focus on specific
251
+ # periods
252
+ # - Performance: For large date ranges, use pagination to retrieve all data
253
+ # efficiently
254
+ # - Backdated usage: If usage events arrive after invoice finalization, breakdowns
255
+ # will reflect the updated usage
256
+ # - Zero quantity filtering: Use `skip_zero_qty_line_items=true` to exclude
257
+ # periods with no usage
142
258
  #
143
259
  # @overload list_breakdowns(customer_id:, ending_before:, starting_on:, credit_type_id: nil, limit: nil, next_page: nil, skip_zero_qty_line_items: nil, sort: nil, status: nil, window_size: nil, request_options: {})
144
260
  #