metronome-sdk 2.1.0 → 3.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 +65 -0
- data/README.md +10 -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/commit.rb +69 -1
- data/lib/metronome_sdk/models/contract_v2.rb +45 -2
- data/lib/metronome_sdk/models/credit.rb +69 -1
- data/lib/metronome_sdk/models/rate.rb +1 -11
- 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/contracts/rate_cards/rate_add_many_params.rb +1 -11
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +1 -11
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +1 -11
- data/lib/metronome_sdk/models/v1/custom_field_add_key_params.rb +4 -0
- data/lib/metronome_sdk/models/v1/custom_field_delete_values_params.rb +4 -0
- data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +4 -0
- data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +4 -0
- data/lib/metronome_sdk/models/v1/custom_field_remove_key_params.rb +4 -0
- data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +4 -0
- 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 +71 -3
- data/lib/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rb +8 -1
- data/lib/metronome_sdk/models/v1/payment.rb +40 -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/rate_cards/rates.rb +1 -3
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +1 -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 +8 -4
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +7 -7
- data/lib/metronome_sdk/resources/v1/customers/plans.rb +5 -5
- data/lib/metronome_sdk/resources/v1/customers.rb +12 -10
- data/lib/metronome_sdk/resources/v1/plans.rb +2 -2
- data/lib/metronome_sdk/resources/v1/settings.rb +3 -1
- data/lib/metronome_sdk/resources/v1/usage.rb +7 -7
- 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/commit.rbi +171 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +85 -6
- data/rbi/metronome_sdk/models/credit.rbi +171 -0
- data/rbi/metronome_sdk/models/rate.rbi +3 -18
- 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/contracts/rate_cards/rate_add_many_params.rbi +3 -18
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +0 -15
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +3 -18
- data/rbi/metronome_sdk/models/v1/custom_field_add_key_params.rbi +20 -0
- data/rbi/metronome_sdk/models/v1/custom_field_delete_values_params.rbi +20 -0
- data/rbi/metronome_sdk/models/v1/custom_field_list_keys_params.rbi +20 -0
- data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +20 -0
- data/rbi/metronome_sdk/models/v1/custom_field_remove_key_params.rbi +20 -0
- data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +20 -0
- 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 +121 -0
- data/rbi/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbi +9 -0
- data/rbi/metronome_sdk/models/v1/payment.rbi +79 -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/rate_cards/rates.rbi +0 -5
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +1 -1
- 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 +9 -3
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -7
- data/rbi/metronome_sdk/resources/v1/customers/plans.rbi +5 -5
- data/rbi/metronome_sdk/resources/v1/customers.rbi +15 -8
- data/rbi/metronome_sdk/resources/v1/plans.rbi +2 -2
- data/rbi/metronome_sdk/resources/v1/settings.rbi +4 -0
- data/rbi/metronome_sdk/resources/v1/usage.rbi +7 -7
- 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/commit.rbs +74 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +45 -6
- data/sig/metronome_sdk/models/credit.rbs +74 -0
- data/sig/metronome_sdk/models/rate.rbs +3 -10
- 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/contracts/rate_cards/rate_add_many_params.rbs +3 -10
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +1 -8
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +3 -10
- data/sig/metronome_sdk/models/v1/custom_field_add_key_params.rbs +8 -0
- data/sig/metronome_sdk/models/v1/custom_field_delete_values_params.rbs +8 -0
- data/sig/metronome_sdk/models/v1/custom_field_list_keys_params.rbs +8 -0
- data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +8 -0
- data/sig/metronome_sdk/models/v1/custom_field_remove_key_params.rbs +8 -0
- data/sig/metronome_sdk/models/v1/custom_field_set_values_params.rbs +8 -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 +64 -0
- data/sig/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbs +7 -0
- data/sig/metronome_sdk/models/v1/payment.rbs +45 -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/rate_cards/rates.rbs +0 -1
- 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 +19 -2
|
@@ -144,6 +144,14 @@ module MetronomeSDK
|
|
|
144
144
|
sig { params(rate_type: MetronomeSDK::Credit::RateType::OrSymbol).void }
|
|
145
145
|
attr_writer :rate_type
|
|
146
146
|
|
|
147
|
+
# The ID of the recurring credit that this credit was generated from, if
|
|
148
|
+
# applicable.
|
|
149
|
+
sig { returns(T.nilable(String)) }
|
|
150
|
+
attr_reader :recurring_credit_id
|
|
151
|
+
|
|
152
|
+
sig { params(recurring_credit_id: String).void }
|
|
153
|
+
attr_writer :recurring_credit_id
|
|
154
|
+
|
|
147
155
|
# This field's availability is dependent on your client's configuration.
|
|
148
156
|
sig { returns(T.nilable(String)) }
|
|
149
157
|
attr_reader :salesforce_opportunity_id
|
|
@@ -162,6 +170,18 @@ module MetronomeSDK
|
|
|
162
170
|
end
|
|
163
171
|
attr_writer :specifiers
|
|
164
172
|
|
|
173
|
+
# The subscription configuration for this credit, if it was generated from a
|
|
174
|
+
# recurring credit with a subscription attached.
|
|
175
|
+
sig { returns(T.nilable(MetronomeSDK::Credit::SubscriptionConfig)) }
|
|
176
|
+
attr_reader :subscription_config
|
|
177
|
+
|
|
178
|
+
sig do
|
|
179
|
+
params(
|
|
180
|
+
subscription_config: MetronomeSDK::Credit::SubscriptionConfig::OrHash
|
|
181
|
+
).void
|
|
182
|
+
end
|
|
183
|
+
attr_writer :subscription_config
|
|
184
|
+
|
|
165
185
|
# Prevents the creation of duplicates. If a request to create a commit or credit
|
|
166
186
|
# is made with a uniqueness key that was previously used to create a commit or
|
|
167
187
|
# credit, a new record will not be created and the request will fail with a 409
|
|
@@ -203,8 +223,10 @@ module MetronomeSDK
|
|
|
203
223
|
netsuite_sales_order_id: String,
|
|
204
224
|
priority: Float,
|
|
205
225
|
rate_type: MetronomeSDK::Credit::RateType::OrSymbol,
|
|
226
|
+
recurring_credit_id: String,
|
|
206
227
|
salesforce_opportunity_id: String,
|
|
207
228
|
specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
|
|
229
|
+
subscription_config: MetronomeSDK::Credit::SubscriptionConfig::OrHash,
|
|
208
230
|
uniqueness_key: String
|
|
209
231
|
).returns(T.attached_class)
|
|
210
232
|
end
|
|
@@ -242,12 +264,18 @@ module MetronomeSDK
|
|
|
242
264
|
# will apply first.
|
|
243
265
|
priority: nil,
|
|
244
266
|
rate_type: nil,
|
|
267
|
+
# The ID of the recurring credit that this credit was generated from, if
|
|
268
|
+
# applicable.
|
|
269
|
+
recurring_credit_id: nil,
|
|
245
270
|
# This field's availability is dependent on your client's configuration.
|
|
246
271
|
salesforce_opportunity_id: nil,
|
|
247
272
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
248
273
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
249
274
|
# specifiers to contribute to a commit's or credit's drawdown.
|
|
250
275
|
specifiers: nil,
|
|
276
|
+
# The subscription configuration for this credit, if it was generated from a
|
|
277
|
+
# recurring credit with a subscription attached.
|
|
278
|
+
subscription_config: nil,
|
|
251
279
|
# Prevents the creation of duplicates. If a request to create a commit or credit
|
|
252
280
|
# is made with a uniqueness key that was previously used to create a commit or
|
|
253
281
|
# credit, a new record will not be created and the request will fail with a 409
|
|
@@ -276,8 +304,10 @@ module MetronomeSDK
|
|
|
276
304
|
netsuite_sales_order_id: String,
|
|
277
305
|
priority: Float,
|
|
278
306
|
rate_type: MetronomeSDK::Credit::RateType::TaggedSymbol,
|
|
307
|
+
recurring_credit_id: String,
|
|
279
308
|
salesforce_opportunity_id: String,
|
|
280
309
|
specifiers: T::Array[MetronomeSDK::CommitSpecifier],
|
|
310
|
+
subscription_config: MetronomeSDK::Credit::SubscriptionConfig,
|
|
281
311
|
uniqueness_key: String
|
|
282
312
|
}
|
|
283
313
|
)
|
|
@@ -1016,6 +1046,147 @@ module MetronomeSDK
|
|
|
1016
1046
|
def self.values
|
|
1017
1047
|
end
|
|
1018
1048
|
end
|
|
1049
|
+
|
|
1050
|
+
class SubscriptionConfig < MetronomeSDK::Internal::Type::BaseModel
|
|
1051
|
+
OrHash =
|
|
1052
|
+
T.type_alias do
|
|
1053
|
+
T.any(
|
|
1054
|
+
MetronomeSDK::Credit::SubscriptionConfig,
|
|
1055
|
+
MetronomeSDK::Internal::AnyHash
|
|
1056
|
+
)
|
|
1057
|
+
end
|
|
1058
|
+
|
|
1059
|
+
sig do
|
|
1060
|
+
returns(
|
|
1061
|
+
T.nilable(
|
|
1062
|
+
MetronomeSDK::Credit::SubscriptionConfig::Allocation::TaggedSymbol
|
|
1063
|
+
)
|
|
1064
|
+
)
|
|
1065
|
+
end
|
|
1066
|
+
attr_reader :allocation
|
|
1067
|
+
|
|
1068
|
+
sig do
|
|
1069
|
+
params(
|
|
1070
|
+
allocation:
|
|
1071
|
+
MetronomeSDK::Credit::SubscriptionConfig::Allocation::OrSymbol
|
|
1072
|
+
).void
|
|
1073
|
+
end
|
|
1074
|
+
attr_writer :allocation
|
|
1075
|
+
|
|
1076
|
+
sig do
|
|
1077
|
+
returns(
|
|
1078
|
+
T.nilable(
|
|
1079
|
+
MetronomeSDK::Credit::SubscriptionConfig::ApplySeatIncreaseConfig
|
|
1080
|
+
)
|
|
1081
|
+
)
|
|
1082
|
+
end
|
|
1083
|
+
attr_reader :apply_seat_increase_config
|
|
1084
|
+
|
|
1085
|
+
sig do
|
|
1086
|
+
params(
|
|
1087
|
+
apply_seat_increase_config:
|
|
1088
|
+
MetronomeSDK::Credit::SubscriptionConfig::ApplySeatIncreaseConfig::OrHash
|
|
1089
|
+
).void
|
|
1090
|
+
end
|
|
1091
|
+
attr_writer :apply_seat_increase_config
|
|
1092
|
+
|
|
1093
|
+
sig { returns(T.nilable(String)) }
|
|
1094
|
+
attr_reader :subscription_id
|
|
1095
|
+
|
|
1096
|
+
sig { params(subscription_id: String).void }
|
|
1097
|
+
attr_writer :subscription_id
|
|
1098
|
+
|
|
1099
|
+
# The subscription configuration for this credit, if it was generated from a
|
|
1100
|
+
# recurring credit with a subscription attached.
|
|
1101
|
+
sig do
|
|
1102
|
+
params(
|
|
1103
|
+
allocation:
|
|
1104
|
+
MetronomeSDK::Credit::SubscriptionConfig::Allocation::OrSymbol,
|
|
1105
|
+
apply_seat_increase_config:
|
|
1106
|
+
MetronomeSDK::Credit::SubscriptionConfig::ApplySeatIncreaseConfig::OrHash,
|
|
1107
|
+
subscription_id: String
|
|
1108
|
+
).returns(T.attached_class)
|
|
1109
|
+
end
|
|
1110
|
+
def self.new(
|
|
1111
|
+
allocation: nil,
|
|
1112
|
+
apply_seat_increase_config: nil,
|
|
1113
|
+
subscription_id: nil
|
|
1114
|
+
)
|
|
1115
|
+
end
|
|
1116
|
+
|
|
1117
|
+
sig do
|
|
1118
|
+
override.returns(
|
|
1119
|
+
{
|
|
1120
|
+
allocation:
|
|
1121
|
+
MetronomeSDK::Credit::SubscriptionConfig::Allocation::TaggedSymbol,
|
|
1122
|
+
apply_seat_increase_config:
|
|
1123
|
+
MetronomeSDK::Credit::SubscriptionConfig::ApplySeatIncreaseConfig,
|
|
1124
|
+
subscription_id: String
|
|
1125
|
+
}
|
|
1126
|
+
)
|
|
1127
|
+
end
|
|
1128
|
+
def to_hash
|
|
1129
|
+
end
|
|
1130
|
+
|
|
1131
|
+
module Allocation
|
|
1132
|
+
extend MetronomeSDK::Internal::Type::Enum
|
|
1133
|
+
|
|
1134
|
+
TaggedSymbol =
|
|
1135
|
+
T.type_alias do
|
|
1136
|
+
T.all(
|
|
1137
|
+
Symbol,
|
|
1138
|
+
MetronomeSDK::Credit::SubscriptionConfig::Allocation
|
|
1139
|
+
)
|
|
1140
|
+
end
|
|
1141
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1142
|
+
|
|
1143
|
+
INDIVIDUAL =
|
|
1144
|
+
T.let(
|
|
1145
|
+
:INDIVIDUAL,
|
|
1146
|
+
MetronomeSDK::Credit::SubscriptionConfig::Allocation::TaggedSymbol
|
|
1147
|
+
)
|
|
1148
|
+
POOLED =
|
|
1149
|
+
T.let(
|
|
1150
|
+
:POOLED,
|
|
1151
|
+
MetronomeSDK::Credit::SubscriptionConfig::Allocation::TaggedSymbol
|
|
1152
|
+
)
|
|
1153
|
+
|
|
1154
|
+
sig do
|
|
1155
|
+
override.returns(
|
|
1156
|
+
T::Array[
|
|
1157
|
+
MetronomeSDK::Credit::SubscriptionConfig::Allocation::TaggedSymbol
|
|
1158
|
+
]
|
|
1159
|
+
)
|
|
1160
|
+
end
|
|
1161
|
+
def self.values
|
|
1162
|
+
end
|
|
1163
|
+
end
|
|
1164
|
+
|
|
1165
|
+
class ApplySeatIncreaseConfig < MetronomeSDK::Internal::Type::BaseModel
|
|
1166
|
+
OrHash =
|
|
1167
|
+
T.type_alias do
|
|
1168
|
+
T.any(
|
|
1169
|
+
MetronomeSDK::Credit::SubscriptionConfig::ApplySeatIncreaseConfig,
|
|
1170
|
+
MetronomeSDK::Internal::AnyHash
|
|
1171
|
+
)
|
|
1172
|
+
end
|
|
1173
|
+
|
|
1174
|
+
# Indicates whether a mid-period seat increase should be prorated.
|
|
1175
|
+
sig { returns(T::Boolean) }
|
|
1176
|
+
attr_accessor :is_prorated
|
|
1177
|
+
|
|
1178
|
+
sig { params(is_prorated: T::Boolean).returns(T.attached_class) }
|
|
1179
|
+
def self.new(
|
|
1180
|
+
# Indicates whether a mid-period seat increase should be prorated.
|
|
1181
|
+
is_prorated:
|
|
1182
|
+
)
|
|
1183
|
+
end
|
|
1184
|
+
|
|
1185
|
+
sig { override.returns({ is_prorated: T::Boolean }) }
|
|
1186
|
+
def to_hash
|
|
1187
|
+
end
|
|
1188
|
+
end
|
|
1189
|
+
end
|
|
1019
1190
|
end
|
|
1020
1191
|
end
|
|
1021
1192
|
end
|
|
@@ -63,15 +63,6 @@ module MetronomeSDK
|
|
|
63
63
|
sig { params(tiers: T::Array[MetronomeSDK::Tier::OrHash]).void }
|
|
64
64
|
attr_writer :tiers
|
|
65
65
|
|
|
66
|
-
# Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
|
|
67
|
-
# using list prices rather than the standard rates for this product on the
|
|
68
|
-
# contract.
|
|
69
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
70
|
-
attr_reader :use_list_prices
|
|
71
|
-
|
|
72
|
-
sig { params(use_list_prices: T::Boolean).void }
|
|
73
|
-
attr_writer :use_list_prices
|
|
74
|
-
|
|
75
66
|
sig do
|
|
76
67
|
params(
|
|
77
68
|
rate_type: MetronomeSDK::Rate::RateType::OrSymbol,
|
|
@@ -81,8 +72,7 @@ module MetronomeSDK
|
|
|
81
72
|
price: Float,
|
|
82
73
|
pricing_group_values: T::Hash[Symbol, String],
|
|
83
74
|
quantity: Float,
|
|
84
|
-
tiers: T::Array[MetronomeSDK::Tier::OrHash]
|
|
85
|
-
use_list_prices: T::Boolean
|
|
75
|
+
tiers: T::Array[MetronomeSDK::Tier::OrHash]
|
|
86
76
|
).returns(T.attached_class)
|
|
87
77
|
end
|
|
88
78
|
def self.new(
|
|
@@ -103,11 +93,7 @@ module MetronomeSDK
|
|
|
103
93
|
# Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
104
94
|
quantity: nil,
|
|
105
95
|
# Only set for TIERED rate_type.
|
|
106
|
-
tiers: nil
|
|
107
|
-
# Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
|
|
108
|
-
# using list prices rather than the standard rates for this product on the
|
|
109
|
-
# contract.
|
|
110
|
-
use_list_prices: nil
|
|
96
|
+
tiers: nil
|
|
111
97
|
)
|
|
112
98
|
end
|
|
113
99
|
|
|
@@ -121,8 +107,7 @@ module MetronomeSDK
|
|
|
121
107
|
price: Float,
|
|
122
108
|
pricing_group_values: T::Hash[Symbol, String],
|
|
123
109
|
quantity: Float,
|
|
124
|
-
tiers: T::Array[MetronomeSDK::Tier]
|
|
125
|
-
use_list_prices: T::Boolean
|
|
110
|
+
tiers: T::Array[MetronomeSDK::Tier]
|
|
126
111
|
}
|
|
127
112
|
)
|
|
128
113
|
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
|
}
|