metronome-sdk 0.3.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/README.md +9 -9
  4. data/lib/metronome_sdk/internal/body_cursor_page.rb +86 -0
  5. data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +86 -0
  6. data/lib/metronome_sdk/internal/transport/base_client.rb +1 -4
  7. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +1 -9
  8. data/lib/metronome_sdk/internal/type/base_model.rb +6 -13
  9. data/lib/metronome_sdk/internal/type/union.rb +11 -0
  10. data/lib/metronome_sdk/internal/util.rb +1 -1
  11. data/lib/metronome_sdk/models/base_threshold_commit.rb +36 -0
  12. data/lib/metronome_sdk/models/commit.rb +26 -170
  13. data/lib/metronome_sdk/models/commit_hierarchy_configuration.rb +98 -0
  14. data/lib/metronome_sdk/models/commit_rate.rb +48 -0
  15. data/lib/metronome_sdk/models/commit_specifier.rb +42 -0
  16. data/lib/metronome_sdk/models/commit_specifier_input.rb +42 -0
  17. data/lib/metronome_sdk/models/contract.rb +404 -0
  18. data/lib/metronome_sdk/models/contract_v2.rb +2919 -0
  19. data/lib/metronome_sdk/models/contract_without_amendments.rb +36 -1126
  20. data/lib/metronome_sdk/models/credit.rb +9 -156
  21. data/lib/metronome_sdk/models/discount.rb +2 -1
  22. data/lib/metronome_sdk/models/hierarchy_configuration.rb +76 -0
  23. data/lib/metronome_sdk/models/override.rb +6 -101
  24. data/lib/metronome_sdk/models/override_tier.rb +21 -0
  25. data/lib/metronome_sdk/models/overwrite_rate.rb +82 -0
  26. data/lib/metronome_sdk/models/payment_gate_config.rb +149 -0
  27. data/lib/metronome_sdk/models/payment_gate_config_v2.rb +149 -0
  28. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +100 -0
  29. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +102 -0
  30. data/lib/metronome_sdk/models/pro_service.rb +2 -1
  31. data/lib/metronome_sdk/models/recurring_commit_subscription_config.rb +51 -0
  32. data/lib/metronome_sdk/models/scheduled_charge.rb +2 -1
  33. data/lib/metronome_sdk/models/spend_threshold_configuration.rb +44 -0
  34. data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +44 -0
  35. data/lib/metronome_sdk/models/subscription.rb +227 -0
  36. data/lib/metronome_sdk/models/update_base_threshold_commit.rb +36 -0
  37. data/lib/metronome_sdk/models/v1/alert_create_params.rb +4 -6
  38. data/lib/metronome_sdk/models/v1/billable_metric_create_params.rb +1 -2
  39. data/lib/metronome_sdk/models/v1/billable_metric_list_response.rb +3 -3
  40. data/lib/metronome_sdk/models/v1/billable_metric_retrieve_response.rb +4 -7
  41. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +57 -411
  42. data/lib/metronome_sdk/models/v1/contract_create_historical_invoices_params.rb +7 -16
  43. data/lib/metronome_sdk/models/v1/contract_create_params.rb +236 -1478
  44. data/lib/metronome_sdk/models/v1/contract_list_balances_response.rb +6 -23
  45. data/lib/metronome_sdk/models/v1/contract_list_response.rb +3 -1153
  46. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_params.rb +2 -6
  47. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rb +5 -50
  48. data/lib/metronome_sdk/models/v1/contract_retrieve_response.rb +3 -1154
  49. data/lib/metronome_sdk/models/v1/contract_schedule_pro_services_invoice_params.rb +1 -3
  50. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +2 -1
  51. data/lib/metronome_sdk/models/v1/contracts/product_list_response.rb +8 -1
  52. data/lib/metronome_sdk/models/v1/contracts/product_retrieve_response.rb +8 -1
  53. data/lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb +1 -4
  54. data/lib/metronome_sdk/models/v1/contracts/rate_card_create_params.rb +4 -7
  55. data/lib/metronome_sdk/models/v1/contracts/rate_card_list_response.rb +10 -1
  56. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_params.rb +2 -6
  57. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rb +5 -50
  58. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rb +10 -1
  59. data/lib/metronome_sdk/models/v1/contracts/rate_card_update_params.rb +1 -3
  60. data/lib/metronome_sdk/models/v1/contracts/rate_cards/product_order_update_params.rb +1 -3
  61. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rb +6 -61
  62. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +3 -49
  63. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +4 -51
  64. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_params.rb +2 -6
  65. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rb +5 -49
  66. data/lib/metronome_sdk/models/v1/credit_grant_list_entries_response.rb +103 -123
  67. data/lib/metronome_sdk/models/v1/credit_grant_list_response.rb +3 -5
  68. data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +1 -3
  69. data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +41 -58
  70. data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +5 -1
  71. data/lib/metronome_sdk/models/v1/customer.rb +2 -1
  72. data/lib/metronome_sdk/models/v1/customer_create_params.rb +37 -11
  73. data/lib/metronome_sdk/models/v1/customer_detail.rb +2 -1
  74. data/lib/metronome_sdk/models/v1/customer_list_billable_metrics_response.rb +3 -3
  75. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +1 -3
  76. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rb +28 -0
  77. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +128 -0
  78. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +143 -0
  79. data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +1 -3
  80. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +30 -1
  81. data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +2 -0
  82. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +2 -0
  83. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +10 -60
  84. data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +6 -48
  85. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +8 -16
  86. data/lib/metronome_sdk/models/v1/customers/invoice.rb +61 -48
  87. data/lib/metronome_sdk/models/v1/customers/invoice_list_breakdowns_params.rb +1 -4
  88. data/lib/metronome_sdk/models/v1/customers/plan_add_params.rb +2 -6
  89. data/lib/metronome_sdk/models/v1/customers/plan_list_response.rb +2 -1
  90. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +4 -11
  91. data/lib/metronome_sdk/models/v1/plan_detail.rb +9 -5
  92. data/lib/metronome_sdk/models/v1/plan_list_charges_response.rb +2 -1
  93. data/lib/metronome_sdk/models/v1/plan_list_customers_response.rb +2 -1
  94. data/lib/metronome_sdk/models/v1/plan_list_response.rb +5 -1
  95. data/lib/metronome_sdk/models/v1/usage_ingest_params.rb +1 -4
  96. data/lib/metronome_sdk/models/v1/usage_list_params.rb +1 -3
  97. data/lib/metronome_sdk/models/v1/usage_list_response.rb +45 -62
  98. data/lib/metronome_sdk/models/v1/usage_search_response.rb +4 -7
  99. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +29 -58
  100. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +26 -49
  101. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +414 -2310
  102. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +337 -2424
  103. data/lib/metronome_sdk/models/v2/contract_list_response.rb +3 -4520
  104. data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +3 -4528
  105. data/lib/metronome_sdk/models.rb +38 -0
  106. data/lib/metronome_sdk/resources/v1/alerts.rb +72 -2
  107. data/lib/metronome_sdk/resources/v1/audit_logs.rb +39 -4
  108. data/lib/metronome_sdk/resources/v1/billable_metrics.rb +54 -4
  109. data/lib/metronome_sdk/resources/v1/contracts/products.rb +25 -6
  110. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rb +7 -2
  111. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +10 -2
  112. data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +109 -10
  113. data/lib/metronome_sdk/resources/v1/contracts.rb +254 -18
  114. data/lib/metronome_sdk/resources/v1/credit_grants.rb +2 -1
  115. data/lib/metronome_sdk/resources/v1/custom_fields.rb +51 -14
  116. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +103 -8
  117. data/lib/metronome_sdk/resources/v1/customers/commits.rb +119 -9
  118. data/lib/metronome_sdk/resources/v1/customers/credits.rb +104 -8
  119. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +124 -8
  120. data/lib/metronome_sdk/resources/v1/customers.rb +169 -12
  121. data/lib/metronome_sdk/resources/v1/dashboards.rb +29 -3
  122. data/lib/metronome_sdk/resources/v1/invoices.rb +23 -2
  123. data/lib/metronome_sdk/resources/v1/pricing_units.rb +6 -1
  124. data/lib/metronome_sdk/resources/v1/services.rb +6 -4
  125. data/lib/metronome_sdk/resources/v1/usage.rb +185 -12
  126. data/lib/metronome_sdk/resources/v2/contracts.rb +114 -18
  127. data/lib/metronome_sdk/version.rb +1 -1
  128. data/lib/metronome_sdk.rb +24 -3
  129. data/rbi/metronome_sdk/errors.rbi +2 -2
  130. data/rbi/metronome_sdk/internal/body_cursor_page.rbi +22 -0
  131. data/rbi/metronome_sdk/internal/cursor_page_without_limit.rbi +22 -0
  132. data/rbi/metronome_sdk/models/base_threshold_commit.rbi +58 -0
  133. data/rbi/metronome_sdk/models/commit.rbi +26 -348
  134. data/rbi/metronome_sdk/models/commit_hierarchy_configuration.rbi +280 -0
  135. data/rbi/metronome_sdk/models/commit_rate.rbi +85 -0
  136. data/rbi/metronome_sdk/models/commit_specifier.rbi +71 -0
  137. data/rbi/metronome_sdk/models/commit_specifier_input.rbi +74 -0
  138. data/rbi/metronome_sdk/models/contract.rbi +768 -0
  139. data/rbi/metronome_sdk/models/contract_v2.rbi +5822 -0
  140. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +184 -2507
  141. data/rbi/metronome_sdk/models/credit.rbi +10 -348
  142. data/rbi/metronome_sdk/models/discount.rbi +2 -0
  143. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +180 -0
  144. data/rbi/metronome_sdk/models/override.rbi +8 -193
  145. data/rbi/metronome_sdk/models/override_tier.rbi +29 -0
  146. data/rbi/metronome_sdk/models/overwrite_rate.rbi +137 -0
  147. data/rbi/metronome_sdk/models/payment_gate_config.rbi +312 -0
  148. data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +321 -0
  149. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +183 -0
  150. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +188 -0
  151. data/rbi/metronome_sdk/models/pro_service.rbi +2 -0
  152. data/rbi/metronome_sdk/models/recurring_commit_subscription_config.rbi +125 -0
  153. data/rbi/metronome_sdk/models/scheduled_charge.rbi +2 -0
  154. data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +76 -0
  155. data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -0
  156. data/rbi/metronome_sdk/models/subscription.rbi +460 -0
  157. data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +61 -0
  158. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +6 -3
  159. data/rbi/metronome_sdk/models/v1/billable_metric_list_response.rbi +2 -0
  160. data/rbi/metronome_sdk/models/v1/billable_metric_retrieve_response.rbi +2 -0
  161. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +44 -768
  162. data/rbi/metronome_sdk/models/v1/contract_create_historical_invoices_params.rbi +2 -0
  163. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1550 -4079
  164. data/rbi/metronome_sdk/models/v1/contract_list_balances_response.rbi +8 -59
  165. data/rbi/metronome_sdk/models/v1/contract_list_response.rbi +5 -2420
  166. data/rbi/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbi +6 -129
  167. data/rbi/metronome_sdk/models/v1/contract_retrieve_response.rbi +4 -2419
  168. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +2 -0
  169. data/rbi/metronome_sdk/models/v1/contracts/product_list_response.rbi +2 -0
  170. data/rbi/metronome_sdk/models/v1/contracts/product_retrieve_response.rbi +2 -0
  171. data/rbi/metronome_sdk/models/v1/contracts/rate_card_create_params.rbi +2 -0
  172. data/rbi/metronome_sdk/models/v1/contracts/rate_card_list_response.rbi +2 -0
  173. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbi +6 -129
  174. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rbi +2 -0
  175. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbi +4 -129
  176. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +4 -129
  177. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +4 -129
  178. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbi +6 -129
  179. data/rbi/metronome_sdk/models/v1/credit_grant_list_entries_response.rbi +147 -198
  180. data/rbi/metronome_sdk/models/v1/credit_grant_list_response.rbi +2 -0
  181. data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +117 -165
  182. data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +8 -1
  183. data/rbi/metronome_sdk/models/v1/customer.rbi +2 -0
  184. data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +88 -3
  185. data/rbi/metronome_sdk/models/v1/customer_detail.rbi +2 -0
  186. data/rbi/metronome_sdk/models/v1/customer_list_billable_metrics_response.rbi +2 -0
  187. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbi +51 -0
  188. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +265 -0
  189. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +348 -0
  190. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +60 -0
  191. data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +10 -0
  192. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +10 -0
  193. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +6 -90
  194. data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +6 -90
  195. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +6 -3
  196. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +70 -10
  197. data/rbi/metronome_sdk/models/v1/customers/plan_list_response.rbi +2 -0
  198. data/rbi/metronome_sdk/models/v1/plan_detail.rbi +2 -0
  199. data/rbi/metronome_sdk/models/v1/plan_list_charges_response.rbi +2 -0
  200. data/rbi/metronome_sdk/models/v1/plan_list_customers_response.rbi +2 -0
  201. data/rbi/metronome_sdk/models/v1/plan_list_response.rbi +8 -1
  202. data/rbi/metronome_sdk/models/v1/usage_list_response.rbi +45 -86
  203. data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +2 -0
  204. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +56 -76
  205. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +56 -76
  206. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +3419 -7270
  207. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1140 -6062
  208. data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +5 -9867
  209. data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +6 -9866
  210. data/rbi/metronome_sdk/models.rbi +44 -0
  211. data/rbi/metronome_sdk/resources/v1/alerts.rbi +72 -2
  212. data/rbi/metronome_sdk/resources/v1/audit_logs.rbi +39 -4
  213. data/rbi/metronome_sdk/resources/v1/billable_metrics.rbi +54 -4
  214. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +25 -5
  215. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rbi +7 -2
  216. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +10 -3
  217. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +109 -9
  218. data/rbi/metronome_sdk/resources/v1/contracts.rbi +257 -16
  219. data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +5 -1
  220. data/rbi/metronome_sdk/resources/v1/custom_fields.rbi +57 -14
  221. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +108 -5
  222. data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +119 -10
  223. data/rbi/metronome_sdk/resources/v1/customers/credits.rbi +104 -9
  224. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +123 -7
  225. data/rbi/metronome_sdk/resources/v1/customers.rbi +156 -11
  226. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +29 -3
  227. data/rbi/metronome_sdk/resources/v1/invoices.rbi +23 -2
  228. data/rbi/metronome_sdk/resources/v1/pricing_units.rbi +6 -1
  229. data/rbi/metronome_sdk/resources/v1/services.rbi +6 -4
  230. data/rbi/metronome_sdk/resources/v1/usage.rbi +188 -12
  231. data/rbi/metronome_sdk/resources/v2/contracts.rbi +120 -23
  232. data/sig/metronome_sdk/internal/body_cursor_page.rbs +13 -0
  233. data/sig/metronome_sdk/internal/cursor_page_without_limit.rbs +13 -0
  234. data/sig/metronome_sdk/models/base_threshold_commit.rbs +26 -0
  235. data/sig/metronome_sdk/models/commit.rbs +17 -170
  236. data/sig/metronome_sdk/models/commit_hierarchy_configuration.rbs +117 -0
  237. data/sig/metronome_sdk/models/commit_rate.rbs +48 -0
  238. data/sig/metronome_sdk/models/commit_specifier.rbs +47 -0
  239. data/sig/metronome_sdk/models/commit_specifier_input.rbs +47 -0
  240. data/sig/metronome_sdk/models/contract.rbs +398 -0
  241. data/sig/metronome_sdk/models/contract_v2.rbs +2881 -0
  242. data/sig/metronome_sdk/models/contract_without_amendments.rbs +54 -976
  243. data/sig/metronome_sdk/models/credit.rbs +12 -170
  244. data/sig/metronome_sdk/models/hierarchy_configuration.rbs +71 -0
  245. data/sig/metronome_sdk/models/override.rbs +12 -101
  246. data/sig/metronome_sdk/models/override_tier.rbs +17 -0
  247. data/sig/metronome_sdk/models/overwrite_rate.rbs +78 -0
  248. data/sig/metronome_sdk/models/payment_gate_config.rbs +123 -0
  249. data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +123 -0
  250. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +82 -0
  251. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +82 -0
  252. data/sig/metronome_sdk/models/recurring_commit_subscription_config.rbs +51 -0
  253. data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +35 -0
  254. data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +35 -0
  255. data/sig/metronome_sdk/models/subscription.rbs +215 -0
  256. data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +28 -0
  257. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +4 -2
  258. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +24 -340
  259. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +168 -1219
  260. data/sig/metronome_sdk/models/v1/contract_list_balances_response.rbs +4 -25
  261. data/sig/metronome_sdk/models/v1/contract_list_response.rbs +4 -1041
  262. data/sig/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbs +6 -54
  263. data/sig/metronome_sdk/models/v1/contract_retrieve_response.rbs +4 -1041
  264. data/sig/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbs +6 -54
  265. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbs +6 -54
  266. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +6 -54
  267. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +6 -54
  268. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbs +6 -54
  269. data/sig/metronome_sdk/models/v1/credit_grant_list_entries_response.rbs +72 -94
  270. data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +53 -75
  271. data/sig/metronome_sdk/models/v1/customer_create_params.rbs +31 -4
  272. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbs +32 -0
  273. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +113 -0
  274. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +133 -0
  275. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +21 -0
  276. data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +7 -1
  277. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +6 -1
  278. data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +6 -50
  279. data/sig/metronome_sdk/models/v1/customers/credit_create_params.rbs +6 -50
  280. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +4 -2
  281. data/sig/metronome_sdk/models/v1/usage_list_response.rbs +33 -55
  282. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +19 -43
  283. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +19 -43
  284. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +361 -1917
  285. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +242 -2252
  286. data/sig/metronome_sdk/models/v2/contract_list_response.rbs +4 -4426
  287. data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +4 -4426
  288. data/sig/metronome_sdk/models.rbs +38 -0
  289. data/sig/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbs +1 -1
  290. data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -3
  291. data/sig/metronome_sdk/resources/v1/credit_grants.rbs +1 -1
  292. data/sig/metronome_sdk/resources/v1/custom_fields.rbs +1 -1
  293. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +2 -1
  294. data/sig/metronome_sdk/resources/v1/customers/commits.rbs +2 -2
  295. data/sig/metronome_sdk/resources/v1/customers/credits.rbs +2 -2
  296. data/sig/metronome_sdk/resources/v1/customers.rbs +11 -0
  297. data/sig/metronome_sdk/resources/v1/usage.rbs +1 -1
  298. data/sig/metronome_sdk/resources/v2/contracts.rbs +7 -4
  299. metadata +74 -11
  300. data/lib/metronome_sdk/models/v1/customers/alert_list_response.rb +0 -29
  301. data/lib/metronome_sdk/models/v1/customers/commit_list_response.rb +0 -26
  302. data/lib/metronome_sdk/models/v1/customers/credit_list_response.rb +0 -26
  303. data/rbi/metronome_sdk/models/v1/customers/alert_list_response.rbi +0 -46
  304. data/rbi/metronome_sdk/models/v1/customers/commit_list_response.rbi +0 -45
  305. data/rbi/metronome_sdk/models/v1/customers/credit_list_response.rbi +0 -45
  306. data/sig/metronome_sdk/models/v1/customers/alert_list_response.rbs +0 -29
  307. data/sig/metronome_sdk/models/v1/customers/commit_list_response.rbs +0 -26
  308. data/sig/metronome_sdk/models/v1/customers/credit_list_response.rbs +0 -26
@@ -16,7 +16,129 @@ module MetronomeSDK
16
16
  # Some parameter documentations has been truncated, see
17
17
  # {MetronomeSDK::Models::V1::ContractCreateParams} for more details.
18
18
  #
19
- # Create a new contract
19
+ # Contracts define a customer's products, pricing, discounts, access duration, and
20
+ # billing configuration. Contracts serve as the central billing agreement for both
21
+ # PLG and Enterprise customers, you can automatically customers access to your
22
+ # products and services directly from your product or CRM.
23
+ #
24
+ # ### Use this endpoint to:
25
+ #
26
+ # - PLG onboarding: Automatically provision new self-serve customers with
27
+ # contracts when they sign up.
28
+ # - Enterprise sales: Push negotiated contracts from Salesforce with custom
29
+ # pricing and commitments
30
+ # - Promotional pricing: Implement time-limited discounts and free trials through
31
+ # overrides
32
+ #
33
+ # ### Key components:
34
+ #
35
+ # #### Contract Term and Billing Schedule
36
+ #
37
+ # - Set contract duration using `starting_at` and `ending_before` fields. PLG
38
+ # contracts typically use perpetual agreements (no end date), while Enterprise
39
+ # contracts have fixed end dates which can be edited over time in the case of
40
+ # co-term upsells.
41
+ #
42
+ # #### Rate Card
43
+ #
44
+ # If you are offering usage based pricing, you can set a rate card for the
45
+ # contract to reference through `rate_card_id` or `rate_card_alias`. The rate card
46
+ # is a store of all of your usage based products and their centralized pricing.
47
+ # Any new products or price changes on the rate card can be set to automatically
48
+ # propagate to all associated contracts - this ensures consistent pricing and
49
+ # product launches flow to contracts without manual updates and migrations. The
50
+ # `usage_statement_schedule` determines the cadence on which Metronome will
51
+ # finalize a usage invoice for the customer. This defaults to monthly on the 1st,
52
+ # with options for custom dates, quarterly, or annual cadences. Note: Most usage
53
+ # based billing companies align usage statements to be evaluated aligned to the
54
+ # first of the month. Read more about
55
+ # [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).
56
+ #
57
+ # #### Overrides and discounts
58
+ #
59
+ # Customize pricing on the contract through time-bounded overrides that can target
60
+ # specific products, product families, or complex usage scenarios. Overrides
61
+ # enable two key capabilities:
62
+ #
63
+ # - Discounts: Apply percentage discounts, fixed rate reductions, or
64
+ # quantity-based pricing tiers
65
+ # - Entitlements: Provide special pricing or access to specific products for
66
+ # negotiated deals
67
+ #
68
+ # Read more about
69
+ # [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).
70
+ #
71
+ # #### Commits and Credits
72
+ #
73
+ # Using commits, configure prepaid or postpaid spending commitments where
74
+ # customers promise to spend a certain amount over the contract period paid in
75
+ # advance or in arrears. Use credits to provide free spending allowances. Under
76
+ # the hood these are the same mechanisms, however, credits are typically offered
77
+ # for free (SLA or promotional) or as a part of an allotment associated with a
78
+ # Subscription.
79
+ #
80
+ # In Metronome, you can set commits and credits to only be applicable for a subset
81
+ # of usage. Use `applicable_product_ids` or `applicable_product_tags` to create
82
+ # product or product-family specific commits or credits, or you can build complex
83
+ # boolean logic specifiers to target usage based on pricing and presentation group
84
+ # values using `override_specifiers`.
85
+ #
86
+ # These objects can also also be configured to have a recurrence schedule to
87
+ # easily model customer packaging which includes recurring monthly or quarterly
88
+ # allotments.
89
+ #
90
+ # Commits support rollover settings (`rollover_fraction`) to transfer unused
91
+ # balances between contract periods, either entirely or as a percentage.
92
+ #
93
+ # Read more about
94
+ # [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).
95
+ #
96
+ # #### Subscriptions
97
+ #
98
+ # You can add a fixed recurring charge to a contract, like monthly licenses or
99
+ # seat-based fees, using the subscription charge. Subscription charges are defined
100
+ # on your rate card and you can select which subscription is applicable to add to
101
+ # each contract. When you add a subscription to a contract you need to:
102
+ #
103
+ # - Define whether the subscription is paid for in-advance or in-arrears
104
+ # (`collection_schedule`)
105
+ # - Define the proration behavior (`proration`)
106
+ # - Specify an initial quantity (`initial_quantity`)
107
+ # - Define which subscription rate on the rate card should be used
108
+ # (`subscription_rate`)
109
+ #
110
+ # Read more about
111
+ # [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).
112
+ #
113
+ # #### Scheduled Charges
114
+ #
115
+ # Set up one-time, recurring, or entirely custom charges that occur on specific
116
+ # dates, separate from usage-based billing or commitments. These can be used to
117
+ # model non-recurring platform charges or professional services.
118
+ #
119
+ # #### Threshold Billing
120
+ #
121
+ # Metronome allows you to configure automatic billing triggers when customers
122
+ # reach spending thresholds to prevent fraud and manage risk. You can use
123
+ # `spend_threshold_configuration` to trigger an invoice to cover current charges
124
+ # whenever the threshold is reached or you can ensure the customer maintains a
125
+ # minimum prepaid balance using the `prepaid_balance_configuration`.
126
+ #
127
+ # Read more about
128
+ # [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/)
129
+ # and
130
+ # [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).
131
+ #
132
+ # ### Usage guidelines:
133
+ #
134
+ # - You can always
135
+ # [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/)
136
+ # after it has been created, using the `editContract` endpoint. Metronome keeps
137
+ # track of all edits, both in the audit log and over the `getEditHistory`
138
+ # endpoint.
139
+ # - Customers in Metronome can have multiple concurrent contracts at one time. Use
140
+ # `usage_filters` to route the correct usage to each contract.
141
+ # [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).
20
142
  #
21
143
  # @overload create(customer_id:, starting_at:, billing_provider_configuration: nil, commits: nil, credits: nil, custom_fields: nil, discounts: nil, ending_before: nil, hierarchy_configuration: nil, multiplier_override_prioritization: nil, name: nil, net_payment_terms_days: nil, netsuite_sales_order_id: nil, overrides: nil, prepaid_balance_threshold_configuration: nil, priority: nil, professional_services: nil, rate_card_alias: nil, rate_card_id: nil, recurring_commits: nil, recurring_credits: nil, reseller_royalties: nil, salesforce_opportunity_id: nil, scheduled_charges: nil, scheduled_charges_on_usage_invoices: nil, spend_threshold_configuration: nil, subscriptions: nil, total_contract_value: nil, transition: nil, uniqueness_key: nil, usage_filter: nil, usage_statement_schedule: nil, request_options: {})
22
144
  #
@@ -30,7 +152,7 @@ module MetronomeSDK
30
152
  #
31
153
  # @param credits [Array<MetronomeSDK::Models::V1::ContractCreateParams::Credit>]
32
154
  #
33
- # @param custom_fields [Hash{Symbol=>String}]
155
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
34
156
  #
35
157
  # @param discounts [Array<MetronomeSDK::Models::V1::ContractCreateParams::Discount>] This field's availability is dependent on your client's configuration.
36
158
  #
@@ -48,7 +170,7 @@ module MetronomeSDK
48
170
  #
49
171
  # @param overrides [Array<MetronomeSDK::Models::V1::ContractCreateParams::Override>]
50
172
  #
51
- # @param prepaid_balance_threshold_configuration [MetronomeSDK::Models::V1::ContractCreateParams::PrepaidBalanceThresholdConfiguration]
173
+ # @param prepaid_balance_threshold_configuration [MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration]
52
174
  #
53
175
  # @param priority [Float] Priority of the contract.
54
176
  #
@@ -70,7 +192,7 @@ module MetronomeSDK
70
192
  #
71
193
  # @param scheduled_charges_on_usage_invoices [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::ScheduledChargesOnUsageInvoices] Determines which scheduled and commit charges to consolidate onto the Contract's
72
194
  #
73
- # @param spend_threshold_configuration [MetronomeSDK::Models::V1::ContractCreateParams::SpendThresholdConfiguration]
195
+ # @param spend_threshold_configuration [MetronomeSDK::Models::SpendThresholdConfiguration]
74
196
  #
75
197
  # @param subscriptions [Array<MetronomeSDK::Models::V1::ContractCreateParams::Subscription>] Optional list of [subscriptions](https://docs.metronome.com/manage-product-acces
76
198
  #
@@ -135,8 +257,13 @@ module MetronomeSDK
135
257
  # Some parameter documentations has been truncated, see
136
258
  # {MetronomeSDK::Models::V1::ContractListParams} for more details.
137
259
  #
138
- # This is the v1 endpoint to list all contracts for a customer. New clients should
139
- # implement using the v2 endpoint.
260
+ # Retrieves all contracts for a specific customer, including pricing, terms,
261
+ # credits, and commitments. Use this to view a customer's contract history and
262
+ # current agreements for billing management. Returns contract details with
263
+ # optional ledgers and balance information.
264
+ #
265
+ # ⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2
266
+ # endpoint for enhanced features.
140
267
  #
141
268
  # @overload list(customer_id:, covering_date: nil, include_archived: nil, include_balance: nil, include_ledgers: nil, starting_at: nil, request_options: {})
142
269
  #
@@ -172,7 +299,24 @@ module MetronomeSDK
172
299
  # {MetronomeSDK::Models::V1::ContractAddManualBalanceEntryParams} for more
173
300
  # details.
174
301
  #
175
- # Add a manual balance entry
302
+ # Manually adjust the available balance on a commit or credit. This entry is
303
+ # appended to the commit ledger as a new event. Optionally include a description
304
+ # that provides the reasoning for the entry.
305
+ #
306
+ # ### Use this endpoint to:
307
+ #
308
+ # - Address incorrect usage burn-down caused by malformed usage or invalid config
309
+ # - Decrease available balance to account for outages where usage may have not
310
+ # been tracked or sent to Metronome
311
+ # - Issue credits to customers in the form of increased balance on existing commit
312
+ # or credit
313
+ #
314
+ # ### Usage guidelines:
315
+ #
316
+ # Manual ledger entries can be extremely useful for resolving discrepancies in
317
+ # Metronome. However, most corrections to inaccurate billings can be modified
318
+ # upstream of the commit, whether that is via contract editing, rate editing, or
319
+ # other actions that cause an invoice to be recalculated.
176
320
  #
177
321
  # @overload add_manual_balance_entry(id:, amount:, customer_id:, reason:, segment_id:, contract_id: nil, timestamp: nil, request_options: {})
178
322
  #
@@ -207,7 +351,7 @@ module MetronomeSDK
207
351
  end
208
352
 
209
353
  # Amendments will be replaced by Contract editing. New clients should implement
210
- # using the editContract endpoint. Read more about the migration to contract
354
+ # using the `editContract` endpoint. Read more about the migration to contract
211
355
  # editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
212
356
  # reach out to your Metronome representative for more details. Once contract
213
357
  # editing is enabled, access to this endpoint will be removed.
@@ -224,7 +368,7 @@ module MetronomeSDK
224
368
  #
225
369
  # @param credits [Array<MetronomeSDK::Models::V1::ContractAmendParams::Credit>]
226
370
  #
227
- # @param custom_fields [Hash{Symbol=>String}]
371
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
228
372
  #
229
373
  # @param discounts [Array<MetronomeSDK::Models::V1::ContractAmendParams::Discount>] This field's availability is dependent on your client's configuration.
230
374
  #
@@ -261,7 +405,26 @@ module MetronomeSDK
261
405
  # Some parameter documentations has been truncated, see
262
406
  # {MetronomeSDK::Models::V1::ContractArchiveParams} for more details.
263
407
  #
264
- # Archive a contract
408
+ # Permanently end and archive a contract along with all its terms. Any draft
409
+ # invoices will be canceled, and all upcoming scheduled invoices will be
410
+ # voided–also all finalized invoices can optionally be voided. Use this in the
411
+ # event a contract was incorrectly created and needed to be removed from a
412
+ # customer.
413
+ #
414
+ # #### Impact on commits and credits:
415
+ #
416
+ # When archiving a contract, all associated commits and credits are also archived.
417
+ # For prepaid commits with active segments, Metronome automatically generates
418
+ # expiration ledger entries to close out any remaining balances, ensuring accurate
419
+ # accounting of unused prepaid amounts. These ledger entries will appear in the
420
+ # commit's transaction history with type `PREPAID_COMMIT_EXPIRATION`.
421
+ #
422
+ # #### Archived contract visibility:
423
+ #
424
+ # Archived contracts remain accessible for historical reporting and audit
425
+ # purposes. They can be retrieved using the `ListContracts` endpoint by setting
426
+ # the `include_archived` parameter to `true` or in the Metronome UI when the "Show
427
+ # archived" option is enabled.
265
428
  #
266
429
  # @overload archive(contract_id:, customer_id:, void_invoices:, request_options: {})
267
430
  #
@@ -287,7 +450,11 @@ module MetronomeSDK
287
450
  )
288
451
  end
289
452
 
290
- # Creates historical usage invoices for a contract
453
+ # Create historical usage invoices for past billing periods on specific contracts.
454
+ # Use this endpoint to generate retroactive invoices with custom usage line items,
455
+ # quantities, and date ranges. Supports preview mode to validate invoice data
456
+ # before creation. Ideal for billing migrations or correcting past billing
457
+ # periods.
291
458
  #
292
459
  # @overload create_historical_invoices(invoices:, preview:, request_options: {})
293
460
  #
@@ -312,7 +479,40 @@ module MetronomeSDK
312
479
  # Some parameter documentations has been truncated, see
313
480
  # {MetronomeSDK::Models::V1::ContractListBalancesParams} for more details.
314
481
  #
315
- # List balances (commits and credits).
482
+ # Retrieve a comprehensive view of all available balances (commits and credits)
483
+ # for a customer. This endpoint provides real-time visibility into prepaid funds,
484
+ # postpaid commitments, promotional credits, and other balance types that can
485
+ # offset usage charges, helping you build transparent billing experiences.
486
+ #
487
+ # ### Use this endpoint to:
488
+ #
489
+ # - Display current available balances in customer dashboards
490
+ # - Verify available funds before approving high-usage operations
491
+ # - Generate balance reports for finance teams
492
+ # - Filter balances by contract or date ranges
493
+ #
494
+ # ### Key response fields:
495
+ #
496
+ # An array of balance objects (all credits and commits) containing:
497
+ #
498
+ # - Balance details: Current available amount for each commit or credit
499
+ # - Metadata: Product associations, priorities, applicable date ranges
500
+ # - Optional ledger entries: Detailed transaction history (if
501
+ # `include_ledgers=true`)
502
+ # - Balance calculations: Including pending transactions and future-dated entries
503
+ # - Custom fields: Any additional metadata attached to balances
504
+ #
505
+ # ### Usage guidelines:
506
+ #
507
+ # - Date filtering: Use `effective_before` to include only balances with access
508
+ # before a specific date (exclusive)
509
+ # - Set `include_balance=true` for calculated balance amounts on each commit or
510
+ # credit
511
+ # - Set `include_ledgers=true` for full transaction history
512
+ # - Set `include_contract_balances = true` to see contract level balances
513
+ # - Balance logic: Reflects currently accessible amounts, excluding expired/future
514
+ # segments
515
+ # - Manual adjustments: Includes all manual ledger entries, even future-dated ones
316
516
  #
317
517
  # @overload list_balances(customer_id:, id: nil, covering_date: nil, effective_before: nil, include_archived: nil, include_balance: nil, include_contract_balances: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
318
518
  #
@@ -340,7 +540,7 @@ module MetronomeSDK
340
540
  #
341
541
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
342
542
  #
343
- # @return [MetronomeSDK::Models::V1::ContractListBalancesResponse]
543
+ # @return [MetronomeSDK::Internal::BodyCursorPage<MetronomeSDK::Models::Commit, MetronomeSDK::Models::Credit>]
344
544
  #
345
545
  # @see MetronomeSDK::Models::V1::ContractListBalancesParams
346
546
  def list_balances(params)
@@ -349,6 +549,7 @@ module MetronomeSDK
349
549
  method: :post,
350
550
  path: "v1/contracts/customerBalances/list",
351
551
  body: parsed,
552
+ page: MetronomeSDK::Internal::BodyCursorPage,
352
553
  model: MetronomeSDK::Models::V1::ContractListBalancesResponse,
353
554
  options: options
354
555
  )
@@ -357,7 +558,13 @@ module MetronomeSDK
357
558
  # Some parameter documentations has been truncated, see
358
559
  # {MetronomeSDK::Models::V1::ContractRetrieveRateScheduleParams} for more details.
359
560
  #
360
- # Get the rate schedule for the rate card on a given contract.
561
+ # For a specific customer and contract, get the rates at a specific point in time.
562
+ # This endpoint takes the contract's rate card into consideration, including
563
+ # scheduled changes. It also takes into account overrides on the contract.
564
+ #
565
+ # For example, if you want to show your customer a summary of the prices they are
566
+ # paying, inclusive of any negotiated discounts or promotions, use this endpoint.
567
+ # This endpoint only returns rates that are entitled.
361
568
  #
362
569
  # @overload retrieve_rate_schedule(contract_id:, customer_id:, limit: nil, next_page: nil, at: nil, selectors: nil, request_options: {})
363
570
  #
@@ -391,8 +598,16 @@ module MetronomeSDK
391
598
  )
392
599
  end
393
600
 
394
- # Fetch the quantity and price for a subscription over time. End-point does not
395
- # return future scheduled changes.
601
+ # Get the history of subscription quantities and prices over time for a given
602
+ # `subscription_id`. This endpoint can be used to power an in-product experience
603
+ # where you show a customer their historical changes to seat count. Future changes
604
+ # are not included in this endpoint - use the `getContract` endpoint to view the
605
+ # future scheduled changes to a subscription's quantity.
606
+ #
607
+ # Subscriptions are used to model fixed recurring fees as well as seat-based
608
+ # recurring fees. To model changes to the number of seats in Metronome, you can
609
+ # increment or decrement the quantity on a subscription at any point in the past
610
+ # or future.
396
611
  #
397
612
  # @overload retrieve_subscription_quantity_history(contract_id:, customer_id:, subscription_id:, request_options: {})
398
613
  #
@@ -449,7 +664,24 @@ module MetronomeSDK
449
664
  )
450
665
  end
451
666
 
452
- # Set usage filter for a contract
667
+ # If a customer has multiple contracts with overlapping rates, the usage filter
668
+ # routes usage to the appropriate contract based on a predefined group key.
669
+ #
670
+ # As an example, imagine you have a customer associated with two projects. Each
671
+ # project is associated with its own contract. You can create a usage filter with
672
+ # group key `project_id` on each contract, and route usage for `project_1` to the
673
+ # first contract and `project_2` to the second contract.
674
+ #
675
+ # ### Use this endpoint to:
676
+ #
677
+ # - Support enterprise contracting scenarios where multiple contracts are
678
+ # associated to the same customer with the same rates.
679
+ # - Update the usage filter associated with the contract over time.
680
+ #
681
+ # ### Usage guidelines:
682
+ #
683
+ # To use usage filters, the `group_key` must be defined on the billable metrics
684
+ # underlying the rate card on the contracts.
453
685
  #
454
686
  # @overload set_usage_filter(contract_id:, customer_id:, group_key:, group_values:, starting_at:, request_options: {})
455
687
  #
@@ -477,7 +709,11 @@ module MetronomeSDK
477
709
  # Some parameter documentations has been truncated, see
478
710
  # {MetronomeSDK::Models::V1::ContractUpdateEndDateParams} for more details.
479
711
  #
480
- # Update the end date of a contract
712
+ # Update or and an end date to a contract. Ending a contract early will impact
713
+ # draft usage statements, truncate any terms, and remove upcoming scheduled
714
+ # invoices. Moving the date into the future will only extend the contract length.
715
+ # Terms and scheduled invoices are not extended. Use this if a contract's end date
716
+ # has changed or if a perpetual contract ends.
481
717
  #
482
718
  # @overload update_end_date(contract_id:, customer_id:, allow_ending_before_finalized_invoice: nil, ending_before: nil, request_options: {})
483
719
  #
@@ -147,7 +147,7 @@ module MetronomeSDK
147
147
  #
148
148
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
149
149
  #
150
- # @return [MetronomeSDK::Models::V1::CreditGrantListEntriesResponse]
150
+ # @return [MetronomeSDK::Internal::CursorPageWithoutLimit<MetronomeSDK::Models::V1::CreditGrantListEntriesResponse>]
151
151
  #
152
152
  # @see MetronomeSDK::Models::V1::CreditGrantListEntriesParams
153
153
  def list_entries(params = {})
@@ -158,6 +158,7 @@ module MetronomeSDK
158
158
  path: "v1/credits/listEntries",
159
159
  query: parsed.slice(*query_params),
160
160
  body: parsed.except(*query_params),
161
+ page: MetronomeSDK::Internal::CursorPageWithoutLimit,
161
162
  model: MetronomeSDK::Models::V1::CreditGrantListEntriesResponse,
162
163
  options: options
163
164
  )
@@ -4,8 +4,35 @@ module MetronomeSDK
4
4
  module Resources
5
5
  class V1
6
6
  class CustomFields
7
- # Add a key to the allow list for a given entity. There is a 100 character limit
8
- # on custom field keys.
7
+ # Creates a new custom field key for a given entity (e.g. billable metric,
8
+ # contract, alert).
9
+ #
10
+ # Custom fields are properties that you can add to Metronome objects to store
11
+ # metadata like foreign keys or other descriptors. This metadata can get
12
+ # transferred to or accessed by other systems to contextualize Metronome data and
13
+ # power business processes. For example, to service workflows like revenue
14
+ # recognition, reconciliation, and invoicing, custom fields help Metronome know
15
+ # the relationship between entities in the platform and third-party systems.
16
+ #
17
+ # ### Use this endpoint to:
18
+ #
19
+ # - Create a new custom field key for Customer objects in Metronome. You can then
20
+ # use the Set Custom Field Values endpoint to set the value of this key for a
21
+ # specific customer.
22
+ # - Specify whether the key should enforce uniqueness. If the key is set to
23
+ # enforce uniqueness and you attempt to set a custom field value for the key
24
+ # that already exists, it will fail.
25
+ #
26
+ # ### Usage guidelines:
27
+ #
28
+ # - Custom fields set on commits, credits, and contracts can be used to scope
29
+ # alert evaluation. For example, you can create a spend threshold alert that
30
+ # only considers spend associated with contracts with custom field key
31
+ # `contract_type` and value `paygo`
32
+ # - Custom fields set on products can be used in the Stripe integration to set
33
+ # metadata on invoices.
34
+ # - Custom fields for customers, contracts, invoices, products, commits, scheduled
35
+ # charges, and subscriptions are passed down to the invoice.
9
36
  #
10
37
  # @overload add_key(enforce_uniqueness:, entity:, key:, request_options: {})
11
38
  #
@@ -28,7 +55,10 @@ module MetronomeSDK
28
55
  )
29
56
  end
30
57
 
31
- # Deletes one or more custom fields on an instance of a Metronome entity.
58
+ # Remove specific custom field values from a Metronome entity instance by
59
+ # specifying the field keys to delete. Use this endpoint to clean up unwanted
60
+ # custom field data while preserving other fields on the same entity. Requires the
61
+ # entity type, entity ID, and array of keys to remove.
32
62
  #
33
63
  # @overload delete_values(entity:, entity_id:, keys:, request_options: {})
34
64
  #
@@ -51,7 +81,10 @@ module MetronomeSDK
51
81
  )
52
82
  end
53
83
 
54
- # List all active custom field keys, optionally filtered by entity type.
84
+ # Retrieve all your active custom field keys, with optional filtering by entity
85
+ # type (customer, contract, product, etc.). Use this endpoint to discover what
86
+ # custom field keys are available before setting values on entities or to audit
87
+ # your custom field configuration across different entity types.
55
88
  #
56
89
  # @overload list_keys(next_page: nil, entities: nil, request_options: {})
57
90
  #
@@ -61,7 +94,7 @@ module MetronomeSDK
61
94
  #
62
95
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
63
96
  #
64
- # @return [MetronomeSDK::Models::V1::CustomFieldListKeysResponse]
97
+ # @return [MetronomeSDK::Internal::CursorPageWithoutLimit<MetronomeSDK::Models::V1::CustomFieldListKeysResponse>]
65
98
  #
66
99
  # @see MetronomeSDK::Models::V1::CustomFieldListKeysParams
67
100
  def list_keys(params = {})
@@ -72,12 +105,16 @@ module MetronomeSDK
72
105
  path: "v1/customFields/listKeys",
73
106
  query: parsed.slice(*query_params),
74
107
  body: parsed.except(*query_params),
108
+ page: MetronomeSDK::Internal::CursorPageWithoutLimit,
75
109
  model: MetronomeSDK::Models::V1::CustomFieldListKeysResponse,
76
110
  options: options
77
111
  )
78
112
  end
79
113
 
80
- # Remove a key from the allow list for a given entity.
114
+ # Removes a custom field key from the allowlist for a specific entity type,
115
+ # preventing future use of that key across all instances of the entity. Existing
116
+ # values for this key on entity instances will no longer be accessible once the
117
+ # key is removed.
81
118
  #
82
119
  # @overload remove_key(entity:, key:, request_options: {})
83
120
  #
@@ -99,19 +136,19 @@ module MetronomeSDK
99
136
  )
100
137
  end
101
138
 
102
- # Sets one or more custom fields on an instance of a Metronome entity. If a
103
- # key/value pair passed in this request matches one already set on the entity, its
104
- # value will be overwritten. Any key/value pairs that exist on the entity that do
105
- # not match those passed in this request will remain untouched. This endpoint is
106
- # transactional and will update all key/value pairs or no key/value pairs. Partial
107
- # updates are not supported. There is a 200 character limit on custom field
108
- # values.
139
+ # Sets custom field values on a specific Metronome entity instance. Overwrites
140
+ # existing values for matching keys while preserving other fields. All updates are
141
+ # transactional—either all values are set or none are. Custom field values are
142
+ # limited to 200 characters each.
109
143
  #
110
144
  # @overload set_values(custom_fields:, entity:, entity_id:, request_options: {})
111
145
  #
112
- # @param custom_fields [Hash{Symbol=>String}]
146
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
147
+ #
113
148
  # @param entity [Symbol, MetronomeSDK::Models::V1::CustomFieldSetValuesParams::Entity]
149
+ #
114
150
  # @param entity_id [String]
151
+ #
115
152
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
116
153
  #
117
154
  # @return [nil]