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
|
# Tag assigned to resource.
|
|
18
|
-
class TagAssignment
|
|
18
|
+
class TagAssignment < ApiModelBase
|
|
19
19
|
# The unique id of the tag.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -64,9 +64,14 @@ module NetworkStorageApi
|
|
|
64
64
|
}
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
+
# Returns attribute mapping this model knows about
|
|
68
|
+
def self.acceptable_attribute_map
|
|
69
|
+
attribute_map
|
|
70
|
+
end
|
|
71
|
+
|
|
67
72
|
# Returns all the JSON keys this model knows about
|
|
68
73
|
def self.acceptable_attributes
|
|
69
|
-
|
|
74
|
+
acceptable_attribute_map.values
|
|
70
75
|
end
|
|
71
76
|
|
|
72
77
|
# Attribute type mapping.
|
|
@@ -94,9 +99,10 @@ module NetworkStorageApi
|
|
|
94
99
|
end
|
|
95
100
|
|
|
96
101
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
102
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
97
103
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
|
-
if (!
|
|
99
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::TagAssignment`. Please check the name to make sure it's valid. List of attributes: " +
|
|
104
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::TagAssignment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
100
106
|
end
|
|
101
107
|
h[k.to_sym] = v
|
|
102
108
|
}
|
|
@@ -160,6 +166,36 @@ module NetworkStorageApi
|
|
|
160
166
|
true
|
|
161
167
|
end
|
|
162
168
|
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] id Value to be assigned
|
|
171
|
+
def id=(id)
|
|
172
|
+
if id.nil?
|
|
173
|
+
fail ArgumentError, 'id cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@id = id
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] name Value to be assigned
|
|
181
|
+
def name=(name)
|
|
182
|
+
if name.nil?
|
|
183
|
+
fail ArgumentError, 'name cannot be nil'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
@name = name
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] is_billing_tag Value to be assigned
|
|
191
|
+
def is_billing_tag=(is_billing_tag)
|
|
192
|
+
if is_billing_tag.nil?
|
|
193
|
+
fail ArgumentError, 'is_billing_tag cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@is_billing_tag = is_billing_tag
|
|
197
|
+
end
|
|
198
|
+
|
|
163
199
|
# Custom attribute writer method checking allowed values (enum).
|
|
164
200
|
# @param [Object] created_by Object to be assigned
|
|
165
201
|
def created_by=(created_by)
|
|
@@ -217,61 +253,6 @@ module NetworkStorageApi
|
|
|
217
253
|
new(transformed_hash)
|
|
218
254
|
end
|
|
219
255
|
|
|
220
|
-
# Deserializes the data based on type
|
|
221
|
-
# @param string type Data type
|
|
222
|
-
# @param string value Value to be deserialized
|
|
223
|
-
# @return [Object] Deserialized data
|
|
224
|
-
def self._deserialize(type, value)
|
|
225
|
-
case type.to_sym
|
|
226
|
-
when :Time
|
|
227
|
-
Time.parse(value)
|
|
228
|
-
when :Date
|
|
229
|
-
Date.parse(value)
|
|
230
|
-
when :String
|
|
231
|
-
value.to_s
|
|
232
|
-
when :Integer
|
|
233
|
-
value.to_i
|
|
234
|
-
when :Float
|
|
235
|
-
value.to_f
|
|
236
|
-
when :Boolean
|
|
237
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
238
|
-
true
|
|
239
|
-
else
|
|
240
|
-
false
|
|
241
|
-
end
|
|
242
|
-
when :Object
|
|
243
|
-
# generic object (usually a Hash), return directly
|
|
244
|
-
value
|
|
245
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
246
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
247
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
248
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
249
|
-
k_type = Regexp.last_match[:k_type]
|
|
250
|
-
v_type = Regexp.last_match[:v_type]
|
|
251
|
-
{}.tap do |hash|
|
|
252
|
-
value.each do |k, v|
|
|
253
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
|
-
else # model
|
|
257
|
-
# models (e.g. Pet) or oneOf
|
|
258
|
-
klass = NetworkStorageApi.const_get(type)
|
|
259
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
# Returns the string representation of the object
|
|
264
|
-
# @return [String] String presentation of the object
|
|
265
|
-
def to_s
|
|
266
|
-
to_hash.to_s
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
270
|
-
# @return [Hash] Returns the object in the form of hash
|
|
271
|
-
def to_body
|
|
272
|
-
to_hash
|
|
273
|
-
end
|
|
274
|
-
|
|
275
256
|
# Returns the object in the form of hash
|
|
276
257
|
# @return [Hash] Returns the object in the form of hash
|
|
277
258
|
def to_hash
|
|
@@ -288,24 +269,6 @@ module NetworkStorageApi
|
|
|
288
269
|
hash
|
|
289
270
|
end
|
|
290
271
|
|
|
291
|
-
# Outputs non-array value in the form of hash
|
|
292
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
293
|
-
# @param [Object] value Any valid value
|
|
294
|
-
# @return [Hash] Returns the value in the form of hash
|
|
295
|
-
def _to_hash(value)
|
|
296
|
-
if value.is_a?(Array)
|
|
297
|
-
value.compact.map { |v| _to_hash(v) }
|
|
298
|
-
elsif value.is_a?(Hash)
|
|
299
|
-
{}.tap do |hash|
|
|
300
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
301
|
-
end
|
|
302
|
-
elsif value.respond_to? :to_hash
|
|
303
|
-
value.to_hash
|
|
304
|
-
else
|
|
305
|
-
value
|
|
306
|
-
end
|
|
307
|
-
end
|
|
308
|
-
|
|
309
272
|
end
|
|
310
273
|
|
|
311
274
|
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
|
# Tag request to assign to resource.
|
|
18
|
-
class TagAssignmentRequest
|
|
18
|
+
class TagAssignmentRequest < ApiModelBase
|
|
19
19
|
# The name of the tag. Tag names are case-sensitive, and should be composed of a maximum of 100 characters including UTF-8 Unicode letters, numbers, and the following symbols: '-', '_'. Regex: [A-zÀ-ú0-9_-]{1,100}.
|
|
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::TagAssignmentRequest`. 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::TagAssignmentRequest`. 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
|
}
|
|
@@ -95,6 +101,16 @@ module NetworkStorageApi
|
|
|
95
101
|
true
|
|
96
102
|
end
|
|
97
103
|
|
|
104
|
+
# Custom attribute writer method with validation
|
|
105
|
+
# @param [Object] name Value to be assigned
|
|
106
|
+
def name=(name)
|
|
107
|
+
if name.nil?
|
|
108
|
+
fail ArgumentError, 'name cannot be nil'
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
@name = name
|
|
112
|
+
end
|
|
113
|
+
|
|
98
114
|
# Checks equality by comparing each attribute.
|
|
99
115
|
# @param [Object] Object to be compared
|
|
100
116
|
def ==(o)
|
|
@@ -139,61 +155,6 @@ module NetworkStorageApi
|
|
|
139
155
|
new(transformed_hash)
|
|
140
156
|
end
|
|
141
157
|
|
|
142
|
-
# Deserializes the data based on type
|
|
143
|
-
# @param string type Data type
|
|
144
|
-
# @param string value Value to be deserialized
|
|
145
|
-
# @return [Object] Deserialized data
|
|
146
|
-
def self._deserialize(type, value)
|
|
147
|
-
case type.to_sym
|
|
148
|
-
when :Time
|
|
149
|
-
Time.parse(value)
|
|
150
|
-
when :Date
|
|
151
|
-
Date.parse(value)
|
|
152
|
-
when :String
|
|
153
|
-
value.to_s
|
|
154
|
-
when :Integer
|
|
155
|
-
value.to_i
|
|
156
|
-
when :Float
|
|
157
|
-
value.to_f
|
|
158
|
-
when :Boolean
|
|
159
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
160
|
-
true
|
|
161
|
-
else
|
|
162
|
-
false
|
|
163
|
-
end
|
|
164
|
-
when :Object
|
|
165
|
-
# generic object (usually a Hash), return directly
|
|
166
|
-
value
|
|
167
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
168
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
169
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
170
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
171
|
-
k_type = Regexp.last_match[:k_type]
|
|
172
|
-
v_type = Regexp.last_match[:v_type]
|
|
173
|
-
{}.tap do |hash|
|
|
174
|
-
value.each do |k, v|
|
|
175
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
176
|
-
end
|
|
177
|
-
end
|
|
178
|
-
else # model
|
|
179
|
-
# models (e.g. Pet) or oneOf
|
|
180
|
-
klass = NetworkStorageApi.const_get(type)
|
|
181
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
182
|
-
end
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
# Returns the string representation of the object
|
|
186
|
-
# @return [String] String presentation of the object
|
|
187
|
-
def to_s
|
|
188
|
-
to_hash.to_s
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
192
|
-
# @return [Hash] Returns the object in the form of hash
|
|
193
|
-
def to_body
|
|
194
|
-
to_hash
|
|
195
|
-
end
|
|
196
|
-
|
|
197
158
|
# Returns the object in the form of hash
|
|
198
159
|
# @return [Hash] Returns the object in the form of hash
|
|
199
160
|
def to_hash
|
|
@@ -210,24 +171,6 @@ module NetworkStorageApi
|
|
|
210
171
|
hash
|
|
211
172
|
end
|
|
212
173
|
|
|
213
|
-
# Outputs non-array value in the form of hash
|
|
214
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
215
|
-
# @param [Object] value Any valid value
|
|
216
|
-
# @return [Hash] Returns the value in the form of hash
|
|
217
|
-
def _to_hash(value)
|
|
218
|
-
if value.is_a?(Array)
|
|
219
|
-
value.compact.map { |v| _to_hash(v) }
|
|
220
|
-
elsif value.is_a?(Hash)
|
|
221
|
-
{}.tap do |hash|
|
|
222
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
223
|
-
end
|
|
224
|
-
elsif value.respond_to? :to_hash
|
|
225
|
-
value.to_hash
|
|
226
|
-
else
|
|
227
|
-
value
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
|
|
231
174
|
end
|
|
232
175
|
|
|
233
176
|
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
|
# Volume for a storage network.
|
|
18
|
-
class Volume
|
|
18
|
+
class Volume < ApiModelBase
|
|
19
19
|
# Volume ID.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -93,9 +93,14 @@ module NetworkStorageApi
|
|
|
93
93
|
}
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
+
# Returns attribute mapping this model knows about
|
|
97
|
+
def self.acceptable_attribute_map
|
|
98
|
+
attribute_map
|
|
99
|
+
end
|
|
100
|
+
|
|
96
101
|
# Returns all the JSON keys this model knows about
|
|
97
102
|
def self.acceptable_attributes
|
|
98
|
-
|
|
103
|
+
acceptable_attribute_map.values
|
|
99
104
|
end
|
|
100
105
|
|
|
101
106
|
# Attribute type mapping.
|
|
@@ -131,9 +136,10 @@ module NetworkStorageApi
|
|
|
131
136
|
end
|
|
132
137
|
|
|
133
138
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
139
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
134
140
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
135
|
-
if (!
|
|
136
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::Volume`. Please check the name to make sure it's valid. List of attributes: " +
|
|
141
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
142
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::Volume`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
137
143
|
end
|
|
138
144
|
h[k.to_sym] = v
|
|
139
145
|
}
|
|
@@ -263,61 +269,6 @@ module NetworkStorageApi
|
|
|
263
269
|
new(transformed_hash)
|
|
264
270
|
end
|
|
265
271
|
|
|
266
|
-
# Deserializes the data based on type
|
|
267
|
-
# @param string type Data type
|
|
268
|
-
# @param string value Value to be deserialized
|
|
269
|
-
# @return [Object] Deserialized data
|
|
270
|
-
def self._deserialize(type, value)
|
|
271
|
-
case type.to_sym
|
|
272
|
-
when :Time
|
|
273
|
-
Time.parse(value)
|
|
274
|
-
when :Date
|
|
275
|
-
Date.parse(value)
|
|
276
|
-
when :String
|
|
277
|
-
value.to_s
|
|
278
|
-
when :Integer
|
|
279
|
-
value.to_i
|
|
280
|
-
when :Float
|
|
281
|
-
value.to_f
|
|
282
|
-
when :Boolean
|
|
283
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
284
|
-
true
|
|
285
|
-
else
|
|
286
|
-
false
|
|
287
|
-
end
|
|
288
|
-
when :Object
|
|
289
|
-
# generic object (usually a Hash), return directly
|
|
290
|
-
value
|
|
291
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
292
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
293
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
294
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
295
|
-
k_type = Regexp.last_match[:k_type]
|
|
296
|
-
v_type = Regexp.last_match[:v_type]
|
|
297
|
-
{}.tap do |hash|
|
|
298
|
-
value.each do |k, v|
|
|
299
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
300
|
-
end
|
|
301
|
-
end
|
|
302
|
-
else # model
|
|
303
|
-
# models (e.g. Pet) or oneOf
|
|
304
|
-
klass = NetworkStorageApi.const_get(type)
|
|
305
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
306
|
-
end
|
|
307
|
-
end
|
|
308
|
-
|
|
309
|
-
# Returns the string representation of the object
|
|
310
|
-
# @return [String] String presentation of the object
|
|
311
|
-
def to_s
|
|
312
|
-
to_hash.to_s
|
|
313
|
-
end
|
|
314
|
-
|
|
315
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
316
|
-
# @return [Hash] Returns the object in the form of hash
|
|
317
|
-
def to_body
|
|
318
|
-
to_hash
|
|
319
|
-
end
|
|
320
|
-
|
|
321
272
|
# Returns the object in the form of hash
|
|
322
273
|
# @return [Hash] Returns the object in the form of hash
|
|
323
274
|
def to_hash
|
|
@@ -334,24 +285,6 @@ module NetworkStorageApi
|
|
|
334
285
|
hash
|
|
335
286
|
end
|
|
336
287
|
|
|
337
|
-
# Outputs non-array value in the form of hash
|
|
338
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
339
|
-
# @param [Object] value Any valid value
|
|
340
|
-
# @return [Hash] Returns the value in the form of hash
|
|
341
|
-
def _to_hash(value)
|
|
342
|
-
if value.is_a?(Array)
|
|
343
|
-
value.compact.map { |v| _to_hash(v) }
|
|
344
|
-
elsif value.is_a?(Hash)
|
|
345
|
-
{}.tap do |hash|
|
|
346
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
347
|
-
end
|
|
348
|
-
elsif value.respond_to? :to_hash
|
|
349
|
-
value.to_hash
|
|
350
|
-
else
|
|
351
|
-
value
|
|
352
|
-
end
|
|
353
|
-
end
|
|
354
|
-
|
|
355
288
|
end
|
|
356
289
|
|
|
357
290
|
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 VolumeCreate
|
|
18
|
+
class VolumeCreate < ApiModelBase
|
|
19
19
|
# Volume friendly name.
|
|
20
20
|
attr_accessor :name
|
|
21
21
|
|
|
@@ -45,9 +45,14 @@ module NetworkStorageApi
|
|
|
45
45
|
}
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
48
53
|
# Returns all the JSON keys this model knows about
|
|
49
54
|
def self.acceptable_attributes
|
|
50
|
-
|
|
55
|
+
acceptable_attribute_map.values
|
|
51
56
|
end
|
|
52
57
|
|
|
53
58
|
# Attribute type mapping.
|
|
@@ -76,9 +81,10 @@ module NetworkStorageApi
|
|
|
76
81
|
end
|
|
77
82
|
|
|
78
83
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
85
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
-
if (!
|
|
81
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::VolumeCreate`. Please check the name to make sure it's valid. List of attributes: " +
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::VolumeCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
88
|
end
|
|
83
89
|
h[k.to_sym] = v
|
|
84
90
|
}
|
|
@@ -128,7 +134,7 @@ module NetworkStorageApi
|
|
|
128
134
|
end
|
|
129
135
|
|
|
130
136
|
if @name.to_s.length < 1
|
|
131
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
137
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
132
138
|
end
|
|
133
139
|
|
|
134
140
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
|
|
@@ -145,7 +151,7 @@ module NetworkStorageApi
|
|
|
145
151
|
end
|
|
146
152
|
|
|
147
153
|
if !@path_suffix.nil? && @path_suffix.to_s.length < 0
|
|
148
|
-
invalid_properties.push('invalid value for "path_suffix", the character length must be
|
|
154
|
+
invalid_properties.push('invalid value for "path_suffix", the character length must be greater than or equal to 0.')
|
|
149
155
|
end
|
|
150
156
|
|
|
151
157
|
pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
|
|
@@ -193,7 +199,7 @@ module NetworkStorageApi
|
|
|
193
199
|
end
|
|
194
200
|
|
|
195
201
|
if name.to_s.length < 1
|
|
196
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
202
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
197
203
|
end
|
|
198
204
|
|
|
199
205
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
|
|
@@ -230,7 +236,7 @@ module NetworkStorageApi
|
|
|
230
236
|
end
|
|
231
237
|
|
|
232
238
|
if path_suffix.to_s.length < 0
|
|
233
|
-
fail ArgumentError, 'invalid value for "path_suffix", the character length must be
|
|
239
|
+
fail ArgumentError, 'invalid value for "path_suffix", the character length must be greater than or equal to 0.'
|
|
234
240
|
end
|
|
235
241
|
|
|
236
242
|
pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
|
|
@@ -303,61 +309,6 @@ module NetworkStorageApi
|
|
|
303
309
|
new(transformed_hash)
|
|
304
310
|
end
|
|
305
311
|
|
|
306
|
-
# Deserializes the data based on type
|
|
307
|
-
# @param string type Data type
|
|
308
|
-
# @param string value Value to be deserialized
|
|
309
|
-
# @return [Object] Deserialized data
|
|
310
|
-
def self._deserialize(type, value)
|
|
311
|
-
case type.to_sym
|
|
312
|
-
when :Time
|
|
313
|
-
Time.parse(value)
|
|
314
|
-
when :Date
|
|
315
|
-
Date.parse(value)
|
|
316
|
-
when :String
|
|
317
|
-
value.to_s
|
|
318
|
-
when :Integer
|
|
319
|
-
value.to_i
|
|
320
|
-
when :Float
|
|
321
|
-
value.to_f
|
|
322
|
-
when :Boolean
|
|
323
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
324
|
-
true
|
|
325
|
-
else
|
|
326
|
-
false
|
|
327
|
-
end
|
|
328
|
-
when :Object
|
|
329
|
-
# generic object (usually a Hash), return directly
|
|
330
|
-
value
|
|
331
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
332
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
333
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
334
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
335
|
-
k_type = Regexp.last_match[:k_type]
|
|
336
|
-
v_type = Regexp.last_match[:v_type]
|
|
337
|
-
{}.tap do |hash|
|
|
338
|
-
value.each do |k, v|
|
|
339
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
340
|
-
end
|
|
341
|
-
end
|
|
342
|
-
else # model
|
|
343
|
-
# models (e.g. Pet) or oneOf
|
|
344
|
-
klass = NetworkStorageApi.const_get(type)
|
|
345
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
346
|
-
end
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
# Returns the string representation of the object
|
|
350
|
-
# @return [String] String presentation of the object
|
|
351
|
-
def to_s
|
|
352
|
-
to_hash.to_s
|
|
353
|
-
end
|
|
354
|
-
|
|
355
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
356
|
-
# @return [Hash] Returns the object in the form of hash
|
|
357
|
-
def to_body
|
|
358
|
-
to_hash
|
|
359
|
-
end
|
|
360
|
-
|
|
361
312
|
# Returns the object in the form of hash
|
|
362
313
|
# @return [Hash] Returns the object in the form of hash
|
|
363
314
|
def to_hash
|
|
@@ -374,24 +325,6 @@ module NetworkStorageApi
|
|
|
374
325
|
hash
|
|
375
326
|
end
|
|
376
327
|
|
|
377
|
-
# Outputs non-array value in the form of hash
|
|
378
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
379
|
-
# @param [Object] value Any valid value
|
|
380
|
-
# @return [Hash] Returns the value in the form of hash
|
|
381
|
-
def _to_hash(value)
|
|
382
|
-
if value.is_a?(Array)
|
|
383
|
-
value.compact.map { |v| _to_hash(v) }
|
|
384
|
-
elsif value.is_a?(Hash)
|
|
385
|
-
{}.tap do |hash|
|
|
386
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
387
|
-
end
|
|
388
|
-
elsif value.respond_to? :to_hash
|
|
389
|
-
value.to_hash
|
|
390
|
-
else
|
|
391
|
-
value
|
|
392
|
-
end
|
|
393
|
-
end
|
|
394
|
-
|
|
395
328
|
end
|
|
396
329
|
|
|
397
330
|
end
|