svix 1.31.0 → 1.33.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/api/message_api.rb +1 -1
- data/lib/svix/api/message_attempt_api.rb +5 -5
- data/lib/svix/api/sink_api.rb +176 -0
- data/lib/svix/api/stream_api.rb +432 -0
- data/lib/svix/models/custom_strings_override.rb +229 -0
- data/lib/svix/models/endpoint_message_out.rb +5 -5
- data/lib/svix/models/environment_settings_out.rb +10 -1
- data/lib/svix/models/list_response_stream_sink_out.rb +259 -0
- data/lib/svix/models/message_broadcast_in.rb +5 -5
- data/lib/svix/models/message_in.rb +5 -5
- data/lib/svix/models/message_out.rb +5 -5
- data/lib/svix/models/s3_config.rb +265 -0
- data/lib/svix/models/settings_in.rb +10 -1
- data/lib/svix/models/settings_out.rb +10 -1
- data/lib/svix/models/sink_http_config.rb +223 -0
- data/lib/svix/models/sink_in.rb +2 -1
- data/lib/svix/models/sink_in_one_of4.rb +271 -0
- data/lib/svix/models/sink_otel_v1_config.rb +223 -0
- data/lib/svix/models/sink_out.rb +2 -1
- data/lib/svix/models/sink_payload_format.rb +36 -0
- data/lib/svix/models/sink_status.rb +38 -0
- data/lib/svix/models/sink_status_in.rb +37 -0
- data/lib/svix/models/stream_sink_in.rb +106 -0
- data/lib/svix/models/stream_sink_in_one_of.rb +271 -0
- data/lib/svix/models/stream_sink_in_one_of1.rb +271 -0
- data/lib/svix/models/stream_sink_in_one_of2.rb +271 -0
- data/lib/svix/models/stream_sink_out.rb +106 -0
- data/lib/svix/models/stream_sink_patch.rb +106 -0
- data/lib/svix/version.rb +1 -1
- metadata +19 -2
@@ -0,0 +1,229 @@
|
|
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 CustomStringsOverride
|
18
|
+
attr_accessor :channels_many
|
19
|
+
|
20
|
+
attr_accessor :channels_one
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'channels_many' => :'channelsMany',
|
26
|
+
:'channels_one' => :'channelsOne'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'channels_many' => :'String',
|
39
|
+
:'channels_one' => :'String'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
:'channels_many',
|
47
|
+
:'channels_one'
|
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::CustomStringsOverride` 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::CustomStringsOverride`. 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?(:'channels_many')
|
67
|
+
self.channels_many = attributes[:'channels_many']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'channels_one')
|
71
|
+
self.channels_one = attributes[:'channels_one']
|
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
|
+
invalid_properties
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
def valid?
|
85
|
+
true
|
86
|
+
end
|
87
|
+
|
88
|
+
# Checks equality by comparing each attribute.
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
channels_many == o.channels_many &&
|
94
|
+
channels_one == o.channels_one
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[channels_many, channels_one].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
new.build_from_hash(attributes)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def build_from_hash(attributes)
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
121
|
+
self.class.openapi_types.each_pair do |key, type|
|
122
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
123
|
+
self.send("#{key}=", nil)
|
124
|
+
elsif type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
129
|
+
end
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
138
|
+
# Deserializes the data based on type
|
139
|
+
# @param string type Data type
|
140
|
+
# @param string value Value to be deserialized
|
141
|
+
# @return [Object] Deserialized data
|
142
|
+
def _deserialize(type, value)
|
143
|
+
case type.to_sym
|
144
|
+
when :Time
|
145
|
+
Time.parse(value)
|
146
|
+
when :Date
|
147
|
+
Date.parse(value)
|
148
|
+
when :String
|
149
|
+
value.to_s
|
150
|
+
when :Integer
|
151
|
+
value.to_i
|
152
|
+
when :Float
|
153
|
+
value.to_f
|
154
|
+
when :Boolean
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
# models (e.g. Pet) or oneOf
|
176
|
+
klass = Svix.const_get(type)
|
177
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the string representation of the object
|
182
|
+
# @return [String] String presentation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_body
|
190
|
+
to_hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the object in the form of hash
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_hash
|
196
|
+
hash = {}
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
198
|
+
value = self.send(attr)
|
199
|
+
if value.nil?
|
200
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
201
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
202
|
+
end
|
203
|
+
|
204
|
+
hash[param] = _to_hash(value)
|
205
|
+
end
|
206
|
+
hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map { |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
@@ -143,8 +143,8 @@ module Svix
|
|
143
143
|
# @return Array for valid properties with the reasons
|
144
144
|
def list_invalid_properties
|
145
145
|
invalid_properties = Array.new
|
146
|
-
if !@channels.nil? && @channels.length >
|
147
|
-
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to
|
146
|
+
if !@channels.nil? && @channels.length > 10
|
147
|
+
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to 10.')
|
148
148
|
end
|
149
149
|
|
150
150
|
if !@channels.nil? && @channels.length < 1
|
@@ -199,7 +199,7 @@ module Svix
|
|
199
199
|
# Check to see if the all the properties in the model are valid
|
200
200
|
# @return true if the model is valid
|
201
201
|
def valid?
|
202
|
-
return false if !@channels.nil? && @channels.length >
|
202
|
+
return false if !@channels.nil? && @channels.length > 10
|
203
203
|
return false if !@channels.nil? && @channels.length < 1
|
204
204
|
return false if !@event_id.nil? && @event_id.to_s.length > 256
|
205
205
|
return false if !@event_id.nil? && @event_id.to_s.length < 1
|
@@ -217,8 +217,8 @@ module Svix
|
|
217
217
|
# Custom attribute writer method with validation
|
218
218
|
# @param [Object] channels Value to be assigned
|
219
219
|
def channels=(channels)
|
220
|
-
if !channels.nil? && channels.length >
|
221
|
-
fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to
|
220
|
+
if !channels.nil? && channels.length > 10
|
221
|
+
fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to 10.'
|
222
222
|
end
|
223
223
|
|
224
224
|
if !channels.nil? && channels.length < 1
|
@@ -27,6 +27,8 @@ module Svix
|
|
27
27
|
|
28
28
|
attr_accessor :custom_logo_url
|
29
29
|
|
30
|
+
attr_accessor :custom_strings_override
|
31
|
+
|
30
32
|
attr_accessor :custom_theme_override
|
31
33
|
|
32
34
|
attr_accessor :display_name
|
@@ -52,6 +54,7 @@ module Svix
|
|
52
54
|
:'custom_font_family' => :'customFontFamily',
|
53
55
|
:'custom_font_family_url' => :'customFontFamilyUrl',
|
54
56
|
:'custom_logo_url' => :'customLogoUrl',
|
57
|
+
:'custom_strings_override' => :'customStringsOverride',
|
55
58
|
:'custom_theme_override' => :'customThemeOverride',
|
56
59
|
:'display_name' => :'displayName',
|
57
60
|
:'enable_channels' => :'enableChannels',
|
@@ -77,6 +80,7 @@ module Svix
|
|
77
80
|
:'custom_font_family' => :'String',
|
78
81
|
:'custom_font_family_url' => :'String',
|
79
82
|
:'custom_logo_url' => :'String',
|
83
|
+
:'custom_strings_override' => :'CustomStringsOverride',
|
80
84
|
:'custom_theme_override' => :'CustomThemeOverride',
|
81
85
|
:'display_name' => :'String',
|
82
86
|
:'enable_channels' => :'Boolean',
|
@@ -138,6 +142,10 @@ module Svix
|
|
138
142
|
self.custom_logo_url = attributes[:'custom_logo_url']
|
139
143
|
end
|
140
144
|
|
145
|
+
if attributes.key?(:'custom_strings_override')
|
146
|
+
self.custom_strings_override = attributes[:'custom_strings_override']
|
147
|
+
end
|
148
|
+
|
141
149
|
if attributes.key?(:'custom_theme_override')
|
142
150
|
self.custom_theme_override = attributes[:'custom_theme_override']
|
143
151
|
end
|
@@ -272,6 +280,7 @@ module Svix
|
|
272
280
|
custom_font_family == o.custom_font_family &&
|
273
281
|
custom_font_family_url == o.custom_font_family_url &&
|
274
282
|
custom_logo_url == o.custom_logo_url &&
|
283
|
+
custom_strings_override == o.custom_strings_override &&
|
275
284
|
custom_theme_override == o.custom_theme_override &&
|
276
285
|
display_name == o.display_name &&
|
277
286
|
enable_channels == o.enable_channels &&
|
@@ -291,7 +300,7 @@ module Svix
|
|
291
300
|
# Calculates hash code according to all attributes.
|
292
301
|
# @return [Integer] Hash code
|
293
302
|
def hash
|
294
|
-
[color_palette_dark, color_palette_light, custom_color, custom_font_family, custom_font_family_url, custom_logo_url, custom_theme_override, display_name, enable_channels, enable_integration_management, enable_message_tags, enable_transformations, show_use_svix_play, wipe_successful_payload].hash
|
303
|
+
[color_palette_dark, color_palette_light, custom_color, custom_font_family, custom_font_family_url, custom_logo_url, custom_strings_override, custom_theme_override, display_name, enable_channels, enable_integration_management, enable_message_tags, enable_transformations, show_use_svix_play, wipe_successful_payload].hash
|
295
304
|
end
|
296
305
|
|
297
306
|
# Builds the object from hash
|
@@ -0,0 +1,259 @@
|
|
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 ListResponseStreamSinkOut
|
18
|
+
attr_accessor :data
|
19
|
+
|
20
|
+
attr_accessor :done
|
21
|
+
|
22
|
+
attr_accessor :iterator
|
23
|
+
|
24
|
+
attr_accessor :prev_iterator
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'data' => :'data',
|
30
|
+
:'done' => :'done',
|
31
|
+
:'iterator' => :'iterator',
|
32
|
+
:'prev_iterator' => :'prevIterator'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
41
|
+
# Attribute type mapping.
|
42
|
+
def self.openapi_types
|
43
|
+
{
|
44
|
+
:'data' => :'Array<StreamSinkOut>',
|
45
|
+
:'done' => :'Boolean',
|
46
|
+
:'iterator' => :'String',
|
47
|
+
:'prev_iterator' => :'String'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# List of attributes with nullable: true
|
52
|
+
def self.openapi_nullable
|
53
|
+
Set.new([
|
54
|
+
:'iterator',
|
55
|
+
:'prev_iterator'
|
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::ListResponseStreamSinkOut` 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::ListResponseStreamSinkOut`. 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?(:'data')
|
75
|
+
if (value = attributes[:'data']).is_a?(Array)
|
76
|
+
self.data = value
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'done')
|
81
|
+
self.done = attributes[:'done']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'iterator')
|
85
|
+
self.iterator = attributes[:'iterator']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'prev_iterator')
|
89
|
+
self.prev_iterator = attributes[:'prev_iterator']
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
94
|
+
# @return Array for valid properties with the reasons
|
95
|
+
def list_invalid_properties
|
96
|
+
invalid_properties = Array.new
|
97
|
+
if @data.nil?
|
98
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
99
|
+
end
|
100
|
+
|
101
|
+
if @done.nil?
|
102
|
+
invalid_properties.push('invalid value for "done", done cannot be nil.')
|
103
|
+
end
|
104
|
+
|
105
|
+
invalid_properties
|
106
|
+
end
|
107
|
+
|
108
|
+
# Check to see if the all the properties in the model are valid
|
109
|
+
# @return true if the model is valid
|
110
|
+
def valid?
|
111
|
+
return false if @data.nil?
|
112
|
+
return false if @done.nil?
|
113
|
+
true
|
114
|
+
end
|
115
|
+
|
116
|
+
# Checks equality by comparing each attribute.
|
117
|
+
# @param [Object] Object to be compared
|
118
|
+
def ==(o)
|
119
|
+
return true if self.equal?(o)
|
120
|
+
self.class == o.class &&
|
121
|
+
data == o.data &&
|
122
|
+
done == o.done &&
|
123
|
+
iterator == o.iterator &&
|
124
|
+
prev_iterator == o.prev_iterator
|
125
|
+
end
|
126
|
+
|
127
|
+
# @see the `==` method
|
128
|
+
# @param [Object] Object to be compared
|
129
|
+
def eql?(o)
|
130
|
+
self == o
|
131
|
+
end
|
132
|
+
|
133
|
+
# Calculates hash code according to all attributes.
|
134
|
+
# @return [Integer] Hash code
|
135
|
+
def hash
|
136
|
+
[data, done, iterator, prev_iterator].hash
|
137
|
+
end
|
138
|
+
|
139
|
+
# Builds the object from hash
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
141
|
+
# @return [Object] Returns the model itself
|
142
|
+
def self.build_from_hash(attributes)
|
143
|
+
new.build_from_hash(attributes)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Builds the object from hash
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
+
# @return [Object] Returns the model itself
|
149
|
+
def build_from_hash(attributes)
|
150
|
+
return nil unless attributes.is_a?(Hash)
|
151
|
+
self.class.openapi_types.each_pair do |key, type|
|
152
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
153
|
+
self.send("#{key}=", nil)
|
154
|
+
elsif type =~ /\AArray<(.*)>/i
|
155
|
+
# check to ensure the input is an array given that the attribute
|
156
|
+
# is documented as an array but the input is not
|
157
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
158
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
159
|
+
end
|
160
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
161
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
self
|
166
|
+
end
|
167
|
+
|
168
|
+
# Deserializes the data based on type
|
169
|
+
# @param string type Data type
|
170
|
+
# @param string value Value to be deserialized
|
171
|
+
# @return [Object] Deserialized data
|
172
|
+
def _deserialize(type, value)
|
173
|
+
case type.to_sym
|
174
|
+
when :Time
|
175
|
+
Time.parse(value)
|
176
|
+
when :Date
|
177
|
+
Date.parse(value)
|
178
|
+
when :String
|
179
|
+
value.to_s
|
180
|
+
when :Integer
|
181
|
+
value.to_i
|
182
|
+
when :Float
|
183
|
+
value.to_f
|
184
|
+
when :Boolean
|
185
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
186
|
+
true
|
187
|
+
else
|
188
|
+
false
|
189
|
+
end
|
190
|
+
when :Object
|
191
|
+
# generic object (usually a Hash), return directly
|
192
|
+
value
|
193
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
194
|
+
inner_type = Regexp.last_match[:inner_type]
|
195
|
+
value.map { |v| _deserialize(inner_type, v) }
|
196
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
197
|
+
k_type = Regexp.last_match[:k_type]
|
198
|
+
v_type = Regexp.last_match[:v_type]
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each do |k, v|
|
201
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
else # model
|
205
|
+
# models (e.g. Pet) or oneOf
|
206
|
+
klass = Svix.const_get(type)
|
207
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
# Returns the string representation of the object
|
212
|
+
# @return [String] String presentation of the object
|
213
|
+
def to_s
|
214
|
+
to_hash.to_s
|
215
|
+
end
|
216
|
+
|
217
|
+
# to_body is an alias to to_hash (backward compatibility)
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
219
|
+
def to_body
|
220
|
+
to_hash
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the object in the form of hash
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
225
|
+
def to_hash
|
226
|
+
hash = {}
|
227
|
+
self.class.attribute_map.each_pair do |attr, param|
|
228
|
+
value = self.send(attr)
|
229
|
+
if value.nil?
|
230
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
231
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
232
|
+
end
|
233
|
+
|
234
|
+
hash[param] = _to_hash(value)
|
235
|
+
end
|
236
|
+
hash
|
237
|
+
end
|
238
|
+
|
239
|
+
# Outputs non-array value in the form of hash
|
240
|
+
# For object, use to_hash. Otherwise, just return the value
|
241
|
+
# @param [Object] value Any valid value
|
242
|
+
# @return [Hash] Returns the value in the form of hash
|
243
|
+
def _to_hash(value)
|
244
|
+
if value.is_a?(Array)
|
245
|
+
value.compact.map { |v| _to_hash(v) }
|
246
|
+
elsif value.is_a?(Hash)
|
247
|
+
{}.tap do |hash|
|
248
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
249
|
+
end
|
250
|
+
elsif value.respond_to? :to_hash
|
251
|
+
value.to_hash
|
252
|
+
else
|
253
|
+
value
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|
258
|
+
|
259
|
+
end
|
@@ -119,8 +119,8 @@ module Svix
|
|
119
119
|
# @return Array for valid properties with the reasons
|
120
120
|
def list_invalid_properties
|
121
121
|
invalid_properties = Array.new
|
122
|
-
if !@channels.nil? && @channels.length >
|
123
|
-
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to
|
122
|
+
if !@channels.nil? && @channels.length > 10
|
123
|
+
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to 10.')
|
124
124
|
end
|
125
125
|
|
126
126
|
if !@channels.nil? && @channels.length < 1
|
@@ -179,7 +179,7 @@ module Svix
|
|
179
179
|
# Check to see if the all the properties in the model are valid
|
180
180
|
# @return true if the model is valid
|
181
181
|
def valid?
|
182
|
-
return false if !@channels.nil? && @channels.length >
|
182
|
+
return false if !@channels.nil? && @channels.length > 10
|
183
183
|
return false if !@channels.nil? && @channels.length < 1
|
184
184
|
return false if !@event_id.nil? && @event_id.to_s.length > 256
|
185
185
|
return false if !@event_id.nil? && @event_id.to_s.length < 1
|
@@ -198,8 +198,8 @@ module Svix
|
|
198
198
|
# Custom attribute writer method with validation
|
199
199
|
# @param [Object] channels Value to be assigned
|
200
200
|
def channels=(channels)
|
201
|
-
if !channels.nil? && channels.length >
|
202
|
-
fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to
|
201
|
+
if !channels.nil? && channels.length > 10
|
202
|
+
fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to 10.'
|
203
203
|
end
|
204
204
|
|
205
205
|
if !channels.nil? && channels.length < 1
|
@@ -150,8 +150,8 @@ module Svix
|
|
150
150
|
# @return Array for valid properties with the reasons
|
151
151
|
def list_invalid_properties
|
152
152
|
invalid_properties = Array.new
|
153
|
-
if !@channels.nil? && @channels.length >
|
154
|
-
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to
|
153
|
+
if !@channels.nil? && @channels.length > 10
|
154
|
+
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to 10.')
|
155
155
|
end
|
156
156
|
|
157
157
|
if !@channels.nil? && @channels.length < 1
|
@@ -218,7 +218,7 @@ module Svix
|
|
218
218
|
# Check to see if the all the properties in the model are valid
|
219
219
|
# @return true if the model is valid
|
220
220
|
def valid?
|
221
|
-
return false if !@channels.nil? && @channels.length >
|
221
|
+
return false if !@channels.nil? && @channels.length > 10
|
222
222
|
return false if !@channels.nil? && @channels.length < 1
|
223
223
|
return false if !@event_id.nil? && @event_id.to_s.length > 256
|
224
224
|
return false if !@event_id.nil? && @event_id.to_s.length < 1
|
@@ -239,8 +239,8 @@ module Svix
|
|
239
239
|
# Custom attribute writer method with validation
|
240
240
|
# @param [Object] channels Value to be assigned
|
241
241
|
def channels=(channels)
|
242
|
-
if !channels.nil? && channels.length >
|
243
|
-
fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to
|
242
|
+
if !channels.nil? && channels.length > 10
|
243
|
+
fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to 10.'
|
244
244
|
end
|
245
245
|
|
246
246
|
if !channels.nil? && channels.length < 1
|
@@ -125,8 +125,8 @@ module Svix
|
|
125
125
|
# @return Array for valid properties with the reasons
|
126
126
|
def list_invalid_properties
|
127
127
|
invalid_properties = Array.new
|
128
|
-
if !@channels.nil? && @channels.length >
|
129
|
-
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to
|
128
|
+
if !@channels.nil? && @channels.length > 10
|
129
|
+
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to 10.')
|
130
130
|
end
|
131
131
|
|
132
132
|
if !@channels.nil? && @channels.length < 1
|
@@ -177,7 +177,7 @@ module Svix
|
|
177
177
|
# Check to see if the all the properties in the model are valid
|
178
178
|
# @return true if the model is valid
|
179
179
|
def valid?
|
180
|
-
return false if !@channels.nil? && @channels.length >
|
180
|
+
return false if !@channels.nil? && @channels.length > 10
|
181
181
|
return false if !@channels.nil? && @channels.length < 1
|
182
182
|
return false if !@event_id.nil? && @event_id.to_s.length > 256
|
183
183
|
return false if !@event_id.nil? && @event_id.to_s.length < 1
|
@@ -194,8 +194,8 @@ module Svix
|
|
194
194
|
# Custom attribute writer method with validation
|
195
195
|
# @param [Object] channels Value to be assigned
|
196
196
|
def channels=(channels)
|
197
|
-
if !channels.nil? && channels.length >
|
198
|
-
fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to
|
197
|
+
if !channels.nil? && channels.length > 10
|
198
|
+
fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to 10.'
|
199
199
|
end
|
200
200
|
|
201
201
|
if !channels.nil? && channels.length < 1
|