metronome-sdk 1.0.0 → 2.0.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 (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/errors.rb +25 -11
  5. data/lib/metronome_sdk/file_part.rb +10 -7
  6. data/lib/metronome_sdk/internal/body_cursor_page.rb +1 -1
  7. data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
  8. data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +1 -1
  9. data/lib/metronome_sdk/internal/transport/base_client.rb +11 -7
  10. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +7 -10
  11. data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
  12. data/lib/metronome_sdk/internal/type/enum.rb +25 -0
  13. data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
  14. data/lib/metronome_sdk/internal/util.rb +8 -7
  15. data/lib/metronome_sdk/models/contract_v2.rb +256 -6
  16. data/lib/metronome_sdk/models/contract_without_amendments.rb +2 -2
  17. data/lib/metronome_sdk/models/hierarchy_configuration.rb +99 -2
  18. data/lib/metronome_sdk/models/payment_gate_config.rb +1 -0
  19. data/lib/metronome_sdk/models/payment_gate_config_v2.rb +1 -0
  20. data/lib/metronome_sdk/models/subscription.rb +85 -1
  21. data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
  22. data/lib/metronome_sdk/models/v1/alert_create_params.rb +38 -36
  23. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +1 -0
  24. data/lib/metronome_sdk/models/v1/contract_create_params.rb +101 -3
  25. data/lib/metronome_sdk/models/v1/customer_detail.rb +9 -1
  26. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +5 -15
  27. data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
  28. data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +3 -3
  29. data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
  30. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +12 -12
  31. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +40 -38
  32. data/lib/metronome_sdk/models/v1/customers/invoice.rb +136 -18
  33. data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
  34. data/lib/metronome_sdk/models/v1/payment.rb +151 -0
  35. data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
  36. data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
  37. data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
  38. data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
  39. data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
  40. data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
  41. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +9 -1
  42. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +9 -1
  43. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +186 -3
  44. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +195 -8
  45. data/lib/metronome_sdk/resources/v1/alerts.rb +57 -53
  46. data/lib/metronome_sdk/resources/v1/contracts.rb +4 -3
  47. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +70 -51
  48. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +55 -0
  49. data/lib/metronome_sdk/resources/v1/customers.rb +7 -4
  50. data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
  51. data/lib/metronome_sdk/resources/v1/usage.rb +4 -2
  52. data/lib/metronome_sdk/resources/v1.rb +4 -0
  53. data/lib/metronome_sdk/resources/v2/contracts.rb +9 -3
  54. data/lib/metronome_sdk/version.rb +1 -1
  55. data/lib/metronome_sdk.rb +9 -0
  56. data/rbi/metronome_sdk/errors.rbi +29 -2
  57. data/rbi/metronome_sdk/file_part.rbi +1 -1
  58. data/rbi/metronome_sdk/internal/transport/base_client.rbi +4 -5
  59. data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
  60. data/rbi/metronome_sdk/internal/util.rbi +1 -1
  61. data/rbi/metronome_sdk/models/contract_v2.rbi +603 -10
  62. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +2 -2
  63. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +250 -6
  64. data/rbi/metronome_sdk/models/payment_gate_config.rbi +5 -0
  65. data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +5 -0
  66. data/rbi/metronome_sdk/models/subscription.rbi +175 -0
  67. data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
  68. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +51 -47
  69. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +5 -0
  70. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +257 -4
  71. data/rbi/metronome_sdk/models/v1/customer_detail.rbi +8 -0
  72. data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
  73. data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
  74. data/rbi/metronome_sdk/models/v1/customers/alert_list_params.rbi +4 -4
  75. data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
  76. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +14 -14
  77. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +48 -44
  78. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +246 -58
  79. data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
  80. data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
  81. data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
  82. data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
  83. data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
  84. data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
  85. data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
  86. data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
  87. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +18 -0
  88. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +18 -0
  89. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +498 -6
  90. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +462 -14
  91. data/rbi/metronome_sdk/resources/v1/alerts.rbi +68 -64
  92. data/rbi/metronome_sdk/resources/v1/contracts.rbi +4 -3
  93. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +73 -54
  94. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +36 -0
  95. data/rbi/metronome_sdk/resources/v1/customers.rbi +7 -4
  96. data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
  97. data/rbi/metronome_sdk/resources/v1/usage.rbi +4 -2
  98. data/rbi/metronome_sdk/resources/v1.rbi +3 -0
  99. data/rbi/metronome_sdk/resources/v2/contracts.rbi +14 -0
  100. data/sig/metronome_sdk/errors.rbs +7 -0
  101. data/sig/metronome_sdk/file_part.rbs +1 -1
  102. data/sig/metronome_sdk/models/contract_v2.rbs +239 -12
  103. data/sig/metronome_sdk/models/hierarchy_configuration.rbs +87 -6
  104. data/sig/metronome_sdk/models/payment_gate_config.rbs +2 -1
  105. data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +2 -1
  106. data/sig/metronome_sdk/models/subscription.rbs +80 -0
  107. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +2 -1
  108. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +91 -5
  109. data/sig/metronome_sdk/models/v1/customer_detail.rbs +5 -0
  110. data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
  111. data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -4
  112. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +137 -24
  113. data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
  114. data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
  115. data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
  116. data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
  117. data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
  118. data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
  119. data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
  120. data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
  121. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +9 -0
  122. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +9 -0
  123. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +182 -7
  124. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +221 -18
  125. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
  126. data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
  127. data/sig/metronome_sdk/resources/v1.rbs +2 -0
  128. data/sig/metronome_sdk/resources/v2/contracts.rbs +3 -0
  129. metadata +29 -2
@@ -16,7 +16,7 @@ module MetronomeSDK
16
16
  )
17
17
  end
18
18
 
19
- # The Metronome ID of the alert
19
+ # The Metronome ID of the threshold notification
20
20
  sig { returns(String) }
21
21
  attr_accessor :alert_id
22
22
 
@@ -32,7 +32,7 @@ module MetronomeSDK
32
32
  ).returns(T.attached_class)
33
33
  end
34
34
  def self.new(
35
- # The Metronome ID of the alert
35
+ # The Metronome ID of the threshold notification
36
36
  alert_id:,
37
37
  # The Metronome ID of the customer
38
38
  customer_id:,
@@ -16,7 +16,7 @@ module MetronomeSDK
16
16
  )
17
17
  end
18
18
 
19
- # The Metronome ID of the alert
19
+ # The Metronome ID of the threshold notification
20
20
  sig { returns(String) }
21
21
  attr_accessor :alert_id
22
22
 
@@ -24,8 +24,8 @@ module MetronomeSDK
24
24
  sig { returns(String) }
25
25
  attr_accessor :customer_id
26
26
 
27
- # Only present for `spend_threshold_reached` alerts. Retrieve the alert for a
28
- # specific group key-value pair.
27
+ # Only present for `spend_threshold_reached` notifications. Retrieve the
28
+ # notification for a specific group key-value pair.
29
29
  sig do
30
30
  returns(
31
31
  T.nilable(
@@ -47,8 +47,8 @@ module MetronomeSDK
47
47
  end
48
48
  attr_writer :group_values
49
49
 
50
- # When parallel alerts are enabled during migration, this flag denotes whether to
51
- # fetch alerts for plans or contracts.
50
+ # When parallel threshold notifications are enabled during migration, this flag
51
+ # denotes whether to fetch notifications for plans or contracts.
52
52
  sig do
53
53
  returns(
54
54
  T.nilable(
@@ -80,15 +80,15 @@ module MetronomeSDK
80
80
  ).returns(T.attached_class)
81
81
  end
82
82
  def self.new(
83
- # The Metronome ID of the alert
83
+ # The Metronome ID of the threshold notification
84
84
  alert_id:,
85
85
  # The Metronome ID of the customer
86
86
  customer_id:,
87
- # Only present for `spend_threshold_reached` alerts. Retrieve the alert for a
88
- # specific group key-value pair.
87
+ # Only present for `spend_threshold_reached` notifications. Retrieve the
88
+ # notification for a specific group key-value pair.
89
89
  group_values: nil,
90
- # When parallel alerts are enabled during migration, this flag denotes whether to
91
- # fetch alerts for plans or contracts.
90
+ # When parallel threshold notifications are enabled during migration, this flag
91
+ # denotes whether to fetch notifications for plans or contracts.
92
92
  plans_or_contracts: nil,
93
93
  request_options: {}
94
94
  )
@@ -127,8 +127,8 @@ module MetronomeSDK
127
127
  sig { returns(String) }
128
128
  attr_accessor :value
129
129
 
130
- # Scopes alert evaluation to a specific presentation group key on individual line
131
- # items. Only present for spend alerts.
130
+ # Scopes threshold notification evaluation to a specific presentation group key on
131
+ # individual line items. Only present for spend notifications.
132
132
  sig { params(key: String, value: String).returns(T.attached_class) }
133
133
  def self.new(key:, value:)
134
134
  end
@@ -138,8 +138,8 @@ module MetronomeSDK
138
138
  end
139
139
  end
140
140
 
141
- # When parallel alerts are enabled during migration, this flag denotes whether to
142
- # fetch alerts for plans or contracts.
141
+ # When parallel threshold notifications are enabled during migration, this flag
142
+ # denotes whether to fetch notifications for plans or contracts.
143
143
  module PlansOrContracts
144
144
  extend MetronomeSDK::Internal::Type::Enum
145
145
 
@@ -25,8 +25,8 @@ module MetronomeSDK
25
25
  end
26
26
  attr_writer :alert
27
27
 
28
- # The status of the customer alert. If the alert is archived, null will be
29
- # returned.
28
+ # The status of the threshold notification. If the notification is archived, null
29
+ # will be returned.
30
30
  sig do
31
31
  returns(
32
32
  T.nilable(
@@ -36,7 +36,7 @@ module MetronomeSDK
36
36
  end
37
37
  attr_accessor :customer_status
38
38
 
39
- # If present, indicates the reason the alert was triggered.
39
+ # If present, indicates the reason the threshold notification was triggered.
40
40
  sig { returns(T.nilable(String)) }
41
41
  attr_accessor :triggered_by
42
42
 
@@ -52,10 +52,10 @@ module MetronomeSDK
52
52
  end
53
53
  def self.new(
54
54
  alert:,
55
- # The status of the customer alert. If the alert is archived, null will be
56
- # returned.
55
+ # The status of the threshold notification. If the notification is archived, null
56
+ # will be returned.
57
57
  customer_status:,
58
- # If present, indicates the reason the alert was triggered.
58
+ # If present, indicates the reason the threshold notification was triggered.
59
59
  triggered_by: nil
60
60
  )
61
61
  end
@@ -84,15 +84,15 @@ module MetronomeSDK
84
84
  )
85
85
  end
86
86
 
87
- # the Metronome ID of the alert
87
+ # the Metronome ID of the threshold notification
88
88
  sig { returns(String) }
89
89
  attr_accessor :id
90
90
 
91
- # Name of the alert
91
+ # Name of the threshold notification
92
92
  sig { returns(String) }
93
93
  attr_accessor :name
94
94
 
95
- # Status of the alert
95
+ # Status of the threshold notification
96
96
  sig do
97
97
  returns(
98
98
  MetronomeSDK::V1::Customers::CustomerAlert::Alert::Status::TaggedSymbol
@@ -100,11 +100,11 @@ module MetronomeSDK
100
100
  end
101
101
  attr_accessor :status
102
102
 
103
- # Threshold value of the alert policy
103
+ # Threshold value of the notification policy
104
104
  sig { returns(Float) }
105
105
  attr_accessor :threshold
106
106
 
107
- # Type of the alert
107
+ # Type of the threshold notification
108
108
  sig do
109
109
  returns(
110
110
  MetronomeSDK::V1::Customers::CustomerAlert::Alert::Type::TaggedSymbol
@@ -112,13 +112,14 @@ module MetronomeSDK
112
112
  end
113
113
  attr_accessor :type
114
114
 
115
- # Timestamp for when the alert was last updated
115
+ # Timestamp for when the threshold notification was last updated
116
116
  sig { returns(Time) }
117
117
  attr_accessor :updated_at
118
118
 
119
- # An array of strings, representing a way to filter the credit grant this alert
120
- # applies to, by looking at the credit_grant_type field on the credit grant. This
121
- # field is only defined for CreditPercentage and CreditBalance alerts
119
+ # An array of strings, representing a way to filter the credit grant this
120
+ # threshold notification applies to, by looking at the credit_grant_type field on
121
+ # the credit grant. This field is only defined for CreditPercentage and
122
+ # CreditBalance notifications
122
123
  sig { returns(T.nilable(T::Array[String])) }
123
124
  attr_reader :credit_grant_type_filters
124
125
 
@@ -135,7 +136,8 @@ module MetronomeSDK
135
136
  end
136
137
  attr_writer :credit_type
137
138
 
138
- # A list of custom field filters for alert types that support advanced filtering
139
+ # A list of custom field filters for notification types that support advanced
140
+ # filtering
139
141
  sig do
140
142
  returns(
141
143
  T.nilable(
@@ -157,8 +159,8 @@ module MetronomeSDK
157
159
  end
158
160
  attr_writer :custom_field_filters
159
161
 
160
- # Scopes alert evaluation to a specific presentation group key on individual line
161
- # items. Only present for spend alerts.
162
+ # Scopes threshold notification evaluation to a specific presentation group key on
163
+ # individual line items. Only present for spend notifications.
162
164
  sig do
163
165
  returns(
164
166
  T.nilable(
@@ -176,8 +178,8 @@ module MetronomeSDK
176
178
  end
177
179
  attr_writer :group_key_filter
178
180
 
179
- # Only present for `spend_threshold_reached` alerts. Scope alert to a specific
180
- # group key on individual line items.
181
+ # Only present for `spend_threshold_reached` notifications. Scope notification to
182
+ # a specific group key on individual line items.
181
183
  sig do
182
184
  returns(
183
185
  T.nilable(
@@ -199,8 +201,8 @@ module MetronomeSDK
199
201
  end
200
202
  attr_writer :group_values
201
203
 
202
- # Only supported for invoice_total_reached alerts. A list of invoice types to
203
- # evaluate.
204
+ # Only supported for invoice_total_reached threshold notifications. A list of
205
+ # invoice types to evaluate.
204
206
  sig { returns(T.nilable(T::Array[String])) }
205
207
  attr_reader :invoice_types_filter
206
208
 
@@ -243,33 +245,35 @@ module MetronomeSDK
243
245
  ).returns(T.attached_class)
244
246
  end
245
247
  def self.new(
246
- # the Metronome ID of the alert
248
+ # the Metronome ID of the threshold notification
247
249
  id:,
248
- # Name of the alert
250
+ # Name of the threshold notification
249
251
  name:,
250
- # Status of the alert
252
+ # Status of the threshold notification
251
253
  status:,
252
- # Threshold value of the alert policy
254
+ # Threshold value of the notification policy
253
255
  threshold:,
254
- # Type of the alert
256
+ # Type of the threshold notification
255
257
  type:,
256
- # Timestamp for when the alert was last updated
258
+ # Timestamp for when the threshold notification was last updated
257
259
  updated_at:,
258
- # An array of strings, representing a way to filter the credit grant this alert
259
- # applies to, by looking at the credit_grant_type field on the credit grant. This
260
- # field is only defined for CreditPercentage and CreditBalance alerts
260
+ # An array of strings, representing a way to filter the credit grant this
261
+ # threshold notification applies to, by looking at the credit_grant_type field on
262
+ # the credit grant. This field is only defined for CreditPercentage and
263
+ # CreditBalance notifications
261
264
  credit_grant_type_filters: nil,
262
265
  credit_type: nil,
263
- # A list of custom field filters for alert types that support advanced filtering
266
+ # A list of custom field filters for notification types that support advanced
267
+ # filtering
264
268
  custom_field_filters: nil,
265
- # Scopes alert evaluation to a specific presentation group key on individual line
266
- # items. Only present for spend alerts.
269
+ # Scopes threshold notification evaluation to a specific presentation group key on
270
+ # individual line items. Only present for spend notifications.
267
271
  group_key_filter: nil,
268
- # Only present for `spend_threshold_reached` alerts. Scope alert to a specific
269
- # group key on individual line items.
272
+ # Only present for `spend_threshold_reached` notifications. Scope notification to
273
+ # a specific group key on individual line items.
270
274
  group_values: nil,
271
- # Only supported for invoice_total_reached alerts. A list of invoice types to
272
- # evaluate.
275
+ # Only supported for invoice_total_reached threshold notifications. A list of
276
+ # invoice types to evaluate.
273
277
  invoice_types_filter: nil,
274
278
  # Prevents the creation of duplicates. If a request to create a record is made
275
279
  # with a previously used uniqueness key, a new record will not be created and the
@@ -309,7 +313,7 @@ module MetronomeSDK
309
313
  def to_hash
310
314
  end
311
315
 
312
- # Status of the alert
316
+ # Status of the threshold notification
313
317
  module Status
314
318
  extend MetronomeSDK::Internal::Type::Enum
315
319
 
@@ -349,7 +353,7 @@ module MetronomeSDK
349
353
  end
350
354
  end
351
355
 
352
- # Type of the alert
356
+ # Type of the threshold notification
353
357
  module Type
354
358
  extend MetronomeSDK::Internal::Type::Enum
355
359
 
@@ -545,8 +549,8 @@ module MetronomeSDK
545
549
  sig { returns(String) }
546
550
  attr_accessor :value
547
551
 
548
- # Scopes alert evaluation to a specific presentation group key on individual line
549
- # items. Only present for spend alerts.
552
+ # Scopes threshold notification evaluation to a specific presentation group key on
553
+ # individual line items. Only present for spend notifications.
550
554
  sig do
551
555
  params(key: String, value: String).returns(T.attached_class)
552
556
  end
@@ -588,8 +592,8 @@ module MetronomeSDK
588
592
  end
589
593
  end
590
594
 
591
- # The status of the customer alert. If the alert is archived, null will be
592
- # returned.
595
+ # The status of the threshold notification. If the notification is archived, null
596
+ # will be returned.
593
597
  module CustomerStatus
594
598
  extend MetronomeSDK::Internal::Type::Enum
595
599