svix 1.41.0 → 1.43.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/environment_api.rb +0 -57
- data/lib/svix/api/message_attempt_api.rb +134 -0
- data/lib/svix/message_api.rb +29 -0
- data/lib/svix/models/count_out.rb +258 -0
- data/lib/svix/models/environment_in.rb +12 -39
- data/lib/svix/models/environment_out.rb +7 -2
- data/lib/svix/version.rb +1 -1
- metadata +3 -4
- data/lib/svix/models/settings_in.rb +0 -465
- data/lib/svix/models/settings_out.rb +0 -465
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.43.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svix
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -125,6 +125,7 @@ files:
|
|
125
125
|
- lib/svix/models/client_secret_jwt_params_in.rb
|
126
126
|
- lib/svix/models/completion_choice.rb
|
127
127
|
- lib/svix/models/completion_message.rb
|
128
|
+
- lib/svix/models/count_out.rb
|
128
129
|
- lib/svix/models/create_message_token_in.rb
|
129
130
|
- lib/svix/models/create_stream_in.rb
|
130
131
|
- lib/svix/models/custom_color_palette.rb
|
@@ -247,8 +248,6 @@ files:
|
|
247
248
|
- lib/svix/models/retry_schedule_in_out.rb
|
248
249
|
- lib/svix/models/rotated_url_out.rb
|
249
250
|
- lib/svix/models/s3_config.rb
|
250
|
-
- lib/svix/models/settings_in.rb
|
251
|
-
- lib/svix/models/settings_out.rb
|
252
251
|
- lib/svix/models/sink_http_config.rb
|
253
252
|
- lib/svix/models/sink_in.rb
|
254
253
|
- lib/svix/models/sink_in_one_of.rb
|
@@ -1,465 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Svix API
|
3
|
-
|
4
|
-
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.1.1
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.9.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module Svix
|
17
|
-
class SettingsIn
|
18
|
-
attr_accessor :color_palette_dark
|
19
|
-
|
20
|
-
attr_accessor :color_palette_light
|
21
|
-
|
22
|
-
attr_accessor :custom_base_font_size
|
23
|
-
|
24
|
-
attr_accessor :custom_color
|
25
|
-
|
26
|
-
attr_accessor :custom_font_family
|
27
|
-
|
28
|
-
attr_accessor :custom_font_family_url
|
29
|
-
|
30
|
-
attr_accessor :custom_logo_url
|
31
|
-
|
32
|
-
attr_accessor :custom_strings_override
|
33
|
-
|
34
|
-
attr_accessor :custom_theme_override
|
35
|
-
|
36
|
-
attr_accessor :disable_endpoint_on_failure
|
37
|
-
|
38
|
-
attr_accessor :display_name
|
39
|
-
|
40
|
-
attr_accessor :enable_channels
|
41
|
-
|
42
|
-
attr_accessor :enable_integration_management
|
43
|
-
|
44
|
-
attr_accessor :enable_transformations
|
45
|
-
|
46
|
-
attr_accessor :enforce_https
|
47
|
-
|
48
|
-
attr_accessor :event_catalog_published
|
49
|
-
|
50
|
-
attr_accessor :read_only
|
51
|
-
|
52
|
-
attr_accessor :show_use_svix_play
|
53
|
-
|
54
|
-
attr_accessor :wipe_successful_payload
|
55
|
-
|
56
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
57
|
-
def self.attribute_map
|
58
|
-
{
|
59
|
-
:'color_palette_dark' => :'colorPaletteDark',
|
60
|
-
:'color_palette_light' => :'colorPaletteLight',
|
61
|
-
:'custom_base_font_size' => :'customBaseFontSize',
|
62
|
-
:'custom_color' => :'customColor',
|
63
|
-
:'custom_font_family' => :'customFontFamily',
|
64
|
-
:'custom_font_family_url' => :'customFontFamilyUrl',
|
65
|
-
:'custom_logo_url' => :'customLogoUrl',
|
66
|
-
:'custom_strings_override' => :'customStringsOverride',
|
67
|
-
:'custom_theme_override' => :'customThemeOverride',
|
68
|
-
:'disable_endpoint_on_failure' => :'disableEndpointOnFailure',
|
69
|
-
:'display_name' => :'displayName',
|
70
|
-
:'enable_channels' => :'enableChannels',
|
71
|
-
:'enable_integration_management' => :'enableIntegrationManagement',
|
72
|
-
:'enable_transformations' => :'enableTransformations',
|
73
|
-
:'enforce_https' => :'enforceHttps',
|
74
|
-
:'event_catalog_published' => :'eventCatalogPublished',
|
75
|
-
:'read_only' => :'readOnly',
|
76
|
-
:'show_use_svix_play' => :'showUseSvixPlay',
|
77
|
-
:'wipe_successful_payload' => :'wipeSuccessfulPayload'
|
78
|
-
}
|
79
|
-
end
|
80
|
-
|
81
|
-
# Returns all the JSON keys this model knows about
|
82
|
-
def self.acceptable_attributes
|
83
|
-
attribute_map.values
|
84
|
-
end
|
85
|
-
|
86
|
-
# Attribute type mapping.
|
87
|
-
def self.openapi_types
|
88
|
-
{
|
89
|
-
:'color_palette_dark' => :'CustomColorPalette',
|
90
|
-
:'color_palette_light' => :'CustomColorPalette',
|
91
|
-
:'custom_base_font_size' => :'Integer',
|
92
|
-
:'custom_color' => :'String',
|
93
|
-
:'custom_font_family' => :'String',
|
94
|
-
:'custom_font_family_url' => :'String',
|
95
|
-
:'custom_logo_url' => :'String',
|
96
|
-
:'custom_strings_override' => :'CustomStringsOverride',
|
97
|
-
:'custom_theme_override' => :'CustomThemeOverride',
|
98
|
-
:'disable_endpoint_on_failure' => :'Boolean',
|
99
|
-
:'display_name' => :'String',
|
100
|
-
:'enable_channels' => :'Boolean',
|
101
|
-
:'enable_integration_management' => :'Boolean',
|
102
|
-
:'enable_transformations' => :'Boolean',
|
103
|
-
:'enforce_https' => :'Boolean',
|
104
|
-
:'event_catalog_published' => :'Boolean',
|
105
|
-
:'read_only' => :'Boolean',
|
106
|
-
:'show_use_svix_play' => :'Boolean',
|
107
|
-
:'wipe_successful_payload' => :'Boolean'
|
108
|
-
}
|
109
|
-
end
|
110
|
-
|
111
|
-
# List of attributes with nullable: true
|
112
|
-
def self.openapi_nullable
|
113
|
-
Set.new([
|
114
|
-
:'custom_base_font_size',
|
115
|
-
:'custom_color',
|
116
|
-
:'custom_font_family',
|
117
|
-
:'custom_font_family_url',
|
118
|
-
:'custom_logo_url',
|
119
|
-
:'display_name',
|
120
|
-
])
|
121
|
-
end
|
122
|
-
|
123
|
-
# Initializes the object
|
124
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
-
def initialize(attributes = {})
|
126
|
-
if (!attributes.is_a?(Hash))
|
127
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::SettingsIn` initialize method"
|
128
|
-
end
|
129
|
-
|
130
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
131
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
132
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
133
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::SettingsIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
134
|
-
end
|
135
|
-
h[k.to_sym] = v
|
136
|
-
}
|
137
|
-
|
138
|
-
if attributes.key?(:'color_palette_dark')
|
139
|
-
self.color_palette_dark = attributes[:'color_palette_dark']
|
140
|
-
end
|
141
|
-
|
142
|
-
if attributes.key?(:'color_palette_light')
|
143
|
-
self.color_palette_light = attributes[:'color_palette_light']
|
144
|
-
end
|
145
|
-
|
146
|
-
if attributes.key?(:'custom_base_font_size')
|
147
|
-
self.custom_base_font_size = attributes[:'custom_base_font_size']
|
148
|
-
end
|
149
|
-
|
150
|
-
if attributes.key?(:'custom_color')
|
151
|
-
self.custom_color = attributes[:'custom_color']
|
152
|
-
end
|
153
|
-
|
154
|
-
if attributes.key?(:'custom_font_family')
|
155
|
-
self.custom_font_family = attributes[:'custom_font_family']
|
156
|
-
end
|
157
|
-
|
158
|
-
if attributes.key?(:'custom_font_family_url')
|
159
|
-
self.custom_font_family_url = attributes[:'custom_font_family_url']
|
160
|
-
end
|
161
|
-
|
162
|
-
if attributes.key?(:'custom_logo_url')
|
163
|
-
self.custom_logo_url = attributes[:'custom_logo_url']
|
164
|
-
end
|
165
|
-
|
166
|
-
if attributes.key?(:'custom_strings_override')
|
167
|
-
self.custom_strings_override = attributes[:'custom_strings_override']
|
168
|
-
end
|
169
|
-
|
170
|
-
if attributes.key?(:'custom_theme_override')
|
171
|
-
self.custom_theme_override = attributes[:'custom_theme_override']
|
172
|
-
end
|
173
|
-
|
174
|
-
if attributes.key?(:'disable_endpoint_on_failure')
|
175
|
-
self.disable_endpoint_on_failure = attributes[:'disable_endpoint_on_failure']
|
176
|
-
else
|
177
|
-
self.disable_endpoint_on_failure = true
|
178
|
-
end
|
179
|
-
|
180
|
-
if attributes.key?(:'display_name')
|
181
|
-
self.display_name = attributes[:'display_name']
|
182
|
-
end
|
183
|
-
|
184
|
-
if attributes.key?(:'enable_channels')
|
185
|
-
self.enable_channels = attributes[:'enable_channels']
|
186
|
-
else
|
187
|
-
self.enable_channels = false
|
188
|
-
end
|
189
|
-
|
190
|
-
if attributes.key?(:'enable_integration_management')
|
191
|
-
self.enable_integration_management = attributes[:'enable_integration_management']
|
192
|
-
else
|
193
|
-
self.enable_integration_management = false
|
194
|
-
end
|
195
|
-
|
196
|
-
if attributes.key?(:'enable_transformations')
|
197
|
-
self.enable_transformations = attributes[:'enable_transformations']
|
198
|
-
else
|
199
|
-
self.enable_transformations = false
|
200
|
-
end
|
201
|
-
|
202
|
-
if attributes.key?(:'enforce_https')
|
203
|
-
self.enforce_https = attributes[:'enforce_https']
|
204
|
-
else
|
205
|
-
self.enforce_https = true
|
206
|
-
end
|
207
|
-
|
208
|
-
if attributes.key?(:'event_catalog_published')
|
209
|
-
self.event_catalog_published = attributes[:'event_catalog_published']
|
210
|
-
else
|
211
|
-
self.event_catalog_published = false
|
212
|
-
end
|
213
|
-
|
214
|
-
if attributes.key?(:'read_only')
|
215
|
-
self.read_only = attributes[:'read_only']
|
216
|
-
else
|
217
|
-
self.read_only = false
|
218
|
-
end
|
219
|
-
|
220
|
-
if attributes.key?(:'show_use_svix_play')
|
221
|
-
self.show_use_svix_play = attributes[:'show_use_svix_play']
|
222
|
-
else
|
223
|
-
self.show_use_svix_play = true
|
224
|
-
end
|
225
|
-
|
226
|
-
if attributes.key?(:'wipe_successful_payload')
|
227
|
-
self.wipe_successful_payload = attributes[:'wipe_successful_payload']
|
228
|
-
else
|
229
|
-
self.wipe_successful_payload = false
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
234
|
-
# @return Array for valid properties with the reasons
|
235
|
-
def list_invalid_properties
|
236
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
237
|
-
invalid_properties = Array.new
|
238
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_ ]+$/)
|
239
|
-
if !@custom_font_family.nil? && @custom_font_family !~ pattern
|
240
|
-
invalid_properties.push("invalid value for \"custom_font_family\", must conform to the pattern #{pattern}.")
|
241
|
-
end
|
242
|
-
|
243
|
-
if !@custom_font_family_url.nil? && @custom_font_family_url.to_s.length > 65536
|
244
|
-
invalid_properties.push('invalid value for "custom_font_family_url", the character length must be smaller than or equal to 65536.')
|
245
|
-
end
|
246
|
-
|
247
|
-
if !@custom_font_family_url.nil? && @custom_font_family_url.to_s.length < 1
|
248
|
-
invalid_properties.push('invalid value for "custom_font_family_url", the character length must be great than or equal to 1.')
|
249
|
-
end
|
250
|
-
|
251
|
-
if !@custom_logo_url.nil? && @custom_logo_url.to_s.length > 65536
|
252
|
-
invalid_properties.push('invalid value for "custom_logo_url", the character length must be smaller than or equal to 65536.')
|
253
|
-
end
|
254
|
-
|
255
|
-
if !@custom_logo_url.nil? && @custom_logo_url.to_s.length < 1
|
256
|
-
invalid_properties.push('invalid value for "custom_logo_url", the character length must be great than or equal to 1.')
|
257
|
-
end
|
258
|
-
|
259
|
-
invalid_properties
|
260
|
-
end
|
261
|
-
|
262
|
-
# Check to see if the all the properties in the model are valid
|
263
|
-
# @return true if the model is valid
|
264
|
-
def valid?
|
265
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
266
|
-
return false if !@custom_font_family.nil? && @custom_font_family !~ Regexp.new(/^[a-zA-Z0-9\-_ ]+$/)
|
267
|
-
return false if !@custom_font_family_url.nil? && @custom_font_family_url.to_s.length > 65536
|
268
|
-
return false if !@custom_font_family_url.nil? && @custom_font_family_url.to_s.length < 1
|
269
|
-
return false if !@custom_logo_url.nil? && @custom_logo_url.to_s.length > 65536
|
270
|
-
return false if !@custom_logo_url.nil? && @custom_logo_url.to_s.length < 1
|
271
|
-
true
|
272
|
-
end
|
273
|
-
|
274
|
-
# Custom attribute writer method with validation
|
275
|
-
# @param [Object] custom_font_family Value to be assigned
|
276
|
-
def custom_font_family=(custom_font_family)
|
277
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_ ]+$/)
|
278
|
-
if !custom_font_family.nil? && custom_font_family !~ pattern
|
279
|
-
fail ArgumentError, "invalid value for \"custom_font_family\", must conform to the pattern #{pattern}."
|
280
|
-
end
|
281
|
-
|
282
|
-
@custom_font_family = custom_font_family
|
283
|
-
end
|
284
|
-
|
285
|
-
# Custom attribute writer method with validation
|
286
|
-
# @param [Object] custom_font_family_url Value to be assigned
|
287
|
-
def custom_font_family_url=(custom_font_family_url)
|
288
|
-
if !custom_font_family_url.nil? && custom_font_family_url.to_s.length > 65536
|
289
|
-
fail ArgumentError, 'invalid value for "custom_font_family_url", the character length must be smaller than or equal to 65536.'
|
290
|
-
end
|
291
|
-
|
292
|
-
if !custom_font_family_url.nil? && custom_font_family_url.to_s.length < 1
|
293
|
-
fail ArgumentError, 'invalid value for "custom_font_family_url", the character length must be great than or equal to 1.'
|
294
|
-
end
|
295
|
-
|
296
|
-
@custom_font_family_url = custom_font_family_url
|
297
|
-
end
|
298
|
-
|
299
|
-
# Custom attribute writer method with validation
|
300
|
-
# @param [Object] custom_logo_url Value to be assigned
|
301
|
-
def custom_logo_url=(custom_logo_url)
|
302
|
-
if !custom_logo_url.nil? && custom_logo_url.to_s.length > 65536
|
303
|
-
fail ArgumentError, 'invalid value for "custom_logo_url", the character length must be smaller than or equal to 65536.'
|
304
|
-
end
|
305
|
-
|
306
|
-
if !custom_logo_url.nil? && custom_logo_url.to_s.length < 1
|
307
|
-
fail ArgumentError, 'invalid value for "custom_logo_url", the character length must be great than or equal to 1.'
|
308
|
-
end
|
309
|
-
|
310
|
-
@custom_logo_url = custom_logo_url
|
311
|
-
end
|
312
|
-
|
313
|
-
# Checks equality by comparing each attribute.
|
314
|
-
# @param [Object] Object to be compared
|
315
|
-
def ==(o)
|
316
|
-
return true if self.equal?(o)
|
317
|
-
self.class == o.class &&
|
318
|
-
color_palette_dark == o.color_palette_dark &&
|
319
|
-
color_palette_light == o.color_palette_light &&
|
320
|
-
custom_base_font_size == o.custom_base_font_size &&
|
321
|
-
custom_color == o.custom_color &&
|
322
|
-
custom_font_family == o.custom_font_family &&
|
323
|
-
custom_font_family_url == o.custom_font_family_url &&
|
324
|
-
custom_logo_url == o.custom_logo_url &&
|
325
|
-
custom_strings_override == o.custom_strings_override &&
|
326
|
-
custom_theme_override == o.custom_theme_override &&
|
327
|
-
disable_endpoint_on_failure == o.disable_endpoint_on_failure &&
|
328
|
-
display_name == o.display_name &&
|
329
|
-
enable_channels == o.enable_channels &&
|
330
|
-
enable_integration_management == o.enable_integration_management &&
|
331
|
-
enable_transformations == o.enable_transformations &&
|
332
|
-
enforce_https == o.enforce_https &&
|
333
|
-
event_catalog_published == o.event_catalog_published &&
|
334
|
-
read_only == o.read_only &&
|
335
|
-
show_use_svix_play == o.show_use_svix_play &&
|
336
|
-
wipe_successful_payload == o.wipe_successful_payload
|
337
|
-
end
|
338
|
-
|
339
|
-
# @see the `==` method
|
340
|
-
# @param [Object] Object to be compared
|
341
|
-
def eql?(o)
|
342
|
-
self == o
|
343
|
-
end
|
344
|
-
|
345
|
-
# Calculates hash code according to all attributes.
|
346
|
-
# @return [Integer] Hash code
|
347
|
-
def hash
|
348
|
-
[color_palette_dark, color_palette_light, custom_base_font_size, custom_color, custom_font_family, custom_font_family_url, custom_logo_url, custom_strings_override, custom_theme_override, disable_endpoint_on_failure, display_name, enable_channels, enable_integration_management, enable_transformations, enforce_https, event_catalog_published, read_only, show_use_svix_play, wipe_successful_payload].hash
|
349
|
-
end
|
350
|
-
|
351
|
-
# Builds the object from hash
|
352
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
353
|
-
# @return [Object] Returns the model itself
|
354
|
-
def self.build_from_hash(attributes)
|
355
|
-
return nil unless attributes.is_a?(Hash)
|
356
|
-
attributes = attributes.transform_keys(&:to_sym)
|
357
|
-
transformed_hash = {}
|
358
|
-
openapi_types.each_pair do |key, type|
|
359
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
360
|
-
transformed_hash["#{key}"] = nil
|
361
|
-
elsif type =~ /\AArray<(.*)>/i
|
362
|
-
# check to ensure the input is an array given that the attribute
|
363
|
-
# is documented as an array but the input is not
|
364
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
365
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
366
|
-
end
|
367
|
-
elsif !attributes[attribute_map[key]].nil?
|
368
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
369
|
-
end
|
370
|
-
end
|
371
|
-
new(transformed_hash)
|
372
|
-
end
|
373
|
-
|
374
|
-
# Deserializes the data based on type
|
375
|
-
# @param string type Data type
|
376
|
-
# @param string value Value to be deserialized
|
377
|
-
# @return [Object] Deserialized data
|
378
|
-
def self._deserialize(type, value)
|
379
|
-
case type.to_sym
|
380
|
-
when :Time
|
381
|
-
Time.parse(value)
|
382
|
-
when :Date
|
383
|
-
Date.parse(value)
|
384
|
-
when :String
|
385
|
-
value.to_s
|
386
|
-
when :Integer
|
387
|
-
value.to_i
|
388
|
-
when :Float
|
389
|
-
value.to_f
|
390
|
-
when :Boolean
|
391
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
392
|
-
true
|
393
|
-
else
|
394
|
-
false
|
395
|
-
end
|
396
|
-
when :Object
|
397
|
-
# generic object (usually a Hash), return directly
|
398
|
-
value
|
399
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
400
|
-
inner_type = Regexp.last_match[:inner_type]
|
401
|
-
value.map { |v| _deserialize(inner_type, v) }
|
402
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
403
|
-
k_type = Regexp.last_match[:k_type]
|
404
|
-
v_type = Regexp.last_match[:v_type]
|
405
|
-
{}.tap do |hash|
|
406
|
-
value.each do |k, v|
|
407
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
408
|
-
end
|
409
|
-
end
|
410
|
-
else # model
|
411
|
-
# models (e.g. Pet) or oneOf
|
412
|
-
klass = Svix.const_get(type)
|
413
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
414
|
-
end
|
415
|
-
end
|
416
|
-
|
417
|
-
# Returns the string representation of the object
|
418
|
-
# @return [String] String presentation of the object
|
419
|
-
def to_s
|
420
|
-
to_hash.to_s
|
421
|
-
end
|
422
|
-
|
423
|
-
# to_body is an alias to to_hash (backward compatibility)
|
424
|
-
# @return [Hash] Returns the object in the form of hash
|
425
|
-
def to_body
|
426
|
-
to_hash
|
427
|
-
end
|
428
|
-
|
429
|
-
# Returns the object in the form of hash
|
430
|
-
# @return [Hash] Returns the object in the form of hash
|
431
|
-
def to_hash
|
432
|
-
hash = {}
|
433
|
-
self.class.attribute_map.each_pair do |attr, param|
|
434
|
-
value = self.send(attr)
|
435
|
-
if value.nil?
|
436
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
437
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
438
|
-
end
|
439
|
-
|
440
|
-
hash[param] = _to_hash(value)
|
441
|
-
end
|
442
|
-
hash
|
443
|
-
end
|
444
|
-
|
445
|
-
# Outputs non-array value in the form of hash
|
446
|
-
# For object, use to_hash. Otherwise, just return the value
|
447
|
-
# @param [Object] value Any valid value
|
448
|
-
# @return [Hash] Returns the value in the form of hash
|
449
|
-
def _to_hash(value)
|
450
|
-
if value.is_a?(Array)
|
451
|
-
value.compact.map { |v| _to_hash(v) }
|
452
|
-
elsif value.is_a?(Hash)
|
453
|
-
{}.tap do |hash|
|
454
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
455
|
-
end
|
456
|
-
elsif value.respond_to? :to_hash
|
457
|
-
value.to_hash
|
458
|
-
else
|
459
|
-
value
|
460
|
-
end
|
461
|
-
end
|
462
|
-
|
463
|
-
end
|
464
|
-
|
465
|
-
end
|