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
|
@@ -4,16 +4,15 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Alerts
|
|
7
|
-
# Create a new
|
|
8
|
-
# in real-time. Metronome's
|
|
9
|
-
# immediate evaluation capabilities, enabling you to
|
|
10
|
-
# accounts and prevent revenue leakage.
|
|
7
|
+
# Create a new threshold notification to monitor customer spending, balances, and
|
|
8
|
+
# billing metrics in real-time. Metronome's notification system provides
|
|
9
|
+
# industry-leading speed with immediate evaluation capabilities, enabling you to
|
|
10
|
+
# proactively manage customer accounts and prevent revenue leakage.
|
|
11
11
|
#
|
|
12
|
-
# This endpoint creates configurable
|
|
13
|
-
# billing thresholds including spend limits, credit balances,
|
|
14
|
-
# utilization, and invoice totals.
|
|
15
|
-
# customers or targeted to specific customer accounts.
|
|
16
|
-
# on certain alert types to further target alerts to groups of customers.
|
|
12
|
+
# This endpoint creates configurable threshold notifications that continuously
|
|
13
|
+
# monitor various billing thresholds including spend limits, credit balances,
|
|
14
|
+
# commitment utilization, and invoice totals. Threshold notifications can be
|
|
15
|
+
# configured globally for all customers or targeted to specific customer accounts.
|
|
17
16
|
#
|
|
18
17
|
# ### Use this endpoint to:
|
|
19
18
|
#
|
|
@@ -29,26 +28,27 @@ module MetronomeSDK
|
|
|
29
28
|
#
|
|
30
29
|
# A successful response returns a CustomerAlert object containing:
|
|
31
30
|
#
|
|
32
|
-
# - The
|
|
31
|
+
# - The threshold notification configuration with its unique ID and current status
|
|
33
32
|
# - The customer's evaluation status (ok, in_alarm, or evaluating)
|
|
34
|
-
# -
|
|
33
|
+
# - Threshold notification metadata including type, threshold values, and update
|
|
34
|
+
# timestamps
|
|
35
35
|
#
|
|
36
36
|
# ### Usage guidelines:
|
|
37
37
|
#
|
|
38
38
|
# - Immediate evaluation: Set `evaluate_on_create` : `true` (default) for instant
|
|
39
39
|
# evaluation against existing customers
|
|
40
|
-
# - Uniqueness constraints: Each
|
|
41
|
-
# your organization. Use `release_uniqueness_key` :
|
|
42
|
-
# reuse keys
|
|
43
|
-
# -
|
|
44
|
-
# `billable_metric_id` for usage
|
|
45
|
-
#
|
|
46
|
-
# - Webhook delivery:
|
|
47
|
-
# integration with your systems. Configure webhook endpoints before
|
|
48
|
-
#
|
|
49
|
-
# - Performance at scale: Metronome's event-driven architecture processes
|
|
50
|
-
# evaluations in real-time as usage events stream in,
|
|
51
|
-
# rely on periodic polling or batch evaluation cycles
|
|
40
|
+
# - Uniqueness constraints: Each threshold notification must have a unique
|
|
41
|
+
# `uniqueness_key` within your organization. Use `release_uniqueness_key` :
|
|
42
|
+
# `true` when archiving to reuse keys
|
|
43
|
+
# - Notification type requirements: Different threshold notification types require
|
|
44
|
+
# specific fields (e.g., `billable_metric_id` for usage notifications,
|
|
45
|
+
# `credit_type_id` for credit-based threshold notifications)
|
|
46
|
+
# - Webhook delivery: Threshold notifications trigger webhook notifications for
|
|
47
|
+
# real-time integration with your systems. Configure webhook endpoints before
|
|
48
|
+
# creating threshold notifications
|
|
49
|
+
# - Performance at scale: Metronome's event-driven architecture processes
|
|
50
|
+
# threshold notification evaluations in real-time as usage events stream in,
|
|
51
|
+
# unlike competitors who rely on periodic polling or batch evaluation cycles
|
|
52
52
|
sig do
|
|
53
53
|
params(
|
|
54
54
|
alert_type:
|
|
@@ -73,42 +73,44 @@ module MetronomeSDK
|
|
|
73
73
|
).returns(MetronomeSDK::Models::V1::AlertCreateResponse)
|
|
74
74
|
end
|
|
75
75
|
def create(
|
|
76
|
-
# Type of the
|
|
76
|
+
# Type of the threshold notification
|
|
77
77
|
alert_type:,
|
|
78
|
-
# Name of the
|
|
78
|
+
# Name of the threshold notification
|
|
79
79
|
name:,
|
|
80
|
-
# Threshold value of the
|
|
81
|
-
# may represent a financial amount, the days remaining, or a
|
|
80
|
+
# Threshold value of the notification policy. Depending upon the notification
|
|
81
|
+
# type, this number may represent a financial amount, the days remaining, or a
|
|
82
|
+
# percentage reached.
|
|
82
83
|
threshold:,
|
|
83
|
-
# For
|
|
84
|
-
# track the usage for.
|
|
84
|
+
# For threshold notifications of type `usage_threshold_reached`, specifies which
|
|
85
|
+
# billable metric to track the usage for.
|
|
85
86
|
billable_metric_id: nil,
|
|
86
|
-
# An array of strings, representing a way to filter the credit grant this
|
|
87
|
-
# applies to, by looking at the credit_grant_type field on
|
|
88
|
-
# field is only defined for CreditPercentage and
|
|
87
|
+
# An array of strings, representing a way to filter the credit grant this
|
|
88
|
+
# threshold notification applies to, by looking at the credit_grant_type field on
|
|
89
|
+
# the credit grant. This field is only defined for CreditPercentage and
|
|
90
|
+
# CreditBalance notifications
|
|
89
91
|
credit_grant_type_filters: nil,
|
|
90
|
-
# ID of the credit's currency, defaults to USD. If the specific
|
|
92
|
+
# ID of the credit's currency, defaults to USD. If the specific notification type
|
|
91
93
|
# requires a pricing unit/currency, find the ID in the
|
|
92
94
|
# [Metronome app](https://app.metronome.com/offering/pricing-units).
|
|
93
95
|
credit_type_id: nil,
|
|
94
|
-
# A list of custom field filters for
|
|
95
|
-
# Only present for contract invoices.
|
|
96
|
+
# A list of custom field filters for threshold notification types that support
|
|
97
|
+
# advanced filtering. Only present for contract invoices.
|
|
96
98
|
custom_field_filters: nil,
|
|
97
|
-
# If provided, will create this
|
|
98
|
-
#
|
|
99
|
+
# If provided, will create this threshold notification for this specific customer.
|
|
100
|
+
# To create a notification for all customers, do not specify a `customer_id`.
|
|
99
101
|
customer_id: nil,
|
|
100
|
-
# If true, the
|
|
101
|
-
#
|
|
102
|
-
# trigger the
|
|
102
|
+
# If true, the threshold notification will evaluate immediately on customers that
|
|
103
|
+
# already meet the notification threshold. If false, it will only evaluate on
|
|
104
|
+
# future customers that trigger the threshold. Defaults to true.
|
|
103
105
|
evaluate_on_create: nil,
|
|
104
|
-
# Only present for `spend_threshold_reached`
|
|
105
|
-
# group key on individual line items.
|
|
106
|
+
# Only present for `spend_threshold_reached` notifications. Scope notification to
|
|
107
|
+
# a specific group key on individual line items.
|
|
106
108
|
group_values: nil,
|
|
107
|
-
# Only supported for invoice_total_reached
|
|
108
|
-
# evaluate.
|
|
109
|
+
# Only supported for invoice_total_reached threshold notifications. A list of
|
|
110
|
+
# invoice types to evaluate.
|
|
109
111
|
invoice_types_filter: nil,
|
|
110
|
-
# If provided, will create this
|
|
111
|
-
# for all customers, do not specify a `plan_id`.
|
|
112
|
+
# If provided, will create this threshold notification for this specific plan. To
|
|
113
|
+
# create a notification for all customers, do not specify a `plan_id`.
|
|
112
114
|
plan_id: nil,
|
|
113
115
|
# Prevents the creation of duplicates. If a request to create a record is made
|
|
114
116
|
# with a previously used uniqueness key, a new record will not be created and the
|
|
@@ -118,33 +120,34 @@ module MetronomeSDK
|
|
|
118
120
|
)
|
|
119
121
|
end
|
|
120
122
|
|
|
121
|
-
# Permanently disable
|
|
122
|
-
# customers. Archived
|
|
123
|
-
# release their uniqueness key for reuse
|
|
123
|
+
# Permanently disable a threshold notification and remove it from active
|
|
124
|
+
# monitoring across all customers. Archived threshold notifications stop
|
|
125
|
+
# evaluating immediately and can optionally release their uniqueness key for reuse
|
|
126
|
+
# in future threshold notification configurations.
|
|
124
127
|
#
|
|
125
128
|
# ### Use this endpoint to:
|
|
126
129
|
#
|
|
127
|
-
# - Decommission
|
|
128
|
-
# - Clean up test or deprecated
|
|
129
|
-
# - Free up uniqueness keys for reuse with new
|
|
130
|
-
# - Stop
|
|
130
|
+
# - Decommission threshold notifications that are no longer needed
|
|
131
|
+
# - Clean up test or deprecated threshold notification configurations
|
|
132
|
+
# - Free up uniqueness keys for reuse with new threshold notifications
|
|
133
|
+
# - Stop threshold notification evaluations without losing historical
|
|
134
|
+
# configuration data
|
|
131
135
|
# - Disable outdated monitoring rules during pricing model transitions
|
|
132
136
|
#
|
|
133
137
|
# ### Key response fields:
|
|
134
138
|
#
|
|
135
|
-
# - data: Object containing the archived
|
|
136
|
-
# - Alert evaluation stops immediately for all affected customers
|
|
137
|
-
# - Historical alert data and configurations remain accessible for audit purposes
|
|
139
|
+
# - data: Object containing the archived threshold notification's ID
|
|
138
140
|
#
|
|
139
141
|
# ### Usage guidelines:
|
|
140
142
|
#
|
|
141
|
-
# - Irreversible for evaluation: Archived
|
|
142
|
-
# new
|
|
143
|
+
# - Irreversible for evaluation: Archived threshold notifications cannot be
|
|
144
|
+
# re-enabled; create a new threshold notification to resume monitoring
|
|
143
145
|
# - Uniqueness key handling: Set `release_uniqueness_key` : `true` to reuse the
|
|
144
|
-
# key in future
|
|
145
|
-
# - Immediate effect:
|
|
146
|
-
#
|
|
147
|
-
#
|
|
146
|
+
# key in future threshold notifications
|
|
147
|
+
# - Immediate effect: Threshold notification evaluation stops instantly across all
|
|
148
|
+
# customers
|
|
149
|
+
# - Historical preservation: Archive operation maintains threshold notification
|
|
150
|
+
# history and configuration for compliance and auditing
|
|
148
151
|
sig do
|
|
149
152
|
params(
|
|
150
153
|
id: String,
|
|
@@ -153,9 +156,10 @@ module MetronomeSDK
|
|
|
153
156
|
).returns(MetronomeSDK::Models::V1::AlertArchiveResponse)
|
|
154
157
|
end
|
|
155
158
|
def archive(
|
|
156
|
-
# The Metronome ID of the
|
|
159
|
+
# The Metronome ID of the threshold notification
|
|
157
160
|
id:,
|
|
158
|
-
# If true, resets the uniqueness key on this
|
|
161
|
+
# If true, resets the uniqueness key on this threshold notification so it can be
|
|
162
|
+
# re-used
|
|
159
163
|
release_uniqueness_key: nil,
|
|
160
164
|
request_options: {}
|
|
161
165
|
)
|
|
@@ -389,7 +389,7 @@ module MetronomeSDK
|
|
|
389
389
|
|
|
390
390
|
# Amendments will be replaced by Contract editing. New clients should implement
|
|
391
391
|
# using the `editContract` endpoint. Read more about the migration to contract
|
|
392
|
-
# editing [here](
|
|
392
|
+
# editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and
|
|
393
393
|
# reach out to your Metronome representative for more details. Once contract
|
|
394
394
|
# editing is enabled, access to this endpoint will be removed.
|
|
395
395
|
sig do
|
|
@@ -553,6 +553,7 @@ module MetronomeSDK
|
|
|
553
553
|
id: String,
|
|
554
554
|
covering_date: Time,
|
|
555
555
|
effective_before: Time,
|
|
556
|
+
exclude_zero_balances: T::Boolean,
|
|
556
557
|
include_archived: T::Boolean,
|
|
557
558
|
include_balance: T::Boolean,
|
|
558
559
|
include_contract_balances: T::Boolean,
|
|
@@ -574,6 +575,8 @@ module MetronomeSDK
|
|
|
574
575
|
covering_date: nil,
|
|
575
576
|
# Include only balances that have any access before the provided date (exclusive)
|
|
576
577
|
effective_before: nil,
|
|
578
|
+
# Exclude balances with zero amounts from the response.
|
|
579
|
+
exclude_zero_balances: nil,
|
|
577
580
|
# Include archived credits and credits from archived contracts.
|
|
578
581
|
include_archived: nil,
|
|
579
582
|
# Include the balance of credits and commits in the response. Setting this flag
|
|
@@ -736,11 +739,12 @@ module MetronomeSDK
|
|
|
736
739
|
)
|
|
737
740
|
end
|
|
738
741
|
|
|
739
|
-
# Update or
|
|
742
|
+
# Update or add an end date to a contract. Ending a contract early will impact
|
|
740
743
|
# draft usage statements, truncate any terms, and remove upcoming scheduled
|
|
741
744
|
# invoices. Moving the date into the future will only extend the contract length.
|
|
742
|
-
# Terms and scheduled invoices are not extended.
|
|
743
|
-
# has changed or if a perpetual
|
|
745
|
+
# Terms and scheduled invoices are not extended. In-advance subscriptions will not
|
|
746
|
+
# be extended. Use this if a contract's end date has changed or if a perpetual
|
|
747
|
+
# contract ends.
|
|
744
748
|
sig do
|
|
745
749
|
params(
|
|
746
750
|
contract_id: String,
|
|
@@ -4,7 +4,8 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class CreditGrants
|
|
7
|
-
# Create a new credit grant
|
|
7
|
+
# Create a new credit grant. This is a Plans (deprecated) endpoint. New clients
|
|
8
|
+
# should implement using Contracts.
|
|
8
9
|
sig do
|
|
9
10
|
params(
|
|
10
11
|
customer_id: String,
|
|
@@ -65,7 +66,8 @@ module MetronomeSDK
|
|
|
65
66
|
)
|
|
66
67
|
end
|
|
67
68
|
|
|
68
|
-
# List credit grants. This list does not included voided grants.
|
|
69
|
+
# List credit grants. This list does not included voided grants. This is a Plans
|
|
70
|
+
# (deprecated) endpoint. New clients should implement using Contracts.
|
|
69
71
|
sig do
|
|
70
72
|
params(
|
|
71
73
|
limit: Integer,
|
|
@@ -105,7 +107,8 @@ module MetronomeSDK
|
|
|
105
107
|
)
|
|
106
108
|
end
|
|
107
109
|
|
|
108
|
-
# Edit an existing credit grant
|
|
110
|
+
# Edit an existing credit grant. This is a Plans (deprecated) endpoint. New
|
|
111
|
+
# clients should implement using Contracts.
|
|
109
112
|
sig do
|
|
110
113
|
params(
|
|
111
114
|
id: String,
|
|
@@ -130,7 +133,8 @@ module MetronomeSDK
|
|
|
130
133
|
|
|
131
134
|
# Fetches a list of credit ledger entries. Returns lists of ledgers per customer.
|
|
132
135
|
# Ledger entries are returned in chronological order. Ledger entries associated
|
|
133
|
-
# with voided credit grants are not included.
|
|
136
|
+
# with voided credit grants are not included. This is a Plans (deprecated)
|
|
137
|
+
# endpoint. New clients should implement using Contracts.
|
|
134
138
|
sig do
|
|
135
139
|
params(
|
|
136
140
|
next_page: String,
|
|
@@ -170,7 +174,8 @@ module MetronomeSDK
|
|
|
170
174
|
)
|
|
171
175
|
end
|
|
172
176
|
|
|
173
|
-
# Void a credit grant
|
|
177
|
+
# Void a credit grant. This is a Plans (deprecated) endpoint. New clients should
|
|
178
|
+
# implement using Contracts.
|
|
174
179
|
sig do
|
|
175
180
|
params(
|
|
176
181
|
id: String,
|
|
@@ -5,17 +5,26 @@ module MetronomeSDK
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class Alerts
|
|
8
|
-
# Retrieve the real-time evaluation status for a specific
|
|
9
|
-
# This endpoint provides instant visibility into
|
|
10
|
-
#
|
|
11
|
-
# action based on current
|
|
8
|
+
# Retrieve the real-time evaluation status for a specific threshold
|
|
9
|
+
# notification-customer pair. This endpoint provides instant visibility into
|
|
10
|
+
# whether a customer has triggered a threshold notification condition, enabling
|
|
11
|
+
# you to monitor account health and take proactive action based on current
|
|
12
|
+
# threshold notification states.
|
|
12
13
|
#
|
|
13
14
|
# ### Use this endpoint to:
|
|
14
15
|
#
|
|
15
|
-
# - Check if a specific customer is currently violating an
|
|
16
|
+
# - Check if a specific customer is currently violating an threshold notification
|
|
16
17
|
# (`in_alarm` status)
|
|
17
|
-
# - Verify
|
|
18
|
-
#
|
|
18
|
+
# - Verify threshold notification configuration details and threshold values for a
|
|
19
|
+
# customer
|
|
20
|
+
# - Monitor the evaluation state of newly created or recently modified threshold
|
|
21
|
+
# notification
|
|
22
|
+
# - Build dashboards or automated workflows that respond to specific threshold
|
|
23
|
+
# notification conditions
|
|
24
|
+
# - Validate threshold notification behavior before deploying to production
|
|
25
|
+
# customers
|
|
26
|
+
# - Integrate threshold notification status checks into customer support tools or
|
|
27
|
+
# admin interfaces
|
|
19
28
|
#
|
|
20
29
|
# ### Key response fields:
|
|
21
30
|
#
|
|
@@ -24,29 +33,32 @@ module MetronomeSDK
|
|
|
24
33
|
# - `customer_status`: The current evaluation state
|
|
25
34
|
#
|
|
26
35
|
# - `ok` - Customer is within acceptable thresholds
|
|
27
|
-
# - `in_alarm
|
|
28
|
-
# - `evaluating` -
|
|
29
|
-
#
|
|
30
|
-
# - `null` -
|
|
31
|
-
# - `triggered_by`: Additional context about what caused the
|
|
32
|
-
# (when applicable)
|
|
33
|
-
# - alert: Complete
|
|
34
|
-
# -
|
|
36
|
+
# - `in_alarm` - Customer has breached the threshold for the notification
|
|
37
|
+
# - `evaluating` - Notification is currently being evaluated (typically during
|
|
38
|
+
# initial setup)
|
|
39
|
+
# - `null` - Notification has been archived
|
|
40
|
+
# - `triggered_by`: Additional context about what caused the notification to
|
|
41
|
+
# trigger (when applicable)
|
|
42
|
+
# - alert: Complete threshold notification configuration including:
|
|
43
|
+
# - Notification ID, name, and type
|
|
35
44
|
# - Current threshold values and credit type information
|
|
36
|
-
# -
|
|
45
|
+
# - Notification status (enabled, disabled, or archived)
|
|
37
46
|
# - Last update timestamp
|
|
38
47
|
# - Any applied filters (credit grant types, custom fields, group values)
|
|
39
48
|
#
|
|
40
49
|
# ### Usage guidelines:
|
|
41
50
|
#
|
|
42
51
|
# - Customer status: Returns the current evaluation state, not historical data.
|
|
43
|
-
# For
|
|
44
|
-
# -
|
|
45
|
-
#
|
|
46
|
-
# -
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
52
|
+
# For threshold notification history, use webhook notifications or event logs
|
|
53
|
+
# - Required parameters: Both customer_id and alert_id must be valid UUIDs that
|
|
54
|
+
# exist in your organization
|
|
55
|
+
# - Archived notifications: Returns null for customer_status if the notification
|
|
56
|
+
# has been archived, but still includes the notification configuration details
|
|
57
|
+
# - Performance considerations: This endpoint queries live evaluation state,
|
|
58
|
+
# making it ideal for real-time monitoring but not for bulk status checks
|
|
59
|
+
# - Integration patterns: Best used for on-demand status checks in response to
|
|
60
|
+
# user actions or as part of targeted monitoring workflows
|
|
61
|
+
# - Error handling: Returns 404 if either the customer or alert_id doesn't exist
|
|
50
62
|
# or isn't accessible to your organization
|
|
51
63
|
sig do
|
|
52
64
|
params(
|
|
@@ -64,45 +76,51 @@ module MetronomeSDK
|
|
|
64
76
|
)
|
|
65
77
|
end
|
|
66
78
|
def retrieve(
|
|
67
|
-
# The Metronome ID of the
|
|
79
|
+
# The Metronome ID of the threshold notification
|
|
68
80
|
alert_id:,
|
|
69
81
|
# The Metronome ID of the customer
|
|
70
82
|
customer_id:,
|
|
71
|
-
# Only present for `spend_threshold_reached`
|
|
72
|
-
# specific group key-value pair.
|
|
83
|
+
# Only present for `spend_threshold_reached` notifications. Retrieve the
|
|
84
|
+
# notification for a specific group key-value pair.
|
|
73
85
|
group_values: nil,
|
|
74
|
-
# When parallel
|
|
75
|
-
# fetch
|
|
86
|
+
# When parallel threshold notifications are enabled during migration, this flag
|
|
87
|
+
# denotes whether to fetch notifications for plans or contracts.
|
|
76
88
|
plans_or_contracts: nil,
|
|
77
89
|
request_options: {}
|
|
78
90
|
)
|
|
79
91
|
end
|
|
80
92
|
|
|
81
|
-
# Retrieve all
|
|
82
|
-
# customer in a single API call. This endpoint provides a
|
|
83
|
-
# all
|
|
93
|
+
# Retrieve all threshold notification configurations and their current statuses
|
|
94
|
+
# for a specific customer in a single API call. This endpoint provides a
|
|
95
|
+
# comprehensive view of all threshold notification monitoring a customer account.
|
|
84
96
|
#
|
|
85
97
|
# ### Use this endpoint to:
|
|
86
98
|
#
|
|
87
|
-
# - Display all active
|
|
88
|
-
#
|
|
89
|
-
# -
|
|
90
|
-
#
|
|
99
|
+
# - Display all active threshold notifications for a customer in dashboards or
|
|
100
|
+
# admin panels
|
|
101
|
+
# - Quickly identify which threshold notifications a customer is currently
|
|
102
|
+
# triggering
|
|
103
|
+
# - Audit threshold notification coverage for specific accounts
|
|
104
|
+
# - Filter threshold notifications by status (enabled, disabled, or archived)
|
|
91
105
|
#
|
|
92
106
|
# ### Key response fields:
|
|
93
107
|
#
|
|
94
108
|
# - data: Array of CustomerAlert objects, each containing:
|
|
95
109
|
# - Current evaluation status (`ok`, `in_alarm`, `evaluating`, or `null`)
|
|
96
|
-
# - Complete
|
|
97
|
-
# -
|
|
98
|
-
# -
|
|
110
|
+
# - Complete threshold notification configuration and threshold details
|
|
111
|
+
# - Threshold notification metadata including type, name, and last update time
|
|
112
|
+
# - next_page: Pagination cursor for retrieving additional results
|
|
99
113
|
#
|
|
100
114
|
# ### Usage guidelines:
|
|
101
115
|
#
|
|
102
|
-
# - Default behavior: Returns only enabled
|
|
103
|
-
# specified
|
|
116
|
+
# - Default behavior: Returns only enabled threshold notifications unless
|
|
117
|
+
# `alert_statuses` filter is specified
|
|
104
118
|
# - Pagination: Use the `next_page` cursor to retrieve all results for customers
|
|
105
|
-
# with many
|
|
119
|
+
# with many notifications
|
|
120
|
+
# - Performance: Efficiently retrieves multiple threshold notification statuses in
|
|
121
|
+
# a single request instead of making individual calls
|
|
122
|
+
# - Filtering: Pass the `alert_statuses` array to include disabled or archived
|
|
123
|
+
# threshold notifications in results
|
|
106
124
|
sig do
|
|
107
125
|
params(
|
|
108
126
|
customer_id: String,
|
|
@@ -123,30 +141,31 @@ module MetronomeSDK
|
|
|
123
141
|
customer_id:,
|
|
124
142
|
# Query param: Cursor that indicates where the next page of results should start.
|
|
125
143
|
next_page: nil,
|
|
126
|
-
# Body param: Optionally filter by
|
|
127
|
-
# will be returned.
|
|
144
|
+
# Body param: Optionally filter by threshold notification status. If absent, only
|
|
145
|
+
# enabled notifications will be returned.
|
|
128
146
|
alert_statuses: nil,
|
|
129
147
|
request_options: {}
|
|
130
148
|
)
|
|
131
149
|
end
|
|
132
150
|
|
|
133
|
-
# Force an immediate re-evaluation of a specific
|
|
134
|
-
# any previous state and triggering a fresh assessment against
|
|
135
|
-
# This endpoint ensures
|
|
136
|
-
# corrections.
|
|
151
|
+
# Force an immediate re-evaluation of a specific threshold notification for a
|
|
152
|
+
# customer, clearing any previous state and triggering a fresh assessment against
|
|
153
|
+
# current thresholds. This endpoint ensures threshold notification accuracy after
|
|
154
|
+
# configuration changes or data corrections.
|
|
137
155
|
#
|
|
138
156
|
# ### Use this endpoint to:
|
|
139
157
|
#
|
|
140
|
-
# - Clear false positive
|
|
141
|
-
# - Re-evaluate
|
|
142
|
-
#
|
|
143
|
-
# -
|
|
158
|
+
# - Clear false positive threshold notifications after fixing data issues
|
|
159
|
+
# - Re-evaluate threshold notifications after adjusting customer balances or
|
|
160
|
+
# credits
|
|
161
|
+
# - Test threshold notification behavior during development and debugging
|
|
162
|
+
# - Resolve stuck threshold notification that may be in an incorrect state
|
|
144
163
|
# - Trigger immediate evaluation after threshold modifications
|
|
145
164
|
#
|
|
146
165
|
# ### Key response fields:
|
|
147
166
|
#
|
|
148
|
-
# - 200 Success: Confirmation that the
|
|
149
|
-
# initiated
|
|
167
|
+
# - 200 Success: Confirmation that the threshold notification has been reset and
|
|
168
|
+
# re-evaluation initiated
|
|
150
169
|
# - No response body is returned - the operation completes asynchronously
|
|
151
170
|
#
|
|
152
171
|
# ### Usage guidelines:
|
|
@@ -166,7 +185,7 @@ module MetronomeSDK
|
|
|
166
185
|
).void
|
|
167
186
|
end
|
|
168
187
|
def reset(
|
|
169
|
-
# The Metronome ID of the
|
|
188
|
+
# The Metronome ID of the threshold notification
|
|
170
189
|
alert_id:,
|
|
171
190
|
# The Metronome ID of the customer
|
|
172
191
|
customer_id:,
|
|
@@ -5,7 +5,8 @@ module MetronomeSDK
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class BillingConfig
|
|
8
|
-
# Set the billing configuration for a given customer.
|
|
8
|
+
# Set the billing configuration for a given customer. This is a Plans (deprecated)
|
|
9
|
+
# endpoint. New clients should implement using Contracts.
|
|
9
10
|
sig do
|
|
10
11
|
params(
|
|
11
12
|
customer_id: String,
|
|
@@ -32,13 +33,15 @@ module MetronomeSDK
|
|
|
32
33
|
aws_product_code: nil,
|
|
33
34
|
# Body param:
|
|
34
35
|
aws_region: nil,
|
|
35
|
-
# Body param:
|
|
36
|
+
# Body param: The collection method for the customer's invoices. NOTE:
|
|
37
|
+
# `auto_charge_payment_intent` and `manually_charge_payment_intent` are in beta.
|
|
36
38
|
stripe_collection_method: nil,
|
|
37
39
|
request_options: {}
|
|
38
40
|
)
|
|
39
41
|
end
|
|
40
42
|
|
|
41
|
-
# Fetch the billing configuration for the given customer.
|
|
43
|
+
# Fetch the billing configuration for the given customer. This is a Plans
|
|
44
|
+
# (deprecated) endpoint. New clients should implement using Contracts.
|
|
42
45
|
sig do
|
|
43
46
|
params(
|
|
44
47
|
customer_id: String,
|
|
@@ -58,7 +61,8 @@ module MetronomeSDK
|
|
|
58
61
|
end
|
|
59
62
|
|
|
60
63
|
# Delete the billing configuration for a given customer. Note: this is unsupported
|
|
61
|
-
# for Azure and AWS Marketplace customers.
|
|
64
|
+
# for Azure and AWS Marketplace customers. This is a Plans (deprecated) endpoint.
|
|
65
|
+
# New clients should implement using Contracts.
|
|
62
66
|
sig do
|
|
63
67
|
params(
|
|
64
68
|
customer_id: String,
|
|
@@ -34,7 +34,8 @@ module MetronomeSDK
|
|
|
34
34
|
# #### Billing configuration:
|
|
35
35
|
#
|
|
36
36
|
# - invoice_contract_id is required for postpaid commits and for prepaid commits
|
|
37
|
-
# with billing (only optional for free prepaid commits)
|
|
37
|
+
# with billing (only optional for free prepaid commits) unless do_not_invoice is
|
|
38
|
+
# set to true
|
|
38
39
|
# - For postpaid commits: access_schedule and invoice_schedule must have matching
|
|
39
40
|
# amounts
|
|
40
41
|
# - For postpaid commits: only one schedule item is allowed in both schedules.
|
|
@@ -123,7 +124,7 @@ module MetronomeSDK
|
|
|
123
124
|
description: nil,
|
|
124
125
|
# The contract that this commit will be billed on. This is required for "POSTPAID"
|
|
125
126
|
# commits and for "PREPAID" commits unless there is no invoice schedule above
|
|
126
|
-
# (i.e., the commit is 'free').
|
|
127
|
+
# (i.e., the commit is 'free'), or if do_not_invoice is set to true.
|
|
127
128
|
invoice_contract_id: nil,
|
|
128
129
|
# Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
129
130
|
# time and only one schedule item is allowed; the total must match
|
|
@@ -159,7 +159,8 @@ module MetronomeSDK
|
|
|
159
159
|
)
|
|
160
160
|
end
|
|
161
161
|
|
|
162
|
-
# Add a one time charge to the specified invoice
|
|
162
|
+
# Add a one time charge to the specified invoice. This is a Plans (deprecated)
|
|
163
|
+
# endpoint. New clients should implement using Contracts.
|
|
163
164
|
sig do
|
|
164
165
|
params(
|
|
165
166
|
customer_id: String,
|
|
@@ -287,6 +288,42 @@ module MetronomeSDK
|
|
|
287
288
|
)
|
|
288
289
|
end
|
|
289
290
|
|
|
291
|
+
# Retrieve a PDF version of a specific invoice by its unique identifier. This
|
|
292
|
+
# endpoint generates a professionally formatted invoice document suitable for
|
|
293
|
+
# sharing with customers, accounting teams, or for record-keeping purposes.
|
|
294
|
+
#
|
|
295
|
+
# ### Use this endpoint to:
|
|
296
|
+
#
|
|
297
|
+
# - Provide customers with downloadable or emailable copies of their invoices
|
|
298
|
+
# - Support accounting and finance teams with official billing documents
|
|
299
|
+
# - Maintain accurate records of billing transactions for audits and compliance
|
|
300
|
+
#
|
|
301
|
+
# ### Key response details:
|
|
302
|
+
#
|
|
303
|
+
# - The response is a binary PDF file representing the full invoice
|
|
304
|
+
# - The PDF includes all standard invoice information such as line items, totals,
|
|
305
|
+
# billing period, and customer details
|
|
306
|
+
# - The document is formatted for clarity and professionalism, suitable for
|
|
307
|
+
# official use
|
|
308
|
+
#
|
|
309
|
+
# ### Usage guidelines:
|
|
310
|
+
#
|
|
311
|
+
# - Ensure the `invoice_id` corresponds to an existing invoice for the specified
|
|
312
|
+
# `customer_id`
|
|
313
|
+
# - The PDF is generated on-demand; frequent requests for the same invoice may
|
|
314
|
+
# impact performance
|
|
315
|
+
# - Use appropriate headers to handle the binary response in your application
|
|
316
|
+
# (e.g., setting `Content-Type: application/pdf`)
|
|
317
|
+
sig do
|
|
318
|
+
params(
|
|
319
|
+
customer_id: String,
|
|
320
|
+
invoice_id: String,
|
|
321
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
322
|
+
).returns(StringIO)
|
|
323
|
+
end
|
|
324
|
+
def retrieve_pdf(customer_id:, invoice_id:, request_options: {})
|
|
325
|
+
end
|
|
326
|
+
|
|
290
327
|
# @api private
|
|
291
328
|
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
292
329
|
def self.new(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
|
sig do
|
|
10
11
|
params(
|
|
11
12
|
customer_id: String,
|
|
@@ -31,7 +32,8 @@ module MetronomeSDK
|
|
|
31
32
|
|
|
32
33
|
# Associate an existing customer with a plan for a specified date range. See the
|
|
33
34
|
# [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
34
|
-
# for details on the price adjustments.
|
|
35
|
+
# for details on the price adjustments. This is a Plans (deprecated) endpoint. New
|
|
36
|
+
# clients should implement using Contracts.
|
|
35
37
|
sig do
|
|
36
38
|
params(
|
|
37
39
|
customer_id: String,
|
|
@@ -82,7 +84,8 @@ module MetronomeSDK
|
|
|
82
84
|
)
|
|
83
85
|
end
|
|
84
86
|
|
|
85
|
-
# Change the end date of a customer's plan.
|
|
87
|
+
# Change the end date of a customer's plan. This is a Plans (deprecated) endpoint.
|
|
88
|
+
# New clients should implement using Contracts.
|
|
86
89
|
sig do
|
|
87
90
|
params(
|
|
88
91
|
customer_id: String,
|
|
@@ -116,7 +119,8 @@ module MetronomeSDK
|
|
|
116
119
|
|
|
117
120
|
# Lists a customer plans adjustments. See the
|
|
118
121
|
# [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
119
|
-
# for details.
|
|
122
|
+
# for details. This is a Plans (deprecated) endpoint. New clients should implement
|
|
123
|
+
# using Contracts.
|
|
120
124
|
sig do
|
|
121
125
|
params(
|
|
122
126
|
customer_id: String,
|