autosde_openapi_client 1.0.48 → 1.1.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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/docs/HostCluster.md +3 -1
  4. data/docs/HostClusterCreate.md +3 -1
  5. data/docs/HostClusterVolumeMapping.md +26 -0
  6. data/docs/HostClusterVolumeMappingApi.md +276 -0
  7. data/docs/HostClusterVolumeMappingCreate.md +24 -0
  8. data/docs/HostClusterVolumeMappingResponse.md +26 -0
  9. data/docs/SystemType.md +1 -1
  10. data/docs/SystemTypeCreate.md +1 -1
  11. data/docs/VolumeCreate.md +2 -0
  12. data/lib/autosde_openapi_client/api/host_cluster_volume_mapping_api.rb +254 -0
  13. data/lib/autosde_openapi_client/models/host_cluster.rb +13 -4
  14. data/lib/autosde_openapi_client/models/host_cluster_create.rb +13 -4
  15. data/lib/autosde_openapi_client/models/host_cluster_volume_mapping.rb +299 -0
  16. data/lib/autosde_openapi_client/models/host_cluster_volume_mapping_create.rb +291 -0
  17. data/lib/autosde_openapi_client/models/host_cluster_volume_mapping_response.rb +301 -0
  18. data/lib/autosde_openapi_client/models/storage_system.rb +0 -15
  19. data/lib/autosde_openapi_client/models/storage_system_create.rb +0 -15
  20. data/lib/autosde_openapi_client/models/system_type.rb +6 -6
  21. data/lib/autosde_openapi_client/models/system_type_create.rb +6 -6
  22. data/lib/autosde_openapi_client/models/volume_create.rb +13 -1
  23. data/lib/autosde_openapi_client/version.rb +2 -2
  24. data/lib/autosde_openapi_client.rb +4 -0
  25. data/spec/api/host_cluster_volume_mapping_api_spec.rb +74 -0
  26. data/spec/models/host_cluster_create_spec.rb +6 -0
  27. data/spec/models/host_cluster_spec.rb +6 -0
  28. data/spec/models/host_cluster_volume_mapping_create_spec.rb +56 -0
  29. data/spec/models/host_cluster_volume_mapping_response_spec.rb +62 -0
  30. data/spec/models/host_cluster_volume_mapping_spec.rb +62 -0
  31. data/spec/models/system_type_create_spec.rb +1 -1
  32. data/spec/models/system_type_spec.rb +1 -1
  33. data/spec/models/volume_create_spec.rb +6 -0
  34. metadata +83 -67
@@ -0,0 +1,254 @@
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 'cgi'
14
+
15
+ module AutosdeOpenapiClient
16
+ class HostClusterVolumeMappingApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # @param [Hash] opts the optional parameters
23
+ # @return [Array<HostClusterVolumeMappingResponse>]
24
+ def host_clusters_mapping_get(opts = {})
25
+ data, _status_code, _headers = host_clusters_mapping_get_with_http_info(opts)
26
+ data
27
+ end
28
+
29
+ # @param [Hash] opts the optional parameters
30
+ # @return [Array<(Array<HostClusterVolumeMappingResponse>, Integer, Hash)>] Array<HostClusterVolumeMappingResponse> data, response status code and response headers
31
+ def host_clusters_mapping_get_with_http_info(opts = {})
32
+ if @api_client.config.debugging
33
+ @api_client.config.logger.debug 'Calling API: HostClusterVolumeMappingApi.host_clusters_mapping_get ...'
34
+ end
35
+ # resource path
36
+ local_var_path = '/host-clusters-mapping'
37
+
38
+ # query parameters
39
+ query_params = opts[:query_params] || {}
40
+
41
+ # header parameters
42
+ header_params = opts[:header_params] || {}
43
+ # HTTP header 'Accept' (if needed)
44
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
45
+
46
+ # form parameters
47
+ form_params = opts[:form_params] || {}
48
+
49
+ # http body (model)
50
+ post_body = opts[:debug_body]
51
+
52
+ # return_type
53
+ return_type = opts[:debug_return_type] || 'Array<HostClusterVolumeMappingResponse>'
54
+
55
+ # auth_names
56
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
57
+
58
+ new_options = opts.merge(
59
+ :operation => :"HostClusterVolumeMappingApi.host_clusters_mapping_get",
60
+ :header_params => header_params,
61
+ :query_params => query_params,
62
+ :form_params => form_params,
63
+ :body => post_body,
64
+ :auth_names => auth_names,
65
+ :return_type => return_type
66
+ )
67
+
68
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
69
+ if @api_client.config.debugging
70
+ @api_client.config.logger.debug "API called: HostClusterVolumeMappingApi#host_clusters_mapping_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
71
+ end
72
+ return data, status_code, headers
73
+ end
74
+
75
+ # @param pk [Integer]
76
+ # @param [Hash] opts the optional parameters
77
+ # @return [Array<HostClusterVolumeMappingResponse>]
78
+ def host_clusters_mapping_pk_delete(pk, opts = {})
79
+ data, _status_code, _headers = host_clusters_mapping_pk_delete_with_http_info(pk, opts)
80
+ data
81
+ end
82
+
83
+ # @param pk [Integer]
84
+ # @param [Hash] opts the optional parameters
85
+ # @return [Array<(Array<HostClusterVolumeMappingResponse>, Integer, Hash)>] Array<HostClusterVolumeMappingResponse> data, response status code and response headers
86
+ def host_clusters_mapping_pk_delete_with_http_info(pk, opts = {})
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug 'Calling API: HostClusterVolumeMappingApi.host_clusters_mapping_pk_delete ...'
89
+ end
90
+ # verify the required parameter 'pk' is set
91
+ if @api_client.config.client_side_validation && pk.nil?
92
+ fail ArgumentError, "Missing the required parameter 'pk' when calling HostClusterVolumeMappingApi.host_clusters_mapping_pk_delete"
93
+ end
94
+ # resource path
95
+ local_var_path = '/host-clusters-mapping/{pk}'.sub('{' + 'pk' + '}', CGI.escape(pk.to_s))
96
+
97
+ # query parameters
98
+ query_params = opts[:query_params] || {}
99
+
100
+ # header parameters
101
+ header_params = opts[:header_params] || {}
102
+ # HTTP header 'Accept' (if needed)
103
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
104
+
105
+ # form parameters
106
+ form_params = opts[:form_params] || {}
107
+
108
+ # http body (model)
109
+ post_body = opts[:debug_body]
110
+
111
+ # return_type
112
+ return_type = opts[:debug_return_type] || 'Array<HostClusterVolumeMappingResponse>'
113
+
114
+ # auth_names
115
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
116
+
117
+ new_options = opts.merge(
118
+ :operation => :"HostClusterVolumeMappingApi.host_clusters_mapping_pk_delete",
119
+ :header_params => header_params,
120
+ :query_params => query_params,
121
+ :form_params => form_params,
122
+ :body => post_body,
123
+ :auth_names => auth_names,
124
+ :return_type => return_type
125
+ )
126
+
127
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
128
+ if @api_client.config.debugging
129
+ @api_client.config.logger.debug "API called: HostClusterVolumeMappingApi#host_clusters_mapping_pk_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
130
+ end
131
+ return data, status_code, headers
132
+ end
133
+
134
+ # @param pk [Integer]
135
+ # @param [Hash] opts the optional parameters
136
+ # @return [Array<HostClusterVolumeMappingResponse>]
137
+ def host_clusters_mapping_pk_get(pk, opts = {})
138
+ data, _status_code, _headers = host_clusters_mapping_pk_get_with_http_info(pk, opts)
139
+ data
140
+ end
141
+
142
+ # @param pk [Integer]
143
+ # @param [Hash] opts the optional parameters
144
+ # @return [Array<(Array<HostClusterVolumeMappingResponse>, Integer, Hash)>] Array<HostClusterVolumeMappingResponse> data, response status code and response headers
145
+ def host_clusters_mapping_pk_get_with_http_info(pk, opts = {})
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug 'Calling API: HostClusterVolumeMappingApi.host_clusters_mapping_pk_get ...'
148
+ end
149
+ # verify the required parameter 'pk' is set
150
+ if @api_client.config.client_side_validation && pk.nil?
151
+ fail ArgumentError, "Missing the required parameter 'pk' when calling HostClusterVolumeMappingApi.host_clusters_mapping_pk_get"
152
+ end
153
+ # resource path
154
+ local_var_path = '/host-clusters-mapping/{pk}'.sub('{' + 'pk' + '}', CGI.escape(pk.to_s))
155
+
156
+ # query parameters
157
+ query_params = opts[:query_params] || {}
158
+
159
+ # header parameters
160
+ header_params = opts[:header_params] || {}
161
+ # HTTP header 'Accept' (if needed)
162
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
163
+
164
+ # form parameters
165
+ form_params = opts[:form_params] || {}
166
+
167
+ # http body (model)
168
+ post_body = opts[:debug_body]
169
+
170
+ # return_type
171
+ return_type = opts[:debug_return_type] || 'Array<HostClusterVolumeMappingResponse>'
172
+
173
+ # auth_names
174
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
175
+
176
+ new_options = opts.merge(
177
+ :operation => :"HostClusterVolumeMappingApi.host_clusters_mapping_pk_get",
178
+ :header_params => header_params,
179
+ :query_params => query_params,
180
+ :form_params => form_params,
181
+ :body => post_body,
182
+ :auth_names => auth_names,
183
+ :return_type => return_type
184
+ )
185
+
186
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug "API called: HostClusterVolumeMappingApi#host_clusters_mapping_pk_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
189
+ end
190
+ return data, status_code, headers
191
+ end
192
+
193
+ # @param host_cluster_volume_mapping_create [HostClusterVolumeMappingCreate]
194
+ # @param [Hash] opts the optional parameters
195
+ # @return [HostClusterVolumeMapping]
196
+ def host_clusters_mapping_post(host_cluster_volume_mapping_create, opts = {})
197
+ data, _status_code, _headers = host_clusters_mapping_post_with_http_info(host_cluster_volume_mapping_create, opts)
198
+ data
199
+ end
200
+
201
+ # @param host_cluster_volume_mapping_create [HostClusterVolumeMappingCreate]
202
+ # @param [Hash] opts the optional parameters
203
+ # @return [Array<(HostClusterVolumeMapping, Integer, Hash)>] HostClusterVolumeMapping data, response status code and response headers
204
+ def host_clusters_mapping_post_with_http_info(host_cluster_volume_mapping_create, opts = {})
205
+ if @api_client.config.debugging
206
+ @api_client.config.logger.debug 'Calling API: HostClusterVolumeMappingApi.host_clusters_mapping_post ...'
207
+ end
208
+ # verify the required parameter 'host_cluster_volume_mapping_create' is set
209
+ if @api_client.config.client_side_validation && host_cluster_volume_mapping_create.nil?
210
+ fail ArgumentError, "Missing the required parameter 'host_cluster_volume_mapping_create' when calling HostClusterVolumeMappingApi.host_clusters_mapping_post"
211
+ end
212
+ # resource path
213
+ local_var_path = '/host-clusters-mapping'
214
+
215
+ # query parameters
216
+ query_params = opts[:query_params] || {}
217
+
218
+ # header parameters
219
+ header_params = opts[:header_params] || {}
220
+ # HTTP header 'Accept' (if needed)
221
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
222
+ # HTTP header 'Content-Type'
223
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
224
+
225
+ # form parameters
226
+ form_params = opts[:form_params] || {}
227
+
228
+ # http body (model)
229
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(host_cluster_volume_mapping_create)
230
+
231
+ # return_type
232
+ return_type = opts[:debug_return_type] || 'HostClusterVolumeMapping'
233
+
234
+ # auth_names
235
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
236
+
237
+ new_options = opts.merge(
238
+ :operation => :"HostClusterVolumeMappingApi.host_clusters_mapping_post",
239
+ :header_params => header_params,
240
+ :query_params => query_params,
241
+ :form_params => form_params,
242
+ :body => post_body,
243
+ :auth_names => auth_names,
244
+ :return_type => return_type
245
+ )
246
+
247
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug "API called: HostClusterVolumeMappingApi#host_clusters_mapping_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
250
+ end
251
+ return data, status_code, headers
252
+ end
253
+ end
254
+ end
@@ -39,6 +39,8 @@ module AutosdeOpenapiClient
39
39
  # uuid
40
40
  attr_accessor :uuid
41
41
 
42
+ attr_accessor :volumes
43
+
42
44
  class EnumAttributeValidator
43
45
  attr_reader :datatype
44
46
  attr_reader :allowable_values
@@ -71,7 +73,8 @@ module AutosdeOpenapiClient
71
73
  :'protocol' => :'protocol',
72
74
  :'status' => :'status',
73
75
  :'storage_system' => :'storage_system',
74
- :'uuid' => :'uuid'
76
+ :'uuid' => :'uuid',
77
+ :'volumes' => :'volumes'
75
78
  }
76
79
  end
77
80
 
@@ -90,7 +93,8 @@ module AutosdeOpenapiClient
90
93
  :'protocol' => :'String',
91
94
  :'status' => :'String',
92
95
  :'storage_system' => :'StorageSystem',
93
- :'uuid' => :'String'
96
+ :'uuid' => :'String',
97
+ :'volumes' => :'Volume'
94
98
  }
95
99
  end
96
100
 
@@ -146,6 +150,10 @@ module AutosdeOpenapiClient
146
150
  if attributes.key?(:'uuid')
147
151
  self.uuid = attributes[:'uuid']
148
152
  end
153
+
154
+ if attributes.key?(:'volumes')
155
+ self.volumes = attributes[:'volumes']
156
+ end
149
157
  end
150
158
 
151
159
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -250,7 +258,8 @@ module AutosdeOpenapiClient
250
258
  protocol == o.protocol &&
251
259
  status == o.status &&
252
260
  storage_system == o.storage_system &&
253
- uuid == o.uuid
261
+ uuid == o.uuid &&
262
+ volumes == o.volumes
254
263
  end
255
264
 
256
265
  # @see the `==` method
@@ -262,7 +271,7 @@ module AutosdeOpenapiClient
262
271
  # Calculates hash code according to all attributes.
263
272
  # @return [Integer] Hash code
264
273
  def hash
265
- [component_state, name, owner_id, owner_name, protocol, status, storage_system, uuid].hash
274
+ [component_state, name, owner_id, owner_name, protocol, status, storage_system, uuid, volumes].hash
266
275
  end
267
276
 
268
277
  # Builds the object from hash
@@ -33,6 +33,8 @@ module AutosdeOpenapiClient
33
33
 
34
34
  attr_accessor :storage_system
35
35
 
36
+ attr_accessor :volumes
37
+
36
38
  # Attribute mapping from ruby-style variable name to JSON key.
37
39
  def self.attribute_map
38
40
  {
@@ -41,7 +43,8 @@ module AutosdeOpenapiClient
41
43
  :'owner_name' => :'owner_name',
42
44
  :'protocol' => :'protocol',
43
45
  :'status' => :'status',
44
- :'storage_system' => :'storage_system'
46
+ :'storage_system' => :'storage_system',
47
+ :'volumes' => :'volumes'
45
48
  }
46
49
  end
47
50
 
@@ -58,7 +61,8 @@ module AutosdeOpenapiClient
58
61
  :'owner_name' => :'String',
59
62
  :'protocol' => :'String',
60
63
  :'status' => :'String',
61
- :'storage_system' => :'StorageSystem'
64
+ :'storage_system' => :'StorageSystem',
65
+ :'volumes' => :'Volume'
62
66
  }
63
67
  end
64
68
 
@@ -106,6 +110,10 @@ module AutosdeOpenapiClient
106
110
  if attributes.key?(:'storage_system')
107
111
  self.storage_system = attributes[:'storage_system']
108
112
  end
113
+
114
+ if attributes.key?(:'volumes')
115
+ self.volumes = attributes[:'volumes']
116
+ end
109
117
  end
110
118
 
111
119
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -191,7 +199,8 @@ module AutosdeOpenapiClient
191
199
  owner_name == o.owner_name &&
192
200
  protocol == o.protocol &&
193
201
  status == o.status &&
194
- storage_system == o.storage_system
202
+ storage_system == o.storage_system &&
203
+ volumes == o.volumes
195
204
  end
196
205
 
197
206
  # @see the `==` method
@@ -203,7 +212,7 @@ module AutosdeOpenapiClient
203
212
  # Calculates hash code according to all attributes.
204
213
  # @return [Integer] Hash code
205
214
  def hash
206
- [name, owner_id, owner_name, protocol, status, storage_system].hash
215
+ [name, owner_id, owner_name, protocol, status, storage_system, volumes].hash
207
216
  end
208
217
 
209
218
  # Builds the object from hash
@@ -0,0 +1,299 @@
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
+ # HostClusterVolumeMapping
18
+ class HostClusterVolumeMapping
19
+ attr_accessor :cluster
20
+
21
+ # component_state
22
+ attr_accessor :component_state
23
+
24
+ # lun
25
+ attr_accessor :lun
26
+
27
+ # uuid
28
+ attr_accessor :uuid
29
+
30
+ attr_accessor :volume
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'cluster' => :'cluster',
58
+ :'component_state' => :'component_state',
59
+ :'lun' => :'lun',
60
+ :'uuid' => :'uuid',
61
+ :'volume' => :'volume'
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
+ :'cluster' => :'HostCluster',
74
+ :'component_state' => :'String',
75
+ :'lun' => :'Integer',
76
+ :'uuid' => :'String',
77
+ :'volume' => :'Volume'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ ])
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::HostClusterVolumeMapping` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!self.class.attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::HostClusterVolumeMapping`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'cluster')
103
+ self.cluster = attributes[:'cluster']
104
+ end
105
+
106
+ if attributes.key?(:'component_state')
107
+ self.component_state = attributes[:'component_state']
108
+ end
109
+
110
+ if attributes.key?(:'lun')
111
+ self.lun = attributes[:'lun']
112
+ else
113
+ self.lun = 0
114
+ end
115
+
116
+ if attributes.key?(:'uuid')
117
+ self.uuid = attributes[:'uuid']
118
+ end
119
+
120
+ if attributes.key?(:'volume')
121
+ self.volume = attributes[:'volume']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ invalid_properties = Array.new
129
+ if !@component_state.nil? && @component_state.to_s.length > 32
130
+ invalid_properties.push('invalid value for "component_state", the character length must be smaller than or equal to 32.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ component_state_validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
140
+ return false unless component_state_validator.valid?(@component_state)
141
+ return false if !@component_state.nil? && @component_state.to_s.length > 32
142
+ true
143
+ end
144
+
145
+ # Custom attribute writer method checking allowed values (enum).
146
+ # @param [Object] component_state Object to be assigned
147
+ def component_state=(component_state)
148
+ validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
149
+ unless validator.valid?(component_state)
150
+ fail ArgumentError, "invalid value for \"component_state\", must be one of #{validator.allowable_values}."
151
+ end
152
+ @component_state = component_state
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
+ cluster == o.cluster &&
161
+ component_state == o.component_state &&
162
+ lun == o.lun &&
163
+ uuid == o.uuid &&
164
+ volume == o.volume
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [cluster, component_state, lun, uuid, volume].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ new.build_from_hash(attributes)
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def build_from_hash(attributes)
190
+ return nil unless attributes.is_a?(Hash)
191
+ self.class.openapi_types.each_pair do |key, type|
192
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
193
+ self.send("#{key}=", nil)
194
+ elsif type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
198
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
+ end
200
+ elsif !attributes[self.class.attribute_map[key]].nil?
201
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
202
+ end
203
+ end
204
+
205
+ self
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def _deserialize(type, value)
213
+ case type.to_sym
214
+ when :Time
215
+ Time.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :Boolean
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ # models (e.g. Pet) or oneOf
246
+ klass = AutosdeOpenapiClient.const_get(type)
247
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
248
+ end
249
+ end
250
+
251
+ # Returns the string representation of the object
252
+ # @return [String] String presentation of the object
253
+ def to_s
254
+ to_hash.to_s
255
+ end
256
+
257
+ # to_body is an alias to to_hash (backward compatibility)
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_body
260
+ to_hash
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+
297
+ end
298
+
299
+ end