volcano-sdk 0.32.6 → 0.33.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/lib/volcano/client.rb +3 -2
  4. data/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb +6 -6
  5. data/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb +4 -4
  6. data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +2 -2
  7. data/lib/volcano/generated/lib/volcano-generated/api/logs_api.rb +6 -6
  8. data/lib/volcano/generated/lib/volcano-generated/api/sandboxes_api.rb +1433 -0
  9. data/lib/volcano/generated/lib/volcano-generated/models/auth_config.rb +1 -1
  10. data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_session_request.rb +294 -0
  11. data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_template_request.rb +247 -0
  12. data/lib/volcano/generated/lib/volcano-generated/models/project.rb +3 -3
  13. data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_signup.rb +1 -1
  14. data/lib/volcano/generated/lib/volcano-generated/models/project_config_custom_domain.rb +1 -1
  15. data/lib/volcano/generated/lib/volcano-generated/models/project_config_email_template.rb +2 -2
  16. data/lib/volcano/generated/lib/volcano-generated/models/project_config_email_templates.rb +1 -1
  17. data/lib/volcano/generated/lib/volcano-generated/models/project_config_hosted_pages.rb +1 -1
  18. data/lib/volcano/generated/lib/volcano-generated/models/project_config_project.rb +1 -1
  19. data/lib/volcano/generated/lib/volcano-generated/models/publish_sandbox_preset_request.rb +268 -0
  20. data/lib/volcano/generated/lib/volcano-generated/models/realtime_plan_limits.rb +1 -1
  21. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_access.rb +216 -0
  22. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_access_request.rb +221 -0
  23. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_capacity.rb +199 -0
  24. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_capacity_list.rb +166 -0
  25. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_request.rb +251 -0
  26. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_result.rb +294 -0
  27. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_deployment.rb +242 -0
  28. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_deployment_page.rb +192 -0
  29. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_request.rb +329 -0
  30. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_result.rb +381 -0
  31. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_read_request.rb +182 -0
  32. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_result.rb +164 -0
  33. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_write_request.rb +217 -0
  34. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_pagination.rb +199 -0
  35. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_preset.rb +294 -0
  36. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_preset_list.rb +166 -0
  37. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session.rb +407 -0
  38. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session_page.rb +192 -0
  39. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_subject_grant_request.rb +164 -0
  40. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_template.rb +321 -0
  41. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_template_page.rb +192 -0
  42. data/lib/volcano/generated/lib/volcano-generated/models/update_auth_config_request.rb +1 -1
  43. data/lib/volcano/generated/lib/volcano-generated/models/update_sandbox_template_request.rb +175 -0
  44. data/lib/volcano/generated/lib/volcano-generated.rb +26 -0
  45. data/lib/volcano/generated_transport.rb +1 -0
  46. data/lib/volcano/generated_transport_sandbox.rb +69 -0
  47. data/lib/volcano/sandbox_files.rb +37 -0
  48. data/lib/volcano/sandbox_models.rb +24 -0
  49. data/lib/volcano/sandbox_request.rb +92 -0
  50. data/lib/volcano/sandbox_response.rb +74 -0
  51. data/lib/volcano/sandbox_session.rb +78 -0
  52. data/lib/volcano/sandboxes.rb +67 -0
  53. data/lib/volcano/version.rb +1 -1
  54. data/lib/volcano.rb +7 -0
  55. data/sig/client.rbs +1 -0
  56. data/sig/sandboxes.rbs +83 -0
  57. metadata +50 -2
@@ -0,0 +1,381 @@
1
+ =begin
2
+ #Volcano Hosting API
3
+
4
+ #Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations.
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: support@volcano.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Volcano::Generated
17
+ class SandboxExecutionResult < ApiModelBase
18
+ attr_accessor :stdout
19
+
20
+ attr_accessor :stderr
21
+
22
+ attr_accessor :exit_code
23
+
24
+ attr_accessor :stdout_truncated
25
+
26
+ attr_accessor :stderr_truncated
27
+
28
+ attr_accessor :timed_out
29
+
30
+ attr_accessor :session_id
31
+
32
+ attr_accessor :region
33
+
34
+ attr_accessor :duration_ms
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'stdout' => :'stdout',
40
+ :'stderr' => :'stderr',
41
+ :'exit_code' => :'exit_code',
42
+ :'stdout_truncated' => :'stdout_truncated',
43
+ :'stderr_truncated' => :'stderr_truncated',
44
+ :'timed_out' => :'timed_out',
45
+ :'session_id' => :'session_id',
46
+ :'region' => :'region',
47
+ :'duration_ms' => :'duration_ms'
48
+ }
49
+ end
50
+
51
+ # Returns attribute mapping this model knows about
52
+ def self.acceptable_attribute_map
53
+ attribute_map
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ acceptable_attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'stdout' => :'String',
65
+ :'stderr' => :'String',
66
+ :'exit_code' => :'Integer',
67
+ :'stdout_truncated' => :'Boolean',
68
+ :'stderr_truncated' => :'Boolean',
69
+ :'timed_out' => :'Boolean',
70
+ :'session_id' => :'String',
71
+ :'region' => :'String',
72
+ :'duration_ms' => :'Integer'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::SandboxExecutionResult` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::SandboxExecutionResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'stdout')
99
+ self.stdout = attributes[:'stdout']
100
+ else
101
+ self.stdout = nil
102
+ end
103
+
104
+ if attributes.key?(:'stderr')
105
+ self.stderr = attributes[:'stderr']
106
+ else
107
+ self.stderr = nil
108
+ end
109
+
110
+ if attributes.key?(:'exit_code')
111
+ self.exit_code = attributes[:'exit_code']
112
+ else
113
+ self.exit_code = nil
114
+ end
115
+
116
+ if attributes.key?(:'stdout_truncated')
117
+ self.stdout_truncated = attributes[:'stdout_truncated']
118
+ else
119
+ self.stdout_truncated = nil
120
+ end
121
+
122
+ if attributes.key?(:'stderr_truncated')
123
+ self.stderr_truncated = attributes[:'stderr_truncated']
124
+ else
125
+ self.stderr_truncated = nil
126
+ end
127
+
128
+ if attributes.key?(:'timed_out')
129
+ self.timed_out = attributes[:'timed_out']
130
+ else
131
+ self.timed_out = nil
132
+ end
133
+
134
+ if attributes.key?(:'session_id')
135
+ self.session_id = attributes[:'session_id']
136
+ else
137
+ self.session_id = nil
138
+ end
139
+
140
+ if attributes.key?(:'region')
141
+ self.region = attributes[:'region']
142
+ else
143
+ self.region = nil
144
+ end
145
+
146
+ if attributes.key?(:'duration_ms')
147
+ self.duration_ms = attributes[:'duration_ms']
148
+ else
149
+ self.duration_ms = nil
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
157
+ invalid_properties = Array.new
158
+ if @stdout.nil?
159
+ invalid_properties.push('invalid value for "stdout", stdout cannot be nil.')
160
+ end
161
+
162
+ if @stderr.nil?
163
+ invalid_properties.push('invalid value for "stderr", stderr cannot be nil.')
164
+ end
165
+
166
+ if @exit_code.nil?
167
+ invalid_properties.push('invalid value for "exit_code", exit_code cannot be nil.')
168
+ end
169
+
170
+ if @stdout_truncated.nil?
171
+ invalid_properties.push('invalid value for "stdout_truncated", stdout_truncated cannot be nil.')
172
+ end
173
+
174
+ if @stderr_truncated.nil?
175
+ invalid_properties.push('invalid value for "stderr_truncated", stderr_truncated cannot be nil.')
176
+ end
177
+
178
+ if @timed_out.nil?
179
+ invalid_properties.push('invalid value for "timed_out", timed_out cannot be nil.')
180
+ end
181
+
182
+ if @session_id.nil?
183
+ invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
184
+ end
185
+
186
+ if @region.nil?
187
+ invalid_properties.push('invalid value for "region", region cannot be nil.')
188
+ end
189
+
190
+ if @duration_ms.nil?
191
+ invalid_properties.push('invalid value for "duration_ms", duration_ms cannot be nil.')
192
+ end
193
+
194
+ if @duration_ms < 0
195
+ invalid_properties.push('invalid value for "duration_ms", must be greater than or equal to 0.')
196
+ end
197
+
198
+ invalid_properties
199
+ end
200
+
201
+ # Check to see if the all the properties in the model are valid
202
+ # @return true if the model is valid
203
+ def valid?
204
+ warn '[DEPRECATED] the `valid?` method is obsolete'
205
+ return false if @stdout.nil?
206
+ return false if @stderr.nil?
207
+ return false if @exit_code.nil?
208
+ return false if @stdout_truncated.nil?
209
+ return false if @stderr_truncated.nil?
210
+ return false if @timed_out.nil?
211
+ return false if @session_id.nil?
212
+ return false if @region.nil?
213
+ return false if @duration_ms.nil?
214
+ return false if @duration_ms < 0
215
+ true
216
+ end
217
+
218
+ # Custom attribute writer method with validation
219
+ # @param [Object] stdout Value to be assigned
220
+ def stdout=(stdout)
221
+ if stdout.nil?
222
+ fail ArgumentError, 'stdout cannot be nil'
223
+ end
224
+
225
+ @stdout = stdout
226
+ end
227
+
228
+ # Custom attribute writer method with validation
229
+ # @param [Object] stderr Value to be assigned
230
+ def stderr=(stderr)
231
+ if stderr.nil?
232
+ fail ArgumentError, 'stderr cannot be nil'
233
+ end
234
+
235
+ @stderr = stderr
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param [Object] exit_code Value to be assigned
240
+ def exit_code=(exit_code)
241
+ if exit_code.nil?
242
+ fail ArgumentError, 'exit_code cannot be nil'
243
+ end
244
+
245
+ @exit_code = exit_code
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] stdout_truncated Value to be assigned
250
+ def stdout_truncated=(stdout_truncated)
251
+ if stdout_truncated.nil?
252
+ fail ArgumentError, 'stdout_truncated cannot be nil'
253
+ end
254
+
255
+ @stdout_truncated = stdout_truncated
256
+ end
257
+
258
+ # Custom attribute writer method with validation
259
+ # @param [Object] stderr_truncated Value to be assigned
260
+ def stderr_truncated=(stderr_truncated)
261
+ if stderr_truncated.nil?
262
+ fail ArgumentError, 'stderr_truncated cannot be nil'
263
+ end
264
+
265
+ @stderr_truncated = stderr_truncated
266
+ end
267
+
268
+ # Custom attribute writer method with validation
269
+ # @param [Object] timed_out Value to be assigned
270
+ def timed_out=(timed_out)
271
+ if timed_out.nil?
272
+ fail ArgumentError, 'timed_out cannot be nil'
273
+ end
274
+
275
+ @timed_out = timed_out
276
+ end
277
+
278
+ # Custom attribute writer method with validation
279
+ # @param [Object] session_id Value to be assigned
280
+ def session_id=(session_id)
281
+ if session_id.nil?
282
+ fail ArgumentError, 'session_id cannot be nil'
283
+ end
284
+
285
+ @session_id = session_id
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] region Value to be assigned
290
+ def region=(region)
291
+ if region.nil?
292
+ fail ArgumentError, 'region cannot be nil'
293
+ end
294
+
295
+ @region = region
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param [Object] duration_ms Value to be assigned
300
+ def duration_ms=(duration_ms)
301
+ if duration_ms.nil?
302
+ fail ArgumentError, 'duration_ms cannot be nil'
303
+ end
304
+
305
+ if duration_ms < 0
306
+ fail ArgumentError, 'invalid value for "duration_ms", must be greater than or equal to 0.'
307
+ end
308
+
309
+ @duration_ms = duration_ms
310
+ end
311
+
312
+ # Checks equality by comparing each attribute.
313
+ # @param [Object] Object to be compared
314
+ def ==(o)
315
+ return true if self.equal?(o)
316
+ self.class == o.class &&
317
+ stdout == o.stdout &&
318
+ stderr == o.stderr &&
319
+ exit_code == o.exit_code &&
320
+ stdout_truncated == o.stdout_truncated &&
321
+ stderr_truncated == o.stderr_truncated &&
322
+ timed_out == o.timed_out &&
323
+ session_id == o.session_id &&
324
+ region == o.region &&
325
+ duration_ms == o.duration_ms
326
+ end
327
+
328
+ # @see the `==` method
329
+ # @param [Object] Object to be compared
330
+ def eql?(o)
331
+ self == o
332
+ end
333
+
334
+ # Calculates hash code according to all attributes.
335
+ # @return [Integer] Hash code
336
+ def hash
337
+ [stdout, stderr, exit_code, stdout_truncated, stderr_truncated, timed_out, session_id, region, duration_ms].hash
338
+ end
339
+
340
+ # Builds the object from hash
341
+ # @param [Hash] attributes Model attributes in the form of hash
342
+ # @return [Object] Returns the model itself
343
+ def self.build_from_hash(attributes)
344
+ return nil unless attributes.is_a?(Hash)
345
+ attributes = attributes.transform_keys(&:to_sym)
346
+ transformed_hash = {}
347
+ openapi_types.each_pair do |key, type|
348
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
349
+ transformed_hash["#{key}"] = nil
350
+ elsif type =~ /\AArray<(.*)>/i
351
+ # check to ensure the input is an array given that the attribute
352
+ # is documented as an array but the input is not
353
+ if attributes[attribute_map[key]].is_a?(Array)
354
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
355
+ end
356
+ elsif !attributes[attribute_map[key]].nil?
357
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
358
+ end
359
+ end
360
+ new(transformed_hash)
361
+ end
362
+
363
+ # Returns the object in the form of hash
364
+ # @return [Hash] Returns the object in the form of hash
365
+ def to_hash
366
+ hash = {}
367
+ self.class.attribute_map.each_pair do |attr, param|
368
+ value = self.send(attr)
369
+ if value.nil?
370
+ is_nullable = self.class.openapi_nullable.include?(attr)
371
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
372
+ end
373
+
374
+ hash[param] = _to_hash(value)
375
+ end
376
+ hash
377
+ end
378
+
379
+ end
380
+
381
+ end
@@ -0,0 +1,182 @@
1
+ =begin
2
+ #Volcano Hosting API
3
+
4
+ #Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations.
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: support@volcano.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Volcano::Generated
17
+ class SandboxFileReadRequest < ApiModelBase
18
+ attr_accessor :path
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'path' => :'path'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'path' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::SandboxFileReadRequest` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::SandboxFileReadRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'path')
67
+ self.path = attributes[:'path']
68
+ else
69
+ self.path = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @path.nil?
79
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
80
+ end
81
+
82
+ if @path.to_s.length > 4096
83
+ invalid_properties.push('invalid value for "path", the character length must be smaller than or equal to 4096.')
84
+ end
85
+
86
+ if @path.to_s.length < 1
87
+ invalid_properties.push('invalid value for "path", the character length must be greater than or equal to 1.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @path.nil?
98
+ return false if @path.to_s.length > 4096
99
+ return false if @path.to_s.length < 1
100
+ true
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param [Object] path Value to be assigned
105
+ def path=(path)
106
+ if path.nil?
107
+ fail ArgumentError, 'path cannot be nil'
108
+ end
109
+
110
+ if path.to_s.length > 4096
111
+ fail ArgumentError, 'invalid value for "path", the character length must be smaller than or equal to 4096.'
112
+ end
113
+
114
+ if path.to_s.length < 1
115
+ fail ArgumentError, 'invalid value for "path", the character length must be greater than or equal to 1.'
116
+ end
117
+
118
+ @path = path
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ path == o.path
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [path].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ openapi_types.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ if value.nil?
171
+ is_nullable = self.class.openapi_nullable.include?(attr)
172
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
173
+ end
174
+
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ end
181
+
182
+ end