metronome-sdk 3.8.0 → 3.10.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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/models/commit.rb +9 -1
  5. data/lib/metronome_sdk/models/contract.rb +46 -16
  6. data/lib/metronome_sdk/models/contract_v2.rb +378 -15
  7. data/lib/metronome_sdk/models/contract_without_amendments.rb +8 -5
  8. data/lib/metronome_sdk/models/v1/contract_create_params.rb +8 -5
  9. data/lib/metronome_sdk/models/v1/contract_create_response.rb +73 -18
  10. data/lib/metronome_sdk/models/v1/contracts/rate_card_update_params.rb +27 -1
  11. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +32 -5
  12. data/lib/metronome_sdk/models/v1/package_create_params.rb +8 -4
  13. data/lib/metronome_sdk/models/v1/package_list_response.rb +8 -4
  14. data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +8 -4
  15. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +11 -1
  16. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +11 -1
  17. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +14 -8
  18. data/lib/metronome_sdk/models/v2/contract_edit_response.rb +8 -4
  19. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +8 -4
  20. data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +11 -14
  21. data/lib/metronome_sdk/resources/v1/dashboards.rb +6 -9
  22. data/lib/metronome_sdk/resources/v2/contracts.rb +6 -2
  23. data/lib/metronome_sdk/version.rb +1 -1
  24. data/rbi/metronome_sdk/models/commit.rbi +11 -0
  25. data/rbi/metronome_sdk/models/contract.rbi +47 -22
  26. data/rbi/metronome_sdk/models/contract_v2.rbi +711 -19
  27. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +12 -11
  28. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +12 -11
  29. data/rbi/metronome_sdk/models/v1/contract_create_response.rbi +72 -43
  30. data/rbi/metronome_sdk/models/v1/contracts/rate_card_update_params.rbi +67 -0
  31. data/rbi/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbi +96 -5
  32. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +12 -6
  33. data/rbi/metronome_sdk/models/v1/package_list_response.rbi +12 -6
  34. data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +12 -6
  35. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +12 -0
  36. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +12 -0
  37. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +28 -18
  38. data/rbi/metronome_sdk/models/v2/contract_edit_response.rbi +12 -6
  39. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +12 -6
  40. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +15 -13
  41. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +6 -9
  42. data/rbi/metronome_sdk/resources/v2/contracts.rbi +10 -0
  43. data/sig/metronome_sdk/models/commit.rbs +7 -0
  44. data/sig/metronome_sdk/models/contract.rbs +22 -11
  45. data/sig/metronome_sdk/models/contract_v2.rbs +289 -5
  46. data/sig/metronome_sdk/models/contract_without_amendments.rbs +1 -2
  47. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +1 -2
  48. data/sig/metronome_sdk/models/v1/contract_create_response.rbs +31 -17
  49. data/sig/metronome_sdk/models/v1/contracts/rate_card_update_params.rbs +28 -0
  50. data/sig/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbs +39 -4
  51. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +5 -0
  52. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +5 -0
  53. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +12 -14
  54. data/sig/metronome_sdk/resources/v1/contracts/rate_cards.rbs +1 -0
  55. data/sig/metronome_sdk/resources/v2/contracts.rbs +2 -0
  56. metadata +2 -2
@@ -112,24 +112,19 @@ module MetronomeSDK
112
112
  # Some parameter documentations has been truncated, see
113
113
  # {MetronomeSDK::Models::V1::Contracts::RateCardUpdateParams} for more details.
114
114
  #
115
- # Update the metadata properties of an existing rate card, including its name,
116
- # description, and aliases. This endpoint is designed for managing rate card
117
- # identity and reference aliases rather than modifying pricing rates.
118
- #
119
- # Modifies the descriptive properties and alias configuration of a rate card
120
- # without affecting the underlying pricing rates or schedules. This allows you to
121
- # update how a rate card is identified and referenced throughout your system.
115
+ # Update a rate card's name, description, aliases, and credit type conversion
116
+ # rates. This endpoint does not affect underlying pricing rates or schedules.
122
117
  #
123
118
  # ### Use this endpoint to:
124
119
  #
125
- # - Rate card renaming: Update display names or descriptions for organizational
120
+ # - Rename rate cards: Update display names or descriptions for organizational
126
121
  # clarity
127
- # - Alias management: Add, modify, or schedule alias transitions for seamless rate
128
- # card migrations
129
- # - Documentation updates: Keep rate card descriptions current with business
122
+ # - Manage aliases: Add, modify, or schedule alias transitions for seamless and
123
+ # code-free rate card migrations
124
+ # - Update documentation: Keep rate card descriptions current with business
130
125
  # context
131
- # - Self-serve provisioning setup: Configure aliases to enable code-free rate card
132
- # transitions
126
+ # - Configure custom pricing units: Add credit type conversions to enable rates
127
+ # with different pricing units
133
128
  #
134
129
  # #### Active contract impact:
135
130
  #
@@ -165,10 +160,12 @@ module MetronomeSDK
165
160
  # your PLG workflow using that alias will automatically reference the new rate
166
161
  # card
167
162
  #
168
- # @overload update(rate_card_id:, aliases: nil, description: nil, name: nil, request_options: {})
163
+ # @overload update(rate_card_id:, add_credit_type_conversions: nil, aliases: nil, description: nil, name: nil, request_options: {})
169
164
  #
170
165
  # @param rate_card_id [String] ID of the rate card to update
171
166
  #
167
+ # @param add_credit_type_conversions [Array<MetronomeSDK::Models::V1::Contracts::RateCardUpdateParams::AddCreditTypeConversion>] Add credit type conversions for using custom pricing units in rates. Existing co
168
+ #
172
169
  # @param aliases [Array<MetronomeSDK::Models::V1::Contracts::RateCardUpdateParams::Alias>] Reference this alias when creating a contract. If the same alias is assigned to
173
170
  #
174
171
  # @param description [String]
@@ -30,16 +30,13 @@ module MetronomeSDK
30
30
  #
31
31
  # - Dashboard types: Choose from `invoices`, `usage`, or `commits_and_credits`
32
32
  # - Customization options:
33
- # - `dashboard_options`: Configure dashboard behavior. For the invoices
34
- # dashboard, supported keys include: `show_zero_usage_line_items`
35
- # ("true"/"false"), `hide_voided_invoices` ("true"/"false"), `contract_id`
36
- # (UUID, filters invoices by contract), `invoice_type` ("USAGE" or
37
- # "SCHEDULED", filters by invoice type), `invoice_status_filter` ("VOID",
38
- # "FINALIZED", "DRAFT", "FINALIZED_AND_DRAFT", or "ALL"), and
39
- # `billable_status_filter` ("BILLABLE", "UNBILLABLE", or "ALL")
33
+ # - `dashboard_options`: Configure dashboard behavior. Supported for the
34
+ # invoices dashboard only. Available keys include:
35
+ # `show_zero_usage_line_items` ("true"/"false"), `contract_id` (UUID, filters
36
+ # invoices by contract), `invoice_type` ("USAGE" or "SCHEDULED", filters by
37
+ # invoice type), and `invoice_status_filter` ("VOID", "FINALIZED", "DRAFT",
38
+ # "FINALIZED_AND_DRAFT", or "ALL")
40
39
  # - `color_overrides`: Match your brand's color palette
41
- # - `bm_group_key_overrides`: Customize how dimensions are displayed (for the
42
- # usage embeddable dashboard)
43
40
  # - Iframe implementation: Embed the returned URL directly in an iframe element
44
41
  # - Responsive design: Dashboards automatically adapt to container dimensions
45
42
  #
@@ -236,7 +236,7 @@ module MetronomeSDK
236
236
  # finalized invoice. You can void the invoice beforehand and then remove the
237
237
  # access schedule segment.
238
238
  #
239
- # @overload edit_commit(commit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, invoice_contract_id: nil, invoice_schedule: nil, name: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
239
+ # @overload edit_commit(commit_id:, customer_id:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, invoice_contract_id: nil, invoice_schedule: nil, name: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
240
240
  #
241
241
  # @param commit_id [String] ID of the commit to edit
242
242
  #
@@ -244,6 +244,8 @@ module MetronomeSDK
244
244
  #
245
245
  # @param access_schedule [MetronomeSDK::Models::V2::ContractEditCommitParams::AccessSchedule]
246
246
  #
247
+ # @param applicable_contract_ids [Array<String>, nil] Which contracts the customer-level commit applies to. If set to null, the commit
248
+ #
247
249
  # @param applicable_product_ids [Array<String>, nil] Which products the commit applies to. If applicable_product_ids, applicable_prod
248
250
  #
249
251
  # @param applicable_product_tags [Array<String>, nil] Which tags the commit applies to. If applicable*product_ids, applicable_product*
@@ -302,7 +304,7 @@ module MetronomeSDK
302
304
  # invoice. You can void the invoice beforehand and then remove the access
303
305
  # schedule segment.
304
306
  #
305
- # @overload edit_credit(credit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, name: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
307
+ # @overload edit_credit(credit_id:, customer_id:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, name: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
306
308
  #
307
309
  # @param credit_id [String] ID of the credit to edit
308
310
  #
@@ -310,6 +312,8 @@ module MetronomeSDK
310
312
  #
311
313
  # @param access_schedule [MetronomeSDK::Models::V2::ContractEditCreditParams::AccessSchedule]
312
314
  #
315
+ # @param applicable_contract_ids [Array<String>, nil] Which contracts the customer-level credit applies to. If set to null, the credit
316
+ #
313
317
  # @param applicable_product_ids [Array<String>, nil] Which products the credit applies to. If both applicable_product_ids and applica
314
318
  #
315
319
  # @param applicable_product_tags [Array<String>, nil] Which tags the credit applies to. If both applicable*product_ids and applicable*
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MetronomeSDK
4
- VERSION = "3.8.0"
4
+ VERSION = "3.10.0"
5
5
  end
@@ -91,6 +91,13 @@ module MetronomeSDK
91
91
  sig { params(contract: MetronomeSDK::Commit::Contract::OrHash).void }
92
92
  attr_writer :contract
93
93
 
94
+ # The ratio of the amount paid for the commit to the amount of credit granted.
95
+ sig { returns(T.nilable(Float)) }
96
+ attr_reader :cost_basis
97
+
98
+ sig { params(cost_basis: Float).void }
99
+ attr_writer :cost_basis
100
+
94
101
  # The actor who created this commit. Omitted for system-generated commits such as
95
102
  # recurring commits, rollover commits, and threshold commits.
96
103
  sig { returns(T.nilable(String)) }
@@ -293,6 +300,7 @@ module MetronomeSDK
293
300
  archived_at: Time,
294
301
  balance: Float,
295
302
  contract: MetronomeSDK::Commit::Contract::OrHash,
303
+ cost_basis: Float,
296
304
  created_by: String,
297
305
  custom_fields: T::Hash[Symbol, String],
298
306
  description: String,
@@ -365,6 +373,8 @@ module MetronomeSDK
365
373
  # included in the balance, including future-dated manual ledger entries.
366
374
  balance: nil,
367
375
  contract: nil,
376
+ # The ratio of the amount paid for the commit to the amount of credit granted.
377
+ cost_basis: nil,
368
378
  # The actor who created this commit. Omitted for system-generated commits such as
369
379
  # recurring commits, rollover commits, and threshold commits.
370
380
  created_by: nil,
@@ -426,6 +436,7 @@ module MetronomeSDK
426
436
  archived_at: Time,
427
437
  balance: Float,
428
438
  contract: MetronomeSDK::Commit::Contract,
439
+ cost_basis: Float,
429
440
  created_by: String,
430
441
  custom_fields: T::Hash[Symbol, String],
431
442
  description: String,
@@ -48,7 +48,6 @@ module MetronomeSDK
48
48
  sig { params(custom_fields: T::Hash[Symbol, String]).void }
49
49
  attr_writer :custom_fields
50
50
 
51
- # The billing provider configuration associated with a contract.
52
51
  sig do
53
52
  returns(
54
53
  T.nilable(
@@ -183,7 +182,6 @@ module MetronomeSDK
183
182
  archived_at: nil,
184
183
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
185
184
  custom_fields: nil,
186
- # The billing provider configuration associated with a contract.
187
185
  customer_billing_provider_configuration: nil,
188
186
  # ID of the package this contract was created from, if applicable.
189
187
  package_id: nil,
@@ -567,9 +565,15 @@ module MetronomeSDK
567
565
  )
568
566
  end
569
567
 
568
+ # ID of this configuration; can be provided as the
569
+ # billing_provider_configuration_id when creating a contract.
570
+ sig { returns(String) }
571
+ attr_accessor :id
572
+
570
573
  sig { returns(T.nilable(Time)) }
571
574
  attr_accessor :archived_at
572
575
 
576
+ # The billing provider set for this configuration.
573
577
  sig do
574
578
  returns(
575
579
  MetronomeSDK::Contract::CustomerBillingProviderConfiguration::BillingProvider::TaggedSymbol
@@ -577,6 +581,15 @@ module MetronomeSDK
577
581
  end
578
582
  attr_accessor :billing_provider
579
583
 
584
+ # Configuration for the billing provider. The structure of this object is specific
585
+ # to the billing provider.
586
+ sig { returns(T::Hash[Symbol, T.anything]) }
587
+ attr_accessor :configuration
588
+
589
+ sig { returns(String) }
590
+ attr_accessor :customer_id
591
+
592
+ # The method to use for delivering invoices to this customer.
580
593
  sig do
581
594
  returns(
582
595
  MetronomeSDK::Contract::CustomerBillingProviderConfiguration::DeliveryMethod::TaggedSymbol
@@ -584,59 +597,70 @@ module MetronomeSDK
584
597
  end
585
598
  attr_accessor :delivery_method
586
599
 
587
- sig { returns(T.nilable(String)) }
588
- attr_reader :id
589
-
590
- sig { params(id: String).void }
591
- attr_writer :id
592
-
593
- # Configuration for the billing provider. The structure of this object is specific
594
- # to the billing provider.
595
- sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
596
- attr_reader :configuration
600
+ # Configuration for the delivery method. The structure of this object is specific
601
+ # to the delivery method.
602
+ sig { returns(T::Hash[Symbol, T.anything]) }
603
+ attr_accessor :delivery_method_configuration
597
604
 
598
- sig { params(configuration: T::Hash[Symbol, T.anything]).void }
599
- attr_writer :configuration
605
+ # ID of the delivery method to use for this customer.
606
+ sig { returns(String) }
607
+ attr_accessor :delivery_method_id
600
608
 
601
- # The billing provider configuration associated with a contract.
602
609
  sig do
603
610
  params(
611
+ id: String,
604
612
  archived_at: T.nilable(Time),
605
613
  billing_provider:
606
614
  MetronomeSDK::Contract::CustomerBillingProviderConfiguration::BillingProvider::OrSymbol,
615
+ configuration: T::Hash[Symbol, T.anything],
616
+ customer_id: String,
607
617
  delivery_method:
608
618
  MetronomeSDK::Contract::CustomerBillingProviderConfiguration::DeliveryMethod::OrSymbol,
609
- id: String,
610
- configuration: T::Hash[Symbol, T.anything]
619
+ delivery_method_configuration: T::Hash[Symbol, T.anything],
620
+ delivery_method_id: String
611
621
  ).returns(T.attached_class)
612
622
  end
613
623
  def self.new(
624
+ # ID of this configuration; can be provided as the
625
+ # billing_provider_configuration_id when creating a contract.
626
+ id:,
614
627
  archived_at:,
628
+ # The billing provider set for this configuration.
615
629
  billing_provider:,
616
- delivery_method:,
617
- id: nil,
618
630
  # Configuration for the billing provider. The structure of this object is specific
619
631
  # to the billing provider.
620
- configuration: nil
632
+ configuration:,
633
+ customer_id:,
634
+ # The method to use for delivering invoices to this customer.
635
+ delivery_method:,
636
+ # Configuration for the delivery method. The structure of this object is specific
637
+ # to the delivery method.
638
+ delivery_method_configuration:,
639
+ # ID of the delivery method to use for this customer.
640
+ delivery_method_id:
621
641
  )
622
642
  end
623
643
 
624
644
  sig do
625
645
  override.returns(
626
646
  {
647
+ id: String,
627
648
  archived_at: T.nilable(Time),
628
649
  billing_provider:
629
650
  MetronomeSDK::Contract::CustomerBillingProviderConfiguration::BillingProvider::TaggedSymbol,
651
+ configuration: T::Hash[Symbol, T.anything],
652
+ customer_id: String,
630
653
  delivery_method:
631
654
  MetronomeSDK::Contract::CustomerBillingProviderConfiguration::DeliveryMethod::TaggedSymbol,
632
- id: String,
633
- configuration: T::Hash[Symbol, T.anything]
655
+ delivery_method_configuration: T::Hash[Symbol, T.anything],
656
+ delivery_method_id: String
634
657
  }
635
658
  )
636
659
  end
637
660
  def to_hash
638
661
  end
639
662
 
663
+ # The billing provider set for this configuration.
640
664
  module BillingProvider
641
665
  extend MetronomeSDK::Internal::Type::Enum
642
666
 
@@ -706,6 +730,7 @@ module MetronomeSDK
706
730
  end
707
731
  end
708
732
 
733
+ # The method to use for delivering invoices to this customer.
709
734
  module DeliveryMethod
710
735
  extend MetronomeSDK::Internal::Type::Enum
711
736