metronome-sdk 3.6.0 → 3.7.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 +16 -0
- data/README.md +1 -1
- data/lib/metronome_sdk/internal/type/enum.rb +0 -25
- data/lib/metronome_sdk/models/commit.rb +27 -1
- data/lib/metronome_sdk/models/contract.rb +140 -1
- data/lib/metronome_sdk/models/contract_v2.rb +168 -2
- data/lib/metronome_sdk/models/contract_without_amendments.rb +142 -1
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +105 -2
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +103 -2
- data/lib/metronome_sdk/models/spend_threshold_configuration.rb +33 -1
- data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +33 -1
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +29 -1
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +146 -2
- data/lib/metronome_sdk/models/v1/contract_create_response.rb +1134 -3
- data/lib/metronome_sdk/models/v1/package_create_params.rb +115 -1
- data/lib/metronome_sdk/models/v1/package_list_response.rb +110 -1
- data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +114 -1
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +303 -5
- data/lib/metronome_sdk/models/v2/contract_edit_response.rb +3862 -3
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +145 -3
- data/lib/metronome_sdk/resources/v1/contracts.rb +3 -1
- data/lib/metronome_sdk/resources/v1/packages.rb +6 -5
- data/lib/metronome_sdk/resources/v1.rb +0 -4
- data/lib/metronome_sdk/resources/v2/contracts.rb +5 -1
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +0 -8
- data/rbi/metronome_sdk/models/commit.rbi +48 -0
- data/rbi/metronome_sdk/models/contract.rbi +354 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +409 -0
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +368 -0
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +289 -6
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +283 -6
- data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +78 -3
- data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -3
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +54 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +368 -0
- data/rbi/metronome_sdk/models/v1/contract_create_response.rbi +2448 -4
- data/rbi/metronome_sdk/models/v1/package_create_params.rbi +310 -0
- data/rbi/metronome_sdk/models/v1/package_list_response.rbi +307 -0
- data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +307 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +734 -11
- data/rbi/metronome_sdk/models/v2/contract_edit_response.rbi +8612 -4
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +359 -11
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +7 -0
- data/rbi/metronome_sdk/resources/v1/packages.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1.rbi +0 -3
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +10 -0
- data/sig/metronome_sdk/models/commit.rbs +19 -0
- data/sig/metronome_sdk/models/contract.rbs +151 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +170 -0
- data/sig/metronome_sdk/models/contract_without_amendments.rbs +151 -0
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +116 -6
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +116 -6
- data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +31 -3
- data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +31 -3
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +19 -0
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +134 -0
- data/sig/metronome_sdk/models/v1/contract_create_response.rbs +1045 -4
- data/sig/metronome_sdk/models/v1/package_create_params.rbs +115 -0
- data/sig/metronome_sdk/models/v1/package_list_response.rbs +115 -0
- data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +115 -0
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +283 -9
- data/sig/metronome_sdk/models/v2/contract_edit_response.rbs +3792 -4
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +142 -9
- data/sig/metronome_sdk/resources/v1/contracts.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/packages.rbs +1 -0
- data/sig/metronome_sdk/resources/v1.rbs +0 -2
- data/sig/metronome_sdk/resources/v2/contracts.rbs +2 -0
- metadata +2 -26
- data/lib/metronome_sdk/models/v1/payment.rb +0 -196
- data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +0 -28
- data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +0 -18
- data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +0 -28
- data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +0 -18
- data/lib/metronome_sdk/models/v1/payment_list_params.rb +0 -53
- data/lib/metronome_sdk/models/v1/payment_status.rb +0 -19
- data/lib/metronome_sdk/resources/v1/payments.rb +0 -102
- data/rbi/metronome_sdk/models/v1/payment.rbi +0 -403
- data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +0 -48
- data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +0 -35
- data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +0 -48
- data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +0 -35
- data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +0 -91
- data/rbi/metronome_sdk/models/v1/payment_status.rbi +0 -33
- data/rbi/metronome_sdk/resources/v1/payments.rbi +0 -72
- data/sig/metronome_sdk/models/v1/payment.rbs +0 -243
- data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +0 -30
- data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +0 -15
- data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +0 -30
- data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +0 -15
- data/sig/metronome_sdk/models/v1/payment_list_params.rbs +0 -56
- data/sig/metronome_sdk/models/v1/payment_status.rbs +0 -19
- data/sig/metronome_sdk/resources/v1/payments.rbs +0 -30
|
@@ -109,18 +109,93 @@ module MetronomeSDK
|
|
|
109
109
|
sig { returns(Float) }
|
|
110
110
|
attr_accessor :payment_fraction
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
# If provided, the discount stops applying once the spend tracker has accumulated
|
|
113
|
+
# this much spend in the billing period.
|
|
114
|
+
sig do
|
|
115
|
+
returns(
|
|
116
|
+
T.nilable(
|
|
117
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration::Cap
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
attr_reader :cap
|
|
122
|
+
|
|
123
|
+
sig do
|
|
124
|
+
params(
|
|
125
|
+
cap:
|
|
126
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration::Cap::OrHash
|
|
127
|
+
).void
|
|
128
|
+
end
|
|
129
|
+
attr_writer :cap
|
|
130
|
+
|
|
131
|
+
sig do
|
|
132
|
+
params(
|
|
133
|
+
payment_fraction: Float,
|
|
134
|
+
cap:
|
|
135
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration::Cap::OrHash
|
|
136
|
+
).returns(T.attached_class)
|
|
137
|
+
end
|
|
113
138
|
def self.new(
|
|
114
139
|
# The fraction of the original amount that the customer pays after applying the
|
|
115
140
|
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
116
141
|
# (a 15% discount).
|
|
117
|
-
payment_fraction
|
|
142
|
+
payment_fraction:,
|
|
143
|
+
# If provided, the discount stops applying once the spend tracker has accumulated
|
|
144
|
+
# this much spend in the billing period.
|
|
145
|
+
cap: nil
|
|
118
146
|
)
|
|
119
147
|
end
|
|
120
148
|
|
|
121
|
-
sig
|
|
149
|
+
sig do
|
|
150
|
+
override.returns(
|
|
151
|
+
{
|
|
152
|
+
payment_fraction: Float,
|
|
153
|
+
cap:
|
|
154
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration::Cap
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
end
|
|
122
158
|
def to_hash
|
|
123
159
|
end
|
|
160
|
+
|
|
161
|
+
class Cap < MetronomeSDK::Internal::Type::BaseModel
|
|
162
|
+
OrHash =
|
|
163
|
+
T.type_alias do
|
|
164
|
+
T.any(
|
|
165
|
+
MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration::Cap,
|
|
166
|
+
MetronomeSDK::Internal::AnyHash
|
|
167
|
+
)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Accumulated spend ceiling above which the discount stops applying.
|
|
171
|
+
sig { returns(Float) }
|
|
172
|
+
attr_accessor :amount
|
|
173
|
+
|
|
174
|
+
# Alias of the spend tracker this cap is measured against.
|
|
175
|
+
sig { returns(String) }
|
|
176
|
+
attr_accessor :spend_tracker_alias
|
|
177
|
+
|
|
178
|
+
# If provided, the discount stops applying once the spend tracker has accumulated
|
|
179
|
+
# this much spend in the billing period.
|
|
180
|
+
sig do
|
|
181
|
+
params(amount: Float, spend_tracker_alias: String).returns(
|
|
182
|
+
T.attached_class
|
|
183
|
+
)
|
|
184
|
+
end
|
|
185
|
+
def self.new(
|
|
186
|
+
# Accumulated spend ceiling above which the discount stops applying.
|
|
187
|
+
amount:,
|
|
188
|
+
# Alias of the spend tracker this cap is measured against.
|
|
189
|
+
spend_tracker_alias:
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
sig do
|
|
194
|
+
override.returns({ amount: Float, spend_tracker_alias: String })
|
|
195
|
+
end
|
|
196
|
+
def to_hash
|
|
197
|
+
end
|
|
198
|
+
end
|
|
124
199
|
end
|
|
125
200
|
end
|
|
126
201
|
end
|
|
@@ -109,18 +109,93 @@ module MetronomeSDK
|
|
|
109
109
|
sig { returns(Float) }
|
|
110
110
|
attr_accessor :payment_fraction
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
# If provided, the discount stops applying once the spend tracker has accumulated
|
|
113
|
+
# this much spend in the billing period.
|
|
114
|
+
sig do
|
|
115
|
+
returns(
|
|
116
|
+
T.nilable(
|
|
117
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration::Cap
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
attr_reader :cap
|
|
122
|
+
|
|
123
|
+
sig do
|
|
124
|
+
params(
|
|
125
|
+
cap:
|
|
126
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration::Cap::OrHash
|
|
127
|
+
).void
|
|
128
|
+
end
|
|
129
|
+
attr_writer :cap
|
|
130
|
+
|
|
131
|
+
sig do
|
|
132
|
+
params(
|
|
133
|
+
payment_fraction: Float,
|
|
134
|
+
cap:
|
|
135
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration::Cap::OrHash
|
|
136
|
+
).returns(T.attached_class)
|
|
137
|
+
end
|
|
113
138
|
def self.new(
|
|
114
139
|
# The fraction of the original amount that the customer pays after applying the
|
|
115
140
|
# discount. For example, 0.85 means the customer pays 85% of the original amount
|
|
116
141
|
# (a 15% discount).
|
|
117
|
-
payment_fraction
|
|
142
|
+
payment_fraction:,
|
|
143
|
+
# If provided, the discount stops applying once the spend tracker has accumulated
|
|
144
|
+
# this much spend in the billing period.
|
|
145
|
+
cap: nil
|
|
118
146
|
)
|
|
119
147
|
end
|
|
120
148
|
|
|
121
|
-
sig
|
|
149
|
+
sig do
|
|
150
|
+
override.returns(
|
|
151
|
+
{
|
|
152
|
+
payment_fraction: Float,
|
|
153
|
+
cap:
|
|
154
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration::Cap
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
end
|
|
122
158
|
def to_hash
|
|
123
159
|
end
|
|
160
|
+
|
|
161
|
+
class Cap < MetronomeSDK::Internal::Type::BaseModel
|
|
162
|
+
OrHash =
|
|
163
|
+
T.type_alias do
|
|
164
|
+
T.any(
|
|
165
|
+
MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration::Cap,
|
|
166
|
+
MetronomeSDK::Internal::AnyHash
|
|
167
|
+
)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Accumulated spend ceiling above which the discount stops applying.
|
|
171
|
+
sig { returns(Float) }
|
|
172
|
+
attr_accessor :amount
|
|
173
|
+
|
|
174
|
+
# Alias of the spend tracker this cap is measured against.
|
|
175
|
+
sig { returns(String) }
|
|
176
|
+
attr_accessor :spend_tracker_alias
|
|
177
|
+
|
|
178
|
+
# If provided, the discount stops applying once the spend tracker has accumulated
|
|
179
|
+
# this much spend in the billing period.
|
|
180
|
+
sig do
|
|
181
|
+
params(amount: Float, spend_tracker_alias: String).returns(
|
|
182
|
+
T.attached_class
|
|
183
|
+
)
|
|
184
|
+
end
|
|
185
|
+
def self.new(
|
|
186
|
+
# Accumulated spend ceiling above which the discount stops applying.
|
|
187
|
+
amount:,
|
|
188
|
+
# Alias of the spend tracker this cap is measured against.
|
|
189
|
+
spend_tracker_alias:
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
sig do
|
|
194
|
+
override.returns({ amount: Float, spend_tracker_alias: String })
|
|
195
|
+
end
|
|
196
|
+
def to_hash
|
|
197
|
+
end
|
|
198
|
+
end
|
|
124
199
|
end
|
|
125
200
|
end
|
|
126
201
|
end
|
|
@@ -446,6 +446,24 @@ module MetronomeSDK
|
|
|
446
446
|
end
|
|
447
447
|
attr_writer :specifiers
|
|
448
448
|
|
|
449
|
+
# Optional attributes for spend tracker integration. Immutable after creation.
|
|
450
|
+
sig do
|
|
451
|
+
returns(
|
|
452
|
+
T.nilable(
|
|
453
|
+
MetronomeSDK::V1::ContractAmendParams::Commit::SpendTrackerAttributes
|
|
454
|
+
)
|
|
455
|
+
)
|
|
456
|
+
end
|
|
457
|
+
attr_reader :spend_tracker_attributes
|
|
458
|
+
|
|
459
|
+
sig do
|
|
460
|
+
params(
|
|
461
|
+
spend_tracker_attributes:
|
|
462
|
+
MetronomeSDK::V1::ContractAmendParams::Commit::SpendTrackerAttributes::OrHash
|
|
463
|
+
).void
|
|
464
|
+
end
|
|
465
|
+
attr_writer :spend_tracker_attributes
|
|
466
|
+
|
|
449
467
|
# A temporary ID for the commit that can be used to reference the commit for
|
|
450
468
|
# commit specific overrides.
|
|
451
469
|
sig { returns(T.nilable(String)) }
|
|
@@ -477,6 +495,8 @@ module MetronomeSDK
|
|
|
477
495
|
MetronomeSDK::V1::ContractAmendParams::Commit::RateType::OrSymbol,
|
|
478
496
|
rollover_fraction: Float,
|
|
479
497
|
specifiers: T::Array[MetronomeSDK::CommitSpecifierInput::OrHash],
|
|
498
|
+
spend_tracker_attributes:
|
|
499
|
+
MetronomeSDK::V1::ContractAmendParams::Commit::SpendTrackerAttributes::OrHash,
|
|
480
500
|
temporary_id: String
|
|
481
501
|
).returns(T.attached_class)
|
|
482
502
|
end
|
|
@@ -523,6 +543,8 @@ module MetronomeSDK
|
|
|
523
543
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
524
544
|
# be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
525
545
|
specifiers: nil,
|
|
546
|
+
# Optional attributes for spend tracker integration. Immutable after creation.
|
|
547
|
+
spend_tracker_attributes: nil,
|
|
526
548
|
# A temporary ID for the commit that can be used to reference the commit for
|
|
527
549
|
# commit specific overrides.
|
|
528
550
|
temporary_id: nil
|
|
@@ -553,6 +575,8 @@ module MetronomeSDK
|
|
|
553
575
|
MetronomeSDK::V1::ContractAmendParams::Commit::RateType::OrSymbol,
|
|
554
576
|
rollover_fraction: Float,
|
|
555
577
|
specifiers: T::Array[MetronomeSDK::CommitSpecifierInput],
|
|
578
|
+
spend_tracker_attributes:
|
|
579
|
+
MetronomeSDK::V1::ContractAmendParams::Commit::SpendTrackerAttributes,
|
|
556
580
|
temporary_id: String
|
|
557
581
|
}
|
|
558
582
|
)
|
|
@@ -1124,6 +1148,36 @@ module MetronomeSDK
|
|
|
1124
1148
|
def self.values
|
|
1125
1149
|
end
|
|
1126
1150
|
end
|
|
1151
|
+
|
|
1152
|
+
class SpendTrackerAttributes < MetronomeSDK::Internal::Type::BaseModel
|
|
1153
|
+
OrHash =
|
|
1154
|
+
T.type_alias do
|
|
1155
|
+
T.any(
|
|
1156
|
+
MetronomeSDK::V1::ContractAmendParams::Commit::SpendTrackerAttributes,
|
|
1157
|
+
MetronomeSDK::Internal::AnyHash
|
|
1158
|
+
)
|
|
1159
|
+
end
|
|
1160
|
+
|
|
1161
|
+
# If true, this commit will be included in spend trackers with discounted set to
|
|
1162
|
+
# DISCOUNTED_ONLY
|
|
1163
|
+
sig { returns(T::Boolean) }
|
|
1164
|
+
attr_accessor :counts_as_discounted
|
|
1165
|
+
|
|
1166
|
+
# Optional attributes for spend tracker integration. Immutable after creation.
|
|
1167
|
+
sig do
|
|
1168
|
+
params(counts_as_discounted: T::Boolean).returns(T.attached_class)
|
|
1169
|
+
end
|
|
1170
|
+
def self.new(
|
|
1171
|
+
# If true, this commit will be included in spend trackers with discounted set to
|
|
1172
|
+
# DISCOUNTED_ONLY
|
|
1173
|
+
counts_as_discounted:
|
|
1174
|
+
)
|
|
1175
|
+
end
|
|
1176
|
+
|
|
1177
|
+
sig { override.returns({ counts_as_discounted: T::Boolean }) }
|
|
1178
|
+
def to_hash
|
|
1179
|
+
end
|
|
1180
|
+
end
|
|
1127
1181
|
end
|
|
1128
1182
|
|
|
1129
1183
|
class Credit < MetronomeSDK::Internal::Type::BaseModel
|