metronome-sdk 3.4.0 → 3.6.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 +84 -0
- data/README.md +1 -1
- data/lib/metronome_sdk/client.rb +15 -1
- data/lib/metronome_sdk/internal/transport/base_client.rb +2 -0
- data/lib/metronome_sdk/internal/util.rb +22 -7
- data/lib/metronome_sdk/models/base_threshold_commit.rb +10 -1
- data/lib/metronome_sdk/models/contract_v2.rb +443 -15
- data/lib/metronome_sdk/models/credit.rb +74 -4
- data/lib/metronome_sdk/models/override.rb +9 -8
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +27 -1
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +28 -2
- data/lib/metronome_sdk/models/spend_threshold_configuration.rb +26 -1
- data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +30 -4
- data/lib/metronome_sdk/models/update_base_threshold_commit.rb +11 -1
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +2 -189
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +3 -191
- data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +119 -0
- data/lib/metronome_sdk/models/v1/contract_list_seat_balances_response.rb +315 -0
- data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +31 -1
- data/lib/metronome_sdk/models/v1/contracts/product_update_params.rb +31 -1
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +1 -0
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +8 -1
- data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +29 -1
- data/lib/metronome_sdk/models/v1/package_create_params.rb +2 -30
- data/lib/metronome_sdk/models/v1/package_list_response.rb +28 -9
- data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +29 -9
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +67 -20
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +496 -15
- data/lib/metronome_sdk/resources/v1/contracts/products.rb +6 -2
- data/lib/metronome_sdk/resources/v1/contracts.rb +76 -2
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +5 -1
- data/lib/metronome_sdk/resources/v1/packages.rb +1 -3
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +3 -1
- data/rbi/metronome_sdk/internal/util.rbi +8 -0
- data/rbi/metronome_sdk/models/base_threshold_commit.rbi +24 -5
- data/rbi/metronome_sdk/models/contract_v2.rbi +916 -19
- data/rbi/metronome_sdk/models/credit.rbi +139 -3
- data/rbi/metronome_sdk/models/override.rbi +9 -12
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +54 -3
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +55 -4
- data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +54 -3
- data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +58 -9
- data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +22 -4
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +3 -416
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +5 -418
- data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +179 -0
- data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_response.rbi +714 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +74 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_update_params.rbi +74 -0
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +9 -0
- data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +75 -0
- data/rbi/metronome_sdk/models/v1/package_create_params.rbi +3 -76
- data/rbi/metronome_sdk/models/v1/package_list_response.rbi +72 -15
- data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +72 -17
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +133 -28
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1174 -145
- data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +18 -0
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +88 -3
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -0
- data/rbi/metronome_sdk/resources/v1/packages.rbi +0 -3
- data/sig/metronome_sdk/internal/util.rbs +4 -0
- data/sig/metronome_sdk/models/base_threshold_commit.rbs +13 -3
- data/sig/metronome_sdk/models/contract_v2.rbs +401 -16
- data/sig/metronome_sdk/models/credit.rbs +69 -0
- data/sig/metronome_sdk/models/override.rbs +8 -10
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +22 -3
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +23 -4
- data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +22 -3
- data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +26 -7
- data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +15 -2
- data/sig/metronome_sdk/models/v1/alert_create_params.rbs +3 -1
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +3 -147
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +3 -147
- data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +96 -0
- data/sig/metronome_sdk/models/v1/contract_list_seat_balances_response.rbs +299 -0
- data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/contracts/product_update_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +3 -1
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +7 -0
- data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +29 -1
- data/sig/metronome_sdk/models/v1/package_create_params.rbs +3 -30
- data/sig/metronome_sdk/models/v1/package_list_response.rbs +33 -15
- data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +33 -15
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +33 -10
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +409 -19
- data/sig/metronome_sdk/resources/v1/contracts/products.rbs +2 -0
- data/sig/metronome_sdk/resources/v1/contracts.rbs +15 -0
- data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +2 -0
- data/sig/metronome_sdk/resources/v1/packages.rbs +0 -1
- metadata +8 -2
|
@@ -110,7 +110,8 @@ module MetronomeSDK
|
|
|
110
110
|
MetronomeSDK::Credit::Ledger::CreditCanceledLedgerEntry::OrHash,
|
|
111
111
|
MetronomeSDK::Credit::Ledger::CreditCreditedLedgerEntry::OrHash,
|
|
112
112
|
MetronomeSDK::Credit::Ledger::CreditManualLedgerEntry::OrHash,
|
|
113
|
-
MetronomeSDK::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry::OrHash
|
|
113
|
+
MetronomeSDK::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry::OrHash,
|
|
114
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::OrHash
|
|
114
115
|
)
|
|
115
116
|
]
|
|
116
117
|
).void
|
|
@@ -152,6 +153,16 @@ module MetronomeSDK
|
|
|
152
153
|
sig { params(recurring_credit_id: String).void }
|
|
153
154
|
attr_writer :recurring_credit_id
|
|
154
155
|
|
|
156
|
+
sig { returns(T.nilable(MetronomeSDK::Credit::RolledOverFrom)) }
|
|
157
|
+
attr_reader :rolled_over_from
|
|
158
|
+
|
|
159
|
+
sig do
|
|
160
|
+
params(
|
|
161
|
+
rolled_over_from: MetronomeSDK::Credit::RolledOverFrom::OrHash
|
|
162
|
+
).void
|
|
163
|
+
end
|
|
164
|
+
attr_writer :rolled_over_from
|
|
165
|
+
|
|
155
166
|
# This field's availability is dependent on your client's configuration.
|
|
156
167
|
sig { returns(T.nilable(String)) }
|
|
157
168
|
attr_reader :salesforce_opportunity_id
|
|
@@ -216,7 +227,8 @@ module MetronomeSDK
|
|
|
216
227
|
MetronomeSDK::Credit::Ledger::CreditCanceledLedgerEntry::OrHash,
|
|
217
228
|
MetronomeSDK::Credit::Ledger::CreditCreditedLedgerEntry::OrHash,
|
|
218
229
|
MetronomeSDK::Credit::Ledger::CreditManualLedgerEntry::OrHash,
|
|
219
|
-
MetronomeSDK::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry::OrHash
|
|
230
|
+
MetronomeSDK::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry::OrHash,
|
|
231
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::OrHash
|
|
220
232
|
)
|
|
221
233
|
],
|
|
222
234
|
name: String,
|
|
@@ -224,6 +236,7 @@ module MetronomeSDK
|
|
|
224
236
|
priority: Float,
|
|
225
237
|
rate_type: MetronomeSDK::Credit::RateType::OrSymbol,
|
|
226
238
|
recurring_credit_id: String,
|
|
239
|
+
rolled_over_from: MetronomeSDK::Credit::RolledOverFrom::OrHash,
|
|
227
240
|
salesforce_opportunity_id: String,
|
|
228
241
|
specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
|
|
229
242
|
subscription_config: MetronomeSDK::Credit::SubscriptionConfig::OrHash,
|
|
@@ -267,6 +280,7 @@ module MetronomeSDK
|
|
|
267
280
|
# The ID of the recurring credit that this credit was generated from, if
|
|
268
281
|
# applicable.
|
|
269
282
|
recurring_credit_id: nil,
|
|
283
|
+
rolled_over_from: nil,
|
|
270
284
|
# This field's availability is dependent on your client's configuration.
|
|
271
285
|
salesforce_opportunity_id: nil,
|
|
272
286
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
@@ -305,6 +319,7 @@ module MetronomeSDK
|
|
|
305
319
|
priority: Float,
|
|
306
320
|
rate_type: MetronomeSDK::Credit::RateType::TaggedSymbol,
|
|
307
321
|
recurring_credit_id: String,
|
|
322
|
+
rolled_over_from: MetronomeSDK::Credit::RolledOverFrom,
|
|
308
323
|
salesforce_opportunity_id: String,
|
|
309
324
|
specifiers: T::Array[MetronomeSDK::CommitSpecifier],
|
|
310
325
|
subscription_config: MetronomeSDK::Credit::SubscriptionConfig,
|
|
@@ -388,7 +403,8 @@ module MetronomeSDK
|
|
|
388
403
|
MetronomeSDK::Credit::Ledger::CreditCanceledLedgerEntry,
|
|
389
404
|
MetronomeSDK::Credit::Ledger::CreditCreditedLedgerEntry,
|
|
390
405
|
MetronomeSDK::Credit::Ledger::CreditManualLedgerEntry,
|
|
391
|
-
MetronomeSDK::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry
|
|
406
|
+
MetronomeSDK::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry,
|
|
407
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry
|
|
392
408
|
)
|
|
393
409
|
end
|
|
394
410
|
|
|
@@ -1019,6 +1035,98 @@ module MetronomeSDK
|
|
|
1019
1035
|
end
|
|
1020
1036
|
end
|
|
1021
1037
|
|
|
1038
|
+
class CreditRolloverLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
|
|
1039
|
+
OrHash =
|
|
1040
|
+
T.type_alias do
|
|
1041
|
+
T.any(
|
|
1042
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry,
|
|
1043
|
+
MetronomeSDK::Internal::AnyHash
|
|
1044
|
+
)
|
|
1045
|
+
end
|
|
1046
|
+
|
|
1047
|
+
sig { returns(Float) }
|
|
1048
|
+
attr_accessor :amount
|
|
1049
|
+
|
|
1050
|
+
sig { returns(String) }
|
|
1051
|
+
attr_accessor :new_contract_id
|
|
1052
|
+
|
|
1053
|
+
sig { returns(String) }
|
|
1054
|
+
attr_accessor :segment_id
|
|
1055
|
+
|
|
1056
|
+
sig { returns(Time) }
|
|
1057
|
+
attr_accessor :timestamp
|
|
1058
|
+
|
|
1059
|
+
sig do
|
|
1060
|
+
returns(
|
|
1061
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::Type::TaggedSymbol
|
|
1062
|
+
)
|
|
1063
|
+
end
|
|
1064
|
+
attr_accessor :type
|
|
1065
|
+
|
|
1066
|
+
sig do
|
|
1067
|
+
params(
|
|
1068
|
+
amount: Float,
|
|
1069
|
+
new_contract_id: String,
|
|
1070
|
+
segment_id: String,
|
|
1071
|
+
timestamp: Time,
|
|
1072
|
+
type:
|
|
1073
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::Type::OrSymbol
|
|
1074
|
+
).returns(T.attached_class)
|
|
1075
|
+
end
|
|
1076
|
+
def self.new(
|
|
1077
|
+
amount:,
|
|
1078
|
+
new_contract_id:,
|
|
1079
|
+
segment_id:,
|
|
1080
|
+
timestamp:,
|
|
1081
|
+
type:
|
|
1082
|
+
)
|
|
1083
|
+
end
|
|
1084
|
+
|
|
1085
|
+
sig do
|
|
1086
|
+
override.returns(
|
|
1087
|
+
{
|
|
1088
|
+
amount: Float,
|
|
1089
|
+
new_contract_id: String,
|
|
1090
|
+
segment_id: String,
|
|
1091
|
+
timestamp: Time,
|
|
1092
|
+
type:
|
|
1093
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::Type::TaggedSymbol
|
|
1094
|
+
}
|
|
1095
|
+
)
|
|
1096
|
+
end
|
|
1097
|
+
def to_hash
|
|
1098
|
+
end
|
|
1099
|
+
|
|
1100
|
+
module Type
|
|
1101
|
+
extend MetronomeSDK::Internal::Type::Enum
|
|
1102
|
+
|
|
1103
|
+
TaggedSymbol =
|
|
1104
|
+
T.type_alias do
|
|
1105
|
+
T.all(
|
|
1106
|
+
Symbol,
|
|
1107
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::Type
|
|
1108
|
+
)
|
|
1109
|
+
end
|
|
1110
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1111
|
+
|
|
1112
|
+
CREDIT_ROLLOVER =
|
|
1113
|
+
T.let(
|
|
1114
|
+
:CREDIT_ROLLOVER,
|
|
1115
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::Type::TaggedSymbol
|
|
1116
|
+
)
|
|
1117
|
+
|
|
1118
|
+
sig do
|
|
1119
|
+
override.returns(
|
|
1120
|
+
T::Array[
|
|
1121
|
+
MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::Type::TaggedSymbol
|
|
1122
|
+
]
|
|
1123
|
+
)
|
|
1124
|
+
end
|
|
1125
|
+
def self.values
|
|
1126
|
+
end
|
|
1127
|
+
end
|
|
1128
|
+
end
|
|
1129
|
+
|
|
1022
1130
|
sig do
|
|
1023
1131
|
override.returns(T::Array[MetronomeSDK::Credit::Ledger::Variants])
|
|
1024
1132
|
end
|
|
@@ -1047,6 +1155,34 @@ module MetronomeSDK
|
|
|
1047
1155
|
end
|
|
1048
1156
|
end
|
|
1049
1157
|
|
|
1158
|
+
class RolledOverFrom < MetronomeSDK::Internal::Type::BaseModel
|
|
1159
|
+
OrHash =
|
|
1160
|
+
T.type_alias do
|
|
1161
|
+
T.any(
|
|
1162
|
+
MetronomeSDK::Credit::RolledOverFrom,
|
|
1163
|
+
MetronomeSDK::Internal::AnyHash
|
|
1164
|
+
)
|
|
1165
|
+
end
|
|
1166
|
+
|
|
1167
|
+
sig { returns(String) }
|
|
1168
|
+
attr_accessor :contract_id
|
|
1169
|
+
|
|
1170
|
+
sig { returns(String) }
|
|
1171
|
+
attr_accessor :credit_id
|
|
1172
|
+
|
|
1173
|
+
sig do
|
|
1174
|
+
params(contract_id: String, credit_id: String).returns(
|
|
1175
|
+
T.attached_class
|
|
1176
|
+
)
|
|
1177
|
+
end
|
|
1178
|
+
def self.new(contract_id:, credit_id:)
|
|
1179
|
+
end
|
|
1180
|
+
|
|
1181
|
+
sig { override.returns({ contract_id: String, credit_id: String }) }
|
|
1182
|
+
def to_hash
|
|
1183
|
+
end
|
|
1184
|
+
end
|
|
1185
|
+
|
|
1050
1186
|
class SubscriptionConfig < MetronomeSDK::Internal::Type::BaseModel
|
|
1051
1187
|
OrHash =
|
|
1052
1188
|
T.type_alias do
|
|
@@ -11,6 +11,9 @@ module MetronomeSDK
|
|
|
11
11
|
sig { returns(String) }
|
|
12
12
|
attr_accessor :id
|
|
13
13
|
|
|
14
|
+
sig { returns(Time) }
|
|
15
|
+
attr_accessor :created_at
|
|
16
|
+
|
|
14
17
|
sig { returns(Time) }
|
|
15
18
|
attr_accessor :starting_at
|
|
16
19
|
|
|
@@ -150,6 +153,7 @@ module MetronomeSDK
|
|
|
150
153
|
sig do
|
|
151
154
|
params(
|
|
152
155
|
id: String,
|
|
156
|
+
created_at: Time,
|
|
153
157
|
starting_at: Time,
|
|
154
158
|
applicable_product_tags: T::Array[String],
|
|
155
159
|
credit_type: MetronomeSDK::CreditTypeData::OrHash,
|
|
@@ -175,6 +179,7 @@ module MetronomeSDK
|
|
|
175
179
|
end
|
|
176
180
|
def self.new(
|
|
177
181
|
id:,
|
|
182
|
+
created_at:,
|
|
178
183
|
starting_at:,
|
|
179
184
|
applicable_product_tags: nil,
|
|
180
185
|
credit_type: nil,
|
|
@@ -210,6 +215,7 @@ module MetronomeSDK
|
|
|
210
215
|
override.returns(
|
|
211
216
|
{
|
|
212
217
|
id: String,
|
|
218
|
+
created_at: Time,
|
|
213
219
|
starting_at: Time,
|
|
214
220
|
applicable_product_tags: T::Array[String],
|
|
215
221
|
credit_type: MetronomeSDK::CreditTypeData,
|
|
@@ -303,12 +309,6 @@ module MetronomeSDK
|
|
|
303
309
|
sig { params(recurring_commit_ids: T::Array[String]).void }
|
|
304
310
|
attr_writer :recurring_commit_ids
|
|
305
311
|
|
|
306
|
-
sig { returns(T.nilable(T::Array[String])) }
|
|
307
|
-
attr_reader :recurring_credit_ids
|
|
308
|
-
|
|
309
|
-
sig { params(recurring_credit_ids: T::Array[String]).void }
|
|
310
|
-
attr_writer :recurring_credit_ids
|
|
311
|
-
|
|
312
312
|
sig do
|
|
313
313
|
params(
|
|
314
314
|
billing_frequency:
|
|
@@ -318,8 +318,7 @@ module MetronomeSDK
|
|
|
318
318
|
pricing_group_values: T::Hash[Symbol, String],
|
|
319
319
|
product_id: String,
|
|
320
320
|
product_tags: T::Array[String],
|
|
321
|
-
recurring_commit_ids: T::Array[String]
|
|
322
|
-
recurring_credit_ids: T::Array[String]
|
|
321
|
+
recurring_commit_ids: T::Array[String]
|
|
323
322
|
).returns(T.attached_class)
|
|
324
323
|
end
|
|
325
324
|
def self.new(
|
|
@@ -329,8 +328,7 @@ module MetronomeSDK
|
|
|
329
328
|
pricing_group_values: nil,
|
|
330
329
|
product_id: nil,
|
|
331
330
|
product_tags: nil,
|
|
332
|
-
recurring_commit_ids: nil
|
|
333
|
-
recurring_credit_ids: nil
|
|
331
|
+
recurring_commit_ids: nil
|
|
334
332
|
)
|
|
335
333
|
end
|
|
336
334
|
|
|
@@ -344,8 +342,7 @@ module MetronomeSDK
|
|
|
344
342
|
pricing_group_values: T::Hash[Symbol, String],
|
|
345
343
|
product_id: String,
|
|
346
344
|
product_tags: T::Array[String],
|
|
347
|
-
recurring_commit_ids: T::Array[String]
|
|
348
|
-
recurring_credit_ids: T::Array[String]
|
|
345
|
+
recurring_commit_ids: T::Array[String]
|
|
349
346
|
}
|
|
350
347
|
)
|
|
351
348
|
end
|
|
@@ -57,6 +57,23 @@ module MetronomeSDK
|
|
|
57
57
|
sig { params(custom_credit_type_id: String).void }
|
|
58
58
|
attr_writer :custom_credit_type_id
|
|
59
59
|
|
|
60
|
+
sig do
|
|
61
|
+
returns(
|
|
62
|
+
T.nilable(
|
|
63
|
+
MetronomeSDK::PrepaidBalanceThresholdConfiguration::DiscountConfiguration
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
attr_reader :discount_configuration
|
|
68
|
+
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
discount_configuration:
|
|
72
|
+
MetronomeSDK::PrepaidBalanceThresholdConfiguration::DiscountConfiguration::OrHash
|
|
73
|
+
).void
|
|
74
|
+
end
|
|
75
|
+
attr_writer :discount_configuration
|
|
76
|
+
|
|
60
77
|
sig do
|
|
61
78
|
params(
|
|
62
79
|
commit:
|
|
@@ -65,7 +82,9 @@ module MetronomeSDK
|
|
|
65
82
|
payment_gate_config: MetronomeSDK::PaymentGateConfig::OrHash,
|
|
66
83
|
recharge_to_amount: Float,
|
|
67
84
|
threshold_amount: Float,
|
|
68
|
-
custom_credit_type_id: String
|
|
85
|
+
custom_credit_type_id: String,
|
|
86
|
+
discount_configuration:
|
|
87
|
+
MetronomeSDK::PrepaidBalanceThresholdConfiguration::DiscountConfiguration::OrHash
|
|
69
88
|
).returns(T.attached_class)
|
|
70
89
|
end
|
|
71
90
|
def self.new(
|
|
@@ -82,7 +101,8 @@ module MetronomeSDK
|
|
|
82
101
|
threshold_amount:,
|
|
83
102
|
# If provided, the threshold, recharge-to amount, and the resulting threshold
|
|
84
103
|
# commit amount will be in terms of this credit type instead of the fiat currency.
|
|
85
|
-
custom_credit_type_id: nil
|
|
104
|
+
custom_credit_type_id: nil,
|
|
105
|
+
discount_configuration: nil
|
|
86
106
|
)
|
|
87
107
|
end
|
|
88
108
|
|
|
@@ -94,7 +114,9 @@ module MetronomeSDK
|
|
|
94
114
|
payment_gate_config: MetronomeSDK::PaymentGateConfig,
|
|
95
115
|
recharge_to_amount: Float,
|
|
96
116
|
threshold_amount: Float,
|
|
97
|
-
custom_credit_type_id: String
|
|
117
|
+
custom_credit_type_id: String,
|
|
118
|
+
discount_configuration:
|
|
119
|
+
MetronomeSDK::PrepaidBalanceThresholdConfiguration::DiscountConfiguration
|
|
98
120
|
}
|
|
99
121
|
)
|
|
100
122
|
end
|
|
@@ -178,6 +200,35 @@ module MetronomeSDK
|
|
|
178
200
|
def to_hash
|
|
179
201
|
end
|
|
180
202
|
end
|
|
203
|
+
|
|
204
|
+
class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
|
|
205
|
+
OrHash =
|
|
206
|
+
T.type_alias do
|
|
207
|
+
T.any(
|
|
208
|
+
MetronomeSDK::PrepaidBalanceThresholdConfiguration::DiscountConfiguration,
|
|
209
|
+
MetronomeSDK::Internal::AnyHash
|
|
210
|
+
)
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# The fraction of the original amount that the customer pays after applying the
|
|
214
|
+
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
215
|
+
# (a 15% discount).
|
|
216
|
+
sig { returns(Float) }
|
|
217
|
+
attr_accessor :payment_fraction
|
|
218
|
+
|
|
219
|
+
sig { params(payment_fraction: Float).returns(T.attached_class) }
|
|
220
|
+
def self.new(
|
|
221
|
+
# The fraction of the original amount that the customer pays after applying the
|
|
222
|
+
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
223
|
+
# (a 15% discount).
|
|
224
|
+
payment_fraction:
|
|
225
|
+
)
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
sig { override.returns({ payment_fraction: Float }) }
|
|
229
|
+
def to_hash
|
|
230
|
+
end
|
|
231
|
+
end
|
|
181
232
|
end
|
|
182
233
|
end
|
|
183
234
|
end
|
|
@@ -57,6 +57,23 @@ module MetronomeSDK
|
|
|
57
57
|
sig { params(custom_credit_type_id: String).void }
|
|
58
58
|
attr_writer :custom_credit_type_id
|
|
59
59
|
|
|
60
|
+
sig do
|
|
61
|
+
returns(
|
|
62
|
+
T.nilable(
|
|
63
|
+
MetronomeSDK::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
attr_reader :discount_configuration
|
|
68
|
+
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
discount_configuration:
|
|
72
|
+
MetronomeSDK::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration::OrHash
|
|
73
|
+
).void
|
|
74
|
+
end
|
|
75
|
+
attr_writer :discount_configuration
|
|
76
|
+
|
|
60
77
|
sig do
|
|
61
78
|
params(
|
|
62
79
|
commit:
|
|
@@ -65,7 +82,9 @@ module MetronomeSDK
|
|
|
65
82
|
payment_gate_config: MetronomeSDK::PaymentGateConfigV2::OrHash,
|
|
66
83
|
recharge_to_amount: Float,
|
|
67
84
|
threshold_amount: Float,
|
|
68
|
-
custom_credit_type_id: String
|
|
85
|
+
custom_credit_type_id: String,
|
|
86
|
+
discount_configuration:
|
|
87
|
+
MetronomeSDK::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration::OrHash
|
|
69
88
|
).returns(T.attached_class)
|
|
70
89
|
end
|
|
71
90
|
def self.new(
|
|
@@ -82,7 +101,8 @@ module MetronomeSDK
|
|
|
82
101
|
threshold_amount:,
|
|
83
102
|
# If provided, the threshold, recharge-to amount, and the resulting threshold
|
|
84
103
|
# commit amount will be in terms of this credit type instead of the fiat currency.
|
|
85
|
-
custom_credit_type_id: nil
|
|
104
|
+
custom_credit_type_id: nil,
|
|
105
|
+
discount_configuration: nil
|
|
86
106
|
)
|
|
87
107
|
end
|
|
88
108
|
|
|
@@ -95,14 +115,16 @@ module MetronomeSDK
|
|
|
95
115
|
payment_gate_config: MetronomeSDK::PaymentGateConfigV2,
|
|
96
116
|
recharge_to_amount: Float,
|
|
97
117
|
threshold_amount: Float,
|
|
98
|
-
custom_credit_type_id: String
|
|
118
|
+
custom_credit_type_id: String,
|
|
119
|
+
discount_configuration:
|
|
120
|
+
MetronomeSDK::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration
|
|
99
121
|
}
|
|
100
122
|
)
|
|
101
123
|
end
|
|
102
124
|
def to_hash
|
|
103
125
|
end
|
|
104
126
|
|
|
105
|
-
class Commit < MetronomeSDK::Models::
|
|
127
|
+
class Commit < MetronomeSDK::Models::BaseThresholdCommit
|
|
106
128
|
OrHash =
|
|
107
129
|
T.type_alias do
|
|
108
130
|
T.any(
|
|
@@ -183,6 +205,35 @@ module MetronomeSDK
|
|
|
183
205
|
def to_hash
|
|
184
206
|
end
|
|
185
207
|
end
|
|
208
|
+
|
|
209
|
+
class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
|
|
210
|
+
OrHash =
|
|
211
|
+
T.type_alias do
|
|
212
|
+
T.any(
|
|
213
|
+
MetronomeSDK::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration,
|
|
214
|
+
MetronomeSDK::Internal::AnyHash
|
|
215
|
+
)
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# The fraction of the original amount that the customer pays after applying the
|
|
219
|
+
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
220
|
+
# (a 15% discount).
|
|
221
|
+
sig { returns(Float) }
|
|
222
|
+
attr_accessor :payment_fraction
|
|
223
|
+
|
|
224
|
+
sig { params(payment_fraction: Float).returns(T.attached_class) }
|
|
225
|
+
def self.new(
|
|
226
|
+
# The fraction of the original amount that the customer pays after applying the
|
|
227
|
+
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
228
|
+
# (a 15% discount).
|
|
229
|
+
payment_fraction:
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
sig { override.returns({ payment_fraction: Float }) }
|
|
234
|
+
def to_hash
|
|
235
|
+
end
|
|
236
|
+
end
|
|
186
237
|
end
|
|
187
238
|
end
|
|
188
239
|
end
|
|
@@ -38,12 +38,31 @@ module MetronomeSDK
|
|
|
38
38
|
sig { returns(Float) }
|
|
39
39
|
attr_accessor :threshold_amount
|
|
40
40
|
|
|
41
|
+
sig do
|
|
42
|
+
returns(
|
|
43
|
+
T.nilable(
|
|
44
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
attr_reader :discount_configuration
|
|
49
|
+
|
|
50
|
+
sig do
|
|
51
|
+
params(
|
|
52
|
+
discount_configuration:
|
|
53
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration::OrHash
|
|
54
|
+
).void
|
|
55
|
+
end
|
|
56
|
+
attr_writer :discount_configuration
|
|
57
|
+
|
|
41
58
|
sig do
|
|
42
59
|
params(
|
|
43
60
|
commit: MetronomeSDK::BaseThresholdCommit::OrHash,
|
|
44
61
|
is_enabled: T::Boolean,
|
|
45
62
|
payment_gate_config: MetronomeSDK::PaymentGateConfig::OrHash,
|
|
46
|
-
threshold_amount: Float
|
|
63
|
+
threshold_amount: Float,
|
|
64
|
+
discount_configuration:
|
|
65
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration::OrHash
|
|
47
66
|
).returns(T.attached_class)
|
|
48
67
|
end
|
|
49
68
|
def self.new(
|
|
@@ -55,7 +74,8 @@ module MetronomeSDK
|
|
|
55
74
|
payment_gate_config:,
|
|
56
75
|
# Specify the threshold amount for the contract. Each time the contract's usage
|
|
57
76
|
# hits this amount, a threshold charge will be initiated.
|
|
58
|
-
threshold_amount
|
|
77
|
+
threshold_amount:,
|
|
78
|
+
discount_configuration: nil
|
|
59
79
|
)
|
|
60
80
|
end
|
|
61
81
|
|
|
@@ -65,12 +85,43 @@ module MetronomeSDK
|
|
|
65
85
|
commit: MetronomeSDK::BaseThresholdCommit,
|
|
66
86
|
is_enabled: T::Boolean,
|
|
67
87
|
payment_gate_config: MetronomeSDK::PaymentGateConfig,
|
|
68
|
-
threshold_amount: Float
|
|
88
|
+
threshold_amount: Float,
|
|
89
|
+
discount_configuration:
|
|
90
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration
|
|
69
91
|
}
|
|
70
92
|
)
|
|
71
93
|
end
|
|
72
94
|
def to_hash
|
|
73
95
|
end
|
|
96
|
+
|
|
97
|
+
class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
|
|
98
|
+
OrHash =
|
|
99
|
+
T.type_alias do
|
|
100
|
+
T.any(
|
|
101
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration,
|
|
102
|
+
MetronomeSDK::Internal::AnyHash
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# The fraction of the original amount that the customer pays after applying the
|
|
107
|
+
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
108
|
+
# (a 15% discount).
|
|
109
|
+
sig { returns(Float) }
|
|
110
|
+
attr_accessor :payment_fraction
|
|
111
|
+
|
|
112
|
+
sig { params(payment_fraction: Float).returns(T.attached_class) }
|
|
113
|
+
def self.new(
|
|
114
|
+
# The fraction of the original amount that the customer pays after applying the
|
|
115
|
+
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
116
|
+
# (a 15% discount).
|
|
117
|
+
payment_fraction:
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
sig { override.returns({ payment_fraction: Float }) }
|
|
122
|
+
def to_hash
|
|
123
|
+
end
|
|
124
|
+
end
|
|
74
125
|
end
|
|
75
126
|
end
|
|
76
127
|
end
|
|
@@ -11,12 +11,10 @@ module MetronomeSDK
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
sig { returns(MetronomeSDK::
|
|
14
|
+
sig { returns(MetronomeSDK::BaseThresholdCommit) }
|
|
15
15
|
attr_reader :commit
|
|
16
16
|
|
|
17
|
-
sig
|
|
18
|
-
params(commit: MetronomeSDK::UpdateBaseThresholdCommit::OrHash).void
|
|
19
|
-
end
|
|
17
|
+
sig { params(commit: MetronomeSDK::BaseThresholdCommit::OrHash).void }
|
|
20
18
|
attr_writer :commit
|
|
21
19
|
|
|
22
20
|
# When set to false, the contract will not be evaluated against the
|
|
@@ -40,12 +38,31 @@ module MetronomeSDK
|
|
|
40
38
|
sig { returns(Float) }
|
|
41
39
|
attr_accessor :threshold_amount
|
|
42
40
|
|
|
41
|
+
sig do
|
|
42
|
+
returns(
|
|
43
|
+
T.nilable(
|
|
44
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
attr_reader :discount_configuration
|
|
49
|
+
|
|
50
|
+
sig do
|
|
51
|
+
params(
|
|
52
|
+
discount_configuration:
|
|
53
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration::OrHash
|
|
54
|
+
).void
|
|
55
|
+
end
|
|
56
|
+
attr_writer :discount_configuration
|
|
57
|
+
|
|
43
58
|
sig do
|
|
44
59
|
params(
|
|
45
|
-
commit: MetronomeSDK::
|
|
60
|
+
commit: MetronomeSDK::BaseThresholdCommit::OrHash,
|
|
46
61
|
is_enabled: T::Boolean,
|
|
47
62
|
payment_gate_config: MetronomeSDK::PaymentGateConfigV2::OrHash,
|
|
48
|
-
threshold_amount: Float
|
|
63
|
+
threshold_amount: Float,
|
|
64
|
+
discount_configuration:
|
|
65
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration::OrHash
|
|
49
66
|
).returns(T.attached_class)
|
|
50
67
|
end
|
|
51
68
|
def self.new(
|
|
@@ -57,22 +74,54 @@ module MetronomeSDK
|
|
|
57
74
|
payment_gate_config:,
|
|
58
75
|
# Specify the threshold amount for the contract. Each time the contract's usage
|
|
59
76
|
# hits this amount, a threshold charge will be initiated.
|
|
60
|
-
threshold_amount
|
|
77
|
+
threshold_amount:,
|
|
78
|
+
discount_configuration: nil
|
|
61
79
|
)
|
|
62
80
|
end
|
|
63
81
|
|
|
64
82
|
sig do
|
|
65
83
|
override.returns(
|
|
66
84
|
{
|
|
67
|
-
commit: MetronomeSDK::
|
|
85
|
+
commit: MetronomeSDK::BaseThresholdCommit,
|
|
68
86
|
is_enabled: T::Boolean,
|
|
69
87
|
payment_gate_config: MetronomeSDK::PaymentGateConfigV2,
|
|
70
|
-
threshold_amount: Float
|
|
88
|
+
threshold_amount: Float,
|
|
89
|
+
discount_configuration:
|
|
90
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration
|
|
71
91
|
}
|
|
72
92
|
)
|
|
73
93
|
end
|
|
74
94
|
def to_hash
|
|
75
95
|
end
|
|
96
|
+
|
|
97
|
+
class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
|
|
98
|
+
OrHash =
|
|
99
|
+
T.type_alias do
|
|
100
|
+
T.any(
|
|
101
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration,
|
|
102
|
+
MetronomeSDK::Internal::AnyHash
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# The fraction of the original amount that the customer pays after applying the
|
|
107
|
+
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
108
|
+
# (a 15% discount).
|
|
109
|
+
sig { returns(Float) }
|
|
110
|
+
attr_accessor :payment_fraction
|
|
111
|
+
|
|
112
|
+
sig { params(payment_fraction: Float).returns(T.attached_class) }
|
|
113
|
+
def self.new(
|
|
114
|
+
# The fraction of the original amount that the customer pays after applying the
|
|
115
|
+
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
116
|
+
# (a 15% discount).
|
|
117
|
+
payment_fraction:
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
sig { override.returns({ payment_fraction: Float }) }
|
|
122
|
+
def to_hash
|
|
123
|
+
end
|
|
124
|
+
end
|
|
76
125
|
end
|
|
77
126
|
end
|
|
78
127
|
end
|