late-sdk 0.0.926 → 0.0.928

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.
@@ -0,0 +1,375 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ # Replacement assets for an existing Performance Max asset group, sent on PUT /v1/ads/{adId}. Google assets are immutable (AssetService only creates), so each field you send becomes new assets linked to the asset group, and the assets that role held are unlinked in the same atomic request. Send one field or many; a field you omit is left untouched. Re-sending a value the asset group already carries is a no-op for that asset, not a re-upload. Unlinked assets stay in the account's asset library: Google has no asset delete. At least one description must be 60 characters or fewer. Texts within each list must be distinct.
18
+ class GooglePmaxAssetGroupUpdate < ApiModelBase
19
+ # Replaces the asset group's final URL.
20
+ attr_accessor :final_url
21
+
22
+ # Replaces every HEADLINE asset on the group.
23
+ attr_accessor :headlines
24
+
25
+ # Replaces the LONG_HEADLINE asset.
26
+ attr_accessor :long_headline
27
+
28
+ # Replaces every DESCRIPTION asset. At least one must be 60 characters or fewer.
29
+ attr_accessor :descriptions
30
+
31
+ # Replaces the BUSINESS_NAME asset.
32
+ attr_accessor :business_name
33
+
34
+ attr_accessor :images
35
+
36
+ # Replaces YOUTUBE_VIDEO assets with existing YouTube video ids. Video uploads and arbitrary video URLs are not supported.
37
+ attr_accessor :youtube_video_ids
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'final_url' => :'finalUrl',
43
+ :'headlines' => :'headlines',
44
+ :'long_headline' => :'longHeadline',
45
+ :'descriptions' => :'descriptions',
46
+ :'business_name' => :'businessName',
47
+ :'images' => :'images',
48
+ :'youtube_video_ids' => :'youtubeVideoIds'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'final_url' => :'String',
66
+ :'headlines' => :'Array<String>',
67
+ :'long_headline' => :'String',
68
+ :'descriptions' => :'Array<String>',
69
+ :'business_name' => :'String',
70
+ :'images' => :'GooglePmaxAssetGroupUpdateImages',
71
+ :'youtube_video_ids' => :'Array<String>'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GooglePmaxAssetGroupUpdate` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ acceptable_attribute_map = self.class.acceptable_attribute_map
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!acceptable_attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GooglePmaxAssetGroupUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'final_url')
98
+ self.final_url = attributes[:'final_url']
99
+ end
100
+
101
+ if attributes.key?(:'headlines')
102
+ if (value = attributes[:'headlines']).is_a?(Array)
103
+ self.headlines = value
104
+ end
105
+ end
106
+
107
+ if attributes.key?(:'long_headline')
108
+ self.long_headline = attributes[:'long_headline']
109
+ end
110
+
111
+ if attributes.key?(:'descriptions')
112
+ if (value = attributes[:'descriptions']).is_a?(Array)
113
+ self.descriptions = value
114
+ end
115
+ end
116
+
117
+ if attributes.key?(:'business_name')
118
+ self.business_name = attributes[:'business_name']
119
+ end
120
+
121
+ if attributes.key?(:'images')
122
+ self.images = attributes[:'images']
123
+ end
124
+
125
+ if attributes.key?(:'youtube_video_ids')
126
+ if (value = attributes[:'youtube_video_ids']).is_a?(Array)
127
+ self.youtube_video_ids = value
128
+ end
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ pattern = Regexp.new(/^https?:\/\//)
138
+ if !@final_url.nil? && @final_url !~ pattern
139
+ invalid_properties.push("invalid value for \"final_url\", must conform to the pattern #{pattern}.")
140
+ end
141
+
142
+ if !@headlines.nil? && @headlines.length > 15
143
+ invalid_properties.push('invalid value for "headlines", number of items must be less than or equal to 15.')
144
+ end
145
+
146
+ if !@headlines.nil? && @headlines.length < 3
147
+ invalid_properties.push('invalid value for "headlines", number of items must be greater than or equal to 3.')
148
+ end
149
+
150
+ if !@long_headline.nil? && @long_headline.to_s.length > 90
151
+ invalid_properties.push('invalid value for "long_headline", the character length must be smaller than or equal to 90.')
152
+ end
153
+
154
+ if !@long_headline.nil? && @long_headline.to_s.length < 1
155
+ invalid_properties.push('invalid value for "long_headline", the character length must be greater than or equal to 1.')
156
+ end
157
+
158
+ if !@descriptions.nil? && @descriptions.length > 5
159
+ invalid_properties.push('invalid value for "descriptions", number of items must be less than or equal to 5.')
160
+ end
161
+
162
+ if !@descriptions.nil? && @descriptions.length < 2
163
+ invalid_properties.push('invalid value for "descriptions", number of items must be greater than or equal to 2.')
164
+ end
165
+
166
+ if !@business_name.nil? && @business_name.to_s.length > 25
167
+ invalid_properties.push('invalid value for "business_name", the character length must be smaller than or equal to 25.')
168
+ end
169
+
170
+ if !@business_name.nil? && @business_name.to_s.length < 1
171
+ invalid_properties.push('invalid value for "business_name", the character length must be greater than or equal to 1.')
172
+ end
173
+
174
+ if !@youtube_video_ids.nil? && @youtube_video_ids.length > 5
175
+ invalid_properties.push('invalid value for "youtube_video_ids", number of items must be less than or equal to 5.')
176
+ end
177
+
178
+ if !@youtube_video_ids.nil? && @youtube_video_ids.length < 1
179
+ invalid_properties.push('invalid value for "youtube_video_ids", number of items must be greater than or equal to 1.')
180
+ end
181
+
182
+ invalid_properties
183
+ end
184
+
185
+ # Check to see if the all the properties in the model are valid
186
+ # @return true if the model is valid
187
+ def valid?
188
+ warn '[DEPRECATED] the `valid?` method is obsolete'
189
+ return false if !@final_url.nil? && @final_url !~ Regexp.new(/^https?:\/\//)
190
+ return false if !@headlines.nil? && @headlines.length > 15
191
+ return false if !@headlines.nil? && @headlines.length < 3
192
+ return false if !@long_headline.nil? && @long_headline.to_s.length > 90
193
+ return false if !@long_headline.nil? && @long_headline.to_s.length < 1
194
+ return false if !@descriptions.nil? && @descriptions.length > 5
195
+ return false if !@descriptions.nil? && @descriptions.length < 2
196
+ return false if !@business_name.nil? && @business_name.to_s.length > 25
197
+ return false if !@business_name.nil? && @business_name.to_s.length < 1
198
+ return false if !@youtube_video_ids.nil? && @youtube_video_ids.length > 5
199
+ return false if !@youtube_video_ids.nil? && @youtube_video_ids.length < 1
200
+ true
201
+ end
202
+
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] final_url Value to be assigned
205
+ def final_url=(final_url)
206
+ if final_url.nil?
207
+ fail ArgumentError, 'final_url cannot be nil'
208
+ end
209
+
210
+ pattern = Regexp.new(/^https?:\/\//)
211
+ if final_url !~ pattern
212
+ fail ArgumentError, "invalid value for \"final_url\", must conform to the pattern #{pattern}."
213
+ end
214
+
215
+ @final_url = final_url
216
+ end
217
+
218
+ # Custom attribute writer method with validation
219
+ # @param [Object] headlines Value to be assigned
220
+ def headlines=(headlines)
221
+ if headlines.nil?
222
+ fail ArgumentError, 'headlines cannot be nil'
223
+ end
224
+
225
+ if headlines.length > 15
226
+ fail ArgumentError, 'invalid value for "headlines", number of items must be less than or equal to 15.'
227
+ end
228
+
229
+ if headlines.length < 3
230
+ fail ArgumentError, 'invalid value for "headlines", number of items must be greater than or equal to 3.'
231
+ end
232
+
233
+ @headlines = headlines
234
+ end
235
+
236
+ # Custom attribute writer method with validation
237
+ # @param [Object] long_headline Value to be assigned
238
+ def long_headline=(long_headline)
239
+ if long_headline.nil?
240
+ fail ArgumentError, 'long_headline cannot be nil'
241
+ end
242
+
243
+ if long_headline.to_s.length > 90
244
+ fail ArgumentError, 'invalid value for "long_headline", the character length must be smaller than or equal to 90.'
245
+ end
246
+
247
+ if long_headline.to_s.length < 1
248
+ fail ArgumentError, 'invalid value for "long_headline", the character length must be greater than or equal to 1.'
249
+ end
250
+
251
+ @long_headline = long_headline
252
+ end
253
+
254
+ # Custom attribute writer method with validation
255
+ # @param [Object] descriptions Value to be assigned
256
+ def descriptions=(descriptions)
257
+ if descriptions.nil?
258
+ fail ArgumentError, 'descriptions cannot be nil'
259
+ end
260
+
261
+ if descriptions.length > 5
262
+ fail ArgumentError, 'invalid value for "descriptions", number of items must be less than or equal to 5.'
263
+ end
264
+
265
+ if descriptions.length < 2
266
+ fail ArgumentError, 'invalid value for "descriptions", number of items must be greater than or equal to 2.'
267
+ end
268
+
269
+ @descriptions = descriptions
270
+ end
271
+
272
+ # Custom attribute writer method with validation
273
+ # @param [Object] business_name Value to be assigned
274
+ def business_name=(business_name)
275
+ if business_name.nil?
276
+ fail ArgumentError, 'business_name cannot be nil'
277
+ end
278
+
279
+ if business_name.to_s.length > 25
280
+ fail ArgumentError, 'invalid value for "business_name", the character length must be smaller than or equal to 25.'
281
+ end
282
+
283
+ if business_name.to_s.length < 1
284
+ fail ArgumentError, 'invalid value for "business_name", the character length must be greater than or equal to 1.'
285
+ end
286
+
287
+ @business_name = business_name
288
+ end
289
+
290
+ # Custom attribute writer method with validation
291
+ # @param [Object] youtube_video_ids Value to be assigned
292
+ def youtube_video_ids=(youtube_video_ids)
293
+ if youtube_video_ids.nil?
294
+ fail ArgumentError, 'youtube_video_ids cannot be nil'
295
+ end
296
+
297
+ if youtube_video_ids.length > 5
298
+ fail ArgumentError, 'invalid value for "youtube_video_ids", number of items must be less than or equal to 5.'
299
+ end
300
+
301
+ if youtube_video_ids.length < 1
302
+ fail ArgumentError, 'invalid value for "youtube_video_ids", number of items must be greater than or equal to 1.'
303
+ end
304
+
305
+ @youtube_video_ids = youtube_video_ids
306
+ end
307
+
308
+ # Checks equality by comparing each attribute.
309
+ # @param [Object] Object to be compared
310
+ def ==(o)
311
+ return true if self.equal?(o)
312
+ self.class == o.class &&
313
+ final_url == o.final_url &&
314
+ headlines == o.headlines &&
315
+ long_headline == o.long_headline &&
316
+ descriptions == o.descriptions &&
317
+ business_name == o.business_name &&
318
+ images == o.images &&
319
+ youtube_video_ids == o.youtube_video_ids
320
+ end
321
+
322
+ # @see the `==` method
323
+ # @param [Object] Object to be compared
324
+ def eql?(o)
325
+ self == o
326
+ end
327
+
328
+ # Calculates hash code according to all attributes.
329
+ # @return [Integer] Hash code
330
+ def hash
331
+ [final_url, headlines, long_headline, descriptions, business_name, images, youtube_video_ids].hash
332
+ end
333
+
334
+ # Builds the object from hash
335
+ # @param [Hash] attributes Model attributes in the form of hash
336
+ # @return [Object] Returns the model itself
337
+ def self.build_from_hash(attributes)
338
+ return nil unless attributes.is_a?(Hash)
339
+ attributes = attributes.transform_keys(&:to_sym)
340
+ transformed_hash = {}
341
+ openapi_types.each_pair do |key, type|
342
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
343
+ transformed_hash["#{key}"] = nil
344
+ elsif type =~ /\AArray<(.*)>/i
345
+ # check to ensure the input is an array given that the attribute
346
+ # is documented as an array but the input is not
347
+ if attributes[attribute_map[key]].is_a?(Array)
348
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
349
+ end
350
+ elsif !attributes[attribute_map[key]].nil?
351
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
352
+ end
353
+ end
354
+ new(transformed_hash)
355
+ end
356
+
357
+ # Returns the object in the form of hash
358
+ # @return [Hash] Returns the object in the form of hash
359
+ def to_hash
360
+ hash = {}
361
+ self.class.attribute_map.each_pair do |attr, param|
362
+ value = self.send(attr)
363
+ if value.nil?
364
+ is_nullable = self.class.openapi_nullable.include?(attr)
365
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
366
+ end
367
+
368
+ hash[param] = _to_hash(value)
369
+ end
370
+ hash
371
+ end
372
+
373
+ end
374
+
375
+ end
@@ -0,0 +1,259 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ # Public HTTP(S) image URLs. Each role you send replaces that role's images; roles you omit stay. GIF, JPEG or PNG, at most 5120 KB per image.
18
+ class GooglePmaxAssetGroupUpdateImages < ApiModelBase
19
+ # Replaces MARKETING_IMAGE assets. Aspect ratio 1.91:1, minimum 600 x 314 pixels.
20
+ attr_accessor :landscape
21
+
22
+ # Replaces SQUARE_MARKETING_IMAGE assets. Aspect ratio 1:1, minimum 300 x 300 pixels.
23
+ attr_accessor :square
24
+
25
+ # Replaces LOGO assets. Aspect ratio 1:1, minimum 128 x 128 pixels.
26
+ attr_accessor :logo
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'landscape' => :'landscape',
32
+ :'square' => :'square',
33
+ :'logo' => :'logo'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'landscape' => :'Array<String>',
51
+ :'square' => :'Array<String>',
52
+ :'logo' => :'Array<String>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GooglePmaxAssetGroupUpdateImages` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GooglePmaxAssetGroupUpdateImages`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'landscape')
79
+ if (value = attributes[:'landscape']).is_a?(Array)
80
+ self.landscape = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'square')
85
+ if (value = attributes[:'square']).is_a?(Array)
86
+ self.square = value
87
+ end
88
+ end
89
+
90
+ if attributes.key?(:'logo')
91
+ if (value = attributes[:'logo']).is_a?(Array)
92
+ self.logo = value
93
+ end
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ if !@landscape.nil? && @landscape.length > 20
103
+ invalid_properties.push('invalid value for "landscape", number of items must be less than or equal to 20.')
104
+ end
105
+
106
+ if !@landscape.nil? && @landscape.length < 1
107
+ invalid_properties.push('invalid value for "landscape", number of items must be greater than or equal to 1.')
108
+ end
109
+
110
+ if !@square.nil? && @square.length > 20
111
+ invalid_properties.push('invalid value for "square", number of items must be less than or equal to 20.')
112
+ end
113
+
114
+ if !@square.nil? && @square.length < 1
115
+ invalid_properties.push('invalid value for "square", number of items must be greater than or equal to 1.')
116
+ end
117
+
118
+ if !@logo.nil? && @logo.length > 5
119
+ invalid_properties.push('invalid value for "logo", number of items must be less than or equal to 5.')
120
+ end
121
+
122
+ if !@logo.nil? && @logo.length < 1
123
+ invalid_properties.push('invalid value for "logo", number of items must be greater than or equal to 1.')
124
+ end
125
+
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ return false if !@landscape.nil? && @landscape.length > 20
134
+ return false if !@landscape.nil? && @landscape.length < 1
135
+ return false if !@square.nil? && @square.length > 20
136
+ return false if !@square.nil? && @square.length < 1
137
+ return false if !@logo.nil? && @logo.length > 5
138
+ return false if !@logo.nil? && @logo.length < 1
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] landscape Value to be assigned
144
+ def landscape=(landscape)
145
+ if landscape.nil?
146
+ fail ArgumentError, 'landscape cannot be nil'
147
+ end
148
+
149
+ if landscape.length > 20
150
+ fail ArgumentError, 'invalid value for "landscape", number of items must be less than or equal to 20.'
151
+ end
152
+
153
+ if landscape.length < 1
154
+ fail ArgumentError, 'invalid value for "landscape", number of items must be greater than or equal to 1.'
155
+ end
156
+
157
+ @landscape = landscape
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] square Value to be assigned
162
+ def square=(square)
163
+ if square.nil?
164
+ fail ArgumentError, 'square cannot be nil'
165
+ end
166
+
167
+ if square.length > 20
168
+ fail ArgumentError, 'invalid value for "square", number of items must be less than or equal to 20.'
169
+ end
170
+
171
+ if square.length < 1
172
+ fail ArgumentError, 'invalid value for "square", number of items must be greater than or equal to 1.'
173
+ end
174
+
175
+ @square = square
176
+ end
177
+
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] logo Value to be assigned
180
+ def logo=(logo)
181
+ if logo.nil?
182
+ fail ArgumentError, 'logo cannot be nil'
183
+ end
184
+
185
+ if logo.length > 5
186
+ fail ArgumentError, 'invalid value for "logo", number of items must be less than or equal to 5.'
187
+ end
188
+
189
+ if logo.length < 1
190
+ fail ArgumentError, 'invalid value for "logo", number of items must be greater than or equal to 1.'
191
+ end
192
+
193
+ @logo = logo
194
+ end
195
+
196
+ # Checks equality by comparing each attribute.
197
+ # @param [Object] Object to be compared
198
+ def ==(o)
199
+ return true if self.equal?(o)
200
+ self.class == o.class &&
201
+ landscape == o.landscape &&
202
+ square == o.square &&
203
+ logo == o.logo
204
+ end
205
+
206
+ # @see the `==` method
207
+ # @param [Object] Object to be compared
208
+ def eql?(o)
209
+ self == o
210
+ end
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Integer] Hash code
214
+ def hash
215
+ [landscape, square, logo].hash
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def self.build_from_hash(attributes)
222
+ return nil unless attributes.is_a?(Hash)
223
+ attributes = attributes.transform_keys(&:to_sym)
224
+ transformed_hash = {}
225
+ openapi_types.each_pair do |key, type|
226
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = nil
228
+ elsif type =~ /\AArray<(.*)>/i
229
+ # check to ensure the input is an array given that the attribute
230
+ # is documented as an array but the input is not
231
+ if attributes[attribute_map[key]].is_a?(Array)
232
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
233
+ end
234
+ elsif !attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
236
+ end
237
+ end
238
+ new(transformed_hash)
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ end
258
+
259
+ end