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
@@ -5,7 +5,46 @@ module MetronomeSDK
5
5
  class V1
6
6
  class Customers
7
7
  class Invoices
8
- # Fetch a specific invoice for a given customer.
8
+ # Retrieve detailed information for a specific invoice by its unique identifier.
9
+ # This endpoint returns comprehensive invoice data including line items, applied
10
+ # credits, totals, and billing period details for both finalized and draft
11
+ # invoices.
12
+ #
13
+ # ### Use this endpoint to:
14
+ #
15
+ # - Display historical invoice details in customer-facing dashboards or billing
16
+ # portals.
17
+ # - Retrieve current month draft invoices to show customers their month-to-date
18
+ # spend.
19
+ # - Access finalized invoices for historical billing records and payment
20
+ # reconciliation.
21
+ # - Validate customer pricing and credit applications for customer support
22
+ # queries.
23
+ #
24
+ # ### Key response fields:
25
+ #
26
+ # Invoice status (DRAFT, FINALIZED, VOID) Billing period start and end dates Total
27
+ # amount and amount due after credits Detailed line items broken down by:
28
+ #
29
+ # - Customer and contract information
30
+ # - Invoice line item type
31
+ # - Product/service name and ID
32
+ # - Quantity consumed
33
+ # - Unit and total price
34
+ # - Time period for usage-based charges
35
+ # - Applied credits or prepaid commitments
36
+ #
37
+ # ### Usage guidelines:
38
+ #
39
+ # - Draft invoices update in real-time as usage is reported and may change before
40
+ # finalization
41
+ # - The response includes both usage-based line items (e.g., API calls, data
42
+ # processed) and scheduled charges (e.g., monthly subscriptions, commitment
43
+ # fees)
44
+ # - Credit and commitment applications are shown as separate line items with
45
+ # negative amounts
46
+ # - For voided invoices, the response will indicate VOID status but retain all
47
+ # original line item details
9
48
  sig do
10
49
  params(
11
50
  customer_id: String,
@@ -28,8 +67,52 @@ module MetronomeSDK
28
67
  )
29
68
  end
30
69
 
31
- # List all invoices for a given customer, optionally filtered by status, date
32
- # range, and/or credit type.
70
+ # Retrieves a paginated list of invoices for a specific customer, with flexible
71
+ # filtering options to narrow results by status, date range, credit type, and
72
+ # more. This endpoint provides a comprehensive view of a customer's billing
73
+ # history and current charges, supporting both real-time billing dashboards and
74
+ # historical reporting needs.
75
+ #
76
+ # ### Use this endpoint to:
77
+ #
78
+ # - Display historical invoice details in customer-facing dashboards or billing
79
+ # portals.
80
+ # - Retrieve current month draft invoices to show customers their month-to-date
81
+ # spend.
82
+ # - Access finalized invoices for historical billing records and payment
83
+ # reconciliation.
84
+ # - Validate customer pricing and credit applications for customer support
85
+ # queries.
86
+ # - Generate financial reports by filtering invoices within specific date ranges
87
+ #
88
+ # ### Key response fields:
89
+ #
90
+ # Array of invoice objects containing:
91
+ #
92
+ # - Invoice ID and status (DRAFT, FINALIZED, VOID)
93
+ # - Invoice type (USAGE, SCHEDULED)
94
+ # - Billing period start and end dates
95
+ # - Issue date and due date
96
+ # - Total amount, subtotal, and amount due
97
+ # - Applied credits summary
98
+ # - Contract ID reference
99
+ # - External billing provider status (if integrated with Stripe, etc.)
100
+ # - Pagination metadata `next_page` cursor
101
+ #
102
+ # ### Usage guidelines:
103
+ #
104
+ # - The endpoint returns invoice summaries; use the Get Invoice endpoint for
105
+ # detailed line items
106
+ # - Draft invoices are continuously updated as new usage is reported and will show
107
+ # real-time spend
108
+ # - Results are ordered by creation date descending by default (newest first)
109
+ # - When filtering by date range, the filter applies to the billing period, not
110
+ # the issue date
111
+ # - For customers with many invoices, implement pagination to ensure all results
112
+ # are retrieved External billing provider statuses (like Stripe payment status)
113
+ # are included when applicable
114
+ # - Voided invoices are included in results by default unless filtered out by
115
+ # status
33
116
  sig do
34
117
  params(
35
118
  customer_id: String,
@@ -113,11 +196,44 @@ module MetronomeSDK
113
196
  )
114
197
  end
115
198
 
116
- # List daily or hourly invoice breakdowns for a given customer, optionally
117
- # filtered by status, date range, and/or credit type. Important considerations:
199
+ # Retrieve granular time-series breakdowns of invoice data at hourly or daily
200
+ # intervals. This endpoint transforms standard invoices into detailed timelines,
201
+ # enabling you to track usage patterns, identify consumption spikes, and provide
202
+ # customers with transparency into their billing details throughout the billing
203
+ # period.
204
+ #
205
+ # ### Use this endpoint to:
206
+ #
207
+ # - Build usage analytics dashboards showing daily or hourly consumption trends
208
+ # - Identify peak usage periods for capacity planning and cost optimization
209
+ # - Generate detailed billing reports for finance teams and customer success
210
+ # - Troubleshoot billing disputes by examining usage patterns at specific times
211
+ # - Power real-time cost monitoring and alerting systems
212
+ #
213
+ # ### Key response fields:
118
214
  #
119
- # - If we receive backdated usage after an invoice has been finalized, the
120
- # backdated usage will be included in the response and usage numbers may differ.
215
+ # An array of BreakdownInvoice objects, each containing:
216
+ #
217
+ # - All standard invoice fields (ID, customer, commit, line items, totals, status)
218
+ # - Line items with quantities and costs for that specific period
219
+ # - `breakdown_start_timestamp`: Start of the specific time window
220
+ # - `breakdown_end_timestamp`: End of the specific time window
221
+ # - `next_page`: Pagination cursor for large result sets
222
+ #
223
+ # ### Usage guidelines:
224
+ #
225
+ # - Time granularity: Set `window_size` to hour or day based on your analysis
226
+ # needs
227
+ # - Response limits: Daily breakdowns return up to 35 days; hourly breakdowns
228
+ # return up to 24 hours per request
229
+ # - Date filtering: Use `starting_on` and `ending_before` to focus on specific
230
+ # periods
231
+ # - Performance: For large date ranges, use pagination to retrieve all data
232
+ # efficiently
233
+ # - Backdated usage: If usage events arrive after invoice finalization, breakdowns
234
+ # will reflect the updated usage
235
+ # - Zero quantity filtering: Use `skip_zero_qty_line_items=true` to exclude
236
+ # periods with no usage
121
237
  sig do
122
238
  params(
123
239
  customer_id: String,
@@ -171,6 +287,42 @@ module MetronomeSDK
171
287
  )
172
288
  end
173
289
 
290
+ # Retrieve a PDF version of a specific invoice by its unique identifier. This
291
+ # endpoint generates a professionally formatted invoice document suitable for
292
+ # sharing with customers, accounting teams, or for record-keeping purposes.
293
+ #
294
+ # ### Use this endpoint to:
295
+ #
296
+ # - Provide customers with downloadable or emailable copies of their invoices
297
+ # - Support accounting and finance teams with official billing documents
298
+ # - Maintain accurate records of billing transactions for audits and compliance
299
+ #
300
+ # ### Key response details:
301
+ #
302
+ # - The response is a binary PDF file representing the full invoice
303
+ # - The PDF includes all standard invoice information such as line items, totals,
304
+ # billing period, and customer details
305
+ # - The document is formatted for clarity and professionalism, suitable for
306
+ # official use
307
+ #
308
+ # ### Usage guidelines:
309
+ #
310
+ # - Ensure the `invoice_id` corresponds to an existing invoice for the specified
311
+ # `customer_id`
312
+ # - The PDF is generated on-demand; frequent requests for the same invoice may
313
+ # impact performance
314
+ # - Use appropriate headers to handle the binary response in your application
315
+ # (e.g., setting `Content-Type: application/pdf`)
316
+ sig do
317
+ params(
318
+ customer_id: String,
319
+ invoice_id: String,
320
+ request_options: MetronomeSDK::RequestOptions::OrHash
321
+ ).returns(StringIO)
322
+ end
323
+ def retrieve_pdf(customer_id:, invoice_id:, request_options: {})
324
+ end
325
+
174
326
  # @api private
175
327
  sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
176
328
  def self.new(client:)
@@ -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 notifications 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,
@@ -173,10 +232,10 @@ module MetronomeSDK
173
232
  )
174
233
  end
175
234
 
176
- # Preview how a set of events will affect a customer's invoice. Generates a draft
177
- # invoice for a customer using their current contract configuration and the
235
+ # Preview how a set of events will affect a customer's invoices. Generates draft
236
+ # invoices for a customer using their current contract configuration and the
178
237
  # provided events. This is useful for testing how new events will affect the
179
- # customer's invoice before they are actually processed.
238
+ # customer's invoices before they are actually processed.
180
239
  sig do
181
240
  params(
182
241
  customer_id: String,
@@ -206,9 +265,91 @@ 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
+ # - Multiple configurations can be added per destination. For example, you can
304
+ # create two Stripe billing configurations for a Metronome customer that each
305
+ # have a distinct `collection_method`.
306
+ #
307
+ # ### Delivery method options:
308
+ #
309
+ # - `direct_to_billing_provider`: Use when Metronome should send invoices directly
310
+ # to the billing provider's API (e.g., Stripe, NetSuite). This is the most
311
+ # common method for automated billing workflows.
312
+ # - `tackle`: Use specifically for AWS Marketplace transactions that require
313
+ # Tackle's co-selling platform for partner attribution and commission tracking.
314
+ # - `aws_sqs`: Use when you want invoice data delivered to an AWS SQS queue for
315
+ # custom processing before sending to your billing system.
316
+ # - `aws_sns`: Use when you want invoice notifications published to an AWS SNS
317
+ # topic for event-driven billing workflows.
318
+ #
319
+ # ### Key response fields:
320
+ #
321
+ # The id for the customer billing configuration. This id can be used to associate
322
+ # the billing configuration to a contract.
323
+ #
324
+ # ### Usage guidelines:
325
+ #
326
+ # Must use the `delivery_method_id` if you have multiple Stripe accounts connected
327
+ # to Metronome.
328
+ sig do
329
+ params(
330
+ data:
331
+ T::Array[
332
+ MetronomeSDK::V1::CustomerSetBillingConfigurationsParams::Data::OrHash
333
+ ],
334
+ request_options: MetronomeSDK::RequestOptions::OrHash
335
+ ).void
336
+ end
337
+ def set_billing_configurations(data:, request_options: {})
338
+ end
339
+
340
+ # Sets the ingest aliases for a customer. Use this endpoint to associate a
341
+ # Metronome customer with an internal ID for easier tracking between systems.
342
+ # Ingest aliases can be used in the `customer_id` field when sending usage events
343
+ # to Metronome.
344
+ #
345
+ # ### Usage guidelines:
346
+ #
347
+ # - This call is idempotent and fully replaces the set of ingest aliases for the
348
+ # given customer.
349
+ # - Switching an ingest alias from one customer to another will associate all
350
+ # corresponding usage to the new customer.
351
+ # - Use multiple ingest aliases to model child organizations within a single
352
+ # Metronome customer.
212
353
  sig do
213
354
  params(
214
355
  customer_id: String,
@@ -225,7 +366,11 @@ module MetronomeSDK
225
366
  )
226
367
  end
227
368
 
228
- # Updates the specified customer's name.
369
+ # Updates the display name for a customer record. Use this to correct customer
370
+ # names, update business names after rebranding, or maintain accurate customer
371
+ # information for invoicing and reporting. Returns the updated customer object
372
+ # with the new name applied immediately across all billing documents and
373
+ # interfaces.
229
374
  sig do
230
375
  params(
231
376
  customer_id: String,
@@ -243,7 +388,10 @@ module MetronomeSDK
243
388
  )
244
389
  end
245
390
 
246
- # Updates the specified customer's config.
391
+ # Update configuration settings for a specific customer, such as external system
392
+ # integrations (e.g., Salesforce account ID) and other customer-specific billing
393
+ # parameters. Use this endpoint to modify customer configurations without
394
+ # affecting core customer data like name or ingest aliases.
247
395
  sig do
248
396
  params(
249
397
  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,
@@ -0,0 +1,72 @@
1
+ # typed: strong
2
+
3
+ module MetronomeSDK
4
+ module Resources
5
+ class V1
6
+ class Payments
7
+ # Fetch all payment attempts for the given invoice.
8
+ sig do
9
+ params(
10
+ customer_id: String,
11
+ invoice_id: String,
12
+ limit: Integer,
13
+ next_page: String,
14
+ statuses: T::Array[MetronomeSDK::V1::PaymentStatus::OrSymbol],
15
+ request_options: MetronomeSDK::RequestOptions::OrHash
16
+ ).returns(
17
+ MetronomeSDK::Internal::BodyCursorPage[MetronomeSDK::V1::Payment]
18
+ )
19
+ end
20
+ def list(
21
+ customer_id:,
22
+ invoice_id:,
23
+ # The maximum number of payments to return. Defaults to 25.
24
+ limit: nil,
25
+ # The next page token from a previous response.
26
+ next_page: nil,
27
+ statuses: nil,
28
+ request_options: {}
29
+ )
30
+ end
31
+
32
+ # Trigger a new attempt by canceling any existing attempts for this invoice and
33
+ # creating a new Payment. This will trigger another attempt to charge the
34
+ # Customer's configured Payment Gateway. Payment can only be attempted if all of
35
+ # the following are true:
36
+ #
37
+ # - The Metronome Invoice is finalized
38
+ # - PLG Invoicing is configured for the Customer
39
+ # - You cannot attempt payments for invoices that have already been `paid` or
40
+ # `voided`.
41
+ #
42
+ # Attempting to payment on an ineligible Invoice or Customer will result in a
43
+ # `400` response.
44
+ sig do
45
+ params(
46
+ customer_id: String,
47
+ invoice_id: String,
48
+ request_options: MetronomeSDK::RequestOptions::OrHash
49
+ ).returns(MetronomeSDK::Models::V1::PaymentAttemptResponse)
50
+ end
51
+ def attempt(customer_id:, invoice_id:, request_options: {})
52
+ end
53
+
54
+ # Cancel an existing payment attempt for an invoice.
55
+ sig do
56
+ params(
57
+ customer_id: String,
58
+ invoice_id: String,
59
+ request_options: MetronomeSDK::RequestOptions::OrHash
60
+ ).returns(MetronomeSDK::Models::V1::PaymentCancelResponse)
61
+ end
62
+ def cancel(customer_id:, invoice_id:, request_options: {})
63
+ end
64
+
65
+ # @api private
66
+ sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
67
+ def self.new(client:)
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -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