svix 1.56.0 → 1.58.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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +115 -10
  4. data/lib/svix/api/authentication_api.rb +101 -16
  5. data/lib/svix/api/background_tasks_api.rb +43 -17
  6. data/lib/svix/api/endpoint_api.rb +312 -96
  7. data/lib/svix/api/inbound_api.rb +4 -4
  8. data/lib/svix/api/integration_api.rb +102 -24
  9. data/lib/svix/api/message_api.rb +142 -39
  10. data/lib/svix/api/message_attempt_api.rb +135 -372
  11. data/lib/svix/api/statistics_api.rb +6 -6
  12. data/lib/svix/api/stream_api.rb +203 -142
  13. data/lib/svix/api/transformation_template_api.rb +88 -23
  14. data/lib/svix/api/webhook_endpoint_api.rb +253 -77
  15. data/lib/svix/background_tasks_api.rb +2 -2
  16. data/lib/svix/message_attempt_api.rb +7 -3
  17. data/lib/svix/models/active_application_out.rb +373 -0
  18. data/lib/svix/models/active_endpoint_out.rb +355 -0
  19. data/lib/svix/models/aggregate_event_types_out.rb +40 -0
  20. data/lib/svix/models/aggregated_event_types.rb +305 -0
  21. data/lib/svix/models/app_portal_access_in.rb +18 -0
  22. data/lib/svix/models/app_usage_stats_out.rb +40 -0
  23. data/lib/svix/models/application_message_failure.rb +277 -0
  24. data/lib/svix/models/application_message_id_pair.rb +317 -0
  25. data/lib/svix/models/application_out.rb +41 -2
  26. data/lib/svix/models/application_patch.rb +1 -1
  27. data/lib/svix/models/application_stats.rb +41 -2
  28. data/lib/svix/models/application_stats_out.rb +324 -0
  29. data/lib/svix/models/auth_token_out.rb +40 -1
  30. data/lib/svix/models/background_task_finished_event.rb +272 -0
  31. data/lib/svix/models/background_task_finished_event2.rb +331 -0
  32. data/lib/svix/models/background_task_out.rb +40 -0
  33. data/lib/svix/models/background_task_type.rb +2 -1
  34. data/lib/svix/models/{template_in.rb → connector_in.rb} +4 -4
  35. data/lib/svix/models/{transformation_template_kind.rb → connector_kind.rb} +3 -3
  36. data/lib/svix/models/create_stream_in.rb +12 -12
  37. data/lib/svix/models/data.rb +108 -0
  38. data/lib/svix/models/data_any_of.rb +240 -0
  39. data/lib/svix/models/data_any_of1.rb +223 -0
  40. data/lib/svix/models/data_any_of2.rb +241 -0
  41. data/lib/svix/models/data_any_of3.rb +223 -0
  42. data/lib/svix/models/data_any_of4.rb +240 -0
  43. data/lib/svix/models/endpoint_created_event_data.rb +82 -4
  44. data/lib/svix/models/endpoint_deleted_event_data.rb +82 -4
  45. data/lib/svix/models/endpoint_disabled_event.rb +1 -1
  46. data/lib/svix/models/endpoint_disabled_event_data.rb +119 -16
  47. data/lib/svix/models/endpoint_disabled_trigger.rb +40 -0
  48. data/lib/svix/models/endpoint_enabled_event.rb +272 -0
  49. data/lib/svix/models/endpoint_enabled_event_data.rb +410 -0
  50. data/lib/svix/models/endpoint_message_out.rb +40 -1
  51. data/lib/svix/models/endpoint_mtls_config_out.rb +215 -0
  52. data/lib/svix/models/endpoint_oauth_config_in.rb +2 -2
  53. data/lib/svix/models/endpoint_oauth_config_out.rb +315 -0
  54. data/lib/svix/models/endpoint_out.rb +40 -1
  55. data/lib/svix/models/endpoint_patch.rb +1 -1
  56. data/lib/svix/models/endpoint_updated_event_data.rb +82 -4
  57. data/lib/svix/models/environment_in.rb +17 -19
  58. data/lib/svix/models/environment_settings_out.rb +23 -1
  59. data/lib/svix/models/event_type_import_open_api_in.rb +14 -2
  60. data/lib/svix/models/export_event_type_out.rb +40 -0
  61. data/lib/svix/models/expung_all_contents_out.rb +315 -0
  62. data/lib/svix/models/inbound_path_params.rb +1 -1
  63. data/lib/svix/models/integration_in.rb +41 -1
  64. data/lib/svix/models/integration_out.rb +81 -2
  65. data/lib/svix/models/integration_update.rb +41 -1
  66. data/lib/svix/models/list_response_active_application_out.rb +261 -0
  67. data/lib/svix/models/message_attempt_endpoint_out.rb +120 -3
  68. data/lib/svix/models/message_attempt_exhausted_event_data.rb +122 -5
  69. data/lib/svix/models/message_attempt_failed_data.rb +40 -1
  70. data/lib/svix/models/message_attempt_failing_event_data.rb +122 -5
  71. data/lib/svix/models/message_attempt_out.rb +120 -3
  72. data/lib/svix/models/message_attempt_recovered_event_data.rb +122 -5
  73. data/lib/svix/models/message_broadcast_out.rb +40 -0
  74. data/lib/svix/models/message_endpoint_out.rb +40 -1
  75. data/lib/svix/models/message_out.rb +40 -1
  76. data/lib/svix/models/message_precheck_in.rb +288 -0
  77. data/lib/svix/models/message_precheck_out.rb +221 -0
  78. data/lib/svix/models/{oauth2_auth_method_in.rb → oauth2_auth_method_in_out.rb} +3 -3
  79. data/lib/svix/models/{oauth2_grant_type_in.rb → oauth2_grant_type_in_out.rb} +3 -3
  80. data/lib/svix/models/operational_webhook_endpoint_headers_in.rb +223 -0
  81. data/lib/svix/models/operational_webhook_endpoint_headers_out.rb +251 -0
  82. data/lib/svix/models/operational_webhook_endpoint_out.rb +40 -1
  83. data/lib/svix/models/polling_endpoint_message_out.rb +454 -0
  84. data/lib/svix/models/polling_endpoint_out.rb +255 -0
  85. data/lib/svix/models/recover_out.rb +40 -0
  86. data/lib/svix/models/replay_out.rb +40 -0
  87. data/lib/svix/models/rotate_poller_token_in.rb +1 -1
  88. data/lib/svix/models/sink_secret_out.rb +233 -0
  89. data/lib/svix/models/stream_in.rb +6 -7
  90. data/lib/svix/models/stream_out.rb +46 -7
  91. data/lib/svix/models/stream_patch.rb +6 -7
  92. data/lib/svix/models/stream_portal_access_in.rb +293 -0
  93. data/lib/svix/models/template_out.rb +81 -1
  94. data/lib/svix/models/template_patch.rb +1 -1
  95. data/lib/svix/models/template_update.rb +1 -1
  96. data/lib/svix/version.rb +1 -1
  97. metadata +35 -7
  98. data/lib/svix/operational_webhook_endpoint_api.rb +0 -37
@@ -16,21 +16,21 @@ require 'time'
16
16
  module Svix
17
17
  # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event.
18
18
  class MessageAttemptExhaustedEventData
19
- # The app's ID
19
+ # The Application's ID.
20
20
  attr_accessor :app_id
21
21
 
22
- # The app's UID
22
+ # The Application's UID.
23
23
  attr_accessor :app_uid
24
24
 
25
- # The ep's ID
25
+ # The Endpoint's ID.
26
26
  attr_accessor :endpoint_id
27
27
 
28
28
  attr_accessor :last_attempt
29
29
 
30
- # The msg's UID
30
+ # The Message's UID.
31
31
  attr_accessor :msg_event_id
32
32
 
33
- # The msg's ID
33
+ # The Message's ID.
34
34
  attr_accessor :msg_id
35
35
 
36
36
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -127,6 +127,19 @@ module Svix
127
127
  invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
128
128
  end
129
129
 
130
+ if @app_id.to_s.length > 31
131
+ invalid_properties.push('invalid value for "app_id", the character length must be smaller than or equal to 31.')
132
+ end
133
+
134
+ if @app_id.to_s.length < 31
135
+ invalid_properties.push('invalid value for "app_id", the character length must be great than or equal to 31.')
136
+ end
137
+
138
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
139
+ if @app_id !~ pattern
140
+ invalid_properties.push("invalid value for \"app_id\", must conform to the pattern #{pattern}.")
141
+ end
142
+
130
143
  if !@app_uid.nil? && @app_uid.to_s.length > 256
131
144
  invalid_properties.push('invalid value for "app_uid", the character length must be smaller than or equal to 256.')
132
145
  end
@@ -144,6 +157,19 @@ module Svix
144
157
  invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
145
158
  end
146
159
 
160
+ if @endpoint_id.to_s.length > 30
161
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be smaller than or equal to 30.')
162
+ end
163
+
164
+ if @endpoint_id.to_s.length < 30
165
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be great than or equal to 30.')
166
+ end
167
+
168
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
169
+ if @endpoint_id !~ pattern
170
+ invalid_properties.push("invalid value for \"endpoint_id\", must conform to the pattern #{pattern}.")
171
+ end
172
+
147
173
  if @last_attempt.nil?
148
174
  invalid_properties.push('invalid value for "last_attempt", last_attempt cannot be nil.')
149
175
  end
@@ -165,6 +191,19 @@ module Svix
165
191
  invalid_properties.push('invalid value for "msg_id", msg_id cannot be nil.')
166
192
  end
167
193
 
194
+ if @msg_id.to_s.length > 31
195
+ invalid_properties.push('invalid value for "msg_id", the character length must be smaller than or equal to 31.')
196
+ end
197
+
198
+ if @msg_id.to_s.length < 31
199
+ invalid_properties.push('invalid value for "msg_id", the character length must be great than or equal to 31.')
200
+ end
201
+
202
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
203
+ if @msg_id !~ pattern
204
+ invalid_properties.push("invalid value for \"msg_id\", must conform to the pattern #{pattern}.")
205
+ end
206
+
168
207
  invalid_properties
169
208
  end
170
209
 
@@ -173,18 +212,50 @@ module Svix
173
212
  def valid?
174
213
  warn '[DEPRECATED] the `valid?` method is obsolete'
175
214
  return false if @app_id.nil?
215
+ return false if @app_id.to_s.length > 31
216
+ return false if @app_id.to_s.length < 31
217
+ return false if @app_id !~ Regexp.new(/^app_[A-Za-z0-9]{27}$/)
176
218
  return false if !@app_uid.nil? && @app_uid.to_s.length > 256
177
219
  return false if !@app_uid.nil? && @app_uid.to_s.length < 1
178
220
  return false if !@app_uid.nil? && @app_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
179
221
  return false if @endpoint_id.nil?
222
+ return false if @endpoint_id.to_s.length > 30
223
+ return false if @endpoint_id.to_s.length < 30
224
+ return false if @endpoint_id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
180
225
  return false if @last_attempt.nil?
181
226
  return false if !@msg_event_id.nil? && @msg_event_id.to_s.length > 256
182
227
  return false if !@msg_event_id.nil? && @msg_event_id.to_s.length < 1
183
228
  return false if !@msg_event_id.nil? && @msg_event_id !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
184
229
  return false if @msg_id.nil?
230
+ return false if @msg_id.to_s.length > 31
231
+ return false if @msg_id.to_s.length < 31
232
+ return false if @msg_id !~ Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
185
233
  true
186
234
  end
187
235
 
236
+ # Custom attribute writer method with validation
237
+ # @param [Object] app_id Value to be assigned
238
+ def app_id=(app_id)
239
+ if app_id.nil?
240
+ fail ArgumentError, 'app_id cannot be nil'
241
+ end
242
+
243
+ if app_id.to_s.length > 31
244
+ fail ArgumentError, 'invalid value for "app_id", the character length must be smaller than or equal to 31.'
245
+ end
246
+
247
+ if app_id.to_s.length < 31
248
+ fail ArgumentError, 'invalid value for "app_id", the character length must be great than or equal to 31.'
249
+ end
250
+
251
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
252
+ if app_id !~ pattern
253
+ fail ArgumentError, "invalid value for \"app_id\", must conform to the pattern #{pattern}."
254
+ end
255
+
256
+ @app_id = app_id
257
+ end
258
+
188
259
  # Custom attribute writer method with validation
189
260
  # @param [Object] app_uid Value to be assigned
190
261
  def app_uid=(app_uid)
@@ -204,6 +275,29 @@ module Svix
204
275
  @app_uid = app_uid
205
276
  end
206
277
 
278
+ # Custom attribute writer method with validation
279
+ # @param [Object] endpoint_id Value to be assigned
280
+ def endpoint_id=(endpoint_id)
281
+ if endpoint_id.nil?
282
+ fail ArgumentError, 'endpoint_id cannot be nil'
283
+ end
284
+
285
+ if endpoint_id.to_s.length > 30
286
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be smaller than or equal to 30.'
287
+ end
288
+
289
+ if endpoint_id.to_s.length < 30
290
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be great than or equal to 30.'
291
+ end
292
+
293
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
294
+ if endpoint_id !~ pattern
295
+ fail ArgumentError, "invalid value for \"endpoint_id\", must conform to the pattern #{pattern}."
296
+ end
297
+
298
+ @endpoint_id = endpoint_id
299
+ end
300
+
207
301
  # Custom attribute writer method with validation
208
302
  # @param [Object] msg_event_id Value to be assigned
209
303
  def msg_event_id=(msg_event_id)
@@ -223,6 +317,29 @@ module Svix
223
317
  @msg_event_id = msg_event_id
224
318
  end
225
319
 
320
+ # Custom attribute writer method with validation
321
+ # @param [Object] msg_id Value to be assigned
322
+ def msg_id=(msg_id)
323
+ if msg_id.nil?
324
+ fail ArgumentError, 'msg_id cannot be nil'
325
+ end
326
+
327
+ if msg_id.to_s.length > 31
328
+ fail ArgumentError, 'invalid value for "msg_id", the character length must be smaller than or equal to 31.'
329
+ end
330
+
331
+ if msg_id.to_s.length < 31
332
+ fail ArgumentError, 'invalid value for "msg_id", the character length must be great than or equal to 31.'
333
+ end
334
+
335
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
336
+ if msg_id !~ pattern
337
+ fail ArgumentError, "invalid value for \"msg_id\", must conform to the pattern #{pattern}."
338
+ end
339
+
340
+ @msg_id = msg_id
341
+ end
342
+
226
343
  # Checks equality by comparing each attribute.
227
344
  # @param [Object] Object to be compared
228
345
  def ==(o)
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class MessageAttemptFailedData
18
- # The attempt's ID
18
+ # The MessageAttempt's ID.
19
19
  attr_accessor :id
20
20
 
21
21
  attr_accessor :response_status_code
@@ -94,6 +94,19 @@ module Svix
94
94
  invalid_properties.push('invalid value for "id", id cannot be nil.')
95
95
  end
96
96
 
97
+ if @id.to_s.length > 33
98
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
99
+ end
100
+
101
+ if @id.to_s.length < 33
102
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
103
+ end
104
+
105
+ pattern = Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
106
+ if @id !~ pattern
107
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
108
+ end
109
+
97
110
  if @response_status_code.nil?
98
111
  invalid_properties.push('invalid value for "response_status_code", response_status_code cannot be nil.')
99
112
  end
@@ -110,11 +123,37 @@ module Svix
110
123
  def valid?
111
124
  warn '[DEPRECATED] the `valid?` method is obsolete'
112
125
  return false if @id.nil?
126
+ return false if @id.to_s.length > 33
127
+ return false if @id.to_s.length < 33
128
+ return false if @id !~ Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
113
129
  return false if @response_status_code.nil?
114
130
  return false if @timestamp.nil?
115
131
  true
116
132
  end
117
133
 
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] id Value to be assigned
136
+ def id=(id)
137
+ if id.nil?
138
+ fail ArgumentError, 'id cannot be nil'
139
+ end
140
+
141
+ if id.to_s.length > 33
142
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
143
+ end
144
+
145
+ if id.to_s.length < 33
146
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
147
+ end
148
+
149
+ pattern = Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
150
+ if id !~ pattern
151
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
152
+ end
153
+
154
+ @id = id
155
+ end
156
+
118
157
  # Checks equality by comparing each attribute.
119
158
  # @param [Object] Object to be compared
120
159
  def ==(o)
@@ -16,21 +16,21 @@ require 'time'
16
16
  module Svix
17
17
  # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event.
18
18
  class MessageAttemptFailingEventData
19
- # The app's ID
19
+ # The Application's ID.
20
20
  attr_accessor :app_id
21
21
 
22
- # The app's UID
22
+ # The Application's UID.
23
23
  attr_accessor :app_uid
24
24
 
25
- # The ep's ID
25
+ # The Endpoint's ID.
26
26
  attr_accessor :endpoint_id
27
27
 
28
28
  attr_accessor :last_attempt
29
29
 
30
- # The msg's UID
30
+ # The Message's UID.
31
31
  attr_accessor :msg_event_id
32
32
 
33
- # The msg's ID
33
+ # The Message's ID.
34
34
  attr_accessor :msg_id
35
35
 
36
36
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -127,6 +127,19 @@ module Svix
127
127
  invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
128
128
  end
129
129
 
130
+ if @app_id.to_s.length > 31
131
+ invalid_properties.push('invalid value for "app_id", the character length must be smaller than or equal to 31.')
132
+ end
133
+
134
+ if @app_id.to_s.length < 31
135
+ invalid_properties.push('invalid value for "app_id", the character length must be great than or equal to 31.')
136
+ end
137
+
138
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
139
+ if @app_id !~ pattern
140
+ invalid_properties.push("invalid value for \"app_id\", must conform to the pattern #{pattern}.")
141
+ end
142
+
130
143
  if !@app_uid.nil? && @app_uid.to_s.length > 256
131
144
  invalid_properties.push('invalid value for "app_uid", the character length must be smaller than or equal to 256.')
132
145
  end
@@ -144,6 +157,19 @@ module Svix
144
157
  invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
145
158
  end
146
159
 
160
+ if @endpoint_id.to_s.length > 30
161
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be smaller than or equal to 30.')
162
+ end
163
+
164
+ if @endpoint_id.to_s.length < 30
165
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be great than or equal to 30.')
166
+ end
167
+
168
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
169
+ if @endpoint_id !~ pattern
170
+ invalid_properties.push("invalid value for \"endpoint_id\", must conform to the pattern #{pattern}.")
171
+ end
172
+
147
173
  if @last_attempt.nil?
148
174
  invalid_properties.push('invalid value for "last_attempt", last_attempt cannot be nil.')
149
175
  end
@@ -165,6 +191,19 @@ module Svix
165
191
  invalid_properties.push('invalid value for "msg_id", msg_id cannot be nil.')
166
192
  end
167
193
 
194
+ if @msg_id.to_s.length > 31
195
+ invalid_properties.push('invalid value for "msg_id", the character length must be smaller than or equal to 31.')
196
+ end
197
+
198
+ if @msg_id.to_s.length < 31
199
+ invalid_properties.push('invalid value for "msg_id", the character length must be great than or equal to 31.')
200
+ end
201
+
202
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
203
+ if @msg_id !~ pattern
204
+ invalid_properties.push("invalid value for \"msg_id\", must conform to the pattern #{pattern}.")
205
+ end
206
+
168
207
  invalid_properties
169
208
  end
170
209
 
@@ -173,18 +212,50 @@ module Svix
173
212
  def valid?
174
213
  warn '[DEPRECATED] the `valid?` method is obsolete'
175
214
  return false if @app_id.nil?
215
+ return false if @app_id.to_s.length > 31
216
+ return false if @app_id.to_s.length < 31
217
+ return false if @app_id !~ Regexp.new(/^app_[A-Za-z0-9]{27}$/)
176
218
  return false if !@app_uid.nil? && @app_uid.to_s.length > 256
177
219
  return false if !@app_uid.nil? && @app_uid.to_s.length < 1
178
220
  return false if !@app_uid.nil? && @app_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
179
221
  return false if @endpoint_id.nil?
222
+ return false if @endpoint_id.to_s.length > 30
223
+ return false if @endpoint_id.to_s.length < 30
224
+ return false if @endpoint_id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
180
225
  return false if @last_attempt.nil?
181
226
  return false if !@msg_event_id.nil? && @msg_event_id.to_s.length > 256
182
227
  return false if !@msg_event_id.nil? && @msg_event_id.to_s.length < 1
183
228
  return false if !@msg_event_id.nil? && @msg_event_id !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
184
229
  return false if @msg_id.nil?
230
+ return false if @msg_id.to_s.length > 31
231
+ return false if @msg_id.to_s.length < 31
232
+ return false if @msg_id !~ Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
185
233
  true
186
234
  end
187
235
 
236
+ # Custom attribute writer method with validation
237
+ # @param [Object] app_id Value to be assigned
238
+ def app_id=(app_id)
239
+ if app_id.nil?
240
+ fail ArgumentError, 'app_id cannot be nil'
241
+ end
242
+
243
+ if app_id.to_s.length > 31
244
+ fail ArgumentError, 'invalid value for "app_id", the character length must be smaller than or equal to 31.'
245
+ end
246
+
247
+ if app_id.to_s.length < 31
248
+ fail ArgumentError, 'invalid value for "app_id", the character length must be great than or equal to 31.'
249
+ end
250
+
251
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
252
+ if app_id !~ pattern
253
+ fail ArgumentError, "invalid value for \"app_id\", must conform to the pattern #{pattern}."
254
+ end
255
+
256
+ @app_id = app_id
257
+ end
258
+
188
259
  # Custom attribute writer method with validation
189
260
  # @param [Object] app_uid Value to be assigned
190
261
  def app_uid=(app_uid)
@@ -204,6 +275,29 @@ module Svix
204
275
  @app_uid = app_uid
205
276
  end
206
277
 
278
+ # Custom attribute writer method with validation
279
+ # @param [Object] endpoint_id Value to be assigned
280
+ def endpoint_id=(endpoint_id)
281
+ if endpoint_id.nil?
282
+ fail ArgumentError, 'endpoint_id cannot be nil'
283
+ end
284
+
285
+ if endpoint_id.to_s.length > 30
286
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be smaller than or equal to 30.'
287
+ end
288
+
289
+ if endpoint_id.to_s.length < 30
290
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be great than or equal to 30.'
291
+ end
292
+
293
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
294
+ if endpoint_id !~ pattern
295
+ fail ArgumentError, "invalid value for \"endpoint_id\", must conform to the pattern #{pattern}."
296
+ end
297
+
298
+ @endpoint_id = endpoint_id
299
+ end
300
+
207
301
  # Custom attribute writer method with validation
208
302
  # @param [Object] msg_event_id Value to be assigned
209
303
  def msg_event_id=(msg_event_id)
@@ -223,6 +317,29 @@ module Svix
223
317
  @msg_event_id = msg_event_id
224
318
  end
225
319
 
320
+ # Custom attribute writer method with validation
321
+ # @param [Object] msg_id Value to be assigned
322
+ def msg_id=(msg_id)
323
+ if msg_id.nil?
324
+ fail ArgumentError, 'msg_id cannot be nil'
325
+ end
326
+
327
+ if msg_id.to_s.length > 31
328
+ fail ArgumentError, 'invalid value for "msg_id", the character length must be smaller than or equal to 31.'
329
+ end
330
+
331
+ if msg_id.to_s.length < 31
332
+ fail ArgumentError, 'invalid value for "msg_id", the character length must be great than or equal to 31.'
333
+ end
334
+
335
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
336
+ if msg_id !~ pattern
337
+ fail ArgumentError, "invalid value for \"msg_id\", must conform to the pattern #{pattern}."
338
+ end
339
+
340
+ @msg_id = msg_id
341
+ end
342
+
226
343
  # Checks equality by comparing each attribute.
227
344
  # @param [Object] Object to be compared
228
345
  def ==(o)
@@ -15,15 +15,15 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class MessageAttemptOut
18
- # The ep's ID
18
+ # The Endpoint's ID.
19
19
  attr_accessor :endpoint_id
20
20
 
21
- # The attempt's ID
21
+ # The MessageAttempt's ID.
22
22
  attr_accessor :id
23
23
 
24
24
  attr_accessor :msg
25
25
 
26
- # The msg's ID
26
+ # The Message's ID.
27
27
  attr_accessor :msg_id
28
28
 
29
29
  attr_accessor :response
@@ -197,14 +197,53 @@ module Svix
197
197
  invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
198
198
  end
199
199
 
200
+ if @endpoint_id.to_s.length > 30
201
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be smaller than or equal to 30.')
202
+ end
203
+
204
+ if @endpoint_id.to_s.length < 30
205
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be great than or equal to 30.')
206
+ end
207
+
208
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
209
+ if @endpoint_id !~ pattern
210
+ invalid_properties.push("invalid value for \"endpoint_id\", must conform to the pattern #{pattern}.")
211
+ end
212
+
200
213
  if @id.nil?
201
214
  invalid_properties.push('invalid value for "id", id cannot be nil.')
202
215
  end
203
216
 
217
+ if @id.to_s.length > 33
218
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
219
+ end
220
+
221
+ if @id.to_s.length < 33
222
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
223
+ end
224
+
225
+ pattern = Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
226
+ if @id !~ pattern
227
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
228
+ end
229
+
204
230
  if @msg_id.nil?
205
231
  invalid_properties.push('invalid value for "msg_id", msg_id cannot be nil.')
206
232
  end
207
233
 
234
+ if @msg_id.to_s.length > 31
235
+ invalid_properties.push('invalid value for "msg_id", the character length must be smaller than or equal to 31.')
236
+ end
237
+
238
+ if @msg_id.to_s.length < 31
239
+ invalid_properties.push('invalid value for "msg_id", the character length must be great than or equal to 31.')
240
+ end
241
+
242
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
243
+ if @msg_id !~ pattern
244
+ invalid_properties.push("invalid value for \"msg_id\", must conform to the pattern #{pattern}.")
245
+ end
246
+
208
247
  if @response.nil?
209
248
  invalid_properties.push('invalid value for "response", response cannot be nil.')
210
249
  end
@@ -249,8 +288,17 @@ module Svix
249
288
  def valid?
250
289
  warn '[DEPRECATED] the `valid?` method is obsolete'
251
290
  return false if @endpoint_id.nil?
291
+ return false if @endpoint_id.to_s.length > 30
292
+ return false if @endpoint_id.to_s.length < 30
293
+ return false if @endpoint_id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
252
294
  return false if @id.nil?
295
+ return false if @id.to_s.length > 33
296
+ return false if @id.to_s.length < 33
297
+ return false if @id !~ Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
253
298
  return false if @msg_id.nil?
299
+ return false if @msg_id.to_s.length > 31
300
+ return false if @msg_id.to_s.length < 31
301
+ return false if @msg_id !~ Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
254
302
  return false if @response.nil?
255
303
  return false if @response_duration_ms.nil?
256
304
  return false if @response_status_code.nil?
@@ -263,6 +311,75 @@ module Svix
263
311
  true
264
312
  end
265
313
 
314
+ # Custom attribute writer method with validation
315
+ # @param [Object] endpoint_id Value to be assigned
316
+ def endpoint_id=(endpoint_id)
317
+ if endpoint_id.nil?
318
+ fail ArgumentError, 'endpoint_id cannot be nil'
319
+ end
320
+
321
+ if endpoint_id.to_s.length > 30
322
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be smaller than or equal to 30.'
323
+ end
324
+
325
+ if endpoint_id.to_s.length < 30
326
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be great than or equal to 30.'
327
+ end
328
+
329
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
330
+ if endpoint_id !~ pattern
331
+ fail ArgumentError, "invalid value for \"endpoint_id\", must conform to the pattern #{pattern}."
332
+ end
333
+
334
+ @endpoint_id = endpoint_id
335
+ end
336
+
337
+ # Custom attribute writer method with validation
338
+ # @param [Object] id Value to be assigned
339
+ def id=(id)
340
+ if id.nil?
341
+ fail ArgumentError, 'id cannot be nil'
342
+ end
343
+
344
+ if id.to_s.length > 33
345
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
346
+ end
347
+
348
+ if id.to_s.length < 33
349
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
350
+ end
351
+
352
+ pattern = Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
353
+ if id !~ pattern
354
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
355
+ end
356
+
357
+ @id = id
358
+ end
359
+
360
+ # Custom attribute writer method with validation
361
+ # @param [Object] msg_id Value to be assigned
362
+ def msg_id=(msg_id)
363
+ if msg_id.nil?
364
+ fail ArgumentError, 'msg_id cannot be nil'
365
+ end
366
+
367
+ if msg_id.to_s.length > 31
368
+ fail ArgumentError, 'invalid value for "msg_id", the character length must be smaller than or equal to 31.'
369
+ end
370
+
371
+ if msg_id.to_s.length < 31
372
+ fail ArgumentError, 'invalid value for "msg_id", the character length must be great than or equal to 31.'
373
+ end
374
+
375
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
376
+ if msg_id !~ pattern
377
+ fail ArgumentError, "invalid value for \"msg_id\", must conform to the pattern #{pattern}."
378
+ end
379
+
380
+ @msg_id = msg_id
381
+ end
382
+
266
383
  # Custom attribute writer method with validation
267
384
  # @param [Object] url Value to be assigned
268
385
  def url=(url)