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