metronome-sdk 0.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +61 -0
- data/README.md +9 -9
- data/lib/metronome_sdk/internal/body_cursor_page.rb +86 -0
- data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +86 -0
- data/lib/metronome_sdk/internal/transport/base_client.rb +1 -4
- data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +1 -9
- data/lib/metronome_sdk/internal/type/array_of.rb +1 -0
- data/lib/metronome_sdk/internal/type/base_model.rb +9 -14
- data/lib/metronome_sdk/internal/type/converter.rb +27 -0
- data/lib/metronome_sdk/internal/type/hash_of.rb +1 -0
- data/lib/metronome_sdk/internal/type/union.rb +20 -7
- data/lib/metronome_sdk/internal/util.rb +1 -1
- data/lib/metronome_sdk/models/base_threshold_commit.rb +36 -0
- data/lib/metronome_sdk/models/commit.rb +26 -170
- data/lib/metronome_sdk/models/commit_hierarchy_configuration.rb +98 -0
- data/lib/metronome_sdk/models/commit_rate.rb +48 -0
- data/lib/metronome_sdk/models/commit_specifier.rb +42 -0
- data/lib/metronome_sdk/models/commit_specifier_input.rb +42 -0
- data/lib/metronome_sdk/models/contract.rb +404 -0
- data/lib/metronome_sdk/models/contract_v2.rb +2919 -0
- data/lib/metronome_sdk/models/contract_without_amendments.rb +36 -1126
- data/lib/metronome_sdk/models/credit.rb +9 -156
- data/lib/metronome_sdk/models/discount.rb +2 -1
- data/lib/metronome_sdk/models/hierarchy_configuration.rb +76 -0
- data/lib/metronome_sdk/models/override.rb +6 -101
- data/lib/metronome_sdk/models/override_tier.rb +21 -0
- data/lib/metronome_sdk/models/overwrite_rate.rb +82 -0
- data/lib/metronome_sdk/models/payment_gate_config.rb +149 -0
- data/lib/metronome_sdk/models/payment_gate_config_v2.rb +149 -0
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +100 -0
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +102 -0
- data/lib/metronome_sdk/models/pro_service.rb +2 -1
- data/lib/metronome_sdk/models/recurring_commit_subscription_config.rb +51 -0
- data/lib/metronome_sdk/models/schedule_point_in_time.rb +14 -1
- data/lib/metronome_sdk/models/scheduled_charge.rb +2 -1
- data/lib/metronome_sdk/models/spend_threshold_configuration.rb +44 -0
- data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +44 -0
- data/lib/metronome_sdk/models/subscription.rb +227 -0
- data/lib/metronome_sdk/models/update_base_threshold_commit.rb +36 -0
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +4 -6
- data/lib/metronome_sdk/models/v1/billable_metric_create_params.rb +1 -2
- data/lib/metronome_sdk/models/v1/billable_metric_list_response.rb +3 -3
- data/lib/metronome_sdk/models/v1/billable_metric_retrieve_response.rb +4 -7
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +110 -415
- data/lib/metronome_sdk/models/v1/contract_create_historical_invoices_params.rb +7 -16
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +287 -1480
- data/lib/metronome_sdk/models/v1/contract_list_balances_response.rb +6 -23
- data/lib/metronome_sdk/models/v1/contract_list_response.rb +3 -1153
- data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rb +5 -50
- data/lib/metronome_sdk/models/v1/contract_retrieve_response.rb +3 -1154
- data/lib/metronome_sdk/models/v1/contract_schedule_pro_services_invoice_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +9 -1
- data/lib/metronome_sdk/models/v1/contracts/product_list_response.rb +8 -1
- data/lib/metronome_sdk/models/v1/contracts/product_retrieve_response.rb +8 -1
- data/lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb +1 -4
- data/lib/metronome_sdk/models/v1/contracts/rate_card_create_params.rb +4 -7
- data/lib/metronome_sdk/models/v1/contracts/rate_card_list_response.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rb +5 -50
- data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/rate_card_update_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/product_order_update_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rb +6 -61
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +3 -49
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +4 -51
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rb +5 -49
- data/lib/metronome_sdk/models/v1/credit_grant_list_entries_response.rb +103 -123
- data/lib/metronome_sdk/models/v1/credit_grant_list_response.rb +3 -5
- data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +41 -58
- data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +5 -1
- data/lib/metronome_sdk/models/v1/customer.rb +2 -1
- data/lib/metronome_sdk/models/v1/customer_create_params.rb +37 -11
- data/lib/metronome_sdk/models/v1/customer_detail.rb +2 -1
- data/lib/metronome_sdk/models/v1/customer_list_billable_metrics_response.rb +3 -3
- data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +128 -0
- data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +143 -0
- data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +30 -1
- data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +2 -0
- data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +2 -0
- data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +20 -61
- data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +6 -48
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +8 -16
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +68 -43
- data/lib/metronome_sdk/models/v1/customers/invoice_list_breakdowns_params.rb +1 -4
- data/lib/metronome_sdk/models/v1/customers/plan_add_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/customers/plan_list_response.rb +2 -1
- data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +4 -11
- data/lib/metronome_sdk/models/v1/plan_detail.rb +9 -5
- data/lib/metronome_sdk/models/v1/plan_list_charges_response.rb +2 -1
- data/lib/metronome_sdk/models/v1/plan_list_customers_response.rb +2 -1
- data/lib/metronome_sdk/models/v1/plan_list_response.rb +5 -1
- data/lib/metronome_sdk/models/v1/usage_ingest_params.rb +1 -4
- data/lib/metronome_sdk/models/v1/usage_list_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/usage_list_response.rb +45 -62
- data/lib/metronome_sdk/models/v1/usage_search_response.rb +4 -7
- data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +38 -58
- data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +35 -49
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +469 -2302
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +358 -2414
- data/lib/metronome_sdk/models/v2/contract_list_response.rb +3 -4520
- data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +3 -4528
- data/lib/metronome_sdk/models.rb +38 -0
- data/lib/metronome_sdk/resources/v1/alerts.rb +72 -2
- data/lib/metronome_sdk/resources/v1/audit_logs.rb +39 -4
- data/lib/metronome_sdk/resources/v1/billable_metrics.rb +54 -4
- data/lib/metronome_sdk/resources/v1/contracts/products.rb +27 -6
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rb +7 -2
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +10 -2
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +109 -10
- data/lib/metronome_sdk/resources/v1/contracts.rb +254 -18
- data/lib/metronome_sdk/resources/v1/credit_grants.rb +2 -1
- data/lib/metronome_sdk/resources/v1/custom_fields.rb +51 -14
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +103 -8
- data/lib/metronome_sdk/resources/v1/customers/commits.rb +119 -9
- data/lib/metronome_sdk/resources/v1/customers/credits.rb +104 -8
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +124 -8
- data/lib/metronome_sdk/resources/v1/customers.rb +169 -12
- data/lib/metronome_sdk/resources/v1/dashboards.rb +29 -3
- data/lib/metronome_sdk/resources/v1/invoices.rb +23 -2
- data/lib/metronome_sdk/resources/v1/pricing_units.rb +6 -1
- data/lib/metronome_sdk/resources/v1/services.rb +6 -4
- data/lib/metronome_sdk/resources/v1/usage.rb +185 -12
- data/lib/metronome_sdk/resources/v2/contracts.rb +118 -18
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +24 -3
- data/rbi/metronome_sdk/errors.rbi +2 -2
- data/rbi/metronome_sdk/internal/body_cursor_page.rbi +22 -0
- data/rbi/metronome_sdk/internal/cursor_page_without_limit.rbi +22 -0
- data/rbi/metronome_sdk/internal/type/converter.rbi +58 -0
- data/rbi/metronome_sdk/internal/type/union.rbi +9 -2
- data/rbi/metronome_sdk/models/base_threshold_commit.rbi +58 -0
- data/rbi/metronome_sdk/models/commit.rbi +26 -348
- data/rbi/metronome_sdk/models/commit_hierarchy_configuration.rbi +280 -0
- data/rbi/metronome_sdk/models/commit_rate.rbi +85 -0
- data/rbi/metronome_sdk/models/commit_specifier.rbi +71 -0
- data/rbi/metronome_sdk/models/commit_specifier_input.rbi +74 -0
- data/rbi/metronome_sdk/models/contract.rbi +768 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +5822 -0
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +184 -2507
- data/rbi/metronome_sdk/models/credit.rbi +10 -348
- data/rbi/metronome_sdk/models/discount.rbi +2 -0
- data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +180 -0
- data/rbi/metronome_sdk/models/override.rbi +8 -193
- data/rbi/metronome_sdk/models/override_tier.rbi +29 -0
- data/rbi/metronome_sdk/models/overwrite_rate.rbi +137 -0
- data/rbi/metronome_sdk/models/payment_gate_config.rbi +312 -0
- data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +321 -0
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +183 -0
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +188 -0
- data/rbi/metronome_sdk/models/pro_service.rbi +2 -0
- data/rbi/metronome_sdk/models/recurring_commit_subscription_config.rbi +125 -0
- data/rbi/metronome_sdk/models/schedule_point_in_time.rbi +17 -1
- data/rbi/metronome_sdk/models/scheduled_charge.rbi +2 -0
- data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +76 -0
- data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -0
- data/rbi/metronome_sdk/models/subscription.rbi +460 -0
- data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +61 -0
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +6 -3
- data/rbi/metronome_sdk/models/v1/billable_metric_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/billable_metric_retrieve_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +120 -771
- data/rbi/metronome_sdk/models/v1/contract_create_historical_invoices_params.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1613 -4069
- data/rbi/metronome_sdk/models/v1/contract_list_balances_response.rbi +8 -59
- data/rbi/metronome_sdk/models/v1/contract_list_response.rbi +5 -2420
- data/rbi/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbi +6 -129
- data/rbi/metronome_sdk/models/v1/contract_retrieve_response.rbi +4 -2419
- data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_retrieve_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_card_create_params.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_card_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbi +6 -129
- data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbi +4 -129
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +4 -129
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +4 -129
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbi +6 -129
- data/rbi/metronome_sdk/models/v1/credit_grant_list_entries_response.rbi +147 -198
- data/rbi/metronome_sdk/models/v1/credit_grant_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +117 -165
- data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +8 -1
- data/rbi/metronome_sdk/models/v1/customer.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +88 -3
- data/rbi/metronome_sdk/models/v1/customer_detail.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/customer_list_billable_metrics_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbi +51 -0
- data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +265 -0
- data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +348 -0
- data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +60 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +10 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +10 -0
- data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +19 -90
- data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +6 -90
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +6 -3
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +76 -0
- data/rbi/metronome_sdk/models/v1/customers/plan_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/plan_detail.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/plan_list_charges_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/plan_list_customers_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/plan_list_response.rbi +8 -1
- data/rbi/metronome_sdk/models/v1/usage_list_response.rbi +45 -86
- data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +66 -76
- data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +66 -76
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +3563 -7329
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1181 -6070
- data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +5 -9867
- data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +6 -9866
- data/rbi/metronome_sdk/models.rbi +44 -0
- data/rbi/metronome_sdk/resources/v1/alerts.rbi +72 -2
- data/rbi/metronome_sdk/resources/v1/audit_logs.rbi +39 -4
- data/rbi/metronome_sdk/resources/v1/billable_metrics.rbi +54 -4
- data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +27 -5
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rbi +7 -2
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +10 -3
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +109 -9
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +257 -16
- data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +5 -1
- data/rbi/metronome_sdk/resources/v1/custom_fields.rbi +57 -14
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +108 -5
- data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +119 -10
- data/rbi/metronome_sdk/resources/v1/customers/credits.rbi +104 -9
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +123 -7
- data/rbi/metronome_sdk/resources/v1/customers.rbi +156 -11
- data/rbi/metronome_sdk/resources/v1/dashboards.rbi +29 -3
- data/rbi/metronome_sdk/resources/v1/invoices.rbi +23 -2
- data/rbi/metronome_sdk/resources/v1/pricing_units.rbi +6 -1
- data/rbi/metronome_sdk/resources/v1/services.rbi +6 -4
- data/rbi/metronome_sdk/resources/v1/usage.rbi +188 -12
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +128 -23
- data/sig/metronome_sdk/internal/body_cursor_page.rbs +13 -0
- data/sig/metronome_sdk/internal/cursor_page_without_limit.rbs +13 -0
- data/sig/metronome_sdk/internal/type/converter.rbs +17 -0
- data/sig/metronome_sdk/internal/type/union.rbs +2 -2
- data/sig/metronome_sdk/models/base_threshold_commit.rbs +26 -0
- data/sig/metronome_sdk/models/commit.rbs +17 -170
- data/sig/metronome_sdk/models/commit_hierarchy_configuration.rbs +117 -0
- data/sig/metronome_sdk/models/commit_rate.rbs +48 -0
- data/sig/metronome_sdk/models/commit_specifier.rbs +47 -0
- data/sig/metronome_sdk/models/commit_specifier_input.rbs +47 -0
- data/sig/metronome_sdk/models/contract.rbs +398 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +2881 -0
- data/sig/metronome_sdk/models/contract_without_amendments.rbs +54 -976
- data/sig/metronome_sdk/models/credit.rbs +12 -170
- data/sig/metronome_sdk/models/hierarchy_configuration.rbs +71 -0
- data/sig/metronome_sdk/models/override.rbs +12 -101
- data/sig/metronome_sdk/models/override_tier.rbs +17 -0
- data/sig/metronome_sdk/models/overwrite_rate.rbs +78 -0
- data/sig/metronome_sdk/models/payment_gate_config.rbs +123 -0
- data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +123 -0
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +82 -0
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +82 -0
- data/sig/metronome_sdk/models/recurring_commit_subscription_config.rbs +51 -0
- data/sig/metronome_sdk/models/schedule_point_in_time.rbs +7 -0
- data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +35 -0
- data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +35 -0
- data/sig/metronome_sdk/models/subscription.rbs +215 -0
- data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +28 -0
- data/sig/metronome_sdk/models/v1/alert_create_params.rbs +4 -2
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +62 -343
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +218 -1234
- data/sig/metronome_sdk/models/v1/contract_list_balances_response.rbs +4 -25
- data/sig/metronome_sdk/models/v1/contract_list_response.rbs +4 -1041
- data/sig/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contract_retrieve_response.rbs +4 -1041
- data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbs +6 -54
- data/sig/metronome_sdk/models/v1/credit_grant_list_entries_response.rbs +72 -94
- data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +53 -75
- data/sig/metronome_sdk/models/v1/customer_create_params.rbs +31 -4
- data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbs +32 -0
- data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +113 -0
- data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +133 -0
- data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +21 -0
- data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +7 -1
- data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +6 -1
- data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +13 -50
- data/sig/metronome_sdk/models/v1/customers/credit_create_params.rbs +6 -50
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +4 -2
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +5 -0
- data/sig/metronome_sdk/models/v1/usage_list_response.rbs +33 -55
- data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +24 -43
- data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +24 -43
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +400 -1911
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +256 -2249
- data/sig/metronome_sdk/models/v2/contract_list_response.rbs +4 -4426
- data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +4 -4426
- data/sig/metronome_sdk/models.rbs +38 -0
- data/sig/metronome_sdk/resources/v1/contracts/products.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbs +1 -1
- data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -3
- data/sig/metronome_sdk/resources/v1/credit_grants.rbs +1 -1
- data/sig/metronome_sdk/resources/v1/custom_fields.rbs +1 -1
- data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +2 -1
- data/sig/metronome_sdk/resources/v1/customers/commits.rbs +2 -2
- data/sig/metronome_sdk/resources/v1/customers/credits.rbs +2 -2
- data/sig/metronome_sdk/resources/v1/customers.rbs +11 -0
- data/sig/metronome_sdk/resources/v1/usage.rbs +1 -1
- data/sig/metronome_sdk/resources/v2/contracts.rbs +9 -4
- metadata +74 -11
- data/lib/metronome_sdk/models/v1/customers/alert_list_response.rb +0 -29
- data/lib/metronome_sdk/models/v1/customers/commit_list_response.rb +0 -26
- data/lib/metronome_sdk/models/v1/customers/credit_list_response.rb +0 -26
- data/rbi/metronome_sdk/models/v1/customers/alert_list_response.rbi +0 -46
- data/rbi/metronome_sdk/models/v1/customers/commit_list_response.rbi +0 -45
- data/rbi/metronome_sdk/models/v1/customers/credit_list_response.rbi +0 -45
- data/sig/metronome_sdk/models/v1/customers/alert_list_response.rbs +0 -29
- data/sig/metronome_sdk/models/v1/customers/commit_list_response.rbs +0 -26
- data/sig/metronome_sdk/models/v1/customers/credit_list_response.rbs +0 -26
@@ -13,7 +13,129 @@ module MetronomeSDK
|
|
13
13
|
sig { returns(MetronomeSDK::Resources::V1::Contracts::NamedSchedules) }
|
14
14
|
attr_reader :named_schedules
|
15
15
|
|
16
|
-
#
|
16
|
+
# Contracts define a customer's products, pricing, discounts, access duration, and
|
17
|
+
# billing configuration. Contracts serve as the central billing agreement for both
|
18
|
+
# PLG and Enterprise customers, you can automatically customers access to your
|
19
|
+
# products and services directly from your product or CRM.
|
20
|
+
#
|
21
|
+
# ### Use this endpoint to:
|
22
|
+
#
|
23
|
+
# - PLG onboarding: Automatically provision new self-serve customers with
|
24
|
+
# contracts when they sign up.
|
25
|
+
# - Enterprise sales: Push negotiated contracts from Salesforce with custom
|
26
|
+
# pricing and commitments
|
27
|
+
# - Promotional pricing: Implement time-limited discounts and free trials through
|
28
|
+
# overrides
|
29
|
+
#
|
30
|
+
# ### Key components:
|
31
|
+
#
|
32
|
+
# #### Contract Term and Billing Schedule
|
33
|
+
#
|
34
|
+
# - Set contract duration using `starting_at` and `ending_before` fields. PLG
|
35
|
+
# contracts typically use perpetual agreements (no end date), while Enterprise
|
36
|
+
# contracts have fixed end dates which can be edited over time in the case of
|
37
|
+
# co-term upsells.
|
38
|
+
#
|
39
|
+
# #### Rate Card
|
40
|
+
#
|
41
|
+
# If you are offering usage based pricing, you can set a rate card for the
|
42
|
+
# contract to reference through `rate_card_id` or `rate_card_alias`. The rate card
|
43
|
+
# is a store of all of your usage based products and their centralized pricing.
|
44
|
+
# Any new products or price changes on the rate card can be set to automatically
|
45
|
+
# propagate to all associated contracts - this ensures consistent pricing and
|
46
|
+
# product launches flow to contracts without manual updates and migrations. The
|
47
|
+
# `usage_statement_schedule` determines the cadence on which Metronome will
|
48
|
+
# finalize a usage invoice for the customer. This defaults to monthly on the 1st,
|
49
|
+
# with options for custom dates, quarterly, or annual cadences. Note: Most usage
|
50
|
+
# based billing companies align usage statements to be evaluated aligned to the
|
51
|
+
# first of the month. Read more about
|
52
|
+
# [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).
|
53
|
+
#
|
54
|
+
# #### Overrides and discounts
|
55
|
+
#
|
56
|
+
# Customize pricing on the contract through time-bounded overrides that can target
|
57
|
+
# specific products, product families, or complex usage scenarios. Overrides
|
58
|
+
# enable two key capabilities:
|
59
|
+
#
|
60
|
+
# - Discounts: Apply percentage discounts, fixed rate reductions, or
|
61
|
+
# quantity-based pricing tiers
|
62
|
+
# - Entitlements: Provide special pricing or access to specific products for
|
63
|
+
# negotiated deals
|
64
|
+
#
|
65
|
+
# Read more about
|
66
|
+
# [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).
|
67
|
+
#
|
68
|
+
# #### Commits and Credits
|
69
|
+
#
|
70
|
+
# Using commits, configure prepaid or postpaid spending commitments where
|
71
|
+
# customers promise to spend a certain amount over the contract period paid in
|
72
|
+
# advance or in arrears. Use credits to provide free spending allowances. Under
|
73
|
+
# the hood these are the same mechanisms, however, credits are typically offered
|
74
|
+
# for free (SLA or promotional) or as a part of an allotment associated with a
|
75
|
+
# Subscription.
|
76
|
+
#
|
77
|
+
# In Metronome, you can set commits and credits to only be applicable for a subset
|
78
|
+
# of usage. Use `applicable_product_ids` or `applicable_product_tags` to create
|
79
|
+
# product or product-family specific commits or credits, or you can build complex
|
80
|
+
# boolean logic specifiers to target usage based on pricing and presentation group
|
81
|
+
# values using `override_specifiers`.
|
82
|
+
#
|
83
|
+
# These objects can also also be configured to have a recurrence schedule to
|
84
|
+
# easily model customer packaging which includes recurring monthly or quarterly
|
85
|
+
# allotments.
|
86
|
+
#
|
87
|
+
# Commits support rollover settings (`rollover_fraction`) to transfer unused
|
88
|
+
# balances between contract periods, either entirely or as a percentage.
|
89
|
+
#
|
90
|
+
# Read more about
|
91
|
+
# [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).
|
92
|
+
#
|
93
|
+
# #### Subscriptions
|
94
|
+
#
|
95
|
+
# You can add a fixed recurring charge to a contract, like monthly licenses or
|
96
|
+
# seat-based fees, using the subscription charge. Subscription charges are defined
|
97
|
+
# on your rate card and you can select which subscription is applicable to add to
|
98
|
+
# each contract. When you add a subscription to a contract you need to:
|
99
|
+
#
|
100
|
+
# - Define whether the subscription is paid for in-advance or in-arrears
|
101
|
+
# (`collection_schedule`)
|
102
|
+
# - Define the proration behavior (`proration`)
|
103
|
+
# - Specify an initial quantity (`initial_quantity`)
|
104
|
+
# - Define which subscription rate on the rate card should be used
|
105
|
+
# (`subscription_rate`)
|
106
|
+
#
|
107
|
+
# Read more about
|
108
|
+
# [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).
|
109
|
+
#
|
110
|
+
# #### Scheduled Charges
|
111
|
+
#
|
112
|
+
# Set up one-time, recurring, or entirely custom charges that occur on specific
|
113
|
+
# dates, separate from usage-based billing or commitments. These can be used to
|
114
|
+
# model non-recurring platform charges or professional services.
|
115
|
+
#
|
116
|
+
# #### Threshold Billing
|
117
|
+
#
|
118
|
+
# Metronome allows you to configure automatic billing triggers when customers
|
119
|
+
# reach spending thresholds to prevent fraud and manage risk. You can use
|
120
|
+
# `spend_threshold_configuration` to trigger an invoice to cover current charges
|
121
|
+
# whenever the threshold is reached or you can ensure the customer maintains a
|
122
|
+
# minimum prepaid balance using the `prepaid_balance_configuration`.
|
123
|
+
#
|
124
|
+
# Read more about
|
125
|
+
# [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/)
|
126
|
+
# and
|
127
|
+
# [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).
|
128
|
+
#
|
129
|
+
# ### Usage guidelines:
|
130
|
+
#
|
131
|
+
# - You can always
|
132
|
+
# [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/)
|
133
|
+
# after it has been created, using the `editContract` endpoint. Metronome keeps
|
134
|
+
# track of all edits, both in the audit log and over the `getEditHistory`
|
135
|
+
# endpoint.
|
136
|
+
# - Customers in Metronome can have multiple concurrent contracts at one time. Use
|
137
|
+
# `usage_filters` to route the correct usage to each contract.
|
138
|
+
# [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).
|
17
139
|
sig do
|
18
140
|
params(
|
19
141
|
customer_id: String,
|
@@ -42,7 +164,7 @@ module MetronomeSDK
|
|
42
164
|
MetronomeSDK::V1::ContractCreateParams::Override::OrHash
|
43
165
|
],
|
44
166
|
prepaid_balance_threshold_configuration:
|
45
|
-
MetronomeSDK::
|
167
|
+
MetronomeSDK::PrepaidBalanceThresholdConfiguration::OrHash,
|
46
168
|
priority: Float,
|
47
169
|
professional_services:
|
48
170
|
T::Array[
|
@@ -70,7 +192,7 @@ module MetronomeSDK
|
|
70
192
|
scheduled_charges_on_usage_invoices:
|
71
193
|
MetronomeSDK::V1::ContractCreateParams::ScheduledChargesOnUsageInvoices::OrSymbol,
|
72
194
|
spend_threshold_configuration:
|
73
|
-
MetronomeSDK::
|
195
|
+
MetronomeSDK::SpendThresholdConfiguration::OrHash,
|
74
196
|
subscriptions:
|
75
197
|
T::Array[
|
76
198
|
MetronomeSDK::V1::ContractCreateParams::Subscription::OrHash
|
@@ -94,6 +216,7 @@ module MetronomeSDK
|
|
94
216
|
billing_provider_configuration: nil,
|
95
217
|
commits: nil,
|
96
218
|
credits: nil,
|
219
|
+
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
97
220
|
custom_fields: nil,
|
98
221
|
# This field's availability is dependent on your client's configuration.
|
99
222
|
discounts: nil,
|
@@ -174,8 +297,13 @@ module MetronomeSDK
|
|
174
297
|
)
|
175
298
|
end
|
176
299
|
|
177
|
-
#
|
178
|
-
#
|
300
|
+
# Retrieves all contracts for a specific customer, including pricing, terms,
|
301
|
+
# credits, and commitments. Use this to view a customer's contract history and
|
302
|
+
# current agreements for billing management. Returns contract details with
|
303
|
+
# optional ledgers and balance information.
|
304
|
+
#
|
305
|
+
# ⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2
|
306
|
+
# endpoint for enhanced features.
|
179
307
|
sig do
|
180
308
|
params(
|
181
309
|
customer_id: String,
|
@@ -209,7 +337,24 @@ module MetronomeSDK
|
|
209
337
|
)
|
210
338
|
end
|
211
339
|
|
212
|
-
#
|
340
|
+
# Manually adjust the available balance on a commit or credit. This entry is
|
341
|
+
# appended to the commit ledger as a new event. Optionally include a description
|
342
|
+
# that provides the reasoning for the entry.
|
343
|
+
#
|
344
|
+
# ### Use this endpoint to:
|
345
|
+
#
|
346
|
+
# - Address incorrect usage burn-down caused by malformed usage or invalid config
|
347
|
+
# - Decrease available balance to account for outages where usage may have not
|
348
|
+
# been tracked or sent to Metronome
|
349
|
+
# - Issue credits to customers in the form of increased balance on existing commit
|
350
|
+
# or credit
|
351
|
+
#
|
352
|
+
# ### Usage guidelines:
|
353
|
+
#
|
354
|
+
# Manual ledger entries can be extremely useful for resolving discrepancies in
|
355
|
+
# Metronome. However, most corrections to inaccurate billings can be modified
|
356
|
+
# upstream of the commit, whether that is via contract editing, rate editing, or
|
357
|
+
# other actions that cause an invoice to be recalculated.
|
213
358
|
sig do
|
214
359
|
params(
|
215
360
|
id: String,
|
@@ -243,7 +388,7 @@ module MetronomeSDK
|
|
243
388
|
end
|
244
389
|
|
245
390
|
# Amendments will be replaced by Contract editing. New clients should implement
|
246
|
-
# using the editContract endpoint. Read more about the migration to contract
|
391
|
+
# using the `editContract` endpoint. Read more about the migration to contract
|
247
392
|
# editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
|
248
393
|
# reach out to your Metronome representative for more details. Once contract
|
249
394
|
# editing is enabled, access to this endpoint will be removed.
|
@@ -288,6 +433,7 @@ module MetronomeSDK
|
|
288
433
|
starting_at:,
|
289
434
|
commits: nil,
|
290
435
|
credits: nil,
|
436
|
+
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
291
437
|
custom_fields: nil,
|
292
438
|
# This field's availability is dependent on your client's configuration.
|
293
439
|
discounts: nil,
|
@@ -307,7 +453,26 @@ module MetronomeSDK
|
|
307
453
|
)
|
308
454
|
end
|
309
455
|
|
310
|
-
#
|
456
|
+
# Permanently end and archive a contract along with all its terms. Any draft
|
457
|
+
# invoices will be canceled, and all upcoming scheduled invoices will be
|
458
|
+
# voided–also all finalized invoices can optionally be voided. Use this in the
|
459
|
+
# event a contract was incorrectly created and needed to be removed from a
|
460
|
+
# customer.
|
461
|
+
#
|
462
|
+
# #### Impact on commits and credits:
|
463
|
+
#
|
464
|
+
# When archiving a contract, all associated commits and credits are also archived.
|
465
|
+
# For prepaid commits with active segments, Metronome automatically generates
|
466
|
+
# expiration ledger entries to close out any remaining balances, ensuring accurate
|
467
|
+
# accounting of unused prepaid amounts. These ledger entries will appear in the
|
468
|
+
# commit's transaction history with type `PREPAID_COMMIT_EXPIRATION`.
|
469
|
+
#
|
470
|
+
# #### Archived contract visibility:
|
471
|
+
#
|
472
|
+
# Archived contracts remain accessible for historical reporting and audit
|
473
|
+
# purposes. They can be retrieved using the `ListContracts` endpoint by setting
|
474
|
+
# the `include_archived` parameter to `true` or in the Metronome UI when the "Show
|
475
|
+
# archived" option is enabled.
|
311
476
|
sig do
|
312
477
|
params(
|
313
478
|
contract_id: String,
|
@@ -328,7 +493,11 @@ module MetronomeSDK
|
|
328
493
|
)
|
329
494
|
end
|
330
495
|
|
331
|
-
#
|
496
|
+
# Create historical usage invoices for past billing periods on specific contracts.
|
497
|
+
# Use this endpoint to generate retroactive invoices with custom usage line items,
|
498
|
+
# quantities, and date ranges. Supports preview mode to validate invoice data
|
499
|
+
# before creation. Ideal for billing migrations or correcting past billing
|
500
|
+
# periods.
|
332
501
|
sig do
|
333
502
|
params(
|
334
503
|
invoices:
|
@@ -344,7 +513,40 @@ module MetronomeSDK
|
|
344
513
|
def create_historical_invoices(invoices:, preview:, request_options: {})
|
345
514
|
end
|
346
515
|
|
347
|
-
#
|
516
|
+
# Retrieve a comprehensive view of all available balances (commits and credits)
|
517
|
+
# for a customer. This endpoint provides real-time visibility into prepaid funds,
|
518
|
+
# postpaid commitments, promotional credits, and other balance types that can
|
519
|
+
# offset usage charges, helping you build transparent billing experiences.
|
520
|
+
#
|
521
|
+
# ### Use this endpoint to:
|
522
|
+
#
|
523
|
+
# - Display current available balances in customer dashboards
|
524
|
+
# - Verify available funds before approving high-usage operations
|
525
|
+
# - Generate balance reports for finance teams
|
526
|
+
# - Filter balances by contract or date ranges
|
527
|
+
#
|
528
|
+
# ### Key response fields:
|
529
|
+
#
|
530
|
+
# An array of balance objects (all credits and commits) containing:
|
531
|
+
#
|
532
|
+
# - Balance details: Current available amount for each commit or credit
|
533
|
+
# - Metadata: Product associations, priorities, applicable date ranges
|
534
|
+
# - Optional ledger entries: Detailed transaction history (if
|
535
|
+
# `include_ledgers=true`)
|
536
|
+
# - Balance calculations: Including pending transactions and future-dated entries
|
537
|
+
# - Custom fields: Any additional metadata attached to balances
|
538
|
+
#
|
539
|
+
# ### Usage guidelines:
|
540
|
+
#
|
541
|
+
# - Date filtering: Use `effective_before` to include only balances with access
|
542
|
+
# before a specific date (exclusive)
|
543
|
+
# - Set `include_balance=true` for calculated balance amounts on each commit or
|
544
|
+
# credit
|
545
|
+
# - Set `include_ledgers=true` for full transaction history
|
546
|
+
# - Set `include_contract_balances = true` to see contract level balances
|
547
|
+
# - Balance logic: Reflects currently accessible amounts, excluding expired/future
|
548
|
+
# segments
|
549
|
+
# - Manual adjustments: Includes all manual ledger entries, even future-dated ones
|
348
550
|
sig do
|
349
551
|
params(
|
350
552
|
customer_id: String,
|
@@ -359,7 +561,11 @@ module MetronomeSDK
|
|
359
561
|
next_page: String,
|
360
562
|
starting_at: Time,
|
361
563
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
362
|
-
).returns(
|
564
|
+
).returns(
|
565
|
+
MetronomeSDK::Internal::BodyCursorPage[
|
566
|
+
MetronomeSDK::Models::V1::ContractListBalancesResponse::Variants
|
567
|
+
]
|
568
|
+
)
|
363
569
|
end
|
364
570
|
def list_balances(
|
365
571
|
customer_id:,
|
@@ -388,7 +594,13 @@ module MetronomeSDK
|
|
388
594
|
)
|
389
595
|
end
|
390
596
|
|
391
|
-
#
|
597
|
+
# For a specific customer and contract, get the rates at a specific point in time.
|
598
|
+
# This endpoint takes the contract's rate card into consideration, including
|
599
|
+
# scheduled changes. It also takes into account overrides on the contract.
|
600
|
+
#
|
601
|
+
# For example, if you want to show your customer a summary of the prices they are
|
602
|
+
# paying, inclusive of any negotiated discounts or promotions, use this endpoint.
|
603
|
+
# This endpoint only returns rates that are entitled.
|
392
604
|
sig do
|
393
605
|
params(
|
394
606
|
contract_id: String,
|
@@ -425,8 +637,16 @@ module MetronomeSDK
|
|
425
637
|
)
|
426
638
|
end
|
427
639
|
|
428
|
-
#
|
429
|
-
#
|
640
|
+
# Get the history of subscription quantities and prices over time for a given
|
641
|
+
# `subscription_id`. This endpoint can be used to power an in-product experience
|
642
|
+
# where you show a customer their historical changes to seat count. Future changes
|
643
|
+
# are not included in this endpoint - use the `getContract` endpoint to view the
|
644
|
+
# future scheduled changes to a subscription's quantity.
|
645
|
+
#
|
646
|
+
# Subscriptions are used to model fixed recurring fees as well as seat-based
|
647
|
+
# recurring fees. To model changes to the number of seats in Metronome, you can
|
648
|
+
# increment or decrement the quantity on a subscription at any point in the past
|
649
|
+
# or future.
|
430
650
|
sig do
|
431
651
|
params(
|
432
652
|
contract_id: String,
|
@@ -478,7 +698,24 @@ module MetronomeSDK
|
|
478
698
|
)
|
479
699
|
end
|
480
700
|
|
481
|
-
#
|
701
|
+
# If a customer has multiple contracts with overlapping rates, the usage filter
|
702
|
+
# routes usage to the appropriate contract based on a predefined group key.
|
703
|
+
#
|
704
|
+
# As an example, imagine you have a customer associated with two projects. Each
|
705
|
+
# project is associated with its own contract. You can create a usage filter with
|
706
|
+
# group key `project_id` on each contract, and route usage for `project_1` to the
|
707
|
+
# first contract and `project_2` to the second contract.
|
708
|
+
#
|
709
|
+
# ### Use this endpoint to:
|
710
|
+
#
|
711
|
+
# - Support enterprise contracting scenarios where multiple contracts are
|
712
|
+
# associated to the same customer with the same rates.
|
713
|
+
# - Update the usage filter associated with the contract over time.
|
714
|
+
#
|
715
|
+
# ### Usage guidelines:
|
716
|
+
#
|
717
|
+
# To use usage filters, the `group_key` must be defined on the billable metrics
|
718
|
+
# underlying the rate card on the contracts.
|
482
719
|
sig do
|
483
720
|
params(
|
484
721
|
contract_id: String,
|
@@ -499,7 +736,11 @@ module MetronomeSDK
|
|
499
736
|
)
|
500
737
|
end
|
501
738
|
|
502
|
-
# Update
|
739
|
+
# Update or and an end date to a contract. Ending a contract early will impact
|
740
|
+
# draft usage statements, truncate any terms, and remove upcoming scheduled
|
741
|
+
# invoices. Moving the date into the future will only extend the contract length.
|
742
|
+
# Terms and scheduled invoices are not extended. Use this if a contract's end date
|
743
|
+
# has changed or if a perpetual contract ends.
|
503
744
|
sig do
|
504
745
|
params(
|
505
746
|
contract_id: String,
|
@@ -141,7 +141,11 @@ module MetronomeSDK
|
|
141
141
|
ending_before: Time,
|
142
142
|
starting_on: Time,
|
143
143
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
144
|
-
).returns(
|
144
|
+
).returns(
|
145
|
+
MetronomeSDK::Internal::CursorPageWithoutLimit[
|
146
|
+
MetronomeSDK::Models::V1::CreditGrantListEntriesResponse
|
147
|
+
]
|
148
|
+
)
|
145
149
|
end
|
146
150
|
def list_entries(
|
147
151
|
# Query param: Cursor that indicates where the next page of results should start.
|
@@ -4,8 +4,35 @@ module MetronomeSDK
|
|
4
4
|
module Resources
|
5
5
|
class V1
|
6
6
|
class CustomFields
|
7
|
-
#
|
8
|
-
#
|
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
|
sig do
|
10
37
|
params(
|
11
38
|
enforce_uniqueness: T::Boolean,
|
@@ -17,7 +44,10 @@ module MetronomeSDK
|
|
17
44
|
def add_key(enforce_uniqueness:, entity:, key:, request_options: {})
|
18
45
|
end
|
19
46
|
|
20
|
-
#
|
47
|
+
# Remove specific custom field values from a Metronome entity instance by
|
48
|
+
# specifying the field keys to delete. Use this endpoint to clean up unwanted
|
49
|
+
# custom field data while preserving other fields on the same entity. Requires the
|
50
|
+
# entity type, entity ID, and array of keys to remove.
|
21
51
|
sig do
|
22
52
|
params(
|
23
53
|
entity:
|
@@ -30,7 +60,10 @@ module MetronomeSDK
|
|
30
60
|
def delete_values(entity:, entity_id:, keys:, request_options: {})
|
31
61
|
end
|
32
62
|
|
33
|
-
#
|
63
|
+
# Retrieve all your active custom field keys, with optional filtering by entity
|
64
|
+
# type (customer, contract, product, etc.). Use this endpoint to discover what
|
65
|
+
# custom field keys are available before setting values on entities or to audit
|
66
|
+
# your custom field configuration across different entity types.
|
34
67
|
sig do
|
35
68
|
params(
|
36
69
|
next_page: String,
|
@@ -39,7 +72,11 @@ module MetronomeSDK
|
|
39
72
|
MetronomeSDK::V1::CustomFieldListKeysParams::Entity::OrSymbol
|
40
73
|
],
|
41
74
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
42
|
-
).returns(
|
75
|
+
).returns(
|
76
|
+
MetronomeSDK::Internal::CursorPageWithoutLimit[
|
77
|
+
MetronomeSDK::Models::V1::CustomFieldListKeysResponse
|
78
|
+
]
|
79
|
+
)
|
43
80
|
end
|
44
81
|
def list_keys(
|
45
82
|
# Query param: Cursor that indicates where the next page of results should start.
|
@@ -50,7 +87,10 @@ module MetronomeSDK
|
|
50
87
|
)
|
51
88
|
end
|
52
89
|
|
53
|
-
#
|
90
|
+
# Removes a custom field key from the allowlist for a specific entity type,
|
91
|
+
# preventing future use of that key across all instances of the entity. Existing
|
92
|
+
# values for this key on entity instances will no longer be accessible once the
|
93
|
+
# key is removed.
|
54
94
|
sig do
|
55
95
|
params(
|
56
96
|
entity:
|
@@ -62,13 +102,10 @@ module MetronomeSDK
|
|
62
102
|
def remove_key(entity:, key:, request_options: {})
|
63
103
|
end
|
64
104
|
|
65
|
-
# Sets
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
# transactional and will update all key/value pairs or no key/value pairs. Partial
|
70
|
-
# updates are not supported. There is a 200 character limit on custom field
|
71
|
-
# values.
|
105
|
+
# Sets custom field values on a specific Metronome entity instance. Overwrites
|
106
|
+
# existing values for matching keys while preserving other fields. All updates are
|
107
|
+
# transactional—either all values are set or none are. Custom field values are
|
108
|
+
# limited to 200 characters each.
|
72
109
|
sig do
|
73
110
|
params(
|
74
111
|
custom_fields: T::Hash[Symbol, String],
|
@@ -78,7 +115,13 @@ module MetronomeSDK
|
|
78
115
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
79
116
|
).void
|
80
117
|
end
|
81
|
-
def set_values(
|
118
|
+
def set_values(
|
119
|
+
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
120
|
+
custom_fields:,
|
121
|
+
entity:,
|
122
|
+
entity_id:,
|
123
|
+
request_options: {}
|
124
|
+
)
|
82
125
|
end
|
83
126
|
|
84
127
|
# @api private
|
@@ -5,12 +5,57 @@ module MetronomeSDK
|
|
5
5
|
class V1
|
6
6
|
class Customers
|
7
7
|
class Alerts
|
8
|
-
#
|
9
|
-
#
|
8
|
+
# Retrieve the real-time evaluation status for a specific alert-customer pair.
|
9
|
+
# This endpoint provides instant visibility into whether a customer has triggered
|
10
|
+
# an alert condition, enabling you to monitor account health and take proactive
|
11
|
+
# action based on current alert states.
|
12
|
+
#
|
13
|
+
# ### Use this endpoint to:
|
14
|
+
#
|
15
|
+
# - Check if a specific customer is currently violating an alert threshold
|
16
|
+
# (`in_alarm` status)
|
17
|
+
# - Verify alert configuration details and threshold values for a customer
|
18
|
+
# - Integrate alert status checks into customer support tools or admin interfaces
|
19
|
+
#
|
20
|
+
# ### Key response fields:
|
21
|
+
#
|
22
|
+
# A CustomerAlert object containing:
|
23
|
+
#
|
24
|
+
# - `customer_status`: The current evaluation state
|
25
|
+
#
|
26
|
+
# - `ok` - Customer is within acceptable thresholds
|
27
|
+
# - `in_alarm`- Customer has breached the alert threshold
|
28
|
+
# - `evaluating` - Alert has yet to be evaluated (typically due to a customer or
|
29
|
+
# alert having just been created)
|
30
|
+
# - `null` - Alert has been archived
|
31
|
+
# - `triggered_by`: Additional context about what caused the alert to trigger
|
32
|
+
# (when applicable)
|
33
|
+
# - alert: Complete alert configuration including:
|
34
|
+
# - Alert ID, name, and type
|
35
|
+
# - Current threshold values and credit type information
|
36
|
+
# - Alert status (enabled, disabled, or archived)
|
37
|
+
# - Last update timestamp
|
38
|
+
# - Any applied filters (credit grant types, custom fields, group values)
|
39
|
+
#
|
40
|
+
# ### Usage guidelines:
|
41
|
+
#
|
42
|
+
# - Customer status: Returns the current evaluation state, not historical data.
|
43
|
+
# For alert history, use webhook notifications or event logs
|
44
|
+
# - Archived alerts: Returns null for customer_status if the alert has been
|
45
|
+
# archived, but still includes the alert configuration details
|
46
|
+
# - Integration patterns: This endpoint can be used to check a customer's alert
|
47
|
+
# status, but shouldn't be scraped. You should instead rely on the webhook
|
48
|
+
# notification to understand when customers are moved to IN_ALARM.
|
49
|
+
# - Error handling: Returns 404 if either the customer or alert ID doesn't exist
|
50
|
+
# or isn't accessible to your organization
|
10
51
|
sig do
|
11
52
|
params(
|
12
53
|
alert_id: String,
|
13
54
|
customer_id: String,
|
55
|
+
group_values:
|
56
|
+
T::Array[
|
57
|
+
MetronomeSDK::V1::Customers::AlertRetrieveParams::GroupValue::OrHash
|
58
|
+
],
|
14
59
|
plans_or_contracts:
|
15
60
|
MetronomeSDK::V1::Customers::AlertRetrieveParams::PlansOrContracts::OrSymbol,
|
16
61
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
@@ -23,6 +68,9 @@ module MetronomeSDK
|
|
23
68
|
alert_id:,
|
24
69
|
# The Metronome ID of the customer
|
25
70
|
customer_id:,
|
71
|
+
# Only present for `spend_threshold_reached` alerts. Retrieve the alert for a
|
72
|
+
# specific group key-value pair.
|
73
|
+
group_values: nil,
|
26
74
|
# When parallel alerts are enabled during migration, this flag denotes whether to
|
27
75
|
# fetch alerts for plans or contracts.
|
28
76
|
plans_or_contracts: nil,
|
@@ -30,7 +78,31 @@ module MetronomeSDK
|
|
30
78
|
)
|
31
79
|
end
|
32
80
|
|
33
|
-
#
|
81
|
+
# Retrieve all alert configurations and their current statuses for a specific
|
82
|
+
# customer in a single API call. This endpoint provides a comprehensive view of
|
83
|
+
# all alerts monitoring a customer account.
|
84
|
+
#
|
85
|
+
# ### Use this endpoint to:
|
86
|
+
#
|
87
|
+
# - Display all active alerts for a customer in dashboards or admin panels
|
88
|
+
# - Quickly identify which alerts a customer is currently triggering
|
89
|
+
# - Audit alert coverage for specific accounts
|
90
|
+
# - Filter alerts by status (enabled, disabled, or archived)
|
91
|
+
#
|
92
|
+
# ### Key response fields:
|
93
|
+
#
|
94
|
+
# - data: Array of CustomerAlert objects, each containing:
|
95
|
+
# - Current evaluation status (`ok`, `in_alarm`, `evaluating`, or `null`)
|
96
|
+
# - Complete alert configuration and threshold details
|
97
|
+
# - Alert metadata including type, name, and last update time
|
98
|
+
# - `next_page`: Pagination cursor for retrieving additional results
|
99
|
+
#
|
100
|
+
# ### Usage guidelines:
|
101
|
+
#
|
102
|
+
# - Default behavior: Returns only enabled alerts unless alert_statuses filter is
|
103
|
+
# specified
|
104
|
+
# - Pagination: Use the `next_page` cursor to retrieve all results for customers
|
105
|
+
# with many alerts
|
34
106
|
sig do
|
35
107
|
params(
|
36
108
|
customer_id: String,
|
@@ -40,7 +112,11 @@ module MetronomeSDK
|
|
40
112
|
MetronomeSDK::V1::Customers::AlertListParams::AlertStatus::OrSymbol
|
41
113
|
],
|
42
114
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
43
|
-
).returns(
|
115
|
+
).returns(
|
116
|
+
MetronomeSDK::Internal::CursorPageWithoutLimit[
|
117
|
+
MetronomeSDK::V1::Customers::CustomerAlert
|
118
|
+
]
|
119
|
+
)
|
44
120
|
end
|
45
121
|
def list(
|
46
122
|
# Body param: The Metronome ID of the customer
|
@@ -54,7 +130,34 @@ module MetronomeSDK
|
|
54
130
|
)
|
55
131
|
end
|
56
132
|
|
57
|
-
#
|
133
|
+
# Force an immediate re-evaluation of a specific alert for a customer, clearing
|
134
|
+
# any previous state and triggering a fresh assessment against current thresholds.
|
135
|
+
# This endpoint ensures alert accuracy after configuration changes or data
|
136
|
+
# corrections.
|
137
|
+
#
|
138
|
+
# ### Use this endpoint to:
|
139
|
+
#
|
140
|
+
# - Clear false positive alerts after fixing data issues
|
141
|
+
# - Re-evaluate alerts after adjusting customer balances or credits
|
142
|
+
# - Test alert behavior during development and debugging
|
143
|
+
# - Resolve stuck alerts that may be in an incorrect state
|
144
|
+
# - Trigger immediate evaluation after threshold modifications
|
145
|
+
#
|
146
|
+
# ### Key response fields:
|
147
|
+
#
|
148
|
+
# - 200 Success: Confirmation that the alert has been reset and re-evaluation
|
149
|
+
# initiated
|
150
|
+
# - No response body is returned - the operation completes asynchronously
|
151
|
+
#
|
152
|
+
# ### Usage guidelines:
|
153
|
+
#
|
154
|
+
# - Immediate effect: Triggers re-evaluation instantly, which may result in new
|
155
|
+
# webhook notifications if thresholds are breached
|
156
|
+
# - State clearing: Removes any cached evaluation state, ensuring a fresh
|
157
|
+
# assessment
|
158
|
+
# - Use sparingly: Intended for exceptional cases, not routine operations
|
159
|
+
# - Asynchronous processing: The reset completes immediately, but re-evaluation
|
160
|
+
# happens in the background
|
58
161
|
sig do
|
59
162
|
params(
|
60
163
|
alert_id: String,
|