metronome-sdk 0.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +91 -0
- data/README.md +9 -9
- data/lib/metronome_sdk/errors.rb +25 -11
- data/lib/metronome_sdk/file_part.rb +10 -7
- data/lib/metronome_sdk/internal/body_cursor_page.rb +86 -0
- data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
- data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +86 -0
- data/lib/metronome_sdk/internal/transport/base_client.rb +12 -11
- data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +8 -19
- data/lib/metronome_sdk/internal/type/base_model.rb +6 -13
- data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
- data/lib/metronome_sdk/internal/type/enum.rb +25 -0
- data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
- data/lib/metronome_sdk/internal/type/union.rb +11 -0
- data/lib/metronome_sdk/internal/util.rb +9 -8
- 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 +3169 -0
- data/lib/metronome_sdk/models/contract_without_amendments.rb +38 -1128
- 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 +173 -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 +150 -0
- data/lib/metronome_sdk/models/payment_gate_config_v2.rb +150 -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/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 +311 -0
- data/lib/metronome_sdk/models/update_base_threshold_commit.rb +36 -0
- data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +42 -42
- 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 +58 -411
- data/lib/metronome_sdk/models/v1/contract_create_historical_invoices_params.rb +7 -16
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +315 -1459
- 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 +2 -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 +11 -2
- 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 +6 -18
- data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -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 +4 -6
- data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +37 -8
- 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 +10 -60
- data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +6 -48
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +48 -54
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +197 -66
- data/lib/metronome_sdk/models/v1/customers/invoice_list_breakdowns_params.rb +1 -4
- data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
- 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/payment.rb +151 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
- data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
- 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 +37 -58
- data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +34 -49
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +552 -2265
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +417 -2317
- 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 +90 -16
- 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 +25 -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 +255 -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 +127 -13
- 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 +179 -8
- data/lib/metronome_sdk/resources/v1/customers.rb +175 -15
- 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/payments.rb +102 -0
- 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 +188 -13
- data/lib/metronome_sdk/resources/v1.rb +4 -0
- data/lib/metronome_sdk/resources/v2/contracts.rb +120 -18
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +33 -3
- data/rbi/metronome_sdk/errors.rbi +31 -4
- data/rbi/metronome_sdk/file_part.rbi +1 -1
- 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/transport/base_client.rbi +4 -5
- data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
- data/rbi/metronome_sdk/internal/util.rbi +1 -1
- 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 +6415 -0
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +186 -2509
- 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 +424 -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 +317 -0
- data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +326 -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/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 +635 -0
- data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +61 -0
- data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +57 -50
- 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 +49 -768
- data/rbi/metronome_sdk/models/v1/contract_create_historical_invoices_params.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1843 -4119
- 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 +2 -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 +10 -0
- data/rbi/metronome_sdk/models/v1/customer_list_billable_metrics_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
- data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
- 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_list_params.rbi +4 -4
- data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
- data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +68 -8
- 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 +6 -90
- data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +6 -90
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +54 -47
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +316 -68
- data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
- data/rbi/metronome_sdk/models/v1/customers/plan_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
- data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -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 +74 -76
- data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +74 -76
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +3875 -7234
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1733 -6207
- 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 +101 -27
- 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 +25 -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 +258 -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 +133 -11
- 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 +159 -7
- data/rbi/metronome_sdk/resources/v1/customers.rbi +162 -14
- 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/payments.rbi +72 -0
- 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 +191 -13
- data/rbi/metronome_sdk/resources/v1.rbi +3 -0
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +134 -23
- data/sig/metronome_sdk/errors.rbs +7 -0
- data/sig/metronome_sdk/file_part.rbs +1 -1
- 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/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 +3108 -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 +152 -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 +124 -0
- data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +124 -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/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 +295 -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 +26 -341
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +219 -1184
- 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/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_detail.rbs +5 -0
- data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
- data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -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 +6 -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 +137 -24
- data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
- data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
- data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
- data/sig/metronome_sdk/models/v1/usage_list_response.rbs +33 -55
- data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +28 -43
- data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +28 -43
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +412 -1793
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +342 -2149
- 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/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/invoices.rbs +6 -0
- data/sig/metronome_sdk/resources/v1/customers.rbs +11 -0
- data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
- data/sig/metronome_sdk/resources/v1/usage.rbs +1 -1
- data/sig/metronome_sdk/resources/v1.rbs +2 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +10 -4
- metadata +101 -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
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
# typed: strong
|
|
2
2
|
|
|
3
3
|
module MetronomeSDK
|
|
4
|
+
BaseThresholdCommit = MetronomeSDK::Models::BaseThresholdCommit
|
|
5
|
+
|
|
4
6
|
BaseUsageFilter = MetronomeSDK::Models::BaseUsageFilter
|
|
5
7
|
|
|
6
8
|
Commit = MetronomeSDK::Models::Commit
|
|
7
9
|
|
|
10
|
+
CommitHierarchyConfiguration =
|
|
11
|
+
MetronomeSDK::Models::CommitHierarchyConfiguration
|
|
12
|
+
|
|
13
|
+
CommitRate = MetronomeSDK::Models::CommitRate
|
|
14
|
+
|
|
15
|
+
CommitSpecifier = MetronomeSDK::Models::CommitSpecifier
|
|
16
|
+
|
|
17
|
+
CommitSpecifierInput = MetronomeSDK::Models::CommitSpecifierInput
|
|
18
|
+
|
|
19
|
+
Contract = MetronomeSDK::Models::Contract
|
|
20
|
+
|
|
21
|
+
ContractV2 = MetronomeSDK::Models::ContractV2
|
|
22
|
+
|
|
8
23
|
ContractWithoutAmendments = MetronomeSDK::Models::ContractWithoutAmendments
|
|
9
24
|
|
|
10
25
|
Credit = MetronomeSDK::Models::Credit
|
|
@@ -15,24 +30,53 @@ module MetronomeSDK
|
|
|
15
30
|
|
|
16
31
|
EventTypeFilter = MetronomeSDK::Models::EventTypeFilter
|
|
17
32
|
|
|
33
|
+
HierarchyConfiguration = MetronomeSDK::Models::HierarchyConfiguration
|
|
34
|
+
|
|
18
35
|
ID = MetronomeSDK::Models::ID
|
|
19
36
|
|
|
20
37
|
Override = MetronomeSDK::Models::Override
|
|
21
38
|
|
|
39
|
+
OverrideTier = MetronomeSDK::Models::OverrideTier
|
|
40
|
+
|
|
41
|
+
OverwriteRate = MetronomeSDK::Models::OverwriteRate
|
|
42
|
+
|
|
43
|
+
PaymentGateConfig = MetronomeSDK::Models::PaymentGateConfig
|
|
44
|
+
|
|
45
|
+
PaymentGateConfigV2 = MetronomeSDK::Models::PaymentGateConfigV2
|
|
46
|
+
|
|
47
|
+
PrepaidBalanceThresholdConfiguration =
|
|
48
|
+
MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration
|
|
49
|
+
|
|
50
|
+
PrepaidBalanceThresholdConfigurationV2 =
|
|
51
|
+
MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2
|
|
52
|
+
|
|
22
53
|
PropertyFilter = MetronomeSDK::Models::PropertyFilter
|
|
23
54
|
|
|
24
55
|
ProService = MetronomeSDK::Models::ProService
|
|
25
56
|
|
|
26
57
|
Rate = MetronomeSDK::Models::Rate
|
|
27
58
|
|
|
59
|
+
RecurringCommitSubscriptionConfig =
|
|
60
|
+
MetronomeSDK::Models::RecurringCommitSubscriptionConfig
|
|
61
|
+
|
|
28
62
|
ScheduledCharge = MetronomeSDK::Models::ScheduledCharge
|
|
29
63
|
|
|
30
64
|
ScheduleDuration = MetronomeSDK::Models::ScheduleDuration
|
|
31
65
|
|
|
32
66
|
SchedulePointInTime = MetronomeSDK::Models::SchedulePointInTime
|
|
33
67
|
|
|
68
|
+
SpendThresholdConfiguration =
|
|
69
|
+
MetronomeSDK::Models::SpendThresholdConfiguration
|
|
70
|
+
|
|
71
|
+
SpendThresholdConfigurationV2 =
|
|
72
|
+
MetronomeSDK::Models::SpendThresholdConfigurationV2
|
|
73
|
+
|
|
74
|
+
Subscription = MetronomeSDK::Models::Subscription
|
|
75
|
+
|
|
34
76
|
Tier = MetronomeSDK::Models::Tier
|
|
35
77
|
|
|
78
|
+
UpdateBaseThresholdCommit = MetronomeSDK::Models::UpdateBaseThresholdCommit
|
|
79
|
+
|
|
36
80
|
V1 = MetronomeSDK::Models::V1
|
|
37
81
|
|
|
38
82
|
V2 = MetronomeSDK::Models::V2
|
|
@@ -4,7 +4,51 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Alerts
|
|
7
|
-
# Create a new
|
|
7
|
+
# Create a new threshold notification to monitor customer spending, balances, and
|
|
8
|
+
# billing metrics in real-time. Metronome's notification system provides
|
|
9
|
+
# industry-leading speed with immediate evaluation capabilities, enabling you to
|
|
10
|
+
# proactively manage customer accounts and prevent revenue leakage.
|
|
11
|
+
#
|
|
12
|
+
# This endpoint creates configurable threshold notifications that continuously
|
|
13
|
+
# monitor various billing thresholds including spend limits, credit balances,
|
|
14
|
+
# commitment utilization, and invoice totals. Threshold notifications can be
|
|
15
|
+
# configured globally for all customers or targeted to specific customer accounts.
|
|
16
|
+
#
|
|
17
|
+
# ### Use this endpoint to:
|
|
18
|
+
#
|
|
19
|
+
# - Proactively monitor customer spending patterns to prevent unexpected overages
|
|
20
|
+
# or credit exhaustion
|
|
21
|
+
# - Automate notifications when customers approach commitment limits or credit
|
|
22
|
+
# thresholds
|
|
23
|
+
# - Enable real-time intervention for accounts at risk of churn or payment issues
|
|
24
|
+
# - Scale billing operations by automating threshold-based workflows and
|
|
25
|
+
# notifications
|
|
26
|
+
#
|
|
27
|
+
# ### Key response fields:
|
|
28
|
+
#
|
|
29
|
+
# A successful response returns a CustomerAlert object containing:
|
|
30
|
+
#
|
|
31
|
+
# - The threshold notification configuration with its unique ID and current status
|
|
32
|
+
# - The customer's evaluation status (ok, in_alarm, or evaluating)
|
|
33
|
+
# - Threshold notification metadata including type, threshold values, and update
|
|
34
|
+
# timestamps
|
|
35
|
+
#
|
|
36
|
+
# ### Usage guidelines:
|
|
37
|
+
#
|
|
38
|
+
# - Immediate evaluation: Set `evaluate_on_create` : `true` (default) for instant
|
|
39
|
+
# evaluation against existing customers
|
|
40
|
+
# - Uniqueness constraints: Each threshold notification must have a unique
|
|
41
|
+
# `uniqueness_key` within your organization. Use `release_uniqueness_key` :
|
|
42
|
+
# `true` when archiving to reuse keys
|
|
43
|
+
# - Notification type requirements: Different threshold notification types require
|
|
44
|
+
# specific fields (e.g., `billable_metric_id` for usage notifications,
|
|
45
|
+
# `credit_type_id` for credit-based threshold notifications)
|
|
46
|
+
# - Webhook delivery: Threshold notifications trigger webhook notifications for
|
|
47
|
+
# real-time integration with your systems. Configure webhook endpoints before
|
|
48
|
+
# creating threshold notifications
|
|
49
|
+
# - Performance at scale: Metronome's event-driven architecture processes
|
|
50
|
+
# threshold notification evaluations in real-time as usage events stream in,
|
|
51
|
+
# unlike competitors who rely on periodic polling or batch evaluation cycles
|
|
8
52
|
sig do
|
|
9
53
|
params(
|
|
10
54
|
alert_type:
|
|
@@ -29,42 +73,44 @@ module MetronomeSDK
|
|
|
29
73
|
).returns(MetronomeSDK::Models::V1::AlertCreateResponse)
|
|
30
74
|
end
|
|
31
75
|
def create(
|
|
32
|
-
# Type of the
|
|
76
|
+
# Type of the threshold notification
|
|
33
77
|
alert_type:,
|
|
34
|
-
# Name of the
|
|
78
|
+
# Name of the threshold notification
|
|
35
79
|
name:,
|
|
36
|
-
# Threshold value of the
|
|
37
|
-
# may represent a financial amount, the days remaining, or a
|
|
80
|
+
# Threshold value of the notification policy. Depending upon the notification
|
|
81
|
+
# type, this number may represent a financial amount, the days remaining, or a
|
|
82
|
+
# percentage reached.
|
|
38
83
|
threshold:,
|
|
39
|
-
# For
|
|
40
|
-
# track the usage for.
|
|
84
|
+
# For threshold notifications of type `usage_threshold_reached`, specifies which
|
|
85
|
+
# billable metric to track the usage for.
|
|
41
86
|
billable_metric_id: nil,
|
|
42
|
-
# An array of strings, representing a way to filter the credit grant this
|
|
43
|
-
# applies to, by looking at the credit_grant_type field on
|
|
44
|
-
# field is only defined for CreditPercentage and
|
|
87
|
+
# An array of strings, representing a way to filter the credit grant this
|
|
88
|
+
# threshold notification applies to, by looking at the credit_grant_type field on
|
|
89
|
+
# the credit grant. This field is only defined for CreditPercentage and
|
|
90
|
+
# CreditBalance notifications
|
|
45
91
|
credit_grant_type_filters: nil,
|
|
46
|
-
# ID of the credit's currency, defaults to USD. If the specific
|
|
92
|
+
# ID of the credit's currency, defaults to USD. If the specific notification type
|
|
47
93
|
# requires a pricing unit/currency, find the ID in the
|
|
48
94
|
# [Metronome app](https://app.metronome.com/offering/pricing-units).
|
|
49
95
|
credit_type_id: nil,
|
|
50
|
-
# A list of custom field filters for
|
|
51
|
-
# Only present for contract invoices.
|
|
96
|
+
# A list of custom field filters for threshold notification types that support
|
|
97
|
+
# advanced filtering. Only present for contract invoices.
|
|
52
98
|
custom_field_filters: nil,
|
|
53
|
-
# If provided, will create this
|
|
54
|
-
#
|
|
99
|
+
# If provided, will create this threshold notification for this specific customer.
|
|
100
|
+
# To create a notification for all customers, do not specify a `customer_id`.
|
|
55
101
|
customer_id: nil,
|
|
56
|
-
# If true, the
|
|
57
|
-
#
|
|
58
|
-
# trigger the
|
|
102
|
+
# If true, the threshold notification will evaluate immediately on customers that
|
|
103
|
+
# already meet the notification threshold. If false, it will only evaluate on
|
|
104
|
+
# future customers that trigger the threshold. Defaults to true.
|
|
59
105
|
evaluate_on_create: nil,
|
|
60
|
-
# Only present for `spend_threshold_reached`
|
|
61
|
-
# group key on individual line items.
|
|
106
|
+
# Only present for `spend_threshold_reached` notifications. Scope notification to
|
|
107
|
+
# a specific group key on individual line items.
|
|
62
108
|
group_values: nil,
|
|
63
|
-
# Only supported for invoice_total_reached
|
|
64
|
-
# evaluate.
|
|
109
|
+
# Only supported for invoice_total_reached threshold notifications. A list of
|
|
110
|
+
# invoice types to evaluate.
|
|
65
111
|
invoice_types_filter: nil,
|
|
66
|
-
# If provided, will create this
|
|
67
|
-
# for all customers, do not specify a `plan_id`.
|
|
112
|
+
# If provided, will create this threshold notification for this specific plan. To
|
|
113
|
+
# create a notification for all customers, do not specify a `plan_id`.
|
|
68
114
|
plan_id: nil,
|
|
69
115
|
# Prevents the creation of duplicates. If a request to create a record is made
|
|
70
116
|
# with a previously used uniqueness key, a new record will not be created and the
|
|
@@ -74,7 +120,34 @@ module MetronomeSDK
|
|
|
74
120
|
)
|
|
75
121
|
end
|
|
76
122
|
|
|
77
|
-
#
|
|
123
|
+
# Permanently disable a threshold notification and remove it from active
|
|
124
|
+
# monitoring across all customers. Archived threshold notifications stop
|
|
125
|
+
# evaluating immediately and can optionally release their uniqueness key for reuse
|
|
126
|
+
# in future threshold notification configurations.
|
|
127
|
+
#
|
|
128
|
+
# ### Use this endpoint to:
|
|
129
|
+
#
|
|
130
|
+
# - Decommission threshold notifications that are no longer needed
|
|
131
|
+
# - Clean up test or deprecated threshold notification configurations
|
|
132
|
+
# - Free up uniqueness keys for reuse with new threshold notifications
|
|
133
|
+
# - Stop threshold notification evaluations without losing historical
|
|
134
|
+
# configuration data
|
|
135
|
+
# - Disable outdated monitoring rules during pricing model transitions
|
|
136
|
+
#
|
|
137
|
+
# ### Key response fields:
|
|
138
|
+
#
|
|
139
|
+
# - data: Object containing the archived threshold notification's ID
|
|
140
|
+
#
|
|
141
|
+
# ### Usage guidelines:
|
|
142
|
+
#
|
|
143
|
+
# - Irreversible for evaluation: Archived threshold notifications cannot be
|
|
144
|
+
# re-enabled; create a new threshold notification to resume monitoring
|
|
145
|
+
# - Uniqueness key handling: Set `release_uniqueness_key` : `true` to reuse the
|
|
146
|
+
# key in future threshold notifications
|
|
147
|
+
# - Immediate effect: Threshold notification evaluation stops instantly across all
|
|
148
|
+
# customers
|
|
149
|
+
# - Historical preservation: Archive operation maintains threshold notification
|
|
150
|
+
# history and configuration for compliance and auditing
|
|
78
151
|
sig do
|
|
79
152
|
params(
|
|
80
153
|
id: String,
|
|
@@ -83,9 +156,10 @@ module MetronomeSDK
|
|
|
83
156
|
).returns(MetronomeSDK::Models::V1::AlertArchiveResponse)
|
|
84
157
|
end
|
|
85
158
|
def archive(
|
|
86
|
-
# The Metronome ID of the
|
|
159
|
+
# The Metronome ID of the threshold notification
|
|
87
160
|
id:,
|
|
88
|
-
# If true, resets the uniqueness key on this
|
|
161
|
+
# If true, resets the uniqueness key on this threshold notification so it can be
|
|
162
|
+
# re-used
|
|
89
163
|
release_uniqueness_key: nil,
|
|
90
164
|
request_options: {}
|
|
91
165
|
)
|
|
@@ -4,10 +4,45 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class AuditLogs
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
7
|
+
# Get a comprehensive audit trail of all operations performed in your Metronome
|
|
8
|
+
# account, whether initiated through the API, web interface, or automated
|
|
9
|
+
# processes. This endpoint provides detailed logs of who did what and when,
|
|
10
|
+
# enabling compliance reporting, security monitoring, and operational
|
|
11
|
+
# troubleshooting across all interaction channels.
|
|
12
|
+
#
|
|
13
|
+
# ### Use this endpoint to:
|
|
14
|
+
#
|
|
15
|
+
# - Monitor all account activity for security and compliance purposes
|
|
16
|
+
# - Track configuration changes regardless of source (API, UI, or system)
|
|
17
|
+
# - Investigate issues by reviewing historical operations
|
|
18
|
+
#
|
|
19
|
+
# ### Key response fields:
|
|
20
|
+
#
|
|
21
|
+
# An array of AuditLog objects containing:
|
|
22
|
+
#
|
|
23
|
+
# - id: Unique identifier for the audit log entry
|
|
24
|
+
# - timestamp: When the action occurred (RFC 3339 format)
|
|
25
|
+
# - actor: Information about who performed the action
|
|
26
|
+
# - request: Details including request ID, IP address, and user agent
|
|
27
|
+
# - `resource_type`: The type of resource affected (e.g., customer, contract,
|
|
28
|
+
# invoice)
|
|
29
|
+
# - `resource_id`: The specific resource identifier
|
|
30
|
+
# - `action`: The operation performed
|
|
31
|
+
# - `next_page`: Cursor for continuous log retrieval
|
|
32
|
+
#
|
|
33
|
+
# ### Usage guidelines:
|
|
34
|
+
#
|
|
35
|
+
# - Continuous retrieval: The next_page token enables uninterrupted log
|
|
36
|
+
# streaming—save it between requests to ensure no logs are missed
|
|
37
|
+
# - Empty responses: An empty data array means no new logs yet; continue polling
|
|
38
|
+
# with the same next_page token
|
|
39
|
+
# - Date filtering:
|
|
40
|
+
# - `starting_on`: Earliest logs to return (inclusive)
|
|
41
|
+
# - `ending_before`: Latest logs to return (exclusive)
|
|
42
|
+
# - Cannot be used with `next_page`
|
|
43
|
+
# - Resource filtering: Must specify both `resource_type` and `resource_id`
|
|
44
|
+
# together
|
|
45
|
+
# - Sort order: Default is `date_asc`; use `date_desc` for newest first
|
|
11
46
|
sig do
|
|
12
47
|
params(
|
|
13
48
|
ending_before: Time,
|
|
@@ -4,7 +4,35 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class BillableMetrics
|
|
7
|
-
#
|
|
7
|
+
# Create billable metrics programmatically with this endpoint—an essential step in
|
|
8
|
+
# configuring your pricing and packaging in Metronome.
|
|
9
|
+
#
|
|
10
|
+
# A billable metric is a customizable query that filters and aggregates events
|
|
11
|
+
# from your event stream. These metrics are continuously tracked as usage data
|
|
12
|
+
# enters Metronome through the ingestion pipeline. The ingestion process
|
|
13
|
+
# transforms raw usage data into actionable pricing metrics, enabling accurate
|
|
14
|
+
# metering and billing for your products.
|
|
15
|
+
#
|
|
16
|
+
# ### Use this endpoint to:
|
|
17
|
+
#
|
|
18
|
+
# - Create individual or multiple billable metrics as part of a setup workflow.
|
|
19
|
+
# - Automate the entire pricing configuration process, from metric creation to
|
|
20
|
+
# customer contract setup.
|
|
21
|
+
# - Define metrics using either standard filtering/aggregation or a custom SQL
|
|
22
|
+
# query.
|
|
23
|
+
#
|
|
24
|
+
# ### Key response fields:
|
|
25
|
+
#
|
|
26
|
+
# - The ID of the billable metric that was created
|
|
27
|
+
# - The created billable metric will be available to be used in Products, usage
|
|
28
|
+
# endpoints, and alerts.
|
|
29
|
+
#
|
|
30
|
+
# ### Usage guidelines:
|
|
31
|
+
#
|
|
32
|
+
# - Metrics defined using standard filtering and aggregation are Streaming
|
|
33
|
+
# billable metrics, which have been optimized for ultra low latency and high
|
|
34
|
+
# throughput workflows.
|
|
35
|
+
# - Use SQL billable metrics if you require more flexible aggregation options.
|
|
8
36
|
sig do
|
|
9
37
|
params(
|
|
10
38
|
name: String,
|
|
@@ -47,7 +75,17 @@ module MetronomeSDK
|
|
|
47
75
|
)
|
|
48
76
|
end
|
|
49
77
|
|
|
50
|
-
#
|
|
78
|
+
# Retrieves the complete configuration for a specific billable metric by its ID.
|
|
79
|
+
# Use this to review billable metric setup before associating it with products.
|
|
80
|
+
# Returns the metric's `name`, `event_type_filter`, `property_filters`,
|
|
81
|
+
# `aggregation_type`, `aggregation_key`, `group_keys`, `custom fields`, and
|
|
82
|
+
# `SQL query` (if it's a SQL billable metric).
|
|
83
|
+
#
|
|
84
|
+
# Important:
|
|
85
|
+
#
|
|
86
|
+
# - Archived billable metrics will include an `archived_at` timestamp; they no
|
|
87
|
+
# longer process new usage events but remain accessible for historical
|
|
88
|
+
# reference.
|
|
51
89
|
sig do
|
|
52
90
|
params(
|
|
53
91
|
billable_metric_id: String,
|
|
@@ -57,7 +95,11 @@ module MetronomeSDK
|
|
|
57
95
|
def retrieve(billable_metric_id:, request_options: {})
|
|
58
96
|
end
|
|
59
97
|
|
|
60
|
-
#
|
|
98
|
+
# Retrieves all billable metrics with their complete configurations. Use this for
|
|
99
|
+
# programmatic discovery and management of billable metrics, such as associating
|
|
100
|
+
# metrics to products and auditing for orphaned or archived metrics. Important:
|
|
101
|
+
# Archived metrics are excluded by default; use `include_archived`=`true`
|
|
102
|
+
# parameter to include them.
|
|
61
103
|
sig do
|
|
62
104
|
params(
|
|
63
105
|
include_archived: T::Boolean,
|
|
@@ -81,7 +123,15 @@ module MetronomeSDK
|
|
|
81
123
|
)
|
|
82
124
|
end
|
|
83
125
|
|
|
84
|
-
#
|
|
126
|
+
# Use this endpoint to retire billable metrics that are no longer used. After a
|
|
127
|
+
# billable metric is archived, that billable metric can no longer be used in any
|
|
128
|
+
# new Products to define how that product should be metered. If you archive a
|
|
129
|
+
# billable metric that is already associated with a Product, the Product will
|
|
130
|
+
# continue to function as usual, metering based on the definition of the archived
|
|
131
|
+
# billable metric.
|
|
132
|
+
#
|
|
133
|
+
# Archived billable metrics will be returned on the `getBillableMetric` and
|
|
134
|
+
# `listBillableMetrics` endpoints with a populated `archived_at` field.
|
|
85
135
|
sig do
|
|
86
136
|
params(
|
|
87
137
|
id: String,
|
|
@@ -5,7 +5,11 @@ module MetronomeSDK
|
|
|
5
5
|
class V1
|
|
6
6
|
class Contracts
|
|
7
7
|
class Products
|
|
8
|
-
# Create a new product
|
|
8
|
+
# Create a new product object. Products in Metronome represent your company's
|
|
9
|
+
# individual product or service offerings. A Product can be thought of as the
|
|
10
|
+
# basic unit of a line item on the invoice. This is analogous to SKUs or items in
|
|
11
|
+
# an ERP system. Give the product a meaningful name as they will appear on
|
|
12
|
+
# customer invoices.
|
|
9
13
|
sig do
|
|
10
14
|
params(
|
|
11
15
|
name: String,
|
|
@@ -45,6 +49,7 @@ module MetronomeSDK
|
|
|
45
49
|
composite_product_ids: nil,
|
|
46
50
|
# Required for COMPOSITE products
|
|
47
51
|
composite_tags: nil,
|
|
52
|
+
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
48
53
|
custom_fields: nil,
|
|
49
54
|
# Beta feature only available for composite products. If true, products with $0
|
|
50
55
|
# will not be included when computing composite usage. Defaults to false
|
|
@@ -83,7 +88,7 @@ module MetronomeSDK
|
|
|
83
88
|
)
|
|
84
89
|
end
|
|
85
90
|
|
|
86
|
-
#
|
|
91
|
+
# Retrieve a product by its ID, including all metadata and historical changes.
|
|
87
92
|
sig do
|
|
88
93
|
params(
|
|
89
94
|
id: String,
|
|
@@ -95,7 +100,17 @@ module MetronomeSDK
|
|
|
95
100
|
def retrieve(id:, request_options: {})
|
|
96
101
|
end
|
|
97
102
|
|
|
98
|
-
#
|
|
103
|
+
# Updates a product's configuration while maintaining billing continuity for
|
|
104
|
+
# active customers. Use this endpoint to modify product names, metrics, pricing
|
|
105
|
+
# rules, and composite settings without disrupting ongoing billing cycles. Changes
|
|
106
|
+
# are scheduled using the starting_at timestamp, which must be on an hour
|
|
107
|
+
# boundary—set future dates to schedule updates ahead of time, or past dates for
|
|
108
|
+
# retroactive changes. Returns the updated product ID upon success.
|
|
109
|
+
#
|
|
110
|
+
# ### Usage guidance:
|
|
111
|
+
#
|
|
112
|
+
# - Product type cannot be changed after creation. For incorrect product types,
|
|
113
|
+
# create a new product and archive the original instead.
|
|
99
114
|
sig do
|
|
100
115
|
params(
|
|
101
116
|
product_id: String,
|
|
@@ -182,7 +197,9 @@ module MetronomeSDK
|
|
|
182
197
|
)
|
|
183
198
|
end
|
|
184
199
|
|
|
185
|
-
#
|
|
200
|
+
# Get a paginated list of all products in your organization with their complete
|
|
201
|
+
# configuration, version history, and metadata. By default excludes archived
|
|
202
|
+
# products unless explicitly requested via the `archive_filter` parameter.
|
|
186
203
|
sig do
|
|
187
204
|
params(
|
|
188
205
|
limit: Integer,
|
|
@@ -208,7 +225,10 @@ module MetronomeSDK
|
|
|
208
225
|
)
|
|
209
226
|
end
|
|
210
227
|
|
|
211
|
-
# Archive a product
|
|
228
|
+
# Archive a product. Any current rate cards associated with this product will
|
|
229
|
+
# continue to function as normal. However, it will no longer be available as an
|
|
230
|
+
# option for newly created rates. Once you archive a product, you can still
|
|
231
|
+
# retrieve it in the UI and API, but you cannot unarchive it.
|
|
212
232
|
sig do
|
|
213
233
|
params(
|
|
214
234
|
product_id: String,
|
|
@@ -6,7 +6,10 @@ module MetronomeSDK
|
|
|
6
6
|
class Contracts
|
|
7
7
|
class RateCards
|
|
8
8
|
class ProductOrders
|
|
9
|
-
#
|
|
9
|
+
# The ordering of products on a rate card determines the order in which the
|
|
10
|
+
# products will appear on customers' invoices. Use this endpoint to set the order
|
|
11
|
+
# of specific products on the rate card by moving them relative to their current
|
|
12
|
+
# location.
|
|
10
13
|
sig do
|
|
11
14
|
params(
|
|
12
15
|
product_moves:
|
|
@@ -27,7 +30,9 @@ module MetronomeSDK
|
|
|
27
30
|
)
|
|
28
31
|
end
|
|
29
32
|
|
|
30
|
-
#
|
|
33
|
+
# The ordering of products on a rate card determines the order in which the
|
|
34
|
+
# products will appear on customers' invoices. Use this endpoint to set the order
|
|
35
|
+
# of products on the rate card.
|
|
31
36
|
sig do
|
|
32
37
|
params(
|
|
33
38
|
product_order: T::Array[String],
|
|
@@ -6,7 +6,15 @@ module MetronomeSDK
|
|
|
6
6
|
class Contracts
|
|
7
7
|
class RateCards
|
|
8
8
|
class Rates
|
|
9
|
-
#
|
|
9
|
+
# Understand the rate schedule at a given timestamp, optionally filtering the list
|
|
10
|
+
# of rates returned based on properties such as `product_id` and
|
|
11
|
+
# `pricing_group_values`. For example, you may want to display the current price
|
|
12
|
+
# for a given product in your product experience - use this endpoint to fetch that
|
|
13
|
+
# information from its source of truth in Metronome.
|
|
14
|
+
#
|
|
15
|
+
# If you want to understand the rates for a specific customer's contract,
|
|
16
|
+
# inclusive of contract-level overrides, use the `getContractRateSchedule`
|
|
17
|
+
# endpoint.
|
|
10
18
|
sig do
|
|
11
19
|
params(
|
|
12
20
|
at: Time,
|
|
@@ -52,8 +60,7 @@ module MetronomeSDK
|
|
|
52
60
|
starting_at: Time,
|
|
53
61
|
billing_frequency:
|
|
54
62
|
MetronomeSDK::V1::Contracts::RateCards::RateAddParams::BillingFrequency::OrSymbol,
|
|
55
|
-
commit_rate:
|
|
56
|
-
MetronomeSDK::V1::Contracts::RateCards::RateAddParams::CommitRate::OrHash,
|
|
63
|
+
commit_rate: MetronomeSDK::CommitRate::OrHash,
|
|
57
64
|
credit_type_id: String,
|
|
58
65
|
custom_rate: T::Hash[Symbol, T.anything],
|
|
59
66
|
ending_before: Time,
|