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
@@ -25,7 +25,40 @@ module MetronomeSDK
25
25
  sig { returns(MetronomeSDK::Resources::V1::Customers::NamedSchedules) }
26
26
  attr_reader :named_schedules
27
27
 
28
- # Create a new customer
28
+ # Create a new customer in Metronome and optionally the billing configuration
29
+ # (recommended) which dictates where invoices for the customer will be sent or
30
+ # where payment will be collected.
31
+ #
32
+ # ### Use this endpoint to:
33
+ #
34
+ # Execute your customer provisioning workflows for either PLG motions, where
35
+ # customers originate in your platform, or SLG motions, where customers originate
36
+ # in your sales system.
37
+ #
38
+ # ### Key response fields:
39
+ #
40
+ # This end-point returns the `customer_id` created by the request. This id can be
41
+ # used to fetch relevant billing configurations and create contracts.
42
+ #
43
+ # ### Example workflow:
44
+ #
45
+ # - Generally, Metronome recommends first creating the customer in the downstream
46
+ # payment / ERP system when payment method is collected and then creating the
47
+ # customer in Metronome using the response (i.e. `customer_id`) from the
48
+ # downstream system. If you do not create a billing configuration on customer
49
+ # creation, you can add it later.
50
+ # - Once a customer is created, you can then create a contract for the customer.
51
+ # In the contract creation process, you will need to add the customer billing
52
+ # configuration to the contract to ensure Metronome invoices the customer
53
+ # correctly. This is because a customer can have multiple configurations.
54
+ # - As part of the customer creation process, set the ingest alias for the
55
+ # customer which will ensure usage is accurately mapped to the customer. Ingest
56
+ # aliases can be added or changed after the creation process as well.
57
+ #
58
+ # ### Usage guidelines:
59
+ #
60
+ # For details on different billing configurations for different systems, review
61
+ # the `/setCustomerBillingConfiguration` end-point.
29
62
  sig do
30
63
  params(
31
64
  name: String,
@@ -45,6 +78,7 @@ module MetronomeSDK
45
78
  # This will be truncated to 160 characters if the provided name is longer.
46
79
  name:,
47
80
  billing_config: nil,
81
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
48
82
  custom_fields: nil,
49
83
  customer_billing_provider_configurations: nil,
50
84
  # (deprecated, use ingest_aliases instead) an alias that can be used to refer to
@@ -56,7 +90,13 @@ module MetronomeSDK
56
90
  )
57
91
  end
58
92
 
59
- # Get a customer by Metronome ID.
93
+ # Get detailed information for a specific customer by their Metronome ID. Returns
94
+ # customer profile data including name, creation date, ingest aliases,
95
+ # configuration settings, and custom fields. Use this endpoint to fetch complete
96
+ # customer details for billing operations or account management.
97
+ #
98
+ # Note: If searching for a customer billing configuration, use the
99
+ # `/getCustomerBillingConfigurations` endpoint.
60
100
  sig do
61
101
  params(
62
102
  customer_id: String,
@@ -66,7 +106,11 @@ module MetronomeSDK
66
106
  def retrieve(customer_id:, request_options: {})
67
107
  end
68
108
 
69
- # List all customers.
109
+ # Gets a paginated list of all customers in your Metronome account. Use this
110
+ # endpoint to browse your customer base, implement customer search functionality,
111
+ # or sync customer data with external systems. Returns customer details including
112
+ # IDs, names, and configuration settings. Supports filtering and pagination
113
+ # parameters for efficient data retrieval.
70
114
  sig do
71
115
  params(
72
116
  customer_ids: T::Array[String],
@@ -99,8 +143,20 @@ module MetronomeSDK
99
143
  )
100
144
  end
101
145
 
102
- # Archive a customer Note: any alerts associated with the customer will not be
103
- # triggered.
146
+ # Use this endpoint to archive a customer while preserving auditability. Archiving
147
+ # a customer will automatically archive all contracts as of the current date and
148
+ # void all corresponding invoices. Use this endpoint if a customer is onboarded by
149
+ # mistake.
150
+ #
151
+ # ### Usage guidelines:
152
+ #
153
+ # - Once a customer is archived, it cannot be unarchived.
154
+ # - Archived customers can still be viewed through the API or the UI for audit
155
+ # purposes.
156
+ # - Ingest aliases remain idempotent for archived customers. In order to reuse an
157
+ # ingest alias, first remove the ingest alias from the customer prior to
158
+ # archiving.
159
+ # - Any alerts associated with the customer will no longer be triggered.
104
160
  sig do
105
161
  params(
106
162
  id: String,
@@ -110,7 +166,10 @@ module MetronomeSDK
110
166
  def archive(id:, request_options: {})
111
167
  end
112
168
 
113
- # Get all billable metrics for a given customer.
169
+ # Get all billable metrics available for a specific customer. Supports pagination
170
+ # and filtering by current plan status or archived metrics. Use this endpoint to
171
+ # see which metrics are being tracked for billing calculations for a given
172
+ # customer.
114
173
  sig do
115
174
  params(
116
175
  customer_id: String,
@@ -206,9 +265,88 @@ module MetronomeSDK
206
265
  )
207
266
  end
208
267
 
209
- # Sets the ingest aliases for a customer. Ingest aliases can be used in the
210
- # `customer_id` field when sending usage events to Metronome. This call is
211
- # idempotent. It fully replaces the set of ingest aliases for the given customer.
268
+ # Returns all billing configurations previously set for the customer. Use during
269
+ # the contract provisioning process to fetch the
270
+ # `billing_provider_configuration_id` needed to set the contract billing
271
+ # configuration.
272
+ sig do
273
+ params(
274
+ customer_id: String,
275
+ include_archived: T::Boolean,
276
+ request_options: MetronomeSDK::RequestOptions::OrHash
277
+ ).returns(
278
+ MetronomeSDK::Models::V1::CustomerRetrieveBillingConfigurationsResponse
279
+ )
280
+ end
281
+ def retrieve_billing_configurations(
282
+ customer_id:,
283
+ include_archived: nil,
284
+ request_options: {}
285
+ )
286
+ end
287
+
288
+ # Create a billing configuration for a customer. Once created, these
289
+ # configurations are available to associate to a contract and dictates which
290
+ # downstream system to collect payment in or send the invoice to. You can create
291
+ # multiple configurations per customer. The configuration formats are distinct for
292
+ # each downstream provider.
293
+ #
294
+ # ### Use this endpoint to:
295
+ #
296
+ # - Add the initial configuration to an existing customer. Once created, the
297
+ # billing configuration can then be associated to the customer's contract.
298
+ # - Add a new configuration to an existing customer. This might be used as part of
299
+ # an upgrade or downgrade workflow where the customer was previously billed
300
+ # through system A (e.g. Stripe) but will now be billed through system B (e.g.
301
+ # AWS). Once created, the new configuration can then be associated to the
302
+ # customer's contract.
303
+ #
304
+ # ### Delivery method options:
305
+ #
306
+ # - `direct_to_billing_provider`: Use when Metronome should send invoices directly
307
+ # to the billing provider's API (e.g., Stripe, NetSuite). This is the most
308
+ # common method for automated billing workflows.
309
+ # - `tackle`: Use specifically for AWS Marketplace transactions that require
310
+ # Tackle's co-selling platform for partner attribution and commission tracking.
311
+ # - `aws_sqs`: Use when you want invoice data delivered to an AWS SQS queue for
312
+ # custom processing before sending to your billing system.
313
+ # - `aws_sns`: Use when you want invoice notifications published to an AWS SNS
314
+ # topic for event-driven billing workflows.
315
+ #
316
+ # ### Key response fields:
317
+ #
318
+ # The id for the customer billing configuration. This id can be used to associate
319
+ # the billing configuration to a contract.
320
+ #
321
+ # ### Usage guidelines:
322
+ #
323
+ # Must use the `delivery_method_id` if you have multiple Stripe accounts connected
324
+ # to Metronome.
325
+ sig do
326
+ params(
327
+ data:
328
+ T::Array[
329
+ MetronomeSDK::V1::CustomerSetBillingConfigurationsParams::Data::OrHash
330
+ ],
331
+ request_options: MetronomeSDK::RequestOptions::OrHash
332
+ ).void
333
+ end
334
+ def set_billing_configurations(data:, request_options: {})
335
+ end
336
+
337
+ # Sets the ingest aliases for a customer. Use this endpoint to associate a
338
+ # Metronome customer with an internal ID for easier tracking between systems.
339
+ # Ingest aliases can be used in the `customer_id` field when sending usage events
340
+ # to Metronome.
341
+ #
342
+ # ### Usage guidelines:
343
+ #
344
+ # - This call is idempotent and fully replaces the set of ingest aliases for the
345
+ # given customer.
346
+ # - Switching an ingest alias from one customer to another will associate all
347
+ # corresponding usage to the new customer.
348
+ # - Use multiple ingest aliases to model child organizations within a single
349
+ # Metronome customer.
212
350
  sig do
213
351
  params(
214
352
  customer_id: String,
@@ -225,7 +363,11 @@ module MetronomeSDK
225
363
  )
226
364
  end
227
365
 
228
- # Updates the specified customer's name.
366
+ # Updates the display name for a customer record. Use this to correct customer
367
+ # names, update business names after rebranding, or maintain accurate customer
368
+ # information for invoicing and reporting. Returns the updated customer object
369
+ # with the new name applied immediately across all billing documents and
370
+ # interfaces.
229
371
  sig do
230
372
  params(
231
373
  customer_id: String,
@@ -243,7 +385,10 @@ module MetronomeSDK
243
385
  )
244
386
  end
245
387
 
246
- # Updates the specified customer's config.
388
+ # Update configuration settings for a specific customer, such as external system
389
+ # integrations (e.g., Salesforce account ID) and other customer-specific billing
390
+ # parameters. Use this endpoint to modify customer configurations without
391
+ # affecting core customer data like name or ingest aliases.
247
392
  sig do
248
393
  params(
249
394
  customer_id: String,
@@ -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
  sig do
11
37
  params(
12
38
  customer_id: String,
@@ -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
  sig do
9
26
  params(
10
27
  id: String,
@@ -18,7 +35,11 @@ module MetronomeSDK
18
35
  )
19
36
  end
20
37
 
21
- # Void an invoice
38
+ # Permanently cancels an invoice by setting its status to voided, preventing
39
+ # collection and removing it from customer billing. Use this to correct billing
40
+ # errors, cancel incorrect charges, or handle disputed invoices that should not be
41
+ # collected. Returns the voided invoice ID with the status change applied
42
+ # immediately to stop any payment processing.
22
43
  sig do
23
44
  params(
24
45
  id: String,
@@ -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
  sig do
9
14
  params(
10
15
  limit: Integer,
@@ -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
  sig do
12
14
  params(request_options: MetronomeSDK::RequestOptions::OrHash).returns(
13
15
  MetronomeSDK::Models::V1::ServiceListResponse
@@ -4,8 +4,39 @@ module MetronomeSDK
4
4
  module Resources
5
5
  class V1
6
6
  class Usage
7
- # Fetch aggregated usage data for multiple customers and billable-metrics, broken
8
- # into intervals of the specified length.
7
+ # Retrieve aggregated usage data across multiple customers and billable metrics in
8
+ # a single query. This batch endpoint enables you to fetch usage patterns at
9
+ # scale, broken down by time windows, making it ideal for building analytics
10
+ # dashboards, generating reports, and monitoring platform-wide usage trends.
11
+ #
12
+ # ### Use this endpoint to:
13
+ #
14
+ # - Generate platform-wide usage reports for internal teams
15
+ # - Monitor aggregate usage trends across your entire customer base
16
+ # - Create comparative usage analyses between customers or time periods
17
+ # - Support capacity planning with historical usage patterns
18
+ #
19
+ # ### Key response fields:
20
+ #
21
+ # An array of `UsageBatchAggregate` objects containing:
22
+ #
23
+ # - `customer_id`: The customer this usage belongs to
24
+ # - `billable_metric_id` and `billable_metric_name`: What was measured
25
+ # - `start_timestamp` and `end_timestamp`: Time window for this data point
26
+ # - `value`: Aggregated usage amount for the period
27
+ # - `groups` (optional): Usage broken down by group keys with values
28
+ # - `next_page`: Pagination cursor for large result sets
29
+ #
30
+ # ### Usage guidelines:
31
+ #
32
+ # - Time windows: Set `window_size` to `hour`, `day`, or `none` (entire period)
33
+ # - Required parameters: Must specify `starting_on`, `ending_before`, and
34
+ # `window_size`
35
+ # - Filtering options:
36
+ # - `customer_ids`: Limit to specific customers (omit for all customers)
37
+ # - `billable_metrics`: Limit to specific metrics (omit for all metrics)
38
+ # - Pagination: Use `next_page` cursor to retrieve large datasets
39
+ # - Null values: Group values may be null when no usage matches that group
9
40
  sig do
10
41
  params(
11
42
  ending_before: Time,
@@ -19,7 +50,11 @@ module MetronomeSDK
19
50
  ],
20
51
  customer_ids: T::Array[String],
21
52
  request_options: MetronomeSDK::RequestOptions::OrHash
22
- ).returns(MetronomeSDK::Models::V1::UsageListResponse)
53
+ ).returns(
54
+ MetronomeSDK::Internal::CursorPageWithoutLimit[
55
+ MetronomeSDK::Models::V1::UsageListResponse
56
+ ]
57
+ )
23
58
  end
24
59
  def list(
25
60
  # Body param:
@@ -43,11 +78,90 @@ module MetronomeSDK
43
78
  )
44
79
  end
45
80
 
46
- # Send usage events to Metronome. The body of this request is expected to be a
47
- # JSON array of between 1 and 100 usage events. Compressed request bodies are
48
- # supported with a `Content-Encoding: gzip` header. See
81
+ # The ingest endpoint is the primary method for sending usage events to Metronome,
82
+ # serving as the foundation for all billing calculations in your usage-based
83
+ # pricing model. This high-throughput endpoint is designed for real-time streaming
84
+ # ingestion, supports backdating 34 days, and is built to handle mission-critical
85
+ # usage data with enterprise-grade reliability. Metronome supports 100,000 events
86
+ # per second without requiring pre-aggregation or rollups and can scale up from
87
+ # there. See
49
88
  # [Getting usage into Metronome](https://docs.metronome.com/connect-metronome/) to
50
89
  # learn more about usage events.
90
+ #
91
+ # ### Use this endpoint to:
92
+ #
93
+ # Create a customer usage pipeline into Metronome that drives billable metrics,
94
+ # credit drawdown, and invoicing. Track customer behavior, resource consumption,
95
+ # and feature usage
96
+ #
97
+ # ### What happens when you send events:
98
+ #
99
+ # - Events are validated and processed in real-time
100
+ # - Events are matched to customers using customer IDs or customer ingest aliases
101
+ # - Events are matched to billable metrics and are immediately available for usage
102
+ # and spend calculations
103
+ #
104
+ # ### Usage guidelines:
105
+ #
106
+ # - Historical events can be backdated up to 34 days and will immediately impact
107
+ # live customer spend
108
+ # - Duplicate events are automatically detected and ignored (34-day deduplication
109
+ # window)
110
+ #
111
+ # #### Event structure:
112
+ #
113
+ # Usage events are simple JSON objects designed for flexibility and ease of
114
+ # integration:
115
+ #
116
+ # ```json
117
+ # {
118
+ # "transaction_id": "2021-01-01T00:00:00Z_cluster42",
119
+ # "customer_id": "team@example.com",
120
+ # "event_type": "api_request",
121
+ # "timestamp": "2021-01-01T00:00:00Z",
122
+ # "properties": {
123
+ # "endpoint": "/v1/users",
124
+ # "method": "POST",
125
+ # "response_time_ms": 45,
126
+ # "region": "us-west-2"
127
+ # }
128
+ # }
129
+ # ```
130
+ #
131
+ # #### Transaction ID
132
+ #
133
+ # The transaction_id serves as your idempotency key, ensuring events are processed
134
+ # exactly once. Metronome maintains a 34-day deduplication window - significantly
135
+ # longer than typical 12-hour windows - enabling robust backfill scenarios without
136
+ # duplicate billing.
137
+ #
138
+ # - Best Practices:
139
+ # - Use UUIDs for one-time events: uuid4()
140
+ # - For heartbeat events, use deterministic IDs
141
+ # - Include enough context to avoid collisions across different event sources
142
+ #
143
+ # #### Customer ID
144
+ #
145
+ # Identifies which customer should be billed for this usage. Supports two
146
+ # identification methods:
147
+ #
148
+ # - Metronome Customer ID: The UUID returned when creating a customer
149
+ # - Ingest Alias: Your system's identifier (email, account number, etc.)
150
+ #
151
+ # Ingest aliases enable seamless integration without requiring ID mapping, and
152
+ # customers can have multiple aliases for flexibility.
153
+ #
154
+ # #### Event Type:
155
+ #
156
+ # Categorizes the event type for billable metric matching. Choose descriptive
157
+ # names that aligns with the product surface area.
158
+ #
159
+ # #### Properties:
160
+ #
161
+ # Flexible metadata also used to match billable metrics or to be used to serve as
162
+ # group keys to create multiple pricing dimensions or breakdown costs by novel
163
+ # properties for end customers or internal finance teams measuring underlying
164
+ # COGs.
51
165
  sig do
52
166
  params(
53
167
  usage: T::Array[MetronomeSDK::V1::UsageIngestParams::Usage::OrHash],
@@ -57,8 +171,40 @@ module MetronomeSDK
57
171
  def ingest(usage: nil, request_options: {})
58
172
  end
59
173
 
60
- # Fetch aggregated usage data for the specified customer, billable-metric, and
61
- # optional group, broken into intervals of the specified length.
174
+ # Retrieve granular usage data for a specific customer and billable metric, with
175
+ # the ability to break down usage by custom grouping dimensions. This endpoint
176
+ # enables deep usage analytics by segmenting data across attributes like region,
177
+ # user, model type, or any custom dimension defined in your billable metrics.
178
+ #
179
+ # ### Use this endpoint to:
180
+ #
181
+ # - Analyze usage patterns broken down by specific attributes (region, user,
182
+ # department, etc.)
183
+ # - Build detailed usage dashboards with dimensional filtering
184
+ # - Identify high-usage segments for optimization opportunities
185
+ #
186
+ # ### Key response fields:
187
+ #
188
+ # An array of `PagedUsageAggregate` objects containing:
189
+ #
190
+ # - `starting_on` and `ending_before`: Time window boundaries
191
+ # - `group_key`: The dimension being grouped by (e.g., "region")
192
+ # - `group_value`: The specific value for this group (e.g., "US-East")
193
+ # - `value`: Aggregated usage for this group and time window
194
+ # - `next_page`: Pagination cursor for large datasets
195
+ #
196
+ # ### Usage guidelines:
197
+ #
198
+ # - Required parameters: Must specify `customer_id`, `billable_metric_id`, and
199
+ # `window_size`
200
+ # - Time windows: Set `window_size` to hour, day, or none for different
201
+ # granularities
202
+ # - Group filtering: Use `group_by` to specify:
203
+ # - key: The dimension to group by (must be set on the billable metric as a
204
+ # group key)
205
+ # - values: Optional array to filter to specific values only
206
+ # - Pagination: Use limit and `next_page` for large result sets
207
+ # - Null handling: `group_value` may be null for unmatched data
62
208
  sig do
63
209
  params(
64
210
  billable_metric_id: String,
@@ -107,10 +253,40 @@ module MetronomeSDK
107
253
  )
108
254
  end
109
255
 
110
- # For a set of events, look up matched billable metrics and customers by
111
- # transaction id. This endpoint looks at transactions that occurred in the last 34
112
- # days, and is intended for sampling-based testing workflows. It is heavily rate
113
- # limited.
256
+ # This endpoint retrieves events by transaction ID for events that occurred within
257
+ # the last 34 days. It is specifically designed for sampling-based testing
258
+ # workflows to detect revenue leakage. The Event Search API provides a critical
259
+ # observability tool that validates the integrity of your usage pipeline by
260
+ # allowing you to sample raw events and verify their matching against active
261
+ # billable metrics.
262
+ #
263
+ # Why event observability matters for revenue leakage: Silent revenue loss occurs
264
+ # when events are dropped, delayed, or fail to match billable metrics due to:
265
+ #
266
+ # - Upstream system failures
267
+ # - Event format changes
268
+ # - Misconfigured billable metrics
269
+ #
270
+ # ### Use this endpoint to:
271
+ #
272
+ # - Sample raw events and validate they match the expected billable metrics
273
+ # - Build custom leakage detection alerts to prevent silent revenue loss
274
+ # - Verify event processing accuracy during system changes or metric updates
275
+ # - Debug event matching issues in real-time
276
+ #
277
+ # ### Key response fields:
278
+ #
279
+ # - Complete event details including transaction ID, customer ID, and properties
280
+ # - Matched Metronome customer (if any)
281
+ # - Matched billable metric information (if any)
282
+ # - Processing status and duplicate detection flags
283
+ #
284
+ # ### Usage guidelines:
285
+ #
286
+ # ⚠️ Important: This endpoint is heavily rate limited and designed for sampling
287
+ # workflows only. Do not use this endpoint to check every event in your system.
288
+ # Instead, implement a sampling strategy to randomly validate a subset of events
289
+ # for observability purposes.
114
290
  sig do
115
291
  params(
116
292
  transaction_ids: T::Array[String],