metronome-sdk 1.0.0 → 2.1.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 +1 -1
- 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 +1 -1
- data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
- data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +1 -1
- data/lib/metronome_sdk/internal/transport/base_client.rb +11 -7
- data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +34 -31
- 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/util.rb +8 -7
- data/lib/metronome_sdk/models/contract.rb +1 -0
- data/lib/metronome_sdk/models/contract_v2.rb +275 -6
- data/lib/metronome_sdk/models/contract_without_amendments.rb +2 -2
- data/lib/metronome_sdk/models/hierarchy_configuration.rb +123 -2
- data/lib/metronome_sdk/models/payment_gate_config.rb +1 -0
- data/lib/metronome_sdk/models/payment_gate_config_v2.rb +1 -0
- data/lib/metronome_sdk/models/subscription.rb +95 -1
- data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +38 -36
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +157 -9
- data/lib/metronome_sdk/models/v1/contract_list_balances_params.rb +9 -1
- data/lib/metronome_sdk/models/v1/customer_create_params.rb +11 -1
- data/lib/metronome_sdk/models/v1/customer_detail.rb +9 -1
- data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +19 -25
- data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
- data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +1 -0
- data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +3 -3
- data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +12 -12
- data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +6 -1
- data/lib/metronome_sdk/models/v1/customers/billing_config_delete_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +6 -1
- data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +1 -1
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +41 -38
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +256 -16
- data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
- data/lib/metronome_sdk/models/v1/payment.rb +157 -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/setting_upsert_avalara_credentials_params.rb +65 -0
- data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rb +12 -0
- data/lib/metronome_sdk/models/v1/settings/billing_provider_create_params.rb +73 -0
- data/lib/metronome_sdk/models/v1/settings/billing_provider_create_response.rb +31 -0
- data/lib/metronome_sdk/models/v1/settings/billing_provider_list_params.rb +26 -0
- data/lib/metronome_sdk/models/v1/settings/billing_provider_list_response.rb +105 -0
- data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +9 -1
- data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +9 -1
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +219 -9
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +195 -8
- data/lib/metronome_sdk/resources/v1/alerts.rb +57 -53
- data/lib/metronome_sdk/resources/v1/contracts.rb +8 -5
- data/lib/metronome_sdk/resources/v1/credit_grants.rb +10 -5
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +70 -51
- data/lib/metronome_sdk/resources/v1/customers/billing_config.rb +7 -4
- data/lib/metronome_sdk/resources/v1/customers/commits.rb +2 -1
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +57 -1
- data/lib/metronome_sdk/resources/v1/customers/plans.rb +8 -4
- data/lib/metronome_sdk/resources/v1/customers.rb +13 -8
- data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
- data/lib/metronome_sdk/resources/v1/plans.rb +8 -4
- data/lib/metronome_sdk/resources/v1/settings/billing_providers.rb +75 -0
- data/lib/metronome_sdk/resources/v1/settings.rb +55 -0
- data/lib/metronome_sdk/resources/v1/usage.rb +4 -2
- data/lib/metronome_sdk/resources/v1.rb +8 -0
- data/lib/metronome_sdk/resources/v2/contracts.rb +9 -3
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +17 -0
- data/rbi/metronome_sdk/errors.rbi +29 -2
- data/rbi/metronome_sdk/file_part.rbi +1 -1
- 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/contract.rbi +5 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +635 -10
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +2 -2
- data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +286 -6
- data/rbi/metronome_sdk/models/payment_gate_config.rbi +5 -0
- data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +5 -0
- data/rbi/metronome_sdk/models/subscription.rbi +190 -0
- data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +51 -47
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +326 -10
- data/rbi/metronome_sdk/models/v1/contract_list_balances_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/customer_detail.rbi +8 -0
- data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +24 -32
- data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
- data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +5 -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 +14 -14
- data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_delete_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +6 -0
- data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +2 -2
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +53 -44
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +462 -38
- data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
- data/rbi/metronome_sdk/models/v1/payment.rbi +324 -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/setting_upsert_avalara_credentials_params.rbi +115 -0
- data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rbi +25 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_params.rbi +157 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_response.rbi +75 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_list_params.rbi +50 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_list_response.rbi +245 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +18 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +18 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +536 -12
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +462 -14
- data/rbi/metronome_sdk/resources/v1/alerts.rbi +68 -64
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +10 -5
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +73 -54
- data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +3 -2
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +38 -1
- data/rbi/metronome_sdk/resources/v1/customers/plans.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/customers.rbi +17 -11
- data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
- data/rbi/metronome_sdk/resources/v1/plans.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/settings/billing_providers.rbi +63 -0
- data/rbi/metronome_sdk/resources/v1/settings.rbi +47 -0
- data/rbi/metronome_sdk/resources/v1/usage.rbi +4 -2
- data/rbi/metronome_sdk/resources/v1.rbi +6 -0
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +14 -0
- data/sig/metronome_sdk/errors.rbs +7 -0
- data/sig/metronome_sdk/file_part.rbs +1 -1
- data/sig/metronome_sdk/models/contract.rbs +2 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +241 -12
- data/sig/metronome_sdk/models/hierarchy_configuration.rbs +87 -6
- data/sig/metronome_sdk/models/payment_gate_config.rbs +2 -1
- data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +2 -1
- data/sig/metronome_sdk/models/subscription.rbs +80 -0
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +2 -1
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +91 -5
- data/sig/metronome_sdk/models/v1/contract_list_balances_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/customer_create_params.rbs +2 -0
- 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_response.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/billing_config_delete_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +244 -19
- data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
- data/sig/metronome_sdk/models/v1/payment.rbs +198 -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/setting_upsert_avalara_credentials_params.rbs +54 -0
- data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rbs +13 -0
- data/sig/metronome_sdk/models/v1/settings/billing_provider_create_params.rbs +64 -0
- data/sig/metronome_sdk/models/v1/settings/billing_provider_create_response.rbs +34 -0
- data/sig/metronome_sdk/models/v1/settings/billing_provider_list_params.rbs +28 -0
- data/sig/metronome_sdk/models/v1/settings/billing_provider_list_response.rbs +102 -0
- data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +9 -0
- data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +9 -0
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +184 -7
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +221 -18
- data/sig/metronome_sdk/resources/v1/contracts.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
- data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
- data/sig/metronome_sdk/resources/v1/settings/billing_providers.rbs +23 -0
- data/sig/metronome_sdk/resources/v1/settings.rbs +19 -0
- data/sig/metronome_sdk/resources/v1.rbs +4 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +3 -0
- metadata +53 -2
|
@@ -7,16 +7,15 @@ module MetronomeSDK
|
|
|
7
7
|
# Some parameter documentations has been truncated, see
|
|
8
8
|
# {MetronomeSDK::Models::V1::AlertCreateParams} for more details.
|
|
9
9
|
#
|
|
10
|
-
# Create a new
|
|
11
|
-
# in real-time. Metronome's
|
|
12
|
-
# immediate evaluation capabilities, enabling you to
|
|
13
|
-
# accounts and prevent revenue leakage.
|
|
10
|
+
# Create a new threshold notification to monitor customer spending, balances, and
|
|
11
|
+
# billing metrics in real-time. Metronome's notification system provides
|
|
12
|
+
# industry-leading speed with immediate evaluation capabilities, enabling you to
|
|
13
|
+
# proactively manage customer accounts and prevent revenue leakage.
|
|
14
14
|
#
|
|
15
|
-
# This endpoint creates configurable
|
|
16
|
-
# billing thresholds including spend limits, credit balances,
|
|
17
|
-
# utilization, and invoice totals.
|
|
18
|
-
# customers or targeted to specific customer accounts.
|
|
19
|
-
# on certain alert types to further target alerts to groups of customers.
|
|
15
|
+
# This endpoint creates configurable threshold notifications that continuously
|
|
16
|
+
# monitor various billing thresholds including spend limits, credit balances,
|
|
17
|
+
# commitment utilization, and invoice totals. Threshold notifications can be
|
|
18
|
+
# configured globally for all customers or targeted to specific customer accounts.
|
|
20
19
|
#
|
|
21
20
|
# ### Use this endpoint to:
|
|
22
21
|
#
|
|
@@ -32,52 +31,53 @@ module MetronomeSDK
|
|
|
32
31
|
#
|
|
33
32
|
# A successful response returns a CustomerAlert object containing:
|
|
34
33
|
#
|
|
35
|
-
# - The
|
|
34
|
+
# - The threshold notification configuration with its unique ID and current status
|
|
36
35
|
# - The customer's evaluation status (ok, in_alarm, or evaluating)
|
|
37
|
-
# -
|
|
36
|
+
# - Threshold notification metadata including type, threshold values, and update
|
|
37
|
+
# timestamps
|
|
38
38
|
#
|
|
39
39
|
# ### Usage guidelines:
|
|
40
40
|
#
|
|
41
41
|
# - Immediate evaluation: Set `evaluate_on_create` : `true` (default) for instant
|
|
42
42
|
# evaluation against existing customers
|
|
43
|
-
# - Uniqueness constraints: Each
|
|
44
|
-
# your organization. Use `release_uniqueness_key` :
|
|
45
|
-
# reuse keys
|
|
46
|
-
# -
|
|
47
|
-
# `billable_metric_id` for usage
|
|
48
|
-
#
|
|
49
|
-
# - Webhook delivery:
|
|
50
|
-
# integration with your systems. Configure webhook endpoints before
|
|
51
|
-
#
|
|
52
|
-
# - Performance at scale: Metronome's event-driven architecture processes
|
|
53
|
-
# evaluations in real-time as usage events stream in,
|
|
54
|
-
# rely on periodic polling or batch evaluation cycles
|
|
43
|
+
# - Uniqueness constraints: Each threshold notification must have a unique
|
|
44
|
+
# `uniqueness_key` within your organization. Use `release_uniqueness_key` :
|
|
45
|
+
# `true` when archiving to reuse keys
|
|
46
|
+
# - Notification type requirements: Different threshold notification types require
|
|
47
|
+
# specific fields (e.g., `billable_metric_id` for usage notifications,
|
|
48
|
+
# `credit_type_id` for credit-based threshold notifications)
|
|
49
|
+
# - Webhook delivery: Threshold notifications trigger webhook notifications for
|
|
50
|
+
# real-time integration with your systems. Configure webhook endpoints before
|
|
51
|
+
# creating threshold notifications
|
|
52
|
+
# - Performance at scale: Metronome's event-driven architecture processes
|
|
53
|
+
# threshold notification evaluations in real-time as usage events stream in,
|
|
54
|
+
# unlike competitors who rely on periodic polling or batch evaluation cycles
|
|
55
55
|
#
|
|
56
56
|
# @overload create(alert_type:, name:, threshold:, billable_metric_id: nil, credit_grant_type_filters: nil, credit_type_id: nil, custom_field_filters: nil, customer_id: nil, evaluate_on_create: nil, group_values: nil, invoice_types_filter: nil, plan_id: nil, uniqueness_key: nil, request_options: {})
|
|
57
57
|
#
|
|
58
|
-
# @param alert_type [Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType] Type of the
|
|
58
|
+
# @param alert_type [Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType] Type of the threshold notification
|
|
59
59
|
#
|
|
60
|
-
# @param name [String] Name of the
|
|
60
|
+
# @param name [String] Name of the threshold notification
|
|
61
61
|
#
|
|
62
|
-
# @param threshold [Float] Threshold value of the
|
|
62
|
+
# @param threshold [Float] Threshold value of the notification policy. Depending upon the notification typ
|
|
63
63
|
#
|
|
64
|
-
# @param billable_metric_id [String] For
|
|
64
|
+
# @param billable_metric_id [String] For threshold notifications of type `usage_threshold_reached`, specifies which b
|
|
65
65
|
#
|
|
66
|
-
# @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this
|
|
66
|
+
# @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this threshol
|
|
67
67
|
#
|
|
68
|
-
# @param credit_type_id [String] ID of the credit's currency, defaults to USD. If the specific
|
|
68
|
+
# @param credit_type_id [String] ID of the credit's currency, defaults to USD. If the specific notification type
|
|
69
69
|
#
|
|
70
|
-
# @param custom_field_filters [Array<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>] A list of custom field filters for
|
|
70
|
+
# @param custom_field_filters [Array<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>] A list of custom field filters for threshold notification types that support adv
|
|
71
71
|
#
|
|
72
|
-
# @param customer_id [String] If provided, will create this
|
|
72
|
+
# @param customer_id [String] If provided, will create this threshold notification for this specific customer.
|
|
73
73
|
#
|
|
74
|
-
# @param evaluate_on_create [Boolean] If true, the
|
|
74
|
+
# @param evaluate_on_create [Boolean] If true, the threshold notification will evaluate immediately on customers that
|
|
75
75
|
#
|
|
76
|
-
# @param group_values [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>] Only present for `spend_threshold_reached`
|
|
76
|
+
# @param group_values [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>] Only present for `spend_threshold_reached` notifications. Scope notification to
|
|
77
77
|
#
|
|
78
|
-
# @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached
|
|
78
|
+
# @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached threshold notifications. A list of invo
|
|
79
79
|
#
|
|
80
|
-
# @param plan_id [String] If provided, will create this
|
|
80
|
+
# @param plan_id [String] If provided, will create this threshold notification for this specific plan. To
|
|
81
81
|
#
|
|
82
82
|
# @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
|
|
83
83
|
#
|
|
@@ -97,39 +97,43 @@ module MetronomeSDK
|
|
|
97
97
|
)
|
|
98
98
|
end
|
|
99
99
|
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
100
|
+
# Some parameter documentations has been truncated, see
|
|
101
|
+
# {MetronomeSDK::Models::V1::AlertArchiveParams} for more details.
|
|
102
|
+
#
|
|
103
|
+
# Permanently disable a threshold notification and remove it from active
|
|
104
|
+
# monitoring across all customers. Archived threshold notifications stop
|
|
105
|
+
# evaluating immediately and can optionally release their uniqueness key for reuse
|
|
106
|
+
# in future threshold notification configurations.
|
|
103
107
|
#
|
|
104
108
|
# ### Use this endpoint to:
|
|
105
109
|
#
|
|
106
|
-
# - Decommission
|
|
107
|
-
# - Clean up test or deprecated
|
|
108
|
-
# - Free up uniqueness keys for reuse with new
|
|
109
|
-
# - Stop
|
|
110
|
+
# - Decommission threshold notifications that are no longer needed
|
|
111
|
+
# - Clean up test or deprecated threshold notification configurations
|
|
112
|
+
# - Free up uniqueness keys for reuse with new threshold notifications
|
|
113
|
+
# - Stop threshold notification evaluations without losing historical
|
|
114
|
+
# configuration data
|
|
110
115
|
# - Disable outdated monitoring rules during pricing model transitions
|
|
111
116
|
#
|
|
112
117
|
# ### Key response fields:
|
|
113
118
|
#
|
|
114
|
-
# - data: Object containing the archived
|
|
115
|
-
# - Alert evaluation stops immediately for all affected customers
|
|
116
|
-
# - Historical alert data and configurations remain accessible for audit purposes
|
|
119
|
+
# - data: Object containing the archived threshold notification's ID
|
|
117
120
|
#
|
|
118
121
|
# ### Usage guidelines:
|
|
119
122
|
#
|
|
120
|
-
# - Irreversible for evaluation: Archived
|
|
121
|
-
# new
|
|
123
|
+
# - Irreversible for evaluation: Archived threshold notifications cannot be
|
|
124
|
+
# re-enabled; create a new threshold notification to resume monitoring
|
|
122
125
|
# - Uniqueness key handling: Set `release_uniqueness_key` : `true` to reuse the
|
|
123
|
-
# key in future
|
|
124
|
-
# - Immediate effect:
|
|
125
|
-
#
|
|
126
|
-
#
|
|
126
|
+
# key in future threshold notifications
|
|
127
|
+
# - Immediate effect: Threshold notification evaluation stops instantly across all
|
|
128
|
+
# customers
|
|
129
|
+
# - Historical preservation: Archive operation maintains threshold notification
|
|
130
|
+
# history and configuration for compliance and auditing
|
|
127
131
|
#
|
|
128
132
|
# @overload archive(id:, release_uniqueness_key: nil, request_options: {})
|
|
129
133
|
#
|
|
130
|
-
# @param id [String] The Metronome ID of the
|
|
134
|
+
# @param id [String] The Metronome ID of the threshold notification
|
|
131
135
|
#
|
|
132
|
-
# @param release_uniqueness_key [Boolean] If true, resets the uniqueness key on this
|
|
136
|
+
# @param release_uniqueness_key [Boolean] If true, resets the uniqueness key on this threshold notification so it can be r
|
|
133
137
|
#
|
|
134
138
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
135
139
|
#
|
|
@@ -352,7 +352,7 @@ module MetronomeSDK
|
|
|
352
352
|
|
|
353
353
|
# Amendments will be replaced by Contract editing. New clients should implement
|
|
354
354
|
# using the `editContract` endpoint. Read more about the migration to contract
|
|
355
|
-
# editing [here](
|
|
355
|
+
# editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and
|
|
356
356
|
# reach out to your Metronome representative for more details. Once contract
|
|
357
357
|
# editing is enabled, access to this endpoint will be removed.
|
|
358
358
|
#
|
|
@@ -514,7 +514,7 @@ module MetronomeSDK
|
|
|
514
514
|
# segments
|
|
515
515
|
# - Manual adjustments: Includes all manual ledger entries, even future-dated ones
|
|
516
516
|
#
|
|
517
|
-
# @overload list_balances(customer_id:, id: nil, covering_date: nil, effective_before: nil, include_archived: nil, include_balance: nil, include_contract_balances: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
|
|
517
|
+
# @overload list_balances(customer_id:, id: nil, covering_date: nil, effective_before: nil, exclude_zero_balances: nil, include_archived: nil, include_balance: nil, include_contract_balances: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
|
|
518
518
|
#
|
|
519
519
|
# @param customer_id [String]
|
|
520
520
|
#
|
|
@@ -524,6 +524,8 @@ module MetronomeSDK
|
|
|
524
524
|
#
|
|
525
525
|
# @param effective_before [Time] Include only balances that have any access before the provided date (exclusive)
|
|
526
526
|
#
|
|
527
|
+
# @param exclude_zero_balances [Boolean] Exclude balances with zero amounts from the response.
|
|
528
|
+
#
|
|
527
529
|
# @param include_archived [Boolean] Include archived credits and credits from archived contracts.
|
|
528
530
|
#
|
|
529
531
|
# @param include_balance [Boolean] Include the balance of credits and commits in the response. Setting this flag ma
|
|
@@ -709,11 +711,12 @@ module MetronomeSDK
|
|
|
709
711
|
# Some parameter documentations has been truncated, see
|
|
710
712
|
# {MetronomeSDK::Models::V1::ContractUpdateEndDateParams} for more details.
|
|
711
713
|
#
|
|
712
|
-
# Update or
|
|
714
|
+
# Update or add an end date to a contract. Ending a contract early will impact
|
|
713
715
|
# draft usage statements, truncate any terms, and remove upcoming scheduled
|
|
714
716
|
# invoices. Moving the date into the future will only extend the contract length.
|
|
715
|
-
# Terms and scheduled invoices are not extended.
|
|
716
|
-
# has changed or if a perpetual
|
|
717
|
+
# Terms and scheduled invoices are not extended. In-advance subscriptions will not
|
|
718
|
+
# be extended. Use this if a contract's end date has changed or if a perpetual
|
|
719
|
+
# contract ends.
|
|
717
720
|
#
|
|
718
721
|
# @overload update_end_date(contract_id:, customer_id:, allow_ending_before_finalized_invoice: nil, ending_before: nil, request_options: {})
|
|
719
722
|
#
|
|
@@ -7,7 +7,8 @@ module MetronomeSDK
|
|
|
7
7
|
# Some parameter documentations has been truncated, see
|
|
8
8
|
# {MetronomeSDK::Models::V1::CreditGrantCreateParams} for more details.
|
|
9
9
|
#
|
|
10
|
-
# Create a new credit grant
|
|
10
|
+
# Create a new credit grant. This is a Plans (deprecated) endpoint. New clients
|
|
11
|
+
# should implement using Contracts.
|
|
11
12
|
#
|
|
12
13
|
# @overload create(customer_id:, expires_at:, grant_amount:, name:, paid_amount:, priority:, credit_grant_type: nil, custom_fields: nil, effective_at: nil, invoice_date: nil, product_ids: nil, reason: nil, rollover_settings: nil, uniqueness_key: nil, request_options: {})
|
|
13
14
|
#
|
|
@@ -58,7 +59,8 @@ module MetronomeSDK
|
|
|
58
59
|
# Some parameter documentations has been truncated, see
|
|
59
60
|
# {MetronomeSDK::Models::V1::CreditGrantListParams} for more details.
|
|
60
61
|
#
|
|
61
|
-
# List credit grants. This list does not included voided grants.
|
|
62
|
+
# List credit grants. This list does not included voided grants. This is a Plans
|
|
63
|
+
# (deprecated) endpoint. New clients should implement using Contracts.
|
|
62
64
|
#
|
|
63
65
|
# @overload list(limit: nil, next_page: nil, credit_grant_ids: nil, credit_type_ids: nil, customer_ids: nil, effective_before: nil, not_expiring_before: nil, request_options: {})
|
|
64
66
|
#
|
|
@@ -95,7 +97,8 @@ module MetronomeSDK
|
|
|
95
97
|
)
|
|
96
98
|
end
|
|
97
99
|
|
|
98
|
-
# Edit an existing credit grant
|
|
100
|
+
# Edit an existing credit grant. This is a Plans (deprecated) endpoint. New
|
|
101
|
+
# clients should implement using Contracts.
|
|
99
102
|
#
|
|
100
103
|
# @overload edit(id:, credit_grant_type: nil, expires_at: nil, name: nil, request_options: {})
|
|
101
104
|
#
|
|
@@ -128,7 +131,8 @@ module MetronomeSDK
|
|
|
128
131
|
#
|
|
129
132
|
# Fetches a list of credit ledger entries. Returns lists of ledgers per customer.
|
|
130
133
|
# Ledger entries are returned in chronological order. Ledger entries associated
|
|
131
|
-
# with voided credit grants are not included.
|
|
134
|
+
# with voided credit grants are not included. This is a Plans (deprecated)
|
|
135
|
+
# endpoint. New clients should implement using Contracts.
|
|
132
136
|
#
|
|
133
137
|
# @overload list_entries(next_page: nil, sort: nil, credit_type_ids: nil, customer_ids: nil, ending_before: nil, starting_on: nil, request_options: {})
|
|
134
138
|
#
|
|
@@ -164,7 +168,8 @@ module MetronomeSDK
|
|
|
164
168
|
)
|
|
165
169
|
end
|
|
166
170
|
|
|
167
|
-
# Void a credit grant
|
|
171
|
+
# Void a credit grant. This is a Plans (deprecated) endpoint. New clients should
|
|
172
|
+
# implement using Contracts.
|
|
168
173
|
#
|
|
169
174
|
# @overload void(id:, release_uniqueness_key: nil, void_credit_purchase_invoice: nil, request_options: {})
|
|
170
175
|
#
|
|
@@ -8,17 +8,26 @@ module MetronomeSDK
|
|
|
8
8
|
# Some parameter documentations has been truncated, see
|
|
9
9
|
# {MetronomeSDK::Models::V1::Customers::AlertRetrieveParams} for more details.
|
|
10
10
|
#
|
|
11
|
-
# Retrieve the real-time evaluation status for a specific
|
|
12
|
-
# This endpoint provides instant visibility into
|
|
13
|
-
#
|
|
14
|
-
# action based on current
|
|
11
|
+
# Retrieve the real-time evaluation status for a specific threshold
|
|
12
|
+
# notification-customer pair. This endpoint provides instant visibility into
|
|
13
|
+
# whether a customer has triggered a threshold notification condition, enabling
|
|
14
|
+
# you to monitor account health and take proactive action based on current
|
|
15
|
+
# threshold notification states.
|
|
15
16
|
#
|
|
16
17
|
# ### Use this endpoint to:
|
|
17
18
|
#
|
|
18
|
-
# - Check if a specific customer is currently violating an
|
|
19
|
+
# - Check if a specific customer is currently violating an threshold notification
|
|
19
20
|
# (`in_alarm` status)
|
|
20
|
-
# - Verify
|
|
21
|
-
#
|
|
21
|
+
# - Verify threshold notification configuration details and threshold values for a
|
|
22
|
+
# customer
|
|
23
|
+
# - Monitor the evaluation state of newly created or recently modified threshold
|
|
24
|
+
# notification
|
|
25
|
+
# - Build dashboards or automated workflows that respond to specific threshold
|
|
26
|
+
# notification conditions
|
|
27
|
+
# - Validate threshold notification behavior before deploying to production
|
|
28
|
+
# customers
|
|
29
|
+
# - Integrate threshold notification status checks into customer support tools or
|
|
30
|
+
# admin interfaces
|
|
22
31
|
#
|
|
23
32
|
# ### Key response fields:
|
|
24
33
|
#
|
|
@@ -27,40 +36,43 @@ module MetronomeSDK
|
|
|
27
36
|
# - `customer_status`: The current evaluation state
|
|
28
37
|
#
|
|
29
38
|
# - `ok` - Customer is within acceptable thresholds
|
|
30
|
-
# - `in_alarm
|
|
31
|
-
# - `evaluating` -
|
|
32
|
-
#
|
|
33
|
-
# - `null` -
|
|
34
|
-
# - `triggered_by`: Additional context about what caused the
|
|
35
|
-
# (when applicable)
|
|
36
|
-
# - alert: Complete
|
|
37
|
-
# -
|
|
39
|
+
# - `in_alarm` - Customer has breached the threshold for the notification
|
|
40
|
+
# - `evaluating` - Notification is currently being evaluated (typically during
|
|
41
|
+
# initial setup)
|
|
42
|
+
# - `null` - Notification has been archived
|
|
43
|
+
# - `triggered_by`: Additional context about what caused the notification to
|
|
44
|
+
# trigger (when applicable)
|
|
45
|
+
# - alert: Complete threshold notification configuration including:
|
|
46
|
+
# - Notification ID, name, and type
|
|
38
47
|
# - Current threshold values and credit type information
|
|
39
|
-
# -
|
|
48
|
+
# - Notification status (enabled, disabled, or archived)
|
|
40
49
|
# - Last update timestamp
|
|
41
50
|
# - Any applied filters (credit grant types, custom fields, group values)
|
|
42
51
|
#
|
|
43
52
|
# ### Usage guidelines:
|
|
44
53
|
#
|
|
45
54
|
# - Customer status: Returns the current evaluation state, not historical data.
|
|
46
|
-
# For
|
|
47
|
-
# -
|
|
48
|
-
#
|
|
49
|
-
# -
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
55
|
+
# For threshold notification history, use webhook notifications or event logs
|
|
56
|
+
# - Required parameters: Both customer_id and alert_id must be valid UUIDs that
|
|
57
|
+
# exist in your organization
|
|
58
|
+
# - Archived notifications: Returns null for customer_status if the notification
|
|
59
|
+
# has been archived, but still includes the notification configuration details
|
|
60
|
+
# - Performance considerations: This endpoint queries live evaluation state,
|
|
61
|
+
# making it ideal for real-time monitoring but not for bulk status checks
|
|
62
|
+
# - Integration patterns: Best used for on-demand status checks in response to
|
|
63
|
+
# user actions or as part of targeted monitoring workflows
|
|
64
|
+
# - Error handling: Returns 404 if either the customer or alert_id doesn't exist
|
|
53
65
|
# or isn't accessible to your organization
|
|
54
66
|
#
|
|
55
67
|
# @overload retrieve(alert_id:, customer_id:, group_values: nil, plans_or_contracts: nil, request_options: {})
|
|
56
68
|
#
|
|
57
|
-
# @param alert_id [String] The Metronome ID of the
|
|
69
|
+
# @param alert_id [String] The Metronome ID of the threshold notification
|
|
58
70
|
#
|
|
59
71
|
# @param customer_id [String] The Metronome ID of the customer
|
|
60
72
|
#
|
|
61
|
-
# @param group_values [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>] Only present for `spend_threshold_reached`
|
|
73
|
+
# @param group_values [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>] Only present for `spend_threshold_reached` notifications. Retrieve the notificat
|
|
62
74
|
#
|
|
63
|
-
# @param plans_or_contracts [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts] When parallel
|
|
75
|
+
# @param plans_or_contracts [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts] When parallel threshold notifications are enabled during migration, this flag de
|
|
64
76
|
#
|
|
65
77
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
66
78
|
#
|
|
@@ -81,31 +93,37 @@ module MetronomeSDK
|
|
|
81
93
|
# Some parameter documentations has been truncated, see
|
|
82
94
|
# {MetronomeSDK::Models::V1::Customers::AlertListParams} for more details.
|
|
83
95
|
#
|
|
84
|
-
# Retrieve all
|
|
85
|
-
# customer in a single API call. This endpoint provides a
|
|
86
|
-
# all
|
|
96
|
+
# Retrieve all threshold notification configurations and their current statuses
|
|
97
|
+
# for a specific customer in a single API call. This endpoint provides a
|
|
98
|
+
# comprehensive view of all threshold notification monitoring a customer account.
|
|
87
99
|
#
|
|
88
100
|
# ### Use this endpoint to:
|
|
89
101
|
#
|
|
90
|
-
# - Display all active
|
|
91
|
-
#
|
|
92
|
-
# -
|
|
93
|
-
#
|
|
102
|
+
# - Display all active threshold notifications for a customer in dashboards or
|
|
103
|
+
# admin panels
|
|
104
|
+
# - Quickly identify which threshold notifications a customer is currently
|
|
105
|
+
# triggering
|
|
106
|
+
# - Audit threshold notification coverage for specific accounts
|
|
107
|
+
# - Filter threshold notifications by status (enabled, disabled, or archived)
|
|
94
108
|
#
|
|
95
109
|
# ### Key response fields:
|
|
96
110
|
#
|
|
97
111
|
# - data: Array of CustomerAlert objects, each containing:
|
|
98
112
|
# - Current evaluation status (`ok`, `in_alarm`, `evaluating`, or `null`)
|
|
99
|
-
# - Complete
|
|
100
|
-
# -
|
|
101
|
-
# -
|
|
113
|
+
# - Complete threshold notification configuration and threshold details
|
|
114
|
+
# - Threshold notification metadata including type, name, and last update time
|
|
115
|
+
# - next_page: Pagination cursor for retrieving additional results
|
|
102
116
|
#
|
|
103
117
|
# ### Usage guidelines:
|
|
104
118
|
#
|
|
105
|
-
# - Default behavior: Returns only enabled
|
|
106
|
-
# specified
|
|
119
|
+
# - Default behavior: Returns only enabled threshold notifications unless
|
|
120
|
+
# `alert_statuses` filter is specified
|
|
107
121
|
# - Pagination: Use the `next_page` cursor to retrieve all results for customers
|
|
108
|
-
# with many
|
|
122
|
+
# with many notifications
|
|
123
|
+
# - Performance: Efficiently retrieves multiple threshold notification statuses in
|
|
124
|
+
# a single request instead of making individual calls
|
|
125
|
+
# - Filtering: Pass the `alert_statuses` array to include disabled or archived
|
|
126
|
+
# threshold notifications in results
|
|
109
127
|
#
|
|
110
128
|
# @overload list(customer_id:, next_page: nil, alert_statuses: nil, request_options: {})
|
|
111
129
|
#
|
|
@@ -113,7 +131,7 @@ module MetronomeSDK
|
|
|
113
131
|
#
|
|
114
132
|
# @param next_page [String] Query param: Cursor that indicates where the next page of results should start.
|
|
115
133
|
#
|
|
116
|
-
# @param alert_statuses [Array<Symbol, MetronomeSDK::Models::V1::Customers::AlertListParams::AlertStatus>] Body param: Optionally filter by
|
|
134
|
+
# @param alert_statuses [Array<Symbol, MetronomeSDK::Models::V1::Customers::AlertListParams::AlertStatus>] Body param: Optionally filter by threshold notification status. If absent, only
|
|
117
135
|
#
|
|
118
136
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
119
137
|
#
|
|
@@ -134,23 +152,24 @@ module MetronomeSDK
|
|
|
134
152
|
)
|
|
135
153
|
end
|
|
136
154
|
|
|
137
|
-
# Force an immediate re-evaluation of a specific
|
|
138
|
-
# any previous state and triggering a fresh assessment against
|
|
139
|
-
# This endpoint ensures
|
|
140
|
-
# corrections.
|
|
155
|
+
# Force an immediate re-evaluation of a specific threshold notification for a
|
|
156
|
+
# customer, clearing any previous state and triggering a fresh assessment against
|
|
157
|
+
# current thresholds. This endpoint ensures threshold notification accuracy after
|
|
158
|
+
# configuration changes or data corrections.
|
|
141
159
|
#
|
|
142
160
|
# ### Use this endpoint to:
|
|
143
161
|
#
|
|
144
|
-
# - Clear false positive
|
|
145
|
-
# - Re-evaluate
|
|
146
|
-
#
|
|
147
|
-
# -
|
|
162
|
+
# - Clear false positive threshold notifications after fixing data issues
|
|
163
|
+
# - Re-evaluate threshold notifications after adjusting customer balances or
|
|
164
|
+
# credits
|
|
165
|
+
# - Test threshold notification behavior during development and debugging
|
|
166
|
+
# - Resolve stuck threshold notification that may be in an incorrect state
|
|
148
167
|
# - Trigger immediate evaluation after threshold modifications
|
|
149
168
|
#
|
|
150
169
|
# ### Key response fields:
|
|
151
170
|
#
|
|
152
|
-
# - 200 Success: Confirmation that the
|
|
153
|
-
# initiated
|
|
171
|
+
# - 200 Success: Confirmation that the threshold notification has been reset and
|
|
172
|
+
# re-evaluation initiated
|
|
154
173
|
# - No response body is returned - the operation completes asynchronously
|
|
155
174
|
#
|
|
156
175
|
# ### Usage guidelines:
|
|
@@ -165,7 +184,7 @@ module MetronomeSDK
|
|
|
165
184
|
#
|
|
166
185
|
# @overload reset(alert_id:, customer_id:, request_options: {})
|
|
167
186
|
#
|
|
168
|
-
# @param alert_id [String] The Metronome ID of the
|
|
187
|
+
# @param alert_id [String] The Metronome ID of the threshold notification
|
|
169
188
|
#
|
|
170
189
|
# @param customer_id [String] The Metronome ID of the customer
|
|
171
190
|
#
|
|
@@ -9,7 +9,8 @@ module MetronomeSDK
|
|
|
9
9
|
# {MetronomeSDK::Models::V1::Customers::BillingConfigCreateParams} for more
|
|
10
10
|
# details.
|
|
11
11
|
#
|
|
12
|
-
# Set the billing configuration for a given customer.
|
|
12
|
+
# Set the billing configuration for a given customer. This is a Plans (deprecated)
|
|
13
|
+
# endpoint. New clients should implement using Contracts.
|
|
13
14
|
#
|
|
14
15
|
# @overload create(customer_id:, billing_provider_type:, billing_provider_customer_id:, aws_product_code: nil, aws_region: nil, stripe_collection_method: nil, request_options: {})
|
|
15
16
|
#
|
|
@@ -23,7 +24,7 @@ module MetronomeSDK
|
|
|
23
24
|
#
|
|
24
25
|
# @param aws_region [Symbol, MetronomeSDK::Models::V1::Customers::BillingConfigCreateParams::AwsRegion] Body param:
|
|
25
26
|
#
|
|
26
|
-
# @param stripe_collection_method [Symbol, MetronomeSDK::Models::V1::Customers::BillingConfigCreateParams::StripeCollectionMethod] Body param:
|
|
27
|
+
# @param stripe_collection_method [Symbol, MetronomeSDK::Models::V1::Customers::BillingConfigCreateParams::StripeCollectionMethod] Body param: The collection method for the customer's invoices.
|
|
27
28
|
#
|
|
28
29
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
29
30
|
#
|
|
@@ -49,7 +50,8 @@ module MetronomeSDK
|
|
|
49
50
|
)
|
|
50
51
|
end
|
|
51
52
|
|
|
52
|
-
# Fetch the billing configuration for the given customer.
|
|
53
|
+
# Fetch the billing configuration for the given customer. This is a Plans
|
|
54
|
+
# (deprecated) endpoint. New clients should implement using Contracts.
|
|
53
55
|
#
|
|
54
56
|
# @overload retrieve(customer_id:, billing_provider_type:, request_options: {})
|
|
55
57
|
#
|
|
@@ -81,7 +83,8 @@ module MetronomeSDK
|
|
|
81
83
|
end
|
|
82
84
|
|
|
83
85
|
# Delete the billing configuration for a given customer. Note: this is unsupported
|
|
84
|
-
# for Azure and AWS Marketplace customers.
|
|
86
|
+
# for Azure and AWS Marketplace customers. This is a Plans (deprecated) endpoint.
|
|
87
|
+
# New clients should implement using Contracts.
|
|
85
88
|
#
|
|
86
89
|
# @overload delete(customer_id:, billing_provider_type:, request_options: {})
|
|
87
90
|
#
|
|
@@ -37,7 +37,8 @@ module MetronomeSDK
|
|
|
37
37
|
# #### Billing configuration:
|
|
38
38
|
#
|
|
39
39
|
# - invoice_contract_id is required for postpaid commits and for prepaid commits
|
|
40
|
-
# with billing (only optional for free prepaid commits)
|
|
40
|
+
# with billing (only optional for free prepaid commits) unless do_not_invoice is
|
|
41
|
+
# set to true
|
|
41
42
|
# - For postpaid commits: access_schedule and invoice_schedule must have matching
|
|
42
43
|
# amounts
|
|
43
44
|
# - For postpaid commits: only one schedule item is allowed in both schedules.
|
|
@@ -175,7 +175,8 @@ module MetronomeSDK
|
|
|
175
175
|
# Some parameter documentations has been truncated, see
|
|
176
176
|
# {MetronomeSDK::Models::V1::Customers::InvoiceAddChargeParams} for more details.
|
|
177
177
|
#
|
|
178
|
-
# Add a one time charge to the specified invoice
|
|
178
|
+
# Add a one time charge to the specified invoice. This is a Plans (deprecated)
|
|
179
|
+
# endpoint. New clients should implement using Contracts.
|
|
179
180
|
#
|
|
180
181
|
# @overload add_charge(customer_id:, charge_id:, customer_plan_id:, description:, invoice_start_timestamp:, price:, quantity:, request_options: {})
|
|
181
182
|
#
|
|
@@ -299,6 +300,61 @@ module MetronomeSDK
|
|
|
299
300
|
)
|
|
300
301
|
end
|
|
301
302
|
|
|
303
|
+
# Retrieve a PDF version of a specific invoice by its unique identifier. This
|
|
304
|
+
# endpoint generates a professionally formatted invoice document suitable for
|
|
305
|
+
# sharing with customers, accounting teams, or for record-keeping purposes.
|
|
306
|
+
#
|
|
307
|
+
# ### Use this endpoint to:
|
|
308
|
+
#
|
|
309
|
+
# - Provide customers with downloadable or emailable copies of their invoices
|
|
310
|
+
# - Support accounting and finance teams with official billing documents
|
|
311
|
+
# - Maintain accurate records of billing transactions for audits and compliance
|
|
312
|
+
#
|
|
313
|
+
# ### Key response details:
|
|
314
|
+
#
|
|
315
|
+
# - The response is a binary PDF file representing the full invoice
|
|
316
|
+
# - The PDF includes all standard invoice information such as line items, totals,
|
|
317
|
+
# billing period, and customer details
|
|
318
|
+
# - The document is formatted for clarity and professionalism, suitable for
|
|
319
|
+
# official use
|
|
320
|
+
#
|
|
321
|
+
# ### Usage guidelines:
|
|
322
|
+
#
|
|
323
|
+
# - Ensure the `invoice_id` corresponds to an existing invoice for the specified
|
|
324
|
+
# `customer_id`
|
|
325
|
+
# - The PDF is generated on-demand; frequent requests for the same invoice may
|
|
326
|
+
# impact performance
|
|
327
|
+
# - Use appropriate headers to handle the binary response in your application
|
|
328
|
+
# (e.g., setting `Content-Type: application/pdf`)
|
|
329
|
+
#
|
|
330
|
+
# @overload retrieve_pdf(customer_id:, invoice_id:, request_options: {})
|
|
331
|
+
#
|
|
332
|
+
# @param customer_id [String]
|
|
333
|
+
# @param invoice_id [String]
|
|
334
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
335
|
+
#
|
|
336
|
+
# @return [StringIO]
|
|
337
|
+
#
|
|
338
|
+
# @see MetronomeSDK::Models::V1::Customers::InvoiceRetrievePdfParams
|
|
339
|
+
def retrieve_pdf(params)
|
|
340
|
+
parsed, options = MetronomeSDK::V1::Customers::InvoiceRetrievePdfParams.dump_request(params)
|
|
341
|
+
customer_id =
|
|
342
|
+
parsed.delete(:customer_id) do
|
|
343
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
344
|
+
end
|
|
345
|
+
invoice_id =
|
|
346
|
+
parsed.delete(:invoice_id) do
|
|
347
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
348
|
+
end
|
|
349
|
+
@client.request(
|
|
350
|
+
method: :get,
|
|
351
|
+
path: ["v1/customers/%1$s/invoices/%2$s/pdf", customer_id, invoice_id],
|
|
352
|
+
headers: {"accept" => "application/pdf"},
|
|
353
|
+
model: StringIO,
|
|
354
|
+
options: options
|
|
355
|
+
)
|
|
356
|
+
end
|
|
357
|
+
|
|
302
358
|
# @api private
|
|
303
359
|
#
|
|
304
360
|
# @param client [MetronomeSDK::Client]
|
|
@@ -5,7 +5,8 @@ module MetronomeSDK
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class Plans
|
|
8
|
-
# List the given customer's plans in reverse-chronological order.
|
|
8
|
+
# List the given customer's plans in reverse-chronological order. This is a Plans
|
|
9
|
+
# (deprecated) endpoint. New clients should implement using Contracts.
|
|
9
10
|
#
|
|
10
11
|
# @overload list(customer_id:, limit: nil, next_page: nil, request_options: {})
|
|
11
12
|
#
|
|
@@ -41,7 +42,8 @@ module MetronomeSDK
|
|
|
41
42
|
#
|
|
42
43
|
# Associate an existing customer with a plan for a specified date range. See the
|
|
43
44
|
# [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
44
|
-
# for details on the price adjustments.
|
|
45
|
+
# for details on the price adjustments. This is a Plans (deprecated) endpoint. New
|
|
46
|
+
# clients should implement using Contracts.
|
|
45
47
|
#
|
|
46
48
|
# @overload add(customer_id:, plan_id:, starting_on:, ending_before: nil, net_payment_terms_days: nil, overage_rate_adjustments: nil, price_adjustments: nil, trial_spec: nil, request_options: {})
|
|
47
49
|
#
|
|
@@ -84,7 +86,8 @@ module MetronomeSDK
|
|
|
84
86
|
# Some parameter documentations has been truncated, see
|
|
85
87
|
# {MetronomeSDK::Models::V1::Customers::PlanEndParams} for more details.
|
|
86
88
|
#
|
|
87
|
-
# Change the end date of a customer's plan.
|
|
89
|
+
# Change the end date of a customer's plan. This is a Plans (deprecated) endpoint.
|
|
90
|
+
# New clients should implement using Contracts.
|
|
88
91
|
#
|
|
89
92
|
# @overload end_(customer_id:, customer_plan_id:, ending_before: nil, void_invoices: nil, void_stripe_invoices: nil, request_options: {})
|
|
90
93
|
#
|
|
@@ -124,7 +127,8 @@ module MetronomeSDK
|
|
|
124
127
|
|
|
125
128
|
# Lists a customer plans adjustments. See the
|
|
126
129
|
# [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
127
|
-
# for details.
|
|
130
|
+
# for details. This is a Plans (deprecated) endpoint. New clients should implement
|
|
131
|
+
# using Contracts.
|
|
128
132
|
#
|
|
129
133
|
# @overload list_price_adjustments(customer_id:, customer_plan_id:, limit: nil, next_page: nil, request_options: {})
|
|
130
134
|
#
|