pnap_network_storage_api 1.1.0 → 1.3.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.
@@ -22,7 +22,7 @@ module NetworkStorageApi
22
22
  # Storage network description.
23
23
  attr_accessor :description
24
24
 
25
- # Location of storage network. Currently this field should be set to `PHX`.
25
+ # Location of storage network. Currently this field should be set to `PHX` or `ASH`.
26
26
  attr_accessor :location
27
27
 
28
28
  # Volume to be created alongside storage. Currently only 1 volume is supported.
@@ -49,7 +49,7 @@ module NetworkStorageApi
49
49
  :'name' => :'String',
50
50
  :'description' => :'String',
51
51
  :'location' => :'String',
52
- :'volumes' => :'Array<VolumeCreate>'
52
+ :'volumes' => :'Array<StorageNetworkVolumeCreate>'
53
53
  }
54
54
  end
55
55
 
@@ -0,0 +1,358 @@
1
+ =begin
2
+ #Network Storage API
3
+
4
+ #Create, list, edit, and delete storage networks with the Network Storage API. Use storage networks to expand storage capacity on a private network. <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bare-metal-cloud-storage' target='_blank'>here</a> </span> <br> <b>All URLs are relative to (https://api.phoenixnap.com/network-storage/v1/)</b>
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@phoenixnap.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.1.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module NetworkStorageApi
17
+ # Create Volume.
18
+ class StorageNetworkVolumeCreate
19
+ # Volume friendly name.
20
+ attr_accessor :name
21
+
22
+ # Volume description.
23
+ attr_accessor :description
24
+
25
+ # Last part of volume's path.
26
+ attr_accessor :path_suffix
27
+
28
+ # Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported.
29
+ attr_accessor :capacity_in_gb
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'name' => :'name',
35
+ :'description' => :'description',
36
+ :'path_suffix' => :'pathSuffix',
37
+ :'capacity_in_gb' => :'capacityInGb'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'name' => :'String',
50
+ :'description' => :'String',
51
+ :'path_suffix' => :'String',
52
+ :'capacity_in_gb' => :'Integer'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `NetworkStorageApi::StorageNetworkVolumeCreate` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::StorageNetworkVolumeCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'name')
78
+ self.name = attributes[:'name']
79
+ end
80
+
81
+ if attributes.key?(:'description')
82
+ self.description = attributes[:'description']
83
+ end
84
+
85
+ if attributes.key?(:'path_suffix')
86
+ self.path_suffix = attributes[:'path_suffix']
87
+ end
88
+
89
+ if attributes.key?(:'capacity_in_gb')
90
+ self.capacity_in_gb = attributes[:'capacity_in_gb']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ if @name.nil?
99
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
100
+ end
101
+
102
+ if @name.to_s.length > 100
103
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
104
+ end
105
+
106
+ if @name.to_s.length < 1
107
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
108
+ end
109
+
110
+ if !@description.nil? && @description.to_s.length > 250
111
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
112
+ end
113
+
114
+ if !@path_suffix.nil? && @path_suffix.to_s.length > 27
115
+ invalid_properties.push('invalid value for "path_suffix", the character length must be smaller than or equal to 27.')
116
+ end
117
+
118
+ if !@path_suffix.nil? && @path_suffix.to_s.length < 0
119
+ invalid_properties.push('invalid value for "path_suffix", the character length must be great than or equal to 0.')
120
+ end
121
+
122
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
123
+ if !@path_suffix.nil? && @path_suffix !~ pattern
124
+ invalid_properties.push("invalid value for \"path_suffix\", must conform to the pattern #{pattern}.")
125
+ end
126
+
127
+ if @capacity_in_gb.nil?
128
+ invalid_properties.push('invalid value for "capacity_in_gb", capacity_in_gb cannot be nil.')
129
+ end
130
+
131
+ if @capacity_in_gb < 1000
132
+ invalid_properties.push('invalid value for "capacity_in_gb", must be greater than or equal to 1000.')
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
+ return false if @name.nil?
142
+ return false if @name.to_s.length > 100
143
+ return false if @name.to_s.length < 1
144
+ return false if !@description.nil? && @description.to_s.length > 250
145
+ return false if !@path_suffix.nil? && @path_suffix.to_s.length > 27
146
+ return false if !@path_suffix.nil? && @path_suffix.to_s.length < 0
147
+ return false if !@path_suffix.nil? && @path_suffix !~ Regexp.new(/^(\/[\w-]+)+$|^$/)
148
+ return false if @capacity_in_gb.nil?
149
+ return false if @capacity_in_gb < 1000
150
+ true
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] name Value to be assigned
155
+ def name=(name)
156
+ if name.nil?
157
+ fail ArgumentError, 'name cannot be nil'
158
+ end
159
+
160
+ if name.to_s.length > 100
161
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
162
+ end
163
+
164
+ if name.to_s.length < 1
165
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
166
+ end
167
+
168
+ @name = name
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] description Value to be assigned
173
+ def description=(description)
174
+ if !description.nil? && description.to_s.length > 250
175
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
176
+ end
177
+
178
+ @description = description
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] path_suffix Value to be assigned
183
+ def path_suffix=(path_suffix)
184
+ if !path_suffix.nil? && path_suffix.to_s.length > 27
185
+ fail ArgumentError, 'invalid value for "path_suffix", the character length must be smaller than or equal to 27.'
186
+ end
187
+
188
+ if !path_suffix.nil? && path_suffix.to_s.length < 0
189
+ fail ArgumentError, 'invalid value for "path_suffix", the character length must be great than or equal to 0.'
190
+ end
191
+
192
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
193
+ if !path_suffix.nil? && path_suffix !~ pattern
194
+ fail ArgumentError, "invalid value for \"path_suffix\", must conform to the pattern #{pattern}."
195
+ end
196
+
197
+ @path_suffix = path_suffix
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] capacity_in_gb Value to be assigned
202
+ def capacity_in_gb=(capacity_in_gb)
203
+ if capacity_in_gb.nil?
204
+ fail ArgumentError, 'capacity_in_gb cannot be nil'
205
+ end
206
+
207
+ if capacity_in_gb < 1000
208
+ fail ArgumentError, 'invalid value for "capacity_in_gb", must be greater than or equal to 1000.'
209
+ end
210
+
211
+ @capacity_in_gb = capacity_in_gb
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ name == o.name &&
220
+ description == o.description &&
221
+ path_suffix == o.path_suffix &&
222
+ capacity_in_gb == o.capacity_in_gb
223
+ end
224
+
225
+ # @see the `==` method
226
+ # @param [Object] Object to be compared
227
+ def eql?(o)
228
+ self == o
229
+ end
230
+
231
+ # Calculates hash code according to all attributes.
232
+ # @return [Integer] Hash code
233
+ def hash
234
+ [name, description, path_suffix, capacity_in_gb].hash
235
+ end
236
+
237
+ # Builds the object from hash
238
+ # @param [Hash] attributes Model attributes in the form of hash
239
+ # @return [Object] Returns the model itself
240
+ def self.build_from_hash(attributes)
241
+ new.build_from_hash(attributes)
242
+ end
243
+
244
+ # Builds the object from hash
245
+ # @param [Hash] attributes Model attributes in the form of hash
246
+ # @return [Object] Returns the model itself
247
+ def build_from_hash(attributes)
248
+ return nil unless attributes.is_a?(Hash)
249
+ attributes = attributes.transform_keys(&:to_sym)
250
+ self.class.openapi_types.each_pair do |key, type|
251
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
252
+ self.send("#{key}=", nil)
253
+ elsif type =~ /\AArray<(.*)>/i
254
+ # check to ensure the input is an array given that the attribute
255
+ # is documented as an array but the input is not
256
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
257
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
258
+ end
259
+ elsif !attributes[self.class.attribute_map[key]].nil?
260
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
261
+ end
262
+ end
263
+
264
+ self
265
+ end
266
+
267
+ # Deserializes the data based on type
268
+ # @param string type Data type
269
+ # @param string value Value to be deserialized
270
+ # @return [Object] Deserialized data
271
+ def _deserialize(type, value)
272
+ case type.to_sym
273
+ when :Time
274
+ Time.parse(value)
275
+ when :Date
276
+ Date.parse(value)
277
+ when :String
278
+ value.to_s
279
+ when :Integer
280
+ value.to_i
281
+ when :Float
282
+ value.to_f
283
+ when :Boolean
284
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
285
+ true
286
+ else
287
+ false
288
+ end
289
+ when :Object
290
+ # generic object (usually a Hash), return directly
291
+ value
292
+ when /\AArray<(?<inner_type>.+)>\z/
293
+ inner_type = Regexp.last_match[:inner_type]
294
+ value.map { |v| _deserialize(inner_type, v) }
295
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
296
+ k_type = Regexp.last_match[:k_type]
297
+ v_type = Regexp.last_match[:v_type]
298
+ {}.tap do |hash|
299
+ value.each do |k, v|
300
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
301
+ end
302
+ end
303
+ else # model
304
+ # models (e.g. Pet) or oneOf
305
+ klass = NetworkStorageApi.const_get(type)
306
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
307
+ end
308
+ end
309
+
310
+ # Returns the string representation of the object
311
+ # @return [String] String presentation of the object
312
+ def to_s
313
+ to_hash.to_s
314
+ end
315
+
316
+ # to_body is an alias to to_hash (backward compatibility)
317
+ # @return [Hash] Returns the object in the form of hash
318
+ def to_body
319
+ to_hash
320
+ end
321
+
322
+ # Returns the object in the form of hash
323
+ # @return [Hash] Returns the object in the form of hash
324
+ def to_hash
325
+ hash = {}
326
+ self.class.attribute_map.each_pair do |attr, param|
327
+ value = self.send(attr)
328
+ if value.nil?
329
+ is_nullable = self.class.openapi_nullable.include?(attr)
330
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
331
+ end
332
+
333
+ hash[param] = _to_hash(value)
334
+ end
335
+ hash
336
+ end
337
+
338
+ # Outputs non-array value in the form of hash
339
+ # For object, use to_hash. Otherwise, just return the value
340
+ # @param [Object] value Any valid value
341
+ # @return [Hash] Returns the value in the form of hash
342
+ def _to_hash(value)
343
+ if value.is_a?(Array)
344
+ value.compact.map { |v| _to_hash(v) }
345
+ elsif value.is_a?(Hash)
346
+ {}.tap do |hash|
347
+ value.each { |k, v| hash[k] = _to_hash(v) }
348
+ end
349
+ elsif value.respond_to? :to_hash
350
+ value.to_hash
351
+ else
352
+ value
353
+ end
354
+ end
355
+
356
+ end
357
+
358
+ end
@@ -28,13 +28,16 @@ module NetworkStorageApi
28
28
  # Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported.
29
29
  attr_accessor :capacity_in_gb
30
30
 
31
+ attr_accessor :permissions
32
+
31
33
  # Attribute mapping from ruby-style variable name to JSON key.
32
34
  def self.attribute_map
33
35
  {
34
36
  :'name' => :'name',
35
37
  :'description' => :'description',
36
38
  :'path_suffix' => :'pathSuffix',
37
- :'capacity_in_gb' => :'capacityInGb'
39
+ :'capacity_in_gb' => :'capacityInGb',
40
+ :'permissions' => :'permissions'
38
41
  }
39
42
  end
40
43
 
@@ -49,7 +52,8 @@ module NetworkStorageApi
49
52
  :'name' => :'String',
50
53
  :'description' => :'String',
51
54
  :'path_suffix' => :'String',
52
- :'capacity_in_gb' => :'Integer'
55
+ :'capacity_in_gb' => :'Integer',
56
+ :'permissions' => :'PermissionsCreate'
53
57
  }
54
58
  end
55
59
 
@@ -89,6 +93,10 @@ module NetworkStorageApi
89
93
  if attributes.key?(:'capacity_in_gb')
90
94
  self.capacity_in_gb = attributes[:'capacity_in_gb']
91
95
  end
96
+
97
+ if attributes.key?(:'permissions')
98
+ self.permissions = attributes[:'permissions']
99
+ end
92
100
  end
93
101
 
94
102
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -111,15 +119,15 @@ module NetworkStorageApi
111
119
  invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
112
120
  end
113
121
 
114
- if !@path_suffix.nil? && @path_suffix.to_s.length > 100
115
- invalid_properties.push('invalid value for "path_suffix", the character length must be smaller than or equal to 100.')
122
+ if !@path_suffix.nil? && @path_suffix.to_s.length > 27
123
+ invalid_properties.push('invalid value for "path_suffix", the character length must be smaller than or equal to 27.')
116
124
  end
117
125
 
118
- if !@path_suffix.nil? && @path_suffix.to_s.length < 1
119
- invalid_properties.push('invalid value for "path_suffix", the character length must be great than or equal to 1.')
126
+ if !@path_suffix.nil? && @path_suffix.to_s.length < 0
127
+ invalid_properties.push('invalid value for "path_suffix", the character length must be great than or equal to 0.')
120
128
  end
121
129
 
122
- pattern = Regexp.new(/^(\/[\w-]+)+$/)
130
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
123
131
  if !@path_suffix.nil? && @path_suffix !~ pattern
124
132
  invalid_properties.push("invalid value for \"path_suffix\", must conform to the pattern #{pattern}.")
125
133
  end
@@ -142,9 +150,9 @@ module NetworkStorageApi
142
150
  return false if @name.to_s.length > 100
143
151
  return false if @name.to_s.length < 1
144
152
  return false if !@description.nil? && @description.to_s.length > 250
145
- return false if !@path_suffix.nil? && @path_suffix.to_s.length > 100
146
- return false if !@path_suffix.nil? && @path_suffix.to_s.length < 1
147
- return false if !@path_suffix.nil? && @path_suffix !~ Regexp.new(/^(\/[\w-]+)+$/)
153
+ return false if !@path_suffix.nil? && @path_suffix.to_s.length > 27
154
+ return false if !@path_suffix.nil? && @path_suffix.to_s.length < 0
155
+ return false if !@path_suffix.nil? && @path_suffix !~ Regexp.new(/^(\/[\w-]+)+$|^$/)
148
156
  return false if @capacity_in_gb.nil?
149
157
  return false if @capacity_in_gb < 1000
150
158
  true
@@ -181,15 +189,15 @@ module NetworkStorageApi
181
189
  # Custom attribute writer method with validation
182
190
  # @param [Object] path_suffix Value to be assigned
183
191
  def path_suffix=(path_suffix)
184
- if !path_suffix.nil? && path_suffix.to_s.length > 100
185
- fail ArgumentError, 'invalid value for "path_suffix", the character length must be smaller than or equal to 100.'
192
+ if !path_suffix.nil? && path_suffix.to_s.length > 27
193
+ fail ArgumentError, 'invalid value for "path_suffix", the character length must be smaller than or equal to 27.'
186
194
  end
187
195
 
188
- if !path_suffix.nil? && path_suffix.to_s.length < 1
189
- fail ArgumentError, 'invalid value for "path_suffix", the character length must be great than or equal to 1.'
196
+ if !path_suffix.nil? && path_suffix.to_s.length < 0
197
+ fail ArgumentError, 'invalid value for "path_suffix", the character length must be great than or equal to 0.'
190
198
  end
191
199
 
192
- pattern = Regexp.new(/^(\/[\w-]+)+$/)
200
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
193
201
  if !path_suffix.nil? && path_suffix !~ pattern
194
202
  fail ArgumentError, "invalid value for \"path_suffix\", must conform to the pattern #{pattern}."
195
203
  end
@@ -219,7 +227,8 @@ module NetworkStorageApi
219
227
  name == o.name &&
220
228
  description == o.description &&
221
229
  path_suffix == o.path_suffix &&
222
- capacity_in_gb == o.capacity_in_gb
230
+ capacity_in_gb == o.capacity_in_gb &&
231
+ permissions == o.permissions
223
232
  end
224
233
 
225
234
  # @see the `==` method
@@ -231,7 +240,7 @@ module NetworkStorageApi
231
240
  # Calculates hash code according to all attributes.
232
241
  # @return [Integer] Hash code
233
242
  def hash
234
- [name, description, path_suffix, capacity_in_gb].hash
243
+ [name, description, path_suffix, capacity_in_gb, permissions].hash
235
244
  end
236
245
 
237
246
  # Builds the object from hash
@@ -16,13 +16,28 @@ require 'time'
16
16
  module NetworkStorageApi
17
17
  # Update storage network volume.
18
18
  class VolumeUpdate
19
+ # Volume friendly name.
20
+ attr_accessor :name
21
+
22
+ # Volume description.
23
+ attr_accessor :description
24
+
19
25
  # Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported.
20
26
  attr_accessor :capacity_in_gb
21
27
 
28
+ # Last part of volume's path.
29
+ attr_accessor :path_suffix
30
+
31
+ attr_accessor :permissions
32
+
22
33
  # Attribute mapping from ruby-style variable name to JSON key.
23
34
  def self.attribute_map
24
35
  {
25
- :'capacity_in_gb' => :'capacityInGb'
36
+ :'name' => :'name',
37
+ :'description' => :'description',
38
+ :'capacity_in_gb' => :'capacityInGb',
39
+ :'path_suffix' => :'pathSuffix',
40
+ :'permissions' => :'permissions'
26
41
  }
27
42
  end
28
43
 
@@ -34,7 +49,11 @@ module NetworkStorageApi
34
49
  # Attribute type mapping.
35
50
  def self.openapi_types
36
51
  {
37
- :'capacity_in_gb' => :'Integer'
52
+ :'name' => :'String',
53
+ :'description' => :'String',
54
+ :'capacity_in_gb' => :'Integer',
55
+ :'path_suffix' => :'String',
56
+ :'permissions' => :'PermissionsUpdate'
38
57
  }
39
58
  end
40
59
 
@@ -59,29 +78,100 @@ module NetworkStorageApi
59
78
  h[k.to_sym] = v
60
79
  }
61
80
 
81
+ if attributes.key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+
85
+ if attributes.key?(:'description')
86
+ self.description = attributes[:'description']
87
+ end
88
+
62
89
  if attributes.key?(:'capacity_in_gb')
63
90
  self.capacity_in_gb = attributes[:'capacity_in_gb']
64
91
  end
92
+
93
+ if attributes.key?(:'path_suffix')
94
+ self.path_suffix = attributes[:'path_suffix']
95
+ end
96
+
97
+ if attributes.key?(:'permissions')
98
+ self.permissions = attributes[:'permissions']
99
+ end
65
100
  end
66
101
 
67
102
  # Show invalid properties with the reasons. Usually used together with valid?
68
103
  # @return Array for valid properties with the reasons
69
104
  def list_invalid_properties
70
105
  invalid_properties = Array.new
106
+ if !@name.nil? && @name.to_s.length > 100
107
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
108
+ end
109
+
110
+ if !@name.nil? && @name.to_s.length < 1
111
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
112
+ end
113
+
114
+ if !@description.nil? && @description.to_s.length > 250
115
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
116
+ end
117
+
71
118
  if !@capacity_in_gb.nil? && @capacity_in_gb < 2000
72
119
  invalid_properties.push('invalid value for "capacity_in_gb", must be greater than or equal to 2000.')
73
120
  end
74
121
 
122
+ if !@path_suffix.nil? && @path_suffix.to_s.length > 27
123
+ invalid_properties.push('invalid value for "path_suffix", the character length must be smaller than or equal to 27.')
124
+ end
125
+
126
+ if !@path_suffix.nil? && @path_suffix.to_s.length < 0
127
+ invalid_properties.push('invalid value for "path_suffix", the character length must be great than or equal to 0.')
128
+ end
129
+
130
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
131
+ if !@path_suffix.nil? && @path_suffix !~ pattern
132
+ invalid_properties.push("invalid value for \"path_suffix\", must conform to the pattern #{pattern}.")
133
+ end
134
+
75
135
  invalid_properties
76
136
  end
77
137
 
78
138
  # Check to see if the all the properties in the model are valid
79
139
  # @return true if the model is valid
80
140
  def valid?
141
+ return false if !@name.nil? && @name.to_s.length > 100
142
+ return false if !@name.nil? && @name.to_s.length < 1
143
+ return false if !@description.nil? && @description.to_s.length > 250
81
144
  return false if !@capacity_in_gb.nil? && @capacity_in_gb < 2000
145
+ return false if !@path_suffix.nil? && @path_suffix.to_s.length > 27
146
+ return false if !@path_suffix.nil? && @path_suffix.to_s.length < 0
147
+ return false if !@path_suffix.nil? && @path_suffix !~ Regexp.new(/^(\/[\w-]+)+$|^$/)
82
148
  true
83
149
  end
84
150
 
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] name Value to be assigned
153
+ def name=(name)
154
+ if !name.nil? && name.to_s.length > 100
155
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
156
+ end
157
+
158
+ if !name.nil? && name.to_s.length < 1
159
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
160
+ end
161
+
162
+ @name = name
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] description Value to be assigned
167
+ def description=(description)
168
+ if !description.nil? && description.to_s.length > 250
169
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
170
+ end
171
+
172
+ @description = description
173
+ end
174
+
85
175
  # Custom attribute writer method with validation
86
176
  # @param [Object] capacity_in_gb Value to be assigned
87
177
  def capacity_in_gb=(capacity_in_gb)
@@ -92,12 +182,35 @@ module NetworkStorageApi
92
182
  @capacity_in_gb = capacity_in_gb
93
183
  end
94
184
 
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] path_suffix Value to be assigned
187
+ def path_suffix=(path_suffix)
188
+ if !path_suffix.nil? && path_suffix.to_s.length > 27
189
+ fail ArgumentError, 'invalid value for "path_suffix", the character length must be smaller than or equal to 27.'
190
+ end
191
+
192
+ if !path_suffix.nil? && path_suffix.to_s.length < 0
193
+ fail ArgumentError, 'invalid value for "path_suffix", the character length must be great than or equal to 0.'
194
+ end
195
+
196
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
197
+ if !path_suffix.nil? && path_suffix !~ pattern
198
+ fail ArgumentError, "invalid value for \"path_suffix\", must conform to the pattern #{pattern}."
199
+ end
200
+
201
+ @path_suffix = path_suffix
202
+ end
203
+
95
204
  # Checks equality by comparing each attribute.
96
205
  # @param [Object] Object to be compared
97
206
  def ==(o)
98
207
  return true if self.equal?(o)
99
208
  self.class == o.class &&
100
- capacity_in_gb == o.capacity_in_gb
209
+ name == o.name &&
210
+ description == o.description &&
211
+ capacity_in_gb == o.capacity_in_gb &&
212
+ path_suffix == o.path_suffix &&
213
+ permissions == o.permissions
101
214
  end
102
215
 
103
216
  # @see the `==` method
@@ -109,7 +222,7 @@ module NetworkStorageApi
109
222
  # Calculates hash code according to all attributes.
110
223
  # @return [Integer] Hash code
111
224
  def hash
112
- [capacity_in_gb].hash
225
+ [name, description, capacity_in_gb, path_suffix, permissions].hash
113
226
  end
114
227
 
115
228
  # Builds the object from hash
@@ -19,11 +19,16 @@ require 'pnap_network_storage_api/configuration'
19
19
  # Models
20
20
  require 'pnap_network_storage_api/models/error'
21
21
  require 'pnap_network_storage_api/models/nfs_permissions'
22
+ require 'pnap_network_storage_api/models/nfs_permissions_create'
23
+ require 'pnap_network_storage_api/models/nfs_permissions_update'
22
24
  require 'pnap_network_storage_api/models/permissions'
25
+ require 'pnap_network_storage_api/models/permissions_create'
26
+ require 'pnap_network_storage_api/models/permissions_update'
23
27
  require 'pnap_network_storage_api/models/status'
24
28
  require 'pnap_network_storage_api/models/storage_network'
25
29
  require 'pnap_network_storage_api/models/storage_network_create'
26
30
  require 'pnap_network_storage_api/models/storage_network_update'
31
+ require 'pnap_network_storage_api/models/storage_network_volume_create'
27
32
  require 'pnap_network_storage_api/models/volume'
28
33
  require 'pnap_network_storage_api/models/volume_create'
29
34
  require 'pnap_network_storage_api/models/volume_update'