metronome-sdk 2.2.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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +10 -1
  4. data/lib/metronome_sdk/models/commit.rb +69 -1
  5. data/lib/metronome_sdk/models/contract_v2.rb +18 -2
  6. data/lib/metronome_sdk/models/credit.rb +69 -1
  7. data/lib/metronome_sdk/models/rate.rb +1 -11
  8. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rb +1 -11
  9. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +1 -11
  10. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +1 -11
  11. data/lib/metronome_sdk/models/v1/custom_field_add_key_params.rb +4 -0
  12. data/lib/metronome_sdk/models/v1/custom_field_delete_values_params.rb +4 -0
  13. data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +4 -0
  14. data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +4 -0
  15. data/lib/metronome_sdk/models/v1/custom_field_remove_key_params.rb +4 -0
  16. data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +4 -0
  17. data/lib/metronome_sdk/models/v1/customers/invoice.rb +51 -1
  18. data/lib/metronome_sdk/models/v1/payment.rb +40 -1
  19. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +1 -3
  20. data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +1 -1
  21. data/lib/metronome_sdk/resources/v1/customers/billing_config.rb +5 -5
  22. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +7 -7
  23. data/lib/metronome_sdk/resources/v1/customers/plans.rb +5 -5
  24. data/lib/metronome_sdk/resources/v1/customers.rb +7 -7
  25. data/lib/metronome_sdk/resources/v1/plans.rb +2 -2
  26. data/lib/metronome_sdk/resources/v1/usage.rb +7 -7
  27. data/lib/metronome_sdk/version.rb +1 -1
  28. data/rbi/metronome_sdk/models/commit.rbi +171 -0
  29. data/rbi/metronome_sdk/models/contract_v2.rbi +22 -0
  30. data/rbi/metronome_sdk/models/credit.rbi +171 -0
  31. data/rbi/metronome_sdk/models/rate.rbi +3 -18
  32. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbi +3 -18
  33. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +0 -15
  34. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +3 -18
  35. data/rbi/metronome_sdk/models/v1/custom_field_add_key_params.rbi +20 -0
  36. data/rbi/metronome_sdk/models/v1/custom_field_delete_values_params.rbi +20 -0
  37. data/rbi/metronome_sdk/models/v1/custom_field_list_keys_params.rbi +20 -0
  38. data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +20 -0
  39. data/rbi/metronome_sdk/models/v1/custom_field_remove_key_params.rbi +20 -0
  40. data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +20 -0
  41. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +89 -0
  42. data/rbi/metronome_sdk/models/v1/payment.rbi +79 -0
  43. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +0 -5
  44. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +1 -1
  45. data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +5 -5
  46. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -7
  47. data/rbi/metronome_sdk/resources/v1/customers/plans.rbi +5 -5
  48. data/rbi/metronome_sdk/resources/v1/customers.rbi +7 -7
  49. data/rbi/metronome_sdk/resources/v1/plans.rbi +2 -2
  50. data/rbi/metronome_sdk/resources/v1/usage.rbi +7 -7
  51. data/sig/metronome_sdk/models/commit.rbs +74 -0
  52. data/sig/metronome_sdk/models/contract_v2.rbs +14 -0
  53. data/sig/metronome_sdk/models/credit.rbs +74 -0
  54. data/sig/metronome_sdk/models/rate.rbs +3 -10
  55. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbs +3 -10
  56. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +1 -8
  57. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +3 -10
  58. data/sig/metronome_sdk/models/v1/custom_field_add_key_params.rbs +8 -0
  59. data/sig/metronome_sdk/models/v1/custom_field_delete_values_params.rbs +8 -0
  60. data/sig/metronome_sdk/models/v1/custom_field_list_keys_params.rbs +8 -0
  61. data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +8 -0
  62. data/sig/metronome_sdk/models/v1/custom_field_remove_key_params.rbs +8 -0
  63. data/sig/metronome_sdk/models/v1/custom_field_set_values_params.rbs +8 -0
  64. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +46 -0
  65. data/sig/metronome_sdk/models/v1/payment.rbs +45 -0
  66. data/sig/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbs +0 -1
  67. metadata +16 -2
@@ -55,6 +55,12 @@ module MetronomeSDK
55
55
  # @return [MetronomeSDK::Models::V1::Payment::PaymentGateway, nil]
56
56
  optional :payment_gateway, -> { MetronomeSDK::V1::Payment::PaymentGateway }
57
57
 
58
+ # @!attribute revenue_system_payments
59
+ #
60
+ # @return [Array<MetronomeSDK::Models::V1::Payment::RevenueSystemPayment>, nil]
61
+ optional :revenue_system_payments,
62
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::Payment::RevenueSystemPayment] }
63
+
58
64
  # @!attribute status
59
65
  #
60
66
  # @return [Symbol, MetronomeSDK::Models::V1::PaymentStatus, nil]
@@ -65,7 +71,7 @@ module MetronomeSDK
65
71
  # @return [Time, nil]
66
72
  optional :updated_at, Time
67
73
 
68
- # @!method initialize(id:, amount: nil, amount_paid: nil, contract_id: nil, created_at: nil, customer_id: nil, error_message: nil, fiat_credit_type: nil, invoice_id: nil, payment_gateway: nil, status: nil, updated_at: nil)
74
+ # @!method initialize(id:, amount: nil, amount_paid: nil, contract_id: nil, created_at: nil, customer_id: nil, error_message: nil, fiat_credit_type: nil, invoice_id: nil, payment_gateway: nil, revenue_system_payments: nil, status: nil, updated_at: nil)
69
75
  # @param id [String]
70
76
  # @param amount [Float]
71
77
  # @param amount_paid [Float]
@@ -76,6 +82,7 @@ module MetronomeSDK
76
82
  # @param fiat_credit_type [MetronomeSDK::Models::CreditTypeData]
77
83
  # @param invoice_id [String]
78
84
  # @param payment_gateway [MetronomeSDK::Models::V1::Payment::PaymentGateway]
85
+ # @param revenue_system_payments [Array<MetronomeSDK::Models::V1::Payment::RevenueSystemPayment>]
79
86
  # @param status [Symbol, MetronomeSDK::Models::V1::PaymentStatus]
80
87
  # @param updated_at [Time]
81
88
 
@@ -151,6 +158,38 @@ module MetronomeSDK
151
158
  # @return [Array<Symbol>]
152
159
  end
153
160
  end
161
+
162
+ class RevenueSystemPayment < MetronomeSDK::Internal::Type::BaseModel
163
+ # @!attribute revenue_system_provider
164
+ #
165
+ # @return [String]
166
+ required :revenue_system_provider, String
167
+
168
+ # @!attribute sync_status
169
+ #
170
+ # @return [String]
171
+ required :sync_status, String
172
+
173
+ # @!attribute error_message
174
+ # The error message from the revenue system, if available.
175
+ #
176
+ # @return [String, nil]
177
+ optional :error_message, String
178
+
179
+ # @!attribute revenue_system_external_payment_id
180
+ #
181
+ # @return [String, nil]
182
+ optional :revenue_system_external_payment_id, String
183
+
184
+ # @!method initialize(revenue_system_provider:, sync_status:, error_message: nil, revenue_system_external_payment_id: nil)
185
+ # @param revenue_system_provider [String]
186
+ #
187
+ # @param sync_status [String]
188
+ #
189
+ # @param error_message [String] The error message from the revenue system, if available.
190
+ #
191
+ # @param revenue_system_external_payment_id [String]
192
+ end
154
193
  end
155
194
  end
156
195
  end
@@ -57,7 +57,7 @@ module MetronomeSDK
57
57
  #
58
58
  # Add a new rate
59
59
  #
60
- # @overload add(entitled:, product_id:, rate_card_id:, rate_type:, starting_at:, billing_frequency: nil, commit_rate: nil, credit_type_id: nil, custom_rate: nil, ending_before: nil, is_prorated: nil, price: nil, pricing_group_values: nil, quantity: nil, tiers: nil, use_list_prices: nil, request_options: {})
60
+ # @overload add(entitled:, product_id:, rate_card_id:, rate_type:, starting_at:, billing_frequency: nil, commit_rate: nil, credit_type_id: nil, custom_rate: nil, ending_before: nil, is_prorated: nil, price: nil, pricing_group_values: nil, quantity: nil, tiers: nil, request_options: {})
61
61
  #
62
62
  # @param entitled [Boolean]
63
63
  #
@@ -89,8 +89,6 @@ module MetronomeSDK
89
89
  #
90
90
  # @param tiers [Array<MetronomeSDK::Models::Tier>] Only set for TIERED rate_type.
91
91
  #
92
- # @param use_list_prices [Boolean] Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
93
- #
94
92
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
95
93
  #
96
94
  # @return [MetronomeSDK::Models::V1::Contracts::RateCards::RateAddResponse]
@@ -196,7 +196,7 @@ module MetronomeSDK
196
196
  #
197
197
  # @param next_page [String] Query param: Cursor that indicates where the next page of results should start.
198
198
  #
199
- # @param body [Object] Body param:
199
+ # @param body [Object] Body param
200
200
  #
201
201
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
202
202
  #
@@ -14,19 +14,19 @@ module MetronomeSDK
14
14
  #
15
15
  # @overload create(customer_id:, billing_provider_type:, billing_provider_customer_id:, aws_customer_account_id: nil, aws_customer_id: nil, aws_product_code: nil, aws_region: nil, stripe_collection_method: nil, request_options: {})
16
16
  #
17
- # @param customer_id [String] Path param:
17
+ # @param customer_id [String] Path param
18
18
  #
19
19
  # @param billing_provider_type [Symbol, MetronomeSDK::Models::V1::Customers::BillingConfigCreateParams::BillingProviderType] Path param: The billing provider (e.g. stripe)
20
20
  #
21
21
  # @param billing_provider_customer_id [String] Body param: The customer ID in the billing provider's system. For Azure, this is
22
22
  #
23
- # @param aws_customer_account_id [String] Body param:
23
+ # @param aws_customer_account_id [String] Body param
24
24
  #
25
- # @param aws_customer_id [String] Body param:
25
+ # @param aws_customer_id [String] Body param
26
26
  #
27
- # @param aws_product_code [String] Body param:
27
+ # @param aws_product_code [String] Body param
28
28
  #
29
- # @param aws_region [Symbol, MetronomeSDK::Models::V1::Customers::BillingConfigCreateParams::AwsRegion] Body param:
29
+ # @param aws_region [Symbol, MetronomeSDK::Models::V1::Customers::BillingConfigCreateParams::AwsRegion] Body param
30
30
  #
31
31
  # @param stripe_collection_method [Symbol, MetronomeSDK::Models::V1::Customers::BillingConfigCreateParams::StripeCollectionMethod] Body param: The collection method for the customer's invoices.
32
32
  #
@@ -51,9 +51,9 @@ module MetronomeSDK
51
51
  #
52
52
  # @overload retrieve(customer_id:, invoice_id:, skip_zero_qty_line_items: nil, request_options: {})
53
53
  #
54
- # @param customer_id [String] Path param:
54
+ # @param customer_id [String] Path param
55
55
  #
56
- # @param invoice_id [String] Path param:
56
+ # @param invoice_id [String] Path param
57
57
  #
58
58
  # @param skip_zero_qty_line_items [Boolean] Query param: If set, all zero quantity line items will be filtered out of the re
59
59
  #
@@ -133,7 +133,7 @@ module MetronomeSDK
133
133
  #
134
134
  # @overload list(customer_id:, credit_type_id: nil, ending_before: nil, limit: nil, next_page: nil, skip_zero_qty_line_items: nil, sort: nil, starting_on: nil, status: nil, request_options: {})
135
135
  #
136
- # @param customer_id [String] Path param:
136
+ # @param customer_id [String] Path param
137
137
  #
138
138
  # @param credit_type_id [String] Query param: Only return invoices for the specified credit type
139
139
  #
@@ -180,19 +180,19 @@ module MetronomeSDK
180
180
  #
181
181
  # @overload add_charge(customer_id:, charge_id:, customer_plan_id:, description:, invoice_start_timestamp:, price:, quantity:, request_options: {})
182
182
  #
183
- # @param customer_id [String] Path param:
183
+ # @param customer_id [String] Path param
184
184
  #
185
185
  # @param charge_id [String] Body param: The Metronome ID of the charge to add to the invoice. Note that the
186
186
  #
187
187
  # @param customer_plan_id [String] Body param: The Metronome ID of the customer plan to add the charge to.
188
188
  #
189
- # @param description [String] Body param:
189
+ # @param description [String] Body param
190
190
  #
191
191
  # @param invoice_start_timestamp [Time] Body param: The start_timestamp of the invoice to add the charge to.
192
192
  #
193
193
  # @param price [Float] Body param: The price of the charge. This price will match the currency on the i
194
194
  #
195
- # @param quantity [Float] Body param:
195
+ # @param quantity [Float] Body param
196
196
  #
197
197
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
198
198
  #
@@ -259,7 +259,7 @@ module MetronomeSDK
259
259
  #
260
260
  # @overload list_breakdowns(customer_id:, ending_before:, starting_on:, credit_type_id: nil, limit: nil, next_page: nil, skip_zero_qty_line_items: nil, sort: nil, status: nil, window_size: nil, request_options: {})
261
261
  #
262
- # @param customer_id [String] Path param:
262
+ # @param customer_id [String] Path param
263
263
  #
264
264
  # @param ending_before [Time] Query param: RFC 3339 timestamp. Breakdowns will only be returned for time windo
265
265
  #
@@ -10,7 +10,7 @@ module MetronomeSDK
10
10
  #
11
11
  # @overload list(customer_id:, limit: nil, next_page: nil, request_options: {})
12
12
  #
13
- # @param customer_id [String] Path param:
13
+ # @param customer_id [String] Path param
14
14
  #
15
15
  # @param limit [Integer] Query param: Max number of results that should be returned
16
16
  #
@@ -47,9 +47,9 @@ module MetronomeSDK
47
47
  #
48
48
  # @overload add(customer_id:, plan_id:, starting_on:, ending_before: nil, net_payment_terms_days: nil, overage_rate_adjustments: nil, price_adjustments: nil, trial_spec: nil, request_options: {})
49
49
  #
50
- # @param customer_id [String] Path param:
50
+ # @param customer_id [String] Path param
51
51
  #
52
- # @param plan_id [String] Body param:
52
+ # @param plan_id [String] Body param
53
53
  #
54
54
  # @param starting_on [Time] Body param: RFC 3339 timestamp for when the plan becomes active for this custome
55
55
  #
@@ -91,7 +91,7 @@ module MetronomeSDK
91
91
  #
92
92
  # @overload end_(customer_id:, customer_plan_id:, ending_before: nil, void_invoices: nil, void_stripe_invoices: nil, request_options: {})
93
93
  #
94
- # @param customer_id [String] Path param:
94
+ # @param customer_id [String] Path param
95
95
  #
96
96
  # @param customer_plan_id [String] Path param: the ID of a customer-plan relationship
97
97
  #
@@ -132,7 +132,7 @@ module MetronomeSDK
132
132
  #
133
133
  # @overload list_price_adjustments(customer_id:, customer_plan_id:, limit: nil, next_page: nil, request_options: {})
134
134
  #
135
- # @param customer_id [String] Path param:
135
+ # @param customer_id [String] Path param
136
136
  #
137
137
  # @param customer_plan_id [String] Path param: the ID of a customer-plan relationship
138
138
  #
@@ -209,7 +209,7 @@ module MetronomeSDK
209
209
  #
210
210
  # @overload list_billable_metrics(customer_id:, include_archived: nil, limit: nil, next_page: nil, on_current_plan: nil, request_options: {})
211
211
  #
212
- # @param customer_id [String] Path param:
212
+ # @param customer_id [String] Path param
213
213
  #
214
214
  # @param include_archived [Boolean] Query param: If true, the list of returned metrics will include archived metrics
215
215
  #
@@ -247,7 +247,7 @@ module MetronomeSDK
247
247
  #
248
248
  # @overload list_costs(customer_id:, ending_before:, starting_on:, limit: nil, next_page: nil, request_options: {})
249
249
  #
250
- # @param customer_id [String] Path param:
250
+ # @param customer_id [String] Path param
251
251
  #
252
252
  # @param ending_before [Time] Query param: RFC 3339 timestamp (exclusive)
253
253
  #
@@ -289,7 +289,7 @@ module MetronomeSDK
289
289
  #
290
290
  # @overload preview_events(customer_id:, events:, mode: nil, skip_zero_qty_line_items: nil, request_options: {})
291
291
  #
292
- # @param customer_id [String] Path param:
292
+ # @param customer_id [String] Path param
293
293
  #
294
294
  # @param events [Array<MetronomeSDK::Models::V1::CustomerPreviewEventsParams::Event>] Body param: Array of usage events to include in the preview calculation. Must co
295
295
  #
@@ -418,9 +418,9 @@ module MetronomeSDK
418
418
  #
419
419
  # @overload set_ingest_aliases(customer_id:, ingest_aliases:, request_options: {})
420
420
  #
421
- # @param customer_id [String] Path param:
421
+ # @param customer_id [String] Path param
422
422
  #
423
- # @param ingest_aliases [Array<String>] Body param:
423
+ # @param ingest_aliases [Array<String>] Body param
424
424
  #
425
425
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
426
426
  #
@@ -453,7 +453,7 @@ module MetronomeSDK
453
453
  #
454
454
  # @overload set_name(customer_id:, name:, request_options: {})
455
455
  #
456
- # @param customer_id [String] Path param:
456
+ # @param customer_id [String] Path param
457
457
  #
458
458
  # @param name [String] Body param: The new name for the customer. This will be truncated to 160 charact
459
459
  #
@@ -487,7 +487,7 @@ module MetronomeSDK
487
487
  #
488
488
  # @overload update_config(customer_id:, leave_stripe_invoices_in_draft: nil, salesforce_account_id: nil, request_options: {})
489
489
  #
490
- # @param customer_id [String] Path param:
490
+ # @param customer_id [String] Path param
491
491
  #
492
492
  # @param leave_stripe_invoices_in_draft [Boolean, nil] Body param: Leave in draft or set to auto-advance on invoices sent to Stripe. Fa
493
493
  #
@@ -60,7 +60,7 @@ module MetronomeSDK
60
60
  #
61
61
  # @overload list_charges(plan_id:, limit: nil, next_page: nil, request_options: {})
62
62
  #
63
- # @param plan_id [String] Path param:
63
+ # @param plan_id [String] Path param
64
64
  #
65
65
  # @param limit [Integer] Query param: Max number of results that should be returned
66
66
  #
@@ -96,7 +96,7 @@ module MetronomeSDK
96
96
  #
97
97
  # @overload list_customers(plan_id:, limit: nil, next_page: nil, status: nil, request_options: {})
98
98
  #
99
- # @param plan_id [String] Path param:
99
+ # @param plan_id [String] Path param
100
100
  #
101
101
  # @param limit [Integer] Query param: Max number of results that should be returned
102
102
  #
@@ -43,9 +43,9 @@ module MetronomeSDK
43
43
  #
44
44
  # @overload list(ending_before:, starting_on:, window_size:, next_page: nil, billable_metrics: nil, customer_ids: nil, request_options: {})
45
45
  #
46
- # @param ending_before [Time] Body param:
46
+ # @param ending_before [Time] Body param
47
47
  #
48
- # @param starting_on [Time] Body param:
48
+ # @param starting_on [Time] Body param
49
49
  #
50
50
  # @param window_size [Symbol, MetronomeSDK::Models::V1::UsageListParams::WindowSize] Body param: A window_size of "day" or "hour" will return the usage for the speci
51
51
  #
@@ -220,9 +220,9 @@ module MetronomeSDK
220
220
  #
221
221
  # @overload list_with_groups(billable_metric_id:, customer_id:, window_size:, limit: nil, next_page: nil, current_period: nil, ending_before: nil, group_by: nil, starting_on: nil, request_options: {})
222
222
  #
223
- # @param billable_metric_id [String] Body param:
223
+ # @param billable_metric_id [String] Body param
224
224
  #
225
- # @param customer_id [String] Body param:
225
+ # @param customer_id [String] Body param
226
226
  #
227
227
  # @param window_size [Symbol, MetronomeSDK::Models::V1::UsageListWithGroupsParams::WindowSize] Body param: A window_size of "day" or "hour" will return the usage for the speci
228
228
  #
@@ -232,11 +232,11 @@ module MetronomeSDK
232
232
  #
233
233
  # @param current_period [Boolean] Body param: If true, will return the usage for the current billing period. Will
234
234
  #
235
- # @param ending_before [Time] Body param:
235
+ # @param ending_before [Time] Body param
236
236
  #
237
- # @param group_by [MetronomeSDK::Models::V1::UsageListWithGroupsParams::GroupBy] Body param:
237
+ # @param group_by [MetronomeSDK::Models::V1::UsageListWithGroupsParams::GroupBy] Body param
238
238
  #
239
- # @param starting_on [Time] Body param:
239
+ # @param starting_on [Time] Body param
240
240
  #
241
241
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
242
242
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MetronomeSDK
4
- VERSION = "2.2.0"
4
+ VERSION = "3.0.0"
5
5
  end
@@ -195,6 +195,14 @@ module MetronomeSDK
195
195
  sig { params(rate_type: MetronomeSDK::Commit::RateType::OrSymbol).void }
196
196
  attr_writer :rate_type
197
197
 
198
+ # The ID of the recurring commit that this commit was generated from, if
199
+ # applicable.
200
+ sig { returns(T.nilable(String)) }
201
+ attr_reader :recurring_commit_id
202
+
203
+ sig { params(recurring_commit_id: String).void }
204
+ attr_writer :recurring_commit_id
205
+
198
206
  sig { returns(T.nilable(MetronomeSDK::Commit::RolledOverFrom)) }
199
207
  attr_reader :rolled_over_from
200
208
 
@@ -229,6 +237,18 @@ module MetronomeSDK
229
237
  end
230
238
  attr_writer :specifiers
231
239
 
240
+ # The subscription configuration for this commit, if it was generated from a
241
+ # recurring commit with a subscription attached.
242
+ sig { returns(T.nilable(MetronomeSDK::Commit::SubscriptionConfig)) }
243
+ attr_reader :subscription_config
244
+
245
+ sig do
246
+ params(
247
+ subscription_config: MetronomeSDK::Commit::SubscriptionConfig::OrHash
248
+ ).void
249
+ end
250
+ attr_writer :subscription_config
251
+
232
252
  # Prevents the creation of duplicates. If a request to create a commit or credit
233
253
  # is made with a uniqueness key that was previously used to create a commit or
234
254
  # credit, a new record will not be created and the request will fail with a 409
@@ -282,10 +302,12 @@ module MetronomeSDK
282
302
  netsuite_sales_order_id: String,
283
303
  priority: Float,
284
304
  rate_type: MetronomeSDK::Commit::RateType::OrSymbol,
305
+ recurring_commit_id: String,
285
306
  rolled_over_from: MetronomeSDK::Commit::RolledOverFrom::OrHash,
286
307
  rollover_fraction: Float,
287
308
  salesforce_opportunity_id: String,
288
309
  specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
310
+ subscription_config: MetronomeSDK::Commit::SubscriptionConfig::OrHash,
289
311
  uniqueness_key: String
290
312
  ).returns(T.attached_class)
291
313
  end
@@ -339,6 +361,9 @@ module MetronomeSDK
339
361
  # will apply first.
340
362
  priority: nil,
341
363
  rate_type: nil,
364
+ # The ID of the recurring commit that this commit was generated from, if
365
+ # applicable.
366
+ recurring_commit_id: nil,
342
367
  rolled_over_from: nil,
343
368
  rollover_fraction: nil,
344
369
  # This field's availability is dependent on your client's configuration.
@@ -347,6 +372,9 @@ module MetronomeSDK
347
372
  # or credit. A customer's usage needs to meet the condition of at least one of the
348
373
  # specifiers to contribute to a commit's or credit's drawdown.
349
374
  specifiers: nil,
375
+ # The subscription configuration for this commit, if it was generated from a
376
+ # recurring commit with a subscription attached.
377
+ subscription_config: nil,
350
378
  # Prevents the creation of duplicates. If a request to create a commit or credit
351
379
  # is made with a uniqueness key that was previously used to create a commit or
352
380
  # credit, a new record will not be created and the request will fail with a 409
@@ -380,10 +408,12 @@ module MetronomeSDK
380
408
  netsuite_sales_order_id: String,
381
409
  priority: Float,
382
410
  rate_type: MetronomeSDK::Commit::RateType::TaggedSymbol,
411
+ recurring_commit_id: String,
383
412
  rolled_over_from: MetronomeSDK::Commit::RolledOverFrom,
384
413
  rollover_fraction: Float,
385
414
  salesforce_opportunity_id: String,
386
415
  specifiers: T::Array[MetronomeSDK::CommitSpecifier],
416
+ subscription_config: MetronomeSDK::Commit::SubscriptionConfig,
387
417
  uniqueness_key: String
388
418
  }
389
419
  )
@@ -1793,6 +1823,147 @@ module MetronomeSDK
1793
1823
  def to_hash
1794
1824
  end
1795
1825
  end
1826
+
1827
+ class SubscriptionConfig < MetronomeSDK::Internal::Type::BaseModel
1828
+ OrHash =
1829
+ T.type_alias do
1830
+ T.any(
1831
+ MetronomeSDK::Commit::SubscriptionConfig,
1832
+ MetronomeSDK::Internal::AnyHash
1833
+ )
1834
+ end
1835
+
1836
+ sig do
1837
+ returns(
1838
+ T.nilable(
1839
+ MetronomeSDK::Commit::SubscriptionConfig::Allocation::TaggedSymbol
1840
+ )
1841
+ )
1842
+ end
1843
+ attr_reader :allocation
1844
+
1845
+ sig do
1846
+ params(
1847
+ allocation:
1848
+ MetronomeSDK::Commit::SubscriptionConfig::Allocation::OrSymbol
1849
+ ).void
1850
+ end
1851
+ attr_writer :allocation
1852
+
1853
+ sig do
1854
+ returns(
1855
+ T.nilable(
1856
+ MetronomeSDK::Commit::SubscriptionConfig::ApplySeatIncreaseConfig
1857
+ )
1858
+ )
1859
+ end
1860
+ attr_reader :apply_seat_increase_config
1861
+
1862
+ sig do
1863
+ params(
1864
+ apply_seat_increase_config:
1865
+ MetronomeSDK::Commit::SubscriptionConfig::ApplySeatIncreaseConfig::OrHash
1866
+ ).void
1867
+ end
1868
+ attr_writer :apply_seat_increase_config
1869
+
1870
+ sig { returns(T.nilable(String)) }
1871
+ attr_reader :subscription_id
1872
+
1873
+ sig { params(subscription_id: String).void }
1874
+ attr_writer :subscription_id
1875
+
1876
+ # The subscription configuration for this commit, if it was generated from a
1877
+ # recurring commit with a subscription attached.
1878
+ sig do
1879
+ params(
1880
+ allocation:
1881
+ MetronomeSDK::Commit::SubscriptionConfig::Allocation::OrSymbol,
1882
+ apply_seat_increase_config:
1883
+ MetronomeSDK::Commit::SubscriptionConfig::ApplySeatIncreaseConfig::OrHash,
1884
+ subscription_id: String
1885
+ ).returns(T.attached_class)
1886
+ end
1887
+ def self.new(
1888
+ allocation: nil,
1889
+ apply_seat_increase_config: nil,
1890
+ subscription_id: nil
1891
+ )
1892
+ end
1893
+
1894
+ sig do
1895
+ override.returns(
1896
+ {
1897
+ allocation:
1898
+ MetronomeSDK::Commit::SubscriptionConfig::Allocation::TaggedSymbol,
1899
+ apply_seat_increase_config:
1900
+ MetronomeSDK::Commit::SubscriptionConfig::ApplySeatIncreaseConfig,
1901
+ subscription_id: String
1902
+ }
1903
+ )
1904
+ end
1905
+ def to_hash
1906
+ end
1907
+
1908
+ module Allocation
1909
+ extend MetronomeSDK::Internal::Type::Enum
1910
+
1911
+ TaggedSymbol =
1912
+ T.type_alias do
1913
+ T.all(
1914
+ Symbol,
1915
+ MetronomeSDK::Commit::SubscriptionConfig::Allocation
1916
+ )
1917
+ end
1918
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1919
+
1920
+ INDIVIDUAL =
1921
+ T.let(
1922
+ :INDIVIDUAL,
1923
+ MetronomeSDK::Commit::SubscriptionConfig::Allocation::TaggedSymbol
1924
+ )
1925
+ POOLED =
1926
+ T.let(
1927
+ :POOLED,
1928
+ MetronomeSDK::Commit::SubscriptionConfig::Allocation::TaggedSymbol
1929
+ )
1930
+
1931
+ sig do
1932
+ override.returns(
1933
+ T::Array[
1934
+ MetronomeSDK::Commit::SubscriptionConfig::Allocation::TaggedSymbol
1935
+ ]
1936
+ )
1937
+ end
1938
+ def self.values
1939
+ end
1940
+ end
1941
+
1942
+ class ApplySeatIncreaseConfig < MetronomeSDK::Internal::Type::BaseModel
1943
+ OrHash =
1944
+ T.type_alias do
1945
+ T.any(
1946
+ MetronomeSDK::Commit::SubscriptionConfig::ApplySeatIncreaseConfig,
1947
+ MetronomeSDK::Internal::AnyHash
1948
+ )
1949
+ end
1950
+
1951
+ # Indicates whether a mid-period seat increase should be prorated.
1952
+ sig { returns(T::Boolean) }
1953
+ attr_accessor :is_prorated
1954
+
1955
+ sig { params(is_prorated: T::Boolean).returns(T.attached_class) }
1956
+ def self.new(
1957
+ # Indicates whether a mid-period seat increase should be prorated.
1958
+ is_prorated:
1959
+ )
1960
+ end
1961
+
1962
+ sig { override.returns({ is_prorated: T::Boolean }) }
1963
+ def to_hash
1964
+ end
1965
+ end
1966
+ end
1796
1967
  end
1797
1968
  end
1798
1969
  end
@@ -691,6 +691,13 @@ module MetronomeSDK
691
691
  end
692
692
  attr_writer :rate_type
693
693
 
694
+ # The ID of the recurring commit that created this commit
695
+ sig { returns(T.nilable(String)) }
696
+ attr_reader :recurring_commit_id
697
+
698
+ sig { params(recurring_commit_id: String).void }
699
+ attr_writer :recurring_commit_id
700
+
694
701
  sig do
695
702
  returns(T.nilable(MetronomeSDK::ContractV2::Commit::RolledOverFrom))
696
703
  end
@@ -787,6 +794,7 @@ module MetronomeSDK
787
794
  netsuite_sales_order_id: String,
788
795
  priority: Float,
789
796
  rate_type: MetronomeSDK::ContractV2::Commit::RateType::OrSymbol,
797
+ recurring_commit_id: String,
790
798
  rolled_over_from:
791
799
  MetronomeSDK::ContractV2::Commit::RolledOverFrom::OrHash,
792
800
  rollover_fraction: Float,
@@ -842,6 +850,8 @@ module MetronomeSDK
842
850
  # will apply first.
843
851
  priority: nil,
844
852
  rate_type: nil,
853
+ # The ID of the recurring commit that created this commit
854
+ recurring_commit_id: nil,
845
855
  rolled_over_from: nil,
846
856
  rollover_fraction: nil,
847
857
  # This field's availability is dependent on your client's configuration.
@@ -883,6 +893,7 @@ module MetronomeSDK
883
893
  priority: Float,
884
894
  rate_type:
885
895
  MetronomeSDK::ContractV2::Commit::RateType::TaggedSymbol,
896
+ recurring_commit_id: String,
886
897
  rolled_over_from:
887
898
  MetronomeSDK::ContractV2::Commit::RolledOverFrom,
888
899
  rollover_fraction: Float,
@@ -3307,6 +3318,13 @@ module MetronomeSDK
3307
3318
  sig { params(priority: Float).void }
3308
3319
  attr_writer :priority
3309
3320
 
3321
+ # The ID of the recurring credit that created this credit
3322
+ sig { returns(T.nilable(String)) }
3323
+ attr_reader :recurring_credit_id
3324
+
3325
+ sig { params(recurring_credit_id: String).void }
3326
+ attr_writer :recurring_credit_id
3327
+
3310
3328
  # This field's availability is dependent on your client's configuration.
3311
3329
  sig { returns(T.nilable(String)) }
3312
3330
  attr_reader :salesforce_opportunity_id
@@ -3372,6 +3390,7 @@ module MetronomeSDK
3372
3390
  name: String,
3373
3391
  netsuite_sales_order_id: String,
3374
3392
  priority: Float,
3393
+ recurring_credit_id: String,
3375
3394
  salesforce_opportunity_id: String,
3376
3395
  specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
3377
3396
  subscription_config:
@@ -3416,6 +3435,8 @@ module MetronomeSDK
3416
3435
  # If multiple credits or commits are applicable, the one with the lower priority
3417
3436
  # will apply first.
3418
3437
  priority: nil,
3438
+ # The ID of the recurring credit that created this credit
3439
+ recurring_credit_id: nil,
3419
3440
  # This field's availability is dependent on your client's configuration.
3420
3441
  salesforce_opportunity_id: nil,
3421
3442
  # List of filters that determine what kind of customer usage draws down a commit
@@ -3449,6 +3470,7 @@ module MetronomeSDK
3449
3470
  name: String,
3450
3471
  netsuite_sales_order_id: String,
3451
3472
  priority: Float,
3473
+ recurring_credit_id: String,
3452
3474
  salesforce_opportunity_id: String,
3453
3475
  specifiers: T::Array[MetronomeSDK::CommitSpecifier],
3454
3476
  subscription_config: