metronome-sdk 2.0.0 → 2.2.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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +75 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/internal/transport/base_client.rb +7 -1
  5. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +38 -26
  6. data/lib/metronome_sdk/internal/util.rb +7 -2
  7. data/lib/metronome_sdk/models/contract.rb +1 -0
  8. data/lib/metronome_sdk/models/contract_v2.rb +69 -23
  9. data/lib/metronome_sdk/models/hierarchy_configuration.rb +45 -21
  10. data/lib/metronome_sdk/models/subscription.rb +38 -1
  11. data/lib/metronome_sdk/models/v1/alert_create_params.rb +33 -1
  12. data/lib/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rb +10 -1
  13. data/lib/metronome_sdk/models/v1/contract_create_params.rb +195 -29
  14. data/lib/metronome_sdk/models/v1/contract_list_balances_params.rb +9 -1
  15. data/lib/metronome_sdk/models/v1/customer_create_params.rb +105 -3
  16. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +14 -10
  17. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +1 -0
  18. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +1 -0
  19. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_response.rb +111 -0
  20. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +32 -1
  21. data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +21 -2
  22. data/lib/metronome_sdk/models/v1/customers/billing_config_delete_params.rb +1 -0
  23. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rb +1 -0
  24. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +21 -2
  25. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +1 -1
  26. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +34 -1
  27. data/lib/metronome_sdk/models/v1/customers/invoice.rb +144 -4
  28. data/lib/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rb +8 -1
  29. data/lib/metronome_sdk/models/v1/payment.rb +7 -1
  30. data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rb +74 -0
  31. data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rb +12 -0
  32. data/lib/metronome_sdk/models/v1/settings/billing_provider_create_params.rb +74 -0
  33. data/lib/metronome_sdk/models/v1/settings/billing_provider_create_response.rb +31 -0
  34. data/lib/metronome_sdk/models/v1/settings/billing_provider_list_params.rb +26 -0
  35. data/lib/metronome_sdk/models/v1/settings/billing_provider_list_response.rb +105 -0
  36. data/lib/metronome_sdk/models/v1/usage_search_response.rb +6 -3
  37. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +17 -1
  38. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +17 -1
  39. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +300 -10
  40. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +177 -3
  41. data/lib/metronome_sdk/resources/v1/alerts.rb +3 -1
  42. data/lib/metronome_sdk/resources/v1/contracts.rb +10 -4
  43. data/lib/metronome_sdk/resources/v1/credit_grants.rb +10 -5
  44. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +3 -1
  45. data/lib/metronome_sdk/resources/v1/customers/billing_config.rb +12 -5
  46. data/lib/metronome_sdk/resources/v1/customers/commits.rb +2 -1
  47. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +2 -1
  48. data/lib/metronome_sdk/resources/v1/customers/plans.rb +8 -4
  49. data/lib/metronome_sdk/resources/v1/customers.rb +12 -8
  50. data/lib/metronome_sdk/resources/v1/plans.rb +8 -4
  51. data/lib/metronome_sdk/resources/v1/settings/billing_providers.rb +75 -0
  52. data/lib/metronome_sdk/resources/v1/settings.rb +57 -0
  53. data/lib/metronome_sdk/resources/v1.rb +4 -0
  54. data/lib/metronome_sdk/resources/v2/contracts.rb +10 -2
  55. data/lib/metronome_sdk/version.rb +1 -1
  56. data/lib/metronome_sdk.rb +11 -0
  57. data/manifest.yaml +2 -0
  58. data/rbi/metronome_sdk/internal/transport/base_client.rbi +5 -0
  59. data/rbi/metronome_sdk/internal/transport/pooled_net_requester.rbi +6 -2
  60. data/rbi/metronome_sdk/internal/type/base_model.rbi +8 -4
  61. data/rbi/metronome_sdk/models/contract.rbi +5 -0
  62. data/rbi/metronome_sdk/models/contract_v2.rbi +122 -33
  63. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +63 -27
  64. data/rbi/metronome_sdk/models/subscription.rbi +64 -3
  65. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +69 -0
  66. data/rbi/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbi +13 -0
  67. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +360 -33
  68. data/rbi/metronome_sdk/models/v1/contract_list_balances_params.rbi +11 -0
  69. data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +215 -0
  70. data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +18 -11
  71. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +5 -0
  72. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +5 -0
  73. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_response.rbi +281 -0
  74. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +67 -0
  75. data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +29 -0
  76. data/rbi/metronome_sdk/models/v1/customers/billing_config_delete_params.rbi +5 -0
  77. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rbi +5 -0
  78. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +24 -0
  79. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +2 -2
  80. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +76 -0
  81. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +268 -0
  82. data/rbi/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbi +9 -0
  83. data/rbi/metronome_sdk/models/v1/payment.rbi +11 -3
  84. data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbi +128 -0
  85. data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rbi +25 -0
  86. data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_params.rbi +162 -0
  87. data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_response.rbi +75 -0
  88. data/rbi/metronome_sdk/models/v1/settings/billing_provider_list_params.rbi +50 -0
  89. data/rbi/metronome_sdk/models/v1/settings/billing_provider_list_response.rbi +245 -0
  90. data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +11 -3
  91. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +22 -0
  92. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +22 -0
  93. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +630 -9
  94. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +367 -3
  95. data/rbi/metronome_sdk/resources/v1/alerts.rbi +5 -0
  96. data/rbi/metronome_sdk/resources/v1/contracts.rbi +13 -1
  97. data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +10 -5
  98. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +5 -0
  99. data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +14 -4
  100. data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +3 -2
  101. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +2 -1
  102. data/rbi/metronome_sdk/resources/v1/customers/plans.rbi +8 -4
  103. data/rbi/metronome_sdk/resources/v1/customers.rbi +19 -9
  104. data/rbi/metronome_sdk/resources/v1/plans.rbi +8 -4
  105. data/rbi/metronome_sdk/resources/v1/settings/billing_providers.rbi +63 -0
  106. data/rbi/metronome_sdk/resources/v1/settings.rbi +51 -0
  107. data/rbi/metronome_sdk/resources/v1.rbi +3 -0
  108. data/rbi/metronome_sdk/resources/v2/contracts.rbi +12 -0
  109. data/sig/metronome_sdk/internal/transport/base_client.rbs +2 -0
  110. data/sig/metronome_sdk/internal/transport/pooled_net_requester.rbs +4 -1
  111. data/sig/metronome_sdk/models/contract.rbs +2 -0
  112. data/sig/metronome_sdk/models/contract_v2.rbs +33 -6
  113. data/sig/metronome_sdk/models/subscription.rbs +22 -3
  114. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +28 -0
  115. data/sig/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbs +7 -0
  116. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +104 -0
  117. data/sig/metronome_sdk/models/v1/contract_list_balances_params.rbs +7 -0
  118. data/sig/metronome_sdk/models/v1/customer_create_params.rbs +85 -0
  119. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +2 -0
  120. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +2 -0
  121. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_response.rbs +119 -0
  122. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +26 -1
  123. data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +16 -0
  124. data/sig/metronome_sdk/models/v1/customers/billing_config_delete_params.rbs +2 -0
  125. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rbs +2 -0
  126. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +14 -0
  127. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +32 -0
  128. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +130 -0
  129. data/sig/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbs +7 -0
  130. data/sig/metronome_sdk/models/v1/payment.rbs +10 -3
  131. data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbs +61 -0
  132. data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rbs +13 -0
  133. data/sig/metronome_sdk/models/v1/settings/billing_provider_create_params.rbs +66 -0
  134. data/sig/metronome_sdk/models/v1/settings/billing_provider_create_response.rbs +34 -0
  135. data/sig/metronome_sdk/models/v1/settings/billing_provider_list_params.rbs +28 -0
  136. data/sig/metronome_sdk/models/v1/settings/billing_provider_list_response.rbs +102 -0
  137. data/sig/metronome_sdk/models/v1/usage_search_response.rbs +3 -1
  138. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +14 -0
  139. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +14 -0
  140. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +234 -3
  141. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +131 -3
  142. data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
  143. data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -0
  144. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +1 -0
  145. data/sig/metronome_sdk/resources/v1/customers/billing_config.rbs +2 -0
  146. data/sig/metronome_sdk/resources/v1/customers.rbs +2 -1
  147. data/sig/metronome_sdk/resources/v1/settings/billing_providers.rbs +23 -0
  148. data/sig/metronome_sdk/resources/v1/settings.rbs +20 -0
  149. data/sig/metronome_sdk/resources/v1.rbs +2 -0
  150. data/sig/metronome_sdk/resources/v2/contracts.rbs +4 -0
  151. metadata +29 -2
@@ -4076,6 +4076,12 @@ module MetronomeSDK
4076
4076
  sig { returns(T.nilable(T::Array[String])) }
4077
4077
  attr_accessor :applicable_product_tags
4078
4078
 
4079
+ sig { returns(T.nilable(String)) }
4080
+ attr_reader :description
4081
+
4082
+ sig { params(description: String).void }
4083
+ attr_writer :description
4084
+
4079
4085
  # Optional configuration for commit hierarchy access control
4080
4086
  sig do
4081
4087
  returns(T.nilable(MetronomeSDK::CommitHierarchyConfiguration))
@@ -4166,6 +4172,7 @@ module MetronomeSDK
4166
4172
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateCommit::AccessSchedule::OrHash,
4167
4173
  applicable_product_ids: T.nilable(T::Array[String]),
4168
4174
  applicable_product_tags: T.nilable(T::Array[String]),
4175
+ description: String,
4169
4176
  hierarchy_configuration:
4170
4177
  MetronomeSDK::CommitHierarchyConfiguration::OrHash,
4171
4178
  invoice_schedule:
@@ -4194,6 +4201,7 @@ module MetronomeSDK
4194
4201
  # applicable_product_tags or specifiers are not provided, the commit applies to
4195
4202
  # all products.
4196
4203
  applicable_product_tags: nil,
4204
+ description: nil,
4197
4205
  # Optional configuration for commit hierarchy access control
4198
4206
  hierarchy_configuration: nil,
4199
4207
  invoice_schedule: nil,
@@ -4224,6 +4232,7 @@ module MetronomeSDK
4224
4232
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateCommit::AccessSchedule,
4225
4233
  applicable_product_ids: T.nilable(T::Array[String]),
4226
4234
  applicable_product_tags: T.nilable(T::Array[String]),
4235
+ description: String,
4227
4236
  hierarchy_configuration:
4228
4237
  MetronomeSDK::CommitHierarchyConfiguration,
4229
4238
  invoice_schedule:
@@ -4822,6 +4831,12 @@ module MetronomeSDK
4822
4831
  end
4823
4832
  attr_writer :access_schedule
4824
4833
 
4834
+ sig { returns(T.nilable(String)) }
4835
+ attr_reader :description
4836
+
4837
+ sig { params(description: String).void }
4838
+ attr_writer :description
4839
+
4825
4840
  # Optional configuration for credit hierarchy access control
4826
4841
  sig do
4827
4842
  returns(T.nilable(MetronomeSDK::CommitHierarchyConfiguration))
@@ -4876,6 +4891,7 @@ module MetronomeSDK
4876
4891
  id: String,
4877
4892
  access_schedule:
4878
4893
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateCredit::AccessSchedule::OrHash,
4894
+ description: String,
4879
4895
  hierarchy_configuration:
4880
4896
  MetronomeSDK::CommitHierarchyConfiguration::OrHash,
4881
4897
  name: String,
@@ -4889,6 +4905,7 @@ module MetronomeSDK
4889
4905
  def self.new(
4890
4906
  id:,
4891
4907
  access_schedule: nil,
4908
+ description: nil,
4892
4909
  # Optional configuration for credit hierarchy access control
4893
4910
  hierarchy_configuration: nil,
4894
4911
  name: nil,
@@ -4908,6 +4925,7 @@ module MetronomeSDK
4908
4925
  id: String,
4909
4926
  access_schedule:
4910
4927
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateCredit::AccessSchedule,
4928
+ description: String,
4911
4929
  hierarchy_configuration:
4912
4930
  MetronomeSDK::CommitHierarchyConfiguration,
4913
4931
  name: String,
@@ -6717,6 +6735,24 @@ module MetronomeSDK
6717
6735
  end
6718
6736
  attr_writer :quantity_updates
6719
6737
 
6738
+ # Manage subscription seats for subscriptions in SEAT_BASED mode.
6739
+ sig do
6740
+ returns(
6741
+ T.nilable(
6742
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates
6743
+ )
6744
+ )
6745
+ end
6746
+ attr_reader :seat_updates
6747
+
6748
+ sig do
6749
+ params(
6750
+ seat_updates:
6751
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::OrHash
6752
+ ).void
6753
+ end
6754
+ attr_writer :seat_updates
6755
+
6720
6756
  sig do
6721
6757
  params(
6722
6758
  id: String,
@@ -6724,10 +6760,18 @@ module MetronomeSDK
6724
6760
  quantity_updates:
6725
6761
  T::Array[
6726
6762
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::QuantityUpdate::OrHash
6727
- ]
6763
+ ],
6764
+ seat_updates:
6765
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::OrHash
6728
6766
  ).returns(T.attached_class)
6729
6767
  end
6730
- def self.new(id:, ending_before: nil, quantity_updates: nil)
6768
+ def self.new(
6769
+ id:,
6770
+ ending_before: nil,
6771
+ quantity_updates: nil,
6772
+ # Manage subscription seats for subscriptions in SEAT_BASED mode.
6773
+ seat_updates: nil
6774
+ )
6731
6775
  end
6732
6776
 
6733
6777
  sig do
@@ -6738,7 +6782,9 @@ module MetronomeSDK
6738
6782
  quantity_updates:
6739
6783
  T::Array[
6740
6784
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::QuantityUpdate
6741
- ]
6785
+ ],
6786
+ seat_updates:
6787
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates
6742
6788
  }
6743
6789
  )
6744
6790
  end
@@ -6787,6 +6833,324 @@ module MetronomeSDK
6787
6833
  def to_hash
6788
6834
  end
6789
6835
  end
6836
+
6837
+ class SeatUpdates < MetronomeSDK::Internal::Type::BaseModel
6838
+ OrHash =
6839
+ T.type_alias do
6840
+ T.any(
6841
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates,
6842
+ MetronomeSDK::Internal::AnyHash
6843
+ )
6844
+ end
6845
+
6846
+ # Adds seat IDs to the subscription. If there are unassigned seats, the new seat
6847
+ # IDs will fill these unassigned seats and not increase the total subscription
6848
+ # quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
6849
+ # total subscription quantity will increase.
6850
+ sig do
6851
+ returns(
6852
+ T.nilable(
6853
+ T::Array[
6854
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddSeatID
6855
+ ]
6856
+ )
6857
+ )
6858
+ end
6859
+ attr_reader :add_seat_ids
6860
+
6861
+ sig do
6862
+ params(
6863
+ add_seat_ids:
6864
+ T::Array[
6865
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddSeatID::OrHash
6866
+ ]
6867
+ ).void
6868
+ end
6869
+ attr_writer :add_seat_ids
6870
+
6871
+ # Adds unassigned seats to the subscription. This will increase the total
6872
+ # subscription quantity.
6873
+ sig do
6874
+ returns(
6875
+ T.nilable(
6876
+ T::Array[
6877
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddUnassignedSeat
6878
+ ]
6879
+ )
6880
+ )
6881
+ end
6882
+ attr_reader :add_unassigned_seats
6883
+
6884
+ sig do
6885
+ params(
6886
+ add_unassigned_seats:
6887
+ T::Array[
6888
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddUnassignedSeat::OrHash
6889
+ ]
6890
+ ).void
6891
+ end
6892
+ attr_writer :add_unassigned_seats
6893
+
6894
+ # Removes seat IDs from the subscription, if possible. If a seat ID is removed,
6895
+ # the total subscription quantity will decrease. Otherwise, if the seat ID is not
6896
+ # found on the subscription, this is a no-op.
6897
+ sig do
6898
+ returns(
6899
+ T.nilable(
6900
+ T::Array[
6901
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveSeatID
6902
+ ]
6903
+ )
6904
+ )
6905
+ end
6906
+ attr_reader :remove_seat_ids
6907
+
6908
+ sig do
6909
+ params(
6910
+ remove_seat_ids:
6911
+ T::Array[
6912
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveSeatID::OrHash
6913
+ ]
6914
+ ).void
6915
+ end
6916
+ attr_writer :remove_seat_ids
6917
+
6918
+ # Removes unassigned seats from the subscription. This will decrease the total
6919
+ # subscription quantity if there are are unassigned seats.
6920
+ sig do
6921
+ returns(
6922
+ T.nilable(
6923
+ T::Array[
6924
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat
6925
+ ]
6926
+ )
6927
+ )
6928
+ end
6929
+ attr_reader :remove_unassigned_seats
6930
+
6931
+ sig do
6932
+ params(
6933
+ remove_unassigned_seats:
6934
+ T::Array[
6935
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat::OrHash
6936
+ ]
6937
+ ).void
6938
+ end
6939
+ attr_writer :remove_unassigned_seats
6940
+
6941
+ # Manage subscription seats for subscriptions in SEAT_BASED mode.
6942
+ sig do
6943
+ params(
6944
+ add_seat_ids:
6945
+ T::Array[
6946
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddSeatID::OrHash
6947
+ ],
6948
+ add_unassigned_seats:
6949
+ T::Array[
6950
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddUnassignedSeat::OrHash
6951
+ ],
6952
+ remove_seat_ids:
6953
+ T::Array[
6954
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveSeatID::OrHash
6955
+ ],
6956
+ remove_unassigned_seats:
6957
+ T::Array[
6958
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat::OrHash
6959
+ ]
6960
+ ).returns(T.attached_class)
6961
+ end
6962
+ def self.new(
6963
+ # Adds seat IDs to the subscription. If there are unassigned seats, the new seat
6964
+ # IDs will fill these unassigned seats and not increase the total subscription
6965
+ # quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
6966
+ # total subscription quantity will increase.
6967
+ add_seat_ids: nil,
6968
+ # Adds unassigned seats to the subscription. This will increase the total
6969
+ # subscription quantity.
6970
+ add_unassigned_seats: nil,
6971
+ # Removes seat IDs from the subscription, if possible. If a seat ID is removed,
6972
+ # the total subscription quantity will decrease. Otherwise, if the seat ID is not
6973
+ # found on the subscription, this is a no-op.
6974
+ remove_seat_ids: nil,
6975
+ # Removes unassigned seats from the subscription. This will decrease the total
6976
+ # subscription quantity if there are are unassigned seats.
6977
+ remove_unassigned_seats: nil
6978
+ )
6979
+ end
6980
+
6981
+ sig do
6982
+ override.returns(
6983
+ {
6984
+ add_seat_ids:
6985
+ T::Array[
6986
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddSeatID
6987
+ ],
6988
+ add_unassigned_seats:
6989
+ T::Array[
6990
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddUnassignedSeat
6991
+ ],
6992
+ remove_seat_ids:
6993
+ T::Array[
6994
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveSeatID
6995
+ ],
6996
+ remove_unassigned_seats:
6997
+ T::Array[
6998
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat
6999
+ ]
7000
+ }
7001
+ )
7002
+ end
7003
+ def to_hash
7004
+ end
7005
+
7006
+ class AddSeatID < MetronomeSDK::Internal::Type::BaseModel
7007
+ OrHash =
7008
+ T.type_alias do
7009
+ T.any(
7010
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddSeatID,
7011
+ MetronomeSDK::Internal::AnyHash
7012
+ )
7013
+ end
7014
+
7015
+ sig { returns(T::Array[String]) }
7016
+ attr_accessor :seat_ids
7017
+
7018
+ # Assigned seats will be added/removed starting at this date.
7019
+ sig { returns(Time) }
7020
+ attr_accessor :starting_at
7021
+
7022
+ sig do
7023
+ params(seat_ids: T::Array[String], starting_at: Time).returns(
7024
+ T.attached_class
7025
+ )
7026
+ end
7027
+ def self.new(
7028
+ seat_ids:,
7029
+ # Assigned seats will be added/removed starting at this date.
7030
+ starting_at:
7031
+ )
7032
+ end
7033
+
7034
+ sig do
7035
+ override.returns(
7036
+ { seat_ids: T::Array[String], starting_at: Time }
7037
+ )
7038
+ end
7039
+ def to_hash
7040
+ end
7041
+ end
7042
+
7043
+ class AddUnassignedSeat < MetronomeSDK::Internal::Type::BaseModel
7044
+ OrHash =
7045
+ T.type_alias do
7046
+ T.any(
7047
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::AddUnassignedSeat,
7048
+ MetronomeSDK::Internal::AnyHash
7049
+ )
7050
+ end
7051
+
7052
+ # The number of unassigned seats on the subscription will increase/decrease by
7053
+ # this delta. Must be greater than 0.
7054
+ sig { returns(Float) }
7055
+ attr_accessor :quantity
7056
+
7057
+ # Unassigned seats will be updated starting at this date.
7058
+ sig { returns(Time) }
7059
+ attr_accessor :starting_at
7060
+
7061
+ sig do
7062
+ params(quantity: Float, starting_at: Time).returns(
7063
+ T.attached_class
7064
+ )
7065
+ end
7066
+ def self.new(
7067
+ # The number of unassigned seats on the subscription will increase/decrease by
7068
+ # this delta. Must be greater than 0.
7069
+ quantity:,
7070
+ # Unassigned seats will be updated starting at this date.
7071
+ starting_at:
7072
+ )
7073
+ end
7074
+
7075
+ sig { override.returns({ quantity: Float, starting_at: Time }) }
7076
+ def to_hash
7077
+ end
7078
+ end
7079
+
7080
+ class RemoveSeatID < MetronomeSDK::Internal::Type::BaseModel
7081
+ OrHash =
7082
+ T.type_alias do
7083
+ T.any(
7084
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveSeatID,
7085
+ MetronomeSDK::Internal::AnyHash
7086
+ )
7087
+ end
7088
+
7089
+ sig { returns(T::Array[String]) }
7090
+ attr_accessor :seat_ids
7091
+
7092
+ # Assigned seats will be added/removed starting at this date.
7093
+ sig { returns(Time) }
7094
+ attr_accessor :starting_at
7095
+
7096
+ sig do
7097
+ params(seat_ids: T::Array[String], starting_at: Time).returns(
7098
+ T.attached_class
7099
+ )
7100
+ end
7101
+ def self.new(
7102
+ seat_ids:,
7103
+ # Assigned seats will be added/removed starting at this date.
7104
+ starting_at:
7105
+ )
7106
+ end
7107
+
7108
+ sig do
7109
+ override.returns(
7110
+ { seat_ids: T::Array[String], starting_at: Time }
7111
+ )
7112
+ end
7113
+ def to_hash
7114
+ end
7115
+ end
7116
+
7117
+ class RemoveUnassignedSeat < MetronomeSDK::Internal::Type::BaseModel
7118
+ OrHash =
7119
+ T.type_alias do
7120
+ T.any(
7121
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat,
7122
+ MetronomeSDK::Internal::AnyHash
7123
+ )
7124
+ end
7125
+
7126
+ # The number of unassigned seats on the subscription will increase/decrease by
7127
+ # this delta. Must be greater than 0.
7128
+ sig { returns(Float) }
7129
+ attr_accessor :quantity
7130
+
7131
+ # Unassigned seats will be updated starting at this date.
7132
+ sig { returns(Time) }
7133
+ attr_accessor :starting_at
7134
+
7135
+ sig do
7136
+ params(quantity: Float, starting_at: Time).returns(
7137
+ T.attached_class
7138
+ )
7139
+ end
7140
+ def self.new(
7141
+ # The number of unassigned seats on the subscription will increase/decrease by
7142
+ # this delta. Must be greater than 0.
7143
+ quantity:,
7144
+ # Unassigned seats will be updated starting at this date.
7145
+ starting_at:
7146
+ )
7147
+ end
7148
+
7149
+ sig { override.returns({ quantity: Float, starting_at: Time }) }
7150
+ def to_hash
7151
+ end
7152
+ end
7153
+ end
6790
7154
  end
6791
7155
  end
6792
7156
  end
@@ -68,6 +68,8 @@ module MetronomeSDK
68
68
  T::Array[MetronomeSDK::V1::AlertCreateParams::GroupValue::OrHash],
69
69
  invoice_types_filter: T::Array[String],
70
70
  plan_id: String,
71
+ seat_filter:
72
+ MetronomeSDK::V1::AlertCreateParams::SeatFilter::OrHash,
71
73
  uniqueness_key: String,
72
74
  request_options: MetronomeSDK::RequestOptions::OrHash
73
75
  ).returns(MetronomeSDK::Models::V1::AlertCreateResponse)
@@ -112,6 +114,9 @@ module MetronomeSDK
112
114
  # If provided, will create this threshold notification for this specific plan. To
113
115
  # create a notification for all customers, do not specify a `plan_id`.
114
116
  plan_id: nil,
117
+ # Required for `low_remaining_seat_balance_reached` notifications. The alert is
118
+ # scoped to this seat group key-value pair.
119
+ seat_filter: nil,
115
120
  # Prevents the creation of duplicates. If a request to create a record is made
116
121
  # with a previously used uniqueness key, a new record will not be created and the
117
122
  # request will fail with a 409 error.
@@ -184,6 +184,8 @@ module MetronomeSDK
184
184
  T::Array[
185
185
  MetronomeSDK::V1::ContractCreateParams::ResellerRoyalty::OrHash
186
186
  ],
187
+ revenue_system_configuration:
188
+ MetronomeSDK::V1::ContractCreateParams::RevenueSystemConfiguration::OrHash,
187
189
  salesforce_opportunity_id: String,
188
190
  scheduled_charges:
189
191
  T::Array[
@@ -246,6 +248,9 @@ module MetronomeSDK
246
248
  recurring_credits: nil,
247
249
  # This field's availability is dependent on your client's configuration.
248
250
  reseller_royalties: nil,
251
+ # The revenue system configuration associated with a contract. Provide either an
252
+ # ID or the provider and delivery method.
253
+ revenue_system_configuration: nil,
249
254
  # This field's availability is dependent on your client's configuration.
250
255
  salesforce_opportunity_id: nil,
251
256
  scheduled_charges: nil,
@@ -363,6 +368,7 @@ module MetronomeSDK
363
368
  reason: String,
364
369
  segment_id: String,
365
370
  contract_id: String,
371
+ per_group_amounts: T::Hash[Symbol, Float],
366
372
  timestamp: Time,
367
373
  request_options: MetronomeSDK::RequestOptions::OrHash
368
374
  ).void
@@ -380,6 +386,9 @@ module MetronomeSDK
380
386
  segment_id:,
381
387
  # ID of the contract to update. Leave blank to update a customer level balance.
382
388
  contract_id: nil,
389
+ # If using individually configured commits/credits attached to seat managed
390
+ # subscriptions, the amount to add for each seat. Must sum to total amount.
391
+ per_group_amounts: nil,
383
392
  # RFC 3339 timestamp indicating when the manual adjustment takes place. If not
384
393
  # provided, it will default to the start of the segment.
385
394
  timestamp: nil,
@@ -389,7 +398,7 @@ module MetronomeSDK
389
398
 
390
399
  # Amendments will be replaced by Contract editing. New clients should implement
391
400
  # using the `editContract` endpoint. Read more about the migration to contract
392
- # editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
401
+ # editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and
393
402
  # reach out to your Metronome representative for more details. Once contract
394
403
  # editing is enabled, access to this endpoint will be removed.
395
404
  sig do
@@ -553,6 +562,7 @@ module MetronomeSDK
553
562
  id: String,
554
563
  covering_date: Time,
555
564
  effective_before: Time,
565
+ exclude_zero_balances: T::Boolean,
556
566
  include_archived: T::Boolean,
557
567
  include_balance: T::Boolean,
558
568
  include_contract_balances: T::Boolean,
@@ -574,6 +584,8 @@ module MetronomeSDK
574
584
  covering_date: nil,
575
585
  # Include only balances that have any access before the provided date (exclusive)
576
586
  effective_before: nil,
587
+ # Exclude balances with zero amounts from the response.
588
+ exclude_zero_balances: nil,
577
589
  # Include archived credits and credits from archived contracts.
578
590
  include_archived: nil,
579
591
  # Include the balance of credits and commits in the response. Setting this flag
@@ -4,7 +4,8 @@ module MetronomeSDK
4
4
  module Resources
5
5
  class V1
6
6
  class CreditGrants
7
- # Create a new credit grant
7
+ # Create a new credit grant. This is a Plans (deprecated) endpoint. New clients
8
+ # should implement using Contracts.
8
9
  sig do
9
10
  params(
10
11
  customer_id: String,
@@ -65,7 +66,8 @@ module MetronomeSDK
65
66
  )
66
67
  end
67
68
 
68
- # List credit grants. This list does not included voided grants.
69
+ # List credit grants. This list does not included voided grants. This is a Plans
70
+ # (deprecated) endpoint. New clients should implement using Contracts.
69
71
  sig do
70
72
  params(
71
73
  limit: Integer,
@@ -105,7 +107,8 @@ module MetronomeSDK
105
107
  )
106
108
  end
107
109
 
108
- # Edit an existing credit grant
110
+ # Edit an existing credit grant. This is a Plans (deprecated) endpoint. New
111
+ # clients should implement using Contracts.
109
112
  sig do
110
113
  params(
111
114
  id: String,
@@ -130,7 +133,8 @@ module MetronomeSDK
130
133
 
131
134
  # Fetches a list of credit ledger entries. Returns lists of ledgers per customer.
132
135
  # Ledger entries are returned in chronological order. Ledger entries associated
133
- # with voided credit grants are not included.
136
+ # with voided credit grants are not included. This is a Plans (deprecated)
137
+ # endpoint. New clients should implement using Contracts.
134
138
  sig do
135
139
  params(
136
140
  next_page: String,
@@ -170,7 +174,8 @@ module MetronomeSDK
170
174
  )
171
175
  end
172
176
 
173
- # Void a credit grant
177
+ # Void a credit grant. This is a Plans (deprecated) endpoint. New clients should
178
+ # implement using Contracts.
174
179
  sig do
175
180
  params(
176
181
  id: String,
@@ -70,6 +70,8 @@ module MetronomeSDK
70
70
  ],
71
71
  plans_or_contracts:
72
72
  MetronomeSDK::V1::Customers::AlertRetrieveParams::PlansOrContracts::OrSymbol,
73
+ seat_filter:
74
+ MetronomeSDK::V1::Customers::AlertRetrieveParams::SeatFilter::OrHash,
73
75
  request_options: MetronomeSDK::RequestOptions::OrHash
74
76
  ).returns(
75
77
  MetronomeSDK::Models::V1::Customers::AlertRetrieveResponse
@@ -86,6 +88,9 @@ module MetronomeSDK
86
88
  # When parallel threshold notifications are enabled during migration, this flag
87
89
  # denotes whether to fetch notifications for plans or contracts.
88
90
  plans_or_contracts: nil,
91
+ # Only allowed for `low_remaining_seat_balance_reached` notifications. This
92
+ # filters alerts by the seat group key-value pair.
93
+ seat_filter: nil,
89
94
  request_options: {}
90
95
  )
91
96
  end
@@ -5,13 +5,16 @@ module MetronomeSDK
5
5
  class V1
6
6
  class Customers
7
7
  class BillingConfig
8
- # Set the billing configuration for a given customer.
8
+ # Set the billing configuration for a given customer. This is a Plans (deprecated)
9
+ # endpoint. New clients should implement using Contracts.
9
10
  sig do
10
11
  params(
11
12
  customer_id: String,
12
13
  billing_provider_type:
13
14
  MetronomeSDK::V1::Customers::BillingConfigCreateParams::BillingProviderType::OrSymbol,
14
15
  billing_provider_customer_id: String,
16
+ aws_customer_account_id: String,
17
+ aws_customer_id: String,
15
18
  aws_product_code: String,
16
19
  aws_region:
17
20
  MetronomeSDK::V1::Customers::BillingConfigCreateParams::AwsRegion::OrSymbol,
@@ -29,16 +32,22 @@ module MetronomeSDK
29
32
  # the subscription ID.
30
33
  billing_provider_customer_id:,
31
34
  # Body param:
35
+ aws_customer_account_id: nil,
36
+ # Body param:
37
+ aws_customer_id: nil,
38
+ # Body param:
32
39
  aws_product_code: nil,
33
40
  # Body param:
34
41
  aws_region: nil,
35
- # Body param:
42
+ # Body param: The collection method for the customer's invoices. NOTE:
43
+ # `auto_charge_payment_intent` and `manually_charge_payment_intent` are in beta.
36
44
  stripe_collection_method: nil,
37
45
  request_options: {}
38
46
  )
39
47
  end
40
48
 
41
- # Fetch the billing configuration for the given customer.
49
+ # Fetch the billing configuration for the given customer. This is a Plans
50
+ # (deprecated) endpoint. New clients should implement using Contracts.
42
51
  sig do
43
52
  params(
44
53
  customer_id: String,
@@ -58,7 +67,8 @@ module MetronomeSDK
58
67
  end
59
68
 
60
69
  # Delete the billing configuration for a given customer. Note: this is unsupported
61
- # for Azure and AWS Marketplace customers.
70
+ # for Azure and AWS Marketplace customers. This is a Plans (deprecated) endpoint.
71
+ # New clients should implement using Contracts.
62
72
  sig do
63
73
  params(
64
74
  customer_id: String,
@@ -34,7 +34,8 @@ module MetronomeSDK
34
34
  # #### Billing configuration:
35
35
  #
36
36
  # - invoice_contract_id is required for postpaid commits and for prepaid commits
37
- # with billing (only optional for free prepaid commits)
37
+ # with billing (only optional for free prepaid commits) unless do_not_invoice is
38
+ # set to true
38
39
  # - For postpaid commits: access_schedule and invoice_schedule must have matching
39
40
  # amounts
40
41
  # - For postpaid commits: only one schedule item is allowed in both schedules.
@@ -123,7 +124,7 @@ module MetronomeSDK
123
124
  description: nil,
124
125
  # The contract that this commit will be billed on. This is required for "POSTPAID"
125
126
  # commits and for "PREPAID" commits unless there is no invoice schedule above
126
- # (i.e., the commit is 'free').
127
+ # (i.e., the commit is 'free'), or if do_not_invoice is set to true.
127
128
  invoice_contract_id: nil,
128
129
  # Required for "POSTPAID" commits: the true up invoice will be generated at this
129
130
  # time and only one schedule item is allowed; the total must match
@@ -159,7 +159,8 @@ module MetronomeSDK
159
159
  )
160
160
  end
161
161
 
162
- # Add a one time charge to the specified invoice
162
+ # Add a one time charge to the specified invoice. This is a Plans (deprecated)
163
+ # endpoint. New clients should implement using Contracts.
163
164
  sig do
164
165
  params(
165
166
  customer_id: String,