metronome-sdk 0.3.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -0
  3. data/README.md +9 -9
  4. data/lib/metronome_sdk/errors.rb +25 -11
  5. data/lib/metronome_sdk/file_part.rb +10 -7
  6. data/lib/metronome_sdk/internal/body_cursor_page.rb +86 -0
  7. data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
  8. data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +86 -0
  9. data/lib/metronome_sdk/internal/transport/base_client.rb +12 -11
  10. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +8 -19
  11. data/lib/metronome_sdk/internal/type/base_model.rb +6 -13
  12. data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
  13. data/lib/metronome_sdk/internal/type/enum.rb +25 -0
  14. data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
  15. data/lib/metronome_sdk/internal/type/union.rb +11 -0
  16. data/lib/metronome_sdk/internal/util.rb +9 -8
  17. data/lib/metronome_sdk/models/base_threshold_commit.rb +36 -0
  18. data/lib/metronome_sdk/models/commit.rb +26 -170
  19. data/lib/metronome_sdk/models/commit_hierarchy_configuration.rb +98 -0
  20. data/lib/metronome_sdk/models/commit_rate.rb +48 -0
  21. data/lib/metronome_sdk/models/commit_specifier.rb +42 -0
  22. data/lib/metronome_sdk/models/commit_specifier_input.rb +42 -0
  23. data/lib/metronome_sdk/models/contract.rb +404 -0
  24. data/lib/metronome_sdk/models/contract_v2.rb +3169 -0
  25. data/lib/metronome_sdk/models/contract_without_amendments.rb +38 -1128
  26. data/lib/metronome_sdk/models/credit.rb +9 -156
  27. data/lib/metronome_sdk/models/discount.rb +2 -1
  28. data/lib/metronome_sdk/models/hierarchy_configuration.rb +173 -0
  29. data/lib/metronome_sdk/models/override.rb +6 -101
  30. data/lib/metronome_sdk/models/override_tier.rb +21 -0
  31. data/lib/metronome_sdk/models/overwrite_rate.rb +82 -0
  32. data/lib/metronome_sdk/models/payment_gate_config.rb +150 -0
  33. data/lib/metronome_sdk/models/payment_gate_config_v2.rb +150 -0
  34. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +100 -0
  35. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +102 -0
  36. data/lib/metronome_sdk/models/pro_service.rb +2 -1
  37. data/lib/metronome_sdk/models/recurring_commit_subscription_config.rb +51 -0
  38. data/lib/metronome_sdk/models/scheduled_charge.rb +2 -1
  39. data/lib/metronome_sdk/models/spend_threshold_configuration.rb +44 -0
  40. data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +44 -0
  41. data/lib/metronome_sdk/models/subscription.rb +311 -0
  42. data/lib/metronome_sdk/models/update_base_threshold_commit.rb +36 -0
  43. data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
  44. data/lib/metronome_sdk/models/v1/alert_create_params.rb +42 -42
  45. data/lib/metronome_sdk/models/v1/billable_metric_create_params.rb +1 -2
  46. data/lib/metronome_sdk/models/v1/billable_metric_list_response.rb +3 -3
  47. data/lib/metronome_sdk/models/v1/billable_metric_retrieve_response.rb +4 -7
  48. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +58 -411
  49. data/lib/metronome_sdk/models/v1/contract_create_historical_invoices_params.rb +7 -16
  50. data/lib/metronome_sdk/models/v1/contract_create_params.rb +315 -1459
  51. data/lib/metronome_sdk/models/v1/contract_list_balances_response.rb +6 -23
  52. data/lib/metronome_sdk/models/v1/contract_list_response.rb +3 -1153
  53. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_params.rb +2 -6
  54. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rb +5 -50
  55. data/lib/metronome_sdk/models/v1/contract_retrieve_response.rb +3 -1154
  56. data/lib/metronome_sdk/models/v1/contract_schedule_pro_services_invoice_params.rb +1 -3
  57. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +2 -1
  58. data/lib/metronome_sdk/models/v1/contracts/product_list_response.rb +8 -1
  59. data/lib/metronome_sdk/models/v1/contracts/product_retrieve_response.rb +8 -1
  60. data/lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb +1 -4
  61. data/lib/metronome_sdk/models/v1/contracts/rate_card_create_params.rb +4 -7
  62. data/lib/metronome_sdk/models/v1/contracts/rate_card_list_response.rb +10 -1
  63. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_params.rb +2 -6
  64. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rb +5 -50
  65. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rb +10 -1
  66. data/lib/metronome_sdk/models/v1/contracts/rate_card_update_params.rb +1 -3
  67. data/lib/metronome_sdk/models/v1/contracts/rate_cards/product_order_update_params.rb +1 -3
  68. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rb +6 -61
  69. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +3 -49
  70. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +4 -51
  71. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_params.rb +2 -6
  72. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rb +5 -49
  73. data/lib/metronome_sdk/models/v1/credit_grant_list_entries_response.rb +103 -123
  74. data/lib/metronome_sdk/models/v1/credit_grant_list_response.rb +3 -5
  75. data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +1 -3
  76. data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +41 -58
  77. data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +5 -1
  78. data/lib/metronome_sdk/models/v1/customer.rb +2 -1
  79. data/lib/metronome_sdk/models/v1/customer_create_params.rb +37 -11
  80. data/lib/metronome_sdk/models/v1/customer_detail.rb +11 -2
  81. data/lib/metronome_sdk/models/v1/customer_list_billable_metrics_response.rb +3 -3
  82. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +6 -18
  83. data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
  84. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rb +28 -0
  85. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +128 -0
  86. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +143 -0
  87. data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +4 -6
  88. data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
  89. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +37 -8
  90. data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +2 -0
  91. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +2 -0
  92. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +10 -60
  93. data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +6 -48
  94. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +48 -54
  95. data/lib/metronome_sdk/models/v1/customers/invoice.rb +197 -66
  96. data/lib/metronome_sdk/models/v1/customers/invoice_list_breakdowns_params.rb +1 -4
  97. data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
  98. data/lib/metronome_sdk/models/v1/customers/plan_add_params.rb +2 -6
  99. data/lib/metronome_sdk/models/v1/customers/plan_list_response.rb +2 -1
  100. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +4 -11
  101. data/lib/metronome_sdk/models/v1/payment.rb +151 -0
  102. data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
  103. data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
  104. data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
  105. data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
  106. data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
  107. data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
  108. data/lib/metronome_sdk/models/v1/plan_detail.rb +9 -5
  109. data/lib/metronome_sdk/models/v1/plan_list_charges_response.rb +2 -1
  110. data/lib/metronome_sdk/models/v1/plan_list_customers_response.rb +2 -1
  111. data/lib/metronome_sdk/models/v1/plan_list_response.rb +5 -1
  112. data/lib/metronome_sdk/models/v1/usage_ingest_params.rb +1 -4
  113. data/lib/metronome_sdk/models/v1/usage_list_params.rb +1 -3
  114. data/lib/metronome_sdk/models/v1/usage_list_response.rb +45 -62
  115. data/lib/metronome_sdk/models/v1/usage_search_response.rb +4 -7
  116. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +37 -58
  117. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +34 -49
  118. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +552 -2265
  119. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +417 -2317
  120. data/lib/metronome_sdk/models/v2/contract_list_response.rb +3 -4520
  121. data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +3 -4528
  122. data/lib/metronome_sdk/models.rb +38 -0
  123. data/lib/metronome_sdk/resources/v1/alerts.rb +90 -16
  124. data/lib/metronome_sdk/resources/v1/audit_logs.rb +39 -4
  125. data/lib/metronome_sdk/resources/v1/billable_metrics.rb +54 -4
  126. data/lib/metronome_sdk/resources/v1/contracts/products.rb +25 -6
  127. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rb +7 -2
  128. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +10 -2
  129. data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +109 -10
  130. data/lib/metronome_sdk/resources/v1/contracts.rb +255 -18
  131. data/lib/metronome_sdk/resources/v1/credit_grants.rb +2 -1
  132. data/lib/metronome_sdk/resources/v1/custom_fields.rb +51 -14
  133. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +127 -13
  134. data/lib/metronome_sdk/resources/v1/customers/commits.rb +119 -9
  135. data/lib/metronome_sdk/resources/v1/customers/credits.rb +104 -8
  136. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +179 -8
  137. data/lib/metronome_sdk/resources/v1/customers.rb +175 -15
  138. data/lib/metronome_sdk/resources/v1/dashboards.rb +29 -3
  139. data/lib/metronome_sdk/resources/v1/invoices.rb +23 -2
  140. data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
  141. data/lib/metronome_sdk/resources/v1/pricing_units.rb +6 -1
  142. data/lib/metronome_sdk/resources/v1/services.rb +6 -4
  143. data/lib/metronome_sdk/resources/v1/usage.rb +188 -13
  144. data/lib/metronome_sdk/resources/v1.rb +4 -0
  145. data/lib/metronome_sdk/resources/v2/contracts.rb +120 -18
  146. data/lib/metronome_sdk/version.rb +1 -1
  147. data/lib/metronome_sdk.rb +33 -3
  148. data/rbi/metronome_sdk/errors.rbi +31 -4
  149. data/rbi/metronome_sdk/file_part.rbi +1 -1
  150. data/rbi/metronome_sdk/internal/body_cursor_page.rbi +22 -0
  151. data/rbi/metronome_sdk/internal/cursor_page_without_limit.rbi +22 -0
  152. data/rbi/metronome_sdk/internal/transport/base_client.rbi +4 -5
  153. data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
  154. data/rbi/metronome_sdk/internal/util.rbi +1 -1
  155. data/rbi/metronome_sdk/models/base_threshold_commit.rbi +58 -0
  156. data/rbi/metronome_sdk/models/commit.rbi +26 -348
  157. data/rbi/metronome_sdk/models/commit_hierarchy_configuration.rbi +280 -0
  158. data/rbi/metronome_sdk/models/commit_rate.rbi +85 -0
  159. data/rbi/metronome_sdk/models/commit_specifier.rbi +71 -0
  160. data/rbi/metronome_sdk/models/commit_specifier_input.rbi +74 -0
  161. data/rbi/metronome_sdk/models/contract.rbi +768 -0
  162. data/rbi/metronome_sdk/models/contract_v2.rbi +6415 -0
  163. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +186 -2509
  164. data/rbi/metronome_sdk/models/credit.rbi +10 -348
  165. data/rbi/metronome_sdk/models/discount.rbi +2 -0
  166. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +424 -0
  167. data/rbi/metronome_sdk/models/override.rbi +8 -193
  168. data/rbi/metronome_sdk/models/override_tier.rbi +29 -0
  169. data/rbi/metronome_sdk/models/overwrite_rate.rbi +137 -0
  170. data/rbi/metronome_sdk/models/payment_gate_config.rbi +317 -0
  171. data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +326 -0
  172. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +183 -0
  173. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +188 -0
  174. data/rbi/metronome_sdk/models/pro_service.rbi +2 -0
  175. data/rbi/metronome_sdk/models/recurring_commit_subscription_config.rbi +125 -0
  176. data/rbi/metronome_sdk/models/scheduled_charge.rbi +2 -0
  177. data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +76 -0
  178. data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -0
  179. data/rbi/metronome_sdk/models/subscription.rbi +635 -0
  180. data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +61 -0
  181. data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
  182. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +57 -50
  183. data/rbi/metronome_sdk/models/v1/billable_metric_list_response.rbi +2 -0
  184. data/rbi/metronome_sdk/models/v1/billable_metric_retrieve_response.rbi +2 -0
  185. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +49 -768
  186. data/rbi/metronome_sdk/models/v1/contract_create_historical_invoices_params.rbi +2 -0
  187. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1843 -4119
  188. data/rbi/metronome_sdk/models/v1/contract_list_balances_response.rbi +8 -59
  189. data/rbi/metronome_sdk/models/v1/contract_list_response.rbi +5 -2420
  190. data/rbi/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbi +6 -129
  191. data/rbi/metronome_sdk/models/v1/contract_retrieve_response.rbi +4 -2419
  192. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +2 -0
  193. data/rbi/metronome_sdk/models/v1/contracts/product_list_response.rbi +2 -0
  194. data/rbi/metronome_sdk/models/v1/contracts/product_retrieve_response.rbi +2 -0
  195. data/rbi/metronome_sdk/models/v1/contracts/rate_card_create_params.rbi +2 -0
  196. data/rbi/metronome_sdk/models/v1/contracts/rate_card_list_response.rbi +2 -0
  197. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbi +6 -129
  198. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rbi +2 -0
  199. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbi +4 -129
  200. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +4 -129
  201. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +4 -129
  202. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbi +6 -129
  203. data/rbi/metronome_sdk/models/v1/credit_grant_list_entries_response.rbi +147 -198
  204. data/rbi/metronome_sdk/models/v1/credit_grant_list_response.rbi +2 -0
  205. data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +117 -165
  206. data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +8 -1
  207. data/rbi/metronome_sdk/models/v1/customer.rbi +2 -0
  208. data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +88 -3
  209. data/rbi/metronome_sdk/models/v1/customer_detail.rbi +10 -0
  210. data/rbi/metronome_sdk/models/v1/customer_list_billable_metrics_response.rbi +2 -0
  211. data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
  212. data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
  213. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbi +51 -0
  214. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +265 -0
  215. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +348 -0
  216. data/rbi/metronome_sdk/models/v1/customers/alert_list_params.rbi +4 -4
  217. data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
  218. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +68 -8
  219. data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +10 -0
  220. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +10 -0
  221. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +6 -90
  222. data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +6 -90
  223. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +54 -47
  224. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +316 -68
  225. data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
  226. data/rbi/metronome_sdk/models/v1/customers/plan_list_response.rbi +2 -0
  227. data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
  228. data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
  229. data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
  230. data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
  231. data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
  232. data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
  233. data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
  234. data/rbi/metronome_sdk/models/v1/plan_detail.rbi +2 -0
  235. data/rbi/metronome_sdk/models/v1/plan_list_charges_response.rbi +2 -0
  236. data/rbi/metronome_sdk/models/v1/plan_list_customers_response.rbi +2 -0
  237. data/rbi/metronome_sdk/models/v1/plan_list_response.rbi +8 -1
  238. data/rbi/metronome_sdk/models/v1/usage_list_response.rbi +45 -86
  239. data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +2 -0
  240. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +74 -76
  241. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +74 -76
  242. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +3875 -7234
  243. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1733 -6207
  244. data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +5 -9867
  245. data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +6 -9866
  246. data/rbi/metronome_sdk/models.rbi +44 -0
  247. data/rbi/metronome_sdk/resources/v1/alerts.rbi +101 -27
  248. data/rbi/metronome_sdk/resources/v1/audit_logs.rbi +39 -4
  249. data/rbi/metronome_sdk/resources/v1/billable_metrics.rbi +54 -4
  250. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +25 -5
  251. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rbi +7 -2
  252. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +10 -3
  253. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +109 -9
  254. data/rbi/metronome_sdk/resources/v1/contracts.rbi +258 -16
  255. data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +5 -1
  256. data/rbi/metronome_sdk/resources/v1/custom_fields.rbi +57 -14
  257. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +133 -11
  258. data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +119 -10
  259. data/rbi/metronome_sdk/resources/v1/customers/credits.rbi +104 -9
  260. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +159 -7
  261. data/rbi/metronome_sdk/resources/v1/customers.rbi +162 -14
  262. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +29 -3
  263. data/rbi/metronome_sdk/resources/v1/invoices.rbi +23 -2
  264. data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
  265. data/rbi/metronome_sdk/resources/v1/pricing_units.rbi +6 -1
  266. data/rbi/metronome_sdk/resources/v1/services.rbi +6 -4
  267. data/rbi/metronome_sdk/resources/v1/usage.rbi +191 -13
  268. data/rbi/metronome_sdk/resources/v1.rbi +3 -0
  269. data/rbi/metronome_sdk/resources/v2/contracts.rbi +134 -23
  270. data/sig/metronome_sdk/errors.rbs +7 -0
  271. data/sig/metronome_sdk/file_part.rbs +1 -1
  272. data/sig/metronome_sdk/internal/body_cursor_page.rbs +13 -0
  273. data/sig/metronome_sdk/internal/cursor_page_without_limit.rbs +13 -0
  274. data/sig/metronome_sdk/models/base_threshold_commit.rbs +26 -0
  275. data/sig/metronome_sdk/models/commit.rbs +17 -170
  276. data/sig/metronome_sdk/models/commit_hierarchy_configuration.rbs +117 -0
  277. data/sig/metronome_sdk/models/commit_rate.rbs +48 -0
  278. data/sig/metronome_sdk/models/commit_specifier.rbs +47 -0
  279. data/sig/metronome_sdk/models/commit_specifier_input.rbs +47 -0
  280. data/sig/metronome_sdk/models/contract.rbs +398 -0
  281. data/sig/metronome_sdk/models/contract_v2.rbs +3108 -0
  282. data/sig/metronome_sdk/models/contract_without_amendments.rbs +54 -976
  283. data/sig/metronome_sdk/models/credit.rbs +12 -170
  284. data/sig/metronome_sdk/models/hierarchy_configuration.rbs +152 -0
  285. data/sig/metronome_sdk/models/override.rbs +12 -101
  286. data/sig/metronome_sdk/models/override_tier.rbs +17 -0
  287. data/sig/metronome_sdk/models/overwrite_rate.rbs +78 -0
  288. data/sig/metronome_sdk/models/payment_gate_config.rbs +124 -0
  289. data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +124 -0
  290. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +82 -0
  291. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +82 -0
  292. data/sig/metronome_sdk/models/recurring_commit_subscription_config.rbs +51 -0
  293. data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +35 -0
  294. data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +35 -0
  295. data/sig/metronome_sdk/models/subscription.rbs +295 -0
  296. data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +28 -0
  297. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +4 -2
  298. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +26 -341
  299. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +219 -1184
  300. data/sig/metronome_sdk/models/v1/contract_list_balances_response.rbs +4 -25
  301. data/sig/metronome_sdk/models/v1/contract_list_response.rbs +4 -1041
  302. data/sig/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbs +6 -54
  303. data/sig/metronome_sdk/models/v1/contract_retrieve_response.rbs +4 -1041
  304. data/sig/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbs +6 -54
  305. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbs +6 -54
  306. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +6 -54
  307. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +6 -54
  308. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbs +6 -54
  309. data/sig/metronome_sdk/models/v1/credit_grant_list_entries_response.rbs +72 -94
  310. data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +53 -75
  311. data/sig/metronome_sdk/models/v1/customer_create_params.rbs +31 -4
  312. data/sig/metronome_sdk/models/v1/customer_detail.rbs +5 -0
  313. data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
  314. data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -4
  315. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbs +32 -0
  316. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +113 -0
  317. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +133 -0
  318. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +21 -0
  319. data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +7 -1
  320. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +6 -1
  321. data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +6 -50
  322. data/sig/metronome_sdk/models/v1/customers/credit_create_params.rbs +6 -50
  323. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +4 -2
  324. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +137 -24
  325. data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
  326. data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
  327. data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
  328. data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
  329. data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
  330. data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
  331. data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
  332. data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
  333. data/sig/metronome_sdk/models/v1/usage_list_response.rbs +33 -55
  334. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +28 -43
  335. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +28 -43
  336. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +412 -1793
  337. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +342 -2149
  338. data/sig/metronome_sdk/models/v2/contract_list_response.rbs +4 -4426
  339. data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +4 -4426
  340. data/sig/metronome_sdk/models.rbs +38 -0
  341. data/sig/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbs +1 -1
  342. data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -3
  343. data/sig/metronome_sdk/resources/v1/credit_grants.rbs +1 -1
  344. data/sig/metronome_sdk/resources/v1/custom_fields.rbs +1 -1
  345. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +2 -1
  346. data/sig/metronome_sdk/resources/v1/customers/commits.rbs +2 -2
  347. data/sig/metronome_sdk/resources/v1/customers/credits.rbs +2 -2
  348. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
  349. data/sig/metronome_sdk/resources/v1/customers.rbs +11 -0
  350. data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
  351. data/sig/metronome_sdk/resources/v1/usage.rbs +1 -1
  352. data/sig/metronome_sdk/resources/v1.rbs +2 -0
  353. data/sig/metronome_sdk/resources/v2/contracts.rbs +10 -4
  354. metadata +101 -11
  355. data/lib/metronome_sdk/models/v1/customers/alert_list_response.rb +0 -29
  356. data/lib/metronome_sdk/models/v1/customers/commit_list_response.rb +0 -26
  357. data/lib/metronome_sdk/models/v1/customers/credit_list_response.rb +0 -26
  358. data/rbi/metronome_sdk/models/v1/customers/alert_list_response.rbi +0 -46
  359. data/rbi/metronome_sdk/models/v1/customers/commit_list_response.rbi +0 -45
  360. data/rbi/metronome_sdk/models/v1/customers/credit_list_response.rbi +0 -45
  361. data/sig/metronome_sdk/models/v1/customers/alert_list_response.rbs +0 -29
  362. data/sig/metronome_sdk/models/v1/customers/commit_list_response.rbs +0 -26
  363. data/sig/metronome_sdk/models/v1/customers/credit_list_response.rbs +0 -26
@@ -39,10 +39,24 @@ module MetronomeSDK
39
39
  mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
40
40
  end
41
41
 
42
+ BaseThresholdCommit = MetronomeSDK::Models::BaseThresholdCommit
43
+
42
44
  BaseUsageFilter = MetronomeSDK::Models::BaseUsageFilter
43
45
 
44
46
  Commit = MetronomeSDK::Models::Commit
45
47
 
48
+ CommitHierarchyConfiguration = MetronomeSDK::Models::CommitHierarchyConfiguration
49
+
50
+ CommitRate = MetronomeSDK::Models::CommitRate
51
+
52
+ CommitSpecifier = MetronomeSDK::Models::CommitSpecifier
53
+
54
+ CommitSpecifierInput = MetronomeSDK::Models::CommitSpecifierInput
55
+
56
+ Contract = MetronomeSDK::Models::Contract
57
+
58
+ ContractV2 = MetronomeSDK::Models::ContractV2
59
+
46
60
  ContractWithoutAmendments = MetronomeSDK::Models::ContractWithoutAmendments
47
61
 
48
62
  Credit = MetronomeSDK::Models::Credit
@@ -53,24 +67,48 @@ module MetronomeSDK
53
67
 
54
68
  EventTypeFilter = MetronomeSDK::Models::EventTypeFilter
55
69
 
70
+ HierarchyConfiguration = MetronomeSDK::Models::HierarchyConfiguration
71
+
56
72
  ID = MetronomeSDK::Models::ID
57
73
 
58
74
  Override = MetronomeSDK::Models::Override
59
75
 
76
+ OverrideTier = MetronomeSDK::Models::OverrideTier
77
+
78
+ OverwriteRate = MetronomeSDK::Models::OverwriteRate
79
+
80
+ PaymentGateConfig = MetronomeSDK::Models::PaymentGateConfig
81
+
82
+ PaymentGateConfigV2 = MetronomeSDK::Models::PaymentGateConfigV2
83
+
84
+ PrepaidBalanceThresholdConfiguration = MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration
85
+
86
+ PrepaidBalanceThresholdConfigurationV2 = MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2
87
+
60
88
  PropertyFilter = MetronomeSDK::Models::PropertyFilter
61
89
 
62
90
  ProService = MetronomeSDK::Models::ProService
63
91
 
64
92
  Rate = MetronomeSDK::Models::Rate
65
93
 
94
+ RecurringCommitSubscriptionConfig = MetronomeSDK::Models::RecurringCommitSubscriptionConfig
95
+
66
96
  ScheduledCharge = MetronomeSDK::Models::ScheduledCharge
67
97
 
68
98
  ScheduleDuration = MetronomeSDK::Models::ScheduleDuration
69
99
 
70
100
  SchedulePointInTime = MetronomeSDK::Models::SchedulePointInTime
71
101
 
102
+ SpendThresholdConfiguration = MetronomeSDK::Models::SpendThresholdConfiguration
103
+
104
+ SpendThresholdConfigurationV2 = MetronomeSDK::Models::SpendThresholdConfigurationV2
105
+
106
+ Subscription = MetronomeSDK::Models::Subscription
107
+
72
108
  Tier = MetronomeSDK::Models::Tier
73
109
 
110
+ UpdateBaseThresholdCommit = MetronomeSDK::Models::UpdateBaseThresholdCommit
111
+
74
112
  V1 = MetronomeSDK::Models::V1
75
113
 
76
114
  V2 = MetronomeSDK::Models::V2
@@ -7,33 +7,77 @@ module MetronomeSDK
7
7
  # Some parameter documentations has been truncated, see
8
8
  # {MetronomeSDK::Models::V1::AlertCreateParams} for more details.
9
9
  #
10
- # Create a new alert
10
+ # Create a new threshold notification to monitor customer spending, balances, and
11
+ # billing metrics in real-time. Metronome's notification system provides
12
+ # industry-leading speed with immediate evaluation capabilities, enabling you to
13
+ # proactively manage customer accounts and prevent revenue leakage.
14
+ #
15
+ # This endpoint creates configurable threshold notifications that continuously
16
+ # monitor various billing thresholds including spend limits, credit balances,
17
+ # commitment utilization, and invoice totals. Threshold notifications can be
18
+ # configured globally for all customers or targeted to specific customer accounts.
19
+ #
20
+ # ### Use this endpoint to:
21
+ #
22
+ # - Proactively monitor customer spending patterns to prevent unexpected overages
23
+ # or credit exhaustion
24
+ # - Automate notifications when customers approach commitment limits or credit
25
+ # thresholds
26
+ # - Enable real-time intervention for accounts at risk of churn or payment issues
27
+ # - Scale billing operations by automating threshold-based workflows and
28
+ # notifications
29
+ #
30
+ # ### Key response fields:
31
+ #
32
+ # A successful response returns a CustomerAlert object containing:
33
+ #
34
+ # - The threshold notification configuration with its unique ID and current status
35
+ # - The customer's evaluation status (ok, in_alarm, or evaluating)
36
+ # - Threshold notification metadata including type, threshold values, and update
37
+ # timestamps
38
+ #
39
+ # ### Usage guidelines:
40
+ #
41
+ # - Immediate evaluation: Set `evaluate_on_create` : `true` (default) for instant
42
+ # evaluation against existing customers
43
+ # - Uniqueness constraints: Each threshold notification must have a unique
44
+ # `uniqueness_key` within your organization. Use `release_uniqueness_key` :
45
+ # `true` when archiving to reuse keys
46
+ # - Notification type requirements: Different threshold notification types require
47
+ # specific fields (e.g., `billable_metric_id` for usage notifications,
48
+ # `credit_type_id` for credit-based threshold notifications)
49
+ # - Webhook delivery: Threshold notifications trigger webhook notifications for
50
+ # real-time integration with your systems. Configure webhook endpoints before
51
+ # creating threshold notifications
52
+ # - Performance at scale: Metronome's event-driven architecture processes
53
+ # threshold notification evaluations in real-time as usage events stream in,
54
+ # unlike competitors who rely on periodic polling or batch evaluation cycles
11
55
  #
12
56
  # @overload create(alert_type:, name:, threshold:, billable_metric_id: nil, credit_grant_type_filters: nil, credit_type_id: nil, custom_field_filters: nil, customer_id: nil, evaluate_on_create: nil, group_values: nil, invoice_types_filter: nil, plan_id: nil, uniqueness_key: nil, request_options: {})
13
57
  #
14
- # @param alert_type [Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType] Type of the alert
58
+ # @param alert_type [Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType] Type of the threshold notification
15
59
  #
16
- # @param name [String] Name of the alert
60
+ # @param name [String] Name of the threshold notification
17
61
  #
18
- # @param threshold [Float] Threshold value of the alert policy. Depending upon the alert type, this number
62
+ # @param threshold [Float] Threshold value of the notification policy. Depending upon the notification typ
19
63
  #
20
- # @param billable_metric_id [String] For alerts of type `usage_threshold_reached`, specifies which billable metric to
64
+ # @param billable_metric_id [String] For threshold notifications of type `usage_threshold_reached`, specifies which b
21
65
  #
22
- # @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this alert ap
66
+ # @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this threshol
23
67
  #
24
- # @param credit_type_id [String] ID of the credit's currency, defaults to USD. If the specific alert type require
68
+ # @param credit_type_id [String] ID of the credit's currency, defaults to USD. If the specific notification type
25
69
  #
26
- # @param custom_field_filters [Array<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>] A list of custom field filters for alert types that support advanced filtering.
70
+ # @param custom_field_filters [Array<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>] A list of custom field filters for threshold notification types that support adv
27
71
  #
28
- # @param customer_id [String] If provided, will create this alert for this specific customer. To create an ale
72
+ # @param customer_id [String] If provided, will create this threshold notification for this specific customer.
29
73
  #
30
- # @param evaluate_on_create [Boolean] If true, the alert will evaluate immediately on customers that already meet the
74
+ # @param evaluate_on_create [Boolean] If true, the threshold notification will evaluate immediately on customers that
31
75
  #
32
- # @param group_values [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>] Only present for `spend_threshold_reached` alerts. Scope alert to a specific gro
76
+ # @param group_values [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>] Only present for `spend_threshold_reached` notifications. Scope notification to
33
77
  #
34
- # @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached alerts. A list of invoice types to eval
78
+ # @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached threshold notifications. A list of invo
35
79
  #
36
- # @param plan_id [String] If provided, will create this alert for this specific plan. To create an alert f
80
+ # @param plan_id [String] If provided, will create this threshold notification for this specific plan. To
37
81
  #
38
82
  # @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
39
83
  #
@@ -53,13 +97,43 @@ module MetronomeSDK
53
97
  )
54
98
  end
55
99
 
56
- # Archive an existing alert
100
+ # Some parameter documentations has been truncated, see
101
+ # {MetronomeSDK::Models::V1::AlertArchiveParams} for more details.
102
+ #
103
+ # Permanently disable a threshold notification and remove it from active
104
+ # monitoring across all customers. Archived threshold notifications stop
105
+ # evaluating immediately and can optionally release their uniqueness key for reuse
106
+ # in future threshold notification configurations.
107
+ #
108
+ # ### Use this endpoint to:
109
+ #
110
+ # - Decommission threshold notifications that are no longer needed
111
+ # - Clean up test or deprecated threshold notification configurations
112
+ # - Free up uniqueness keys for reuse with new threshold notifications
113
+ # - Stop threshold notification evaluations without losing historical
114
+ # configuration data
115
+ # - Disable outdated monitoring rules during pricing model transitions
116
+ #
117
+ # ### Key response fields:
118
+ #
119
+ # - data: Object containing the archived threshold notification's ID
120
+ #
121
+ # ### Usage guidelines:
122
+ #
123
+ # - Irreversible for evaluation: Archived threshold notifications cannot be
124
+ # re-enabled; create a new threshold notification to resume monitoring
125
+ # - Uniqueness key handling: Set `release_uniqueness_key` : `true` to reuse the
126
+ # key in future threshold notifications
127
+ # - Immediate effect: Threshold notification evaluation stops instantly across all
128
+ # customers
129
+ # - Historical preservation: Archive operation maintains threshold notification
130
+ # history and configuration for compliance and auditing
57
131
  #
58
132
  # @overload archive(id:, release_uniqueness_key: nil, request_options: {})
59
133
  #
60
- # @param id [String] The Metronome ID of the alert
134
+ # @param id [String] The Metronome ID of the threshold notification
61
135
  #
62
- # @param release_uniqueness_key [Boolean] If true, resets the uniqueness key on this alert so it can be re-used
136
+ # @param release_uniqueness_key [Boolean] If true, resets the uniqueness key on this threshold notification so it can be r
63
137
  #
64
138
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
65
139
  #
@@ -7,10 +7,45 @@ module MetronomeSDK
7
7
  # Some parameter documentations has been truncated, see
8
8
  # {MetronomeSDK::Models::V1::AuditLogListParams} for more details.
9
9
  #
10
- # Retrieves a range of audit logs. If no further audit logs are currently
11
- # available, the data array will be empty. As new audit logs are created,
12
- # subsequent requests using the same next_page value will be in the returned data
13
- # array, ensuring a continuous and uninterrupted reading of audit logs.
10
+ # Get a comprehensive audit trail of all operations performed in your Metronome
11
+ # account, whether initiated through the API, web interface, or automated
12
+ # processes. This endpoint provides detailed logs of who did what and when,
13
+ # enabling compliance reporting, security monitoring, and operational
14
+ # troubleshooting across all interaction channels.
15
+ #
16
+ # ### Use this endpoint to:
17
+ #
18
+ # - Monitor all account activity for security and compliance purposes
19
+ # - Track configuration changes regardless of source (API, UI, or system)
20
+ # - Investigate issues by reviewing historical operations
21
+ #
22
+ # ### Key response fields:
23
+ #
24
+ # An array of AuditLog objects containing:
25
+ #
26
+ # - id: Unique identifier for the audit log entry
27
+ # - timestamp: When the action occurred (RFC 3339 format)
28
+ # - actor: Information about who performed the action
29
+ # - request: Details including request ID, IP address, and user agent
30
+ # - `resource_type`: The type of resource affected (e.g., customer, contract,
31
+ # invoice)
32
+ # - `resource_id`: The specific resource identifier
33
+ # - `action`: The operation performed
34
+ # - `next_page`: Cursor for continuous log retrieval
35
+ #
36
+ # ### Usage guidelines:
37
+ #
38
+ # - Continuous retrieval: The next_page token enables uninterrupted log
39
+ # streaming—save it between requests to ensure no logs are missed
40
+ # - Empty responses: An empty data array means no new logs yet; continue polling
41
+ # with the same next_page token
42
+ # - Date filtering:
43
+ # - `starting_on`: Earliest logs to return (inclusive)
44
+ # - `ending_before`: Latest logs to return (exclusive)
45
+ # - Cannot be used with `next_page`
46
+ # - Resource filtering: Must specify both `resource_type` and `resource_id`
47
+ # together
48
+ # - Sort order: Default is `date_asc`; use `date_desc` for newest first
14
49
  #
15
50
  # @overload list(ending_before: nil, limit: nil, next_page: nil, resource_id: nil, resource_type: nil, sort: nil, starting_on: nil, request_options: {})
16
51
  #
@@ -7,7 +7,35 @@ module MetronomeSDK
7
7
  # Some parameter documentations has been truncated, see
8
8
  # {MetronomeSDK::Models::V1::BillableMetricCreateParams} for more details.
9
9
  #
10
- # Creates a new Billable Metric.
10
+ # Create billable metrics programmatically with this endpoint—an essential step in
11
+ # configuring your pricing and packaging in Metronome.
12
+ #
13
+ # A billable metric is a customizable query that filters and aggregates events
14
+ # from your event stream. These metrics are continuously tracked as usage data
15
+ # enters Metronome through the ingestion pipeline. The ingestion process
16
+ # transforms raw usage data into actionable pricing metrics, enabling accurate
17
+ # metering and billing for your products.
18
+ #
19
+ # ### Use this endpoint to:
20
+ #
21
+ # - Create individual or multiple billable metrics as part of a setup workflow.
22
+ # - Automate the entire pricing configuration process, from metric creation to
23
+ # customer contract setup.
24
+ # - Define metrics using either standard filtering/aggregation or a custom SQL
25
+ # query.
26
+ #
27
+ # ### Key response fields:
28
+ #
29
+ # - The ID of the billable metric that was created
30
+ # - The created billable metric will be available to be used in Products, usage
31
+ # endpoints, and alerts.
32
+ #
33
+ # ### Usage guidelines:
34
+ #
35
+ # - Metrics defined using standard filtering and aggregation are Streaming
36
+ # billable metrics, which have been optimized for ultra low latency and high
37
+ # throughput workflows.
38
+ # - Use SQL billable metrics if you require more flexible aggregation options.
11
39
  #
12
40
  # @overload create(name:, aggregation_key: nil, aggregation_type: nil, custom_fields: nil, event_type_filter: nil, group_keys: nil, property_filters: nil, sql: nil, request_options: {})
13
41
  #
@@ -43,7 +71,17 @@ module MetronomeSDK
43
71
  )
44
72
  end
45
73
 
46
- # Get a billable metric.
74
+ # Retrieves the complete configuration for a specific billable metric by its ID.
75
+ # Use this to review billable metric setup before associating it with products.
76
+ # Returns the metric's `name`, `event_type_filter`, `property_filters`,
77
+ # `aggregation_type`, `aggregation_key`, `group_keys`, `custom fields`, and
78
+ # `SQL query` (if it's a SQL billable metric).
79
+ #
80
+ # Important:
81
+ #
82
+ # - Archived billable metrics will include an `archived_at` timestamp; they no
83
+ # longer process new usage events but remain accessible for historical
84
+ # reference.
47
85
  #
48
86
  # @overload retrieve(billable_metric_id:, request_options: {})
49
87
  #
@@ -67,7 +105,11 @@ module MetronomeSDK
67
105
  )
68
106
  end
69
107
 
70
- # List all billable metrics.
108
+ # Retrieves all billable metrics with their complete configurations. Use this for
109
+ # programmatic discovery and management of billable metrics, such as associating
110
+ # metrics to products and auditing for orphaned or archived metrics. Important:
111
+ # Archived metrics are excluded by default; use `include_archived`=`true`
112
+ # parameter to include them.
71
113
  #
72
114
  # @overload list(include_archived: nil, limit: nil, next_page: nil, request_options: {})
73
115
  #
@@ -94,7 +136,15 @@ module MetronomeSDK
94
136
  )
95
137
  end
96
138
 
97
- # Archive an existing billable metric.
139
+ # Use this endpoint to retire billable metrics that are no longer used. After a
140
+ # billable metric is archived, that billable metric can no longer be used in any
141
+ # new Products to define how that product should be metered. If you archive a
142
+ # billable metric that is already associated with a Product, the Product will
143
+ # continue to function as usual, metering based on the definition of the archived
144
+ # billable metric.
145
+ #
146
+ # Archived billable metrics will be returned on the `getBillableMetric` and
147
+ # `listBillableMetrics` endpoints with a populated `archived_at` field.
98
148
  #
99
149
  # @overload archive(id:, request_options: {})
100
150
  #
@@ -8,7 +8,11 @@ module MetronomeSDK
8
8
  # Some parameter documentations has been truncated, see
9
9
  # {MetronomeSDK::Models::V1::Contracts::ProductCreateParams} for more details.
10
10
  #
11
- # Create a new product
11
+ # Create a new product object. Products in Metronome represent your company's
12
+ # individual product or service offerings. A Product can be thought of as the
13
+ # basic unit of a line item on the invoice. This is analogous to SKUs or items in
14
+ # an ERP system. Give the product a meaningful name as they will appear on
15
+ # customer invoices.
12
16
  #
13
17
  # @overload create(name:, type:, billable_metric_id: nil, composite_product_ids: nil, composite_tags: nil, custom_fields: nil, exclude_free_usage: nil, is_refundable: nil, netsuite_internal_item_id: nil, netsuite_overage_item_id: nil, presentation_group_key: nil, pricing_group_key: nil, quantity_conversion: nil, quantity_rounding: nil, tags: nil, request_options: {})
14
18
  #
@@ -22,7 +26,7 @@ module MetronomeSDK
22
26
  #
23
27
  # @param composite_tags [Array<String>] Required for COMPOSITE products
24
28
  #
25
- # @param custom_fields [Hash{Symbol=>String}]
29
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
26
30
  #
27
31
  # @param exclude_free_usage [Boolean] Beta feature only available for composite products. If true, products with $0 wi
28
32
  #
@@ -58,7 +62,7 @@ module MetronomeSDK
58
62
  )
59
63
  end
60
64
 
61
- # Get a specific product
65
+ # Retrieve a product by its ID, including all metadata and historical changes.
62
66
  #
63
67
  # @overload retrieve(id:, request_options: {})
64
68
  #
@@ -82,7 +86,17 @@ module MetronomeSDK
82
86
  # Some parameter documentations has been truncated, see
83
87
  # {MetronomeSDK::Models::V1::Contracts::ProductUpdateParams} for more details.
84
88
  #
85
- # Update a product
89
+ # Updates a product's configuration while maintaining billing continuity for
90
+ # active customers. Use this endpoint to modify product names, metrics, pricing
91
+ # rules, and composite settings without disrupting ongoing billing cycles. Changes
92
+ # are scheduled using the starting_at timestamp, which must be on an hour
93
+ # boundary—set future dates to schedule updates ahead of time, or past dates for
94
+ # retroactive changes. Returns the updated product ID upon success.
95
+ #
96
+ # ### Usage guidance:
97
+ #
98
+ # - Product type cannot be changed after creation. For incorrect product types,
99
+ # create a new product and archive the original instead.
86
100
  #
87
101
  # @overload update(product_id:, starting_at:, billable_metric_id: nil, composite_product_ids: nil, composite_tags: nil, exclude_free_usage: nil, is_refundable: nil, name: nil, netsuite_internal_item_id: nil, netsuite_overage_item_id: nil, presentation_group_key: nil, pricing_group_key: nil, quantity_conversion: nil, quantity_rounding: nil, tags: nil, request_options: {})
88
102
  #
@@ -135,7 +149,9 @@ module MetronomeSDK
135
149
  # Some parameter documentations has been truncated, see
136
150
  # {MetronomeSDK::Models::V1::Contracts::ProductListParams} for more details.
137
151
  #
138
- # List products
152
+ # Get a paginated list of all products in your organization with their complete
153
+ # configuration, version history, and metadata. By default excludes archived
154
+ # products unless explicitly requested via the `archive_filter` parameter.
139
155
  #
140
156
  # @overload list(limit: nil, next_page: nil, archive_filter: nil, request_options: {})
141
157
  #
@@ -164,7 +180,10 @@ module MetronomeSDK
164
180
  )
165
181
  end
166
182
 
167
- # Archive a product
183
+ # Archive a product. Any current rate cards associated with this product will
184
+ # continue to function as normal. However, it will no longer be available as an
185
+ # option for newly created rates. Once you archive a product, you can still
186
+ # retrieve it in the UI and API, but you cannot unarchive it.
168
187
  #
169
188
  # @overload archive(product_id:, request_options: {})
170
189
  #
@@ -6,7 +6,10 @@ module MetronomeSDK
6
6
  class Contracts
7
7
  class RateCards
8
8
  class ProductOrders
9
- # Updates ordering of specified products
9
+ # The ordering of products on a rate card determines the order in which the
10
+ # products will appear on customers' invoices. Use this endpoint to set the order
11
+ # of specific products on the rate card by moving them relative to their current
12
+ # location.
10
13
  #
11
14
  # @overload update(product_moves:, rate_card_id:, request_options: {})
12
15
  #
@@ -30,7 +33,9 @@ module MetronomeSDK
30
33
  )
31
34
  end
32
35
 
33
- # Sets the ordering of products within a rate card
36
+ # The ordering of products on a rate card determines the order in which the
37
+ # products will appear on customers' invoices. Use this endpoint to set the order
38
+ # of products on the rate card.
34
39
  #
35
40
  # @overload set(product_order:, rate_card_id:, request_options: {})
36
41
  #
@@ -10,7 +10,15 @@ module MetronomeSDK
10
10
  # {MetronomeSDK::Models::V1::Contracts::RateCards::RateListParams} for more
11
11
  # details.
12
12
  #
13
- # Get all rates for a rate card at a point in time
13
+ # Understand the rate schedule at a given timestamp, optionally filtering the list
14
+ # of rates returned based on properties such as `product_id` and
15
+ # `pricing_group_values`. For example, you may want to display the current price
16
+ # for a given product in your product experience - use this endpoint to fetch that
17
+ # information from its source of truth in Metronome.
18
+ #
19
+ # If you want to understand the rates for a specific customer's contract,
20
+ # inclusive of contract-level overrides, use the `getContractRateSchedule`
21
+ # endpoint.
14
22
  #
15
23
  # @overload list(at:, rate_card_id:, limit: nil, next_page: nil, selectors: nil, request_options: {})
16
24
  #
@@ -63,7 +71,7 @@ module MetronomeSDK
63
71
  #
64
72
  # @param billing_frequency [Symbol, MetronomeSDK::Models::V1::Contracts::RateCards::RateAddParams::BillingFrequency] Optional. Frequency to bill subscriptions with. Required for subscription type p
65
73
  #
66
- # @param commit_rate [MetronomeSDK::Models::V1::Contracts::RateCards::RateAddParams::CommitRate] A distinct rate on the rate card. You can choose to use this rate rather than li
74
+ # @param commit_rate [MetronomeSDK::Models::CommitRate] A distinct rate on the rate card. You can choose to use this rate rather than li
67
75
  #
68
76
  # @param credit_type_id [String] The Metronome ID of the credit type to associate with price, defaults to USD (ce
69
77
  #
@@ -17,7 +17,39 @@ module MetronomeSDK
17
17
  # Some parameter documentations has been truncated, see
18
18
  # {MetronomeSDK::Models::V1::Contracts::RateCardCreateParams} for more details.
19
19
  #
20
- # Create a new rate card
20
+ # In Metronome, the rate card is the central location for your pricing. Rate cards
21
+ # were built with new product launches and pricing changes in mind - you can
22
+ # update your products and pricing in one place, and that change will be
23
+ # automatically propagated across your customer cohorts. Most clients need only
24
+ # maintain one or a few rate cards within Metronome.
25
+ #
26
+ # ### Use this endpoint to:
27
+ #
28
+ # - Create a rate card with a name and description
29
+ # - Define the rate card's single underlying fiat currency, and any number of
30
+ # conversion rates between that fiat currency and custom pricing units. You can
31
+ # then add products and associated rates in the fiat currency or custom pricing
32
+ # unit for which you have defined a conversion rate.
33
+ # - Set aliases for the rate card. Aliases are human-readable names that you can
34
+ # use in the place of the id of the rate card when provisioning a customer's
35
+ # contract. By using an alias, you can easily create a contract and provision a
36
+ # customer by choosing the paygo rate card, without storing the rate card id in
37
+ # your internal systems. This is helpful when launching a new rate card for
38
+ # paygo customers, you can update the alias for paygo to be scheduled to be
39
+ # assigned to the new rate card without updating your code.
40
+ #
41
+ # ### Key response fields:
42
+ #
43
+ # - The ID of the rate card you just created
44
+ #
45
+ # ### Usage guidelines:
46
+ #
47
+ # - After creating a rate card, you can now use the addRate or addRates endpoints
48
+ # to add products and their prices to it
49
+ # - A rate card alias can only be used by one rate card at a time. If you create a
50
+ # contract with a rate card alias that is already in use by another rate card,
51
+ # the original rate card's alias schedule will be updated. The alias will
52
+ # reference the rate card to which it was most recently assigned.
21
53
  #
22
54
  # @overload create(name:, aliases: nil, credit_type_conversions: nil, custom_fields: nil, description: nil, fiat_credit_type_id: nil, request_options: {})
23
55
  #
@@ -27,7 +59,7 @@ module MetronomeSDK
27
59
  #
28
60
  # @param credit_type_conversions [Array<MetronomeSDK::Models::V1::Contracts::RateCardCreateParams::CreditTypeConversion>] Required when using custom pricing units in rates.
29
61
  #
30
- # @param custom_fields [Hash{Symbol=>String}]
62
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
31
63
  #
32
64
  # @param description [String]
33
65
  #
@@ -49,8 +81,9 @@ module MetronomeSDK
49
81
  )
50
82
  end
51
83
 
52
- # Get a specific rate card NOTE: Use `/contract-pricing/rate-cards/getRates` to
53
- # retrieve rate card rates.
84
+ # Return details for a specific rate card including name, description, and
85
+ # aliases. This endpoint does not return rates - use the dedicated getRates or
86
+ # getRateSchedule endpoints to understand the rates on a rate card.
54
87
  #
55
88
  # @overload retrieve(id:, request_options: {})
56
89
  #
@@ -74,7 +107,58 @@ module MetronomeSDK
74
107
  # Some parameter documentations has been truncated, see
75
108
  # {MetronomeSDK::Models::V1::Contracts::RateCardUpdateParams} for more details.
76
109
  #
77
- # Update a rate card
110
+ # Update the metadata properties of an existing rate card, including its name,
111
+ # description, and aliases. This endpoint is designed for managing rate card
112
+ # identity and reference aliases rather than modifying pricing rates.
113
+ #
114
+ # Modifies the descriptive properties and alias configuration of a rate card
115
+ # without affecting the underlying pricing rates or schedules. This allows you to
116
+ # update how a rate card is identified and referenced throughout your system.
117
+ #
118
+ # ### Use this endpoint to:
119
+ #
120
+ # - Rate card renaming: Update display names or descriptions for organizational
121
+ # clarity
122
+ # - Alias management: Add, modify, or schedule alias transitions for seamless rate
123
+ # card migrations
124
+ # - Documentation updates: Keep rate card descriptions current with business
125
+ # context
126
+ # - Self-serve provisioning setup: Configure aliases to enable code-free rate card
127
+ # transitions
128
+ #
129
+ # #### Active contract impact:
130
+ #
131
+ # - Alias changes: Already-created contracts continue using their originally
132
+ # assigned rate cards.
133
+ # - Other changes made using this endpoint will only impact the Metronome UI.
134
+ #
135
+ # #### Grandfathering existing PLG customer pricing:
136
+ #
137
+ # - Rate card aliases support scheduled transitions, enabling seamless rate card
138
+ # migrations for new customers, allowing existing customers to be grandfathered
139
+ # into their existing prices without code. Note that there are multiple
140
+ # mechanisms to support grandfathering in Metronome.
141
+ #
142
+ # #### How scheduled aliases work for PLG grandfathering:
143
+ #
144
+ # Initial setup:
145
+ #
146
+ # - Add alias to current rate card: Assign a stable alias (e.g.,
147
+ # "standard-pricing") to your active rate card
148
+ # - Reference alias during contract creation: Configure your self-serve workflow
149
+ # to create contracts using `rate_card_alias` instead of direct `rate_card_id`
150
+ # - Automatic resolution: New contracts referencing the alias automatically
151
+ # resolve to the rate card associated with the alias at the point in time of
152
+ # provisioning
153
+ #
154
+ # #### Grandfathering process:
155
+ #
156
+ # - Create new rate card: Build your new rate card with updated pricing structure
157
+ # - Schedule alias transition: Add the same alias to the new rate card with a
158
+ # `starting_at` timestamp
159
+ # - Automatic cutover: Starting at the scheduled time, new contracts created in
160
+ # your PLG workflow using that alias will automatically reference the new rate
161
+ # card
78
162
  #
79
163
  # @overload update(rate_card_id:, aliases: nil, description: nil, name: nil, request_options: {})
80
164
  #
@@ -102,8 +186,9 @@ module MetronomeSDK
102
186
  )
103
187
  end
104
188
 
105
- # List rate cards NOTE: Use `/contract-pricing/rate-cards/getRates` to retrieve
106
- # rate card rates.
189
+ # List all rate cards. Returns rate card IDs, names, descriptions, aliases, and
190
+ # other details. To view the rates associated with a given rate card, use the
191
+ # getRates or getRateSchedule endpoints.
107
192
  #
108
193
  # @overload list(limit: nil, next_page: nil, body: nil, request_options: {})
109
194
  #
@@ -131,7 +216,11 @@ module MetronomeSDK
131
216
  )
132
217
  end
133
218
 
134
- # Archive a rate card
219
+ # Permanently disable a rate card by archiving it, preventing use in new contracts
220
+ # while preserving existing contract pricing. Use this when retiring old pricing
221
+ # models, consolidating rate cards, or removing outdated pricing structures.
222
+ # Returns the archived rate card ID and stops the rate card from appearing in
223
+ # contract creation workflows.
135
224
  #
136
225
  # @overload archive(id:, request_options: {})
137
226
  #
@@ -156,8 +245,18 @@ module MetronomeSDK
156
245
  # {MetronomeSDK::Models::V1::Contracts::RateCardRetrieveRateScheduleParams} for
157
246
  # more details.
158
247
  #
159
- # Get all rates for a rate card from starting_at (either in perpetuity or until
160
- # ending_before, if provided)
248
+ # A rate card defines the prices that you charge for your products. Rate cards
249
+ # support scheduled changes over time, to allow you to easily roll out pricing
250
+ # changes and new product launches across your customer base. Use this endpoint to
251
+ # understand the rate schedule `starting_at` a given date, optionally filtering
252
+ # the list of rates returned based on product id or pricing group values. For
253
+ # example, you may want to display a schedule of upcoming price changes for a
254
+ # given product in your product experience - use this endpoint to fetch that
255
+ # information from its source of truth in Metronome.
256
+ #
257
+ # If you want to understand the rates for a specific customer's contract,
258
+ # inclusive of contract-level overrides, use the `getContractRateSchedule`
259
+ # endpoint.
161
260
  #
162
261
  # @overload retrieve_rate_schedule(rate_card_id:, starting_at:, limit: nil, next_page: nil, ending_before: nil, selectors: nil, request_options: {})
163
262
  #