metronome-sdk 2.1.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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -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 +18 -12
  6. data/lib/metronome_sdk/internal/util.rb +7 -2
  7. data/lib/metronome_sdk/models/contract_v2.rb +29 -2
  8. data/lib/metronome_sdk/models/subscription.rb +32 -5
  9. data/lib/metronome_sdk/models/v1/alert_create_params.rb +33 -1
  10. data/lib/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rb +10 -1
  11. data/lib/metronome_sdk/models/v1/contract_create_params.rb +136 -20
  12. data/lib/metronome_sdk/models/v1/customer_create_params.rb +94 -2
  13. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_response.rb +111 -0
  14. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +32 -1
  15. data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +15 -1
  16. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +15 -1
  17. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +33 -1
  18. data/lib/metronome_sdk/models/v1/customers/invoice.rb +20 -2
  19. data/lib/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rb +8 -1
  20. data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rb +10 -1
  21. data/lib/metronome_sdk/models/v1/settings/billing_provider_create_params.rb +1 -0
  22. data/lib/metronome_sdk/models/v1/usage_search_response.rb +6 -3
  23. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +17 -1
  24. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +17 -1
  25. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +285 -22
  26. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +177 -3
  27. data/lib/metronome_sdk/resources/v1/alerts.rb +3 -1
  28. data/lib/metronome_sdk/resources/v1/contracts.rb +6 -2
  29. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +3 -1
  30. data/lib/metronome_sdk/resources/v1/customers/billing_config.rb +5 -1
  31. data/lib/metronome_sdk/resources/v1/customers.rb +5 -3
  32. data/lib/metronome_sdk/resources/v1/settings.rb +3 -1
  33. data/lib/metronome_sdk/resources/v2/contracts.rb +10 -2
  34. data/lib/metronome_sdk/version.rb +1 -1
  35. data/lib/metronome_sdk.rb +3 -0
  36. data/manifest.yaml +2 -0
  37. data/rbi/metronome_sdk/internal/transport/base_client.rbi +5 -0
  38. data/rbi/metronome_sdk/internal/transport/pooled_net_requester.rbi +6 -2
  39. data/rbi/metronome_sdk/internal/type/base_model.rbi +8 -4
  40. data/rbi/metronome_sdk/models/contract_v2.rbi +63 -6
  41. data/rbi/metronome_sdk/models/subscription.rbi +55 -9
  42. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +69 -0
  43. data/rbi/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbi +13 -0
  44. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +288 -24
  45. data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +204 -0
  46. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_response.rbi +281 -0
  47. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +67 -0
  48. data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +18 -0
  49. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +18 -0
  50. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +71 -0
  51. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +32 -0
  52. data/rbi/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbi +9 -0
  53. data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbi +13 -0
  54. data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_params.rbi +5 -0
  55. data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +11 -3
  56. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +22 -0
  57. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +22 -0
  58. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +616 -27
  59. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +367 -3
  60. data/rbi/metronome_sdk/resources/v1/alerts.rbi +5 -0
  61. data/rbi/metronome_sdk/resources/v1/contracts.rbi +9 -0
  62. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +5 -0
  63. data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +6 -0
  64. data/rbi/metronome_sdk/resources/v1/customers.rbi +8 -1
  65. data/rbi/metronome_sdk/resources/v1/settings.rbi +4 -0
  66. data/rbi/metronome_sdk/resources/v2/contracts.rbi +12 -0
  67. data/sig/metronome_sdk/internal/transport/base_client.rbs +2 -0
  68. data/sig/metronome_sdk/internal/transport/pooled_net_requester.rbs +4 -1
  69. data/sig/metronome_sdk/models/contract_v2.rbs +31 -6
  70. data/sig/metronome_sdk/models/subscription.rbs +22 -3
  71. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +28 -0
  72. data/sig/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbs +7 -0
  73. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +104 -0
  74. data/sig/metronome_sdk/models/v1/customer_create_params.rbs +83 -0
  75. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_response.rbs +119 -0
  76. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +26 -1
  77. data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +14 -0
  78. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +14 -0
  79. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +30 -0
  80. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +18 -0
  81. data/sig/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbs +7 -0
  82. data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbs +8 -1
  83. data/sig/metronome_sdk/models/v1/settings/billing_provider_create_params.rbs +3 -1
  84. data/sig/metronome_sdk/models/v1/usage_search_response.rbs +3 -1
  85. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +14 -0
  86. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +14 -0
  87. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +232 -3
  88. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +131 -3
  89. data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
  90. data/sig/metronome_sdk/resources/v1/contracts.rbs +2 -0
  91. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +1 -0
  92. data/sig/metronome_sdk/resources/v1/customers/billing_config.rbs +2 -0
  93. data/sig/metronome_sdk/resources/v1/customers.rbs +2 -1
  94. data/sig/metronome_sdk/resources/v1/settings.rbs +1 -0
  95. data/sig/metronome_sdk/resources/v2/contracts.rbs +4 -0
  96. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f70b65323a25a4de65861565a092a6aa70f43d28e5e910acca44d883efe9cf86
4
- data.tar.gz: 4d89458274f95fb69ca5d6bccad455a6ecaf92a3d1a93b8843290166f724e01d
3
+ metadata.gz: 24c53b426a786c58cd7f8d4ae93526596c3a4fa93b6b662e5de17309317f36e5
4
+ data.tar.gz: 1409a92e54deccc0ae37945c293b208cf27149114eae2509af99fe87a4584ece
5
5
  SHA512:
6
- metadata.gz: '010907bdf574da3664f42af09be522e41a87dfc4ae1280ee4307326c8d62751c1fdc11bfec4214ec22176cbaf0002a2f1a7b6ed3668da3fb3347ab2bdb3b5494'
7
- data.tar.gz: d9be0ec4d10b760064dc84412f78c074258613af6b2ba7e33432ddade4c39d6356ed9d4fc59fb7a89eadc1ce4cd99f893e7c329bbedc27b4dc8e3ac8f76d1c5d
6
+ metadata.gz: 7472b69ef8d4e84138a0b0818d3cf770268065044819e86804727fc00dc92c66b4f1e36ffac58131da73983ab124d3872aae8054bbc4731581aab51168eb08b3
7
+ data.tar.gz: 5cffe8618d7460adf817768b5a91d0d478c1ed1103211571def61d3e76c5fa31adf91847158d62e188fd170edc88d718f1501c5966249314acd45f92dfa1a716
data/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.0 (2025-12-18)
4
+
5
+ Full Changelog: [v2.1.0...v2.2.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v2.1.0...v2.2.0)
6
+
7
+ ### Features
8
+
9
+ * [ORCH-605] uses x-mint groups to enable conditional rendering of gated revenue system config apis ([22ceee8](https://github.com/Metronome-Industries/metronome-ruby/commit/22ceee870bf6b1642ff4283b37485be599658e47))
10
+ * [ORCH-752] Update contract creation endpoints to allow setting revenue system configuration ([c2ca4f7](https://github.com/Metronome-Industries/metronome-ruby/commit/c2ca4f7ef46b0ead89b74a6e75a37a2ba55d9dc8))
11
+ * Add `commit_transactions` to the body of `/upsertAvalaraCredentials` endpoint ([d99cab3](https://github.com/Metronome-Industries/metronome-ruby/commit/d99cab3cda4f2da4f80ec925c76583e31ea1763a))
12
+ * Add `seat_filter` field to creation request and response parameters of the alert object ([165e3f0](https://github.com/Metronome-Industries/metronome-ruby/commit/165e3f0deab903b00fb7b4b235179b52a4f8093f))
13
+ * add quantity to plan pricing adjustment response ([cbf2539](https://github.com/Metronome-Industries/metronome-ruby/commit/cbf2539bbab6fac9f0d4984cd0f88c9f6b0ceea2))
14
+ * adds external_payment_id to ExternalInvoice ([ff5f18f](https://github.com/Metronome-Industries/metronome-ruby/commit/ff5f18f6b14e08b4c499689ca329b357a03177a9))
15
+ * everything ([6188141](https://github.com/Metronome-Industries/metronome-ruby/commit/618814115adbe126a1b0b5a330244034a14c98f7))
16
+ * GET-6845 get openapi specs ready for GA ([dc48f09](https://github.com/Metronome-Industries/metronome-ruby/commit/dc48f094c3283251a7f452aa4cc3db917ee7eba6))
17
+ * include aggregation BM info from searchEvents ([ea0dfc0](https://github.com/Metronome-Industries/metronome-ruby/commit/ea0dfc021a244b0e0d3ebfbcdacfc053f5194b61))
18
+ * ORCH-833/948/946/947 - updated the API to accept aws_customer_account_id all gated behind a feature flag ([4c2e292](https://github.com/Metronome-Industries/metronome-ruby/commit/4c2e2926ed8b6d0844b3670312f9780f14df2beb))
19
+ * remove beta language, FF, stainless skip ([b504def](https://github.com/Metronome-Industries/metronome-ruby/commit/b504defa5b97aa3f622bbc746e76ac12691d1e90))
20
+ * Return values for set customer billing configuration endpoint ([1641a74](https://github.com/Metronome-Industries/metronome-ruby/commit/1641a74439ebf507fb85f0478bbd056f6047c173))
21
+ * update create alert api to allow LowRemainingSeatBalanceReached alert ([54a60e6](https://github.com/Metronome-Industries/metronome-ruby/commit/54a60e6027b889e61554b7a006c780e3a9fc4815))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * better thread safety via early initializing SSL store during HTTP client creation ([341992d](https://github.com/Metronome-Industries/metronome-ruby/commit/341992d633b9191d24209713f5f6a734d2229601))
27
+ * calling `break` out of streams should be instantaneous ([0db918b](https://github.com/Metronome-Industries/metronome-ruby/commit/0db918bb075b3420715faf0e73ef96cc01d58697))
28
+ * issue where json.parse errors when receiving HTTP 204 with nobody ([7a27bb6](https://github.com/Metronome-Industries/metronome-ruby/commit/7a27bb648e886deaf33358cde8f5c3c5d80ccf42))
29
+
30
+
31
+ ### Chores
32
+
33
+ * **client:** send user-agent header ([379e4e4](https://github.com/Metronome-Industries/metronome-ruby/commit/379e4e46eb858bce94633dd193fbc1526ea1c42c))
34
+ * explicitly require "base64" gem ([5d4a7dc](https://github.com/Metronome-Industries/metronome-ruby/commit/5d4a7dc568346f2fc33ab39cf1517582923d98d5))
35
+ * **internal:** codegen related update ([9878983](https://github.com/Metronome-Industries/metronome-ruby/commit/9878983e4d67b0d04d543d7a49afdd14e9eb4f73))
36
+
37
+
38
+ ### Documentation
39
+
40
+ * document missing fields for schemas related to recurring credits and commits ([d848e15](https://github.com/Metronome-Industries/metronome-ruby/commit/d848e159b2046aebccea5d2b3915779adf891791))
41
+
3
42
  ## 2.1.0 (2025-10-31)
4
43
 
5
44
  Full Changelog: [v2.0.0...v2.1.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v2.0.0...v2.1.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "metronome-sdk", "~> 2.1.0"
20
+ gem "metronome-sdk", "~> 2.2.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -201,7 +201,8 @@ module MetronomeSDK
201
201
  self.class::PLATFORM_HEADERS,
202
202
  {
203
203
  "accept" => "application/json",
204
- "content-type" => "application/json"
204
+ "content-type" => "application/json",
205
+ "user-agent" => user_agent
205
206
  },
206
207
  headers
207
208
  )
@@ -219,6 +220,11 @@ module MetronomeSDK
219
220
  # @return [Hash{String=>String}]
220
221
  private def auth_headers = {}
221
222
 
223
+ # @api private
224
+ #
225
+ # @return [String]
226
+ private def user_agent = "#{self.class.name}/Ruby #{MetronomeSDK::VERSION}"
227
+
222
228
  # @api private
223
229
  #
224
230
  # @return [String]
@@ -16,10 +16,11 @@ module MetronomeSDK
16
16
  class << self
17
17
  # @api private
18
18
  #
19
+ # @param cert_store [OpenSSL::X509::Store]
19
20
  # @param url [URI::Generic]
20
21
  #
21
22
  # @return [Net::HTTP]
22
- def connect(url)
23
+ def connect(cert_store:, url:)
23
24
  port =
24
25
  case [url.port, url.scheme]
25
26
  in [Integer, _]
@@ -33,6 +34,8 @@ module MetronomeSDK
33
34
  Net::HTTP.new(url.host, port).tap do
34
35
  _1.use_ssl = %w[https wss].include?(url.scheme)
35
36
  _1.max_retries = 0
37
+
38
+ (_1.cert_store = cert_store) if _1.use_ssl?
36
39
  end
37
40
  end
38
41
 
@@ -102,7 +105,7 @@ module MetronomeSDK
102
105
  pool =
103
106
  @mutex.synchronize do
104
107
  @pools[origin] ||= ConnectionPool.new(size: @size) do
105
- self.class.connect(url)
108
+ self.class.connect(cert_store: @cert_store, url: url)
106
109
  end
107
110
  end
108
111
 
@@ -150,17 +153,19 @@ module MetronomeSDK
150
153
  end
151
154
 
152
155
  self.class.calibrate_socket_timeout(conn, deadline)
153
- conn.request(req) do |rsp|
154
- y << [req, rsp]
155
- break if finished
156
-
157
- rsp.read_body do |bytes|
158
- y << bytes.force_encoding(Encoding::BINARY)
159
- break if finished
160
-
161
- self.class.calibrate_socket_timeout(conn, deadline)
156
+ ::Kernel.catch(:jump) do
157
+ conn.request(req) do |rsp|
158
+ y << [req, rsp]
159
+ ::Kernel.throw(:jump) if finished
160
+
161
+ rsp.read_body do |bytes|
162
+ y << bytes.force_encoding(Encoding::BINARY)
163
+ ::Kernel.throw(:jump) if finished
164
+
165
+ self.class.calibrate_socket_timeout(conn, deadline)
166
+ end
167
+ eof = true
162
168
  end
163
- eof = true
164
169
  end
165
170
  end
166
171
  ensure
@@ -192,6 +197,7 @@ module MetronomeSDK
192
197
  def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
193
198
  @mutex = Mutex.new
194
199
  @size = size
200
+ @cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
195
201
  @pools = {}
196
202
  end
197
203
 
@@ -657,7 +657,8 @@ module MetronomeSDK
657
657
  def decode_content(headers, stream:, suppress_error: false)
658
658
  case (content_type = headers["content-type"])
659
659
  in MetronomeSDK::Internal::Util::JSON_CONTENT
660
- json = stream.to_a.join
660
+ return nil if (json = stream.to_a.join).empty?
661
+
661
662
  begin
662
663
  JSON.parse(json, symbolize_names: true)
663
664
  rescue JSON::ParserError => e
@@ -667,7 +668,11 @@ module MetronomeSDK
667
668
  in MetronomeSDK::Internal::Util::JSONL_CONTENT
668
669
  lines = decode_lines(stream)
669
670
  chain_fused(lines) do |y|
670
- lines.each { y << JSON.parse(_1, symbolize_names: true) }
671
+ lines.each do
672
+ next if _1.empty?
673
+
674
+ y << JSON.parse(_1, symbolize_names: true)
675
+ end
671
676
  end
672
677
  in %r{^text/event-stream}
673
678
  lines = decode_lines(stream)
@@ -445,7 +445,13 @@ module MetronomeSDK
445
445
  # @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
446
446
  optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }
447
447
 
448
- # @!method initialize(id:, created_at:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, archived_at: nil, balance: nil, contract: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, invoice_contract: nil, invoice_schedule: nil, ledger: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rolled_over_from: nil, rollover_fraction: nil, salesforce_opportunity_id: nil, specifiers: nil)
448
+ # @!attribute subscription_config
449
+ # Attach a subscription to the recurring commit/credit.
450
+ #
451
+ # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
452
+ optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
453
+
454
+ # @!method initialize(id:, created_at:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, archived_at: nil, balance: nil, contract: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, invoice_contract: nil, invoice_schedule: nil, ledger: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rolled_over_from: nil, rollover_fraction: nil, salesforce_opportunity_id: nil, specifiers: nil, subscription_config: nil)
449
455
  # Some parameter documentations has been truncated, see
450
456
  # {MetronomeSDK::Models::ContractV2::Commit} for more details.
451
457
  #
@@ -498,6 +504,8 @@ module MetronomeSDK
498
504
  # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
499
505
  #
500
506
  # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
507
+ #
508
+ # @param subscription_config [MetronomeSDK::Models::RecurringCommitSubscriptionConfig] Attach a subscription to the recurring commit/credit.
501
509
 
502
510
  # @see MetronomeSDK::Models::ContractV2::Commit#product
503
511
  class Product < MetronomeSDK::Internal::Type::BaseModel
@@ -1646,6 +1654,15 @@ module MetronomeSDK
1646
1654
  # @return [MetronomeSDK::Models::ContractV2::Credit::Contract, nil]
1647
1655
  optional :contract, -> { MetronomeSDK::ContractV2::Credit::Contract }
1648
1656
 
1657
+ # @!attribute created_at
1658
+ # Timestamp of when the credit was created.
1659
+ #
1660
+ # - Recurring credits: latter of credit service period date and parent credit
1661
+ # start date
1662
+ #
1663
+ # @return [Time, nil]
1664
+ optional :created_at, Time
1665
+
1649
1666
  # @!attribute custom_fields
1650
1667
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1651
1668
  #
@@ -1703,7 +1720,13 @@ module MetronomeSDK
1703
1720
  # @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
1704
1721
  optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }
1705
1722
 
1706
- # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, balance: nil, contract: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, ledger: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, salesforce_opportunity_id: nil, specifiers: nil)
1723
+ # @!attribute subscription_config
1724
+ # Attach a subscription to the recurring commit/credit.
1725
+ #
1726
+ # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
1727
+ optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
1728
+
1729
+ # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, balance: nil, contract: nil, created_at: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, ledger: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, salesforce_opportunity_id: nil, specifiers: nil, subscription_config: nil)
1707
1730
  # Some parameter documentations has been truncated, see
1708
1731
  # {MetronomeSDK::Models::ContractV2::Credit} for more details.
1709
1732
  #
@@ -1725,6 +1748,8 @@ module MetronomeSDK
1725
1748
  #
1726
1749
  # @param contract [MetronomeSDK::Models::ContractV2::Credit::Contract]
1727
1750
  #
1751
+ # @param created_at [Time] Timestamp of when the credit was created.
1752
+ #
1728
1753
  # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1729
1754
  #
1730
1755
  # @param description [String]
@@ -1742,6 +1767,8 @@ module MetronomeSDK
1742
1767
  # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
1743
1768
  #
1744
1769
  # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
1770
+ #
1771
+ # @param subscription_config [MetronomeSDK::Models::RecurringCommitSubscriptionConfig] Attach a subscription to the recurring commit/credit.
1745
1772
 
1746
1773
  # @see MetronomeSDK::Models::ContractV2::Credit#product
1747
1774
  class Product < MetronomeSDK::Internal::Type::BaseModel
@@ -24,8 +24,8 @@ module MetronomeSDK
24
24
  # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
25
25
  # directly on the subscription. `initial_quantity` must be provided with this
26
26
  # option. Compatible with recurring commits/credits that use POOLED allocation.
27
- # **SEAT_BASED**: (BETA) Use when you want to pass specific seat identifiers (e.g.
28
- # add user_123) to increment and decrement a subscription quantity, rather than
27
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
28
+ # user_123) to increment and decrement a subscription quantity, rather than
29
29
  # directly providing the quantity. You must use a **SEAT_BASED** subscription to
30
30
  # use a linked recurring credit with an allocation per seat. `seat_config` must be
31
31
  # provided with this option.
@@ -82,7 +82,12 @@ module MetronomeSDK
82
82
  # @return [String, nil]
83
83
  optional :name, String
84
84
 
85
- # @!method initialize(billing_periods:, collection_schedule:, proration:, quantity_management_mode:, quantity_schedule:, starting_at:, subscription_rate:, id: nil, custom_fields: nil, description: nil, ending_before: nil, fiat_credit_type_id: nil, name: nil)
85
+ # @!attribute seat_config
86
+ #
87
+ # @return [MetronomeSDK::Models::Subscription::SeatConfig, nil]
88
+ optional :seat_config, -> { MetronomeSDK::Subscription::SeatConfig }
89
+
90
+ # @!method initialize(billing_periods:, collection_schedule:, proration:, quantity_management_mode:, quantity_schedule:, starting_at:, subscription_rate:, id: nil, custom_fields: nil, description: nil, ending_before: nil, fiat_credit_type_id: nil, name: nil, seat_config: nil)
86
91
  # Some parameter documentations has been truncated, see
87
92
  # {MetronomeSDK::Models::Subscription} for more details.
88
93
  #
@@ -111,6 +116,8 @@ module MetronomeSDK
111
116
  # @param fiat_credit_type_id [String]
112
117
  #
113
118
  # @param name [String]
119
+ #
120
+ # @param seat_config [MetronomeSDK::Models::Subscription::SeatConfig]
114
121
 
115
122
  # @see MetronomeSDK::Models::Subscription#billing_periods
116
123
  class BillingPeriods < MetronomeSDK::Internal::Type::BaseModel
@@ -231,8 +238,8 @@ module MetronomeSDK
231
238
  # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
232
239
  # directly on the subscription. `initial_quantity` must be provided with this
233
240
  # option. Compatible with recurring commits/credits that use POOLED allocation.
234
- # **SEAT_BASED**: (BETA) Use when you want to pass specific seat identifiers (e.g.
235
- # add user_123) to increment and decrement a subscription quantity, rather than
241
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
242
+ # user_123) to increment and decrement a subscription quantity, rather than
236
243
  # directly providing the quantity. You must use a **SEAT_BASED** subscription to
237
244
  # use a linked recurring credit with an allocation per seat. `seat_config` must be
238
245
  # provided with this option.
@@ -316,6 +323,26 @@ module MetronomeSDK
316
323
  # @param name [String]
317
324
  end
318
325
  end
326
+
327
+ # @see MetronomeSDK::Models::Subscription#seat_config
328
+ class SeatConfig < MetronomeSDK::Internal::Type::BaseModel
329
+ # @!attribute seat_group_key
330
+ # The property name, sent on usage events, that identifies the seat ID associated
331
+ # with the usage event. For example, the property name might be seat_id or
332
+ # user_id. The property must be set as a group key on billable metrics and a
333
+ # presentation/pricing group key on contract products. This allows linked
334
+ # recurring credits with an allocation per seat to be consumed by only one seat's
335
+ # usage.
336
+ #
337
+ # @return [String]
338
+ required :seat_group_key, String
339
+
340
+ # @!method initialize(seat_group_key:)
341
+ # Some parameter documentations has been truncated, see
342
+ # {MetronomeSDK::Models::Subscription::SeatConfig} for more details.
343
+ #
344
+ # @param seat_group_key [String] The property name, sent on usage events, that identifies the seat ID associated
345
+ end
319
346
  end
320
347
  end
321
348
  end
@@ -97,6 +97,13 @@ module MetronomeSDK
97
97
  # @return [String, nil]
98
98
  optional :plan_id, String
99
99
 
100
+ # @!attribute seat_filter
101
+ # Required for `low_remaining_seat_balance_reached` notifications. The alert is
102
+ # scoped to this seat group key-value pair.
103
+ #
104
+ # @return [MetronomeSDK::Models::V1::AlertCreateParams::SeatFilter, nil]
105
+ optional :seat_filter, -> { MetronomeSDK::V1::AlertCreateParams::SeatFilter }
106
+
100
107
  # @!attribute uniqueness_key
101
108
  # Prevents the creation of duplicates. If a request to create a record is made
102
109
  # with a previously used uniqueness key, a new record will not be created and the
@@ -105,7 +112,7 @@ module MetronomeSDK
105
112
  # @return [String, nil]
106
113
  optional :uniqueness_key, String
107
114
 
108
- # @!method initialize(alert_type:, name:, threshold:, billable_metric_id: nil, credit_grant_type_filters: nil, credit_type_id: nil, custom_field_filters: nil, customer_id: nil, evaluate_on_create: nil, group_values: nil, invoice_types_filter: nil, plan_id: nil, uniqueness_key: nil, request_options: {})
115
+ # @!method initialize(alert_type:, name:, threshold:, billable_metric_id: nil, credit_grant_type_filters: nil, credit_type_id: nil, custom_field_filters: nil, customer_id: nil, evaluate_on_create: nil, group_values: nil, invoice_types_filter: nil, plan_id: nil, seat_filter: nil, uniqueness_key: nil, request_options: {})
109
116
  # Some parameter documentations has been truncated, see
110
117
  # {MetronomeSDK::Models::V1::AlertCreateParams} for more details.
111
118
  #
@@ -133,6 +140,8 @@ module MetronomeSDK
133
140
  #
134
141
  # @param plan_id [String] If provided, will create this threshold notification for this specific plan. To
135
142
  #
143
+ # @param seat_filter [MetronomeSDK::Models::V1::AlertCreateParams::SeatFilter] Required for `low_remaining_seat_balance_reached` notifications. The alert is sc
144
+ #
136
145
  # @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
137
146
  #
138
147
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]
@@ -157,6 +166,7 @@ module MetronomeSDK
157
166
  LOW_REMAINING_CONTRACT_CREDIT_AND_COMMIT_BALANCE_REACHED =
158
167
  :low_remaining_contract_credit_and_commit_balance_reached
159
168
  INVOICE_TOTAL_REACHED = :invoice_total_reached
169
+ LOW_REMAINING_SEAT_BALANCE_REACHED = :low_remaining_seat_balance_reached
160
170
 
161
171
  # @!method self.values
162
172
  # @return [Array<Symbol>]
@@ -211,6 +221,28 @@ module MetronomeSDK
211
221
  # @param key [String]
212
222
  # @param value [String]
213
223
  end
224
+
225
+ class SeatFilter < MetronomeSDK::Internal::Type::BaseModel
226
+ # @!attribute seat_group_key
227
+ # The seat group key (e.g., "seat_id", "user_id")
228
+ #
229
+ # @return [String]
230
+ required :seat_group_key, String
231
+
232
+ # @!attribute seat_group_value
233
+ # Optional seat identifier the alert is scoped to.
234
+ #
235
+ # @return [String, nil]
236
+ optional :seat_group_value, String
237
+
238
+ # @!method initialize(seat_group_key:, seat_group_value: nil)
239
+ # Required for `low_remaining_seat_balance_reached` notifications. The alert is
240
+ # scoped to this seat group key-value pair.
241
+ #
242
+ # @param seat_group_key [String] The seat group key (e.g., "seat_id", "user_id")
243
+ #
244
+ # @param seat_group_value [String] Optional seat identifier the alert is scoped to.
245
+ end
214
246
  end
215
247
  end
216
248
  end
@@ -44,6 +44,13 @@ module MetronomeSDK
44
44
  # @return [String, nil]
45
45
  optional :contract_id, String
46
46
 
47
+ # @!attribute per_group_amounts
48
+ # If using individually configured commits/credits attached to seat managed
49
+ # subscriptions, the amount to add for each seat. Must sum to total amount.
50
+ #
51
+ # @return [Hash{Symbol=>Float}, nil]
52
+ optional :per_group_amounts, MetronomeSDK::Internal::Type::HashOf[Float]
53
+
47
54
  # @!attribute timestamp
48
55
  # RFC 3339 timestamp indicating when the manual adjustment takes place. If not
49
56
  # provided, it will default to the start of the segment.
@@ -51,7 +58,7 @@ module MetronomeSDK
51
58
  # @return [Time, nil]
52
59
  optional :timestamp, Time
53
60
 
54
- # @!method initialize(id:, amount:, customer_id:, reason:, segment_id:, contract_id: nil, timestamp: nil, request_options: {})
61
+ # @!method initialize(id:, amount:, customer_id:, reason:, segment_id:, contract_id: nil, per_group_amounts: nil, timestamp: nil, request_options: {})
55
62
  # Some parameter documentations has been truncated, see
56
63
  # {MetronomeSDK::Models::V1::ContractAddManualBalanceEntryParams} for more
57
64
  # details.
@@ -68,6 +75,8 @@ module MetronomeSDK
68
75
  #
69
76
  # @param contract_id [String] ID of the contract to update. Leave blank to update a customer level balance.
70
77
  #
78
+ # @param per_group_amounts [Hash{Symbol=>Float}] If using individually configured commits/credits attached to seat managed subscr
79
+ #
71
80
  # @param timestamp [Time] RFC 3339 timestamp indicating when the manual adjustment takes place. If not pro
72
81
  #
73
82
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]