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,164 @@
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 SandboxFileResult < ApiModelBase
18
+ attr_accessor :data
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data'
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
+ :'data' => :'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::SandboxFileResult` 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::SandboxFileResult`. 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?(:'data')
67
+ self.data = attributes[:'data']
68
+ else
69
+ self.data = 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 @data.nil?
79
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @data.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] data Value to be assigned
95
+ def data=(data)
96
+ if data.nil?
97
+ fail ArgumentError, 'data cannot be nil'
98
+ end
99
+
100
+ @data = data
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ data == o.data
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [data].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end
@@ -0,0 +1,217 @@
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 SandboxFileWriteRequest < ApiModelBase
18
+ attr_accessor :path
19
+
20
+ attr_accessor :data
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'path' => :'path',
26
+ :'data' => :'data'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'path' => :'String',
44
+ :'data' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::SandboxFileWriteRequest` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::SandboxFileWriteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'path')
71
+ self.path = attributes[:'path']
72
+ else
73
+ self.path = nil
74
+ end
75
+
76
+ if attributes.key?(:'data')
77
+ self.data = attributes[:'data']
78
+ else
79
+ self.data = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @path.nil?
89
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
90
+ end
91
+
92
+ if @path.to_s.length > 4096
93
+ invalid_properties.push('invalid value for "path", the character length must be smaller than or equal to 4096.')
94
+ end
95
+
96
+ if @path.to_s.length < 1
97
+ invalid_properties.push('invalid value for "path", the character length must be greater than or equal to 1.')
98
+ end
99
+
100
+ if @data.nil?
101
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
102
+ end
103
+
104
+ if @data.to_s.length > 11184812
105
+ invalid_properties.push('invalid value for "data", the character length must be smaller than or equal to 11184812.')
106
+ end
107
+
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ return false if @path.nil?
116
+ return false if @path.to_s.length > 4096
117
+ return false if @path.to_s.length < 1
118
+ return false if @data.nil?
119
+ return false if @data.to_s.length > 11184812
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] path Value to be assigned
125
+ def path=(path)
126
+ if path.nil?
127
+ fail ArgumentError, 'path cannot be nil'
128
+ end
129
+
130
+ if path.to_s.length > 4096
131
+ fail ArgumentError, 'invalid value for "path", the character length must be smaller than or equal to 4096.'
132
+ end
133
+
134
+ if path.to_s.length < 1
135
+ fail ArgumentError, 'invalid value for "path", the character length must be greater than or equal to 1.'
136
+ end
137
+
138
+ @path = path
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] data Value to be assigned
143
+ def data=(data)
144
+ if data.nil?
145
+ fail ArgumentError, 'data cannot be nil'
146
+ end
147
+
148
+ if data.to_s.length > 11184812
149
+ fail ArgumentError, 'invalid value for "data", the character length must be smaller than or equal to 11184812.'
150
+ end
151
+
152
+ @data = data
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ path == o.path &&
161
+ data == o.data
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [path, data].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ attributes = attributes.transform_keys(&:to_sym)
182
+ transformed_hash = {}
183
+ openapi_types.each_pair do |key, type|
184
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = nil
186
+ elsif type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[attribute_map[key]].is_a?(Array)
190
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
+ end
192
+ elsif !attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
+ end
195
+ end
196
+ new(transformed_hash)
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ end
216
+
217
+ end
@@ -0,0 +1,199 @@
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 SandboxPagination < ApiModelBase
18
+ attr_accessor :limit
19
+
20
+ attr_accessor :has_more
21
+
22
+ attr_accessor :next_cursor
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'limit' => :'limit',
28
+ :'has_more' => :'has_more',
29
+ :'next_cursor' => :'next_cursor'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'limit' => :'Integer',
47
+ :'has_more' => :'Boolean',
48
+ :'next_cursor' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::SandboxPagination` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::SandboxPagination`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'limit')
75
+ self.limit = attributes[:'limit']
76
+ else
77
+ self.limit = nil
78
+ end
79
+
80
+ if attributes.key?(:'has_more')
81
+ self.has_more = attributes[:'has_more']
82
+ else
83
+ self.has_more = nil
84
+ end
85
+
86
+ if attributes.key?(:'next_cursor')
87
+ self.next_cursor = attributes[:'next_cursor']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ if @limit.nil?
97
+ invalid_properties.push('invalid value for "limit", limit cannot be nil.')
98
+ end
99
+
100
+ if @has_more.nil?
101
+ invalid_properties.push('invalid value for "has_more", has_more cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ return false if @limit.nil?
112
+ return false if @has_more.nil?
113
+ true
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param [Object] limit Value to be assigned
118
+ def limit=(limit)
119
+ if limit.nil?
120
+ fail ArgumentError, 'limit cannot be nil'
121
+ end
122
+
123
+ @limit = limit
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] has_more Value to be assigned
128
+ def has_more=(has_more)
129
+ if has_more.nil?
130
+ fail ArgumentError, 'has_more cannot be nil'
131
+ end
132
+
133
+ @has_more = has_more
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ limit == o.limit &&
142
+ has_more == o.has_more &&
143
+ next_cursor == o.next_cursor
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [limit, has_more, next_cursor].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ transformed_hash = {}
165
+ openapi_types.each_pair do |key, type|
166
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = nil
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[attribute_map[key]].is_a?(Array)
172
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
+ end
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
+ end
177
+ end
178
+ new(transformed_hash)
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ end
198
+
199
+ end