metronome-sdk 0.1.0 → 0.3.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 (80) 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 +1 -1
  5. data/lib/metronome_sdk/internal/type/array_of.rb +1 -0
  6. data/lib/metronome_sdk/internal/type/base_model.rb +3 -1
  7. data/lib/metronome_sdk/internal/type/converter.rb +27 -0
  8. data/lib/metronome_sdk/internal/type/hash_of.rb +1 -0
  9. data/lib/metronome_sdk/internal/type/union.rb +9 -7
  10. data/lib/metronome_sdk/models/commit.rb +35 -5
  11. data/lib/metronome_sdk/models/contract_without_amendments.rb +128 -2
  12. data/lib/metronome_sdk/models/credit.rb +21 -3
  13. data/lib/metronome_sdk/models/schedule_point_in_time.rb +14 -1
  14. data/lib/metronome_sdk/models/v1/alert_create_params.rb +9 -11
  15. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +54 -5
  16. data/lib/metronome_sdk/models/v1/contract_create_params.rb +219 -23
  17. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +8 -1
  18. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +10 -1
  19. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +29 -1
  20. data/lib/metronome_sdk/models/v1/customers/invoice.rb +13 -1
  21. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +2 -0
  22. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +12 -1
  23. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +12 -1
  24. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +259 -37
  25. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +602 -15
  26. data/lib/metronome_sdk/models/v2/contract_list_response.rb +194 -17
  27. data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +194 -17
  28. data/lib/metronome_sdk/resources/v1/alerts.rb +2 -2
  29. data/lib/metronome_sdk/resources/v1/contracts/products.rb +3 -1
  30. data/lib/metronome_sdk/resources/v2/contracts.rb +6 -2
  31. data/lib/metronome_sdk/version.rb +1 -1
  32. data/rbi/metronome_sdk/internal/transport/base_client.rbi +1 -1
  33. data/rbi/metronome_sdk/internal/type/converter.rbi +58 -0
  34. data/rbi/metronome_sdk/internal/type/union.rbi +9 -2
  35. data/rbi/metronome_sdk/models/commit.rbi +89 -15
  36. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +304 -6
  37. data/rbi/metronome_sdk/models/credit.rbi +54 -9
  38. data/rbi/metronome_sdk/models/schedule_point_in_time.rbi +17 -1
  39. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +16 -18
  40. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +76 -3
  41. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +433 -26
  42. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +9 -0
  43. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +13 -0
  44. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +60 -0
  45. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +16 -0
  46. data/rbi/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbi +10 -0
  47. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +14 -0
  48. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +14 -0
  49. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +481 -38
  50. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1565 -42
  51. data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +431 -37
  52. data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +431 -37
  53. data/rbi/metronome_sdk/resources/v1/alerts.rbi +5 -5
  54. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +2 -0
  55. data/rbi/metronome_sdk/resources/v2/contracts.rbi +12 -0
  56. data/sig/metronome_sdk/internal/transport/base_client.rbs +1 -1
  57. data/sig/metronome_sdk/internal/type/converter.rbs +17 -0
  58. data/sig/metronome_sdk/internal/type/union.rbs +2 -2
  59. data/sig/metronome_sdk/models/commit.rbs +50 -15
  60. data/sig/metronome_sdk/models/contract_without_amendments.rbs +120 -6
  61. data/sig/metronome_sdk/models/credit.rbs +30 -9
  62. data/sig/metronome_sdk/models/schedule_point_in_time.rbs +7 -0
  63. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +9 -9
  64. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +38 -3
  65. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +168 -6
  66. data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +7 -0
  67. data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +7 -0
  68. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +21 -0
  69. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +5 -0
  70. data/sig/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbs +4 -0
  71. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +5 -0
  72. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +5 -0
  73. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +178 -6
  74. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +629 -6
  75. data/sig/metronome_sdk/models/v2/contract_list_response.rbs +205 -30
  76. data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +205 -30
  77. data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -1
  78. data/sig/metronome_sdk/resources/v1/contracts/products.rbs +1 -0
  79. data/sig/metronome_sdk/resources/v2/contracts.rbs +2 -0
  80. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f4ff0f17b280b8084d27b79a761e6ab88ffe486ef89d0e6eb293ed03bd30c1a
4
- data.tar.gz: a9dc39b1d257fc714c2a2cc523098fb84533ac07cfcddfc9b02d0ba28651e368
3
+ metadata.gz: 1b6d2ecfc5a635976f250cecb6fa6c7b332f5779a7f947aa9fec0a3bdbe709ac
4
+ data.tar.gz: 9f2e2e93d6e3582458bb1a147ab3961df59656ff060e379b9e82c9a3014eefc8
5
5
  SHA512:
6
- metadata.gz: 406759335a7c9a236c5743e7f3127de60773ea9e7984444d3e19fa2640f20355d6f82cffb86588ab691d0a66b537acb3ee003176c8d3400e0d8fc9a8b1a1b17b
7
- data.tar.gz: f030ece1727f3e6742106c2d49c748ffe33285307ee54049f32eaab33d0926c7b3574b45487ecdf48ab4216070e1bfb36e0a774b9388c72ab8ac0a46411b0c2c
6
+ metadata.gz: 819a57ee71e4d1f8220dd90b691fed840c893225ef19e80196660bdfe8acdbe915babaa211881ab69c463e1886607203ffadb0f3ff7b0e64aa6123081c1fbd51
7
+ data.tar.gz: 80a9dcdb292e99ca7dc6759fe7c4694f2d48a50bfe272a650ef2901a85f7b70e02c013baca5e5385e5b0c7944fc28473d0f822cf4aa1838d683625851ce32fef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (2025-08-15)
4
+
5
+ Full Changelog: [v0.2.0...v0.3.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v0.2.0...v0.3.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([dc85d2b](https://github.com/Metronome-Industries/metronome-ruby/commit/dc85d2b1e840bb8a99500a34d4560c635d023776))
10
+ * **api:** api update ([b2fe3ed](https://github.com/Metronome-Industries/metronome-ruby/commit/b2fe3edfa51151ff1c6a9f15da363591b46202b7))
11
+ * **api:** api update ([361462c](https://github.com/Metronome-Industries/metronome-ruby/commit/361462c038856e72c4e889b7365b204bb3a914c6))
12
+ * **api:** api update ([acc5999](https://github.com/Metronome-Industries/metronome-ruby/commit/acc599977b528e8d916ee99d9fd9ec2a35a91b65))
13
+ * **api:** api update ([f8ffd7b](https://github.com/Metronome-Industries/metronome-ruby/commit/f8ffd7bb950eef4563012f0b96bda2f9f4a9d160))
14
+ * **api:** api update ([760744e](https://github.com/Metronome-Industries/metronome-ruby/commit/760744ef3f5155ca5202810537943a80efaa1e0f))
15
+ * **api:** api update ([6a16947](https://github.com/Metronome-Industries/metronome-ruby/commit/6a169473afa8d1d1793304afb2cd742b9c1c1b7e))
16
+ * **api:** api update ([2b47d83](https://github.com/Metronome-Industries/metronome-ruby/commit/2b47d832c06878b9725cae05f887117ad98c73d8))
17
+ * **api:** api update ([1f496c7](https://github.com/Metronome-Industries/metronome-ruby/commit/1f496c72f3c73542350c357219ff2ec6b528d2f3))
18
+ * **api:** api update ([ff4d847](https://github.com/Metronome-Industries/metronome-ruby/commit/ff4d8478d49d587bdaf70a7b52fb18fb6662d7e3))
19
+ * **api:** api update ([49702e6](https://github.com/Metronome-Industries/metronome-ruby/commit/49702e67db92e2b7495ec88e127c8a60e862a685))
20
+
21
+
22
+ ### Chores
23
+
24
+ * collect metadata from type DSL ([45d8eb1](https://github.com/Metronome-Industries/metronome-ruby/commit/45d8eb1c1ea599b68e3fcd6571d27390e52a09db))
25
+ * **internal:** update comment in script ([de52ac2](https://github.com/Metronome-Industries/metronome-ruby/commit/de52ac2965601808912f1e55952d731641132361))
26
+ * update @stainless-api/prism-cli to v5.15.0 ([6ad9705](https://github.com/Metronome-Industries/metronome-ruby/commit/6ad9705b1a25dfb037e3625e669f8d1cdc144b7a))
27
+
28
+ ## 0.2.0 (2025-07-31)
29
+
30
+ Full Changelog: [v0.1.0...v0.2.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v0.1.0...v0.2.0)
31
+
32
+ ### Features
33
+ * **api:** Add support for spend threshold alerts for specific group keys. See [updated alert documentation](https://docs.metronome.com/manage-product-access/create-manage-alerts/#spend-alerts).
34
+ * **api:** Add support for recurring commits linked to subscriptions. See documentation for [hybrid billing models](https://docs.metronome.com/launch-guides/hybrid-business/#implement-a-hybrid-model-for-a-customer).
35
+ * **api:** Add support for new styles in embeddable dashboards.
36
+ * **api:** Add reference to contract on commit objects.
37
+
38
+ ### Chores
39
+
40
+ * **docs:** Improved documentation.
41
+
3
42
  ## 0.1.0 (2025-07-24)
4
43
 
5
44
  Full Changelog: [v0.1.0-alpha.4...v0.1.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v0.1.0-alpha.4...v0.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", "~> 0.1.0"
20
+ gem "metronome-sdk", "~> 0.3.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -365,7 +365,7 @@ module MetronomeSDK
365
365
  #
366
366
  # @raise [MetronomeSDK::Errors::APIError]
367
367
  # @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
368
- private def send_request(request, redirect_count:, retry_count:, send_retry_header:)
368
+ def send_request(request, redirect_count:, retry_count:, send_retry_header:)
369
369
  url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
370
370
  input = {
371
371
  **request.except(:timeout),
@@ -148,6 +148,7 @@ module MetronomeSDK
148
148
  # @option spec [Boolean] :"nil?"
149
149
  def initialize(type_info, spec = {})
150
150
  @item_type_fn = MetronomeSDK::Internal::Type::Converter.type_info(type_info || spec)
151
+ @meta = MetronomeSDK::Internal::Type::Converter.meta_info(type_info, spec)
151
152
  @nilable = spec.fetch(:nil?, false)
152
153
  end
153
154
 
@@ -52,6 +52,7 @@ module MetronomeSDK
52
52
  #
53
53
  # @option spec [Boolean] :"nil?"
54
54
  private def add_field(name_sym, required:, type_info:, spec:)
55
+ meta = MetronomeSDK::Internal::Type::Converter.meta_info(type_info, spec)
55
56
  type_fn, info =
56
57
  case type_info
57
58
  in Proc | MetronomeSDK::Internal::Type::Converter | Class
@@ -81,7 +82,8 @@ module MetronomeSDK
81
82
  required: required,
82
83
  nilable: nilable,
83
84
  const: const,
84
- type_fn: type_fn
85
+ type_fn: type_fn,
86
+ meta: meta
85
87
  }
86
88
 
87
89
  define_method(setter) do |value|
@@ -98,6 +98,33 @@ module MetronomeSDK
98
98
  end
99
99
  end
100
100
 
101
+ # @api private
102
+ #
103
+ # @param type_info [Hash{Symbol=>Object}, Proc, MetronomeSDK::Internal::Type::Converter, Class] .
104
+ #
105
+ # @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
106
+ #
107
+ # @option type_info [Proc] :enum
108
+ #
109
+ # @option type_info [Proc] :union
110
+ #
111
+ # @option type_info [Boolean] :"nil?"
112
+ #
113
+ # @param spec [Hash{Symbol=>Object}, Proc, MetronomeSDK::Internal::Type::Converter, Class] .
114
+ #
115
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
116
+ #
117
+ # @option spec [Proc] :enum
118
+ #
119
+ # @option spec [Proc] :union
120
+ #
121
+ # @option spec [Boolean] :"nil?"
122
+ #
123
+ # @return [Hash{Symbol=>Object}]
124
+ def meta_info(type_info, spec)
125
+ [spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?)
126
+ end
127
+
101
128
  # @api private
102
129
  #
103
130
  # @param translate_names [Boolean]
@@ -168,6 +168,7 @@ module MetronomeSDK
168
168
  # @option spec [Boolean] :"nil?"
169
169
  def initialize(type_info, spec = {})
170
170
  @item_type_fn = MetronomeSDK::Internal::Type::Converter.type_info(type_info || spec)
171
+ @meta = MetronomeSDK::Internal::Type::Converter.meta_info(type_info, spec)
171
172
  @nilable = spec.fetch(:nil?, false)
172
173
  end
173
174
 
@@ -12,20 +12,20 @@ module MetronomeSDK
12
12
  #
13
13
  # All of the specified variant info for this union.
14
14
  #
15
- # @return [Array<Array(Symbol, Proc)>]
15
+ # @return [Array<Array(Symbol, Proc, Hash{Symbol=>Object})>]
16
16
  private def known_variants = (@known_variants ||= [])
17
17
 
18
18
  # @api private
19
19
  #
20
- # @return [Array<Array(Symbol, Object)>]
20
+ # @return [Array<Array(Symbol, Object, Hash{Symbol=>Object})>]
21
21
  protected def derefed_variants
22
- known_variants.map { |key, variant_fn| [key, variant_fn.call] }
22
+ known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] }
23
23
  end
24
24
 
25
25
  # All of the specified variants for this union.
26
26
  #
27
27
  # @return [Array<Object>]
28
- def variants = derefed_variants.map(&:last)
28
+ def variants = derefed_variants.map { _2 }
29
29
 
30
30
  # @api private
31
31
  #
@@ -51,12 +51,13 @@ module MetronomeSDK
51
51
  #
52
52
  # @option spec [Boolean] :"nil?"
53
53
  private def variant(key, spec = nil)
54
+ meta = MetronomeSDK::Internal::Type::Converter.meta_info(nil, spec)
54
55
  variant_info =
55
56
  case key
56
57
  in Symbol
57
- [key, MetronomeSDK::Internal::Type::Converter.type_info(spec)]
58
+ [key, MetronomeSDK::Internal::Type::Converter.type_info(spec), meta]
58
59
  in Proc | MetronomeSDK::Internal::Type::Converter | Class | Hash
59
- [nil, MetronomeSDK::Internal::Type::Converter.type_info(key)]
60
+ [nil, MetronomeSDK::Internal::Type::Converter.type_info(key), meta]
60
61
  end
61
62
 
62
63
  known_variants << variant_info
@@ -79,7 +80,8 @@ module MetronomeSDK
79
80
  return nil if key == MetronomeSDK::Internal::OMIT
80
81
 
81
82
  key = key.to_sym if key.is_a?(String)
82
- known_variants.find { |k,| k == key }&.last&.call
83
+ _, found = known_variants.find { |k,| k == key }
84
+ found&.call
83
85
  else
84
86
  nil
85
87
  end
@@ -479,12 +479,18 @@ module MetronomeSDK
479
479
  MetronomeSDK::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry::Type
480
480
  }
481
481
 
482
- # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:)
482
+ # @!attribute contract_id
483
+ #
484
+ # @return [String, nil]
485
+ optional :contract_id, String
486
+
487
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
483
488
  # @param amount [Float]
484
489
  # @param invoice_id [String]
485
490
  # @param segment_id [String]
486
491
  # @param timestamp [Time]
487
492
  # @param type [Symbol, MetronomeSDK::Models::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry::Type]
493
+ # @param contract_id [String]
488
494
 
489
495
  # @see MetronomeSDK::Models::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry#type
490
496
  module Type
@@ -605,12 +611,18 @@ module MetronomeSDK
605
611
  # @return [Symbol, MetronomeSDK::Models::Commit::Ledger::PrepaidCommitCanceledLedgerEntry::Type]
606
612
  required :type, enum: -> { MetronomeSDK::Commit::Ledger::PrepaidCommitCanceledLedgerEntry::Type }
607
613
 
608
- # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:)
614
+ # @!attribute contract_id
615
+ #
616
+ # @return [String, nil]
617
+ optional :contract_id, String
618
+
619
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
609
620
  # @param amount [Float]
610
621
  # @param invoice_id [String]
611
622
  # @param segment_id [String]
612
623
  # @param timestamp [Time]
613
624
  # @param type [Symbol, MetronomeSDK::Models::Commit::Ledger::PrepaidCommitCanceledLedgerEntry::Type]
625
+ # @param contract_id [String]
614
626
 
615
627
  # @see MetronomeSDK::Models::Commit::Ledger::PrepaidCommitCanceledLedgerEntry#type
616
628
  module Type
@@ -649,12 +661,18 @@ module MetronomeSDK
649
661
  # @return [Symbol, MetronomeSDK::Models::Commit::Ledger::PrepaidCommitCreditedLedgerEntry::Type]
650
662
  required :type, enum: -> { MetronomeSDK::Commit::Ledger::PrepaidCommitCreditedLedgerEntry::Type }
651
663
 
652
- # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:)
664
+ # @!attribute contract_id
665
+ #
666
+ # @return [String, nil]
667
+ optional :contract_id, String
668
+
669
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
653
670
  # @param amount [Float]
654
671
  # @param invoice_id [String]
655
672
  # @param segment_id [String]
656
673
  # @param timestamp [Time]
657
674
  # @param type [Symbol, MetronomeSDK::Models::Commit::Ledger::PrepaidCommitCreditedLedgerEntry::Type]
675
+ # @param contract_id [String]
658
676
 
659
677
  # @see MetronomeSDK::Models::Commit::Ledger::PrepaidCommitCreditedLedgerEntry#type
660
678
  module Type
@@ -772,12 +790,18 @@ module MetronomeSDK
772
790
  MetronomeSDK::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry::Type
773
791
  }
774
792
 
775
- # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:)
793
+ # @!attribute contract_id
794
+ #
795
+ # @return [String, nil]
796
+ optional :contract_id, String
797
+
798
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
776
799
  # @param amount [Float]
777
800
  # @param invoice_id [String]
778
801
  # @param segment_id [String]
779
802
  # @param timestamp [Time]
780
803
  # @param type [Symbol, MetronomeSDK::Models::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry::Type]
804
+ # @param contract_id [String]
781
805
 
782
806
  # @see MetronomeSDK::Models::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry#type
783
807
  module Type
@@ -855,11 +879,17 @@ module MetronomeSDK
855
879
  # @return [Symbol, MetronomeSDK::Models::Commit::Ledger::PostpaidCommitTrueupLedgerEntry::Type]
856
880
  required :type, enum: -> { MetronomeSDK::Commit::Ledger::PostpaidCommitTrueupLedgerEntry::Type }
857
881
 
858
- # @!method initialize(amount:, invoice_id:, timestamp:, type:)
882
+ # @!attribute contract_id
883
+ #
884
+ # @return [String, nil]
885
+ optional :contract_id, String
886
+
887
+ # @!method initialize(amount:, invoice_id:, timestamp:, type:, contract_id: nil)
859
888
  # @param amount [Float]
860
889
  # @param invoice_id [String]
861
890
  # @param timestamp [Time]
862
891
  # @param type [Symbol, MetronomeSDK::Models::Commit::Ledger::PostpaidCommitTrueupLedgerEntry::Type]
892
+ # @param contract_id [String]
863
893
 
864
894
  # @see MetronomeSDK::Models::Commit::Ledger::PostpaidCommitTrueupLedgerEntry#type
865
895
  module Type
@@ -836,7 +836,14 @@ module MetronomeSDK
836
836
  MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractWithoutAmendments::RecurringCommit::Specifier]
837
837
  }
838
838
 
839
- # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, invoice_amount: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil)
839
+ # @!attribute subscription_config
840
+ # Attach a subscription to the recurring commit/credit.
841
+ #
842
+ # @return [MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig, nil]
843
+ optional :subscription_config,
844
+ -> { MetronomeSDK::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig }
845
+
846
+ # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, invoice_amount: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
840
847
  # Some parameter documentations has been truncated, see
841
848
  # {MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit} for more
842
849
  # details.
@@ -880,6 +887,8 @@ module MetronomeSDK
880
887
  # @param rollover_fraction [Float] Will be passed down to the individual commits. This controls how much of an indi
881
888
  #
882
889
  # @param specifiers [Array<MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::Specifier>] List of filters that determine what kind of customer usage draws down a commit o
890
+ #
891
+ # @param subscription_config [MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig] Attach a subscription to the recurring commit/credit.
883
892
 
884
893
  # @see MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit#access_amount
885
894
  class AccessAmount < MetronomeSDK::Internal::Type::BaseModel
@@ -1185,6 +1194,60 @@ module MetronomeSDK
1185
1194
  #
1186
1195
  # @param product_tags [Array<String>] If provided, the specifier will only apply to products with all the specified ta
1187
1196
  end
1197
+
1198
+ # @see MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit#subscription_config
1199
+ class SubscriptionConfig < MetronomeSDK::Internal::Type::BaseModel
1200
+ # @!attribute allocation
1201
+ #
1202
+ # @return [Symbol, MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig::Allocation]
1203
+ required :allocation,
1204
+ enum: -> {
1205
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig::Allocation
1206
+ }
1207
+
1208
+ # @!attribute apply_seat_increase_config
1209
+ #
1210
+ # @return [MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig::ApplySeatIncreaseConfig]
1211
+ required :apply_seat_increase_config,
1212
+ -> {
1213
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig::ApplySeatIncreaseConfig
1214
+ }
1215
+
1216
+ # @!attribute subscription_id
1217
+ #
1218
+ # @return [String]
1219
+ required :subscription_id, String
1220
+
1221
+ # @!method initialize(allocation:, apply_seat_increase_config:, subscription_id:)
1222
+ # Attach a subscription to the recurring commit/credit.
1223
+ #
1224
+ # @param allocation [Symbol, MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig::Allocation]
1225
+ # @param apply_seat_increase_config [MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig::ApplySeatIncreaseConfig]
1226
+ # @param subscription_id [String]
1227
+
1228
+ # @see MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig#allocation
1229
+ module Allocation
1230
+ extend MetronomeSDK::Internal::Type::Enum
1231
+
1232
+ INDIVIDUAL = :INDIVIDUAL
1233
+ POOLED = :POOLED
1234
+
1235
+ # @!method self.values
1236
+ # @return [Array<Symbol>]
1237
+ end
1238
+
1239
+ # @see MetronomeSDK::Models::ContractWithoutAmendments::RecurringCommit::SubscriptionConfig#apply_seat_increase_config
1240
+ class ApplySeatIncreaseConfig < MetronomeSDK::Internal::Type::BaseModel
1241
+ # @!attribute is_prorated
1242
+ # Indicates whether a mid-period seat increase should be prorated.
1243
+ #
1244
+ # @return [Boolean]
1245
+ required :is_prorated, MetronomeSDK::Internal::Type::Boolean
1246
+
1247
+ # @!method initialize(is_prorated:)
1248
+ # @param is_prorated [Boolean] Indicates whether a mid-period seat increase should be prorated.
1249
+ end
1250
+ end
1188
1251
  end
1189
1252
 
1190
1253
  class RecurringCredit < MetronomeSDK::Internal::Type::BaseModel
@@ -1316,7 +1379,14 @@ module MetronomeSDK
1316
1379
  MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractWithoutAmendments::RecurringCredit::Specifier]
1317
1380
  }
1318
1381
 
1319
- # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil)
1382
+ # @!attribute subscription_config
1383
+ # Attach a subscription to the recurring commit/credit.
1384
+ #
1385
+ # @return [MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig, nil]
1386
+ optional :subscription_config,
1387
+ -> { MetronomeSDK::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig }
1388
+
1389
+ # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
1320
1390
  # Some parameter documentations has been truncated, see
1321
1391
  # {MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit} for more
1322
1392
  # details.
@@ -1358,6 +1428,8 @@ module MetronomeSDK
1358
1428
  # @param rollover_fraction [Float] Will be passed down to the individual commits. This controls how much of an indi
1359
1429
  #
1360
1430
  # @param specifiers [Array<MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::Specifier>] List of filters that determine what kind of customer usage draws down a commit o
1431
+ #
1432
+ # @param subscription_config [MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig] Attach a subscription to the recurring commit/credit.
1361
1433
 
1362
1434
  # @see MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit#access_amount
1363
1435
  class AccessAmount < MetronomeSDK::Internal::Type::BaseModel
@@ -1638,6 +1710,60 @@ module MetronomeSDK
1638
1710
  #
1639
1711
  # @param product_tags [Array<String>] If provided, the specifier will only apply to products with all the specified ta
1640
1712
  end
1713
+
1714
+ # @see MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit#subscription_config
1715
+ class SubscriptionConfig < MetronomeSDK::Internal::Type::BaseModel
1716
+ # @!attribute allocation
1717
+ #
1718
+ # @return [Symbol, MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig::Allocation]
1719
+ required :allocation,
1720
+ enum: -> {
1721
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig::Allocation
1722
+ }
1723
+
1724
+ # @!attribute apply_seat_increase_config
1725
+ #
1726
+ # @return [MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig::ApplySeatIncreaseConfig]
1727
+ required :apply_seat_increase_config,
1728
+ -> {
1729
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig::ApplySeatIncreaseConfig
1730
+ }
1731
+
1732
+ # @!attribute subscription_id
1733
+ #
1734
+ # @return [String]
1735
+ required :subscription_id, String
1736
+
1737
+ # @!method initialize(allocation:, apply_seat_increase_config:, subscription_id:)
1738
+ # Attach a subscription to the recurring commit/credit.
1739
+ #
1740
+ # @param allocation [Symbol, MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig::Allocation]
1741
+ # @param apply_seat_increase_config [MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig::ApplySeatIncreaseConfig]
1742
+ # @param subscription_id [String]
1743
+
1744
+ # @see MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig#allocation
1745
+ module Allocation
1746
+ extend MetronomeSDK::Internal::Type::Enum
1747
+
1748
+ INDIVIDUAL = :INDIVIDUAL
1749
+ POOLED = :POOLED
1750
+
1751
+ # @!method self.values
1752
+ # @return [Array<Symbol>]
1753
+ end
1754
+
1755
+ # @see MetronomeSDK::Models::ContractWithoutAmendments::RecurringCredit::SubscriptionConfig#apply_seat_increase_config
1756
+ class ApplySeatIncreaseConfig < MetronomeSDK::Internal::Type::BaseModel
1757
+ # @!attribute is_prorated
1758
+ # Indicates whether a mid-period seat increase should be prorated.
1759
+ #
1760
+ # @return [Boolean]
1761
+ required :is_prorated, MetronomeSDK::Internal::Type::Boolean
1762
+
1763
+ # @!method initialize(is_prorated:)
1764
+ # @param is_prorated [Boolean] Indicates whether a mid-period seat increase should be prorated.
1765
+ end
1766
+ end
1641
1767
  end
1642
1768
 
1643
1769
  class ResellerRoyalty < MetronomeSDK::Internal::Type::BaseModel
@@ -398,12 +398,18 @@ module MetronomeSDK
398
398
  required :type,
399
399
  enum: -> { MetronomeSDK::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry::Type }
400
400
 
401
- # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:)
401
+ # @!attribute contract_id
402
+ #
403
+ # @return [String, nil]
404
+ optional :contract_id, String
405
+
406
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
402
407
  # @param amount [Float]
403
408
  # @param invoice_id [String]
404
409
  # @param segment_id [String]
405
410
  # @param timestamp [Time]
406
411
  # @param type [Symbol, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry::Type]
412
+ # @param contract_id [String]
407
413
 
408
414
  # @see MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry#type
409
415
  module Type
@@ -480,12 +486,18 @@ module MetronomeSDK
480
486
  # @return [Symbol, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry::Type]
481
487
  required :type, enum: -> { MetronomeSDK::Credit::Ledger::CreditCanceledLedgerEntry::Type }
482
488
 
483
- # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:)
489
+ # @!attribute contract_id
490
+ #
491
+ # @return [String, nil]
492
+ optional :contract_id, String
493
+
494
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
484
495
  # @param amount [Float]
485
496
  # @param invoice_id [String]
486
497
  # @param segment_id [String]
487
498
  # @param timestamp [Time]
488
499
  # @param type [Symbol, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry::Type]
500
+ # @param contract_id [String]
489
501
 
490
502
  # @see MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry#type
491
503
  module Type
@@ -524,12 +536,18 @@ module MetronomeSDK
524
536
  # @return [Symbol, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry::Type]
525
537
  required :type, enum: -> { MetronomeSDK::Credit::Ledger::CreditCreditedLedgerEntry::Type }
526
538
 
527
- # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:)
539
+ # @!attribute contract_id
540
+ #
541
+ # @return [String, nil]
542
+ optional :contract_id, String
543
+
544
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
528
545
  # @param amount [Float]
529
546
  # @param invoice_id [String]
530
547
  # @param segment_id [String]
531
548
  # @param timestamp [Time]
532
549
  # @param type [Symbol, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry::Type]
550
+ # @param contract_id [String]
533
551
 
534
552
  # @see MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry#type
535
553
  module Type
@@ -8,14 +8,27 @@ module MetronomeSDK
8
8
  # @return [MetronomeSDK::Models::CreditTypeData, nil]
9
9
  optional :credit_type, -> { MetronomeSDK::CreditTypeData }
10
10
 
11
+ # @!attribute do_not_invoice
12
+ # This field is only applicable to commit invoice schedules. If true, this
13
+ # schedule will not generate an invoice.
14
+ #
15
+ # @return [Boolean, nil]
16
+ optional :do_not_invoice, MetronomeSDK::Internal::Type::Boolean
17
+
11
18
  # @!attribute schedule_items
12
19
  #
13
20
  # @return [Array<MetronomeSDK::Models::SchedulePointInTime::ScheduleItem>, nil]
14
21
  optional :schedule_items,
15
22
  -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::SchedulePointInTime::ScheduleItem] }
16
23
 
17
- # @!method initialize(credit_type: nil, schedule_items: nil)
24
+ # @!method initialize(credit_type: nil, do_not_invoice: nil, schedule_items: nil)
25
+ # Some parameter documentations has been truncated, see
26
+ # {MetronomeSDK::Models::SchedulePointInTime} for more details.
27
+ #
18
28
  # @param credit_type [MetronomeSDK::Models::CreditTypeData]
29
+ #
30
+ # @param do_not_invoice [Boolean] This field is only applicable to commit invoice schedules. If true, this schedul
31
+ #
19
32
  # @param schedule_items [Array<MetronomeSDK::Models::SchedulePointInTime::ScheduleItem>]
20
33
 
21
34
  class ScheduleItem < MetronomeSDK::Internal::Type::BaseModel
@@ -75,12 +75,13 @@ module MetronomeSDK
75
75
  # @return [Boolean, nil]
76
76
  optional :evaluate_on_create, MetronomeSDK::Internal::Type::Boolean
77
77
 
78
- # @!attribute group_key_filter
79
- # Scopes alert evaluation to a specific presentation group key on individual line
80
- # items. Only present for spend alerts.
78
+ # @!attribute group_values
79
+ # Only present for `spend_threshold_reached` alerts. Scope alert to a specific
80
+ # group key on individual line items.
81
81
  #
82
- # @return [MetronomeSDK::Models::V1::AlertCreateParams::GroupKeyFilter, nil]
83
- optional :group_key_filter, -> { MetronomeSDK::V1::AlertCreateParams::GroupKeyFilter }
82
+ # @return [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>, nil]
83
+ optional :group_values,
84
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::AlertCreateParams::GroupValue] }
84
85
 
85
86
  # @!attribute invoice_types_filter
86
87
  # Only supported for invoice_total_reached alerts. A list of invoice types to
@@ -104,7 +105,7 @@ module MetronomeSDK
104
105
  # @return [String, nil]
105
106
  optional :uniqueness_key, String
106
107
 
107
- # @!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_key_filter: nil, invoice_types_filter: nil, plan_id: nil, uniqueness_key: nil, request_options: {})
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: {})
108
109
  # Some parameter documentations has been truncated, see
109
110
  # {MetronomeSDK::Models::V1::AlertCreateParams} for more details.
110
111
  #
@@ -126,7 +127,7 @@ module MetronomeSDK
126
127
  #
127
128
  # @param evaluate_on_create [Boolean] If true, the alert will evaluate immediately on customers that already meet the
128
129
  #
129
- # @param group_key_filter [MetronomeSDK::Models::V1::AlertCreateParams::GroupKeyFilter] Scopes alert evaluation to a specific presentation group key on individual line
130
+ # @param group_values [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>] Only present for `spend_threshold_reached` alerts. Scope alert to a specific gro
130
131
  #
131
132
  # @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached alerts. A list of invoice types to eval
132
133
  #
@@ -195,7 +196,7 @@ module MetronomeSDK
195
196
  end
196
197
  end
197
198
 
198
- class GroupKeyFilter < MetronomeSDK::Internal::Type::BaseModel
199
+ class GroupValue < MetronomeSDK::Internal::Type::BaseModel
199
200
  # @!attribute key
200
201
  #
201
202
  # @return [String]
@@ -207,9 +208,6 @@ module MetronomeSDK
207
208
  required :value, String
208
209
 
209
210
  # @!method initialize(key:, value:)
210
- # Scopes alert evaluation to a specific presentation group key on individual line
211
- # items. Only present for spend alerts.
212
- #
213
211
  # @param key [String]
214
212
  # @param value [String]
215
213
  end