pnap_network_storage_api 2.0.3 → 2.0.5
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/VERSION +1 -1
- data/lib/pnap_network_storage_api/api/storage_networks_api.rb +12 -12
- data/lib/pnap_network_storage_api/api_client.rb +17 -14
- data/lib/pnap_network_storage_api/api_error.rb +1 -1
- data/lib/pnap_network_storage_api/api_model_base.rb +88 -0
- data/lib/pnap_network_storage_api/configuration.rb +11 -1
- data/lib/pnap_network_storage_api/models/error.rb +21 -78
- data/lib/pnap_network_storage_api/models/nfs_permissions.rb +11 -78
- data/lib/pnap_network_storage_api/models/nfs_permissions_create.rb +11 -78
- data/lib/pnap_network_storage_api/models/nfs_permissions_update.rb +11 -78
- data/lib/pnap_network_storage_api/models/permissions.rb +11 -78
- data/lib/pnap_network_storage_api/models/permissions_create.rb +11 -78
- data/lib/pnap_network_storage_api/models/permissions_update.rb +11 -78
- data/lib/pnap_network_storage_api/models/status.rb +1 -1
- data/lib/pnap_network_storage_api/models/storage_network.rb +11 -78
- data/lib/pnap_network_storage_api/models/storage_network_create.rb +23 -80
- data/lib/pnap_network_storage_api/models/storage_network_update.rb +13 -80
- data/lib/pnap_network_storage_api/models/storage_network_volume_create.rb +15 -82
- data/lib/pnap_network_storage_api/models/tag_assignment.rb +41 -78
- data/lib/pnap_network_storage_api/models/tag_assignment_request.rb +21 -78
- data/lib/pnap_network_storage_api/models/volume.rb +11 -78
- data/lib/pnap_network_storage_api/models/volume_create.rb +15 -82
- data/lib/pnap_network_storage_api/models/volume_update.rb +15 -82
- data/lib/pnap_network_storage_api/version.rb +1 -2
- data/lib/pnap_network_storage_api.rb +2 -1
- data/pnap_network_storage_api.gemspec +6 -6
- data/spec/api/storage_networks_api_spec.rb +1 -1
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/nfs_permissions_create_spec.rb +2 -2
- data/spec/models/nfs_permissions_spec.rb +2 -2
- data/spec/models/nfs_permissions_update_spec.rb +2 -2
- data/spec/models/permissions_create_spec.rb +2 -2
- data/spec/models/permissions_spec.rb +2 -2
- data/spec/models/permissions_update_spec.rb +2 -2
- data/spec/models/status_spec.rb +2 -2
- data/spec/models/storage_network_create_spec.rb +2 -2
- data/spec/models/storage_network_spec.rb +2 -2
- data/spec/models/storage_network_update_spec.rb +2 -2
- data/spec/models/storage_network_volume_create_spec.rb +2 -2
- data/spec/models/tag_assignment_request_spec.rb +2 -2
- data/spec/models/tag_assignment_spec.rb +2 -2
- data/spec/models/volume_create_spec.rb +2 -2
- data/spec/models/volume_spec.rb +2 -2
- data/spec/models/volume_update_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +21 -17
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module NetworkStorageApi
|
|
17
17
|
# Storage network.
|
|
18
|
-
class StorageNetwork
|
|
18
|
+
class StorageNetwork < ApiModelBase
|
|
19
19
|
# Storage network ID.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -83,9 +83,14 @@ module NetworkStorageApi
|
|
|
83
83
|
}
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
# Returns attribute mapping this model knows about
|
|
87
|
+
def self.acceptable_attribute_map
|
|
88
|
+
attribute_map
|
|
89
|
+
end
|
|
90
|
+
|
|
86
91
|
# Returns all the JSON keys this model knows about
|
|
87
92
|
def self.acceptable_attributes
|
|
88
|
-
|
|
93
|
+
acceptable_attribute_map.values
|
|
89
94
|
end
|
|
90
95
|
|
|
91
96
|
# Attribute type mapping.
|
|
@@ -118,9 +123,10 @@ module NetworkStorageApi
|
|
|
118
123
|
end
|
|
119
124
|
|
|
120
125
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
126
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
121
127
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
122
|
-
if (!
|
|
123
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetwork`. Please check the name to make sure it's valid. List of attributes: " +
|
|
128
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
129
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetwork`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
124
130
|
end
|
|
125
131
|
h[k.to_sym] = v
|
|
126
132
|
}
|
|
@@ -237,61 +243,6 @@ module NetworkStorageApi
|
|
|
237
243
|
new(transformed_hash)
|
|
238
244
|
end
|
|
239
245
|
|
|
240
|
-
# Deserializes the data based on type
|
|
241
|
-
# @param string type Data type
|
|
242
|
-
# @param string value Value to be deserialized
|
|
243
|
-
# @return [Object] Deserialized data
|
|
244
|
-
def self._deserialize(type, value)
|
|
245
|
-
case type.to_sym
|
|
246
|
-
when :Time
|
|
247
|
-
Time.parse(value)
|
|
248
|
-
when :Date
|
|
249
|
-
Date.parse(value)
|
|
250
|
-
when :String
|
|
251
|
-
value.to_s
|
|
252
|
-
when :Integer
|
|
253
|
-
value.to_i
|
|
254
|
-
when :Float
|
|
255
|
-
value.to_f
|
|
256
|
-
when :Boolean
|
|
257
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
258
|
-
true
|
|
259
|
-
else
|
|
260
|
-
false
|
|
261
|
-
end
|
|
262
|
-
when :Object
|
|
263
|
-
# generic object (usually a Hash), return directly
|
|
264
|
-
value
|
|
265
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
266
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
267
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
268
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
269
|
-
k_type = Regexp.last_match[:k_type]
|
|
270
|
-
v_type = Regexp.last_match[:v_type]
|
|
271
|
-
{}.tap do |hash|
|
|
272
|
-
value.each do |k, v|
|
|
273
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
else # model
|
|
277
|
-
# models (e.g. Pet) or oneOf
|
|
278
|
-
klass = NetworkStorageApi.const_get(type)
|
|
279
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
280
|
-
end
|
|
281
|
-
end
|
|
282
|
-
|
|
283
|
-
# Returns the string representation of the object
|
|
284
|
-
# @return [String] String presentation of the object
|
|
285
|
-
def to_s
|
|
286
|
-
to_hash.to_s
|
|
287
|
-
end
|
|
288
|
-
|
|
289
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
290
|
-
# @return [Hash] Returns the object in the form of hash
|
|
291
|
-
def to_body
|
|
292
|
-
to_hash
|
|
293
|
-
end
|
|
294
|
-
|
|
295
246
|
# Returns the object in the form of hash
|
|
296
247
|
# @return [Hash] Returns the object in the form of hash
|
|
297
248
|
def to_hash
|
|
@@ -308,24 +259,6 @@ module NetworkStorageApi
|
|
|
308
259
|
hash
|
|
309
260
|
end
|
|
310
261
|
|
|
311
|
-
# Outputs non-array value in the form of hash
|
|
312
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
313
|
-
# @param [Object] value Any valid value
|
|
314
|
-
# @return [Hash] Returns the value in the form of hash
|
|
315
|
-
def _to_hash(value)
|
|
316
|
-
if value.is_a?(Array)
|
|
317
|
-
value.compact.map { |v| _to_hash(v) }
|
|
318
|
-
elsif value.is_a?(Hash)
|
|
319
|
-
{}.tap do |hash|
|
|
320
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
321
|
-
end
|
|
322
|
-
elsif value.respond_to? :to_hash
|
|
323
|
-
value.to_hash
|
|
324
|
-
else
|
|
325
|
-
value
|
|
326
|
-
end
|
|
327
|
-
end
|
|
328
|
-
|
|
329
262
|
end
|
|
330
263
|
|
|
331
264
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module NetworkStorageApi
|
|
17
17
|
# Create Storage Network.
|
|
18
|
-
class StorageNetworkCreate
|
|
18
|
+
class StorageNetworkCreate < ApiModelBase
|
|
19
19
|
# Storage network friendly name.
|
|
20
20
|
attr_accessor :name
|
|
21
21
|
|
|
@@ -42,9 +42,14 @@ module NetworkStorageApi
|
|
|
42
42
|
}
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
45
50
|
# Returns all the JSON keys this model knows about
|
|
46
51
|
def self.acceptable_attributes
|
|
47
|
-
|
|
52
|
+
acceptable_attribute_map.values
|
|
48
53
|
end
|
|
49
54
|
|
|
50
55
|
# Attribute type mapping.
|
|
@@ -72,9 +77,10 @@ module NetworkStorageApi
|
|
|
72
77
|
end
|
|
73
78
|
|
|
74
79
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
81
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
-
if (!
|
|
77
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetworkCreate`. Please check the name to make sure it's valid. List of attributes: " +
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetworkCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
84
|
end
|
|
79
85
|
h[k.to_sym] = v
|
|
80
86
|
}
|
|
@@ -122,7 +128,7 @@ module NetworkStorageApi
|
|
|
122
128
|
end
|
|
123
129
|
|
|
124
130
|
if @name.to_s.length < 1
|
|
125
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
131
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
126
132
|
end
|
|
127
133
|
|
|
128
134
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
|
|
@@ -191,7 +197,7 @@ module NetworkStorageApi
|
|
|
191
197
|
end
|
|
192
198
|
|
|
193
199
|
if name.to_s.length < 1
|
|
194
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
200
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
195
201
|
end
|
|
196
202
|
|
|
197
203
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
|
|
@@ -216,6 +222,16 @@ module NetworkStorageApi
|
|
|
216
222
|
@description = description
|
|
217
223
|
end
|
|
218
224
|
|
|
225
|
+
# Custom attribute writer method with validation
|
|
226
|
+
# @param [Object] location Value to be assigned
|
|
227
|
+
def location=(location)
|
|
228
|
+
if location.nil?
|
|
229
|
+
fail ArgumentError, 'location cannot be nil'
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@location = location
|
|
233
|
+
end
|
|
234
|
+
|
|
219
235
|
# Custom attribute writer method with validation
|
|
220
236
|
# @param [Object] volumes Value to be assigned
|
|
221
237
|
def volumes=(volumes)
|
|
@@ -299,61 +315,6 @@ module NetworkStorageApi
|
|
|
299
315
|
new(transformed_hash)
|
|
300
316
|
end
|
|
301
317
|
|
|
302
|
-
# Deserializes the data based on type
|
|
303
|
-
# @param string type Data type
|
|
304
|
-
# @param string value Value to be deserialized
|
|
305
|
-
# @return [Object] Deserialized data
|
|
306
|
-
def self._deserialize(type, value)
|
|
307
|
-
case type.to_sym
|
|
308
|
-
when :Time
|
|
309
|
-
Time.parse(value)
|
|
310
|
-
when :Date
|
|
311
|
-
Date.parse(value)
|
|
312
|
-
when :String
|
|
313
|
-
value.to_s
|
|
314
|
-
when :Integer
|
|
315
|
-
value.to_i
|
|
316
|
-
when :Float
|
|
317
|
-
value.to_f
|
|
318
|
-
when :Boolean
|
|
319
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
320
|
-
true
|
|
321
|
-
else
|
|
322
|
-
false
|
|
323
|
-
end
|
|
324
|
-
when :Object
|
|
325
|
-
# generic object (usually a Hash), return directly
|
|
326
|
-
value
|
|
327
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
328
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
329
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
330
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
331
|
-
k_type = Regexp.last_match[:k_type]
|
|
332
|
-
v_type = Regexp.last_match[:v_type]
|
|
333
|
-
{}.tap do |hash|
|
|
334
|
-
value.each do |k, v|
|
|
335
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
336
|
-
end
|
|
337
|
-
end
|
|
338
|
-
else # model
|
|
339
|
-
# models (e.g. Pet) or oneOf
|
|
340
|
-
klass = NetworkStorageApi.const_get(type)
|
|
341
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
342
|
-
end
|
|
343
|
-
end
|
|
344
|
-
|
|
345
|
-
# Returns the string representation of the object
|
|
346
|
-
# @return [String] String presentation of the object
|
|
347
|
-
def to_s
|
|
348
|
-
to_hash.to_s
|
|
349
|
-
end
|
|
350
|
-
|
|
351
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
352
|
-
# @return [Hash] Returns the object in the form of hash
|
|
353
|
-
def to_body
|
|
354
|
-
to_hash
|
|
355
|
-
end
|
|
356
|
-
|
|
357
318
|
# Returns the object in the form of hash
|
|
358
319
|
# @return [Hash] Returns the object in the form of hash
|
|
359
320
|
def to_hash
|
|
@@ -370,24 +331,6 @@ module NetworkStorageApi
|
|
|
370
331
|
hash
|
|
371
332
|
end
|
|
372
333
|
|
|
373
|
-
# Outputs non-array value in the form of hash
|
|
374
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
375
|
-
# @param [Object] value Any valid value
|
|
376
|
-
# @return [Hash] Returns the value in the form of hash
|
|
377
|
-
def _to_hash(value)
|
|
378
|
-
if value.is_a?(Array)
|
|
379
|
-
value.compact.map { |v| _to_hash(v) }
|
|
380
|
-
elsif value.is_a?(Hash)
|
|
381
|
-
{}.tap do |hash|
|
|
382
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
383
|
-
end
|
|
384
|
-
elsif value.respond_to? :to_hash
|
|
385
|
-
value.to_hash
|
|
386
|
-
else
|
|
387
|
-
value
|
|
388
|
-
end
|
|
389
|
-
end
|
|
390
|
-
|
|
391
334
|
end
|
|
392
335
|
|
|
393
336
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module NetworkStorageApi
|
|
17
17
|
# Update storage network.
|
|
18
|
-
class StorageNetworkUpdate
|
|
18
|
+
class StorageNetworkUpdate < ApiModelBase
|
|
19
19
|
# Storage network friendly name.
|
|
20
20
|
attr_accessor :name
|
|
21
21
|
|
|
@@ -30,9 +30,14 @@ module NetworkStorageApi
|
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
33
38
|
# Returns all the JSON keys this model knows about
|
|
34
39
|
def self.acceptable_attributes
|
|
35
|
-
|
|
40
|
+
acceptable_attribute_map.values
|
|
36
41
|
end
|
|
37
42
|
|
|
38
43
|
# Attribute type mapping.
|
|
@@ -57,9 +62,10 @@ module NetworkStorageApi
|
|
|
57
62
|
end
|
|
58
63
|
|
|
59
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
-
if (!
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetworkUpdate`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetworkUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
69
|
end
|
|
64
70
|
h[k.to_sym] = v
|
|
65
71
|
}
|
|
@@ -83,7 +89,7 @@ module NetworkStorageApi
|
|
|
83
89
|
end
|
|
84
90
|
|
|
85
91
|
if !@name.nil? && @name.to_s.length < 1
|
|
86
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
92
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
87
93
|
end
|
|
88
94
|
|
|
89
95
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
|
|
@@ -121,7 +127,7 @@ module NetworkStorageApi
|
|
|
121
127
|
end
|
|
122
128
|
|
|
123
129
|
if name.to_s.length < 1
|
|
124
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
130
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
125
131
|
end
|
|
126
132
|
|
|
127
133
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
|
|
@@ -190,61 +196,6 @@ module NetworkStorageApi
|
|
|
190
196
|
new(transformed_hash)
|
|
191
197
|
end
|
|
192
198
|
|
|
193
|
-
# Deserializes the data based on type
|
|
194
|
-
# @param string type Data type
|
|
195
|
-
# @param string value Value to be deserialized
|
|
196
|
-
# @return [Object] Deserialized data
|
|
197
|
-
def self._deserialize(type, value)
|
|
198
|
-
case type.to_sym
|
|
199
|
-
when :Time
|
|
200
|
-
Time.parse(value)
|
|
201
|
-
when :Date
|
|
202
|
-
Date.parse(value)
|
|
203
|
-
when :String
|
|
204
|
-
value.to_s
|
|
205
|
-
when :Integer
|
|
206
|
-
value.to_i
|
|
207
|
-
when :Float
|
|
208
|
-
value.to_f
|
|
209
|
-
when :Boolean
|
|
210
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
211
|
-
true
|
|
212
|
-
else
|
|
213
|
-
false
|
|
214
|
-
end
|
|
215
|
-
when :Object
|
|
216
|
-
# generic object (usually a Hash), return directly
|
|
217
|
-
value
|
|
218
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
219
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
220
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
221
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
222
|
-
k_type = Regexp.last_match[:k_type]
|
|
223
|
-
v_type = Regexp.last_match[:v_type]
|
|
224
|
-
{}.tap do |hash|
|
|
225
|
-
value.each do |k, v|
|
|
226
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
227
|
-
end
|
|
228
|
-
end
|
|
229
|
-
else # model
|
|
230
|
-
# models (e.g. Pet) or oneOf
|
|
231
|
-
klass = NetworkStorageApi.const_get(type)
|
|
232
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
233
|
-
end
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
# Returns the string representation of the object
|
|
237
|
-
# @return [String] String presentation of the object
|
|
238
|
-
def to_s
|
|
239
|
-
to_hash.to_s
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
243
|
-
# @return [Hash] Returns the object in the form of hash
|
|
244
|
-
def to_body
|
|
245
|
-
to_hash
|
|
246
|
-
end
|
|
247
|
-
|
|
248
199
|
# Returns the object in the form of hash
|
|
249
200
|
# @return [Hash] Returns the object in the form of hash
|
|
250
201
|
def to_hash
|
|
@@ -261,24 +212,6 @@ module NetworkStorageApi
|
|
|
261
212
|
hash
|
|
262
213
|
end
|
|
263
214
|
|
|
264
|
-
# Outputs non-array value in the form of hash
|
|
265
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
266
|
-
# @param [Object] value Any valid value
|
|
267
|
-
# @return [Hash] Returns the value in the form of hash
|
|
268
|
-
def _to_hash(value)
|
|
269
|
-
if value.is_a?(Array)
|
|
270
|
-
value.compact.map { |v| _to_hash(v) }
|
|
271
|
-
elsif value.is_a?(Hash)
|
|
272
|
-
{}.tap do |hash|
|
|
273
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
274
|
-
end
|
|
275
|
-
elsif value.respond_to? :to_hash
|
|
276
|
-
value.to_hash
|
|
277
|
-
else
|
|
278
|
-
value
|
|
279
|
-
end
|
|
280
|
-
end
|
|
281
|
-
|
|
282
215
|
end
|
|
283
216
|
|
|
284
217
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module NetworkStorageApi
|
|
17
17
|
# Create Volume.
|
|
18
|
-
class StorageNetworkVolumeCreate
|
|
18
|
+
class StorageNetworkVolumeCreate < ApiModelBase
|
|
19
19
|
# Volume friendly name.
|
|
20
20
|
attr_accessor :name
|
|
21
21
|
|
|
@@ -42,9 +42,14 @@ module NetworkStorageApi
|
|
|
42
42
|
}
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
45
50
|
# Returns all the JSON keys this model knows about
|
|
46
51
|
def self.acceptable_attributes
|
|
47
|
-
|
|
52
|
+
acceptable_attribute_map.values
|
|
48
53
|
end
|
|
49
54
|
|
|
50
55
|
# Attribute type mapping.
|
|
@@ -72,9 +77,10 @@ module NetworkStorageApi
|
|
|
72
77
|
end
|
|
73
78
|
|
|
74
79
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
81
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
-
if (!
|
|
77
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetworkVolumeCreate`. Please check the name to make sure it's valid. List of attributes: " +
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetworkVolumeCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
84
|
end
|
|
79
85
|
h[k.to_sym] = v
|
|
80
86
|
}
|
|
@@ -120,7 +126,7 @@ module NetworkStorageApi
|
|
|
120
126
|
end
|
|
121
127
|
|
|
122
128
|
if @name.to_s.length < 1
|
|
123
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
129
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
124
130
|
end
|
|
125
131
|
|
|
126
132
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
|
|
@@ -137,7 +143,7 @@ module NetworkStorageApi
|
|
|
137
143
|
end
|
|
138
144
|
|
|
139
145
|
if !@path_suffix.nil? && @path_suffix.to_s.length < 0
|
|
140
|
-
invalid_properties.push('invalid value for "path_suffix", the character length must be
|
|
146
|
+
invalid_properties.push('invalid value for "path_suffix", the character length must be greater than or equal to 0.')
|
|
141
147
|
end
|
|
142
148
|
|
|
143
149
|
pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
|
|
@@ -185,7 +191,7 @@ module NetworkStorageApi
|
|
|
185
191
|
end
|
|
186
192
|
|
|
187
193
|
if name.to_s.length < 1
|
|
188
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
194
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
189
195
|
end
|
|
190
196
|
|
|
191
197
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
|
|
@@ -222,7 +228,7 @@ module NetworkStorageApi
|
|
|
222
228
|
end
|
|
223
229
|
|
|
224
230
|
if path_suffix.to_s.length < 0
|
|
225
|
-
fail ArgumentError, 'invalid value for "path_suffix", the character length must be
|
|
231
|
+
fail ArgumentError, 'invalid value for "path_suffix", the character length must be greater than or equal to 0.'
|
|
226
232
|
end
|
|
227
233
|
|
|
228
234
|
pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
|
|
@@ -294,61 +300,6 @@ module NetworkStorageApi
|
|
|
294
300
|
new(transformed_hash)
|
|
295
301
|
end
|
|
296
302
|
|
|
297
|
-
# Deserializes the data based on type
|
|
298
|
-
# @param string type Data type
|
|
299
|
-
# @param string value Value to be deserialized
|
|
300
|
-
# @return [Object] Deserialized data
|
|
301
|
-
def self._deserialize(type, value)
|
|
302
|
-
case type.to_sym
|
|
303
|
-
when :Time
|
|
304
|
-
Time.parse(value)
|
|
305
|
-
when :Date
|
|
306
|
-
Date.parse(value)
|
|
307
|
-
when :String
|
|
308
|
-
value.to_s
|
|
309
|
-
when :Integer
|
|
310
|
-
value.to_i
|
|
311
|
-
when :Float
|
|
312
|
-
value.to_f
|
|
313
|
-
when :Boolean
|
|
314
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
315
|
-
true
|
|
316
|
-
else
|
|
317
|
-
false
|
|
318
|
-
end
|
|
319
|
-
when :Object
|
|
320
|
-
# generic object (usually a Hash), return directly
|
|
321
|
-
value
|
|
322
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
323
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
324
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
325
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
326
|
-
k_type = Regexp.last_match[:k_type]
|
|
327
|
-
v_type = Regexp.last_match[:v_type]
|
|
328
|
-
{}.tap do |hash|
|
|
329
|
-
value.each do |k, v|
|
|
330
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
331
|
-
end
|
|
332
|
-
end
|
|
333
|
-
else # model
|
|
334
|
-
# models (e.g. Pet) or oneOf
|
|
335
|
-
klass = NetworkStorageApi.const_get(type)
|
|
336
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
337
|
-
end
|
|
338
|
-
end
|
|
339
|
-
|
|
340
|
-
# Returns the string representation of the object
|
|
341
|
-
# @return [String] String presentation of the object
|
|
342
|
-
def to_s
|
|
343
|
-
to_hash.to_s
|
|
344
|
-
end
|
|
345
|
-
|
|
346
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
347
|
-
# @return [Hash] Returns the object in the form of hash
|
|
348
|
-
def to_body
|
|
349
|
-
to_hash
|
|
350
|
-
end
|
|
351
|
-
|
|
352
303
|
# Returns the object in the form of hash
|
|
353
304
|
# @return [Hash] Returns the object in the form of hash
|
|
354
305
|
def to_hash
|
|
@@ -365,24 +316,6 @@ module NetworkStorageApi
|
|
|
365
316
|
hash
|
|
366
317
|
end
|
|
367
318
|
|
|
368
|
-
# Outputs non-array value in the form of hash
|
|
369
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
370
|
-
# @param [Object] value Any valid value
|
|
371
|
-
# @return [Hash] Returns the value in the form of hash
|
|
372
|
-
def _to_hash(value)
|
|
373
|
-
if value.is_a?(Array)
|
|
374
|
-
value.compact.map { |v| _to_hash(v) }
|
|
375
|
-
elsif value.is_a?(Hash)
|
|
376
|
-
{}.tap do |hash|
|
|
377
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
378
|
-
end
|
|
379
|
-
elsif value.respond_to? :to_hash
|
|
380
|
-
value.to_hash
|
|
381
|
-
else
|
|
382
|
-
value
|
|
383
|
-
end
|
|
384
|
-
end
|
|
385
|
-
|
|
386
319
|
end
|
|
387
320
|
|
|
388
321
|
end
|