metronome-sdk 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +55 -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 +7 -10
- 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_v2.rb +256 -6
- data/lib/metronome_sdk/models/contract_without_amendments.rb +2 -2
- data/lib/metronome_sdk/models/hierarchy_configuration.rb +99 -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 +85 -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 +101 -3
- data/lib/metronome_sdk/models/v1/customer_detail.rb +9 -1
- data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +5 -15
- data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
- 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/customer_alert.rb +40 -38
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +136 -18
- data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
- data/lib/metronome_sdk/models/v1/payment.rb +151 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
- data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
- data/lib/metronome_sdk/models/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 +186 -3
- 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 +4 -3
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +70 -51
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +55 -0
- data/lib/metronome_sdk/resources/v1/customers.rb +7 -4
- data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
- data/lib/metronome_sdk/resources/v1/usage.rb +4 -2
- data/lib/metronome_sdk/resources/v1.rb +4 -0
- data/lib/metronome_sdk/resources/v2/contracts.rb +9 -3
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +9 -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_v2.rbi +603 -10
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +2 -2
- data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +250 -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 +175 -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 +257 -4
- data/rbi/metronome_sdk/models/v1/customer_detail.rbi +8 -0
- data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
- data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
- data/rbi/metronome_sdk/models/v1/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/customer_alert.rbi +48 -44
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +246 -58
- data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
- data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
- data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
- data/rbi/metronome_sdk/models/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 +498 -6
- 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 +4 -3
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +73 -54
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +36 -0
- data/rbi/metronome_sdk/resources/v1/customers.rbi +7 -4
- data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
- data/rbi/metronome_sdk/resources/v1/usage.rbi +4 -2
- data/rbi/metronome_sdk/resources/v1.rbi +3 -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_v2.rbs +239 -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/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/customers/invoice.rbs +137 -24
- data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
- data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
- data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
- data/sig/metronome_sdk/models/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 +182 -7
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +221 -18
- 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.rbs +2 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +3 -0
- metadata +29 -2
|
@@ -15,39 +15,41 @@ module MetronomeSDK
|
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
# Type of the
|
|
18
|
+
# Type of the threshold notification
|
|
19
19
|
sig do
|
|
20
20
|
returns(MetronomeSDK::V1::AlertCreateParams::AlertType::OrSymbol)
|
|
21
21
|
end
|
|
22
22
|
attr_accessor :alert_type
|
|
23
23
|
|
|
24
|
-
# Name of the
|
|
24
|
+
# Name of the threshold notification
|
|
25
25
|
sig { returns(String) }
|
|
26
26
|
attr_accessor :name
|
|
27
27
|
|
|
28
|
-
# Threshold value of the
|
|
29
|
-
# may represent a financial amount, the days remaining, or a
|
|
28
|
+
# Threshold value of the notification policy. Depending upon the notification
|
|
29
|
+
# type, this number may represent a financial amount, the days remaining, or a
|
|
30
|
+
# percentage reached.
|
|
30
31
|
sig { returns(Float) }
|
|
31
32
|
attr_accessor :threshold
|
|
32
33
|
|
|
33
|
-
# For
|
|
34
|
-
# track the usage for.
|
|
34
|
+
# For threshold notifications of type `usage_threshold_reached`, specifies which
|
|
35
|
+
# billable metric to track the usage for.
|
|
35
36
|
sig { returns(T.nilable(String)) }
|
|
36
37
|
attr_reader :billable_metric_id
|
|
37
38
|
|
|
38
39
|
sig { params(billable_metric_id: String).void }
|
|
39
40
|
attr_writer :billable_metric_id
|
|
40
41
|
|
|
41
|
-
# An array of strings, representing a way to filter the credit grant this
|
|
42
|
-
# applies to, by looking at the credit_grant_type field on
|
|
43
|
-
# field is only defined for CreditPercentage and
|
|
42
|
+
# An array of strings, representing a way to filter the credit grant this
|
|
43
|
+
# threshold notification applies to, by looking at the credit_grant_type field on
|
|
44
|
+
# the credit grant. This field is only defined for CreditPercentage and
|
|
45
|
+
# CreditBalance notifications
|
|
44
46
|
sig { returns(T.nilable(T::Array[String])) }
|
|
45
47
|
attr_reader :credit_grant_type_filters
|
|
46
48
|
|
|
47
49
|
sig { params(credit_grant_type_filters: T::Array[String]).void }
|
|
48
50
|
attr_writer :credit_grant_type_filters
|
|
49
51
|
|
|
50
|
-
# ID of the credit's currency, defaults to USD. If the specific
|
|
52
|
+
# ID of the credit's currency, defaults to USD. If the specific notification type
|
|
51
53
|
# requires a pricing unit/currency, find the ID in the
|
|
52
54
|
# [Metronome app](https://app.metronome.com/offering/pricing-units).
|
|
53
55
|
sig { returns(T.nilable(String)) }
|
|
@@ -56,8 +58,8 @@ module MetronomeSDK
|
|
|
56
58
|
sig { params(credit_type_id: String).void }
|
|
57
59
|
attr_writer :credit_type_id
|
|
58
60
|
|
|
59
|
-
# A list of custom field filters for
|
|
60
|
-
# Only present for contract invoices.
|
|
61
|
+
# A list of custom field filters for threshold notification types that support
|
|
62
|
+
# advanced filtering. Only present for contract invoices.
|
|
61
63
|
sig do
|
|
62
64
|
returns(
|
|
63
65
|
T.nilable(
|
|
@@ -77,25 +79,25 @@ module MetronomeSDK
|
|
|
77
79
|
end
|
|
78
80
|
attr_writer :custom_field_filters
|
|
79
81
|
|
|
80
|
-
# If provided, will create this
|
|
81
|
-
#
|
|
82
|
+
# If provided, will create this threshold notification for this specific customer.
|
|
83
|
+
# To create a notification for all customers, do not specify a `customer_id`.
|
|
82
84
|
sig { returns(T.nilable(String)) }
|
|
83
85
|
attr_reader :customer_id
|
|
84
86
|
|
|
85
87
|
sig { params(customer_id: String).void }
|
|
86
88
|
attr_writer :customer_id
|
|
87
89
|
|
|
88
|
-
# If true, the
|
|
89
|
-
#
|
|
90
|
-
# trigger the
|
|
90
|
+
# If true, the threshold notification will evaluate immediately on customers that
|
|
91
|
+
# already meet the notification threshold. If false, it will only evaluate on
|
|
92
|
+
# future customers that trigger the threshold. Defaults to true.
|
|
91
93
|
sig { returns(T.nilable(T::Boolean)) }
|
|
92
94
|
attr_reader :evaluate_on_create
|
|
93
95
|
|
|
94
96
|
sig { params(evaluate_on_create: T::Boolean).void }
|
|
95
97
|
attr_writer :evaluate_on_create
|
|
96
98
|
|
|
97
|
-
# Only present for `spend_threshold_reached`
|
|
98
|
-
# group key on individual line items.
|
|
99
|
+
# Only present for `spend_threshold_reached` notifications. Scope notification to
|
|
100
|
+
# a specific group key on individual line items.
|
|
99
101
|
sig do
|
|
100
102
|
returns(
|
|
101
103
|
T.nilable(T::Array[MetronomeSDK::V1::AlertCreateParams::GroupValue])
|
|
@@ -111,16 +113,16 @@ module MetronomeSDK
|
|
|
111
113
|
end
|
|
112
114
|
attr_writer :group_values
|
|
113
115
|
|
|
114
|
-
# Only supported for invoice_total_reached
|
|
115
|
-
# evaluate.
|
|
116
|
+
# Only supported for invoice_total_reached threshold notifications. A list of
|
|
117
|
+
# invoice types to evaluate.
|
|
116
118
|
sig { returns(T.nilable(T::Array[String])) }
|
|
117
119
|
attr_reader :invoice_types_filter
|
|
118
120
|
|
|
119
121
|
sig { params(invoice_types_filter: T::Array[String]).void }
|
|
120
122
|
attr_writer :invoice_types_filter
|
|
121
123
|
|
|
122
|
-
# If provided, will create this
|
|
123
|
-
# for all customers, do not specify a `plan_id`.
|
|
124
|
+
# If provided, will create this threshold notification for this specific plan. To
|
|
125
|
+
# create a notification for all customers, do not specify a `plan_id`.
|
|
124
126
|
sig { returns(T.nilable(String)) }
|
|
125
127
|
attr_reader :plan_id
|
|
126
128
|
|
|
@@ -160,42 +162,44 @@ module MetronomeSDK
|
|
|
160
162
|
).returns(T.attached_class)
|
|
161
163
|
end
|
|
162
164
|
def self.new(
|
|
163
|
-
# Type of the
|
|
165
|
+
# Type of the threshold notification
|
|
164
166
|
alert_type:,
|
|
165
|
-
# Name of the
|
|
167
|
+
# Name of the threshold notification
|
|
166
168
|
name:,
|
|
167
|
-
# Threshold value of the
|
|
168
|
-
# may represent a financial amount, the days remaining, or a
|
|
169
|
+
# Threshold value of the notification policy. Depending upon the notification
|
|
170
|
+
# type, this number may represent a financial amount, the days remaining, or a
|
|
171
|
+
# percentage reached.
|
|
169
172
|
threshold:,
|
|
170
|
-
# For
|
|
171
|
-
# track the usage for.
|
|
173
|
+
# For threshold notifications of type `usage_threshold_reached`, specifies which
|
|
174
|
+
# billable metric to track the usage for.
|
|
172
175
|
billable_metric_id: nil,
|
|
173
|
-
# An array of strings, representing a way to filter the credit grant this
|
|
174
|
-
# applies to, by looking at the credit_grant_type field on
|
|
175
|
-
# field is only defined for CreditPercentage and
|
|
176
|
+
# An array of strings, representing a way to filter the credit grant this
|
|
177
|
+
# threshold notification applies to, by looking at the credit_grant_type field on
|
|
178
|
+
# the credit grant. This field is only defined for CreditPercentage and
|
|
179
|
+
# CreditBalance notifications
|
|
176
180
|
credit_grant_type_filters: nil,
|
|
177
|
-
# ID of the credit's currency, defaults to USD. If the specific
|
|
181
|
+
# ID of the credit's currency, defaults to USD. If the specific notification type
|
|
178
182
|
# requires a pricing unit/currency, find the ID in the
|
|
179
183
|
# [Metronome app](https://app.metronome.com/offering/pricing-units).
|
|
180
184
|
credit_type_id: nil,
|
|
181
|
-
# A list of custom field filters for
|
|
182
|
-
# Only present for contract invoices.
|
|
185
|
+
# A list of custom field filters for threshold notification types that support
|
|
186
|
+
# advanced filtering. Only present for contract invoices.
|
|
183
187
|
custom_field_filters: nil,
|
|
184
|
-
# If provided, will create this
|
|
185
|
-
#
|
|
188
|
+
# If provided, will create this threshold notification for this specific customer.
|
|
189
|
+
# To create a notification for all customers, do not specify a `customer_id`.
|
|
186
190
|
customer_id: nil,
|
|
187
|
-
# If true, the
|
|
188
|
-
#
|
|
189
|
-
# trigger the
|
|
191
|
+
# If true, the threshold notification will evaluate immediately on customers that
|
|
192
|
+
# already meet the notification threshold. If false, it will only evaluate on
|
|
193
|
+
# future customers that trigger the threshold. Defaults to true.
|
|
190
194
|
evaluate_on_create: nil,
|
|
191
|
-
# Only present for `spend_threshold_reached`
|
|
192
|
-
# group key on individual line items.
|
|
195
|
+
# Only present for `spend_threshold_reached` notifications. Scope notification to
|
|
196
|
+
# a specific group key on individual line items.
|
|
193
197
|
group_values: nil,
|
|
194
|
-
# Only supported for invoice_total_reached
|
|
195
|
-
# evaluate.
|
|
198
|
+
# Only supported for invoice_total_reached threshold notifications. A list of
|
|
199
|
+
# invoice types to evaluate.
|
|
196
200
|
invoice_types_filter: nil,
|
|
197
|
-
# If provided, will create this
|
|
198
|
-
# for all customers, do not specify a `plan_id`.
|
|
201
|
+
# If provided, will create this threshold notification for this specific plan. To
|
|
202
|
+
# create a notification for all customers, do not specify a `plan_id`.
|
|
199
203
|
plan_id: nil,
|
|
200
204
|
# Prevents the creation of duplicates. If a request to create a record is made
|
|
201
205
|
# with a previously used uniqueness key, a new record will not be created and the
|
|
@@ -233,7 +237,7 @@ module MetronomeSDK
|
|
|
233
237
|
def to_hash
|
|
234
238
|
end
|
|
235
239
|
|
|
236
|
-
# Type of the
|
|
240
|
+
# Type of the threshold notification
|
|
237
241
|
module AlertType
|
|
238
242
|
extend MetronomeSDK::Internal::Type::Enum
|
|
239
243
|
|
|
@@ -1469,6 +1469,11 @@ module MetronomeSDK
|
|
|
1469
1469
|
:ANROK,
|
|
1470
1470
|
MetronomeSDK::V1::ContractAmendParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
|
|
1471
1471
|
)
|
|
1472
|
+
AVALARA =
|
|
1473
|
+
T.let(
|
|
1474
|
+
:AVALARA,
|
|
1475
|
+
MetronomeSDK::V1::ContractAmendParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
|
|
1476
|
+
)
|
|
1472
1477
|
PRECALCULATED =
|
|
1473
1478
|
T.let(
|
|
1474
1479
|
:PRECALCULATED,
|
|
@@ -2011,6 +2011,11 @@ module MetronomeSDK
|
|
|
2011
2011
|
:ANROK,
|
|
2012
2012
|
MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
|
|
2013
2013
|
)
|
|
2014
|
+
AVALARA =
|
|
2015
|
+
T.let(
|
|
2016
|
+
:AVALARA,
|
|
2017
|
+
MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
|
|
2018
|
+
)
|
|
2014
2019
|
PRECALCULATED =
|
|
2015
2020
|
T.let(
|
|
2016
2021
|
:PRECALCULATED,
|
|
@@ -2888,7 +2893,9 @@ module MetronomeSDK
|
|
|
2888
2893
|
|
|
2889
2894
|
sig do
|
|
2890
2895
|
returns(
|
|
2891
|
-
|
|
2896
|
+
T.nilable(
|
|
2897
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Parent
|
|
2898
|
+
)
|
|
2892
2899
|
)
|
|
2893
2900
|
end
|
|
2894
2901
|
attr_reader :parent
|
|
@@ -2901,20 +2908,98 @@ module MetronomeSDK
|
|
|
2901
2908
|
end
|
|
2902
2909
|
attr_writer :parent
|
|
2903
2910
|
|
|
2911
|
+
sig do
|
|
2912
|
+
returns(
|
|
2913
|
+
T.nilable(
|
|
2914
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior
|
|
2915
|
+
)
|
|
2916
|
+
)
|
|
2917
|
+
end
|
|
2918
|
+
attr_reader :parent_behavior
|
|
2919
|
+
|
|
2920
|
+
sig do
|
|
2921
|
+
params(
|
|
2922
|
+
parent_behavior:
|
|
2923
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::OrHash
|
|
2924
|
+
).void
|
|
2925
|
+
end
|
|
2926
|
+
attr_writer :parent_behavior
|
|
2927
|
+
|
|
2928
|
+
# Indicates whether the parent should pay for the child's invoice charges
|
|
2929
|
+
sig do
|
|
2930
|
+
returns(
|
|
2931
|
+
T.nilable(
|
|
2932
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer::OrSymbol
|
|
2933
|
+
)
|
|
2934
|
+
)
|
|
2935
|
+
end
|
|
2936
|
+
attr_reader :payer
|
|
2937
|
+
|
|
2938
|
+
sig do
|
|
2939
|
+
params(
|
|
2940
|
+
payer:
|
|
2941
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer::OrSymbol
|
|
2942
|
+
).void
|
|
2943
|
+
end
|
|
2944
|
+
attr_writer :payer
|
|
2945
|
+
|
|
2946
|
+
# Indicates the behavior of the child's invoice statements on the parent's
|
|
2947
|
+
# invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
2948
|
+
# consolidated invoices **SEPARATE**: Child's invoice statements will appear not
|
|
2949
|
+
# appear on parent's consolidated invoices
|
|
2950
|
+
sig do
|
|
2951
|
+
returns(
|
|
2952
|
+
T.nilable(
|
|
2953
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior::OrSymbol
|
|
2954
|
+
)
|
|
2955
|
+
)
|
|
2956
|
+
end
|
|
2957
|
+
attr_reader :usage_statement_behavior
|
|
2958
|
+
|
|
2959
|
+
sig do
|
|
2960
|
+
params(
|
|
2961
|
+
usage_statement_behavior:
|
|
2962
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior::OrSymbol
|
|
2963
|
+
).void
|
|
2964
|
+
end
|
|
2965
|
+
attr_writer :usage_statement_behavior
|
|
2966
|
+
|
|
2904
2967
|
sig do
|
|
2905
2968
|
params(
|
|
2906
2969
|
parent:
|
|
2907
|
-
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Parent::OrHash
|
|
2970
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Parent::OrHash,
|
|
2971
|
+
parent_behavior:
|
|
2972
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::OrHash,
|
|
2973
|
+
payer:
|
|
2974
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer::OrSymbol,
|
|
2975
|
+
usage_statement_behavior:
|
|
2976
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior::OrSymbol
|
|
2908
2977
|
).returns(T.attached_class)
|
|
2909
2978
|
end
|
|
2910
|
-
def self.new(
|
|
2979
|
+
def self.new(
|
|
2980
|
+
parent: nil,
|
|
2981
|
+
parent_behavior: nil,
|
|
2982
|
+
# Indicates whether the parent should pay for the child's invoice charges
|
|
2983
|
+
payer: nil,
|
|
2984
|
+
# Indicates the behavior of the child's invoice statements on the parent's
|
|
2985
|
+
# invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
2986
|
+
# consolidated invoices **SEPARATE**: Child's invoice statements will appear not
|
|
2987
|
+
# appear on parent's consolidated invoices
|
|
2988
|
+
usage_statement_behavior: nil
|
|
2989
|
+
)
|
|
2911
2990
|
end
|
|
2912
2991
|
|
|
2913
2992
|
sig do
|
|
2914
2993
|
override.returns(
|
|
2915
2994
|
{
|
|
2916
2995
|
parent:
|
|
2917
|
-
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Parent
|
|
2996
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Parent,
|
|
2997
|
+
parent_behavior:
|
|
2998
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior,
|
|
2999
|
+
payer:
|
|
3000
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer::OrSymbol,
|
|
3001
|
+
usage_statement_behavior:
|
|
3002
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior::OrSymbol
|
|
2918
3003
|
}
|
|
2919
3004
|
)
|
|
2920
3005
|
end
|
|
@@ -2950,6 +3035,174 @@ module MetronomeSDK
|
|
|
2950
3035
|
def to_hash
|
|
2951
3036
|
end
|
|
2952
3037
|
end
|
|
3038
|
+
|
|
3039
|
+
class ParentBehavior < MetronomeSDK::Internal::Type::BaseModel
|
|
3040
|
+
OrHash =
|
|
3041
|
+
T.type_alias do
|
|
3042
|
+
T.any(
|
|
3043
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior,
|
|
3044
|
+
MetronomeSDK::Internal::AnyHash
|
|
3045
|
+
)
|
|
3046
|
+
end
|
|
3047
|
+
|
|
3048
|
+
# Indicates the desired behavior of consolidated invoices generated by the parent
|
|
3049
|
+
# in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
|
|
3050
|
+
# customers will be appended to the consolidated invoice **NONE**: Do not generate
|
|
3051
|
+
# consolidated invoices
|
|
3052
|
+
sig do
|
|
3053
|
+
returns(
|
|
3054
|
+
T.nilable(
|
|
3055
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType::OrSymbol
|
|
3056
|
+
)
|
|
3057
|
+
)
|
|
3058
|
+
end
|
|
3059
|
+
attr_reader :invoice_consolidation_type
|
|
3060
|
+
|
|
3061
|
+
sig do
|
|
3062
|
+
params(
|
|
3063
|
+
invoice_consolidation_type:
|
|
3064
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType::OrSymbol
|
|
3065
|
+
).void
|
|
3066
|
+
end
|
|
3067
|
+
attr_writer :invoice_consolidation_type
|
|
3068
|
+
|
|
3069
|
+
sig do
|
|
3070
|
+
params(
|
|
3071
|
+
invoice_consolidation_type:
|
|
3072
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType::OrSymbol
|
|
3073
|
+
).returns(T.attached_class)
|
|
3074
|
+
end
|
|
3075
|
+
def self.new(
|
|
3076
|
+
# Indicates the desired behavior of consolidated invoices generated by the parent
|
|
3077
|
+
# in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
|
|
3078
|
+
# customers will be appended to the consolidated invoice **NONE**: Do not generate
|
|
3079
|
+
# consolidated invoices
|
|
3080
|
+
invoice_consolidation_type: nil
|
|
3081
|
+
)
|
|
3082
|
+
end
|
|
3083
|
+
|
|
3084
|
+
sig do
|
|
3085
|
+
override.returns(
|
|
3086
|
+
{
|
|
3087
|
+
invoice_consolidation_type:
|
|
3088
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType::OrSymbol
|
|
3089
|
+
}
|
|
3090
|
+
)
|
|
3091
|
+
end
|
|
3092
|
+
def to_hash
|
|
3093
|
+
end
|
|
3094
|
+
|
|
3095
|
+
# Indicates the desired behavior of consolidated invoices generated by the parent
|
|
3096
|
+
# in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
|
|
3097
|
+
# customers will be appended to the consolidated invoice **NONE**: Do not generate
|
|
3098
|
+
# consolidated invoices
|
|
3099
|
+
module InvoiceConsolidationType
|
|
3100
|
+
extend MetronomeSDK::Internal::Type::Enum
|
|
3101
|
+
|
|
3102
|
+
TaggedSymbol =
|
|
3103
|
+
T.type_alias do
|
|
3104
|
+
T.all(
|
|
3105
|
+
Symbol,
|
|
3106
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType
|
|
3107
|
+
)
|
|
3108
|
+
end
|
|
3109
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
3110
|
+
|
|
3111
|
+
CONCATENATE =
|
|
3112
|
+
T.let(
|
|
3113
|
+
:CONCATENATE,
|
|
3114
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType::TaggedSymbol
|
|
3115
|
+
)
|
|
3116
|
+
NONE =
|
|
3117
|
+
T.let(
|
|
3118
|
+
:NONE,
|
|
3119
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType::TaggedSymbol
|
|
3120
|
+
)
|
|
3121
|
+
|
|
3122
|
+
sig do
|
|
3123
|
+
override.returns(
|
|
3124
|
+
T::Array[
|
|
3125
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType::TaggedSymbol
|
|
3126
|
+
]
|
|
3127
|
+
)
|
|
3128
|
+
end
|
|
3129
|
+
def self.values
|
|
3130
|
+
end
|
|
3131
|
+
end
|
|
3132
|
+
end
|
|
3133
|
+
|
|
3134
|
+
# Indicates whether the parent should pay for the child's invoice charges
|
|
3135
|
+
module Payer
|
|
3136
|
+
extend MetronomeSDK::Internal::Type::Enum
|
|
3137
|
+
|
|
3138
|
+
TaggedSymbol =
|
|
3139
|
+
T.type_alias do
|
|
3140
|
+
T.all(
|
|
3141
|
+
Symbol,
|
|
3142
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer
|
|
3143
|
+
)
|
|
3144
|
+
end
|
|
3145
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
3146
|
+
|
|
3147
|
+
SELF =
|
|
3148
|
+
T.let(
|
|
3149
|
+
:SELF,
|
|
3150
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer::TaggedSymbol
|
|
3151
|
+
)
|
|
3152
|
+
PARENT =
|
|
3153
|
+
T.let(
|
|
3154
|
+
:PARENT,
|
|
3155
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer::TaggedSymbol
|
|
3156
|
+
)
|
|
3157
|
+
|
|
3158
|
+
sig do
|
|
3159
|
+
override.returns(
|
|
3160
|
+
T::Array[
|
|
3161
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer::TaggedSymbol
|
|
3162
|
+
]
|
|
3163
|
+
)
|
|
3164
|
+
end
|
|
3165
|
+
def self.values
|
|
3166
|
+
end
|
|
3167
|
+
end
|
|
3168
|
+
|
|
3169
|
+
# Indicates the behavior of the child's invoice statements on the parent's
|
|
3170
|
+
# invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
3171
|
+
# consolidated invoices **SEPARATE**: Child's invoice statements will appear not
|
|
3172
|
+
# appear on parent's consolidated invoices
|
|
3173
|
+
module UsageStatementBehavior
|
|
3174
|
+
extend MetronomeSDK::Internal::Type::Enum
|
|
3175
|
+
|
|
3176
|
+
TaggedSymbol =
|
|
3177
|
+
T.type_alias do
|
|
3178
|
+
T.all(
|
|
3179
|
+
Symbol,
|
|
3180
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior
|
|
3181
|
+
)
|
|
3182
|
+
end
|
|
3183
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
3184
|
+
|
|
3185
|
+
CONSOLIDATE =
|
|
3186
|
+
T.let(
|
|
3187
|
+
:CONSOLIDATE,
|
|
3188
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior::TaggedSymbol
|
|
3189
|
+
)
|
|
3190
|
+
SEPARATE =
|
|
3191
|
+
T.let(
|
|
3192
|
+
:SEPARATE,
|
|
3193
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior::TaggedSymbol
|
|
3194
|
+
)
|
|
3195
|
+
|
|
3196
|
+
sig do
|
|
3197
|
+
override.returns(
|
|
3198
|
+
T::Array[
|
|
3199
|
+
MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior::TaggedSymbol
|
|
3200
|
+
]
|
|
3201
|
+
)
|
|
3202
|
+
end
|
|
3203
|
+
def self.values
|
|
3204
|
+
end
|
|
3205
|
+
end
|
|
2953
3206
|
end
|
|
2954
3207
|
|
|
2955
3208
|
# Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
|
|
@@ -48,6 +48,10 @@ module MetronomeSDK
|
|
|
48
48
|
sig { returns(String) }
|
|
49
49
|
attr_accessor :name
|
|
50
50
|
|
|
51
|
+
# RFC 3339 timestamp indicating when the customer was last updated.
|
|
52
|
+
sig { returns(Time) }
|
|
53
|
+
attr_accessor :updated_at
|
|
54
|
+
|
|
51
55
|
# RFC 3339 timestamp indicating when the customer was archived. Null if the
|
|
52
56
|
# customer is active.
|
|
53
57
|
sig { returns(T.nilable(Time)) }
|
|
@@ -79,6 +83,7 @@ module MetronomeSDK
|
|
|
79
83
|
external_id: String,
|
|
80
84
|
ingest_aliases: T::Array[String],
|
|
81
85
|
name: String,
|
|
86
|
+
updated_at: Time,
|
|
82
87
|
archived_at: T.nilable(Time),
|
|
83
88
|
current_billable_status:
|
|
84
89
|
MetronomeSDK::V1::CustomerDetail::CurrentBillableStatus::OrHash
|
|
@@ -99,6 +104,8 @@ module MetronomeSDK
|
|
|
99
104
|
# in usage events
|
|
100
105
|
ingest_aliases:,
|
|
101
106
|
name:,
|
|
107
|
+
# RFC 3339 timestamp indicating when the customer was last updated.
|
|
108
|
+
updated_at:,
|
|
102
109
|
# RFC 3339 timestamp indicating when the customer was archived. Null if the
|
|
103
110
|
# customer is active.
|
|
104
111
|
archived_at: nil,
|
|
@@ -117,6 +124,7 @@ module MetronomeSDK
|
|
|
117
124
|
external_id: String,
|
|
118
125
|
ingest_aliases: T::Array[String],
|
|
119
126
|
name: String,
|
|
127
|
+
updated_at: Time,
|
|
120
128
|
archived_at: T.nilable(Time),
|
|
121
129
|
current_billable_status:
|
|
122
130
|
MetronomeSDK::V1::CustomerDetail::CurrentBillableStatus
|
|
@@ -104,15 +104,6 @@ module MetronomeSDK
|
|
|
104
104
|
sig { returns(String) }
|
|
105
105
|
attr_accessor :event_type
|
|
106
106
|
|
|
107
|
-
# This has no effect for preview events, but may be set for consistency with Event
|
|
108
|
-
# objects. They will be processed even if they do not match the customer's ID or
|
|
109
|
-
# ingest aliases.
|
|
110
|
-
sig { returns(T.nilable(String)) }
|
|
111
|
-
attr_reader :customer_id
|
|
112
|
-
|
|
113
|
-
sig { params(customer_id: String).void }
|
|
114
|
-
attr_writer :customer_id
|
|
115
|
-
|
|
116
107
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
117
108
|
attr_reader :properties
|
|
118
109
|
|
|
@@ -126,9 +117,9 @@ module MetronomeSDK
|
|
|
126
117
|
sig { params(timestamp: String).void }
|
|
127
118
|
attr_writer :timestamp
|
|
128
119
|
|
|
129
|
-
#
|
|
130
|
-
#
|
|
131
|
-
# request.
|
|
120
|
+
# Optional unique identifier for event deduplication. When provided, preview
|
|
121
|
+
# events are automatically deduplicated against historical events from the past 34
|
|
122
|
+
# days. Duplicate transaction IDs within the same request will return an error.
|
|
132
123
|
sig { returns(T.nilable(String)) }
|
|
133
124
|
attr_reader :transaction_id
|
|
134
125
|
|
|
@@ -138,7 +129,6 @@ module MetronomeSDK
|
|
|
138
129
|
sig do
|
|
139
130
|
params(
|
|
140
131
|
event_type: String,
|
|
141
|
-
customer_id: String,
|
|
142
132
|
properties: T::Hash[Symbol, T.anything],
|
|
143
133
|
timestamp: String,
|
|
144
134
|
transaction_id: String
|
|
@@ -146,16 +136,12 @@ module MetronomeSDK
|
|
|
146
136
|
end
|
|
147
137
|
def self.new(
|
|
148
138
|
event_type:,
|
|
149
|
-
# This has no effect for preview events, but may be set for consistency with Event
|
|
150
|
-
# objects. They will be processed even if they do not match the customer's ID or
|
|
151
|
-
# ingest aliases.
|
|
152
|
-
customer_id: nil,
|
|
153
139
|
properties: nil,
|
|
154
140
|
# RFC 3339 formatted. If not provided, the current time will be used.
|
|
155
141
|
timestamp: nil,
|
|
156
|
-
#
|
|
157
|
-
#
|
|
158
|
-
# request.
|
|
142
|
+
# Optional unique identifier for event deduplication. When provided, preview
|
|
143
|
+
# events are automatically deduplicated against historical events from the past 34
|
|
144
|
+
# days. Duplicate transaction IDs within the same request will return an error.
|
|
159
145
|
transaction_id: nil
|
|
160
146
|
)
|
|
161
147
|
end
|
|
@@ -164,7 +150,6 @@ module MetronomeSDK
|
|
|
164
150
|
override.returns(
|
|
165
151
|
{
|
|
166
152
|
event_type: String,
|
|
167
|
-
customer_id: String,
|
|
168
153
|
properties: T::Hash[Symbol, T.anything],
|
|
169
154
|
timestamp: String,
|
|
170
155
|
transaction_id: String
|
|
@@ -12,21 +12,22 @@ module MetronomeSDK
|
|
|
12
12
|
)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
sig { returns(MetronomeSDK::V1::Customers::Invoice) }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
sig { params(data: MetronomeSDK::V1::Customers::Invoice::OrHash).void }
|
|
19
|
-
attr_writer :data
|
|
15
|
+
sig { returns(T::Array[MetronomeSDK::V1::Customers::Invoice]) }
|
|
16
|
+
attr_accessor :data
|
|
20
17
|
|
|
21
18
|
sig do
|
|
22
|
-
params(
|
|
23
|
-
T
|
|
24
|
-
)
|
|
19
|
+
params(
|
|
20
|
+
data: T::Array[MetronomeSDK::V1::Customers::Invoice::OrHash]
|
|
21
|
+
).returns(T.attached_class)
|
|
25
22
|
end
|
|
26
23
|
def self.new(data:)
|
|
27
24
|
end
|
|
28
25
|
|
|
29
|
-
sig
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ data: T::Array[MetronomeSDK::V1::Customers::Invoice] }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
30
31
|
def to_hash
|
|
31
32
|
end
|
|
32
33
|
end
|
|
@@ -27,8 +27,8 @@ module MetronomeSDK
|
|
|
27
27
|
sig { params(next_page: String).void }
|
|
28
28
|
attr_writer :next_page
|
|
29
29
|
|
|
30
|
-
# Optionally filter by
|
|
31
|
-
# returned.
|
|
30
|
+
# Optionally filter by threshold notification status. If absent, only enabled
|
|
31
|
+
# notifications will be returned.
|
|
32
32
|
sig do
|
|
33
33
|
returns(
|
|
34
34
|
T.nilable(
|
|
@@ -66,8 +66,8 @@ module MetronomeSDK
|
|
|
66
66
|
customer_id:,
|
|
67
67
|
# Cursor that indicates where the next page of results should start.
|
|
68
68
|
next_page: nil,
|
|
69
|
-
# Optionally filter by
|
|
70
|
-
# returned.
|
|
69
|
+
# Optionally filter by threshold notification status. If absent, only enabled
|
|
70
|
+
# notifications will be returned.
|
|
71
71
|
alert_statuses: nil,
|
|
72
72
|
request_options: {}
|
|
73
73
|
)
|