metronome-sdk 2.1.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 +39 -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 +18 -12
- data/lib/metronome_sdk/internal/util.rb +7 -2
- data/lib/metronome_sdk/models/contract_v2.rb +29 -2
- data/lib/metronome_sdk/models/subscription.rb +32 -5
- 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 +136 -20
- data/lib/metronome_sdk/models/v1/customer_create_params.rb +94 -2
- 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 +15 -1
- data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +15 -1
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +33 -1
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +20 -2
- data/lib/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rb +8 -1
- data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/settings/billing_provider_create_params.rb +1 -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 +285 -22
- 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 +6 -2
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +3 -1
- data/lib/metronome_sdk/resources/v1/customers/billing_config.rb +5 -1
- data/lib/metronome_sdk/resources/v1/customers.rb +5 -3
- data/lib/metronome_sdk/resources/v1/settings.rb +3 -1
- data/lib/metronome_sdk/resources/v2/contracts.rb +10 -2
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +3 -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_v2.rbi +63 -6
- data/rbi/metronome_sdk/models/subscription.rbi +55 -9
- 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 +288 -24
- data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +204 -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 +18 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +18 -0
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +71 -0
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +32 -0
- data/rbi/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbi +9 -0
- data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_params.rbi +5 -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 +616 -27
- 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 +9 -0
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +5 -0
- data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +6 -0
- data/rbi/metronome_sdk/resources/v1/customers.rbi +8 -1
- data/rbi/metronome_sdk/resources/v1/settings.rbi +4 -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_v2.rbs +31 -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/customer_create_params.rbs +83 -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 +14 -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 +30 -0
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +18 -0
- data/sig/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbs +7 -0
- data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbs +8 -1
- data/sig/metronome_sdk/models/v1/settings/billing_provider_create_params.rbs +3 -1
- 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 +232 -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 +2 -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.rbs +1 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +4 -0
- metadata +5 -2
|
@@ -730,6 +730,20 @@ module MetronomeSDK
|
|
|
730
730
|
end
|
|
731
731
|
attr_writer :specifiers
|
|
732
732
|
|
|
733
|
+
# Attach a subscription to the recurring commit/credit.
|
|
734
|
+
sig do
|
|
735
|
+
returns(T.nilable(MetronomeSDK::RecurringCommitSubscriptionConfig))
|
|
736
|
+
end
|
|
737
|
+
attr_reader :subscription_config
|
|
738
|
+
|
|
739
|
+
sig do
|
|
740
|
+
params(
|
|
741
|
+
subscription_config:
|
|
742
|
+
MetronomeSDK::RecurringCommitSubscriptionConfig::OrHash
|
|
743
|
+
).void
|
|
744
|
+
end
|
|
745
|
+
attr_writer :subscription_config
|
|
746
|
+
|
|
733
747
|
sig do
|
|
734
748
|
params(
|
|
735
749
|
id: String,
|
|
@@ -777,7 +791,9 @@ module MetronomeSDK
|
|
|
777
791
|
MetronomeSDK::ContractV2::Commit::RolledOverFrom::OrHash,
|
|
778
792
|
rollover_fraction: Float,
|
|
779
793
|
salesforce_opportunity_id: String,
|
|
780
|
-
specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash]
|
|
794
|
+
specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
|
|
795
|
+
subscription_config:
|
|
796
|
+
MetronomeSDK::RecurringCommitSubscriptionConfig::OrHash
|
|
781
797
|
).returns(T.attached_class)
|
|
782
798
|
end
|
|
783
799
|
def self.new(
|
|
@@ -833,7 +849,9 @@ module MetronomeSDK
|
|
|
833
849
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
834
850
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
835
851
|
# specifiers to contribute to a commit's or credit's drawdown.
|
|
836
|
-
specifiers: nil
|
|
852
|
+
specifiers: nil,
|
|
853
|
+
# Attach a subscription to the recurring commit/credit.
|
|
854
|
+
subscription_config: nil
|
|
837
855
|
)
|
|
838
856
|
end
|
|
839
857
|
|
|
@@ -869,7 +887,9 @@ module MetronomeSDK
|
|
|
869
887
|
MetronomeSDK::ContractV2::Commit::RolledOverFrom,
|
|
870
888
|
rollover_fraction: Float,
|
|
871
889
|
salesforce_opportunity_id: String,
|
|
872
|
-
specifiers: T::Array[MetronomeSDK::CommitSpecifier]
|
|
890
|
+
specifiers: T::Array[MetronomeSDK::CommitSpecifier],
|
|
891
|
+
subscription_config:
|
|
892
|
+
MetronomeSDK::RecurringCommitSubscriptionConfig
|
|
873
893
|
}
|
|
874
894
|
)
|
|
875
895
|
end
|
|
@@ -3202,6 +3222,16 @@ module MetronomeSDK
|
|
|
3202
3222
|
end
|
|
3203
3223
|
attr_writer :contract
|
|
3204
3224
|
|
|
3225
|
+
# Timestamp of when the credit was created.
|
|
3226
|
+
#
|
|
3227
|
+
# - Recurring credits: latter of credit service period date and parent credit
|
|
3228
|
+
# start date
|
|
3229
|
+
sig { returns(T.nilable(Time)) }
|
|
3230
|
+
attr_reader :created_at
|
|
3231
|
+
|
|
3232
|
+
sig { params(created_at: Time).void }
|
|
3233
|
+
attr_writer :created_at
|
|
3234
|
+
|
|
3205
3235
|
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
3206
3236
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
3207
3237
|
attr_reader :custom_fields
|
|
@@ -3297,6 +3327,20 @@ module MetronomeSDK
|
|
|
3297
3327
|
end
|
|
3298
3328
|
attr_writer :specifiers
|
|
3299
3329
|
|
|
3330
|
+
# Attach a subscription to the recurring commit/credit.
|
|
3331
|
+
sig do
|
|
3332
|
+
returns(T.nilable(MetronomeSDK::RecurringCommitSubscriptionConfig))
|
|
3333
|
+
end
|
|
3334
|
+
attr_reader :subscription_config
|
|
3335
|
+
|
|
3336
|
+
sig do
|
|
3337
|
+
params(
|
|
3338
|
+
subscription_config:
|
|
3339
|
+
MetronomeSDK::RecurringCommitSubscriptionConfig::OrHash
|
|
3340
|
+
).void
|
|
3341
|
+
end
|
|
3342
|
+
attr_writer :subscription_config
|
|
3343
|
+
|
|
3300
3344
|
sig do
|
|
3301
3345
|
params(
|
|
3302
3346
|
id: String,
|
|
@@ -3308,6 +3352,7 @@ module MetronomeSDK
|
|
|
3308
3352
|
applicable_product_tags: T::Array[String],
|
|
3309
3353
|
balance: Float,
|
|
3310
3354
|
contract: MetronomeSDK::ContractV2::Credit::Contract::OrHash,
|
|
3355
|
+
created_at: Time,
|
|
3311
3356
|
custom_fields: T::Hash[Symbol, String],
|
|
3312
3357
|
description: String,
|
|
3313
3358
|
hierarchy_configuration:
|
|
@@ -3328,7 +3373,9 @@ module MetronomeSDK
|
|
|
3328
3373
|
netsuite_sales_order_id: String,
|
|
3329
3374
|
priority: Float,
|
|
3330
3375
|
salesforce_opportunity_id: String,
|
|
3331
|
-
specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash]
|
|
3376
|
+
specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
|
|
3377
|
+
subscription_config:
|
|
3378
|
+
MetronomeSDK::RecurringCommitSubscriptionConfig::OrHash
|
|
3332
3379
|
).returns(T.attached_class)
|
|
3333
3380
|
end
|
|
3334
3381
|
def self.new(
|
|
@@ -3350,6 +3397,11 @@ module MetronomeSDK
|
|
|
3350
3397
|
# included in the balance, including future-dated manual ledger entries.
|
|
3351
3398
|
balance: nil,
|
|
3352
3399
|
contract: nil,
|
|
3400
|
+
# Timestamp of when the credit was created.
|
|
3401
|
+
#
|
|
3402
|
+
# - Recurring credits: latter of credit service period date and parent credit
|
|
3403
|
+
# start date
|
|
3404
|
+
created_at: nil,
|
|
3353
3405
|
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
3354
3406
|
custom_fields: nil,
|
|
3355
3407
|
description: nil,
|
|
@@ -3369,7 +3421,9 @@ module MetronomeSDK
|
|
|
3369
3421
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
3370
3422
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
3371
3423
|
# specifiers to contribute to a commit's or credit's drawdown.
|
|
3372
|
-
specifiers: nil
|
|
3424
|
+
specifiers: nil,
|
|
3425
|
+
# Attach a subscription to the recurring commit/credit.
|
|
3426
|
+
subscription_config: nil
|
|
3373
3427
|
)
|
|
3374
3428
|
end
|
|
3375
3429
|
|
|
@@ -3385,6 +3439,7 @@ module MetronomeSDK
|
|
|
3385
3439
|
applicable_product_tags: T::Array[String],
|
|
3386
3440
|
balance: Float,
|
|
3387
3441
|
contract: MetronomeSDK::ContractV2::Credit::Contract,
|
|
3442
|
+
created_at: Time,
|
|
3388
3443
|
custom_fields: T::Hash[Symbol, String],
|
|
3389
3444
|
description: String,
|
|
3390
3445
|
hierarchy_configuration:
|
|
@@ -3395,7 +3450,9 @@ module MetronomeSDK
|
|
|
3395
3450
|
netsuite_sales_order_id: String,
|
|
3396
3451
|
priority: Float,
|
|
3397
3452
|
salesforce_opportunity_id: String,
|
|
3398
|
-
specifiers: T::Array[MetronomeSDK::CommitSpecifier]
|
|
3453
|
+
specifiers: T::Array[MetronomeSDK::CommitSpecifier],
|
|
3454
|
+
subscription_config:
|
|
3455
|
+
MetronomeSDK::RecurringCommitSubscriptionConfig
|
|
3399
3456
|
}
|
|
3400
3457
|
)
|
|
3401
3458
|
end
|
|
@@ -36,8 +36,8 @@ 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**:
|
|
40
|
-
#
|
|
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
41
|
# directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
42
42
|
# use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
43
43
|
# provided with this option.
|
|
@@ -104,6 +104,14 @@ module MetronomeSDK
|
|
|
104
104
|
sig { params(name: String).void }
|
|
105
105
|
attr_writer :name
|
|
106
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
|
+
|
|
107
115
|
sig do
|
|
108
116
|
params(
|
|
109
117
|
billing_periods: MetronomeSDK::Subscription::BillingPeriods::OrHash,
|
|
@@ -122,7 +130,8 @@ module MetronomeSDK
|
|
|
122
130
|
description: String,
|
|
123
131
|
ending_before: Time,
|
|
124
132
|
fiat_credit_type_id: String,
|
|
125
|
-
name: String
|
|
133
|
+
name: String,
|
|
134
|
+
seat_config: MetronomeSDK::Subscription::SeatConfig::OrHash
|
|
126
135
|
).returns(T.attached_class)
|
|
127
136
|
end
|
|
128
137
|
def self.new(
|
|
@@ -134,8 +143,8 @@ module MetronomeSDK
|
|
|
134
143
|
# QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
135
144
|
# directly on the subscription. `initial_quantity` must be provided with this
|
|
136
145
|
# option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
137
|
-
# **SEAT_BASED**:
|
|
138
|
-
#
|
|
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
|
|
139
148
|
# directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
140
149
|
# use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
141
150
|
# provided with this option.
|
|
@@ -151,7 +160,8 @@ module MetronomeSDK
|
|
|
151
160
|
description: nil,
|
|
152
161
|
ending_before: nil,
|
|
153
162
|
fiat_credit_type_id: nil,
|
|
154
|
-
name: nil
|
|
163
|
+
name: nil,
|
|
164
|
+
seat_config: nil
|
|
155
165
|
)
|
|
156
166
|
end
|
|
157
167
|
|
|
@@ -173,7 +183,8 @@ module MetronomeSDK
|
|
|
173
183
|
description: String,
|
|
174
184
|
ending_before: Time,
|
|
175
185
|
fiat_credit_type_id: String,
|
|
176
|
-
name: String
|
|
186
|
+
name: String,
|
|
187
|
+
seat_config: MetronomeSDK::Subscription::SeatConfig
|
|
177
188
|
}
|
|
178
189
|
)
|
|
179
190
|
end
|
|
@@ -451,8 +462,8 @@ module MetronomeSDK
|
|
|
451
462
|
# QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
452
463
|
# directly on the subscription. `initial_quantity` must be provided with this
|
|
453
464
|
# option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
454
|
-
# **SEAT_BASED**:
|
|
455
|
-
#
|
|
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
|
|
456
467
|
# directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
457
468
|
# use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
458
469
|
# provided with this option.
|
|
@@ -645,6 +656,41 @@ module MetronomeSDK
|
|
|
645
656
|
end
|
|
646
657
|
end
|
|
647
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
|
|
648
694
|
end
|
|
649
695
|
end
|
|
650
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
|
}
|