metronome-sdk 3.5.0 → 3.6.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/client.rb +15 -1
  5. data/lib/metronome_sdk/internal/transport/base_client.rb +2 -0
  6. data/lib/metronome_sdk/models/contract_v2.rb +362 -4
  7. data/lib/metronome_sdk/models/v1/alert_create_params.rb +1 -0
  8. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +1 -177
  9. data/lib/metronome_sdk/models/v1/contract_create_params.rb +2 -179
  10. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +119 -0
  11. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_response.rb +315 -0
  12. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +31 -1
  13. data/lib/metronome_sdk/models/v1/contracts/product_update_params.rb +31 -1
  14. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +1 -0
  15. data/lib/metronome_sdk/models/v1/customers/invoice.rb +8 -1
  16. data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +29 -1
  17. data/lib/metronome_sdk/models/v1/package_create_params.rb +1 -18
  18. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +362 -3
  19. data/lib/metronome_sdk/resources/v1/contracts/products.rb +6 -2
  20. data/lib/metronome_sdk/resources/v1/contracts.rb +69 -2
  21. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +5 -1
  22. data/lib/metronome_sdk/resources/v1/packages.rb +1 -3
  23. data/lib/metronome_sdk/version.rb +1 -1
  24. data/lib/metronome_sdk.rb +2 -0
  25. data/rbi/metronome_sdk/models/contract_v2.rbi +763 -4
  26. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +5 -0
  27. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +0 -396
  28. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +2 -398
  29. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +179 -0
  30. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_response.rbi +714 -0
  31. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +74 -0
  32. data/rbi/metronome_sdk/models/v1/contracts/product_update_params.rbi +74 -0
  33. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +5 -0
  34. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +9 -0
  35. data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +75 -0
  36. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +0 -56
  37. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +792 -4
  38. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +18 -0
  39. data/rbi/metronome_sdk/resources/v1/contracts.rbi +81 -3
  40. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -0
  41. data/rbi/metronome_sdk/resources/v1/packages.rbi +0 -3
  42. data/sig/metronome_sdk/models/contract_v2.rbs +324 -6
  43. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +3 -1
  44. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +0 -137
  45. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +0 -137
  46. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +96 -0
  47. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_response.rbs +299 -0
  48. data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +20 -0
  49. data/sig/metronome_sdk/models/v1/contracts/product_update_params.rbs +20 -0
  50. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +3 -1
  51. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +7 -0
  52. data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +29 -1
  53. data/sig/metronome_sdk/models/v1/package_create_params.rbs +0 -20
  54. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +319 -6
  55. data/sig/metronome_sdk/resources/v1/contracts/products.rbs +2 -0
  56. data/sig/metronome_sdk/resources/v1/contracts.rbs +15 -0
  57. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +2 -0
  58. data/sig/metronome_sdk/resources/v1/packages.rbs +0 -1
  59. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0efabaeb66e2c3c37a2df72b4643172c5696992964c9d4d87fa7c8831d954bae
4
- data.tar.gz: ce828a8840076f76c98d7721873e799fa3f536dcb4cedf25705fb5080b2ef90b
3
+ metadata.gz: d4d5355d04639b7153cfe94271378797fceaff008c386c001c6450f66674a584
4
+ data.tar.gz: 25c993147e97e4acead3048b17b7328e67b4e95274bef1893723bf806ddd9bec
5
5
  SHA512:
6
- metadata.gz: f4404c030aaafa8c308dd7b708bfb709e92d5a0b03c9822187fe5dd2ce7cae120fb0c2ba76f39d95de800cd91005e6ed913658509cdcc53a213d9fd0301bda12
7
- data.tar.gz: 728d74b8043e076f0b0719967681cb8341558ee9a9a536b40dbf7364141c49faf2c8934fcd3ed35af5ce47e287e230a284b0607a95d33d32e943233ba2ab4fb0
6
+ metadata.gz: 653c76e15fba1881dcc6e344161a61f7c0c061aba2603bdb26a3f489986c23e31d1fe77bb2134070f53333efe9efa5d37b73f206abb30b4cba33eb05f967c771
7
+ data.tar.gz: 3d6505e8bd6767e3873ba2d70c28bc93eac7280ae2ca126eba43a18eca5e4a113704574909e5c0a26f503204675bc407582190dd9d1f20afa91ecc98cc30def0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.6.0 (2026-05-18)
4
+
5
+ Full Changelog: [v3.5.0...v3.6.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v3.5.0...v3.6.0)
6
+
7
+ ### Features
8
+
9
+ * [docs] fix typo in "Create a Contract" [1] page ([1c944c1](https://github.com/Metronome-Industries/metronome-ruby/commit/1c944c186c83b405e283708850d5a608e6c21ed6))
10
+ * [orch-383] fix API docs for one-off payment-gated commits ([a4d2798](https://github.com/Metronome-Industries/metronome-ruby/commit/a4d27985195453b3546b5ecd8a420b4d768110db))
11
+ * Add alert specifiers to contract create API ([51db5ed](https://github.com/Metronome-Industries/metronome-ruby/commit/51db5ed0d8954978ac23e2ddc30a6b542a535828))
12
+ * add contract_id filter to list invoices endpoint ([a304fbe](https://github.com/Metronome-Industries/metronome-ruby/commit/a304fbe7fbdec29e84f6d7e00757ac8d53c4ddf2))
13
+ * add invoice type filter for list invoices api ([872e130](https://github.com/Metronome-Industries/metronome-ruby/commit/872e1300646c989ab9d1ae057358213651f140d9))
14
+ * Add list seat balances API endpoint to SDK ([b00dd28](https://github.com/Metronome-Industries/metronome-ruby/commit/b00dd2876202080710203143d27a3b592aa7333b))
15
+ * Add regenerated_from_invoice_id to getInvoice response ([4fcd94f](https://github.com/Metronome-Industries/metronome-ruby/commit/4fcd94f52de907beea33c5f619ee529cdf2ee295))
16
+ * Add sql_breakdown_granularity flag to product create/edit ([101c0ef](https://github.com/Metronome-Industries/metronome-ruby/commit/101c0efded08535d01f7d5ef67b80c3325be7e5a))
17
+ * added custom fields to create contract with package ([3df5eaf](https://github.com/Metronome-Industries/metronome-ruby/commit/3df5eafd29b0d030f2de6c9b1da6bd0f2d83fefd))
18
+ * doc updates ([a38c0ad](https://github.com/Metronome-Industries/metronome-ruby/commit/a38c0adccd0a9de33f91052cef6f8db0bfd054ba))
19
+ * Limit spend breakdown/seat balances to 100 vals ([019e16c](https://github.com/Metronome-Industries/metronome-ruby/commit/019e16ca2e5091d75d9674d3c1ae58e4af6c8786))
20
+ * Pranadreddy/launch 2486 remove dead billing anchor date field from api ([880922c](https://github.com/Metronome-Industries/metronome-ruby/commit/880922c776ce6b9026338097d22629153b06790d))
21
+ * support setting headers via env ([70a6689](https://github.com/Metronome-Industries/metronome-ruby/commit/70a66896bf1c85734adbcc3f90ec88e91b3b124d))
22
+ * Update stainless.yml to include Java configuration logic ([caadd1b](https://github.com/Metronome-Industries/metronome-ruby/commit/caadd1bcdfe6e513fa45e1ffe7ba16be4078f8e0))
23
+ * wip ([d85557d](https://github.com/Metronome-Industries/metronome-ruby/commit/d85557d5c8d4e42eaedeeb01d52e925cfaec2bf5))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * add archived_at to Credit schema (parity with Commit) ([c4cb0de](https://github.com/Metronome-Industries/metronome-ruby/commit/c4cb0de6639d6260cd5cd4991c2bdbbca9a56308))
29
+ * **client:** elide content type header on requests without body ([3229b9e](https://github.com/Metronome-Industries/metronome-ruby/commit/3229b9ea9655734024eeacf899aef1559401c950))
30
+
31
+
32
+ ### Chores
33
+
34
+ * configure new SDK language ([2318d44](https://github.com/Metronome-Industries/metronome-ruby/commit/2318d447232cd1368c1be58b004f4e56f6ec58f8))
35
+ * configure new SDK language ([c604e19](https://github.com/Metronome-Industries/metronome-ruby/commit/c604e191054d276f6620fe43ef76543c000703ee))
36
+ * configure new SDK language ([85c2a71](https://github.com/Metronome-Industries/metronome-ruby/commit/85c2a714681224c4e5b654ae2a0ffa0ff478c269))
37
+ * configure new SDK language ([7f6bb80](https://github.com/Metronome-Industries/metronome-ruby/commit/7f6bb80a5e0f7838849aa1fef4e255ac7a7c6d44))
38
+ * **internal:** more robust bootstrap script ([3f8dd59](https://github.com/Metronome-Industries/metronome-ruby/commit/3f8dd59db3d7878d6232f01d0fda804657de3e2a))
39
+
3
40
  ## 3.5.0 (2026-04-18)
4
41
 
5
42
  Full Changelog: [v3.4.0...v3.5.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v3.4.0...v3.5.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "metronome-sdk", "~> 3.5.0"
29
+ gem "metronome-sdk", "~> 3.6.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -67,6 +67,19 @@ module MetronomeSDK
67
67
  raise ArgumentError.new("bearer_token is required, and can be set via environ: \"METRONOME_BEARER_TOKEN\"")
68
68
  end
69
69
 
70
+ headers = {}
71
+ custom_headers_env = ENV["METRONOME_CUSTOM_HEADERS"]
72
+ unless custom_headers_env.nil?
73
+ parsed = {}
74
+ custom_headers_env.split("\n").each do |line|
75
+ colon = line.index(":")
76
+ unless colon.nil?
77
+ parsed[line[0...colon].strip] = line[(colon + 1)..].strip
78
+ end
79
+ end
80
+ headers = parsed.merge(headers)
81
+ end
82
+
70
83
  @bearer_token = bearer_token.to_s
71
84
  @webhook_secret = webhook_secret&.to_s
72
85
 
@@ -75,7 +88,8 @@ module MetronomeSDK
75
88
  timeout: timeout,
76
89
  max_retries: max_retries,
77
90
  initial_retry_delay: initial_retry_delay,
78
- max_retry_delay: max_retry_delay
91
+ max_retry_delay: max_retry_delay,
92
+ headers: headers
79
93
  )
80
94
 
81
95
  @v2 = MetronomeSDK::Resources::V2.new(client: self)
@@ -306,6 +306,8 @@ module MetronomeSDK
306
306
  MetronomeSDK::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
307
307
  end
308
308
 
309
+ headers.delete("content-type") if body.nil?
310
+
309
311
  url = MetronomeSDK::Internal::Util.join_parsed_uri(
310
312
  @base_url_components,
311
313
  {**req, path: path, query: query}
@@ -200,8 +200,9 @@ module MetronomeSDK
200
200
  # @!attribute subscriptions
201
201
  # List of subscriptions on the contract.
202
202
  #
203
- # @return [Array<MetronomeSDK::Models::Subscription>, nil]
204
- optional :subscriptions, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Subscription] }
203
+ # @return [Array<MetronomeSDK::Models::ContractV2::Subscription>, nil]
204
+ optional :subscriptions,
205
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::Subscription] }
205
206
 
206
207
  # @!attribute total_contract_value
207
208
  #
@@ -284,7 +285,7 @@ module MetronomeSDK
284
285
  #
285
286
  # @param spend_threshold_configuration [MetronomeSDK::Models::SpendThresholdConfigurationV2]
286
287
  #
287
- # @param subscriptions [Array<MetronomeSDK::Models::Subscription>] List of subscriptions on the contract.
288
+ # @param subscriptions [Array<MetronomeSDK::Models::ContractV2::Subscription>] List of subscriptions on the contract.
288
289
  #
289
290
  # @param total_contract_value [Float]
290
291
  #
@@ -1645,6 +1646,11 @@ module MetronomeSDK
1645
1646
  # @return [Array<String>, nil]
1646
1647
  optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
1647
1648
 
1649
+ # @!attribute archived_at
1650
+ #
1651
+ # @return [Time, nil]
1652
+ optional :archived_at, Time
1653
+
1648
1654
  # @!attribute balance
1649
1655
  # The current balance of the credit or commit. This balance reflects the amount of
1650
1656
  # credit or commit that the customer has access to use at this moment - thus,
@@ -1746,7 +1752,7 @@ module MetronomeSDK
1746
1752
  # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
1747
1753
  optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
1748
1754
 
1749
- # @!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, recurring_credit_id: nil, rolled_over_from: nil, salesforce_opportunity_id: nil, specifiers: nil, subscription_config: nil)
1755
+ # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, archived_at: 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, recurring_credit_id: nil, rolled_over_from: nil, salesforce_opportunity_id: nil, specifiers: nil, subscription_config: nil)
1750
1756
  # Some parameter documentations has been truncated, see
1751
1757
  # {MetronomeSDK::Models::ContractV2::Credit} for more details.
1752
1758
  #
@@ -1764,6 +1770,8 @@ module MetronomeSDK
1764
1770
  #
1765
1771
  # @param applicable_product_tags [Array<String>]
1766
1772
  #
1773
+ # @param archived_at [Time]
1774
+ #
1767
1775
  # @param balance [Float] The current balance of the credit or commit. This balance reflects the amount of
1768
1776
  #
1769
1777
  # @param contract [MetronomeSDK::Models::ContractV2::Credit::Contract]
@@ -3297,6 +3305,356 @@ module MetronomeSDK
3297
3305
  # @!method self.values
3298
3306
  # @return [Array<Symbol>]
3299
3307
  end
3308
+
3309
+ class Subscription < MetronomeSDK::Internal::Type::BaseModel
3310
+ # @!attribute billing_periods
3311
+ # Previous, current, and next billing periods for the subscription.
3312
+ #
3313
+ # @return [MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods]
3314
+ required :billing_periods, -> { MetronomeSDK::ContractV2::Subscription::BillingPeriods }
3315
+
3316
+ # @!attribute collection_schedule
3317
+ #
3318
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Subscription::CollectionSchedule]
3319
+ required :collection_schedule, enum: -> { MetronomeSDK::ContractV2::Subscription::CollectionSchedule }
3320
+
3321
+ # @!attribute proration
3322
+ #
3323
+ # @return [MetronomeSDK::Models::ContractV2::Subscription::Proration]
3324
+ required :proration, -> { MetronomeSDK::ContractV2::Subscription::Proration }
3325
+
3326
+ # @!attribute quantity_management_mode
3327
+ # Determines how the subscription's quantity is controlled. Defaults to
3328
+ # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
3329
+ # directly on the subscription. `initial_quantity` must be provided with this
3330
+ # option. Compatible with recurring commits/credits that use POOLED allocation.
3331
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
3332
+ # user_123) to increment and decrement a subscription quantity, rather than
3333
+ # directly providing the quantity. You must use a **SEAT_BASED** subscription to
3334
+ # use a linked recurring credit with an allocation per seat. `seat_config` must be
3335
+ # provided with this option.
3336
+ #
3337
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Subscription::QuantityManagementMode]
3338
+ required :quantity_management_mode,
3339
+ enum: -> { MetronomeSDK::ContractV2::Subscription::QuantityManagementMode }
3340
+
3341
+ # @!attribute quantity_schedule
3342
+ # List of quantity schedule items for the subscription. Only includes the current
3343
+ # quantity and future quantity changes.
3344
+ #
3345
+ # @return [Array<MetronomeSDK::Models::ContractV2::Subscription::QuantitySchedule>]
3346
+ required :quantity_schedule,
3347
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::Subscription::QuantitySchedule] }
3348
+
3349
+ # @!attribute starting_at
3350
+ #
3351
+ # @return [Time]
3352
+ required :starting_at, Time
3353
+
3354
+ # @!attribute subscription_rate
3355
+ #
3356
+ # @return [MetronomeSDK::Models::ContractV2::Subscription::SubscriptionRate]
3357
+ required :subscription_rate, -> { MetronomeSDK::ContractV2::Subscription::SubscriptionRate }
3358
+
3359
+ # @!attribute id
3360
+ #
3361
+ # @return [String, nil]
3362
+ optional :id, String
3363
+
3364
+ # @!attribute custom_fields
3365
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3366
+ #
3367
+ # @return [Hash{Symbol=>String}, nil]
3368
+ optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]
3369
+
3370
+ # @!attribute description
3371
+ #
3372
+ # @return [String, nil]
3373
+ optional :description, String
3374
+
3375
+ # @!attribute ending_before
3376
+ #
3377
+ # @return [Time, nil]
3378
+ optional :ending_before, Time
3379
+
3380
+ # @!attribute fiat_credit_type_id
3381
+ #
3382
+ # @return [String, nil]
3383
+ optional :fiat_credit_type_id, String
3384
+
3385
+ # @!attribute name
3386
+ #
3387
+ # @return [String, nil]
3388
+ optional :name, String
3389
+
3390
+ # @!attribute seat_config
3391
+ #
3392
+ # @return [MetronomeSDK::Models::ContractV2::Subscription::SeatConfig, nil]
3393
+ optional :seat_config, -> { MetronomeSDK::ContractV2::Subscription::SeatConfig }
3394
+
3395
+ # @!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)
3396
+ # Some parameter documentations has been truncated, see
3397
+ # {MetronomeSDK::Models::ContractV2::Subscription} for more details.
3398
+ #
3399
+ # @param billing_periods [MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods] Previous, current, and next billing periods for the subscription.
3400
+ #
3401
+ # @param collection_schedule [Symbol, MetronomeSDK::Models::ContractV2::Subscription::CollectionSchedule]
3402
+ #
3403
+ # @param proration [MetronomeSDK::Models::ContractV2::Subscription::Proration]
3404
+ #
3405
+ # @param quantity_management_mode [Symbol, MetronomeSDK::Models::ContractV2::Subscription::QuantityManagementMode] Determines how the subscription's quantity is controlled. Defaults to QUANTITY_O
3406
+ #
3407
+ # @param quantity_schedule [Array<MetronomeSDK::Models::ContractV2::Subscription::QuantitySchedule>] List of quantity schedule items for the subscription. Only includes the current
3408
+ #
3409
+ # @param starting_at [Time]
3410
+ #
3411
+ # @param subscription_rate [MetronomeSDK::Models::ContractV2::Subscription::SubscriptionRate]
3412
+ #
3413
+ # @param id [String]
3414
+ #
3415
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3416
+ #
3417
+ # @param description [String]
3418
+ #
3419
+ # @param ending_before [Time]
3420
+ #
3421
+ # @param fiat_credit_type_id [String]
3422
+ #
3423
+ # @param name [String]
3424
+ #
3425
+ # @param seat_config [MetronomeSDK::Models::ContractV2::Subscription::SeatConfig]
3426
+
3427
+ # @see MetronomeSDK::Models::ContractV2::Subscription#billing_periods
3428
+ class BillingPeriods < MetronomeSDK::Internal::Type::BaseModel
3429
+ # @!attribute current
3430
+ #
3431
+ # @return [MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods::Current, nil]
3432
+ optional :current, -> { MetronomeSDK::ContractV2::Subscription::BillingPeriods::Current }
3433
+
3434
+ # @!attribute next_
3435
+ #
3436
+ # @return [MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods::Next, nil]
3437
+ optional :next_,
3438
+ -> {
3439
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Next
3440
+ },
3441
+ api_name: :next
3442
+
3443
+ # @!attribute previous
3444
+ #
3445
+ # @return [MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods::Previous, nil]
3446
+ optional :previous, -> { MetronomeSDK::ContractV2::Subscription::BillingPeriods::Previous }
3447
+
3448
+ # @!method initialize(current: nil, next_: nil, previous: nil)
3449
+ # Previous, current, and next billing periods for the subscription.
3450
+ #
3451
+ # @param current [MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods::Current]
3452
+ # @param next_ [MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods::Next]
3453
+ # @param previous [MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods::Previous]
3454
+
3455
+ # @see MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods#current
3456
+ class Current < MetronomeSDK::Internal::Type::BaseModel
3457
+ # @!attribute ending_before
3458
+ #
3459
+ # @return [Time]
3460
+ required :ending_before, Time
3461
+
3462
+ # @!attribute starting_at
3463
+ #
3464
+ # @return [Time]
3465
+ required :starting_at, Time
3466
+
3467
+ # @!method initialize(ending_before:, starting_at:)
3468
+ # @param ending_before [Time]
3469
+ # @param starting_at [Time]
3470
+ end
3471
+
3472
+ # @see MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods#next_
3473
+ class Next < MetronomeSDK::Internal::Type::BaseModel
3474
+ # @!attribute ending_before
3475
+ #
3476
+ # @return [Time]
3477
+ required :ending_before, Time
3478
+
3479
+ # @!attribute starting_at
3480
+ #
3481
+ # @return [Time]
3482
+ required :starting_at, Time
3483
+
3484
+ # @!method initialize(ending_before:, starting_at:)
3485
+ # @param ending_before [Time]
3486
+ # @param starting_at [Time]
3487
+ end
3488
+
3489
+ # @see MetronomeSDK::Models::ContractV2::Subscription::BillingPeriods#previous
3490
+ class Previous < MetronomeSDK::Internal::Type::BaseModel
3491
+ # @!attribute ending_before
3492
+ #
3493
+ # @return [Time]
3494
+ required :ending_before, Time
3495
+
3496
+ # @!attribute starting_at
3497
+ #
3498
+ # @return [Time]
3499
+ required :starting_at, Time
3500
+
3501
+ # @!method initialize(ending_before:, starting_at:)
3502
+ # @param ending_before [Time]
3503
+ # @param starting_at [Time]
3504
+ end
3505
+ end
3506
+
3507
+ # @see MetronomeSDK::Models::ContractV2::Subscription#collection_schedule
3508
+ module CollectionSchedule
3509
+ extend MetronomeSDK::Internal::Type::Enum
3510
+
3511
+ ADVANCE = :ADVANCE
3512
+ ARREARS = :ARREARS
3513
+
3514
+ # @!method self.values
3515
+ # @return [Array<Symbol>]
3516
+ end
3517
+
3518
+ # @see MetronomeSDK::Models::ContractV2::Subscription#proration
3519
+ class Proration < MetronomeSDK::Internal::Type::BaseModel
3520
+ # @!attribute invoice_behavior
3521
+ #
3522
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Subscription::Proration::InvoiceBehavior]
3523
+ required :invoice_behavior,
3524
+ enum: -> { MetronomeSDK::ContractV2::Subscription::Proration::InvoiceBehavior }
3525
+
3526
+ # @!attribute is_prorated
3527
+ #
3528
+ # @return [Boolean]
3529
+ required :is_prorated, MetronomeSDK::Internal::Type::Boolean
3530
+
3531
+ # @!method initialize(invoice_behavior:, is_prorated:)
3532
+ # @param invoice_behavior [Symbol, MetronomeSDK::Models::ContractV2::Subscription::Proration::InvoiceBehavior]
3533
+ # @param is_prorated [Boolean]
3534
+
3535
+ # @see MetronomeSDK::Models::ContractV2::Subscription::Proration#invoice_behavior
3536
+ module InvoiceBehavior
3537
+ extend MetronomeSDK::Internal::Type::Enum
3538
+
3539
+ BILL_IMMEDIATELY = :BILL_IMMEDIATELY
3540
+ BILL_ON_NEXT_COLLECTION_DATE = :BILL_ON_NEXT_COLLECTION_DATE
3541
+
3542
+ # @!method self.values
3543
+ # @return [Array<Symbol>]
3544
+ end
3545
+ end
3546
+
3547
+ # Determines how the subscription's quantity is controlled. Defaults to
3548
+ # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
3549
+ # directly on the subscription. `initial_quantity` must be provided with this
3550
+ # option. Compatible with recurring commits/credits that use POOLED allocation.
3551
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
3552
+ # user_123) to increment and decrement a subscription quantity, rather than
3553
+ # directly providing the quantity. You must use a **SEAT_BASED** subscription to
3554
+ # use a linked recurring credit with an allocation per seat. `seat_config` must be
3555
+ # provided with this option.
3556
+ #
3557
+ # @see MetronomeSDK::Models::ContractV2::Subscription#quantity_management_mode
3558
+ module QuantityManagementMode
3559
+ extend MetronomeSDK::Internal::Type::Enum
3560
+
3561
+ SEAT_BASED = :SEAT_BASED
3562
+ QUANTITY_ONLY = :QUANTITY_ONLY
3563
+
3564
+ # @!method self.values
3565
+ # @return [Array<Symbol>]
3566
+ end
3567
+
3568
+ class QuantitySchedule < MetronomeSDK::Internal::Type::BaseModel
3569
+ # @!attribute quantity
3570
+ #
3571
+ # @return [Float]
3572
+ required :quantity, Float
3573
+
3574
+ # @!attribute starting_at
3575
+ #
3576
+ # @return [Time]
3577
+ required :starting_at, Time
3578
+
3579
+ # @!attribute ending_before
3580
+ #
3581
+ # @return [Time, nil]
3582
+ optional :ending_before, Time
3583
+
3584
+ # @!method initialize(quantity:, starting_at:, ending_before: nil)
3585
+ # @param quantity [Float]
3586
+ # @param starting_at [Time]
3587
+ # @param ending_before [Time]
3588
+ end
3589
+
3590
+ # @see MetronomeSDK::Models::ContractV2::Subscription#subscription_rate
3591
+ class SubscriptionRate < MetronomeSDK::Internal::Type::BaseModel
3592
+ # @!attribute billing_frequency
3593
+ #
3594
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Subscription::SubscriptionRate::BillingFrequency]
3595
+ required :billing_frequency,
3596
+ enum: -> { MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency }
3597
+
3598
+ # @!attribute product
3599
+ #
3600
+ # @return [MetronomeSDK::Models::ContractV2::Subscription::SubscriptionRate::Product]
3601
+ required :product, -> { MetronomeSDK::ContractV2::Subscription::SubscriptionRate::Product }
3602
+
3603
+ # @!method initialize(billing_frequency:, product:)
3604
+ # @param billing_frequency [Symbol, MetronomeSDK::Models::ContractV2::Subscription::SubscriptionRate::BillingFrequency]
3605
+ # @param product [MetronomeSDK::Models::ContractV2::Subscription::SubscriptionRate::Product]
3606
+
3607
+ # @see MetronomeSDK::Models::ContractV2::Subscription::SubscriptionRate#billing_frequency
3608
+ module BillingFrequency
3609
+ extend MetronomeSDK::Internal::Type::Enum
3610
+
3611
+ MONTHLY = :MONTHLY
3612
+ QUARTERLY = :QUARTERLY
3613
+ ANNUAL = :ANNUAL
3614
+ WEEKLY = :WEEKLY
3615
+
3616
+ # @!method self.values
3617
+ # @return [Array<Symbol>]
3618
+ end
3619
+
3620
+ # @see MetronomeSDK::Models::ContractV2::Subscription::SubscriptionRate#product
3621
+ class Product < MetronomeSDK::Internal::Type::BaseModel
3622
+ # @!attribute id
3623
+ #
3624
+ # @return [String]
3625
+ required :id, String
3626
+
3627
+ # @!attribute name
3628
+ #
3629
+ # @return [String]
3630
+ required :name, String
3631
+
3632
+ # @!method initialize(id:, name:)
3633
+ # @param id [String]
3634
+ # @param name [String]
3635
+ end
3636
+ end
3637
+
3638
+ # @see MetronomeSDK::Models::ContractV2::Subscription#seat_config
3639
+ class SeatConfig < MetronomeSDK::Internal::Type::BaseModel
3640
+ # @!attribute seat_group_key
3641
+ # The property name, sent on usage events, that identifies the seat ID associated
3642
+ # with the usage event. For example, the property name might be seat_id or
3643
+ # user_id. The property must be set as a group key on billable metrics and a
3644
+ # presentation/pricing group key on contract products. This allows linked
3645
+ # recurring credits with an allocation per seat to be consumed by only one seat's
3646
+ # usage.
3647
+ #
3648
+ # @return [String]
3649
+ required :seat_group_key, String
3650
+
3651
+ # @!method initialize(seat_group_key:)
3652
+ # Some parameter documentations has been truncated, see
3653
+ # {MetronomeSDK::Models::ContractV2::Subscription::SeatConfig} for more details.
3654
+ #
3655
+ # @param seat_group_key [String] The property name, sent on usage events, that identifies the seat ID associated
3656
+ end
3657
+ end
3300
3658
  end
3301
3659
  end
3302
3660
  end
@@ -200,6 +200,7 @@ module MetronomeSDK
200
200
  CONTRACT = :Contract
201
201
  COMMIT = :Commit
202
202
  CONTRACT_CREDIT = :ContractCredit
203
+ CONTRACT_CREDIT_OR_COMMIT = :ContractCreditOrCommit
203
204
 
204
205
  # @!method self.values
205
206
  # @return [Array<Symbol>]