autosde_openapi_client 3.0.0 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1870191af5e15ad22eac848c81d922e688150cae0bee0b6d795fef11880396df
4
- data.tar.gz: ad4a500feec278df247d97fba97495f39b798543884588b50c4659427c8566a6
3
+ metadata.gz: b1d2218fb3bed0806cf73ceb77730c92e1370f7ff0db9c6ba7856a391f33f055
4
+ data.tar.gz: ffc214f88eb27b2ada9cb18a3ae61af00ab601a1edff61b848ccacb40cec289e
5
5
  SHA512:
6
- metadata.gz: 6ee9bd65a0cde8bafa143f66f9a8e0321ec6533bc3659f25dddfeecdae7719a1381dfed7164c86739be80392075cd87e973c214d72a12c50e53916d895a39ccc
7
- data.tar.gz: 4723f74be75bbb03e284042d2d3d09947186cf6236e875ef66e8c58c386015fa0f18cbd88d1e880fde3e64bc38f02114479076f4d30b6d28d02444ddedd4a357
6
+ metadata.gz: b20865aa9f6bc82d34d63fb9f41a61f5bb674c9423c5b4e9c67f45de50620ed4827917ba7d622081e62b31de2a6092fc14a7c141d19461116837c0154ec0e004
7
+ data.tar.gz: e3553f0f7f106783c03ed43f824a8cb372921cc7381871b1e06db709a46bca23c8af3ed7e2c9e255264ab4908e4750118443a172d2599d3f356f36f5ccc24b01
data/README.md CHANGED
@@ -236,6 +236,7 @@ Class | Method | HTTP request | Description
236
236
  - [AutosdeOpenapiClient::HostVolumeConnectionCreate](docs/HostVolumeConnectionCreate.md)
237
237
  - [AutosdeOpenapiClient::Job](docs/Job.md)
238
238
  - [AutosdeOpenapiClient::JobCreate](docs/JobCreate.md)
239
+ - [AutosdeOpenapiClient::JobResponse](docs/JobResponse.md)
239
240
  - [AutosdeOpenapiClient::NativeCapability](docs/NativeCapability.md)
240
241
  - [AutosdeOpenapiClient::Profile](docs/Profile.md)
241
242
  - [AutosdeOpenapiClient::ProvisioningStrategy](docs/ProvisioningStrategy.md)
@@ -247,6 +248,7 @@ Class | Method | HTTP request | Description
247
248
  - [AutosdeOpenapiClient::ServiceResourceAttachment](docs/ServiceResourceAttachment.md)
248
249
  - [AutosdeOpenapiClient::ServiceResourceAttachmentResponse](docs/ServiceResourceAttachmentResponse.md)
249
250
  - [AutosdeOpenapiClient::ServiceResponse](docs/ServiceResponse.md)
251
+ - [AutosdeOpenapiClient::ServiceUpdate](docs/ServiceUpdate.md)
250
252
  - [AutosdeOpenapiClient::Snapshot](docs/Snapshot.md)
251
253
  - [AutosdeOpenapiClient::SnapshotCreate](docs/SnapshotCreate.md)
252
254
  - [AutosdeOpenapiClient::SnapshotResponse](docs/SnapshotResponse.md)
data/docs/Job.md CHANGED
@@ -7,7 +7,7 @@
7
7
  | **date_finished** | **Time** | date_finished | [optional] |
8
8
  | **date_started** | **Time** | date_started | [optional] |
9
9
  | **extra** | **String** | extra | [optional] |
10
- | **object_id** | **String** | object_id | [optional][default to 'null'] |
10
+ | **objects_ids** | **Array<String>** | objects_ids | [optional] |
11
11
  | **result** | **String** | result | [optional] |
12
12
  | **status** | **String** | status | [optional] |
13
13
  | **task_args** | **String** | task_args | [optional] |
@@ -24,7 +24,7 @@ instance = AutosdeOpenapiClient::Job.new(
24
24
  date_finished: null,
25
25
  date_started: null,
26
26
  extra: null,
27
- object_id: null,
27
+ objects_ids: null,
28
28
  result: null,
29
29
  status: null,
30
30
  task_args: null,
data/docs/JobApi.md CHANGED
@@ -143,7 +143,7 @@ end
143
143
 
144
144
  ## jobs_pk_get
145
145
 
146
- > <Job> jobs_pk_get(pk)
146
+ > <JobResponse> jobs_pk_get(pk)
147
147
 
148
148
 
149
149
 
@@ -174,7 +174,7 @@ end
174
174
 
175
175
  This returns an Array which contains the response data, status code and headers.
176
176
 
177
- > <Array(<Job>, Integer, Hash)> jobs_pk_get_with_http_info(pk)
177
+ > <Array(<JobResponse>, Integer, Hash)> jobs_pk_get_with_http_info(pk)
178
178
 
179
179
  ```ruby
180
180
  begin
@@ -182,7 +182,7 @@ begin
182
182
  data, status_code, headers = api_instance.jobs_pk_get_with_http_info(pk)
183
183
  p status_code # => 2xx
184
184
  p headers # => { ... }
185
- p data # => <Job>
185
+ p data # => <JobResponse>
186
186
  rescue AutosdeOpenapiClient::ApiError => e
187
187
  puts "Error when calling JobApi->jobs_pk_get_with_http_info: #{e}"
188
188
  end
@@ -196,7 +196,7 @@ end
196
196
 
197
197
  ### Return type
198
198
 
199
- [**Job**](Job.md)
199
+ [**JobResponse**](JobResponse.md)
200
200
 
201
201
  ### Authorization
202
202
 
@@ -0,0 +1,36 @@
1
+ # AutosdeOpenapiClient::JobResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **date_finished** | **Time** | date_finished | [optional] |
8
+ | **date_started** | **Time** | date_started | [optional] |
9
+ | **extra** | **String** | extra | [optional] |
10
+ | **objects_ids** | **Array&lt;String&gt;** | objects_ids | [optional] |
11
+ | **result** | **String** | result | [optional] |
12
+ | **status** | **String** | status | [optional] |
13
+ | **task_args** | **String** | task_args | [optional] |
14
+ | **task_id** | **String** | task_id | [optional] |
15
+ | **task_kwargs** | **String** | task_kwargs | [optional] |
16
+ | **task_name** | **String** | task_name | [optional] |
17
+
18
+ ## Example
19
+
20
+ ```ruby
21
+ require 'autosde_openapi_client'
22
+
23
+ instance = AutosdeOpenapiClient::JobResponse.new(
24
+ date_finished: null,
25
+ date_started: null,
26
+ extra: null,
27
+ objects_ids: null,
28
+ result: null,
29
+ status: null,
30
+ task_args: null,
31
+ task_id: null,
32
+ task_kwargs: null,
33
+ task_name: null
34
+ )
35
+ ```
36
+
data/docs/ServiceApi.md CHANGED
@@ -211,7 +211,7 @@ end
211
211
 
212
212
  ## services_pk_put
213
213
 
214
- > <Service> services_pk_put(pk, service)
214
+ > <AsyncResponse> services_pk_put(pk, service_update)
215
215
 
216
216
 
217
217
 
@@ -228,11 +228,11 @@ end
228
228
 
229
229
  api_instance = AutosdeOpenapiClient::ServiceApi.new
230
230
  pk = 56 # Integer |
231
- service = AutosdeOpenapiClient::Service.new # Service |
231
+ service_update = AutosdeOpenapiClient::ServiceUpdate.new # ServiceUpdate |
232
232
 
233
233
  begin
234
234
 
235
- result = api_instance.services_pk_put(pk, service)
235
+ result = api_instance.services_pk_put(pk, service_update)
236
236
  p result
237
237
  rescue AutosdeOpenapiClient::ApiError => e
238
238
  puts "Error when calling ServiceApi->services_pk_put: #{e}"
@@ -243,15 +243,15 @@ end
243
243
 
244
244
  This returns an Array which contains the response data, status code and headers.
245
245
 
246
- > <Array(<Service>, Integer, Hash)> services_pk_put_with_http_info(pk, service)
246
+ > <Array(<AsyncResponse>, Integer, Hash)> services_pk_put_with_http_info(pk, service_update)
247
247
 
248
248
  ```ruby
249
249
  begin
250
250
 
251
- data, status_code, headers = api_instance.services_pk_put_with_http_info(pk, service)
251
+ data, status_code, headers = api_instance.services_pk_put_with_http_info(pk, service_update)
252
252
  p status_code # => 2xx
253
253
  p headers # => { ... }
254
- p data # => <Service>
254
+ p data # => <AsyncResponse>
255
255
  rescue AutosdeOpenapiClient::ApiError => e
256
256
  puts "Error when calling ServiceApi->services_pk_put_with_http_info: #{e}"
257
257
  end
@@ -262,11 +262,11 @@ end
262
262
  | Name | Type | Description | Notes |
263
263
  | ---- | ---- | ----------- | ----- |
264
264
  | **pk** | **Integer** | | |
265
- | **service** | [**Service**](Service.md) | | |
265
+ | **service_update** | [**ServiceUpdate**](ServiceUpdate.md) | | |
266
266
 
267
267
  ### Return type
268
268
 
269
- [**Service**](Service.md)
269
+ [**AsyncResponse**](AsyncResponse.md)
270
270
 
271
271
  ### Authorization
272
272
 
@@ -0,0 +1,34 @@
1
+ # AutosdeOpenapiClient::ServiceUpdate
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **capability_value_list** | **Array&lt;String&gt;** | capability_value_list | [optional] |
8
+ | **component_state** | **String** | component_state | [optional] |
9
+ | **description** | **String** | description | [optional][default to &#39;&#39;] |
10
+ | **name** | **String** | name | [optional] |
11
+ | **profile** | [**Profile**](Profile.md) | | [optional] |
12
+ | **project** | [**AutoSDEProject**](AutoSDEProject.md) | | [optional] |
13
+ | **provisioning_strategy** | [**ProvisioningStrategy**](ProvisioningStrategy.md) | | [optional] |
14
+ | **uuid** | **String** | uuid | [optional] |
15
+ | **version** | **Integer** | The version of the service | [optional][default to 1] |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'autosde_openapi_client'
21
+
22
+ instance = AutosdeOpenapiClient::ServiceUpdate.new(
23
+ capability_value_list: null,
24
+ component_state: null,
25
+ description: null,
26
+ name: null,
27
+ profile: null,
28
+ project: null,
29
+ provisioning_strategy: null,
30
+ uuid: null,
31
+ version: null
32
+ )
33
+ ```
34
+
@@ -133,7 +133,7 @@ module AutosdeOpenapiClient
133
133
 
134
134
  # @param pk [Integer]
135
135
  # @param [Hash] opts the optional parameters
136
- # @return [Job]
136
+ # @return [JobResponse]
137
137
  def jobs_pk_get(pk, opts = {})
138
138
  data, _status_code, _headers = jobs_pk_get_with_http_info(pk, opts)
139
139
  data
@@ -141,7 +141,7 @@ module AutosdeOpenapiClient
141
141
 
142
142
  # @param pk [Integer]
143
143
  # @param [Hash] opts the optional parameters
144
- # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
144
+ # @return [Array<(JobResponse, Integer, Hash)>] JobResponse data, response status code and response headers
145
145
  def jobs_pk_get_with_http_info(pk, opts = {})
146
146
  if @api_client.config.debugging
147
147
  @api_client.config.logger.debug 'Calling API: JobApi.jobs_pk_get ...'
@@ -168,7 +168,7 @@ module AutosdeOpenapiClient
168
168
  post_body = opts[:debug_body]
169
169
 
170
170
  # return_type
171
- return_type = opts[:debug_return_type] || 'Job'
171
+ return_type = opts[:debug_return_type] || 'JobResponse'
172
172
 
173
173
  # auth_names
174
174
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
@@ -191,19 +191,19 @@ module AutosdeOpenapiClient
191
191
  end
192
192
 
193
193
  # @param pk [Integer]
194
- # @param service [Service]
194
+ # @param service_update [ServiceUpdate]
195
195
  # @param [Hash] opts the optional parameters
196
- # @return [Service]
197
- def services_pk_put(pk, service, opts = {})
198
- data, _status_code, _headers = services_pk_put_with_http_info(pk, service, opts)
196
+ # @return [AsyncResponse]
197
+ def services_pk_put(pk, service_update, opts = {})
198
+ data, _status_code, _headers = services_pk_put_with_http_info(pk, service_update, opts)
199
199
  data
200
200
  end
201
201
 
202
202
  # @param pk [Integer]
203
- # @param service [Service]
203
+ # @param service_update [ServiceUpdate]
204
204
  # @param [Hash] opts the optional parameters
205
- # @return [Array<(Service, Integer, Hash)>] Service data, response status code and response headers
206
- def services_pk_put_with_http_info(pk, service, opts = {})
205
+ # @return [Array<(AsyncResponse, Integer, Hash)>] AsyncResponse data, response status code and response headers
206
+ def services_pk_put_with_http_info(pk, service_update, opts = {})
207
207
  if @api_client.config.debugging
208
208
  @api_client.config.logger.debug 'Calling API: ServiceApi.services_pk_put ...'
209
209
  end
@@ -211,9 +211,9 @@ module AutosdeOpenapiClient
211
211
  if @api_client.config.client_side_validation && pk.nil?
212
212
  fail ArgumentError, "Missing the required parameter 'pk' when calling ServiceApi.services_pk_put"
213
213
  end
214
- # verify the required parameter 'service' is set
215
- if @api_client.config.client_side_validation && service.nil?
216
- fail ArgumentError, "Missing the required parameter 'service' when calling ServiceApi.services_pk_put"
214
+ # verify the required parameter 'service_update' is set
215
+ if @api_client.config.client_side_validation && service_update.nil?
216
+ fail ArgumentError, "Missing the required parameter 'service_update' when calling ServiceApi.services_pk_put"
217
217
  end
218
218
  # resource path
219
219
  local_var_path = '/services/{pk}'.sub('{' + 'pk' + '}', CGI.escape(pk.to_s))
@@ -232,10 +232,10 @@ module AutosdeOpenapiClient
232
232
  form_params = opts[:form_params] || {}
233
233
 
234
234
  # http body (model)
235
- post_body = opts[:debug_body] || @api_client.object_to_http_body(service)
235
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(service_update)
236
236
 
237
237
  # return_type
238
- return_type = opts[:debug_return_type] || 'Service'
238
+ return_type = opts[:debug_return_type] || 'AsyncResponse'
239
239
 
240
240
  # auth_names
241
241
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module AutosdeOpenapiClient
17
- # hostClusterMembership
17
+ # HostClusterMembership
18
18
  class HostClusterMembership
19
19
  attr_accessor :cluster
20
20
 
@@ -25,8 +25,8 @@ module AutosdeOpenapiClient
25
25
  # extra
26
26
  attr_accessor :extra
27
27
 
28
- # object_id
29
- attr_accessor :object_id
28
+ # objects_ids
29
+ attr_accessor :objects_ids
30
30
 
31
31
  # result
32
32
  attr_accessor :result
@@ -52,7 +52,7 @@ module AutosdeOpenapiClient
52
52
  :'date_finished' => :'date_finished',
53
53
  :'date_started' => :'date_started',
54
54
  :'extra' => :'extra',
55
- :'object_id' => :'object_id',
55
+ :'objects_ids' => :'objects_ids',
56
56
  :'result' => :'result',
57
57
  :'status' => :'status',
58
58
  :'task_args' => :'task_args',
@@ -73,7 +73,7 @@ module AutosdeOpenapiClient
73
73
  :'date_finished' => :'Time',
74
74
  :'date_started' => :'Time',
75
75
  :'extra' => :'String',
76
- :'object_id' => :'String',
76
+ :'objects_ids' => :'Array<String>',
77
77
  :'result' => :'String',
78
78
  :'status' => :'String',
79
79
  :'task_args' => :'String',
@@ -116,10 +116,10 @@ module AutosdeOpenapiClient
116
116
  self.extra = attributes[:'extra']
117
117
  end
118
118
 
119
- if attributes.key?(:'object_id')
120
- self.object_id = attributes[:'object_id']
121
- else
122
- self.object_id = 'null'
119
+ if attributes.key?(:'objects_ids')
120
+ if (value = attributes[:'objects_ids']).is_a?(Array)
121
+ self.objects_ids = value
122
+ end
123
123
  end
124
124
 
125
125
  if attributes.key?(:'result')
@@ -168,7 +168,7 @@ module AutosdeOpenapiClient
168
168
  date_finished == o.date_finished &&
169
169
  date_started == o.date_started &&
170
170
  extra == o.extra &&
171
- object_id == o.object_id &&
171
+ objects_ids == o.objects_ids &&
172
172
  result == o.result &&
173
173
  status == o.status &&
174
174
  task_args == o.task_args &&
@@ -186,7 +186,7 @@ module AutosdeOpenapiClient
186
186
  # Calculates hash code according to all attributes.
187
187
  # @return [Integer] Hash code
188
188
  def hash
189
- [date_finished, date_started, extra, object_id, result, status, task_args, task_id, task_kwargs, task_name].hash
189
+ [date_finished, date_started, extra, objects_ids, result, status, task_args, task_id, task_kwargs, task_name].hash
190
190
  end
191
191
 
192
192
  # Builds the object from hash
@@ -0,0 +1,312 @@
1
+ =begin
2
+ #Site Manager API
3
+
4
+ #Site Manager API
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: autosde@il.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module AutosdeOpenapiClient
17
+ # TODO add description
18
+ class JobResponse
19
+ # date_finished
20
+ attr_accessor :date_finished
21
+
22
+ # date_started
23
+ attr_accessor :date_started
24
+
25
+ # extra
26
+ attr_accessor :extra
27
+
28
+ # objects_ids
29
+ attr_accessor :objects_ids
30
+
31
+ # result
32
+ attr_accessor :result
33
+
34
+ # status
35
+ attr_accessor :status
36
+
37
+ # task_args
38
+ attr_accessor :task_args
39
+
40
+ # task_id
41
+ attr_accessor :task_id
42
+
43
+ # task_kwargs
44
+ attr_accessor :task_kwargs
45
+
46
+ # task_name
47
+ attr_accessor :task_name
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'date_finished' => :'date_finished',
53
+ :'date_started' => :'date_started',
54
+ :'extra' => :'extra',
55
+ :'objects_ids' => :'objects_ids',
56
+ :'result' => :'result',
57
+ :'status' => :'status',
58
+ :'task_args' => :'task_args',
59
+ :'task_id' => :'task_id',
60
+ :'task_kwargs' => :'task_kwargs',
61
+ :'task_name' => :'task_name'
62
+ }
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'date_finished' => :'Time',
74
+ :'date_started' => :'Time',
75
+ :'extra' => :'String',
76
+ :'objects_ids' => :'Array<String>',
77
+ :'result' => :'String',
78
+ :'status' => :'String',
79
+ :'task_args' => :'String',
80
+ :'task_id' => :'String',
81
+ :'task_kwargs' => :'String',
82
+ :'task_name' => :'String'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::JobResponse` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::JobResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'date_finished')
108
+ self.date_finished = attributes[:'date_finished']
109
+ end
110
+
111
+ if attributes.key?(:'date_started')
112
+ self.date_started = attributes[:'date_started']
113
+ end
114
+
115
+ if attributes.key?(:'extra')
116
+ self.extra = attributes[:'extra']
117
+ end
118
+
119
+ if attributes.key?(:'objects_ids')
120
+ if (value = attributes[:'objects_ids']).is_a?(Array)
121
+ self.objects_ids = value
122
+ end
123
+ end
124
+
125
+ if attributes.key?(:'result')
126
+ self.result = attributes[:'result']
127
+ end
128
+
129
+ if attributes.key?(:'status')
130
+ self.status = attributes[:'status']
131
+ end
132
+
133
+ if attributes.key?(:'task_args')
134
+ self.task_args = attributes[:'task_args']
135
+ end
136
+
137
+ if attributes.key?(:'task_id')
138
+ self.task_id = attributes[:'task_id']
139
+ end
140
+
141
+ if attributes.key?(:'task_kwargs')
142
+ self.task_kwargs = attributes[:'task_kwargs']
143
+ end
144
+
145
+ if attributes.key?(:'task_name')
146
+ self.task_name = attributes[:'task_name']
147
+ end
148
+ end
149
+
150
+ # Show invalid properties with the reasons. Usually used together with valid?
151
+ # @return Array for valid properties with the reasons
152
+ def list_invalid_properties
153
+ invalid_properties = Array.new
154
+ invalid_properties
155
+ end
156
+
157
+ # Check to see if the all the properties in the model are valid
158
+ # @return true if the model is valid
159
+ def valid?
160
+ true
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ date_finished == o.date_finished &&
169
+ date_started == o.date_started &&
170
+ extra == o.extra &&
171
+ objects_ids == o.objects_ids &&
172
+ result == o.result &&
173
+ status == o.status &&
174
+ task_args == o.task_args &&
175
+ task_id == o.task_id &&
176
+ task_kwargs == o.task_kwargs &&
177
+ task_name == o.task_name
178
+ end
179
+
180
+ # @see the `==` method
181
+ # @param [Object] Object to be compared
182
+ def eql?(o)
183
+ self == o
184
+ end
185
+
186
+ # Calculates hash code according to all attributes.
187
+ # @return [Integer] Hash code
188
+ def hash
189
+ [date_finished, date_started, extra, objects_ids, result, status, task_args, task_id, task_kwargs, task_name].hash
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def self.build_from_hash(attributes)
196
+ new.build_from_hash(attributes)
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ self.class.openapi_types.each_pair do |key, type|
205
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
206
+ self.send("#{key}=", nil)
207
+ elsif type =~ /\AArray<(.*)>/i
208
+ # check to ensure the input is an array given that the attribute
209
+ # is documented as an array but the input is not
210
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
211
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
212
+ end
213
+ elsif !attributes[self.class.attribute_map[key]].nil?
214
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
215
+ end
216
+ end
217
+
218
+ self
219
+ end
220
+
221
+ # Deserializes the data based on type
222
+ # @param string type Data type
223
+ # @param string value Value to be deserialized
224
+ # @return [Object] Deserialized data
225
+ def _deserialize(type, value)
226
+ case type.to_sym
227
+ when :Time
228
+ Time.parse(value)
229
+ when :Date
230
+ Date.parse(value)
231
+ when :String
232
+ value.to_s
233
+ when :Integer
234
+ value.to_i
235
+ when :Float
236
+ value.to_f
237
+ when :Boolean
238
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
239
+ true
240
+ else
241
+ false
242
+ end
243
+ when :Object
244
+ # generic object (usually a Hash), return directly
245
+ value
246
+ when /\AArray<(?<inner_type>.+)>\z/
247
+ inner_type = Regexp.last_match[:inner_type]
248
+ value.map { |v| _deserialize(inner_type, v) }
249
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
250
+ k_type = Regexp.last_match[:k_type]
251
+ v_type = Regexp.last_match[:v_type]
252
+ {}.tap do |hash|
253
+ value.each do |k, v|
254
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
255
+ end
256
+ end
257
+ else # model
258
+ # models (e.g. Pet) or oneOf
259
+ klass = AutosdeOpenapiClient.const_get(type)
260
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
261
+ end
262
+ end
263
+
264
+ # Returns the string representation of the object
265
+ # @return [String] String presentation of the object
266
+ def to_s
267
+ to_hash.to_s
268
+ end
269
+
270
+ # to_body is an alias to to_hash (backward compatibility)
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_body
273
+ to_hash
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ # Outputs non-array value in the form of hash
293
+ # For object, use to_hash. Otherwise, just return the value
294
+ # @param [Object] value Any valid value
295
+ # @return [Hash] Returns the value in the form of hash
296
+ def _to_hash(value)
297
+ if value.is_a?(Array)
298
+ value.compact.map { |v| _to_hash(v) }
299
+ elsif value.is_a?(Hash)
300
+ {}.tap do |hash|
301
+ value.each { |k, v| hash[k] = _to_hash(v) }
302
+ end
303
+ elsif value.respond_to? :to_hash
304
+ value.to_hash
305
+ else
306
+ value
307
+ end
308
+ end
309
+
310
+ end
311
+
312
+ end