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
@@ -28,7 +28,40 @@ module MetronomeSDK
28
28
  # Some parameter documentations has been truncated, see
29
29
  # {MetronomeSDK::Models::V1::CustomerCreateParams} for more details.
30
30
  #
31
- # Create a new customer
31
+ # Create a new customer in Metronome and optionally the billing configuration
32
+ # (recommended) which dictates where invoices for the customer will be sent or
33
+ # where payment will be collected.
34
+ #
35
+ # ### Use this endpoint to:
36
+ #
37
+ # Execute your customer provisioning workflows for either PLG motions, where
38
+ # customers originate in your platform, or SLG motions, where customers originate
39
+ # in your sales system.
40
+ #
41
+ # ### Key response fields:
42
+ #
43
+ # This end-point returns the `customer_id` created by the request. This id can be
44
+ # used to fetch relevant billing configurations and create contracts.
45
+ #
46
+ # ### Example workflow:
47
+ #
48
+ # - Generally, Metronome recommends first creating the customer in the downstream
49
+ # payment / ERP system when payment method is collected and then creating the
50
+ # customer in Metronome using the response (i.e. `customer_id`) from the
51
+ # downstream system. If you do not create a billing configuration on customer
52
+ # creation, you can add it later.
53
+ # - Once a customer is created, you can then create a contract for the customer.
54
+ # In the contract creation process, you will need to add the customer billing
55
+ # configuration to the contract to ensure Metronome invoices the customer
56
+ # correctly. This is because a customer can have multiple configurations.
57
+ # - As part of the customer creation process, set the ingest alias for the
58
+ # customer which will ensure usage is accurately mapped to the customer. Ingest
59
+ # aliases can be added or changed after the creation process as well.
60
+ #
61
+ # ### Usage guidelines:
62
+ #
63
+ # For details on different billing configurations for different systems, review
64
+ # the `/setCustomerBillingConfiguration` end-point.
32
65
  #
33
66
  # @overload create(name:, billing_config: nil, custom_fields: nil, customer_billing_provider_configurations: nil, external_id: nil, ingest_aliases: nil, request_options: {})
34
67
  #
@@ -36,7 +69,7 @@ module MetronomeSDK
36
69
  #
37
70
  # @param billing_config [MetronomeSDK::Models::V1::CustomerCreateParams::BillingConfig]
38
71
  #
39
- # @param custom_fields [Hash{Symbol=>String}]
72
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
40
73
  #
41
74
  # @param customer_billing_provider_configurations [Array<MetronomeSDK::Models::V1::CustomerCreateParams::CustomerBillingProviderConfiguration>]
42
75
  #
@@ -60,7 +93,13 @@ module MetronomeSDK
60
93
  )
61
94
  end
62
95
 
63
- # Get a customer by Metronome ID.
96
+ # Get detailed information for a specific customer by their Metronome ID. Returns
97
+ # customer profile data including name, creation date, ingest aliases,
98
+ # configuration settings, and custom fields. Use this endpoint to fetch complete
99
+ # customer details for billing operations or account management.
100
+ #
101
+ # Note: If searching for a customer billing configuration, use the
102
+ # `/getCustomerBillingConfigurations` endpoint.
64
103
  #
65
104
  # @overload retrieve(customer_id:, request_options: {})
66
105
  #
@@ -87,7 +126,11 @@ module MetronomeSDK
87
126
  # Some parameter documentations has been truncated, see
88
127
  # {MetronomeSDK::Models::V1::CustomerListParams} for more details.
89
128
  #
90
- # List all customers.
129
+ # Gets a paginated list of all customers in your Metronome account. Use this
130
+ # endpoint to browse your customer base, implement customer search functionality,
131
+ # or sync customer data with external systems. Returns customer details including
132
+ # IDs, names, and configuration settings. Supports filtering and pagination
133
+ # parameters for efficient data retrieval.
91
134
  #
92
135
  # @overload list(customer_ids: nil, ingest_alias: nil, limit: nil, next_page: nil, only_archived: nil, salesforce_account_ids: nil, request_options: {})
93
136
  #
@@ -120,8 +163,20 @@ module MetronomeSDK
120
163
  )
121
164
  end
122
165
 
123
- # Archive a customer Note: any alerts associated with the customer will not be
124
- # triggered.
166
+ # Use this endpoint to archive a customer while preserving auditability. Archiving
167
+ # a customer will automatically archive all contracts as of the current date and
168
+ # void all corresponding invoices. Use this endpoint if a customer is onboarded by
169
+ # mistake.
170
+ #
171
+ # ### Usage guidelines:
172
+ #
173
+ # - Once a customer is archived, it cannot be unarchived.
174
+ # - Archived customers can still be viewed through the API or the UI for audit
175
+ # purposes.
176
+ # - Ingest aliases remain idempotent for archived customers. In order to reuse an
177
+ # ingest alias, first remove the ingest alias from the customer prior to
178
+ # archiving.
179
+ # - Any alerts associated with the customer will no longer be triggered.
125
180
  #
126
181
  # @overload archive(id:, request_options: {})
127
182
  #
@@ -145,7 +200,10 @@ module MetronomeSDK
145
200
  # Some parameter documentations has been truncated, see
146
201
  # {MetronomeSDK::Models::V1::CustomerListBillableMetricsParams} for more details.
147
202
  #
148
- # Get all billable metrics for a given customer.
203
+ # Get all billable metrics available for a specific customer. Supports pagination
204
+ # and filtering by current plan status or archived metrics. Use this endpoint to
205
+ # see which metrics are being tracked for billing calculations for a given
206
+ # customer.
149
207
  #
150
208
  # @overload list_billable_metrics(customer_id:, include_archived: nil, limit: nil, next_page: nil, on_current_plan: nil, request_options: {})
151
209
  #
@@ -255,9 +313,101 @@ module MetronomeSDK
255
313
  )
256
314
  end
257
315
 
258
- # Sets the ingest aliases for a customer. Ingest aliases can be used in the
259
- # `customer_id` field when sending usage events to Metronome. This call is
260
- # idempotent. It fully replaces the set of ingest aliases for the given customer.
316
+ # Returns all billing configurations previously set for the customer. Use during
317
+ # the contract provisioning process to fetch the
318
+ # `billing_provider_configuration_id` needed to set the contract billing
319
+ # configuration.
320
+ #
321
+ # @overload retrieve_billing_configurations(customer_id:, include_archived: nil, request_options: {})
322
+ #
323
+ # @param customer_id [String]
324
+ # @param include_archived [Boolean]
325
+ # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
326
+ #
327
+ # @return [MetronomeSDK::Models::V1::CustomerRetrieveBillingConfigurationsResponse]
328
+ #
329
+ # @see MetronomeSDK::Models::V1::CustomerRetrieveBillingConfigurationsParams
330
+ def retrieve_billing_configurations(params)
331
+ parsed, options = MetronomeSDK::V1::CustomerRetrieveBillingConfigurationsParams.dump_request(params)
332
+ @client.request(
333
+ method: :post,
334
+ path: "v1/getCustomerBillingProviderConfigurations",
335
+ body: parsed,
336
+ model: MetronomeSDK::Models::V1::CustomerRetrieveBillingConfigurationsResponse,
337
+ options: options
338
+ )
339
+ end
340
+
341
+ # Create a billing configuration for a customer. Once created, these
342
+ # configurations are available to associate to a contract and dictates which
343
+ # downstream system to collect payment in or send the invoice to. You can create
344
+ # multiple configurations per customer. The configuration formats are distinct for
345
+ # each downstream provider.
346
+ #
347
+ # ### Use this endpoint to:
348
+ #
349
+ # - Add the initial configuration to an existing customer. Once created, the
350
+ # billing configuration can then be associated to the customer's contract.
351
+ # - Add a new configuration to an existing customer. This might be used as part of
352
+ # an upgrade or downgrade workflow where the customer was previously billed
353
+ # through system A (e.g. Stripe) but will now be billed through system B (e.g.
354
+ # AWS). Once created, the new configuration can then be associated to the
355
+ # customer's contract.
356
+ #
357
+ # ### Delivery method options:
358
+ #
359
+ # - `direct_to_billing_provider`: Use when Metronome should send invoices directly
360
+ # to the billing provider's API (e.g., Stripe, NetSuite). This is the most
361
+ # common method for automated billing workflows.
362
+ # - `tackle`: Use specifically for AWS Marketplace transactions that require
363
+ # Tackle's co-selling platform for partner attribution and commission tracking.
364
+ # - `aws_sqs`: Use when you want invoice data delivered to an AWS SQS queue for
365
+ # custom processing before sending to your billing system.
366
+ # - `aws_sns`: Use when you want invoice notifications published to an AWS SNS
367
+ # topic for event-driven billing workflows.
368
+ #
369
+ # ### Key response fields:
370
+ #
371
+ # The id for the customer billing configuration. This id can be used to associate
372
+ # the billing configuration to a contract.
373
+ #
374
+ # ### Usage guidelines:
375
+ #
376
+ # Must use the `delivery_method_id` if you have multiple Stripe accounts connected
377
+ # to Metronome.
378
+ #
379
+ # @overload set_billing_configurations(data:, request_options: {})
380
+ #
381
+ # @param data [Array<MetronomeSDK::Models::V1::CustomerSetBillingConfigurationsParams::Data>]
382
+ # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
383
+ #
384
+ # @return [nil]
385
+ #
386
+ # @see MetronomeSDK::Models::V1::CustomerSetBillingConfigurationsParams
387
+ def set_billing_configurations(params)
388
+ parsed, options = MetronomeSDK::V1::CustomerSetBillingConfigurationsParams.dump_request(params)
389
+ @client.request(
390
+ method: :post,
391
+ path: "v1/setCustomerBillingProviderConfigurations",
392
+ body: parsed,
393
+ model: NilClass,
394
+ options: options
395
+ )
396
+ end
397
+
398
+ # Sets the ingest aliases for a customer. Use this endpoint to associate a
399
+ # Metronome customer with an internal ID for easier tracking between systems.
400
+ # Ingest aliases can be used in the `customer_id` field when sending usage events
401
+ # to Metronome.
402
+ #
403
+ # ### Usage guidelines:
404
+ #
405
+ # - This call is idempotent and fully replaces the set of ingest aliases for the
406
+ # given customer.
407
+ # - Switching an ingest alias from one customer to another will associate all
408
+ # corresponding usage to the new customer.
409
+ # - Use multiple ingest aliases to model child organizations within a single
410
+ # Metronome customer.
261
411
  #
262
412
  # @overload set_ingest_aliases(customer_id:, ingest_aliases:, request_options: {})
263
413
  #
@@ -288,7 +438,11 @@ module MetronomeSDK
288
438
  # Some parameter documentations has been truncated, see
289
439
  # {MetronomeSDK::Models::V1::CustomerSetNameParams} for more details.
290
440
  #
291
- # Updates the specified customer's name.
441
+ # Updates the display name for a customer record. Use this to correct customer
442
+ # names, update business names after rebranding, or maintain accurate customer
443
+ # information for invoicing and reporting. Returns the updated customer object
444
+ # with the new name applied immediately across all billing documents and
445
+ # interfaces.
292
446
  #
293
447
  # @overload set_name(customer_id:, name:, request_options: {})
294
448
  #
@@ -319,7 +473,10 @@ module MetronomeSDK
319
473
  # Some parameter documentations has been truncated, see
320
474
  # {MetronomeSDK::Models::V1::CustomerUpdateConfigParams} for more details.
321
475
  #
322
- # Updates the specified customer's config.
476
+ # Update configuration settings for a specific customer, such as external system
477
+ # integrations (e.g., Salesforce account ID) and other customer-specific billing
478
+ # parameters. Use this endpoint to modify customer configurations without
479
+ # affecting core customer data like name or ingest aliases.
323
480
  #
324
481
  # @overload update_config(customer_id:, leave_stripe_invoices_in_draft: nil, salesforce_account_id: nil, request_options: {})
325
482
  #
@@ -4,9 +4,35 @@ module MetronomeSDK
4
4
  module Resources
5
5
  class V1
6
6
  class Dashboards
7
- # Retrieve an embeddable dashboard url for a customer. The dashboard can be
8
- # embedded using an iframe in a website. This will show information such as usage
9
- # data and customer invoices.
7
+ # Generate secure, embeddable dashboard URLs that allow you to seamlessly
8
+ # integrate Metronome's billing visualizations directly into your application.
9
+ # This endpoint creates authenticated iframe-ready URLs for customer-specific
10
+ # dashboards, providing a white-labeled billing experience without building custom
11
+ # UI.
12
+ #
13
+ # ### Use this endpoint to:
14
+ #
15
+ # - Embed billing dashboards directly in your customer portal or admin interface
16
+ # - Provide self-service access to invoices, usage data, and credit balances
17
+ # - Build white-labeled billing experiences with minimal development effort
18
+ #
19
+ # ### Key response fields:
20
+ #
21
+ # - A secure, time-limited URL that can be embedded in an iframe
22
+ # - The URL includes authentication tokens and configuration parameters
23
+ # - URLs are customer-specific and respect your security settings
24
+ #
25
+ # ### Usage guidelines:
26
+ #
27
+ # - Dashboard types: Choose from `invoices`, `usage`, or `commits_and_credits`
28
+ # - Customization options:
29
+ # - `dashboard_options`: Configure whether you want invoices to show zero usage
30
+ # line items
31
+ # - `color_overrides`: Match your brand's color palette
32
+ # - `bm_group_key_overrides`: Customize how dimensions are displayed (for the
33
+ # usage embeddable dashboard)
34
+ # - Iframe implementation: Embed the returned URL directly in an iframe element
35
+ # - Responsive design: Dashboards automatically adapt to container dimensions
10
36
  #
11
37
  # @overload get_embeddable_url(customer_id:, dashboard:, bm_group_key_overrides: nil, color_overrides: nil, dashboard_options: nil, request_options: {})
12
38
  #
@@ -4,7 +4,24 @@ module MetronomeSDK
4
4
  module Resources
5
5
  class V1
6
6
  class Invoices
7
- # Regenerate a voided contract invoice
7
+ # This endpoint regenerates a voided invoice and recalculates the invoice based on
8
+ # up-to-date rates, available balances, and other fees regardless of the billing
9
+ # period.
10
+ #
11
+ # ### Use this endpoint to:
12
+ #
13
+ # Recalculate an invoice with updated rate terms, available balance, and fees to
14
+ # correct billing disputes or discrepancies
15
+ #
16
+ # ### Key response fields:
17
+ #
18
+ # The regenerated invoice id, which is distinct from the previously voided
19
+ # invoice.
20
+ #
21
+ # ### Usage guidelines:
22
+ #
23
+ # If an invoice is attached to a contract with a billing provider on it, the
24
+ # regenerated invoice will be distributed based on the configuration.
8
25
  #
9
26
  # @overload regenerate(id:, request_options: {})
10
27
  #
@@ -26,7 +43,11 @@ module MetronomeSDK
26
43
  )
27
44
  end
28
45
 
29
- # Void an invoice
46
+ # Permanently cancels an invoice by setting its status to voided, preventing
47
+ # collection and removing it from customer billing. Use this to correct billing
48
+ # errors, cancel incorrect charges, or handle disputed invoices that should not be
49
+ # collected. Returns the voided invoice ID with the status change applied
50
+ # immediately to stop any payment processing.
30
51
  #
31
52
  # @overload void(id:, request_options: {})
32
53
  #
@@ -4,7 +4,12 @@ module MetronomeSDK
4
4
  module Resources
5
5
  class V1
6
6
  class PricingUnits
7
- # List all pricing units (known in the API by the legacy term "credit types").
7
+ # List all pricing units. All fiat currency types (for example, USD or GBP) will
8
+ # be included, as well as any custom pricing units that were configured. Custom
9
+ # pricing units can be used to charge for usage in a non-fiat pricing unit, for
10
+ # example AI credits.
11
+ #
12
+ # Note: The USD (cents) pricing unit is 2714e483-4ff1-48e4-9e25-ac732e8f24f2.
8
13
  #
9
14
  # @overload list(limit: nil, next_page: nil, request_options: {})
10
15
  #
@@ -4,10 +4,12 @@ module MetronomeSDK
4
4
  module Resources
5
5
  class V1
6
6
  class Services
7
- # Fetches a list of services used by Metronome and the associated IP addresses. IP
8
- # addresses are not necessarily unique between services. In most cases, IP
9
- # addresses will appear in the list at least 30 days before they are used for the
10
- # first time.
7
+ # Gets Metronome's service registry with associated IP addresses for security
8
+ # allowlisting and firewall configuration. Use this endpoint to maintain an
9
+ # up-to-date list of IPs that your systems should trust for Metronome
10
+ # communications. Returns service names and their current IP ranges, with new IPs
11
+ # typically appearing 30+ days before first use to ensure smooth allowlist
12
+ # updates.
11
13
  #
12
14
  # @overload list(request_options: {})
13
15
  #
@@ -7,8 +7,39 @@ module MetronomeSDK
7
7
  # Some parameter documentations has been truncated, see
8
8
  # {MetronomeSDK::Models::V1::UsageListParams} for more details.
9
9
  #
10
- # Fetch aggregated usage data for multiple customers and billable-metrics, broken
11
- # into intervals of the specified length.
10
+ # Retrieve aggregated usage data across multiple customers and billable metrics in
11
+ # a single query. This batch endpoint enables you to fetch usage patterns at
12
+ # scale, broken down by time windows, making it ideal for building analytics
13
+ # dashboards, generating reports, and monitoring platform-wide usage trends.
14
+ #
15
+ # ### Use this endpoint to:
16
+ #
17
+ # - Generate platform-wide usage reports for internal teams
18
+ # - Monitor aggregate usage trends across your entire customer base
19
+ # - Create comparative usage analyses between customers or time periods
20
+ # - Support capacity planning with historical usage patterns
21
+ #
22
+ # ### Key response fields:
23
+ #
24
+ # An array of `UsageBatchAggregate` objects containing:
25
+ #
26
+ # - `customer_id`: The customer this usage belongs to
27
+ # - `billable_metric_id` and `billable_metric_name`: What was measured
28
+ # - `start_timestamp` and `end_timestamp`: Time window for this data point
29
+ # - `value`: Aggregated usage amount for the period
30
+ # - `groups` (optional): Usage broken down by group keys with values
31
+ # - `next_page`: Pagination cursor for large result sets
32
+ #
33
+ # ### Usage guidelines:
34
+ #
35
+ # - Time windows: Set `window_size` to `hour`, `day`, or `none` (entire period)
36
+ # - Required parameters: Must specify `starting_on`, `ending_before`, and
37
+ # `window_size`
38
+ # - Filtering options:
39
+ # - `customer_ids`: Limit to specific customers (omit for all customers)
40
+ # - `billable_metrics`: Limit to specific metrics (omit for all metrics)
41
+ # - Pagination: Use `next_page` cursor to retrieve large datasets
42
+ # - Null values: Group values may be null when no usage matches that group
12
43
  #
13
44
  # @overload list(ending_before:, starting_on:, window_size:, next_page: nil, billable_metrics: nil, customer_ids: nil, request_options: {})
14
45
  #
@@ -26,7 +57,7 @@ module MetronomeSDK
26
57
  #
27
58
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
28
59
  #
29
- # @return [MetronomeSDK::Models::V1::UsageListResponse]
60
+ # @return [MetronomeSDK::Internal::CursorPageWithoutLimit<MetronomeSDK::Models::V1::UsageListResponse>]
30
61
  #
31
62
  # @see MetronomeSDK::Models::V1::UsageListParams
32
63
  def list(params)
@@ -37,17 +68,97 @@ module MetronomeSDK
37
68
  path: "v1/usage",
38
69
  query: parsed.slice(*query_params),
39
70
  body: parsed.except(*query_params),
71
+ page: MetronomeSDK::Internal::CursorPageWithoutLimit,
40
72
  model: MetronomeSDK::Models::V1::UsageListResponse,
41
73
  options: options
42
74
  )
43
75
  end
44
76
 
45
- # Send usage events to Metronome. The body of this request is expected to be a
46
- # JSON array of between 1 and 100 usage events. Compressed request bodies are
47
- # supported with a `Content-Encoding: gzip` header. See
77
+ # The ingest endpoint is the primary method for sending usage events to Metronome,
78
+ # serving as the foundation for all billing calculations in your usage-based
79
+ # pricing model. This high-throughput endpoint is designed for real-time streaming
80
+ # ingestion, supports backdating 34 days, and is built to handle mission-critical
81
+ # usage data with enterprise-grade reliability. Metronome supports 100,000 events
82
+ # per second without requiring pre-aggregation or rollups and can scale up from
83
+ # there. See
48
84
  # [Getting usage into Metronome](https://docs.metronome.com/connect-metronome/) to
49
85
  # learn more about usage events.
50
86
  #
87
+ # ### Use this endpoint to:
88
+ #
89
+ # Create a customer usage pipeline into Metronome that drives billable metrics,
90
+ # credit drawdown, and invoicing. Track customer behavior, resource consumption,
91
+ # and feature usage
92
+ #
93
+ # ### What happens when you send events:
94
+ #
95
+ # - Events are validated and processed in real-time
96
+ # - Events are matched to customers using customer IDs or customer ingest aliases
97
+ # - Events are matched to billable metrics and are immediately available for usage
98
+ # and spend calculations
99
+ #
100
+ # ### Usage guidelines:
101
+ #
102
+ # - Historical events can be backdated up to 34 days and will immediately impact
103
+ # live customer spend
104
+ # - Duplicate events are automatically detected and ignored (34-day deduplication
105
+ # window)
106
+ #
107
+ # #### Event structure:
108
+ #
109
+ # Usage events are simple JSON objects designed for flexibility and ease of
110
+ # integration:
111
+ #
112
+ # ```json
113
+ # {
114
+ # "transaction_id": "2021-01-01T00:00:00Z_cluster42",
115
+ # "customer_id": "team@example.com",
116
+ # "event_type": "api_request",
117
+ # "timestamp": "2021-01-01T00:00:00Z",
118
+ # "properties": {
119
+ # "endpoint": "/v1/users",
120
+ # "method": "POST",
121
+ # "response_time_ms": 45,
122
+ # "region": "us-west-2"
123
+ # }
124
+ # }
125
+ # ```
126
+ #
127
+ # #### Transaction ID
128
+ #
129
+ # The transaction_id serves as your idempotency key, ensuring events are processed
130
+ # exactly once. Metronome maintains a 34-day deduplication window - significantly
131
+ # longer than typical 12-hour windows - enabling robust backfill scenarios without
132
+ # duplicate billing.
133
+ #
134
+ # - Best Practices:
135
+ # - Use UUIDs for one-time events: uuid4()
136
+ # - For heartbeat events, use deterministic IDs
137
+ # - Include enough context to avoid collisions across different event sources
138
+ #
139
+ # #### Customer ID
140
+ #
141
+ # Identifies which customer should be billed for this usage. Supports two
142
+ # identification methods:
143
+ #
144
+ # - Metronome Customer ID: The UUID returned when creating a customer
145
+ # - Ingest Alias: Your system's identifier (email, account number, etc.)
146
+ #
147
+ # Ingest aliases enable seamless integration without requiring ID mapping, and
148
+ # customers can have multiple aliases for flexibility.
149
+ #
150
+ # #### Event Type:
151
+ #
152
+ # Categorizes the event type for billable metric matching. Choose descriptive
153
+ # names that aligns with the product surface area.
154
+ #
155
+ # #### Properties:
156
+ #
157
+ # Flexible metadata also used to match billable metrics or to be used to serve as
158
+ # group keys to create multiple pricing dimensions or breakdown costs by novel
159
+ # properties for end customers or internal finance teams measuring underlying
160
+ # COGs.
161
+ #
51
162
  # @overload ingest(usage: nil, request_options: {})
52
163
  #
53
164
  # @param usage [Array<MetronomeSDK::Models::V1::UsageIngestParams::Usage>]
@@ -70,8 +181,40 @@ module MetronomeSDK
70
181
  # Some parameter documentations has been truncated, see
71
182
  # {MetronomeSDK::Models::V1::UsageListWithGroupsParams} for more details.
72
183
  #
73
- # Fetch aggregated usage data for the specified customer, billable-metric, and
74
- # optional group, broken into intervals of the specified length.
184
+ # Retrieve granular usage data for a specific customer and billable metric, with
185
+ # the ability to break down usage by custom grouping dimensions. This endpoint
186
+ # enables deep usage analytics by segmenting data across attributes like region,
187
+ # user, model type, or any custom dimension defined in your billable metrics.
188
+ #
189
+ # ### Use this endpoint to:
190
+ #
191
+ # - Analyze usage patterns broken down by specific attributes (region, user,
192
+ # department, etc.)
193
+ # - Build detailed usage dashboards with dimensional filtering
194
+ # - Identify high-usage segments for optimization opportunities
195
+ #
196
+ # ### Key response fields:
197
+ #
198
+ # An array of `PagedUsageAggregate` objects containing:
199
+ #
200
+ # - `starting_on` and `ending_before`: Time window boundaries
201
+ # - `group_key`: The dimension being grouped by (e.g., "region")
202
+ # - `group_value`: The specific value for this group (e.g., "US-East")
203
+ # - `value`: Aggregated usage for this group and time window
204
+ # - `next_page`: Pagination cursor for large datasets
205
+ #
206
+ # ### Usage guidelines:
207
+ #
208
+ # - Required parameters: Must specify `customer_id`, `billable_metric_id`, and
209
+ # `window_size`
210
+ # - Time windows: Set `window_size` to hour, day, or none for different
211
+ # granularities
212
+ # - Group filtering: Use `group_by` to specify:
213
+ # - key: The dimension to group by (must be set on the billable metric as a
214
+ # group key)
215
+ # - values: Optional array to filter to specific values only
216
+ # - Pagination: Use limit and `next_page` for large result sets
217
+ # - Null handling: `group_value` may be null for unmatched data
75
218
  #
76
219
  # @overload list_with_groups(billable_metric_id:, customer_id:, window_size:, limit: nil, next_page: nil, current_period: nil, ending_before: nil, group_by: nil, starting_on: nil, request_options: {})
77
220
  #
@@ -112,10 +255,40 @@ module MetronomeSDK
112
255
  )
113
256
  end
114
257
 
115
- # For a set of events, look up matched billable metrics and customers by
116
- # transaction id. This endpoint looks at transactions that occurred in the last 34
117
- # days, and is intended for sampling-based testing workflows. It is heavily rate
118
- # limited.
258
+ # This endpoint retrieves events by transaction ID for events that occurred within
259
+ # the last 34 days. It is specifically designed for sampling-based testing
260
+ # workflows to detect revenue leakage. The Event Search API provides a critical
261
+ # observability tool that validates the integrity of your usage pipeline by
262
+ # allowing you to sample raw events and verify their matching against active
263
+ # billable metrics.
264
+ #
265
+ # Why event observability matters for revenue leakage: Silent revenue loss occurs
266
+ # when events are dropped, delayed, or fail to match billable metrics due to:
267
+ #
268
+ # - Upstream system failures
269
+ # - Event format changes
270
+ # - Misconfigured billable metrics
271
+ #
272
+ # ### Use this endpoint to:
273
+ #
274
+ # - Sample raw events and validate they match the expected billable metrics
275
+ # - Build custom leakage detection alerts to prevent silent revenue loss
276
+ # - Verify event processing accuracy during system changes or metric updates
277
+ # - Debug event matching issues in real-time
278
+ #
279
+ # ### Key response fields:
280
+ #
281
+ # - Complete event details including transaction ID, customer ID, and properties
282
+ # - Matched Metronome customer (if any)
283
+ # - Matched billable metric information (if any)
284
+ # - Processing status and duplicate detection flags
285
+ #
286
+ # ### Usage guidelines:
287
+ #
288
+ # ⚠️ Important: This endpoint is heavily rate limited and designed for sampling
289
+ # workflows only. Do not use this endpoint to check every event in your system.
290
+ # Instead, implement a sampling strategy to randomly validate a subset of events
291
+ # for observability purposes.
119
292
  #
120
293
  # @overload search(transaction_ids:, request_options: {})
121
294
  #