svix 1.35.0 → 1.37.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,285 @@
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 parameters for defining a Snowflake sink.
18
+ class SnowflakeConfig
19
+ # Snowflake account identifier, which includes both the organization and account IDs separated by a hyphen.
20
+ attr_accessor :account_identifier
21
+
22
+ # Database name. Only required if not using transformations.
23
+ attr_accessor :db_name
24
+
25
+ # PEM-encoded private key used for signing token-based requests to the Snowflake API. Beginning/end delimiters are not required.
26
+ attr_accessor :private_key
27
+
28
+ # Schema name. Only required if not using transformations.
29
+ attr_accessor :schema_name
30
+
31
+ # Table name. Only required if not using transformations.
32
+ attr_accessor :table_name
33
+
34
+ # The Snowflake user id.
35
+ attr_accessor :user_id
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'account_identifier' => :'accountIdentifier',
41
+ :'db_name' => :'dbName',
42
+ :'private_key' => :'privateKey',
43
+ :'schema_name' => :'schemaName',
44
+ :'table_name' => :'tableName',
45
+ :'user_id' => :'userId'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'account_identifier' => :'String',
58
+ :'db_name' => :'String',
59
+ :'private_key' => :'String',
60
+ :'schema_name' => :'String',
61
+ :'table_name' => :'String',
62
+ :'user_id' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::SnowflakeConfig` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::SnowflakeConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'account_identifier')
88
+ self.account_identifier = attributes[:'account_identifier']
89
+ end
90
+
91
+ if attributes.key?(:'db_name')
92
+ self.db_name = attributes[:'db_name']
93
+ end
94
+
95
+ if attributes.key?(:'private_key')
96
+ self.private_key = attributes[:'private_key']
97
+ end
98
+
99
+ if attributes.key?(:'schema_name')
100
+ self.schema_name = attributes[:'schema_name']
101
+ end
102
+
103
+ if attributes.key?(:'table_name')
104
+ self.table_name = attributes[:'table_name']
105
+ end
106
+
107
+ if attributes.key?(:'user_id')
108
+ self.user_id = attributes[:'user_id']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ invalid_properties = Array.new
116
+ if @account_identifier.nil?
117
+ invalid_properties.push('invalid value for "account_identifier", account_identifier cannot be nil.')
118
+ end
119
+
120
+ if @private_key.nil?
121
+ invalid_properties.push('invalid value for "private_key", private_key cannot be nil.')
122
+ end
123
+
124
+ if @user_id.nil?
125
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ return false if @account_identifier.nil?
135
+ return false if @private_key.nil?
136
+ return false if @user_id.nil?
137
+ true
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ account_identifier == o.account_identifier &&
146
+ db_name == o.db_name &&
147
+ private_key == o.private_key &&
148
+ schema_name == o.schema_name &&
149
+ table_name == o.table_name &&
150
+ user_id == o.user_id
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [account_identifier, db_name, private_key, schema_name, table_name, user_id].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ new.build_from_hash(attributes)
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ self.class.openapi_types.each_pair do |key, type|
178
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
179
+ self.send("#{key}=", nil)
180
+ elsif type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ end
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :Time
201
+ Time.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :Boolean
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ # models (e.g. Pet) or oneOf
232
+ klass = Svix.const_get(type)
233
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ if value.nil?
256
+ is_nullable = self.class.openapi_nullable.include?(attr)
257
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
258
+ end
259
+
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map { |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+
283
+ end
284
+
285
+ end
@@ -17,7 +17,6 @@ module Svix
17
17
  class StreamIn
18
18
  attr_accessor :description
19
19
 
20
- # Optional unique identifier for the stream
21
20
  attr_accessor :uid
22
21
 
23
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -44,7 +43,6 @@ module Svix
44
43
  # List of attributes with nullable: true
45
44
  def self.openapi_nullable
46
45
  Set.new([
47
- :'uid'
48
46
  ])
49
47
  end
50
48
 
@@ -84,6 +82,19 @@ module Svix
84
82
  invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
85
83
  end
86
84
 
85
+ if !@uid.nil? && @uid.to_s.length > 60
86
+ invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 60.')
87
+ end
88
+
89
+ if !@uid.nil? && @uid.to_s.length < 1
90
+ invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.')
91
+ end
92
+
93
+ pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
94
+ if !@uid.nil? && @uid !~ pattern
95
+ invalid_properties.push("invalid value for \"uid\", must conform to the pattern #{pattern}.")
96
+ end
97
+
87
98
  invalid_properties
88
99
  end
89
100
 
@@ -92,6 +103,9 @@ module Svix
92
103
  def valid?
93
104
  return false if @description.nil?
94
105
  return false if @description.to_s.length < 1
106
+ return false if !@uid.nil? && @uid.to_s.length > 60
107
+ return false if !@uid.nil? && @uid.to_s.length < 1
108
+ return false if !@uid.nil? && @uid !~ Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
95
109
  true
96
110
  end
97
111
 
@@ -109,6 +123,25 @@ module Svix
109
123
  @description = description
110
124
  end
111
125
 
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] uid Value to be assigned
128
+ def uid=(uid)
129
+ if !uid.nil? && uid.to_s.length > 60
130
+ fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 60.'
131
+ end
132
+
133
+ if !uid.nil? && uid.to_s.length < 1
134
+ fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
135
+ end
136
+
137
+ pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
138
+ if !uid.nil? && uid !~ pattern
139
+ fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
140
+ end
141
+
142
+ @uid = uid
143
+ end
144
+
112
145
  # Checks equality by comparing each attribute.
113
146
  # @param [Object] Object to be compared
114
147
  def ==(o)
@@ -56,7 +56,6 @@ module Svix
56
56
  def self.openapi_nullable
57
57
  Set.new([
58
58
  :'description',
59
- :'uid',
60
59
  ])
61
60
  end
62
61
 
@@ -108,6 +107,19 @@ module Svix
108
107
  invalid_properties.push('invalid value for "id", id cannot be nil.')
109
108
  end
110
109
 
110
+ if !@uid.nil? && @uid.to_s.length > 60
111
+ invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 60.')
112
+ end
113
+
114
+ if !@uid.nil? && @uid.to_s.length < 1
115
+ invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.')
116
+ end
117
+
118
+ pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
119
+ if !@uid.nil? && @uid !~ pattern
120
+ invalid_properties.push("invalid value for \"uid\", must conform to the pattern #{pattern}.")
121
+ end
122
+
111
123
  if @updated_at.nil?
112
124
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
113
125
  end
@@ -120,10 +132,32 @@ module Svix
120
132
  def valid?
121
133
  return false if @created_at.nil?
122
134
  return false if @id.nil?
135
+ return false if !@uid.nil? && @uid.to_s.length > 60
136
+ return false if !@uid.nil? && @uid.to_s.length < 1
137
+ return false if !@uid.nil? && @uid !~ Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
123
138
  return false if @updated_at.nil?
124
139
  true
125
140
  end
126
141
 
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] uid Value to be assigned
144
+ def uid=(uid)
145
+ if !uid.nil? && uid.to_s.length > 60
146
+ fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 60.'
147
+ end
148
+
149
+ if !uid.nil? && uid.to_s.length < 1
150
+ fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
151
+ end
152
+
153
+ pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
154
+ if !uid.nil? && uid !~ pattern
155
+ fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
156
+ end
157
+
158
+ @uid = uid
159
+ end
160
+
127
161
  # Checks equality by comparing each attribute.
128
162
  # @param [Object] Object to be compared
129
163
  def ==(o)
@@ -17,7 +17,6 @@ module Svix
17
17
  class StreamPatch
18
18
  attr_accessor :description
19
19
 
20
- # Optional unique identifier for the stream
21
20
  attr_accessor :uid
22
21
 
23
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -44,7 +43,6 @@ module Svix
44
43
  # List of attributes with nullable: true
45
44
  def self.openapi_nullable
46
45
  Set.new([
47
- :'uid'
48
46
  ])
49
47
  end
50
48
 
@@ -76,15 +74,50 @@ module Svix
76
74
  # @return Array for valid properties with the reasons
77
75
  def list_invalid_properties
78
76
  invalid_properties = Array.new
77
+ if !@uid.nil? && @uid.to_s.length > 60
78
+ invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 60.')
79
+ end
80
+
81
+ if !@uid.nil? && @uid.to_s.length < 1
82
+ invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.')
83
+ end
84
+
85
+ pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
86
+ if !@uid.nil? && @uid !~ pattern
87
+ invalid_properties.push("invalid value for \"uid\", must conform to the pattern #{pattern}.")
88
+ end
89
+
79
90
  invalid_properties
80
91
  end
81
92
 
82
93
  # Check to see if the all the properties in the model are valid
83
94
  # @return true if the model is valid
84
95
  def valid?
96
+ return false if !@uid.nil? && @uid.to_s.length > 60
97
+ return false if !@uid.nil? && @uid.to_s.length < 1
98
+ return false if !@uid.nil? && @uid !~ Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
85
99
  true
86
100
  end
87
101
 
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] uid Value to be assigned
104
+ def uid=(uid)
105
+ if !uid.nil? && uid.to_s.length > 60
106
+ fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 60.'
107
+ end
108
+
109
+ if !uid.nil? && uid.to_s.length < 1
110
+ fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
111
+ end
112
+
113
+ pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
114
+ if !uid.nil? && uid !~ pattern
115
+ fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
116
+ end
117
+
118
+ @uid = uid
119
+ end
120
+
88
121
  # Checks equality by comparing each attribute.
89
122
  # @param [Object] Object to be compared
90
123
  def ==(o)
@@ -21,7 +21,11 @@ module Svix
21
21
  [
22
22
  :'StreamSinkInOneOf',
23
23
  :'StreamSinkInOneOf1',
24
- :'StreamSinkInOneOf2'
24
+ :'StreamSinkInOneOf2',
25
+ :'StreamSinkInOneOf3',
26
+ :'StreamSinkInOneOf4',
27
+ :'StreamSinkInOneOf5',
28
+ :'StreamSinkInOneOf6'
25
29
  ]
26
30
  end
27
31
 
@@ -57,7 +57,7 @@ module Svix
57
57
  # Attribute type mapping.
58
58
  def self.openapi_types
59
59
  {
60
- :'config' => :'SinkOtelV1Config',
60
+ :'config' => :'AzureBlobStorageConfig',
61
61
  :'type' => :'String'
62
62
  }
63
63
  end
@@ -112,7 +112,7 @@ module Svix
112
112
  def valid?
113
113
  return false if @config.nil?
114
114
  return false if @type.nil?
115
- type_validator = EnumAttributeValidator.new('String', ["otelV1HttpTrace"])
115
+ type_validator = EnumAttributeValidator.new('String', ["azureBlobStorage"])
116
116
  return false unless type_validator.valid?(@type)
117
117
  true
118
118
  end
@@ -120,7 +120,7 @@ module Svix
120
120
  # Custom attribute writer method checking allowed values (enum).
121
121
  # @param [Object] type Object to be assigned
122
122
  def type=(type)
123
- validator = EnumAttributeValidator.new('String', ["otelV1HttpTrace"])
123
+ validator = EnumAttributeValidator.new('String', ["azureBlobStorage"])
124
124
  unless validator.valid?(type)
125
125
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
126
126
  end
@@ -57,7 +57,7 @@ module Svix
57
57
  # Attribute type mapping.
58
58
  def self.openapi_types
59
59
  {
60
- :'config' => :'SinkHttpConfig',
60
+ :'config' => :'SinkOtelV1Config',
61
61
  :'type' => :'String'
62
62
  }
63
63
  end
@@ -112,7 +112,7 @@ module Svix
112
112
  def valid?
113
113
  return false if @config.nil?
114
114
  return false if @type.nil?
115
- type_validator = EnumAttributeValidator.new('String', ["http"])
115
+ type_validator = EnumAttributeValidator.new('String', ["otelV1HttpTrace"])
116
116
  return false unless type_validator.valid?(@type)
117
117
  true
118
118
  end
@@ -120,7 +120,7 @@ module Svix
120
120
  # Custom attribute writer method checking allowed values (enum).
121
121
  # @param [Object] type Object to be assigned
122
122
  def type=(type)
123
- validator = EnumAttributeValidator.new('String', ["http"])
123
+ validator = EnumAttributeValidator.new('String', ["otelV1HttpTrace"])
124
124
  unless validator.valid?(type)
125
125
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
126
126
  end
@@ -57,7 +57,7 @@ module Svix
57
57
  # Attribute type mapping.
58
58
  def self.openapi_types
59
59
  {
60
- :'config' => :'S3Config',
60
+ :'config' => :'SinkHttpConfig',
61
61
  :'type' => :'String'
62
62
  }
63
63
  end
@@ -112,7 +112,7 @@ module Svix
112
112
  def valid?
113
113
  return false if @config.nil?
114
114
  return false if @type.nil?
115
- type_validator = EnumAttributeValidator.new('String', ["amazonS3"])
115
+ type_validator = EnumAttributeValidator.new('String', ["http"])
116
116
  return false unless type_validator.valid?(@type)
117
117
  true
118
118
  end
@@ -120,7 +120,7 @@ module Svix
120
120
  # Custom attribute writer method checking allowed values (enum).
121
121
  # @param [Object] type Object to be assigned
122
122
  def type=(type)
123
- validator = EnumAttributeValidator.new('String', ["amazonS3"])
123
+ validator = EnumAttributeValidator.new('String', ["http"])
124
124
  unless validator.valid?(type)
125
125
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
126
126
  end