growwer 1.0.2 → 1.1.1
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/README.md +10 -5
- data/docs/CatalogueApi.md +6 -6
- data/docs/CreateSellerMediaRequest.md +38 -0
- data/docs/CreateSellerMediaRequestPostOffer.md +24 -0
- data/docs/GetMe200ResponseCatalogue.md +1 -1
- data/docs/LinkAdditionOrderBriefingRequest.md +1 -1
- data/docs/ManagedServicesApi.md +3 -3
- data/docs/ProjectCatalogueMediaAllOfProject.md +3 -1
- data/docs/ProjectCatalogueMediaAllOfProjectAiKeywords.md +20 -0
- data/docs/SavedFiltersApi.md +1 -1
- data/docs/SellerMedia.md +2 -0
- data/docs/SellerMediaPostOffer.md +7 -1
- data/docs/SellerMediasApi.md +148 -5
- data/docs/SellerOrderPostDelivery.md +1 -1
- data/docs/SellerOrdersApi.md +1 -1
- data/docs/UpdateSellerMediaRequest.md +2 -0
- data/docs/UpdateSellerMediaRequestPostOffer.md +8 -2
- data/lib/growwer/api/catalogue_api.rb +8 -8
- data/lib/growwer/api/managed_services_api.rb +6 -6
- data/lib/growwer/api/saved_filters_api.rb +2 -2
- data/lib/growwer/api/seller_medias_api.rb +157 -4
- data/lib/growwer/api/seller_orders_api.rb +2 -2
- data/lib/growwer/api_client.rb +1 -1
- data/lib/growwer/models/create_seller_media_request.rb +447 -0
- data/lib/growwer/models/create_seller_media_request_post_offer.rb +273 -0
- data/lib/growwer/models/get_me200_response_catalogue.rb +1 -1
- data/lib/growwer/models/link_addition_order_briefing_request.rb +1 -1
- data/lib/growwer/models/project_catalogue_media_all_of_project.rb +34 -5
- data/lib/growwer/models/project_catalogue_media_all_of_project_ai_keywords.rb +211 -0
- data/lib/growwer/models/seller_media.rb +29 -1
- data/lib/growwer/models/seller_media_post_offer.rb +99 -1
- data/lib/growwer/models/seller_order_post_delivery.rb +1 -1
- data/lib/growwer/models/update_seller_media_request.rb +44 -1
- data/lib/growwer/models/update_seller_media_request_post_offer.rb +96 -12
- data/lib/growwer/version.rb +1 -1
- data/lib/growwer.rb +3 -0
- data/spec/models/create_seller_media_request_post_offer_spec.rb +62 -0
- data/spec/models/create_seller_media_request_spec.rb +100 -0
- data/spec/models/project_catalogue_media_all_of_project_ai_keywords_spec.rb +46 -0
- metadata +14 -2
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Growwer API
|
|
3
|
+
|
|
4
|
+
#The Growwer customer API. Authenticate every call with an API key created on your profile page, sent as `Authorization: Bearer <key>`. A read key can call every GET operation; writes need a read and write key and an `Idempotency-Key` header. Idempotency: use a new `Idempotency-Key` (1 to 255 printable ASCII characters without spaces) for each operation and reuse it only to retry that same operation. Keys belong to your account, not to one API key. - A successful write is stored for 30 days: a retry with the same key and the same request replays its response with `Idempotent-Replayed: true` and does nothing again. - A refused write (4xx) has no effect and releases its key: once you fix the cause, retry with the same key and the write runs. - A failed write (5xx) may have taken effect, so it is never run again under its key: a retry gets 409 `idempotency_outcome_unknown`. Check whether it took effect before retrying with a new key. - A retry while the first request is still running gets 409 `idempotency_request_in_progress`. A request still running after 5 minutes is treated as failed: a retry gets 409 `idempotency_outcome_unknown`. - The same key with a different request (method, path, query or body) gets 409 `idempotency_key_reused`. A write without the header gets 400 `idempotency_key_required`. Every response carries `X-Request-Id`. Errors share one shape, `{code, message, requestId, details?}`. Money is integer cents plus a currency code and dates are ISO-8601.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1
|
|
7
|
+
Contact: support@growwer.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Growwer
|
|
17
|
+
class CreateSellerMediaRequest < ApiModelBase
|
|
18
|
+
attr_accessor :root_url
|
|
19
|
+
|
|
20
|
+
attr_accessor :typology
|
|
21
|
+
|
|
22
|
+
# A country code from GET /vocabulary.
|
|
23
|
+
attr_accessor :country
|
|
24
|
+
|
|
25
|
+
# A language code from GET /vocabulary.
|
|
26
|
+
attr_accessor :language
|
|
27
|
+
|
|
28
|
+
# Topic ids from GET /vocabulary.
|
|
29
|
+
attr_accessor :topics
|
|
30
|
+
|
|
31
|
+
# The topic ids from GET /vocabulary the media refuses.
|
|
32
|
+
attr_accessor :banned_topics
|
|
33
|
+
|
|
34
|
+
attr_accessor :post_offer
|
|
35
|
+
|
|
36
|
+
attr_accessor :link_addition_offer
|
|
37
|
+
|
|
38
|
+
attr_accessor :extra_services
|
|
39
|
+
|
|
40
|
+
# Must be true: you accept the media publishing terms.
|
|
41
|
+
attr_accessor :accept_media_publishing_terms
|
|
42
|
+
|
|
43
|
+
# Must be true: you own or manage this media.
|
|
44
|
+
attr_accessor :declare_media_ownership
|
|
45
|
+
|
|
46
|
+
class EnumAttributeValidator
|
|
47
|
+
attr_reader :datatype
|
|
48
|
+
attr_reader :allowable_values
|
|
49
|
+
|
|
50
|
+
def initialize(datatype, allowable_values)
|
|
51
|
+
@allowable_values = allowable_values.map do |value|
|
|
52
|
+
case datatype.to_s
|
|
53
|
+
when /Integer/i
|
|
54
|
+
value.to_i
|
|
55
|
+
when /Float/i
|
|
56
|
+
value.to_f
|
|
57
|
+
else
|
|
58
|
+
value
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def valid?(value)
|
|
64
|
+
!value || allowable_values.include?(value)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
69
|
+
def self.attribute_map
|
|
70
|
+
{
|
|
71
|
+
:'root_url' => :'rootUrl',
|
|
72
|
+
:'typology' => :'typology',
|
|
73
|
+
:'country' => :'country',
|
|
74
|
+
:'language' => :'language',
|
|
75
|
+
:'topics' => :'topics',
|
|
76
|
+
:'banned_topics' => :'bannedTopics',
|
|
77
|
+
:'post_offer' => :'postOffer',
|
|
78
|
+
:'link_addition_offer' => :'linkAdditionOffer',
|
|
79
|
+
:'extra_services' => :'extraServices',
|
|
80
|
+
:'accept_media_publishing_terms' => :'acceptMediaPublishingTerms',
|
|
81
|
+
:'declare_media_ownership' => :'declareMediaOwnership'
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Returns attribute mapping this model knows about
|
|
86
|
+
def self.acceptable_attribute_map
|
|
87
|
+
attribute_map
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Returns all the JSON keys this model knows about
|
|
91
|
+
def self.acceptable_attributes
|
|
92
|
+
acceptable_attribute_map.values
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Attribute type mapping.
|
|
96
|
+
def self.openapi_types
|
|
97
|
+
{
|
|
98
|
+
:'root_url' => :'String',
|
|
99
|
+
:'typology' => :'String',
|
|
100
|
+
:'country' => :'String',
|
|
101
|
+
:'language' => :'String',
|
|
102
|
+
:'topics' => :'Array<Integer>',
|
|
103
|
+
:'banned_topics' => :'Array<Integer>',
|
|
104
|
+
:'post_offer' => :'CreateSellerMediaRequestPostOffer',
|
|
105
|
+
:'link_addition_offer' => :'UpdateSellerMediaRequestLinkAdditionOffer',
|
|
106
|
+
:'extra_services' => :'Array<UpdateSellerMediaRequestExtraServicesInner>',
|
|
107
|
+
:'accept_media_publishing_terms' => :'Boolean',
|
|
108
|
+
:'declare_media_ownership' => :'Boolean'
|
|
109
|
+
}
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# List of attributes with nullable: true
|
|
113
|
+
def self.openapi_nullable
|
|
114
|
+
Set.new([
|
|
115
|
+
:'link_addition_offer',
|
|
116
|
+
])
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Initializes the object
|
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
121
|
+
def initialize(attributes = {})
|
|
122
|
+
if (!attributes.is_a?(Hash))
|
|
123
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Growwer::CreateSellerMediaRequest` initialize method"
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
127
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
128
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
129
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
130
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Growwer::CreateSellerMediaRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
131
|
+
end
|
|
132
|
+
h[k.to_sym] = v
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'root_url')
|
|
136
|
+
self.root_url = attributes[:'root_url']
|
|
137
|
+
else
|
|
138
|
+
self.root_url = nil
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'typology')
|
|
142
|
+
self.typology = attributes[:'typology']
|
|
143
|
+
else
|
|
144
|
+
self.typology = nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'country')
|
|
148
|
+
self.country = attributes[:'country']
|
|
149
|
+
else
|
|
150
|
+
self.country = nil
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'language')
|
|
154
|
+
self.language = attributes[:'language']
|
|
155
|
+
else
|
|
156
|
+
self.language = nil
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'topics')
|
|
160
|
+
if (value = attributes[:'topics']).is_a?(Array)
|
|
161
|
+
self.topics = value
|
|
162
|
+
end
|
|
163
|
+
else
|
|
164
|
+
self.topics = nil
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'banned_topics')
|
|
168
|
+
if (value = attributes[:'banned_topics']).is_a?(Array)
|
|
169
|
+
self.banned_topics = value
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'post_offer')
|
|
174
|
+
self.post_offer = attributes[:'post_offer']
|
|
175
|
+
else
|
|
176
|
+
self.post_offer = nil
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'link_addition_offer')
|
|
180
|
+
self.link_addition_offer = attributes[:'link_addition_offer']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'extra_services')
|
|
184
|
+
if (value = attributes[:'extra_services']).is_a?(Array)
|
|
185
|
+
self.extra_services = value
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'accept_media_publishing_terms')
|
|
190
|
+
self.accept_media_publishing_terms = attributes[:'accept_media_publishing_terms']
|
|
191
|
+
else
|
|
192
|
+
self.accept_media_publishing_terms = nil
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'declare_media_ownership')
|
|
196
|
+
self.declare_media_ownership = attributes[:'declare_media_ownership']
|
|
197
|
+
else
|
|
198
|
+
self.declare_media_ownership = nil
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
203
|
+
# @return Array for valid properties with the reasons
|
|
204
|
+
def list_invalid_properties
|
|
205
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
206
|
+
invalid_properties = Array.new
|
|
207
|
+
if @root_url.nil?
|
|
208
|
+
invalid_properties.push('invalid value for "root_url", root_url cannot be nil.')
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if @typology.nil?
|
|
212
|
+
invalid_properties.push('invalid value for "typology", typology cannot be nil.')
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if @country.nil?
|
|
216
|
+
invalid_properties.push('invalid value for "country", country cannot be nil.')
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if @language.nil?
|
|
220
|
+
invalid_properties.push('invalid value for "language", language cannot be nil.')
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
if @topics.nil?
|
|
224
|
+
invalid_properties.push('invalid value for "topics", topics cannot be nil.')
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
if @topics.length > 100
|
|
228
|
+
invalid_properties.push('invalid value for "topics", number of items must be less than or equal to 100.')
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
if @topics.length < 1
|
|
232
|
+
invalid_properties.push('invalid value for "topics", number of items must be greater than or equal to 1.')
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if !@banned_topics.nil? && @banned_topics.length > 100
|
|
236
|
+
invalid_properties.push('invalid value for "banned_topics", number of items must be less than or equal to 100.')
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if @post_offer.nil?
|
|
240
|
+
invalid_properties.push('invalid value for "post_offer", post_offer cannot be nil.')
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
if @accept_media_publishing_terms.nil?
|
|
244
|
+
invalid_properties.push('invalid value for "accept_media_publishing_terms", accept_media_publishing_terms cannot be nil.')
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
if @declare_media_ownership.nil?
|
|
248
|
+
invalid_properties.push('invalid value for "declare_media_ownership", declare_media_ownership cannot be nil.')
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
invalid_properties
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Check to see if the all the properties in the model are valid
|
|
255
|
+
# @return true if the model is valid
|
|
256
|
+
def valid?
|
|
257
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
258
|
+
return false if @root_url.nil?
|
|
259
|
+
return false if @typology.nil?
|
|
260
|
+
typology_validator = EnumAttributeValidator.new('String', ["blog", "press"])
|
|
261
|
+
return false unless typology_validator.valid?(@typology)
|
|
262
|
+
return false if @country.nil?
|
|
263
|
+
return false if @language.nil?
|
|
264
|
+
return false if @topics.nil?
|
|
265
|
+
return false if @topics.length > 100
|
|
266
|
+
return false if @topics.length < 1
|
|
267
|
+
return false if !@banned_topics.nil? && @banned_topics.length > 100
|
|
268
|
+
return false if @post_offer.nil?
|
|
269
|
+
return false if @accept_media_publishing_terms.nil?
|
|
270
|
+
return false if @declare_media_ownership.nil?
|
|
271
|
+
true
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Custom attribute writer method with validation
|
|
275
|
+
# @param [Object] root_url Value to be assigned
|
|
276
|
+
def root_url=(root_url)
|
|
277
|
+
if root_url.nil?
|
|
278
|
+
fail ArgumentError, 'root_url cannot be nil'
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
@root_url = root_url
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
285
|
+
# @param [Object] typology Object to be assigned
|
|
286
|
+
def typology=(typology)
|
|
287
|
+
validator = EnumAttributeValidator.new('String', ["blog", "press"])
|
|
288
|
+
unless validator.valid?(typology)
|
|
289
|
+
fail ArgumentError, "invalid value for \"typology\", must be one of #{validator.allowable_values}."
|
|
290
|
+
end
|
|
291
|
+
@typology = typology
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Custom attribute writer method with validation
|
|
295
|
+
# @param [Object] country Value to be assigned
|
|
296
|
+
def country=(country)
|
|
297
|
+
if country.nil?
|
|
298
|
+
fail ArgumentError, 'country cannot be nil'
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
@country = country
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Custom attribute writer method with validation
|
|
305
|
+
# @param [Object] language Value to be assigned
|
|
306
|
+
def language=(language)
|
|
307
|
+
if language.nil?
|
|
308
|
+
fail ArgumentError, 'language cannot be nil'
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
@language = language
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
# Custom attribute writer method with validation
|
|
315
|
+
# @param [Object] topics Value to be assigned
|
|
316
|
+
def topics=(topics)
|
|
317
|
+
if topics.nil?
|
|
318
|
+
fail ArgumentError, 'topics cannot be nil'
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
if topics.length > 100
|
|
322
|
+
fail ArgumentError, 'invalid value for "topics", number of items must be less than or equal to 100.'
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
if topics.length < 1
|
|
326
|
+
fail ArgumentError, 'invalid value for "topics", number of items must be greater than or equal to 1.'
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
@topics = topics
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Custom attribute writer method with validation
|
|
333
|
+
# @param [Object] banned_topics Value to be assigned
|
|
334
|
+
def banned_topics=(banned_topics)
|
|
335
|
+
if banned_topics.nil?
|
|
336
|
+
fail ArgumentError, 'banned_topics cannot be nil'
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
if banned_topics.length > 100
|
|
340
|
+
fail ArgumentError, 'invalid value for "banned_topics", number of items must be less than or equal to 100.'
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
@banned_topics = banned_topics
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# Custom attribute writer method with validation
|
|
347
|
+
# @param [Object] post_offer Value to be assigned
|
|
348
|
+
def post_offer=(post_offer)
|
|
349
|
+
if post_offer.nil?
|
|
350
|
+
fail ArgumentError, 'post_offer cannot be nil'
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
@post_offer = post_offer
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Custom attribute writer method with validation
|
|
357
|
+
# @param [Object] accept_media_publishing_terms Value to be assigned
|
|
358
|
+
def accept_media_publishing_terms=(accept_media_publishing_terms)
|
|
359
|
+
if accept_media_publishing_terms.nil?
|
|
360
|
+
fail ArgumentError, 'accept_media_publishing_terms cannot be nil'
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
@accept_media_publishing_terms = accept_media_publishing_terms
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Custom attribute writer method with validation
|
|
367
|
+
# @param [Object] declare_media_ownership Value to be assigned
|
|
368
|
+
def declare_media_ownership=(declare_media_ownership)
|
|
369
|
+
if declare_media_ownership.nil?
|
|
370
|
+
fail ArgumentError, 'declare_media_ownership cannot be nil'
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
@declare_media_ownership = declare_media_ownership
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
# Checks equality by comparing each attribute.
|
|
377
|
+
# @param [Object] Object to be compared
|
|
378
|
+
def ==(o)
|
|
379
|
+
return true if self.equal?(o)
|
|
380
|
+
self.class == o.class &&
|
|
381
|
+
root_url == o.root_url &&
|
|
382
|
+
typology == o.typology &&
|
|
383
|
+
country == o.country &&
|
|
384
|
+
language == o.language &&
|
|
385
|
+
topics == o.topics &&
|
|
386
|
+
banned_topics == o.banned_topics &&
|
|
387
|
+
post_offer == o.post_offer &&
|
|
388
|
+
link_addition_offer == o.link_addition_offer &&
|
|
389
|
+
extra_services == o.extra_services &&
|
|
390
|
+
accept_media_publishing_terms == o.accept_media_publishing_terms &&
|
|
391
|
+
declare_media_ownership == o.declare_media_ownership
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# @see the `==` method
|
|
395
|
+
# @param [Object] Object to be compared
|
|
396
|
+
def eql?(o)
|
|
397
|
+
self == o
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
# Calculates hash code according to all attributes.
|
|
401
|
+
# @return [Integer] Hash code
|
|
402
|
+
def hash
|
|
403
|
+
[root_url, typology, country, language, topics, banned_topics, post_offer, link_addition_offer, extra_services, accept_media_publishing_terms, declare_media_ownership].hash
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
# Builds the object from hash
|
|
407
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
408
|
+
# @return [Object] Returns the model itself
|
|
409
|
+
def self.build_from_hash(attributes)
|
|
410
|
+
return nil unless attributes.is_a?(Hash)
|
|
411
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
412
|
+
transformed_hash = {}
|
|
413
|
+
openapi_types.each_pair do |key, type|
|
|
414
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
415
|
+
transformed_hash["#{key}"] = nil
|
|
416
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
417
|
+
# check to ensure the input is an array given that the attribute
|
|
418
|
+
# is documented as an array but the input is not
|
|
419
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
420
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
421
|
+
end
|
|
422
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
423
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
424
|
+
end
|
|
425
|
+
end
|
|
426
|
+
new(transformed_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
|
+
end
|
|
446
|
+
|
|
447
|
+
end
|