svix 1.35.0 → 1.36.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/models/custom_strings_override.rb +11 -1
- data/lib/svix/models/message_attempt_endpoint_out.rb +1 -0
- data/lib/svix/models/message_attempt_out.rb +1 -0
- data/lib/svix/models/snowflake_config.rb +278 -0
- data/lib/svix/models/stream_in.rb +35 -2
- data/lib/svix/models/stream_out.rb +35 -1
- data/lib/svix/models/stream_patch.rb +35 -2
- data/lib/svix/models/stream_sink_in.rb +2 -1
- data/lib/svix/models/stream_sink_in_one_of3.rb +271 -0
- data/lib/svix/models/stream_sink_out.rb +2 -1
- data/lib/svix/models/stream_sink_patch.rb +2 -1
- data/lib/svix/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35fa546540a9244a1faf7da5ae5e6bfe69198183d5042b4d20fb7f0c61c5251d
|
4
|
+
data.tar.gz: ef08823825978aade141008dcf5b6a7888d9eecce81ab6c3d7469a717c9bd38b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d02cb39d530028f82c42ae6619437232c3b5ed64d9ee4d3943bdf50690ffc499ccb6c3396f12493523b599c945e30ed60d65a8a4d894c087b99ed659229483db
|
7
|
+
data.tar.gz: 58de26d10232433e2175110f0ee9309e8777cdac8f24ad2370bb38c00c2425b22dddb8f79df1f4ea963dbbe55bbc8808635afc0c9e601ccceb32b78409b053bc
|
data/Gemfile.lock
CHANGED
@@ -15,6 +15,8 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Svix
|
17
17
|
class CustomStringsOverride
|
18
|
+
attr_accessor :channels_help
|
19
|
+
|
18
20
|
attr_accessor :channels_many
|
19
21
|
|
20
22
|
attr_accessor :channels_one
|
@@ -22,6 +24,7 @@ module Svix
|
|
22
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
23
25
|
def self.attribute_map
|
24
26
|
{
|
27
|
+
:'channels_help' => :'channelsHelp',
|
25
28
|
:'channels_many' => :'channelsMany',
|
26
29
|
:'channels_one' => :'channelsOne'
|
27
30
|
}
|
@@ -35,6 +38,7 @@ module Svix
|
|
35
38
|
# Attribute type mapping.
|
36
39
|
def self.openapi_types
|
37
40
|
{
|
41
|
+
:'channels_help' => :'String',
|
38
42
|
:'channels_many' => :'String',
|
39
43
|
:'channels_one' => :'String'
|
40
44
|
}
|
@@ -43,6 +47,7 @@ module Svix
|
|
43
47
|
# List of attributes with nullable: true
|
44
48
|
def self.openapi_nullable
|
45
49
|
Set.new([
|
50
|
+
:'channels_help',
|
46
51
|
:'channels_many',
|
47
52
|
:'channels_one'
|
48
53
|
])
|
@@ -63,6 +68,10 @@ module Svix
|
|
63
68
|
h[k.to_sym] = v
|
64
69
|
}
|
65
70
|
|
71
|
+
if attributes.key?(:'channels_help')
|
72
|
+
self.channels_help = attributes[:'channels_help']
|
73
|
+
end
|
74
|
+
|
66
75
|
if attributes.key?(:'channels_many')
|
67
76
|
self.channels_many = attributes[:'channels_many']
|
68
77
|
end
|
@@ -90,6 +99,7 @@ module Svix
|
|
90
99
|
def ==(o)
|
91
100
|
return true if self.equal?(o)
|
92
101
|
self.class == o.class &&
|
102
|
+
channels_help == o.channels_help &&
|
93
103
|
channels_many == o.channels_many &&
|
94
104
|
channels_one == o.channels_one
|
95
105
|
end
|
@@ -103,7 +113,7 @@ module Svix
|
|
103
113
|
# Calculates hash code according to all attributes.
|
104
114
|
# @return [Integer] Hash code
|
105
115
|
def hash
|
106
|
-
[channels_many, channels_one].hash
|
116
|
+
[channels_help, channels_many, channels_one].hash
|
107
117
|
end
|
108
118
|
|
109
119
|
# Builds the object from hash
|
@@ -0,0 +1,278 @@
|
|
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 SnowflakeConfig
|
18
|
+
attr_accessor :account_identifier
|
19
|
+
|
20
|
+
attr_accessor :db_name
|
21
|
+
|
22
|
+
attr_accessor :private_key
|
23
|
+
|
24
|
+
attr_accessor :schema_name
|
25
|
+
|
26
|
+
attr_accessor :table_name
|
27
|
+
|
28
|
+
attr_accessor :user_id
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'account_identifier' => :'accountIdentifier',
|
34
|
+
:'db_name' => :'dbName',
|
35
|
+
:'private_key' => :'privateKey',
|
36
|
+
:'schema_name' => :'schemaName',
|
37
|
+
:'table_name' => :'tableName',
|
38
|
+
:'user_id' => :'userId'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Returns all the JSON keys this model knows about
|
43
|
+
def self.acceptable_attributes
|
44
|
+
attribute_map.values
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.openapi_types
|
49
|
+
{
|
50
|
+
:'account_identifier' => :'String',
|
51
|
+
:'db_name' => :'String',
|
52
|
+
:'private_key' => :'String',
|
53
|
+
:'schema_name' => :'String',
|
54
|
+
:'table_name' => :'String',
|
55
|
+
:'user_id' => :'String'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# List of attributes with nullable: true
|
60
|
+
def self.openapi_nullable
|
61
|
+
Set.new([
|
62
|
+
])
|
63
|
+
end
|
64
|
+
|
65
|
+
# Initializes the object
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
67
|
+
def initialize(attributes = {})
|
68
|
+
if (!attributes.is_a?(Hash))
|
69
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::SnowflakeConfig` initialize method"
|
70
|
+
end
|
71
|
+
|
72
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
73
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
74
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
75
|
+
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
|
76
|
+
end
|
77
|
+
h[k.to_sym] = v
|
78
|
+
}
|
79
|
+
|
80
|
+
if attributes.key?(:'account_identifier')
|
81
|
+
self.account_identifier = attributes[:'account_identifier']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'db_name')
|
85
|
+
self.db_name = attributes[:'db_name']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'private_key')
|
89
|
+
self.private_key = attributes[:'private_key']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'schema_name')
|
93
|
+
self.schema_name = attributes[:'schema_name']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'table_name')
|
97
|
+
self.table_name = attributes[:'table_name']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'user_id')
|
101
|
+
self.user_id = attributes[:'user_id']
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
106
|
+
# @return Array for valid properties with the reasons
|
107
|
+
def list_invalid_properties
|
108
|
+
invalid_properties = Array.new
|
109
|
+
if @account_identifier.nil?
|
110
|
+
invalid_properties.push('invalid value for "account_identifier", account_identifier cannot be nil.')
|
111
|
+
end
|
112
|
+
|
113
|
+
if @private_key.nil?
|
114
|
+
invalid_properties.push('invalid value for "private_key", private_key cannot be nil.')
|
115
|
+
end
|
116
|
+
|
117
|
+
if @user_id.nil?
|
118
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
119
|
+
end
|
120
|
+
|
121
|
+
invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
return false if @account_identifier.nil?
|
128
|
+
return false if @private_key.nil?
|
129
|
+
return false if @user_id.nil?
|
130
|
+
true
|
131
|
+
end
|
132
|
+
|
133
|
+
# Checks equality by comparing each attribute.
|
134
|
+
# @param [Object] Object to be compared
|
135
|
+
def ==(o)
|
136
|
+
return true if self.equal?(o)
|
137
|
+
self.class == o.class &&
|
138
|
+
account_identifier == o.account_identifier &&
|
139
|
+
db_name == o.db_name &&
|
140
|
+
private_key == o.private_key &&
|
141
|
+
schema_name == o.schema_name &&
|
142
|
+
table_name == o.table_name &&
|
143
|
+
user_id == o.user_id
|
144
|
+
end
|
145
|
+
|
146
|
+
# @see the `==` method
|
147
|
+
# @param [Object] Object to be compared
|
148
|
+
def eql?(o)
|
149
|
+
self == o
|
150
|
+
end
|
151
|
+
|
152
|
+
# Calculates hash code according to all attributes.
|
153
|
+
# @return [Integer] Hash code
|
154
|
+
def hash
|
155
|
+
[account_identifier, db_name, private_key, schema_name, table_name, user_id].hash
|
156
|
+
end
|
157
|
+
|
158
|
+
# Builds the object from hash
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
160
|
+
# @return [Object] Returns the model itself
|
161
|
+
def self.build_from_hash(attributes)
|
162
|
+
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
169
|
+
return nil unless attributes.is_a?(Hash)
|
170
|
+
self.class.openapi_types.each_pair do |key, type|
|
171
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
172
|
+
self.send("#{key}=", nil)
|
173
|
+
elsif type =~ /\AArray<(.*)>/i
|
174
|
+
# check to ensure the input is an array given that the attribute
|
175
|
+
# is documented as an array but the input is not
|
176
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
177
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
178
|
+
end
|
179
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
180
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
self
|
185
|
+
end
|
186
|
+
|
187
|
+
# Deserializes the data based on type
|
188
|
+
# @param string type Data type
|
189
|
+
# @param string value Value to be deserialized
|
190
|
+
# @return [Object] Deserialized data
|
191
|
+
def _deserialize(type, value)
|
192
|
+
case type.to_sym
|
193
|
+
when :Time
|
194
|
+
Time.parse(value)
|
195
|
+
when :Date
|
196
|
+
Date.parse(value)
|
197
|
+
when :String
|
198
|
+
value.to_s
|
199
|
+
when :Integer
|
200
|
+
value.to_i
|
201
|
+
when :Float
|
202
|
+
value.to_f
|
203
|
+
when :Boolean
|
204
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
205
|
+
true
|
206
|
+
else
|
207
|
+
false
|
208
|
+
end
|
209
|
+
when :Object
|
210
|
+
# generic object (usually a Hash), return directly
|
211
|
+
value
|
212
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
213
|
+
inner_type = Regexp.last_match[:inner_type]
|
214
|
+
value.map { |v| _deserialize(inner_type, v) }
|
215
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
216
|
+
k_type = Regexp.last_match[:k_type]
|
217
|
+
v_type = Regexp.last_match[:v_type]
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each do |k, v|
|
220
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
else # model
|
224
|
+
# models (e.g. Pet) or oneOf
|
225
|
+
klass = Svix.const_get(type)
|
226
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
# Returns the string representation of the object
|
231
|
+
# @return [String] String presentation of the object
|
232
|
+
def to_s
|
233
|
+
to_hash.to_s
|
234
|
+
end
|
235
|
+
|
236
|
+
# to_body is an alias to to_hash (backward compatibility)
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
238
|
+
def to_body
|
239
|
+
to_hash
|
240
|
+
end
|
241
|
+
|
242
|
+
# Returns the object in the form of hash
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
244
|
+
def to_hash
|
245
|
+
hash = {}
|
246
|
+
self.class.attribute_map.each_pair do |attr, param|
|
247
|
+
value = self.send(attr)
|
248
|
+
if value.nil?
|
249
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
250
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
251
|
+
end
|
252
|
+
|
253
|
+
hash[param] = _to_hash(value)
|
254
|
+
end
|
255
|
+
hash
|
256
|
+
end
|
257
|
+
|
258
|
+
# Outputs non-array value in the form of hash
|
259
|
+
# For object, use to_hash. Otherwise, just return the value
|
260
|
+
# @param [Object] value Any valid value
|
261
|
+
# @return [Hash] Returns the value in the form of hash
|
262
|
+
def _to_hash(value)
|
263
|
+
if value.is_a?(Array)
|
264
|
+
value.compact.map { |v| _to_hash(v) }
|
265
|
+
elsif value.is_a?(Hash)
|
266
|
+
{}.tap do |hash|
|
267
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
268
|
+
end
|
269
|
+
elsif value.respond_to? :to_hash
|
270
|
+
value.to_hash
|
271
|
+
else
|
272
|
+
value
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
end
|
277
|
+
|
278
|
+
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)
|
@@ -0,0 +1,271 @@
|
|
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 StreamSinkInOneOf3
|
18
|
+
attr_accessor :config
|
19
|
+
|
20
|
+
attr_accessor :type
|
21
|
+
|
22
|
+
class EnumAttributeValidator
|
23
|
+
attr_reader :datatype
|
24
|
+
attr_reader :allowable_values
|
25
|
+
|
26
|
+
def initialize(datatype, allowable_values)
|
27
|
+
@allowable_values = allowable_values.map do |value|
|
28
|
+
case datatype.to_s
|
29
|
+
when /Integer/i
|
30
|
+
value.to_i
|
31
|
+
when /Float/i
|
32
|
+
value.to_f
|
33
|
+
else
|
34
|
+
value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def valid?(value)
|
40
|
+
!value || allowable_values.include?(value)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
45
|
+
def self.attribute_map
|
46
|
+
{
|
47
|
+
:'config' => :'config',
|
48
|
+
:'type' => :'type'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.openapi_types
|
59
|
+
{
|
60
|
+
:'config' => :'SnowflakeConfig',
|
61
|
+
:'type' => :'String'
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# List of attributes with nullable: true
|
66
|
+
def self.openapi_nullable
|
67
|
+
Set.new([
|
68
|
+
])
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
73
|
+
def initialize(attributes = {})
|
74
|
+
if (!attributes.is_a?(Hash))
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::StreamSinkInOneOf3` initialize method"
|
76
|
+
end
|
77
|
+
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
80
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::StreamSinkInOneOf3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
82
|
+
end
|
83
|
+
h[k.to_sym] = v
|
84
|
+
}
|
85
|
+
|
86
|
+
if attributes.key?(:'config')
|
87
|
+
self.config = attributes[:'config']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'type')
|
91
|
+
self.type = attributes[:'type']
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
96
|
+
# @return Array for valid properties with the reasons
|
97
|
+
def list_invalid_properties
|
98
|
+
invalid_properties = Array.new
|
99
|
+
if @config.nil?
|
100
|
+
invalid_properties.push('invalid value for "config", config cannot be nil.')
|
101
|
+
end
|
102
|
+
|
103
|
+
if @type.nil?
|
104
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
105
|
+
end
|
106
|
+
|
107
|
+
invalid_properties
|
108
|
+
end
|
109
|
+
|
110
|
+
# Check to see if the all the properties in the model are valid
|
111
|
+
# @return true if the model is valid
|
112
|
+
def valid?
|
113
|
+
return false if @config.nil?
|
114
|
+
return false if @type.nil?
|
115
|
+
type_validator = EnumAttributeValidator.new('String', ["snowflake"])
|
116
|
+
return false unless type_validator.valid?(@type)
|
117
|
+
true
|
118
|
+
end
|
119
|
+
|
120
|
+
# Custom attribute writer method checking allowed values (enum).
|
121
|
+
# @param [Object] type Object to be assigned
|
122
|
+
def type=(type)
|
123
|
+
validator = EnumAttributeValidator.new('String', ["snowflake"])
|
124
|
+
unless validator.valid?(type)
|
125
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
126
|
+
end
|
127
|
+
@type = type
|
128
|
+
end
|
129
|
+
|
130
|
+
# Checks equality by comparing each attribute.
|
131
|
+
# @param [Object] Object to be compared
|
132
|
+
def ==(o)
|
133
|
+
return true if self.equal?(o)
|
134
|
+
self.class == o.class &&
|
135
|
+
config == o.config &&
|
136
|
+
type == o.type
|
137
|
+
end
|
138
|
+
|
139
|
+
# @see the `==` method
|
140
|
+
# @param [Object] Object to be compared
|
141
|
+
def eql?(o)
|
142
|
+
self == o
|
143
|
+
end
|
144
|
+
|
145
|
+
# Calculates hash code according to all attributes.
|
146
|
+
# @return [Integer] Hash code
|
147
|
+
def hash
|
148
|
+
[config, type].hash
|
149
|
+
end
|
150
|
+
|
151
|
+
# Builds the object from hash
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
153
|
+
# @return [Object] Returns the model itself
|
154
|
+
def self.build_from_hash(attributes)
|
155
|
+
new.build_from_hash(attributes)
|
156
|
+
end
|
157
|
+
|
158
|
+
# Builds the object from hash
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
160
|
+
# @return [Object] Returns the model itself
|
161
|
+
def build_from_hash(attributes)
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
163
|
+
self.class.openapi_types.each_pair do |key, type|
|
164
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
165
|
+
self.send("#{key}=", nil)
|
166
|
+
elsif type =~ /\AArray<(.*)>/i
|
167
|
+
# check to ensure the input is an array given that the attribute
|
168
|
+
# is documented as an array but the input is not
|
169
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
170
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
171
|
+
end
|
172
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
173
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
self
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param string type Data type
|
182
|
+
# @param string value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def _deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :Time
|
187
|
+
Time.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :Boolean
|
197
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
# models (e.g. Pet) or oneOf
|
218
|
+
klass = Svix.const_get(type)
|
219
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the string representation of the object
|
224
|
+
# @return [String] String presentation of the object
|
225
|
+
def to_s
|
226
|
+
to_hash.to_s
|
227
|
+
end
|
228
|
+
|
229
|
+
# to_body is an alias to to_hash (backward compatibility)
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_body
|
232
|
+
to_hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the object in the form of hash
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
237
|
+
def to_hash
|
238
|
+
hash = {}
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
240
|
+
value = self.send(attr)
|
241
|
+
if value.nil?
|
242
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
243
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
244
|
+
end
|
245
|
+
|
246
|
+
hash[param] = _to_hash(value)
|
247
|
+
end
|
248
|
+
hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Outputs non-array value in the form of hash
|
252
|
+
# For object, use to_hash. Otherwise, just return the value
|
253
|
+
# @param [Object] value Any valid value
|
254
|
+
# @return [Hash] Returns the value in the form of hash
|
255
|
+
def _to_hash(value)
|
256
|
+
if value.is_a?(Array)
|
257
|
+
value.compact.map { |v| _to_hash(v) }
|
258
|
+
elsif value.is_a?(Hash)
|
259
|
+
{}.tap do |hash|
|
260
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
261
|
+
end
|
262
|
+
elsif value.respond_to? :to_hash
|
263
|
+
value.to_hash
|
264
|
+
else
|
265
|
+
value
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
data/lib/svix/version.rb
CHANGED
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.
|
4
|
+
version: 1.36.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-09-
|
11
|
+
date: 2024-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -251,6 +251,7 @@ files:
|
|
251
251
|
- lib/svix/models/sink_status_in.rb
|
252
252
|
- lib/svix/models/sink_transform_in.rb
|
253
253
|
- lib/svix/models/sink_transformation_out.rb
|
254
|
+
- lib/svix/models/snowflake_config.rb
|
254
255
|
- lib/svix/models/statistics_period.rb
|
255
256
|
- lib/svix/models/status_code_class.rb
|
256
257
|
- lib/svix/models/stream_in.rb
|
@@ -260,6 +261,7 @@ files:
|
|
260
261
|
- lib/svix/models/stream_sink_in_one_of.rb
|
261
262
|
- lib/svix/models/stream_sink_in_one_of1.rb
|
262
263
|
- lib/svix/models/stream_sink_in_one_of2.rb
|
264
|
+
- lib/svix/models/stream_sink_in_one_of3.rb
|
263
265
|
- lib/svix/models/stream_sink_out.rb
|
264
266
|
- lib/svix/models/stream_sink_patch.rb
|
265
267
|
- lib/svix/models/template_in.rb
|