metronome-sdk 2.0.0 → 2.2.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 +75 -0
- data/README.md +1 -1
- data/lib/metronome_sdk/internal/transport/base_client.rb +7 -1
- data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +38 -26
- data/lib/metronome_sdk/internal/util.rb +7 -2
- data/lib/metronome_sdk/models/contract.rb +1 -0
- data/lib/metronome_sdk/models/contract_v2.rb +69 -23
- data/lib/metronome_sdk/models/hierarchy_configuration.rb +45 -21
- data/lib/metronome_sdk/models/subscription.rb +38 -1
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +33 -1
- data/lib/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +195 -29
- data/lib/metronome_sdk/models/v1/contract_list_balances_params.rb +9 -1
- data/lib/metronome_sdk/models/v1/customer_create_params.rb +105 -3
- data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +14 -10
- 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/customer_set_billing_configurations_response.rb +111 -0
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +32 -1
- data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +21 -2
- 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 +21 -2
- data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +1 -1
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +34 -1
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +144 -4
- data/lib/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rb +8 -1
- data/lib/metronome_sdk/models/v1/payment.rb +7 -1
- data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rb +74 -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 +74 -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/v1/usage_search_response.rb +6 -3
- data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +17 -1
- data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +17 -1
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +300 -10
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +177 -3
- data/lib/metronome_sdk/resources/v1/alerts.rb +3 -1
- data/lib/metronome_sdk/resources/v1/contracts.rb +10 -4
- data/lib/metronome_sdk/resources/v1/credit_grants.rb +10 -5
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +3 -1
- data/lib/metronome_sdk/resources/v1/customers/billing_config.rb +12 -5
- data/lib/metronome_sdk/resources/v1/customers/commits.rb +2 -1
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +2 -1
- data/lib/metronome_sdk/resources/v1/customers/plans.rb +8 -4
- data/lib/metronome_sdk/resources/v1/customers.rb +12 -8
- 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 +57 -0
- data/lib/metronome_sdk/resources/v1.rb +4 -0
- data/lib/metronome_sdk/resources/v2/contracts.rb +10 -2
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +11 -0
- data/manifest.yaml +2 -0
- data/rbi/metronome_sdk/internal/transport/base_client.rbi +5 -0
- data/rbi/metronome_sdk/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/metronome_sdk/internal/type/base_model.rbi +8 -4
- data/rbi/metronome_sdk/models/contract.rbi +5 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +122 -33
- data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +63 -27
- data/rbi/metronome_sdk/models/subscription.rbi +64 -3
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +69 -0
- data/rbi/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +360 -33
- data/rbi/metronome_sdk/models/v1/contract_list_balances_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +215 -0
- data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +18 -11
- 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/customer_set_billing_configurations_response.rbi +281 -0
- data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +67 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +29 -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 +24 -0
- data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +2 -2
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +76 -0
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +268 -0
- data/rbi/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbi +9 -0
- data/rbi/metronome_sdk/models/v1/payment.rbi +11 -3
- data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbi +128 -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 +162 -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/v1/usage_search_response.rbi +11 -3
- data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +22 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +22 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +630 -9
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +367 -3
- data/rbi/metronome_sdk/resources/v1/alerts.rbi +5 -0
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +13 -1
- data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +10 -5
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +5 -0
- data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +14 -4
- data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +3 -2
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +2 -1
- data/rbi/metronome_sdk/resources/v1/customers/plans.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/customers.rbi +19 -9
- 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 +51 -0
- data/rbi/metronome_sdk/resources/v1.rbi +3 -0
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +12 -0
- data/sig/metronome_sdk/internal/transport/base_client.rbs +2 -0
- data/sig/metronome_sdk/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/metronome_sdk/models/contract.rbs +2 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +33 -6
- data/sig/metronome_sdk/models/subscription.rbs +22 -3
- data/sig/metronome_sdk/models/v1/alert_create_params.rbs +28 -0
- data/sig/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +104 -0
- data/sig/metronome_sdk/models/v1/contract_list_balances_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/customer_create_params.rbs +85 -0
- 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/customer_set_billing_configurations_response.rbs +119 -0
- data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +26 -1
- data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +16 -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/billing_config_retrieve_response.rbs +14 -0
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +32 -0
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +130 -0
- data/sig/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbs +7 -0
- data/sig/metronome_sdk/models/v1/payment.rbs +10 -3
- data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbs +61 -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 +66 -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/v1/usage_search_response.rbs +3 -1
- data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +14 -0
- data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +14 -0
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +234 -3
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +131 -3
- data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -0
- data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/customers/billing_config.rbs +2 -0
- data/sig/metronome_sdk/resources/v1/customers.rbs +2 -1
- data/sig/metronome_sdk/resources/v1/settings/billing_providers.rbs +23 -0
- data/sig/metronome_sdk/resources/v1/settings.rbs +20 -0
- data/sig/metronome_sdk/resources/v1.rbs +2 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +4 -0
- metadata +29 -2
|
@@ -120,10 +120,13 @@ module MetronomeSDK
|
|
|
120
120
|
)
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
-
# Indicates the desired behavior of consolidated invoices
|
|
124
|
-
# in a customer hierarchy
|
|
125
|
-
#
|
|
126
|
-
#
|
|
123
|
+
# Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
|
|
124
|
+
# generated by the parent in a customer hierarchy
|
|
125
|
+
#
|
|
126
|
+
# **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
127
|
+
# to the consolidated invoice
|
|
128
|
+
#
|
|
129
|
+
# **NONE**: Do not generate consolidated invoices
|
|
127
130
|
sig do
|
|
128
131
|
returns(
|
|
129
132
|
T.nilable(
|
|
@@ -148,10 +151,13 @@ module MetronomeSDK
|
|
|
148
151
|
).returns(T.attached_class)
|
|
149
152
|
end
|
|
150
153
|
def self.new(
|
|
151
|
-
# Indicates the desired behavior of consolidated invoices
|
|
152
|
-
# in a customer hierarchy
|
|
153
|
-
#
|
|
154
|
-
#
|
|
154
|
+
# Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
|
|
155
|
+
# generated by the parent in a customer hierarchy
|
|
156
|
+
#
|
|
157
|
+
# **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
158
|
+
# to the consolidated invoice
|
|
159
|
+
#
|
|
160
|
+
# **NONE**: Do not generate consolidated invoices
|
|
155
161
|
invoice_consolidation_type: nil
|
|
156
162
|
)
|
|
157
163
|
end
|
|
@@ -167,10 +173,13 @@ module MetronomeSDK
|
|
|
167
173
|
def to_hash
|
|
168
174
|
end
|
|
169
175
|
|
|
170
|
-
# Indicates the desired behavior of consolidated invoices
|
|
171
|
-
# in a customer hierarchy
|
|
172
|
-
#
|
|
173
|
-
#
|
|
176
|
+
# Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
|
|
177
|
+
# generated by the parent in a customer hierarchy
|
|
178
|
+
#
|
|
179
|
+
# **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
180
|
+
# to the consolidated invoice
|
|
181
|
+
#
|
|
182
|
+
# **NONE**: Do not generate consolidated invoices
|
|
174
183
|
module InvoiceConsolidationType
|
|
175
184
|
extend MetronomeSDK::Internal::Type::Enum
|
|
176
185
|
|
|
@@ -232,7 +241,12 @@ module MetronomeSDK
|
|
|
232
241
|
end
|
|
233
242
|
attr_writer :parent
|
|
234
243
|
|
|
235
|
-
# Indicates
|
|
244
|
+
# Account hierarchy M3 - Indicates which customer should pay for the child's
|
|
245
|
+
# invoice charges
|
|
246
|
+
#
|
|
247
|
+
# **SELF**: The child pays for its own invoice charges
|
|
248
|
+
#
|
|
249
|
+
# **PARENT**: The parent pays for the child's invoice charges
|
|
236
250
|
sig do
|
|
237
251
|
returns(
|
|
238
252
|
T.nilable(
|
|
@@ -250,10 +264,14 @@ module MetronomeSDK
|
|
|
250
264
|
end
|
|
251
265
|
attr_writer :payer
|
|
252
266
|
|
|
253
|
-
# Indicates the behavior of the child's invoice statements
|
|
254
|
-
#
|
|
255
|
-
#
|
|
256
|
-
#
|
|
267
|
+
# Account hierarchy M3 - Indicates the behavior of the child's invoice statements
|
|
268
|
+
# on the parent's invoices.
|
|
269
|
+
#
|
|
270
|
+
# **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
271
|
+
# consolidated invoices
|
|
272
|
+
#
|
|
273
|
+
# **SEPARATE**: Child's invoice statements will appear not appear on parent's
|
|
274
|
+
# consolidated invoices
|
|
257
275
|
sig do
|
|
258
276
|
returns(
|
|
259
277
|
T.nilable(
|
|
@@ -284,12 +302,21 @@ module MetronomeSDK
|
|
|
284
302
|
def self.new(
|
|
285
303
|
# The single parent contract/customer for this child.
|
|
286
304
|
parent:,
|
|
287
|
-
# Indicates
|
|
305
|
+
# Account hierarchy M3 - Indicates which customer should pay for the child's
|
|
306
|
+
# invoice charges
|
|
307
|
+
#
|
|
308
|
+
# **SELF**: The child pays for its own invoice charges
|
|
309
|
+
#
|
|
310
|
+
# **PARENT**: The parent pays for the child's invoice charges
|
|
288
311
|
payer: nil,
|
|
289
|
-
# Indicates the behavior of the child's invoice statements
|
|
290
|
-
#
|
|
291
|
-
#
|
|
292
|
-
#
|
|
312
|
+
# Account hierarchy M3 - Indicates the behavior of the child's invoice statements
|
|
313
|
+
# on the parent's invoices.
|
|
314
|
+
#
|
|
315
|
+
# **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
316
|
+
# consolidated invoices
|
|
317
|
+
#
|
|
318
|
+
# **SEPARATE**: Child's invoice statements will appear not appear on parent's
|
|
319
|
+
# consolidated invoices
|
|
293
320
|
usage_statement_behavior: nil
|
|
294
321
|
)
|
|
295
322
|
end
|
|
@@ -338,7 +365,12 @@ module MetronomeSDK
|
|
|
338
365
|
end
|
|
339
366
|
end
|
|
340
367
|
|
|
341
|
-
# Indicates
|
|
368
|
+
# Account hierarchy M3 - Indicates which customer should pay for the child's
|
|
369
|
+
# invoice charges
|
|
370
|
+
#
|
|
371
|
+
# **SELF**: The child pays for its own invoice charges
|
|
372
|
+
#
|
|
373
|
+
# **PARENT**: The parent pays for the child's invoice charges
|
|
342
374
|
module Payer
|
|
343
375
|
extend MetronomeSDK::Internal::Type::Enum
|
|
344
376
|
|
|
@@ -373,10 +405,14 @@ module MetronomeSDK
|
|
|
373
405
|
end
|
|
374
406
|
end
|
|
375
407
|
|
|
376
|
-
# Indicates the behavior of the child's invoice statements
|
|
377
|
-
#
|
|
378
|
-
#
|
|
379
|
-
#
|
|
408
|
+
# Account hierarchy M3 - Indicates the behavior of the child's invoice statements
|
|
409
|
+
# on the parent's invoices.
|
|
410
|
+
#
|
|
411
|
+
# **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
412
|
+
# consolidated invoices
|
|
413
|
+
#
|
|
414
|
+
# **SEPARATE**: Child's invoice statements will appear not appear on parent's
|
|
415
|
+
# consolidated invoices
|
|
380
416
|
module UsageStatementBehavior
|
|
381
417
|
extend MetronomeSDK::Internal::Type::Enum
|
|
382
418
|
|
|
@@ -36,6 +36,11 @@ module MetronomeSDK
|
|
|
36
36
|
# QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
37
37
|
# directly on the subscription. `initial_quantity` must be provided with this
|
|
38
38
|
# option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
39
|
+
# **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
|
|
40
|
+
# user_123) to increment and decrement a subscription quantity, rather than
|
|
41
|
+
# directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
42
|
+
# use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
43
|
+
# provided with this option.
|
|
39
44
|
sig do
|
|
40
45
|
returns(
|
|
41
46
|
MetronomeSDK::Subscription::QuantityManagementMode::TaggedSymbol
|
|
@@ -99,6 +104,14 @@ module MetronomeSDK
|
|
|
99
104
|
sig { params(name: String).void }
|
|
100
105
|
attr_writer :name
|
|
101
106
|
|
|
107
|
+
sig { returns(T.nilable(MetronomeSDK::Subscription::SeatConfig)) }
|
|
108
|
+
attr_reader :seat_config
|
|
109
|
+
|
|
110
|
+
sig do
|
|
111
|
+
params(seat_config: MetronomeSDK::Subscription::SeatConfig::OrHash).void
|
|
112
|
+
end
|
|
113
|
+
attr_writer :seat_config
|
|
114
|
+
|
|
102
115
|
sig do
|
|
103
116
|
params(
|
|
104
117
|
billing_periods: MetronomeSDK::Subscription::BillingPeriods::OrHash,
|
|
@@ -117,7 +130,8 @@ module MetronomeSDK
|
|
|
117
130
|
description: String,
|
|
118
131
|
ending_before: Time,
|
|
119
132
|
fiat_credit_type_id: String,
|
|
120
|
-
name: String
|
|
133
|
+
name: String,
|
|
134
|
+
seat_config: MetronomeSDK::Subscription::SeatConfig::OrHash
|
|
121
135
|
).returns(T.attached_class)
|
|
122
136
|
end
|
|
123
137
|
def self.new(
|
|
@@ -129,6 +143,11 @@ module MetronomeSDK
|
|
|
129
143
|
# QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
130
144
|
# directly on the subscription. `initial_quantity` must be provided with this
|
|
131
145
|
# option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
146
|
+
# **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
|
|
147
|
+
# user_123) to increment and decrement a subscription quantity, rather than
|
|
148
|
+
# directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
149
|
+
# use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
150
|
+
# provided with this option.
|
|
132
151
|
quantity_management_mode:,
|
|
133
152
|
# List of quantity schedule items for the subscription. Only includes the current
|
|
134
153
|
# quantity and future quantity changes.
|
|
@@ -141,7 +160,8 @@ module MetronomeSDK
|
|
|
141
160
|
description: nil,
|
|
142
161
|
ending_before: nil,
|
|
143
162
|
fiat_credit_type_id: nil,
|
|
144
|
-
name: nil
|
|
163
|
+
name: nil,
|
|
164
|
+
seat_config: nil
|
|
145
165
|
)
|
|
146
166
|
end
|
|
147
167
|
|
|
@@ -163,7 +183,8 @@ module MetronomeSDK
|
|
|
163
183
|
description: String,
|
|
164
184
|
ending_before: Time,
|
|
165
185
|
fiat_credit_type_id: String,
|
|
166
|
-
name: String
|
|
186
|
+
name: String,
|
|
187
|
+
seat_config: MetronomeSDK::Subscription::SeatConfig
|
|
167
188
|
}
|
|
168
189
|
)
|
|
169
190
|
end
|
|
@@ -441,6 +462,11 @@ module MetronomeSDK
|
|
|
441
462
|
# QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
442
463
|
# directly on the subscription. `initial_quantity` must be provided with this
|
|
443
464
|
# option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
465
|
+
# **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
|
|
466
|
+
# user_123) to increment and decrement a subscription quantity, rather than
|
|
467
|
+
# directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
468
|
+
# use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
469
|
+
# provided with this option.
|
|
444
470
|
module QuantityManagementMode
|
|
445
471
|
extend MetronomeSDK::Internal::Type::Enum
|
|
446
472
|
|
|
@@ -630,6 +656,41 @@ module MetronomeSDK
|
|
|
630
656
|
end
|
|
631
657
|
end
|
|
632
658
|
end
|
|
659
|
+
|
|
660
|
+
class SeatConfig < MetronomeSDK::Internal::Type::BaseModel
|
|
661
|
+
OrHash =
|
|
662
|
+
T.type_alias do
|
|
663
|
+
T.any(
|
|
664
|
+
MetronomeSDK::Subscription::SeatConfig,
|
|
665
|
+
MetronomeSDK::Internal::AnyHash
|
|
666
|
+
)
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
# The property name, sent on usage events, that identifies the seat ID associated
|
|
670
|
+
# with the usage event. For example, the property name might be seat_id or
|
|
671
|
+
# user_id. The property must be set as a group key on billable metrics and a
|
|
672
|
+
# presentation/pricing group key on contract products. This allows linked
|
|
673
|
+
# recurring credits with an allocation per seat to be consumed by only one seat's
|
|
674
|
+
# usage.
|
|
675
|
+
sig { returns(String) }
|
|
676
|
+
attr_accessor :seat_group_key
|
|
677
|
+
|
|
678
|
+
sig { params(seat_group_key: String).returns(T.attached_class) }
|
|
679
|
+
def self.new(
|
|
680
|
+
# The property name, sent on usage events, that identifies the seat ID associated
|
|
681
|
+
# with the usage event. For example, the property name might be seat_id or
|
|
682
|
+
# user_id. The property must be set as a group key on billable metrics and a
|
|
683
|
+
# presentation/pricing group key on contract products. This allows linked
|
|
684
|
+
# recurring credits with an allocation per seat to be consumed by only one seat's
|
|
685
|
+
# usage.
|
|
686
|
+
seat_group_key:
|
|
687
|
+
)
|
|
688
|
+
end
|
|
689
|
+
|
|
690
|
+
sig { override.returns({ seat_group_key: String }) }
|
|
691
|
+
def to_hash
|
|
692
|
+
end
|
|
693
|
+
end
|
|
633
694
|
end
|
|
634
695
|
end
|
|
635
696
|
end
|
|
@@ -129,6 +129,20 @@ module MetronomeSDK
|
|
|
129
129
|
sig { params(plan_id: String).void }
|
|
130
130
|
attr_writer :plan_id
|
|
131
131
|
|
|
132
|
+
# Required for `low_remaining_seat_balance_reached` notifications. The alert is
|
|
133
|
+
# scoped to this seat group key-value pair.
|
|
134
|
+
sig do
|
|
135
|
+
returns(T.nilable(MetronomeSDK::V1::AlertCreateParams::SeatFilter))
|
|
136
|
+
end
|
|
137
|
+
attr_reader :seat_filter
|
|
138
|
+
|
|
139
|
+
sig do
|
|
140
|
+
params(
|
|
141
|
+
seat_filter: MetronomeSDK::V1::AlertCreateParams::SeatFilter::OrHash
|
|
142
|
+
).void
|
|
143
|
+
end
|
|
144
|
+
attr_writer :seat_filter
|
|
145
|
+
|
|
132
146
|
# Prevents the creation of duplicates. If a request to create a record is made
|
|
133
147
|
# with a previously used uniqueness key, a new record will not be created and the
|
|
134
148
|
# request will fail with a 409 error.
|
|
@@ -157,6 +171,8 @@ module MetronomeSDK
|
|
|
157
171
|
T::Array[MetronomeSDK::V1::AlertCreateParams::GroupValue::OrHash],
|
|
158
172
|
invoice_types_filter: T::Array[String],
|
|
159
173
|
plan_id: String,
|
|
174
|
+
seat_filter:
|
|
175
|
+
MetronomeSDK::V1::AlertCreateParams::SeatFilter::OrHash,
|
|
160
176
|
uniqueness_key: String,
|
|
161
177
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
162
178
|
).returns(T.attached_class)
|
|
@@ -201,6 +217,9 @@ module MetronomeSDK
|
|
|
201
217
|
# If provided, will create this threshold notification for this specific plan. To
|
|
202
218
|
# create a notification for all customers, do not specify a `plan_id`.
|
|
203
219
|
plan_id: nil,
|
|
220
|
+
# Required for `low_remaining_seat_balance_reached` notifications. The alert is
|
|
221
|
+
# scoped to this seat group key-value pair.
|
|
222
|
+
seat_filter: nil,
|
|
204
223
|
# Prevents the creation of duplicates. If a request to create a record is made
|
|
205
224
|
# with a previously used uniqueness key, a new record will not be created and the
|
|
206
225
|
# request will fail with a 409 error.
|
|
@@ -229,6 +248,7 @@ module MetronomeSDK
|
|
|
229
248
|
T::Array[MetronomeSDK::V1::AlertCreateParams::GroupValue],
|
|
230
249
|
invoice_types_filter: T::Array[String],
|
|
231
250
|
plan_id: String,
|
|
251
|
+
seat_filter: MetronomeSDK::V1::AlertCreateParams::SeatFilter,
|
|
232
252
|
uniqueness_key: String,
|
|
233
253
|
request_options: MetronomeSDK::RequestOptions
|
|
234
254
|
}
|
|
@@ -317,6 +337,11 @@ module MetronomeSDK
|
|
|
317
337
|
:invoice_total_reached,
|
|
318
338
|
MetronomeSDK::V1::AlertCreateParams::AlertType::TaggedSymbol
|
|
319
339
|
)
|
|
340
|
+
LOW_REMAINING_SEAT_BALANCE_REACHED =
|
|
341
|
+
T.let(
|
|
342
|
+
:low_remaining_seat_balance_reached,
|
|
343
|
+
MetronomeSDK::V1::AlertCreateParams::AlertType::TaggedSymbol
|
|
344
|
+
)
|
|
320
345
|
|
|
321
346
|
sig do
|
|
322
347
|
override.returns(
|
|
@@ -441,6 +466,50 @@ module MetronomeSDK
|
|
|
441
466
|
def to_hash
|
|
442
467
|
end
|
|
443
468
|
end
|
|
469
|
+
|
|
470
|
+
class SeatFilter < MetronomeSDK::Internal::Type::BaseModel
|
|
471
|
+
OrHash =
|
|
472
|
+
T.type_alias do
|
|
473
|
+
T.any(
|
|
474
|
+
MetronomeSDK::V1::AlertCreateParams::SeatFilter,
|
|
475
|
+
MetronomeSDK::Internal::AnyHash
|
|
476
|
+
)
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
# The seat group key (e.g., "seat_id", "user_id")
|
|
480
|
+
sig { returns(String) }
|
|
481
|
+
attr_accessor :seat_group_key
|
|
482
|
+
|
|
483
|
+
# Optional seat identifier the alert is scoped to.
|
|
484
|
+
sig { returns(T.nilable(String)) }
|
|
485
|
+
attr_reader :seat_group_value
|
|
486
|
+
|
|
487
|
+
sig { params(seat_group_value: String).void }
|
|
488
|
+
attr_writer :seat_group_value
|
|
489
|
+
|
|
490
|
+
# Required for `low_remaining_seat_balance_reached` notifications. The alert is
|
|
491
|
+
# scoped to this seat group key-value pair.
|
|
492
|
+
sig do
|
|
493
|
+
params(seat_group_key: String, seat_group_value: String).returns(
|
|
494
|
+
T.attached_class
|
|
495
|
+
)
|
|
496
|
+
end
|
|
497
|
+
def self.new(
|
|
498
|
+
# The seat group key (e.g., "seat_id", "user_id")
|
|
499
|
+
seat_group_key:,
|
|
500
|
+
# Optional seat identifier the alert is scoped to.
|
|
501
|
+
seat_group_value: nil
|
|
502
|
+
)
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
sig do
|
|
506
|
+
override.returns(
|
|
507
|
+
{ seat_group_key: String, seat_group_value: String }
|
|
508
|
+
)
|
|
509
|
+
end
|
|
510
|
+
def to_hash
|
|
511
|
+
end
|
|
512
|
+
end
|
|
444
513
|
end
|
|
445
514
|
end
|
|
446
515
|
end
|
|
@@ -42,6 +42,14 @@ module MetronomeSDK
|
|
|
42
42
|
sig { params(contract_id: String).void }
|
|
43
43
|
attr_writer :contract_id
|
|
44
44
|
|
|
45
|
+
# If using individually configured commits/credits attached to seat managed
|
|
46
|
+
# subscriptions, the amount to add for each seat. Must sum to total amount.
|
|
47
|
+
sig { returns(T.nilable(T::Hash[Symbol, Float])) }
|
|
48
|
+
attr_reader :per_group_amounts
|
|
49
|
+
|
|
50
|
+
sig { params(per_group_amounts: T::Hash[Symbol, Float]).void }
|
|
51
|
+
attr_writer :per_group_amounts
|
|
52
|
+
|
|
45
53
|
# RFC 3339 timestamp indicating when the manual adjustment takes place. If not
|
|
46
54
|
# provided, it will default to the start of the segment.
|
|
47
55
|
sig { returns(T.nilable(Time)) }
|
|
@@ -58,6 +66,7 @@ module MetronomeSDK
|
|
|
58
66
|
reason: String,
|
|
59
67
|
segment_id: String,
|
|
60
68
|
contract_id: String,
|
|
69
|
+
per_group_amounts: T::Hash[Symbol, Float],
|
|
61
70
|
timestamp: Time,
|
|
62
71
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
63
72
|
).returns(T.attached_class)
|
|
@@ -75,6 +84,9 @@ module MetronomeSDK
|
|
|
75
84
|
segment_id:,
|
|
76
85
|
# ID of the contract to update. Leave blank to update a customer level balance.
|
|
77
86
|
contract_id: nil,
|
|
87
|
+
# If using individually configured commits/credits attached to seat managed
|
|
88
|
+
# subscriptions, the amount to add for each seat. Must sum to total amount.
|
|
89
|
+
per_group_amounts: nil,
|
|
78
90
|
# RFC 3339 timestamp indicating when the manual adjustment takes place. If not
|
|
79
91
|
# provided, it will default to the start of the segment.
|
|
80
92
|
timestamp: nil,
|
|
@@ -91,6 +103,7 @@ module MetronomeSDK
|
|
|
91
103
|
reason: String,
|
|
92
104
|
segment_id: String,
|
|
93
105
|
contract_id: String,
|
|
106
|
+
per_group_amounts: T::Hash[Symbol, Float],
|
|
94
107
|
timestamp: Time,
|
|
95
108
|
request_options: MetronomeSDK::RequestOptions
|
|
96
109
|
}
|