svix 1.36.0 → 1.38.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35fa546540a9244a1faf7da5ae5e6bfe69198183d5042b4d20fb7f0c61c5251d
4
- data.tar.gz: ef08823825978aade141008dcf5b6a7888d9eecce81ab6c3d7469a717c9bd38b
3
+ metadata.gz: 600789ef4557cfe7bfc08f6395b796255d380c2c4c737bb0fb43aff0eb81b3e5
4
+ data.tar.gz: 6a0ae88d404cb316dacbd196d394dc666ea364b26f019d8eb384c6eb0dacdd1b
5
5
  SHA512:
6
- metadata.gz: d02cb39d530028f82c42ae6619437232c3b5ed64d9ee4d3943bdf50690ffc499ccb6c3396f12493523b599c945e30ed60d65a8a4d894c087b99ed659229483db
7
- data.tar.gz: 58de26d10232433e2175110f0ee9309e8777cdac8f24ad2370bb38c00c2425b22dddb8f79df1f4ea963dbbe55bbc8808635afc0c9e601ccceb32b78409b053bc
6
+ metadata.gz: 37ce7d602c6dc5b9c5437c2c5f505f413ae2f32059185576bd65a58e39238a552ba57093198b66a1deed7983024a3aad1495cf091a1c15dc8548e128a2203543
7
+ data.tar.gz: 417eb0f82446da3b50315cbd59a1fa3bf804d68ca20ac123cb45621338bc06d7848ba9d393538a10246d14f919ed677aad802b818b78467613d55f227478039e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (1.36.0)
4
+ svix (1.38.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -0,0 +1,251 @@
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
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Svix
17
+ class AzureBlobStorageConfig
18
+ attr_accessor :access_key
19
+
20
+ attr_accessor :account
21
+
22
+ attr_accessor :container
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'access_key' => :'accessKey',
28
+ :'account' => :'account',
29
+ :'container' => :'container'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'access_key' => :'String',
42
+ :'account' => :'String',
43
+ :'container' => :'String'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::AzureBlobStorageConfig` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::AzureBlobStorageConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'access_key')
69
+ self.access_key = attributes[:'access_key']
70
+ end
71
+
72
+ if attributes.key?(:'account')
73
+ self.account = attributes[:'account']
74
+ end
75
+
76
+ if attributes.key?(:'container')
77
+ self.container = attributes[:'container']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @access_key.nil?
86
+ invalid_properties.push('invalid value for "access_key", access_key cannot be nil.')
87
+ end
88
+
89
+ if @account.nil?
90
+ invalid_properties.push('invalid value for "account", account cannot be nil.')
91
+ end
92
+
93
+ if @container.nil?
94
+ invalid_properties.push('invalid value for "container", container cannot be nil.')
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ return false if @access_key.nil?
104
+ return false if @account.nil?
105
+ return false if @container.nil?
106
+ true
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] Object to be compared
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ access_key == o.access_key &&
115
+ account == o.account &&
116
+ container == o.container
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [access_key, account, container].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ new.build_from_hash(attributes)
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.openapi_types.each_pair do |key, type|
144
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
145
+ self.send("#{key}=", nil)
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :Time
167
+ Time.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ # models (e.g. Pet) or oneOf
198
+ klass = Svix.const_get(type)
199
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+
249
+ end
250
+
251
+ end
@@ -21,6 +21,8 @@ module Svix
21
21
 
22
22
  attr_accessor :settings
23
23
 
24
+ attr_accessor :transformation_templates
25
+
24
26
  attr_accessor :version
25
27
 
26
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -29,6 +31,7 @@ module Svix
29
31
  :'created_at' => :'createdAt',
30
32
  :'event_types' => :'eventTypes',
31
33
  :'settings' => :'settings',
34
+ :'transformation_templates' => :'transformationTemplates',
32
35
  :'version' => :'version'
33
36
  }
34
37
  end
@@ -44,6 +47,7 @@ module Svix
44
47
  :'created_at' => :'Time',
45
48
  :'event_types' => :'Array<EventTypeIn>',
46
49
  :'settings' => :'SettingsIn',
50
+ :'transformation_templates' => :'Array<TemplateIn>',
47
51
  :'version' => :'Integer'
48
52
  }
49
53
  end
@@ -52,6 +56,7 @@ module Svix
52
56
  def self.openapi_nullable
53
57
  Set.new([
54
58
  :'event_types',
59
+ :'transformation_templates',
55
60
  ])
56
61
  end
57
62
 
@@ -84,6 +89,12 @@ module Svix
84
89
  self.settings = attributes[:'settings']
85
90
  end
86
91
 
92
+ if attributes.key?(:'transformation_templates')
93
+ if (value = attributes[:'transformation_templates']).is_a?(Array)
94
+ self.transformation_templates = value
95
+ end
96
+ end
97
+
87
98
  if attributes.key?(:'version')
88
99
  self.version = attributes[:'version']
89
100
  end
@@ -120,6 +131,7 @@ module Svix
120
131
  created_at == o.created_at &&
121
132
  event_types == o.event_types &&
122
133
  settings == o.settings &&
134
+ transformation_templates == o.transformation_templates &&
123
135
  version == o.version
124
136
  end
125
137
 
@@ -132,7 +144,7 @@ module Svix
132
144
  # Calculates hash code according to all attributes.
133
145
  # @return [Integer] Hash code
134
146
  def hash
135
- [created_at, event_types, settings, version].hash
147
+ [created_at, event_types, settings, transformation_templates, version].hash
136
148
  end
137
149
 
138
150
  # Builds the object from hash
@@ -21,6 +21,8 @@ module Svix
21
21
 
22
22
  attr_accessor :settings
23
23
 
24
+ attr_accessor :transformation_templates
25
+
24
26
  attr_accessor :version
25
27
 
26
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -29,6 +31,7 @@ module Svix
29
31
  :'created_at' => :'createdAt',
30
32
  :'event_types' => :'eventTypes',
31
33
  :'settings' => :'settings',
34
+ :'transformation_templates' => :'transformationTemplates',
32
35
  :'version' => :'version'
33
36
  }
34
37
  end
@@ -44,6 +47,7 @@ module Svix
44
47
  :'created_at' => :'Time',
45
48
  :'event_types' => :'Array<EventTypeOut>',
46
49
  :'settings' => :'SettingsOut',
50
+ :'transformation_templates' => :'Array<TemplateOut>',
47
51
  :'version' => :'Integer'
48
52
  }
49
53
  end
@@ -83,6 +87,12 @@ module Svix
83
87
  self.settings = attributes[:'settings']
84
88
  end
85
89
 
90
+ if attributes.key?(:'transformation_templates')
91
+ if (value = attributes[:'transformation_templates']).is_a?(Array)
92
+ self.transformation_templates = value
93
+ end
94
+ end
95
+
86
96
  if attributes.key?(:'version')
87
97
  self.version = attributes[:'version']
88
98
  else
@@ -102,6 +112,10 @@ module Svix
102
112
  invalid_properties.push('invalid value for "event_types", event_types cannot be nil.')
103
113
  end
104
114
 
115
+ if @transformation_templates.nil?
116
+ invalid_properties.push('invalid value for "transformation_templates", transformation_templates cannot be nil.')
117
+ end
118
+
105
119
  invalid_properties
106
120
  end
107
121
 
@@ -110,6 +124,7 @@ module Svix
110
124
  def valid?
111
125
  return false if @created_at.nil?
112
126
  return false if @event_types.nil?
127
+ return false if @transformation_templates.nil?
113
128
  true
114
129
  end
115
130
 
@@ -121,6 +136,7 @@ module Svix
121
136
  created_at == o.created_at &&
122
137
  event_types == o.event_types &&
123
138
  settings == o.settings &&
139
+ transformation_templates == o.transformation_templates &&
124
140
  version == o.version
125
141
  end
126
142
 
@@ -133,7 +149,7 @@ module Svix
133
149
  # Calculates hash code according to all attributes.
134
150
  # @return [Integer] Hash code
135
151
  def hash
136
- [created_at, event_types, settings, version].hash
152
+ [created_at, event_types, settings, transformation_templates, version].hash
137
153
  end
138
154
 
139
155
  # Builds the object from hash
@@ -0,0 +1,239 @@
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
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Svix
17
+ # Configuration for a Google Cloud Storage sink. Write stream events into the named bucket using the supplied Google Cloud credentials.
18
+ class GoogleCloudStorageConfig
19
+ attr_accessor :bucket
20
+
21
+ # Google Cloud Credentials JSON Object as a string.
22
+ attr_accessor :credentials
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'bucket' => :'bucket',
28
+ :'credentials' => :'credentials'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'bucket' => :'String',
41
+ :'credentials' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::GoogleCloudStorageConfig` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::GoogleCloudStorageConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'bucket')
67
+ self.bucket = attributes[:'bucket']
68
+ end
69
+
70
+ if attributes.key?(:'credentials')
71
+ self.credentials = attributes[:'credentials']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if @bucket.nil?
80
+ invalid_properties.push('invalid value for "bucket", bucket cannot be nil.')
81
+ end
82
+
83
+ if @credentials.nil?
84
+ invalid_properties.push('invalid value for "credentials", credentials cannot be nil.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @bucket.nil?
94
+ return false if @credentials.nil?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ bucket == o.bucket &&
104
+ credentials == o.credentials
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [bucket, credentials].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = Svix.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end