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