svix 1.56.0 → 1.57.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
@@ -0,0 +1,410 @@
1
+ =begin
2
+ #Svix API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Svix
17
+ # Sent when an endpoint has been enabled.
18
+ class EndpointEnabledEventData
19
+ # The Application's ID.
20
+ attr_accessor :app_id
21
+
22
+ # The Application's UID.
23
+ attr_accessor :app_uid
24
+
25
+ # The Endpoint's ID.
26
+ attr_accessor :endpoint_id
27
+
28
+ # The Endpoint's UID.
29
+ attr_accessor :endpoint_uid
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'app_id' => :'appId',
35
+ :'app_uid' => :'appUid',
36
+ :'endpoint_id' => :'endpointId',
37
+ :'endpoint_uid' => :'endpointUid'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'app_id' => :'String',
50
+ :'app_uid' => :'String',
51
+ :'endpoint_id' => :'String',
52
+ :'endpoint_uid' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'app_uid',
60
+ :'endpoint_uid'
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointEnabledEventData` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!self.class.attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointEnabledEventData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'app_id')
80
+ self.app_id = attributes[:'app_id']
81
+ else
82
+ self.app_id = nil
83
+ end
84
+
85
+ if attributes.key?(:'app_uid')
86
+ self.app_uid = attributes[:'app_uid']
87
+ end
88
+
89
+ if attributes.key?(:'endpoint_id')
90
+ self.endpoint_id = attributes[:'endpoint_id']
91
+ else
92
+ self.endpoint_id = nil
93
+ end
94
+
95
+ if attributes.key?(:'endpoint_uid')
96
+ self.endpoint_uid = attributes[:'endpoint_uid']
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
+ invalid_properties = Array.new
105
+ if @app_id.nil?
106
+ invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
107
+ end
108
+
109
+ if @app_id.to_s.length > 31
110
+ invalid_properties.push('invalid value for "app_id", the character length must be smaller than or equal to 31.')
111
+ end
112
+
113
+ if @app_id.to_s.length < 31
114
+ invalid_properties.push('invalid value for "app_id", the character length must be great than or equal to 31.')
115
+ end
116
+
117
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
118
+ if @app_id !~ pattern
119
+ invalid_properties.push("invalid value for \"app_id\", must conform to the pattern #{pattern}.")
120
+ end
121
+
122
+ if !@app_uid.nil? && @app_uid.to_s.length > 256
123
+ invalid_properties.push('invalid value for "app_uid", the character length must be smaller than or equal to 256.')
124
+ end
125
+
126
+ if !@app_uid.nil? && @app_uid.to_s.length < 1
127
+ invalid_properties.push('invalid value for "app_uid", the character length must be great than or equal to 1.')
128
+ end
129
+
130
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
131
+ if !@app_uid.nil? && @app_uid !~ pattern
132
+ invalid_properties.push("invalid value for \"app_uid\", must conform to the pattern #{pattern}.")
133
+ end
134
+
135
+ if @endpoint_id.nil?
136
+ invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
137
+ end
138
+
139
+ if @endpoint_id.to_s.length > 30
140
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be smaller than or equal to 30.')
141
+ end
142
+
143
+ if @endpoint_id.to_s.length < 30
144
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be great than or equal to 30.')
145
+ end
146
+
147
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
148
+ if @endpoint_id !~ pattern
149
+ invalid_properties.push("invalid value for \"endpoint_id\", must conform to the pattern #{pattern}.")
150
+ end
151
+
152
+ if !@endpoint_uid.nil? && @endpoint_uid.to_s.length > 256
153
+ invalid_properties.push('invalid value for "endpoint_uid", the character length must be smaller than or equal to 256.')
154
+ end
155
+
156
+ if !@endpoint_uid.nil? && @endpoint_uid.to_s.length < 1
157
+ invalid_properties.push('invalid value for "endpoint_uid", the character length must be great than or equal to 1.')
158
+ end
159
+
160
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
161
+ if !@endpoint_uid.nil? && @endpoint_uid !~ pattern
162
+ invalid_properties.push("invalid value for \"endpoint_uid\", must conform to the pattern #{pattern}.")
163
+ end
164
+
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ warn '[DEPRECATED] the `valid?` method is obsolete'
172
+ return false if @app_id.nil?
173
+ return false if @app_id.to_s.length > 31
174
+ return false if @app_id.to_s.length < 31
175
+ return false if @app_id !~ Regexp.new(/^app_[A-Za-z0-9]{27}$/)
176
+ return false if !@app_uid.nil? && @app_uid.to_s.length > 256
177
+ return false if !@app_uid.nil? && @app_uid.to_s.length < 1
178
+ return false if !@app_uid.nil? && @app_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
179
+ return false if @endpoint_id.nil?
180
+ return false if @endpoint_id.to_s.length > 30
181
+ return false if @endpoint_id.to_s.length < 30
182
+ return false if @endpoint_id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
183
+ return false if !@endpoint_uid.nil? && @endpoint_uid.to_s.length > 256
184
+ return false if !@endpoint_uid.nil? && @endpoint_uid.to_s.length < 1
185
+ return false if !@endpoint_uid.nil? && @endpoint_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
186
+ true
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] app_id Value to be assigned
191
+ def app_id=(app_id)
192
+ if app_id.nil?
193
+ fail ArgumentError, 'app_id cannot be nil'
194
+ end
195
+
196
+ if app_id.to_s.length > 31
197
+ fail ArgumentError, 'invalid value for "app_id", the character length must be smaller than or equal to 31.'
198
+ end
199
+
200
+ if app_id.to_s.length < 31
201
+ fail ArgumentError, 'invalid value for "app_id", the character length must be great than or equal to 31.'
202
+ end
203
+
204
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
205
+ if app_id !~ pattern
206
+ fail ArgumentError, "invalid value for \"app_id\", must conform to the pattern #{pattern}."
207
+ end
208
+
209
+ @app_id = app_id
210
+ end
211
+
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] app_uid Value to be assigned
214
+ def app_uid=(app_uid)
215
+ if !app_uid.nil? && app_uid.to_s.length > 256
216
+ fail ArgumentError, 'invalid value for "app_uid", the character length must be smaller than or equal to 256.'
217
+ end
218
+
219
+ if !app_uid.nil? && app_uid.to_s.length < 1
220
+ fail ArgumentError, 'invalid value for "app_uid", the character length must be great than or equal to 1.'
221
+ end
222
+
223
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
224
+ if !app_uid.nil? && app_uid !~ pattern
225
+ fail ArgumentError, "invalid value for \"app_uid\", must conform to the pattern #{pattern}."
226
+ end
227
+
228
+ @app_uid = app_uid
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] endpoint_id Value to be assigned
233
+ def endpoint_id=(endpoint_id)
234
+ if endpoint_id.nil?
235
+ fail ArgumentError, 'endpoint_id cannot be nil'
236
+ end
237
+
238
+ if endpoint_id.to_s.length > 30
239
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be smaller than or equal to 30.'
240
+ end
241
+
242
+ if endpoint_id.to_s.length < 30
243
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be great than or equal to 30.'
244
+ end
245
+
246
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
247
+ if endpoint_id !~ pattern
248
+ fail ArgumentError, "invalid value for \"endpoint_id\", must conform to the pattern #{pattern}."
249
+ end
250
+
251
+ @endpoint_id = endpoint_id
252
+ end
253
+
254
+ # Custom attribute writer method with validation
255
+ # @param [Object] endpoint_uid Value to be assigned
256
+ def endpoint_uid=(endpoint_uid)
257
+ if !endpoint_uid.nil? && endpoint_uid.to_s.length > 256
258
+ fail ArgumentError, 'invalid value for "endpoint_uid", the character length must be smaller than or equal to 256.'
259
+ end
260
+
261
+ if !endpoint_uid.nil? && endpoint_uid.to_s.length < 1
262
+ fail ArgumentError, 'invalid value for "endpoint_uid", the character length must be great than or equal to 1.'
263
+ end
264
+
265
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
266
+ if !endpoint_uid.nil? && endpoint_uid !~ pattern
267
+ fail ArgumentError, "invalid value for \"endpoint_uid\", must conform to the pattern #{pattern}."
268
+ end
269
+
270
+ @endpoint_uid = endpoint_uid
271
+ end
272
+
273
+ # Checks equality by comparing each attribute.
274
+ # @param [Object] Object to be compared
275
+ def ==(o)
276
+ return true if self.equal?(o)
277
+ self.class == o.class &&
278
+ app_id == o.app_id &&
279
+ app_uid == o.app_uid &&
280
+ endpoint_id == o.endpoint_id &&
281
+ endpoint_uid == o.endpoint_uid
282
+ end
283
+
284
+ # @see the `==` method
285
+ # @param [Object] Object to be compared
286
+ def eql?(o)
287
+ self == o
288
+ end
289
+
290
+ # Calculates hash code according to all attributes.
291
+ # @return [Integer] Hash code
292
+ def hash
293
+ [app_id, app_uid, endpoint_id, endpoint_uid].hash
294
+ end
295
+
296
+ # Builds the object from hash
297
+ # @param [Hash] attributes Model attributes in the form of hash
298
+ # @return [Object] Returns the model itself
299
+ def self.build_from_hash(attributes)
300
+ return nil unless attributes.is_a?(Hash)
301
+ attributes = attributes.transform_keys(&:to_sym)
302
+ transformed_hash = {}
303
+ openapi_types.each_pair do |key, type|
304
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
305
+ transformed_hash["#{key}"] = nil
306
+ elsif type =~ /\AArray<(.*)>/i
307
+ # check to ensure the input is an array given that the attribute
308
+ # is documented as an array but the input is not
309
+ if attributes[attribute_map[key]].is_a?(Array)
310
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
311
+ end
312
+ elsif !attributes[attribute_map[key]].nil?
313
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
314
+ end
315
+ end
316
+ new(transformed_hash)
317
+ end
318
+
319
+ # Deserializes the data based on type
320
+ # @param string type Data type
321
+ # @param string value Value to be deserialized
322
+ # @return [Object] Deserialized data
323
+ def self._deserialize(type, value)
324
+ case type.to_sym
325
+ when :Time
326
+ Time.parse(value)
327
+ when :Date
328
+ Date.parse(value)
329
+ when :String
330
+ value.to_s
331
+ when :Integer
332
+ value.to_i
333
+ when :Float
334
+ value.to_f
335
+ when :Boolean
336
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
337
+ true
338
+ else
339
+ false
340
+ end
341
+ when :Object
342
+ # generic object (usually a Hash), return directly
343
+ value
344
+ when /\AArray<(?<inner_type>.+)>\z/
345
+ inner_type = Regexp.last_match[:inner_type]
346
+ value.map { |v| _deserialize(inner_type, v) }
347
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
348
+ k_type = Regexp.last_match[:k_type]
349
+ v_type = Regexp.last_match[:v_type]
350
+ {}.tap do |hash|
351
+ value.each do |k, v|
352
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
353
+ end
354
+ end
355
+ else # model
356
+ # models (e.g. Pet) or oneOf
357
+ klass = Svix.const_get(type)
358
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
359
+ end
360
+ end
361
+
362
+ # Returns the string representation of the object
363
+ # @return [String] String presentation of the object
364
+ def to_s
365
+ to_hash.to_s
366
+ end
367
+
368
+ # to_body is an alias to to_hash (backward compatibility)
369
+ # @return [Hash] Returns the object in the form of hash
370
+ def to_body
371
+ to_hash
372
+ end
373
+
374
+ # Returns the object in the form of hash
375
+ # @return [Hash] Returns the object in the form of hash
376
+ def to_hash
377
+ hash = {}
378
+ self.class.attribute_map.each_pair do |attr, param|
379
+ value = self.send(attr)
380
+ if value.nil?
381
+ is_nullable = self.class.openapi_nullable.include?(attr)
382
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
383
+ end
384
+
385
+ hash[param] = _to_hash(value)
386
+ end
387
+ hash
388
+ end
389
+
390
+ # Outputs non-array value in the form of hash
391
+ # For object, use to_hash. Otherwise, just return the value
392
+ # @param [Object] value Any valid value
393
+ # @return [Hash] Returns the value in the form of hash
394
+ def _to_hash(value)
395
+ if value.is_a?(Array)
396
+ value.compact.map { |v| _to_hash(v) }
397
+ elsif value.is_a?(Hash)
398
+ {}.tap do |hash|
399
+ value.each { |k, v| hash[k] = _to_hash(v) }
400
+ end
401
+ elsif value.respond_to? :to_hash
402
+ value.to_hash
403
+ else
404
+ value
405
+ end
406
+ end
407
+
408
+ end
409
+
410
+ end
@@ -25,7 +25,7 @@ module Svix
25
25
  # The event type's name
26
26
  attr_accessor :event_type
27
27
 
28
- # The msg's ID
28
+ # The Message's ID.
29
29
  attr_accessor :id
30
30
 
31
31
  attr_accessor :next_attempt
@@ -214,6 +214,19 @@ module Svix
214
214
  invalid_properties.push('invalid value for "id", id cannot be nil.')
215
215
  end
216
216
 
217
+ if @id.to_s.length > 31
218
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 31.')
219
+ end
220
+
221
+ if @id.to_s.length < 31
222
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 31.')
223
+ end
224
+
225
+ pattern = Regexp.new(/^msg_[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
+
217
230
  if @payload.nil?
218
231
  invalid_properties.push('invalid value for "payload", payload cannot be nil.')
219
232
  end
@@ -242,6 +255,9 @@ module Svix
242
255
  return false if @event_type.to_s.length > 256
243
256
  return false if @event_type !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
244
257
  return false if @id.nil?
258
+ return false if @id.to_s.length > 31
259
+ return false if @id.to_s.length < 31
260
+ return false if @id !~ Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
245
261
  return false if @payload.nil?
246
262
  return false if @status.nil?
247
263
  return false if @timestamp.nil?
@@ -300,6 +316,29 @@ module Svix
300
316
  @event_type = event_type
301
317
  end
302
318
 
319
+ # Custom attribute writer method with validation
320
+ # @param [Object] id Value to be assigned
321
+ def id=(id)
322
+ if id.nil?
323
+ fail ArgumentError, 'id cannot be nil'
324
+ end
325
+
326
+ if id.to_s.length > 31
327
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 31.'
328
+ end
329
+
330
+ if id.to_s.length < 31
331
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 31.'
332
+ end
333
+
334
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
335
+ if id !~ pattern
336
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
337
+ end
338
+
339
+ @id = id
340
+ end
341
+
303
342
  # Custom attribute writer method with validation
304
343
  # @param [Object] tags Value to be assigned
305
344
  def tags=(tags)
@@ -0,0 +1,215 @@
1
+ =begin
2
+ #Svix API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Svix
17
+ class EndpointMtlsConfigOut
18
+ attr_accessor :server_ca_cert
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'server_ca_cert' => :'serverCaCert'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'server_ca_cert' => :'String'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ :'server_ca_cert'
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointMtlsConfigOut` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointMtlsConfigOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'server_ca_cert')
62
+ self.server_ca_cert = attributes[:'server_ca_cert']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ warn '[DEPRECATED] the `valid?` method is obsolete'
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ server_ca_cert == o.server_ca_cert
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [server_ca_cert].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ attributes = attributes.transform_keys(&:to_sym)
107
+ transformed_hash = {}
108
+ openapi_types.each_pair do |key, type|
109
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
110
+ transformed_hash["#{key}"] = nil
111
+ elsif type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[attribute_map[key]].is_a?(Array)
115
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
116
+ end
117
+ elsif !attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
119
+ end
120
+ end
121
+ new(transformed_hash)
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def self._deserialize(type, value)
129
+ case type.to_sym
130
+ when :Time
131
+ Time.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :Boolean
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ # models (e.g. Pet) or oneOf
162
+ klass = Svix.const_get(type)
163
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ if value.nil?
186
+ is_nullable = self.class.openapi_nullable.include?(attr)
187
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
+ end
189
+
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+
215
+ end
@@ -84,11 +84,11 @@ module Svix
84
84
  # Attribute type mapping.
85
85
  def self.openapi_types
86
86
  {
87
- :'auth_method' => :'Oauth2AuthMethodIn',
87
+ :'auth_method' => :'Oauth2AuthMethodInOut',
88
88
  :'client_id' => :'String',
89
89
  :'client_secret' => :'String',
90
90
  :'extra_params' => :'Hash<String, String>',
91
- :'grant_type' => :'Oauth2GrantTypeIn',
91
+ :'grant_type' => :'Oauth2GrantTypeInOut',
92
92
  :'jwt_params' => :'ClientSecretJwtParamsIn',
93
93
  :'refresh_token' => :'String',
94
94
  :'scopes' => :'Array<String>',