svix 1.45.1 → 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,355 @@
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 ActiveEndpointOut
18
+ attr_accessor :created_at
19
+
20
+ # The Endpoint's ID.
21
+ attr_accessor :id
22
+
23
+ # The Endpoint's UID.
24
+ attr_accessor :uid
25
+
26
+ attr_accessor :updated_at
27
+
28
+ attr_accessor :url
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'created_at' => :'createdAt',
34
+ :'id' => :'id',
35
+ :'uid' => :'uid',
36
+ :'updated_at' => :'updatedAt',
37
+ :'url' => :'url'
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
+ :'created_at' => :'Time',
50
+ :'id' => :'String',
51
+ :'uid' => :'String',
52
+ :'updated_at' => :'Time',
53
+ :'url' => :'String'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ :'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::ActiveEndpointOut` 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::ActiveEndpointOut`. 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?(:'created_at')
80
+ self.created_at = attributes[:'created_at']
81
+ else
82
+ self.created_at = nil
83
+ end
84
+
85
+ if attributes.key?(:'id')
86
+ self.id = attributes[:'id']
87
+ else
88
+ self.id = nil
89
+ end
90
+
91
+ if attributes.key?(:'uid')
92
+ self.uid = attributes[:'uid']
93
+ end
94
+
95
+ if attributes.key?(:'updated_at')
96
+ self.updated_at = attributes[:'updated_at']
97
+ else
98
+ self.updated_at = nil
99
+ end
100
+
101
+ if attributes.key?(:'url')
102
+ self.url = attributes[:'url']
103
+ else
104
+ self.url = nil
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @created_at.nil?
114
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
115
+ end
116
+
117
+ if @id.nil?
118
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
119
+ end
120
+
121
+ if @id.to_s.length > 30
122
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 30.')
123
+ end
124
+
125
+ if @id.to_s.length < 30
126
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 30.')
127
+ end
128
+
129
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
130
+ if @id !~ pattern
131
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
132
+ end
133
+
134
+ if !@uid.nil? && @uid.to_s.length > 256
135
+ invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 256.')
136
+ end
137
+
138
+ if !@uid.nil? && @uid.to_s.length < 1
139
+ invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.')
140
+ end
141
+
142
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
143
+ if !@uid.nil? && @uid !~ pattern
144
+ invalid_properties.push("invalid value for \"uid\", must conform to the pattern #{pattern}.")
145
+ end
146
+
147
+ if @updated_at.nil?
148
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
149
+ end
150
+
151
+ if @url.nil?
152
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
153
+ end
154
+
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ warn '[DEPRECATED] the `valid?` method is obsolete'
162
+ return false if @created_at.nil?
163
+ return false if @id.nil?
164
+ return false if @id.to_s.length > 30
165
+ return false if @id.to_s.length < 30
166
+ return false if @id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
167
+ return false if !@uid.nil? && @uid.to_s.length > 256
168
+ return false if !@uid.nil? && @uid.to_s.length < 1
169
+ return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
170
+ return false if @updated_at.nil?
171
+ return false if @url.nil?
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] id Value to be assigned
177
+ def id=(id)
178
+ if id.nil?
179
+ fail ArgumentError, 'id cannot be nil'
180
+ end
181
+
182
+ if id.to_s.length > 30
183
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 30.'
184
+ end
185
+
186
+ if id.to_s.length < 30
187
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 30.'
188
+ end
189
+
190
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
191
+ if id !~ pattern
192
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
193
+ end
194
+
195
+ @id = id
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] uid Value to be assigned
200
+ def uid=(uid)
201
+ if !uid.nil? && uid.to_s.length > 256
202
+ fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 256.'
203
+ end
204
+
205
+ if !uid.nil? && uid.to_s.length < 1
206
+ fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
207
+ end
208
+
209
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
210
+ if !uid.nil? && uid !~ pattern
211
+ fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
212
+ end
213
+
214
+ @uid = uid
215
+ end
216
+
217
+ # Checks equality by comparing each attribute.
218
+ # @param [Object] Object to be compared
219
+ def ==(o)
220
+ return true if self.equal?(o)
221
+ self.class == o.class &&
222
+ created_at == o.created_at &&
223
+ id == o.id &&
224
+ uid == o.uid &&
225
+ updated_at == o.updated_at &&
226
+ url == o.url
227
+ end
228
+
229
+ # @see the `==` method
230
+ # @param [Object] Object to be compared
231
+ def eql?(o)
232
+ self == o
233
+ end
234
+
235
+ # Calculates hash code according to all attributes.
236
+ # @return [Integer] Hash code
237
+ def hash
238
+ [created_at, id, uid, updated_at, url].hash
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def self.build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ attributes = attributes.transform_keys(&:to_sym)
247
+ transformed_hash = {}
248
+ openapi_types.each_pair do |key, type|
249
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = nil
251
+ elsif type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[attribute_map[key]].is_a?(Array)
255
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
256
+ end
257
+ elsif !attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
259
+ end
260
+ end
261
+ new(transformed_hash)
262
+ end
263
+
264
+ # Deserializes the data based on type
265
+ # @param string type Data type
266
+ # @param string value Value to be deserialized
267
+ # @return [Object] Deserialized data
268
+ def self._deserialize(type, value)
269
+ case type.to_sym
270
+ when :Time
271
+ Time.parse(value)
272
+ when :Date
273
+ Date.parse(value)
274
+ when :String
275
+ value.to_s
276
+ when :Integer
277
+ value.to_i
278
+ when :Float
279
+ value.to_f
280
+ when :Boolean
281
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
282
+ true
283
+ else
284
+ false
285
+ end
286
+ when :Object
287
+ # generic object (usually a Hash), return directly
288
+ value
289
+ when /\AArray<(?<inner_type>.+)>\z/
290
+ inner_type = Regexp.last_match[:inner_type]
291
+ value.map { |v| _deserialize(inner_type, v) }
292
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
293
+ k_type = Regexp.last_match[:k_type]
294
+ v_type = Regexp.last_match[:v_type]
295
+ {}.tap do |hash|
296
+ value.each do |k, v|
297
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
298
+ end
299
+ end
300
+ else # model
301
+ # models (e.g. Pet) or oneOf
302
+ klass = Svix.const_get(type)
303
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
304
+ end
305
+ end
306
+
307
+ # Returns the string representation of the object
308
+ # @return [String] String presentation of the object
309
+ def to_s
310
+ to_hash.to_s
311
+ end
312
+
313
+ # to_body is an alias to to_hash (backward compatibility)
314
+ # @return [Hash] Returns the object in the form of hash
315
+ def to_body
316
+ to_hash
317
+ end
318
+
319
+ # Returns the object in the form of hash
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_hash
322
+ hash = {}
323
+ self.class.attribute_map.each_pair do |attr, param|
324
+ value = self.send(attr)
325
+ if value.nil?
326
+ is_nullable = self.class.openapi_nullable.include?(attr)
327
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
328
+ end
329
+
330
+ hash[param] = _to_hash(value)
331
+ end
332
+ hash
333
+ end
334
+
335
+ # Outputs non-array value in the form of hash
336
+ # For object, use to_hash. Otherwise, just return the value
337
+ # @param [Object] value Any valid value
338
+ # @return [Hash] Returns the value in the form of hash
339
+ def _to_hash(value)
340
+ if value.is_a?(Array)
341
+ value.compact.map { |v| _to_hash(v) }
342
+ elsif value.is_a?(Hash)
343
+ {}.tap do |hash|
344
+ value.each { |k, v| hash[k] = _to_hash(v) }
345
+ end
346
+ elsif value.respond_to? :to_hash
347
+ value.to_hash
348
+ else
349
+ value
350
+ end
351
+ end
352
+
353
+ end
354
+
355
+ end
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class AggregateEventTypesOut
18
+ # The QueueBackgroundTask's ID.
18
19
  attr_accessor :id
19
20
 
20
21
  attr_accessor :status
@@ -115,6 +116,19 @@ module Svix
115
116
  invalid_properties.push('invalid value for "id", id cannot be nil.')
116
117
  end
117
118
 
119
+ if @id.to_s.length > 33
120
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
121
+ end
122
+
123
+ if @id.to_s.length < 33
124
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
125
+ end
126
+
127
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
128
+ if @id !~ pattern
129
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
130
+ end
131
+
118
132
  if @status.nil?
119
133
  invalid_properties.push('invalid value for "status", status cannot be nil.')
120
134
  end
@@ -131,11 +145,37 @@ module Svix
131
145
  def valid?
132
146
  warn '[DEPRECATED] the `valid?` method is obsolete'
133
147
  return false if @id.nil?
148
+ return false if @id.to_s.length > 33
149
+ return false if @id.to_s.length < 33
150
+ return false if @id !~ Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
134
151
  return false if @status.nil?
135
152
  return false if @task.nil?
136
153
  true
137
154
  end
138
155
 
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] id Value to be assigned
158
+ def id=(id)
159
+ if id.nil?
160
+ fail ArgumentError, 'id cannot be nil'
161
+ end
162
+
163
+ if id.to_s.length > 33
164
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
165
+ end
166
+
167
+ if id.to_s.length < 33
168
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
169
+ end
170
+
171
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
172
+ if id !~ pattern
173
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
174
+ end
175
+
176
+ @id = id
177
+ end
178
+
139
179
  # Checks equality by comparing each attribute.
140
180
  # @param [Object] Object to be compared
141
181
  def ==(o)