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
|
@@ -4,8 +4,39 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Usage
|
|
7
|
-
#
|
|
8
|
-
#
|
|
7
|
+
# Retrieve aggregated usage data across multiple customers and billable metrics in
|
|
8
|
+
# a single query. This batch endpoint enables you to fetch usage patterns at
|
|
9
|
+
# scale, broken down by time windows, making it ideal for building analytics
|
|
10
|
+
# dashboards, generating reports, and monitoring platform-wide usage trends.
|
|
11
|
+
#
|
|
12
|
+
# ### Use this endpoint to:
|
|
13
|
+
#
|
|
14
|
+
# - Generate platform-wide usage reports for internal teams
|
|
15
|
+
# - Monitor aggregate usage trends across your entire customer base
|
|
16
|
+
# - Create comparative usage analyses between customers or time periods
|
|
17
|
+
# - Support capacity planning with historical usage patterns
|
|
18
|
+
#
|
|
19
|
+
# ### Key response fields:
|
|
20
|
+
#
|
|
21
|
+
# An array of `UsageBatchAggregate` objects containing:
|
|
22
|
+
#
|
|
23
|
+
# - `customer_id`: The customer this usage belongs to
|
|
24
|
+
# - `billable_metric_id` and `billable_metric_name`: What was measured
|
|
25
|
+
# - `start_timestamp` and `end_timestamp`: Time window for this data point
|
|
26
|
+
# - `value`: Aggregated usage amount for the period
|
|
27
|
+
# - `groups` (optional): Usage broken down by group keys with values
|
|
28
|
+
# - `next_page`: Pagination cursor for large result sets
|
|
29
|
+
#
|
|
30
|
+
# ### Usage guidelines:
|
|
31
|
+
#
|
|
32
|
+
# - Time windows: Set `window_size` to `hour`, `day`, or `none` (entire period)
|
|
33
|
+
# - Required parameters: Must specify `starting_on`, `ending_before`, and
|
|
34
|
+
# `window_size`
|
|
35
|
+
# - Filtering options:
|
|
36
|
+
# - `customer_ids`: Limit to specific customers (omit for all customers)
|
|
37
|
+
# - `billable_metrics`: Limit to specific metrics (omit for all metrics)
|
|
38
|
+
# - Pagination: Use `next_page` cursor to retrieve large datasets
|
|
39
|
+
# - Null values: Group values may be null when no usage matches that group
|
|
9
40
|
sig do
|
|
10
41
|
params(
|
|
11
42
|
ending_before: Time,
|
|
@@ -19,7 +50,11 @@ module MetronomeSDK
|
|
|
19
50
|
],
|
|
20
51
|
customer_ids: T::Array[String],
|
|
21
52
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
22
|
-
).returns(
|
|
53
|
+
).returns(
|
|
54
|
+
MetronomeSDK::Internal::CursorPageWithoutLimit[
|
|
55
|
+
MetronomeSDK::Models::V1::UsageListResponse
|
|
56
|
+
]
|
|
57
|
+
)
|
|
23
58
|
end
|
|
24
59
|
def list(
|
|
25
60
|
# Body param:
|
|
@@ -43,11 +78,92 @@ module MetronomeSDK
|
|
|
43
78
|
)
|
|
44
79
|
end
|
|
45
80
|
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
81
|
+
# The ingest endpoint is the primary method for sending usage events to Metronome,
|
|
82
|
+
# serving as the foundation for all billing calculations in your usage-based
|
|
83
|
+
# pricing model. This high-throughput endpoint is designed for real-time streaming
|
|
84
|
+
# ingestion, supports backdating 34 days, and is built to handle mission-critical
|
|
85
|
+
# usage data with enterprise-grade reliability. Metronome supports 100,000 events
|
|
86
|
+
# per second without requiring pre-aggregation or rollups and can scale up from
|
|
87
|
+
# there. See the [Send usage events](/guides/events/send-usage-events) guide to
|
|
50
88
|
# learn more about usage events.
|
|
89
|
+
#
|
|
90
|
+
# ### Use this endpoint to:
|
|
91
|
+
#
|
|
92
|
+
# Create a customer usage pipeline into Metronome that drives billable metrics,
|
|
93
|
+
# credit drawdown, and invoicing. Track customer behavior, resource consumption,
|
|
94
|
+
# and feature usage
|
|
95
|
+
#
|
|
96
|
+
# ### What happens when you send events:
|
|
97
|
+
#
|
|
98
|
+
# - Events are validated and processed in real-time
|
|
99
|
+
# - Events are matched to customers using customer IDs or customer ingest aliases
|
|
100
|
+
# - Events are matched to billable metrics and are immediately available for usage
|
|
101
|
+
# and spend calculations
|
|
102
|
+
#
|
|
103
|
+
# ### Usage guidelines:
|
|
104
|
+
#
|
|
105
|
+
# - Historical events can be backdated up to 34 days and will immediately impact
|
|
106
|
+
# live customer spend
|
|
107
|
+
# - Duplicate events are automatically detected and ignored (34-day deduplication
|
|
108
|
+
# window)
|
|
109
|
+
#
|
|
110
|
+
# #### Event structure:
|
|
111
|
+
#
|
|
112
|
+
# Usage events are simple JSON objects designed for flexibility and ease of
|
|
113
|
+
# integration:
|
|
114
|
+
#
|
|
115
|
+
# ```json
|
|
116
|
+
# {
|
|
117
|
+
# "transaction_id": "2021-01-01T00:00:00Z_cluster42",
|
|
118
|
+
# "customer_id": "team@example.com",
|
|
119
|
+
# "event_type": "api_request",
|
|
120
|
+
# "timestamp": "2021-01-01T00:00:00Z",
|
|
121
|
+
# "properties": {
|
|
122
|
+
# "endpoint": "/v1/users",
|
|
123
|
+
# "method": "POST",
|
|
124
|
+
# "response_time_ms": 45,
|
|
125
|
+
# "region": "us-west-2"
|
|
126
|
+
# }
|
|
127
|
+
# }
|
|
128
|
+
# ```
|
|
129
|
+
#
|
|
130
|
+
# Learn more about
|
|
131
|
+
# [usage event structure definitions](/guides/events/design-usage-events).
|
|
132
|
+
#
|
|
133
|
+
# #### Transaction ID
|
|
134
|
+
#
|
|
135
|
+
# The transaction_id serves as your idempotency key, ensuring events are processed
|
|
136
|
+
# exactly once. Metronome maintains a 34-day deduplication window - significantly
|
|
137
|
+
# longer than typical 12-hour windows - enabling robust backfill scenarios without
|
|
138
|
+
# duplicate billing.
|
|
139
|
+
#
|
|
140
|
+
# - Best Practices:
|
|
141
|
+
# - Use UUIDs for one-time events: uuid4()
|
|
142
|
+
# - For heartbeat events, use deterministic IDs
|
|
143
|
+
# - Include enough context to avoid collisions across different event sources
|
|
144
|
+
#
|
|
145
|
+
# #### Customer ID
|
|
146
|
+
#
|
|
147
|
+
# Identifies which customer should be billed for this usage. Supports two
|
|
148
|
+
# identification methods:
|
|
149
|
+
#
|
|
150
|
+
# - Metronome Customer ID: The UUID returned when creating a customer
|
|
151
|
+
# - Ingest Alias: Your system's identifier (email, account number, etc.)
|
|
152
|
+
#
|
|
153
|
+
# Ingest aliases enable seamless integration without requiring ID mapping, and
|
|
154
|
+
# customers can have multiple aliases for flexibility.
|
|
155
|
+
#
|
|
156
|
+
# #### Event Type:
|
|
157
|
+
#
|
|
158
|
+
# Categorizes the event type for billable metric matching. Choose descriptive
|
|
159
|
+
# names that aligns with the product surface area.
|
|
160
|
+
#
|
|
161
|
+
# #### Properties:
|
|
162
|
+
#
|
|
163
|
+
# Flexible metadata also used to match billable metrics or to be used to serve as
|
|
164
|
+
# group keys to create multiple pricing dimensions or breakdown costs by novel
|
|
165
|
+
# properties for end customers or internal finance teams measuring underlying
|
|
166
|
+
# COGs.
|
|
51
167
|
sig do
|
|
52
168
|
params(
|
|
53
169
|
usage: T::Array[MetronomeSDK::V1::UsageIngestParams::Usage::OrHash],
|
|
@@ -57,8 +173,40 @@ module MetronomeSDK
|
|
|
57
173
|
def ingest(usage: nil, request_options: {})
|
|
58
174
|
end
|
|
59
175
|
|
|
60
|
-
#
|
|
61
|
-
#
|
|
176
|
+
# Retrieve granular usage data for a specific customer and billable metric, with
|
|
177
|
+
# the ability to break down usage by custom grouping dimensions. This endpoint
|
|
178
|
+
# enables deep usage analytics by segmenting data across attributes like region,
|
|
179
|
+
# user, model type, or any custom dimension defined in your billable metrics.
|
|
180
|
+
#
|
|
181
|
+
# ### Use this endpoint to:
|
|
182
|
+
#
|
|
183
|
+
# - Analyze usage patterns broken down by specific attributes (region, user,
|
|
184
|
+
# department, etc.)
|
|
185
|
+
# - Build detailed usage dashboards with dimensional filtering
|
|
186
|
+
# - Identify high-usage segments for optimization opportunities
|
|
187
|
+
#
|
|
188
|
+
# ### Key response fields:
|
|
189
|
+
#
|
|
190
|
+
# An array of `PagedUsageAggregate` objects containing:
|
|
191
|
+
#
|
|
192
|
+
# - `starting_on` and `ending_before`: Time window boundaries
|
|
193
|
+
# - `group_key`: The dimension being grouped by (e.g., "region")
|
|
194
|
+
# - `group_value`: The specific value for this group (e.g., "US-East")
|
|
195
|
+
# - `value`: Aggregated usage for this group and time window
|
|
196
|
+
# - `next_page`: Pagination cursor for large datasets
|
|
197
|
+
#
|
|
198
|
+
# ### Usage guidelines:
|
|
199
|
+
#
|
|
200
|
+
# - Required parameters: Must specify `customer_id`, `billable_metric_id`, and
|
|
201
|
+
# `window_size`
|
|
202
|
+
# - Time windows: Set `window_size` to hour, day, or none for different
|
|
203
|
+
# granularities
|
|
204
|
+
# - Group filtering: Use `group_by` to specify:
|
|
205
|
+
# - key: The dimension to group by (must be set on the billable metric as a
|
|
206
|
+
# group key)
|
|
207
|
+
# - values: Optional array to filter to specific values only
|
|
208
|
+
# - Pagination: Use limit and `next_page` for large result sets
|
|
209
|
+
# - Null handling: `group_value` may be null for unmatched data
|
|
62
210
|
sig do
|
|
63
211
|
params(
|
|
64
212
|
billable_metric_id: String,
|
|
@@ -107,10 +255,40 @@ module MetronomeSDK
|
|
|
107
255
|
)
|
|
108
256
|
end
|
|
109
257
|
|
|
110
|
-
#
|
|
111
|
-
#
|
|
112
|
-
#
|
|
113
|
-
#
|
|
258
|
+
# This endpoint retrieves events by transaction ID for events that occurred within
|
|
259
|
+
# the last 34 days. It is specifically designed for sampling-based testing
|
|
260
|
+
# workflows to detect revenue leakage. The Event Search API provides a critical
|
|
261
|
+
# observability tool that validates the integrity of your usage pipeline by
|
|
262
|
+
# allowing you to sample raw events and verify their matching against active
|
|
263
|
+
# billable metrics.
|
|
264
|
+
#
|
|
265
|
+
# Why event observability matters for revenue leakage: Silent revenue loss occurs
|
|
266
|
+
# when events are dropped, delayed, or fail to match billable metrics due to:
|
|
267
|
+
#
|
|
268
|
+
# - Upstream system failures
|
|
269
|
+
# - Event format changes
|
|
270
|
+
# - Misconfigured billable metrics
|
|
271
|
+
#
|
|
272
|
+
# ### Use this endpoint to:
|
|
273
|
+
#
|
|
274
|
+
# - Sample raw events and validate they match the expected billable metrics
|
|
275
|
+
# - Build custom leakage detection alerts to prevent silent revenue loss
|
|
276
|
+
# - Verify event processing accuracy during system changes or metric updates
|
|
277
|
+
# - Debug event matching issues in real-time
|
|
278
|
+
#
|
|
279
|
+
# ### Key response fields:
|
|
280
|
+
#
|
|
281
|
+
# - Complete event details including transaction ID, customer ID, and properties
|
|
282
|
+
# - Matched Metronome customer (if any)
|
|
283
|
+
# - Matched billable metric information (if any)
|
|
284
|
+
# - Processing status and duplicate detection flags
|
|
285
|
+
#
|
|
286
|
+
# ### Usage guidelines:
|
|
287
|
+
#
|
|
288
|
+
# ⚠️ Important: This endpoint is heavily rate limited and designed for sampling
|
|
289
|
+
# workflows only. Do not use this endpoint to check every event in your system.
|
|
290
|
+
# Instead, implement a sampling strategy to randomly validate a subset of events
|
|
291
|
+
# for observability purposes.
|
|
114
292
|
sig do
|
|
115
293
|
params(
|
|
116
294
|
transaction_ids: T::Array[String],
|
|
@@ -42,6 +42,9 @@ module MetronomeSDK
|
|
|
42
42
|
sig { returns(MetronomeSDK::Resources::V1::Contracts) }
|
|
43
43
|
attr_reader :contracts
|
|
44
44
|
|
|
45
|
+
sig { returns(MetronomeSDK::Resources::V1::Payments) }
|
|
46
|
+
attr_reader :payments
|
|
47
|
+
|
|
45
48
|
# @api private
|
|
46
49
|
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
47
50
|
def self.new(client:)
|
|
@@ -4,8 +4,23 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V2
|
|
6
6
|
class Contracts
|
|
7
|
-
#
|
|
8
|
-
#
|
|
7
|
+
# Gets the details for a specific contract, including contract term, rate card
|
|
8
|
+
# information, credits and commits, and more.
|
|
9
|
+
#
|
|
10
|
+
# ### Use this endpoint to:
|
|
11
|
+
#
|
|
12
|
+
# - Check the duration of a customer's current contract
|
|
13
|
+
# - Get details on contract terms, including access schedule amounts for
|
|
14
|
+
# commitments and credits
|
|
15
|
+
# - Understand the state of a contract at a past time. As you can evolve the terms
|
|
16
|
+
# of a contract over time through editing, use the `as_of_date` parameter to
|
|
17
|
+
# view the full contract configuration as of that point in time.
|
|
18
|
+
#
|
|
19
|
+
# ### Usage guidelines:
|
|
20
|
+
#
|
|
21
|
+
# - Optionally, use the `include_balance` and `include_ledger` fields to include
|
|
22
|
+
# balances and ledgers in the credit and commit responses. Using these fields
|
|
23
|
+
# will cause the query to be slower.
|
|
9
24
|
sig do
|
|
10
25
|
params(
|
|
11
26
|
contract_id: String,
|
|
@@ -32,8 +47,21 @@ module MetronomeSDK
|
|
|
32
47
|
)
|
|
33
48
|
end
|
|
34
49
|
|
|
35
|
-
#
|
|
36
|
-
#
|
|
50
|
+
# For a given customer, lists all of their contracts in chronological order.
|
|
51
|
+
#
|
|
52
|
+
# ### Use this endpoint to:
|
|
53
|
+
#
|
|
54
|
+
# - Check if a customer is provisioned with any contract, and at which tier
|
|
55
|
+
# - Check the duration and terms of a customer's current contract
|
|
56
|
+
# - Power a page in your end customer experience that shows the customer's history
|
|
57
|
+
# of tiers (e.g. this customer started out on the Pro Plan, then downgraded to
|
|
58
|
+
# the Starter plan).
|
|
59
|
+
#
|
|
60
|
+
# ### Usage guidelines:
|
|
61
|
+
#
|
|
62
|
+
# Use the `starting_at`, `covering_date`, and `include_archived` parameters to
|
|
63
|
+
# filter the list of returned contracts. For example, to list only currently
|
|
64
|
+
# active contracts, pass `covering_date` equal to the current time.
|
|
37
65
|
sig do
|
|
38
66
|
params(
|
|
39
67
|
customer_id: String,
|
|
@@ -65,11 +93,34 @@ module MetronomeSDK
|
|
|
65
93
|
)
|
|
66
94
|
end
|
|
67
95
|
|
|
68
|
-
#
|
|
96
|
+
# The ability to edit a contract helps you react quickly to the needs of your
|
|
97
|
+
# customers and your business.
|
|
98
|
+
#
|
|
99
|
+
# ### Use this endpoint to:
|
|
100
|
+
#
|
|
101
|
+
# - Encode mid-term commitment and discount changes
|
|
102
|
+
# - Fix configuration mistakes and easily roll back packaging changes
|
|
103
|
+
#
|
|
104
|
+
# ### Key response fields:
|
|
105
|
+
#
|
|
106
|
+
# - The `id` of the edit
|
|
107
|
+
# - Complete edit details. For example, if you edited the contract to add new
|
|
108
|
+
# overrides and credits, you will receive the IDs of those overrides and credits
|
|
109
|
+
# in the response.
|
|
110
|
+
#
|
|
111
|
+
# ### Usage guidelines:
|
|
112
|
+
#
|
|
113
|
+
# - When you edit a contract, any draft invoices update immediately to reflect
|
|
114
|
+
# that edit. Finalized invoices remain unchanged - you must void and regenerate
|
|
115
|
+
# them in the UI or API to reflect the edit.
|
|
116
|
+
# - Contract editing must be enabled to use this endpoint. Reach out to your
|
|
117
|
+
# Metronome representative to learn more.
|
|
69
118
|
sig do
|
|
70
119
|
params(
|
|
71
120
|
contract_id: String,
|
|
72
121
|
customer_id: String,
|
|
122
|
+
add_billing_provider_configuration_update:
|
|
123
|
+
MetronomeSDK::V2::ContractEditParams::AddBillingProviderConfigurationUpdate::OrHash,
|
|
73
124
|
add_commits:
|
|
74
125
|
T::Array[MetronomeSDK::V2::ContractEditParams::AddCommit::OrHash],
|
|
75
126
|
add_credits:
|
|
@@ -83,7 +134,7 @@ module MetronomeSDK
|
|
|
83
134
|
MetronomeSDK::V2::ContractEditParams::AddOverride::OrHash
|
|
84
135
|
],
|
|
85
136
|
add_prepaid_balance_threshold_configuration:
|
|
86
|
-
MetronomeSDK::
|
|
137
|
+
MetronomeSDK::PrepaidBalanceThresholdConfigurationV2::OrHash,
|
|
87
138
|
add_professional_services:
|
|
88
139
|
T::Array[
|
|
89
140
|
MetronomeSDK::V2::ContractEditParams::AddProfessionalService::OrHash
|
|
@@ -105,7 +156,7 @@ module MetronomeSDK
|
|
|
105
156
|
MetronomeSDK::V2::ContractEditParams::AddScheduledCharge::OrHash
|
|
106
157
|
],
|
|
107
158
|
add_spend_threshold_configuration:
|
|
108
|
-
MetronomeSDK::
|
|
159
|
+
MetronomeSDK::SpendThresholdConfigurationV2::OrHash,
|
|
109
160
|
add_subscriptions:
|
|
110
161
|
T::Array[
|
|
111
162
|
MetronomeSDK::V2::ContractEditParams::AddSubscription::OrHash
|
|
@@ -127,6 +178,7 @@ module MetronomeSDK
|
|
|
127
178
|
T::Array[
|
|
128
179
|
MetronomeSDK::V2::ContractEditParams::RemoveOverride::OrHash
|
|
129
180
|
],
|
|
181
|
+
uniqueness_key: String,
|
|
130
182
|
update_commits:
|
|
131
183
|
T::Array[
|
|
132
184
|
MetronomeSDK::V2::ContractEditParams::UpdateCommit::OrHash
|
|
@@ -165,6 +217,10 @@ module MetronomeSDK
|
|
|
165
217
|
contract_id:,
|
|
166
218
|
# ID of the customer whose contract is being edited
|
|
167
219
|
customer_id:,
|
|
220
|
+
# Update the billing provider configuration on the contract. Currently only
|
|
221
|
+
# supports adding a billing provider configuration to a contract that does not
|
|
222
|
+
# already have one.
|
|
223
|
+
add_billing_provider_configuration_update: nil,
|
|
168
224
|
add_commits: nil,
|
|
169
225
|
add_credits: nil,
|
|
170
226
|
add_discounts: nil,
|
|
@@ -194,6 +250,8 @@ module MetronomeSDK
|
|
|
194
250
|
archive_scheduled_charges: nil,
|
|
195
251
|
# IDs of overrides to remove
|
|
196
252
|
remove_overrides: nil,
|
|
253
|
+
# Optional uniqueness key to prevent duplicate contract edits.
|
|
254
|
+
uniqueness_key: nil,
|
|
197
255
|
update_commits: nil,
|
|
198
256
|
# RFC 3339 timestamp indicating when the contract will end (exclusive).
|
|
199
257
|
update_contract_end_date: nil,
|
|
@@ -218,8 +276,22 @@ module MetronomeSDK
|
|
|
218
276
|
)
|
|
219
277
|
end
|
|
220
278
|
|
|
221
|
-
# Edit a
|
|
222
|
-
#
|
|
279
|
+
# Edit specific details for a contract-level or customer-level commit. Use this
|
|
280
|
+
# endpoint to modify individual commit access schedules, invoice schedules,
|
|
281
|
+
# applicable products, invoicing contracts, or other fields.
|
|
282
|
+
#
|
|
283
|
+
# ### Usage guidelines:
|
|
284
|
+
#
|
|
285
|
+
# - As with all edits in Metronome, draft invoices will reflect the edit
|
|
286
|
+
# immediately, while finalized invoices are untouched unless voided and
|
|
287
|
+
# regenerated.
|
|
288
|
+
# - If a commit's invoice schedule item is associated with a finalized invoice,
|
|
289
|
+
# you cannot remove or update the invoice schedule item.
|
|
290
|
+
# - If a commit's invoice schedule item is associated with a voided invoice, you
|
|
291
|
+
# cannot remove the invoice schedule item.
|
|
292
|
+
# - You cannot remove an commit access schedule segment that was applied to a
|
|
293
|
+
# finalized invoice. You can void the invoice beforehand and then remove the
|
|
294
|
+
# access schedule segment.
|
|
223
295
|
sig do
|
|
224
296
|
params(
|
|
225
297
|
commit_id: String,
|
|
@@ -228,17 +300,17 @@ module MetronomeSDK
|
|
|
228
300
|
MetronomeSDK::V2::ContractEditCommitParams::AccessSchedule::OrHash,
|
|
229
301
|
applicable_product_ids: T.nilable(T::Array[String]),
|
|
230
302
|
applicable_product_tags: T.nilable(T::Array[String]),
|
|
303
|
+
hierarchy_configuration:
|
|
304
|
+
MetronomeSDK::CommitHierarchyConfiguration::OrHash,
|
|
231
305
|
invoice_contract_id: String,
|
|
232
306
|
invoice_schedule:
|
|
233
307
|
MetronomeSDK::V2::ContractEditCommitParams::InvoiceSchedule::OrHash,
|
|
234
308
|
priority: T.nilable(Float),
|
|
235
309
|
product_id: String,
|
|
310
|
+
rate_type:
|
|
311
|
+
MetronomeSDK::V2::ContractEditCommitParams::RateType::OrSymbol,
|
|
236
312
|
specifiers:
|
|
237
|
-
T.nilable(
|
|
238
|
-
T::Array[
|
|
239
|
-
MetronomeSDK::V2::ContractEditCommitParams::Specifier::OrHash
|
|
240
|
-
]
|
|
241
|
-
),
|
|
313
|
+
T.nilable(T::Array[MetronomeSDK::CommitSpecifierInput::OrHash]),
|
|
242
314
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
243
315
|
).returns(MetronomeSDK::Models::V2::ContractEditCommitResponse)
|
|
244
316
|
end
|
|
@@ -256,6 +328,8 @@ module MetronomeSDK
|
|
|
256
328
|
# applicable_product_tags or specifiers are not provided, the commit applies to
|
|
257
329
|
# all products.
|
|
258
330
|
applicable_product_tags: nil,
|
|
331
|
+
# Optional configuration for commit hierarchy access control
|
|
332
|
+
hierarchy_configuration: nil,
|
|
259
333
|
# ID of contract to use for invoicing
|
|
260
334
|
invoice_contract_id: nil,
|
|
261
335
|
invoice_schedule: nil,
|
|
@@ -263,6 +337,10 @@ module MetronomeSDK
|
|
|
263
337
|
# first.
|
|
264
338
|
priority: nil,
|
|
265
339
|
product_id: nil,
|
|
340
|
+
# If provided, updates the commit to use the specified rate type for current and
|
|
341
|
+
# future invoices. Previously finalized invoices will need to be voided and
|
|
342
|
+
# regenerated to reflect the rate type change.
|
|
343
|
+
rate_type: nil,
|
|
266
344
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
267
345
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
268
346
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
@@ -274,8 +352,22 @@ module MetronomeSDK
|
|
|
274
352
|
)
|
|
275
353
|
end
|
|
276
354
|
|
|
277
|
-
# Edit a
|
|
278
|
-
#
|
|
355
|
+
# Edit details for a contract-level or customer-level credit.
|
|
356
|
+
#
|
|
357
|
+
# ### Use this endpoint to:
|
|
358
|
+
#
|
|
359
|
+
# - Extend the duration or the amount of an existing free credit like a trial
|
|
360
|
+
# - Modify individual credit access schedules, applicable products, priority, or
|
|
361
|
+
# other fields.
|
|
362
|
+
#
|
|
363
|
+
# ### Usage guidelines:
|
|
364
|
+
#
|
|
365
|
+
# - As with all edits in Metronome, draft invoices will reflect the edit
|
|
366
|
+
# immediately, while finalized invoices are untouched unless voided and
|
|
367
|
+
# regenerated.
|
|
368
|
+
# - You cannot remove an access schedule segment that was applied to a finalized
|
|
369
|
+
# invoice. You can void the invoice beforehand and then remove the access
|
|
370
|
+
# schedule segment.
|
|
279
371
|
sig do
|
|
280
372
|
params(
|
|
281
373
|
credit_id: String,
|
|
@@ -284,14 +376,14 @@ module MetronomeSDK
|
|
|
284
376
|
MetronomeSDK::V2::ContractEditCreditParams::AccessSchedule::OrHash,
|
|
285
377
|
applicable_product_ids: T.nilable(T::Array[String]),
|
|
286
378
|
applicable_product_tags: T.nilable(T::Array[String]),
|
|
379
|
+
hierarchy_configuration:
|
|
380
|
+
MetronomeSDK::CommitHierarchyConfiguration::OrHash,
|
|
287
381
|
priority: T.nilable(Float),
|
|
288
382
|
product_id: String,
|
|
383
|
+
rate_type:
|
|
384
|
+
MetronomeSDK::V2::ContractEditCreditParams::RateType::OrSymbol,
|
|
289
385
|
specifiers:
|
|
290
|
-
T.nilable(
|
|
291
|
-
T::Array[
|
|
292
|
-
MetronomeSDK::V2::ContractEditCreditParams::Specifier::OrHash
|
|
293
|
-
]
|
|
294
|
-
),
|
|
386
|
+
T.nilable(T::Array[MetronomeSDK::CommitSpecifierInput::OrHash]),
|
|
295
387
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
296
388
|
).returns(MetronomeSDK::Models::V2::ContractEditCreditResponse)
|
|
297
389
|
end
|
|
@@ -307,10 +399,16 @@ module MetronomeSDK
|
|
|
307
399
|
# Which tags the credit applies to. If both applicable_product_ids and
|
|
308
400
|
# applicable_product_tags are not provided, the credit applies to all products.
|
|
309
401
|
applicable_product_tags: nil,
|
|
402
|
+
# Optional configuration for credit hierarchy access control
|
|
403
|
+
hierarchy_configuration: nil,
|
|
310
404
|
# If multiple commits are applicable, the one with the lower priority will apply
|
|
311
405
|
# first.
|
|
312
406
|
priority: nil,
|
|
313
407
|
product_id: nil,
|
|
408
|
+
# If provided, updates the credit to use the specified rate type for current and
|
|
409
|
+
# future invoices. Previously finalized invoices will need to be voided and
|
|
410
|
+
# regenerated to reflect the rate type change.
|
|
411
|
+
rate_type: nil,
|
|
314
412
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
315
413
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
316
414
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
@@ -322,8 +420,21 @@ module MetronomeSDK
|
|
|
322
420
|
)
|
|
323
421
|
end
|
|
324
422
|
|
|
325
|
-
#
|
|
326
|
-
#
|
|
423
|
+
# List all the edits made to a contract over time. In Metronome, you can edit a
|
|
424
|
+
# contract at any point after it's created to fix mistakes or reflect changes in
|
|
425
|
+
# terms. Metronome stores a full history of all edits that were ever made to a
|
|
426
|
+
# contract, whether through the UI, `editContract` endpoint, or other endpoints
|
|
427
|
+
# like `updateContractEndDate`.
|
|
428
|
+
#
|
|
429
|
+
# ### Use this endpoint to:
|
|
430
|
+
#
|
|
431
|
+
# - Understand what changes were made to a contract, when, and by who
|
|
432
|
+
#
|
|
433
|
+
# ### Key response fields:
|
|
434
|
+
#
|
|
435
|
+
# - An array of every edit ever made to the contract
|
|
436
|
+
# - Details on each individual edit - for example showing that in one edit, a user
|
|
437
|
+
# added two discounts and incremented a subscription quantity.
|
|
327
438
|
sig do
|
|
328
439
|
params(
|
|
329
440
|
contract_id: String,
|
|
@@ -21,11 +21,14 @@ module MetronomeSDK
|
|
|
21
21
|
|
|
22
22
|
attr_accessor status: Integer?
|
|
23
23
|
|
|
24
|
+
attr_accessor headers: ::Hash[String, String]?
|
|
25
|
+
|
|
24
26
|
attr_accessor body: top?
|
|
25
27
|
|
|
26
28
|
def initialize: (
|
|
27
29
|
url: URI::Generic,
|
|
28
30
|
?status: Integer?,
|
|
31
|
+
?headers: ::Hash[String, String]?,
|
|
29
32
|
?body: Object?,
|
|
30
33
|
?request: nil,
|
|
31
34
|
?response: nil,
|
|
@@ -37,6 +40,7 @@ module MetronomeSDK
|
|
|
37
40
|
def initialize: (
|
|
38
41
|
url: URI::Generic,
|
|
39
42
|
?status: nil,
|
|
43
|
+
?headers: ::Hash[String, String]?,
|
|
40
44
|
?body: nil,
|
|
41
45
|
?request: nil,
|
|
42
46
|
?response: nil,
|
|
@@ -48,6 +52,7 @@ module MetronomeSDK
|
|
|
48
52
|
def initialize: (
|
|
49
53
|
url: URI::Generic,
|
|
50
54
|
?status: nil,
|
|
55
|
+
?headers: ::Hash[String, String]?,
|
|
51
56
|
?body: nil,
|
|
52
57
|
?request: nil,
|
|
53
58
|
?response: nil,
|
|
@@ -59,6 +64,7 @@ module MetronomeSDK
|
|
|
59
64
|
def self.for: (
|
|
60
65
|
url: URI::Generic,
|
|
61
66
|
status: Integer,
|
|
67
|
+
headers: ::Hash[String, String]?,
|
|
62
68
|
body: Object?,
|
|
63
69
|
request: nil,
|
|
64
70
|
response: nil,
|
|
@@ -68,6 +74,7 @@ module MetronomeSDK
|
|
|
68
74
|
def initialize: (
|
|
69
75
|
url: URI::Generic,
|
|
70
76
|
status: Integer,
|
|
77
|
+
headers: ::Hash[String, String]?,
|
|
71
78
|
body: Object?,
|
|
72
79
|
request: nil,
|
|
73
80
|
response: nil,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module MetronomeSDK
|
|
2
|
+
module Models
|
|
3
|
+
type base_threshold_commit =
|
|
4
|
+
{ product_id: String, description: String, name: String }
|
|
5
|
+
|
|
6
|
+
class BaseThresholdCommit < MetronomeSDK::Internal::Type::BaseModel
|
|
7
|
+
attr_accessor product_id: String
|
|
8
|
+
|
|
9
|
+
attr_reader description: String?
|
|
10
|
+
|
|
11
|
+
def description=: (String) -> String
|
|
12
|
+
|
|
13
|
+
attr_reader name: String?
|
|
14
|
+
|
|
15
|
+
def name=: (String) -> String
|
|
16
|
+
|
|
17
|
+
def initialize: (
|
|
18
|
+
product_id: String,
|
|
19
|
+
?description: String,
|
|
20
|
+
?name: String
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def to_hash: -> { product_id: String, description: String, name: String }
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|