BmltClient 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/BmltClient.gemspec +38 -0
  3. data/Gemfile +9 -0
  4. data/Makefile +22 -0
  5. data/README.md +157 -0
  6. data/Rakefile +10 -0
  7. data/docs/AuthenticationError.md +18 -0
  8. data/docs/AuthorizationError.md +18 -0
  9. data/docs/ErrorTest.md +22 -0
  10. data/docs/Format.md +24 -0
  11. data/docs/FormatAllOf.md +18 -0
  12. data/docs/FormatBase.md +22 -0
  13. data/docs/FormatCreate.md +22 -0
  14. data/docs/FormatPartialUpdate.md +22 -0
  15. data/docs/FormatTranslation.md +24 -0
  16. data/docs/FormatUpdate.md +22 -0
  17. data/docs/Meeting.md +90 -0
  18. data/docs/MeetingBase.md +88 -0
  19. data/docs/MeetingCreate.md +88 -0
  20. data/docs/MeetingPartialUpdate.md +88 -0
  21. data/docs/MeetingUpdate.md +88 -0
  22. data/docs/NotFoundError.md +18 -0
  23. data/docs/RootServerApi.md +1958 -0
  24. data/docs/ServerError.md +18 -0
  25. data/docs/ServiceBody.md +38 -0
  26. data/docs/ServiceBodyBase.md +36 -0
  27. data/docs/ServiceBodyCreate.md +36 -0
  28. data/docs/ServiceBodyPartialUpdate.md +36 -0
  29. data/docs/ServiceBodyUpdate.md +36 -0
  30. data/docs/Token.md +24 -0
  31. data/docs/TokenCredentials.md +20 -0
  32. data/docs/User.md +30 -0
  33. data/docs/UserBase.md +28 -0
  34. data/docs/UserCreate.md +30 -0
  35. data/docs/UserCreateAllOf.md +18 -0
  36. data/docs/UserPartialUpdate.md +30 -0
  37. data/docs/UserUpdate.md +30 -0
  38. data/docs/ValidationError.md +20 -0
  39. data/git_push.sh +57 -0
  40. data/lib/BmltClient/api/root_server_api.rb +1880 -0
  41. data/lib/BmltClient/api_client.rb +392 -0
  42. data/lib/BmltClient/api_error.rb +57 -0
  43. data/lib/BmltClient/configuration.rb +279 -0
  44. data/lib/BmltClient/models/authentication_error.rb +224 -0
  45. data/lib/BmltClient/models/authorization_error.rb +224 -0
  46. data/lib/BmltClient/models/error_test.rb +237 -0
  47. data/lib/BmltClient/models/format.rb +276 -0
  48. data/lib/BmltClient/models/format_all_of.rb +219 -0
  49. data/lib/BmltClient/models/format_base.rb +239 -0
  50. data/lib/BmltClient/models/format_create.rb +251 -0
  51. data/lib/BmltClient/models/format_partial_update.rb +246 -0
  52. data/lib/BmltClient/models/format_translation.rb +266 -0
  53. data/lib/BmltClient/models/format_update.rb +251 -0
  54. data/lib/BmltClient/models/meeting.rb +628 -0
  55. data/lib/BmltClient/models/meeting_base.rb +536 -0
  56. data/lib/BmltClient/models/meeting_create.rb +593 -0
  57. data/lib/BmltClient/models/meeting_partial_update.rb +593 -0
  58. data/lib/BmltClient/models/meeting_update.rb +593 -0
  59. data/lib/BmltClient/models/not_found_error.rb +224 -0
  60. data/lib/BmltClient/models/server_error.rb +224 -0
  61. data/lib/BmltClient/models/service_body.rb +374 -0
  62. data/lib/BmltClient/models/service_body_base.rb +302 -0
  63. data/lib/BmltClient/models/service_body_create.rb +339 -0
  64. data/lib/BmltClient/models/service_body_partial_update.rb +309 -0
  65. data/lib/BmltClient/models/service_body_update.rb +339 -0
  66. data/lib/BmltClient/models/token.rb +266 -0
  67. data/lib/BmltClient/models/token_credentials.rb +238 -0
  68. data/lib/BmltClient/models/user.rb +316 -0
  69. data/lib/BmltClient/models/user_base.rb +264 -0
  70. data/lib/BmltClient/models/user_create.rb +301 -0
  71. data/lib/BmltClient/models/user_create_all_of.rb +219 -0
  72. data/lib/BmltClient/models/user_partial_update.rb +281 -0
  73. data/lib/BmltClient/models/user_update.rb +296 -0
  74. data/lib/BmltClient/models/validation_error.rb +240 -0
  75. data/lib/BmltClient/version.rb +15 -0
  76. data/lib/BmltClient.rb +71 -0
  77. data/openapi.json +1 -0
  78. data/spec/api/root_server_api_spec.rb +377 -0
  79. data/spec/api_client_spec.rb +226 -0
  80. data/spec/configuration_spec.rb +42 -0
  81. data/spec/models/authentication_error_spec.rb +34 -0
  82. data/spec/models/authorization_error_spec.rb +34 -0
  83. data/spec/models/error_test_spec.rb +46 -0
  84. data/spec/models/format_all_of_spec.rb +34 -0
  85. data/spec/models/format_base_spec.rb +46 -0
  86. data/spec/models/format_create_spec.rb +46 -0
  87. data/spec/models/format_partial_update_spec.rb +46 -0
  88. data/spec/models/format_spec.rb +52 -0
  89. data/spec/models/format_translation_spec.rb +52 -0
  90. data/spec/models/format_update_spec.rb +46 -0
  91. data/spec/models/meeting_base_spec.rb +244 -0
  92. data/spec/models/meeting_create_spec.rb +244 -0
  93. data/spec/models/meeting_partial_update_spec.rb +244 -0
  94. data/spec/models/meeting_spec.rb +250 -0
  95. data/spec/models/meeting_update_spec.rb +244 -0
  96. data/spec/models/not_found_error_spec.rb +34 -0
  97. data/spec/models/server_error_spec.rb +34 -0
  98. data/spec/models/service_body_base_spec.rb +88 -0
  99. data/spec/models/service_body_create_spec.rb +88 -0
  100. data/spec/models/service_body_partial_update_spec.rb +88 -0
  101. data/spec/models/service_body_spec.rb +94 -0
  102. data/spec/models/service_body_update_spec.rb +88 -0
  103. data/spec/models/token_credentials_spec.rb +40 -0
  104. data/spec/models/token_spec.rb +52 -0
  105. data/spec/models/user_base_spec.rb +64 -0
  106. data/spec/models/user_create_all_of_spec.rb +34 -0
  107. data/spec/models/user_create_spec.rb +70 -0
  108. data/spec/models/user_partial_update_spec.rb +70 -0
  109. data/spec/models/user_spec.rb +70 -0
  110. data/spec/models/user_update_spec.rb +70 -0
  111. data/spec/models/validation_error_spec.rb +40 -0
  112. data/spec/spec_helper.rb +111 -0
  113. metadata +229 -0
@@ -0,0 +1,536 @@
1
+ =begin
2
+ #BMLT
3
+
4
+ #BMLT Admin API Documentation
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module BmltClient
17
+ class MeetingBase
18
+ attr_accessor :service_body_id
19
+
20
+ attr_accessor :format_ids
21
+
22
+ attr_accessor :venue_type
23
+
24
+ attr_accessor :temporarily_virtual
25
+
26
+ attr_accessor :day
27
+
28
+ attr_accessor :start_time
29
+
30
+ attr_accessor :duration
31
+
32
+ attr_accessor :time_zone
33
+
34
+ attr_accessor :latitude
35
+
36
+ attr_accessor :longitude
37
+
38
+ attr_accessor :published
39
+
40
+ attr_accessor :email
41
+
42
+ attr_accessor :world_id
43
+
44
+ attr_accessor :name
45
+
46
+ attr_accessor :location_text
47
+
48
+ attr_accessor :location_info
49
+
50
+ attr_accessor :location_street
51
+
52
+ attr_accessor :location_neighborhood
53
+
54
+ attr_accessor :location_city_subsection
55
+
56
+ attr_accessor :location_municipality
57
+
58
+ attr_accessor :location_sub_province
59
+
60
+ attr_accessor :location_province
61
+
62
+ attr_accessor :location_postal_code_1
63
+
64
+ attr_accessor :location_nation
65
+
66
+ attr_accessor :phone_meeting_number
67
+
68
+ attr_accessor :virtual_meeting_link
69
+
70
+ attr_accessor :virtual_meeting_additional_info
71
+
72
+ attr_accessor :contact_name_1
73
+
74
+ attr_accessor :contact_name_2
75
+
76
+ attr_accessor :contact_phone_1
77
+
78
+ attr_accessor :contact_phone_2
79
+
80
+ attr_accessor :contact_email_1
81
+
82
+ attr_accessor :contact_email_2
83
+
84
+ attr_accessor :bus_lines
85
+
86
+ attr_accessor :train_line
87
+
88
+ attr_accessor :comments
89
+
90
+ # Attribute mapping from ruby-style variable name to JSON key.
91
+ def self.attribute_map
92
+ {
93
+ :'service_body_id' => :'serviceBodyId',
94
+ :'format_ids' => :'formatIds',
95
+ :'venue_type' => :'venueType',
96
+ :'temporarily_virtual' => :'temporarilyVirtual',
97
+ :'day' => :'day',
98
+ :'start_time' => :'startTime',
99
+ :'duration' => :'duration',
100
+ :'time_zone' => :'timeZone',
101
+ :'latitude' => :'latitude',
102
+ :'longitude' => :'longitude',
103
+ :'published' => :'published',
104
+ :'email' => :'email',
105
+ :'world_id' => :'worldId',
106
+ :'name' => :'name',
107
+ :'location_text' => :'location_text',
108
+ :'location_info' => :'location_info',
109
+ :'location_street' => :'location_street',
110
+ :'location_neighborhood' => :'location_neighborhood',
111
+ :'location_city_subsection' => :'location_city_subsection',
112
+ :'location_municipality' => :'location_municipality',
113
+ :'location_sub_province' => :'location_sub_province',
114
+ :'location_province' => :'location_province',
115
+ :'location_postal_code_1' => :'location_postal_code_1',
116
+ :'location_nation' => :'location_nation',
117
+ :'phone_meeting_number' => :'phone_meeting_number',
118
+ :'virtual_meeting_link' => :'virtual_meeting_link',
119
+ :'virtual_meeting_additional_info' => :'virtual_meeting_additional_info',
120
+ :'contact_name_1' => :'contact_name_1',
121
+ :'contact_name_2' => :'contact_name_2',
122
+ :'contact_phone_1' => :'contact_phone_1',
123
+ :'contact_phone_2' => :'contact_phone_2',
124
+ :'contact_email_1' => :'contact_email_1',
125
+ :'contact_email_2' => :'contact_email_2',
126
+ :'bus_lines' => :'bus_lines',
127
+ :'train_line' => :'train_line',
128
+ :'comments' => :'comments'
129
+ }
130
+ end
131
+
132
+ # Returns all the JSON keys this model knows about
133
+ def self.acceptable_attributes
134
+ attribute_map.values
135
+ end
136
+
137
+ # Attribute type mapping.
138
+ def self.openapi_types
139
+ {
140
+ :'service_body_id' => :'Integer',
141
+ :'format_ids' => :'Array<Integer>',
142
+ :'venue_type' => :'Integer',
143
+ :'temporarily_virtual' => :'Boolean',
144
+ :'day' => :'Integer',
145
+ :'start_time' => :'String',
146
+ :'duration' => :'String',
147
+ :'time_zone' => :'String',
148
+ :'latitude' => :'Float',
149
+ :'longitude' => :'Float',
150
+ :'published' => :'Boolean',
151
+ :'email' => :'String',
152
+ :'world_id' => :'String',
153
+ :'name' => :'String',
154
+ :'location_text' => :'String',
155
+ :'location_info' => :'String',
156
+ :'location_street' => :'String',
157
+ :'location_neighborhood' => :'String',
158
+ :'location_city_subsection' => :'String',
159
+ :'location_municipality' => :'String',
160
+ :'location_sub_province' => :'String',
161
+ :'location_province' => :'String',
162
+ :'location_postal_code_1' => :'String',
163
+ :'location_nation' => :'String',
164
+ :'phone_meeting_number' => :'String',
165
+ :'virtual_meeting_link' => :'String',
166
+ :'virtual_meeting_additional_info' => :'String',
167
+ :'contact_name_1' => :'String',
168
+ :'contact_name_2' => :'String',
169
+ :'contact_phone_1' => :'String',
170
+ :'contact_phone_2' => :'String',
171
+ :'contact_email_1' => :'String',
172
+ :'contact_email_2' => :'String',
173
+ :'bus_lines' => :'String',
174
+ :'train_line' => :'String',
175
+ :'comments' => :'String'
176
+ }
177
+ end
178
+
179
+ # List of attributes with nullable: true
180
+ def self.openapi_nullable
181
+ Set.new([
182
+ ])
183
+ end
184
+
185
+ # Initializes the object
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ def initialize(attributes = {})
188
+ if (!attributes.is_a?(Hash))
189
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BmltClient::MeetingBase` initialize method"
190
+ end
191
+
192
+ # check to see if the attribute exists and convert string to symbol for hash key
193
+ attributes = attributes.each_with_object({}) { |(k, v), h|
194
+ if (!self.class.attribute_map.key?(k.to_sym))
195
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmltClient::MeetingBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
196
+ end
197
+ h[k.to_sym] = v
198
+ }
199
+
200
+ if attributes.key?(:'service_body_id')
201
+ self.service_body_id = attributes[:'service_body_id']
202
+ end
203
+
204
+ if attributes.key?(:'format_ids')
205
+ if (value = attributes[:'format_ids']).is_a?(Array)
206
+ self.format_ids = value
207
+ end
208
+ end
209
+
210
+ if attributes.key?(:'venue_type')
211
+ self.venue_type = attributes[:'venue_type']
212
+ end
213
+
214
+ if attributes.key?(:'temporarily_virtual')
215
+ self.temporarily_virtual = attributes[:'temporarily_virtual']
216
+ end
217
+
218
+ if attributes.key?(:'day')
219
+ self.day = attributes[:'day']
220
+ end
221
+
222
+ if attributes.key?(:'start_time')
223
+ self.start_time = attributes[:'start_time']
224
+ end
225
+
226
+ if attributes.key?(:'duration')
227
+ self.duration = attributes[:'duration']
228
+ end
229
+
230
+ if attributes.key?(:'time_zone')
231
+ self.time_zone = attributes[:'time_zone']
232
+ end
233
+
234
+ if attributes.key?(:'latitude')
235
+ self.latitude = attributes[:'latitude']
236
+ end
237
+
238
+ if attributes.key?(:'longitude')
239
+ self.longitude = attributes[:'longitude']
240
+ end
241
+
242
+ if attributes.key?(:'published')
243
+ self.published = attributes[:'published']
244
+ end
245
+
246
+ if attributes.key?(:'email')
247
+ self.email = attributes[:'email']
248
+ end
249
+
250
+ if attributes.key?(:'world_id')
251
+ self.world_id = attributes[:'world_id']
252
+ end
253
+
254
+ if attributes.key?(:'name')
255
+ self.name = attributes[:'name']
256
+ end
257
+
258
+ if attributes.key?(:'location_text')
259
+ self.location_text = attributes[:'location_text']
260
+ end
261
+
262
+ if attributes.key?(:'location_info')
263
+ self.location_info = attributes[:'location_info']
264
+ end
265
+
266
+ if attributes.key?(:'location_street')
267
+ self.location_street = attributes[:'location_street']
268
+ end
269
+
270
+ if attributes.key?(:'location_neighborhood')
271
+ self.location_neighborhood = attributes[:'location_neighborhood']
272
+ end
273
+
274
+ if attributes.key?(:'location_city_subsection')
275
+ self.location_city_subsection = attributes[:'location_city_subsection']
276
+ end
277
+
278
+ if attributes.key?(:'location_municipality')
279
+ self.location_municipality = attributes[:'location_municipality']
280
+ end
281
+
282
+ if attributes.key?(:'location_sub_province')
283
+ self.location_sub_province = attributes[:'location_sub_province']
284
+ end
285
+
286
+ if attributes.key?(:'location_province')
287
+ self.location_province = attributes[:'location_province']
288
+ end
289
+
290
+ if attributes.key?(:'location_postal_code_1')
291
+ self.location_postal_code_1 = attributes[:'location_postal_code_1']
292
+ end
293
+
294
+ if attributes.key?(:'location_nation')
295
+ self.location_nation = attributes[:'location_nation']
296
+ end
297
+
298
+ if attributes.key?(:'phone_meeting_number')
299
+ self.phone_meeting_number = attributes[:'phone_meeting_number']
300
+ end
301
+
302
+ if attributes.key?(:'virtual_meeting_link')
303
+ self.virtual_meeting_link = attributes[:'virtual_meeting_link']
304
+ end
305
+
306
+ if attributes.key?(:'virtual_meeting_additional_info')
307
+ self.virtual_meeting_additional_info = attributes[:'virtual_meeting_additional_info']
308
+ end
309
+
310
+ if attributes.key?(:'contact_name_1')
311
+ self.contact_name_1 = attributes[:'contact_name_1']
312
+ end
313
+
314
+ if attributes.key?(:'contact_name_2')
315
+ self.contact_name_2 = attributes[:'contact_name_2']
316
+ end
317
+
318
+ if attributes.key?(:'contact_phone_1')
319
+ self.contact_phone_1 = attributes[:'contact_phone_1']
320
+ end
321
+
322
+ if attributes.key?(:'contact_phone_2')
323
+ self.contact_phone_2 = attributes[:'contact_phone_2']
324
+ end
325
+
326
+ if attributes.key?(:'contact_email_1')
327
+ self.contact_email_1 = attributes[:'contact_email_1']
328
+ end
329
+
330
+ if attributes.key?(:'contact_email_2')
331
+ self.contact_email_2 = attributes[:'contact_email_2']
332
+ end
333
+
334
+ if attributes.key?(:'bus_lines')
335
+ self.bus_lines = attributes[:'bus_lines']
336
+ end
337
+
338
+ if attributes.key?(:'train_line')
339
+ self.train_line = attributes[:'train_line']
340
+ end
341
+
342
+ if attributes.key?(:'comments')
343
+ self.comments = attributes[:'comments']
344
+ end
345
+ end
346
+
347
+ # Show invalid properties with the reasons. Usually used together with valid?
348
+ # @return Array for valid properties with the reasons
349
+ def list_invalid_properties
350
+ invalid_properties = Array.new
351
+ invalid_properties
352
+ end
353
+
354
+ # Check to see if the all the properties in the model are valid
355
+ # @return true if the model is valid
356
+ def valid?
357
+ true
358
+ end
359
+
360
+ # Checks equality by comparing each attribute.
361
+ # @param [Object] Object to be compared
362
+ def ==(o)
363
+ return true if self.equal?(o)
364
+ self.class == o.class &&
365
+ service_body_id == o.service_body_id &&
366
+ format_ids == o.format_ids &&
367
+ venue_type == o.venue_type &&
368
+ temporarily_virtual == o.temporarily_virtual &&
369
+ day == o.day &&
370
+ start_time == o.start_time &&
371
+ duration == o.duration &&
372
+ time_zone == o.time_zone &&
373
+ latitude == o.latitude &&
374
+ longitude == o.longitude &&
375
+ published == o.published &&
376
+ email == o.email &&
377
+ world_id == o.world_id &&
378
+ name == o.name &&
379
+ location_text == o.location_text &&
380
+ location_info == o.location_info &&
381
+ location_street == o.location_street &&
382
+ location_neighborhood == o.location_neighborhood &&
383
+ location_city_subsection == o.location_city_subsection &&
384
+ location_municipality == o.location_municipality &&
385
+ location_sub_province == o.location_sub_province &&
386
+ location_province == o.location_province &&
387
+ location_postal_code_1 == o.location_postal_code_1 &&
388
+ location_nation == o.location_nation &&
389
+ phone_meeting_number == o.phone_meeting_number &&
390
+ virtual_meeting_link == o.virtual_meeting_link &&
391
+ virtual_meeting_additional_info == o.virtual_meeting_additional_info &&
392
+ contact_name_1 == o.contact_name_1 &&
393
+ contact_name_2 == o.contact_name_2 &&
394
+ contact_phone_1 == o.contact_phone_1 &&
395
+ contact_phone_2 == o.contact_phone_2 &&
396
+ contact_email_1 == o.contact_email_1 &&
397
+ contact_email_2 == o.contact_email_2 &&
398
+ bus_lines == o.bus_lines &&
399
+ train_line == o.train_line &&
400
+ comments == o.comments
401
+ end
402
+
403
+ # @see the `==` method
404
+ # @param [Object] Object to be compared
405
+ def eql?(o)
406
+ self == o
407
+ end
408
+
409
+ # Calculates hash code according to all attributes.
410
+ # @return [Integer] Hash code
411
+ def hash
412
+ [service_body_id, format_ids, venue_type, temporarily_virtual, day, start_time, duration, time_zone, latitude, longitude, published, email, world_id, name, location_text, location_info, location_street, location_neighborhood, location_city_subsection, location_municipality, location_sub_province, location_province, location_postal_code_1, location_nation, phone_meeting_number, virtual_meeting_link, virtual_meeting_additional_info, contact_name_1, contact_name_2, contact_phone_1, contact_phone_2, contact_email_1, contact_email_2, bus_lines, train_line, comments].hash
413
+ end
414
+
415
+ # Builds the object from hash
416
+ # @param [Hash] attributes Model attributes in the form of hash
417
+ # @return [Object] Returns the model itself
418
+ def self.build_from_hash(attributes)
419
+ new.build_from_hash(attributes)
420
+ end
421
+
422
+ # Builds the object from hash
423
+ # @param [Hash] attributes Model attributes in the form of hash
424
+ # @return [Object] Returns the model itself
425
+ def build_from_hash(attributes)
426
+ return nil unless attributes.is_a?(Hash)
427
+ attributes = attributes.transform_keys(&:to_sym)
428
+ self.class.openapi_types.each_pair do |key, type|
429
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
430
+ self.send("#{key}=", nil)
431
+ elsif type =~ /\AArray<(.*)>/i
432
+ # check to ensure the input is an array given that the attribute
433
+ # is documented as an array but the input is not
434
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
435
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
436
+ end
437
+ elsif !attributes[self.class.attribute_map[key]].nil?
438
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
439
+ end
440
+ end
441
+
442
+ self
443
+ end
444
+
445
+ # Deserializes the data based on type
446
+ # @param string type Data type
447
+ # @param string value Value to be deserialized
448
+ # @return [Object] Deserialized data
449
+ def _deserialize(type, value)
450
+ case type.to_sym
451
+ when :Time
452
+ Time.parse(value)
453
+ when :Date
454
+ Date.parse(value)
455
+ when :String
456
+ value.to_s
457
+ when :Integer
458
+ value.to_i
459
+ when :Float
460
+ value.to_f
461
+ when :Boolean
462
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
463
+ true
464
+ else
465
+ false
466
+ end
467
+ when :Object
468
+ # generic object (usually a Hash), return directly
469
+ value
470
+ when /\AArray<(?<inner_type>.+)>\z/
471
+ inner_type = Regexp.last_match[:inner_type]
472
+ value.map { |v| _deserialize(inner_type, v) }
473
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
474
+ k_type = Regexp.last_match[:k_type]
475
+ v_type = Regexp.last_match[:v_type]
476
+ {}.tap do |hash|
477
+ value.each do |k, v|
478
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
479
+ end
480
+ end
481
+ else # model
482
+ # models (e.g. Pet) or oneOf
483
+ klass = BmltClient.const_get(type)
484
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
485
+ end
486
+ end
487
+
488
+ # Returns the string representation of the object
489
+ # @return [String] String presentation of the object
490
+ def to_s
491
+ to_hash.to_s
492
+ end
493
+
494
+ # to_body is an alias to to_hash (backward compatibility)
495
+ # @return [Hash] Returns the object in the form of hash
496
+ def to_body
497
+ to_hash
498
+ end
499
+
500
+ # Returns the object in the form of hash
501
+ # @return [Hash] Returns the object in the form of hash
502
+ def to_hash
503
+ hash = {}
504
+ self.class.attribute_map.each_pair do |attr, param|
505
+ value = self.send(attr)
506
+ if value.nil?
507
+ is_nullable = self.class.openapi_nullable.include?(attr)
508
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
509
+ end
510
+
511
+ hash[param] = _to_hash(value)
512
+ end
513
+ hash
514
+ end
515
+
516
+ # Outputs non-array value in the form of hash
517
+ # For object, use to_hash. Otherwise, just return the value
518
+ # @param [Object] value Any valid value
519
+ # @return [Hash] Returns the value in the form of hash
520
+ def _to_hash(value)
521
+ if value.is_a?(Array)
522
+ value.compact.map { |v| _to_hash(v) }
523
+ elsif value.is_a?(Hash)
524
+ {}.tap do |hash|
525
+ value.each { |k, v| hash[k] = _to_hash(v) }
526
+ end
527
+ elsif value.respond_to? :to_hash
528
+ value.to_hash
529
+ else
530
+ value
531
+ end
532
+ end
533
+
534
+ end
535
+
536
+ end