svix 1.39.0 → 1.41.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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/stream_api.rb +157 -0
  4. data/lib/svix/api/stream_event_types_api.rb +486 -0
  5. data/lib/svix/models/app_usage_stats_in.rb +1 -0
  6. data/lib/svix/models/app_usage_stats_out.rb +33 -4
  7. data/lib/svix/models/event_example_in.rb +35 -4
  8. data/lib/svix/models/event_in.rb +38 -1
  9. data/lib/svix/models/event_out.rb +38 -1
  10. data/lib/svix/models/list_response_application_out.rb +2 -0
  11. data/lib/svix/models/list_response_application_stats.rb +2 -0
  12. data/lib/svix/models/list_response_background_task_out.rb +2 -0
  13. data/lib/svix/models/list_response_endpoint_message_out.rb +2 -0
  14. data/lib/svix/models/list_response_endpoint_out.rb +2 -0
  15. data/lib/svix/models/list_response_event_type_out.rb +2 -0
  16. data/lib/svix/models/list_response_integration_out.rb +2 -0
  17. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +2 -0
  18. data/lib/svix/models/list_response_message_attempt_out.rb +2 -0
  19. data/lib/svix/models/list_response_message_endpoint_out.rb +2 -0
  20. data/lib/svix/models/list_response_message_out.rb +2 -0
  21. data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +2 -0
  22. data/lib/svix/models/list_response_sink_out.rb +2 -0
  23. data/lib/svix/models/list_response_stream_event_type_out.rb +261 -0
  24. data/lib/svix/models/list_response_stream_out.rb +2 -0
  25. data/lib/svix/models/list_response_stream_sink_out.rb +2 -0
  26. data/lib/svix/models/list_response_template_out.rb +2 -0
  27. data/lib/svix/models/sink_http_config.rb +11 -1
  28. data/lib/svix/models/stream_event_type_in.rb +262 -0
  29. data/lib/svix/models/stream_event_type_out.rb +294 -0
  30. data/lib/svix/models/stream_event_type_patch.rb +254 -0
  31. data/lib/svix/version.rb +1 -1
  32. metadata +7 -3
  33. data/lib/svix/api/sink_api.rb +0 -179
@@ -0,0 +1,294 @@
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 StreamEventTypeOut
18
+ attr_accessor :created_at
19
+
20
+ attr_accessor :description
21
+
22
+ # The event type's name
23
+ attr_accessor :name
24
+
25
+ attr_accessor :updated_at
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'created_at' => :'createdAt',
31
+ :'description' => :'description',
32
+ :'name' => :'name',
33
+ :'updated_at' => :'updatedAt'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'created_at' => :'Time',
46
+ :'description' => :'String',
47
+ :'name' => :'String',
48
+ :'updated_at' => :'Time'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'description',
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::StreamEventTypeOut` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::StreamEventTypeOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'created_at')
75
+ self.created_at = attributes[:'created_at']
76
+ else
77
+ self.created_at = nil
78
+ end
79
+
80
+ if attributes.key?(:'description')
81
+ self.description = attributes[:'description']
82
+ end
83
+
84
+ if attributes.key?(:'name')
85
+ self.name = attributes[:'name']
86
+ else
87
+ self.name = nil
88
+ end
89
+
90
+ if attributes.key?(:'updated_at')
91
+ self.updated_at = attributes[:'updated_at']
92
+ else
93
+ self.updated_at = nil
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ if @created_at.nil?
103
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
104
+ end
105
+
106
+ if @name.nil?
107
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
108
+ end
109
+
110
+ if @name.to_s.length > 256
111
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 256.')
112
+ end
113
+
114
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
115
+ if @name !~ pattern
116
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
117
+ end
118
+
119
+ if @updated_at.nil?
120
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ warn '[DEPRECATED] the `valid?` method is obsolete'
130
+ return false if @created_at.nil?
131
+ return false if @name.nil?
132
+ return false if @name.to_s.length > 256
133
+ return false if @name !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
134
+ return false if @updated_at.nil?
135
+ true
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] name Value to be assigned
140
+ def name=(name)
141
+ if name.nil?
142
+ fail ArgumentError, 'name cannot be nil'
143
+ end
144
+
145
+ if name.to_s.length > 256
146
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 256.'
147
+ end
148
+
149
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
150
+ if name !~ pattern
151
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
152
+ end
153
+
154
+ @name = name
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ created_at == o.created_at &&
163
+ description == o.description &&
164
+ name == o.name &&
165
+ updated_at == o.updated_at
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [created_at, description, name, updated_at].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
190
+ elsif type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
195
+ end
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
+ end
199
+ end
200
+ new(transformed_hash)
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def self._deserialize(type, value)
208
+ case type.to_sym
209
+ when :Time
210
+ Time.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :Boolean
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ # models (e.g. Pet) or oneOf
241
+ klass = Svix.const_get(type)
242
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ if value.nil?
265
+ is_nullable = self.class.openapi_nullable.include?(attr)
266
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
+ end
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map { |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+
292
+ end
293
+
294
+ end
@@ -0,0 +1,254 @@
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 StreamEventTypePatch
18
+ attr_accessor :description
19
+
20
+ # The event type's name
21
+ attr_accessor :name
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'description' => :'description',
27
+ :'name' => :'name'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'description' => :'String',
40
+ :'name' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ :'description',
48
+ :'name'
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::StreamEventTypePatch` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::StreamEventTypePatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'description')
68
+ self.description = attributes[:'description']
69
+ else
70
+ self.description = nil
71
+ end
72
+
73
+ if attributes.key?(:'name')
74
+ self.name = attributes[:'name']
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
82
+ invalid_properties = Array.new
83
+ if !@name.nil? && @name.to_s.length > 256
84
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 256.')
85
+ end
86
+
87
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
88
+ if !@name.nil? && @name !~ pattern
89
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if !@name.nil? && @name.to_s.length > 256
100
+ return false if !@name.nil? && @name !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param [Object] name Value to be assigned
106
+ def name=(name)
107
+ if !name.nil? && name.to_s.length > 256
108
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 256.'
109
+ end
110
+
111
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
112
+ if !name.nil? && name !~ pattern
113
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
114
+ end
115
+
116
+ @name = name
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ description == o.description &&
125
+ name == o.name
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [description, name].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ attributes = attributes.transform_keys(&:to_sym)
146
+ transformed_hash = {}
147
+ openapi_types.each_pair do |key, type|
148
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = nil
150
+ elsif type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[attribute_map[key]].is_a?(Array)
154
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
155
+ end
156
+ elsif !attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
158
+ end
159
+ end
160
+ new(transformed_hash)
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def self._deserialize(type, value)
168
+ case type.to_sym
169
+ when :Time
170
+ Time.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :Boolean
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ # models (e.g. Pet) or oneOf
201
+ klass = Svix.const_get(type)
202
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ if value.nil?
225
+ is_nullable = self.class.openapi_nullable.include?(attr)
226
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
+ end
228
+
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+
254
+ end
data/lib/svix/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svix
4
- VERSION = "1.39.0"
4
+ VERSION = "1.41.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.39.0
4
+ version: 1.41.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-06 00:00:00.000000000 Z
11
+ date: 2024-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -84,9 +84,9 @@ files:
84
84
  - lib/svix/api/integration_api.rb
85
85
  - lib/svix/api/message_api.rb
86
86
  - lib/svix/api/message_attempt_api.rb
87
- - lib/svix/api/sink_api.rb
88
87
  - lib/svix/api/statistics_api.rb
89
88
  - lib/svix/api/stream_api.rb
89
+ - lib/svix/api/stream_event_types_api.rb
90
90
  - lib/svix/api/transformation_template_api.rb
91
91
  - lib/svix/api/webhook_endpoint_api.rb
92
92
  - lib/svix/api_client.rb
@@ -202,6 +202,7 @@ files:
202
202
  - lib/svix/models/list_response_message_out.rb
203
203
  - lib/svix/models/list_response_operational_webhook_endpoint_out.rb
204
204
  - lib/svix/models/list_response_sink_out.rb
205
+ - lib/svix/models/list_response_stream_event_type_out.rb
205
206
  - lib/svix/models/list_response_stream_out.rb
206
207
  - lib/svix/models/list_response_stream_sink_out.rb
207
208
  - lib/svix/models/list_response_template_out.rb
@@ -264,6 +265,9 @@ files:
264
265
  - lib/svix/models/snowflake_config.rb
265
266
  - lib/svix/models/statistics_period.rb
266
267
  - lib/svix/models/status_code_class.rb
268
+ - lib/svix/models/stream_event_type_in.rb
269
+ - lib/svix/models/stream_event_type_out.rb
270
+ - lib/svix/models/stream_event_type_patch.rb
267
271
  - lib/svix/models/stream_in.rb
268
272
  - lib/svix/models/stream_out.rb
269
273
  - lib/svix/models/stream_patch.rb