pnap_network_storage_api 1.1.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98790b752c44df0148ad5371bd2044d5dff91b569b25c8b7c38e2bc016dd1e5a
4
- data.tar.gz: '089913181ec8d92e0560bf0d13991d9dacc5ed2839bc48e92564bbfe3577fd54'
3
+ metadata.gz: 825f2d86eab01b72dc080b416b4b20fd8d51ebdf62595e0f564630f8e62bb15b
4
+ data.tar.gz: 3e77f5f15f2154ceb8eca25a3bebac2d418b1d52f94cf5b5a7d180e13c960ccd
5
5
  SHA512:
6
- metadata.gz: 3d619f8343b73ad20a8e9bdd40b7efe43ea8c1f2833f3a408af32477a097b70cd0155f8888d0434709d2ee49216ce4f8427074363bf41c2cbd8def0b6f7b616b
7
- data.tar.gz: 94b4b770f57606f873a1da64360e4c1faba2737cf2ba6a7ec792f981feb418a4687fb9292793f4d9e8b8a366205da8e37770d5630496280fa1512e217faeba91
6
+ metadata.gz: 5ae1bca9d78dab9bbd1bbd8553f9e4eaabc2c6c512b2790562b1a1c1951da9af03221ef8a011c25c046b0ca7951e1fbd8be6677d233096aa37c2bb57ab07742f
7
+ data.tar.gz: f746fb54257b7774e25be56a40b283d9e2fc7a7ead0b8873e59de563aa1de78ee27f08f1e1aaf20225fdd296517b28b2c34aef745eea333b08d146eaa95dc301
data/README.md CHANGED
@@ -127,6 +127,7 @@ Class | Method | HTTP request | Description
127
127
  *NetworkStorageApi::StorageNetworksApi* | [**storage_networks_id_patch**](docs/StorageNetworksApi.md#storage_networks_id_patch) | **PATCH** /storage-networks/{storageNetworkId} | Update storage network details.
128
128
  *NetworkStorageApi::StorageNetworksApi* | [**storage_networks_post**](docs/StorageNetworksApi.md#storage_networks_post) | **POST** /storage-networks | Create a storage network and volume.
129
129
  *NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_get**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_get) | **GET** /storage-networks/{storageNetworkId}/volumes | Display one or more volumes belonging to a storage network.
130
+ *NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_post**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_post) | **POST** /storage-networks/{storageNetworkId}/volumes | Create a volume belonging to a storage network.
130
131
  *NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_volume_id_delete**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_delete) | **DELETE** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Delete a Storage Network's Volume
131
132
  *NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_volume_id_get**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_get) | **GET** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Get a storage network's volume details.
132
133
  *NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_volume_id_patch**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_patch) | **PATCH** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Update a storage network's volume details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **name** | **String** | Storage network friendly name. | |
8
8
  | **description** | **String** | Storage network description. | [optional] |
9
- | **location** | **String** | Location of storage network. Currently this field should be set to `PHX`. | |
9
+ | **location** | **String** | Location of storage network. Currently this field should be set to `PHX` or `ASH`. | |
10
10
  | **volumes** | [**Array<VolumeCreate>**](VolumeCreate.md) | Volume to be created alongside storage. Currently only 1 volume is supported. | |
11
11
 
12
12
  ## Example
@@ -10,6 +10,7 @@ All URIs are relative to *https://api.phoenixnap.com/network-storage/v1*
10
10
  | [**storage_networks_id_patch**](StorageNetworksApi.md#storage_networks_id_patch) | **PATCH** /storage-networks/{storageNetworkId} | Update storage network details. |
11
11
  | [**storage_networks_post**](StorageNetworksApi.md#storage_networks_post) | **POST** /storage-networks | Create a storage network and volume. |
12
12
  | [**storage_networks_storage_network_id_volumes_get**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_get) | **GET** /storage-networks/{storageNetworkId}/volumes | Display one or more volumes belonging to a storage network. |
13
+ | [**storage_networks_storage_network_id_volumes_post**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_post) | **POST** /storage-networks/{storageNetworkId}/volumes | Create a volume belonging to a storage network. |
13
14
  | [**storage_networks_storage_network_id_volumes_volume_id_delete**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_delete) | **DELETE** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Delete a Storage Network's Volume |
14
15
  | [**storage_networks_storage_network_id_volumes_volume_id_get**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_get) | **GET** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Get a storage network's volume details. |
15
16
  | [**storage_networks_storage_network_id_volumes_volume_id_patch**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_patch) | **PATCH** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Update a storage network's volume details. |
@@ -436,6 +437,79 @@ end
436
437
  - **Accept**: application/json
437
438
 
438
439
 
440
+ ## storage_networks_storage_network_id_volumes_post
441
+
442
+ > <Volume> storage_networks_storage_network_id_volumes_post(storage_network_id, opts)
443
+
444
+ Create a volume belonging to a storage network.
445
+
446
+ Create a volume belonging to a storage network.
447
+
448
+ ### Examples
449
+
450
+ ```ruby
451
+ require 'time'
452
+ require 'pnap_network_storage_api'
453
+ # setup authorization
454
+ NetworkStorageApi.configure do |config|
455
+ # Configure OAuth2 access token for authorization: OAuth2
456
+ config.access_token = 'YOUR ACCESS TOKEN'
457
+ end
458
+
459
+ api_instance = NetworkStorageApi::StorageNetworksApi.new
460
+ storage_network_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of storage network.
461
+ opts = {
462
+ volume_create: NetworkStorageApi::VolumeCreate.new({name: 'My volume name', capacity_in_gb: 2000}) # VolumeCreate |
463
+ }
464
+
465
+ begin
466
+ # Create a volume belonging to a storage network.
467
+ result = api_instance.storage_networks_storage_network_id_volumes_post(storage_network_id, opts)
468
+ p result
469
+ rescue NetworkStorageApi::ApiError => e
470
+ puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_post: #{e}"
471
+ end
472
+ ```
473
+
474
+ #### Using the storage_networks_storage_network_id_volumes_post_with_http_info variant
475
+
476
+ This returns an Array which contains the response data, status code and headers.
477
+
478
+ > <Array(<Volume>, Integer, Hash)> storage_networks_storage_network_id_volumes_post_with_http_info(storage_network_id, opts)
479
+
480
+ ```ruby
481
+ begin
482
+ # Create a volume belonging to a storage network.
483
+ data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_post_with_http_info(storage_network_id, opts)
484
+ p status_code # => 2xx
485
+ p headers # => { ... }
486
+ p data # => <Volume>
487
+ rescue NetworkStorageApi::ApiError => e
488
+ puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_post_with_http_info: #{e}"
489
+ end
490
+ ```
491
+
492
+ ### Parameters
493
+
494
+ | Name | Type | Description | Notes |
495
+ | ---- | ---- | ----------- | ----- |
496
+ | **storage_network_id** | **String** | ID of storage network. | |
497
+ | **volume_create** | [**VolumeCreate**](VolumeCreate.md) | | [optional] |
498
+
499
+ ### Return type
500
+
501
+ [**Volume**](Volume.md)
502
+
503
+ ### Authorization
504
+
505
+ [OAuth2](../README.md#OAuth2)
506
+
507
+ ### HTTP request headers
508
+
509
+ - **Content-Type**: application/json
510
+ - **Accept**: application/json
511
+
512
+
439
513
  ## storage_networks_storage_network_id_volumes_volume_id_delete
440
514
 
441
515
  > storage_networks_storage_network_id_volumes_volume_id_delete(storage_network_id, volume_id)
data/docs/VolumeUpdate.md CHANGED
@@ -4,7 +4,10 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | Volume friendly name. | [optional] |
8
+ | **description** | **String** | Volume description. | [optional] |
7
9
  | **capacity_in_gb** | **Integer** | Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported. | [optional] |
10
+ | **path_suffix** | **String** | Last part of volume&#39;s path. | [optional] |
8
11
 
9
12
  ## Example
10
13
 
@@ -12,7 +15,10 @@
12
15
  require 'pnap_network_storage_api'
13
16
 
14
17
  instance = NetworkStorageApi::VolumeUpdate.new(
15
- capacity_in_gb: 2000
18
+ name: New Volume name,
19
+ description: New Volume description,
20
+ capacity_in_gb: 2000,
21
+ path_suffix: null
16
22
  )
17
23
  ```
18
24
 
@@ -402,6 +402,76 @@ module NetworkStorageApi
402
402
  return data, status_code, headers
403
403
  end
404
404
 
405
+ # Create a volume belonging to a storage network.
406
+ # Create a volume belonging to a storage network.
407
+ # @param storage_network_id [String] ID of storage network.
408
+ # @param [Hash] opts the optional parameters
409
+ # @option opts [VolumeCreate] :volume_create
410
+ # @return [Volume]
411
+ def storage_networks_storage_network_id_volumes_post(storage_network_id, opts = {})
412
+ data, _status_code, _headers = storage_networks_storage_network_id_volumes_post_with_http_info(storage_network_id, opts)
413
+ data
414
+ end
415
+
416
+ # Create a volume belonging to a storage network.
417
+ # Create a volume belonging to a storage network.
418
+ # @param storage_network_id [String] ID of storage network.
419
+ # @param [Hash] opts the optional parameters
420
+ # @option opts [VolumeCreate] :volume_create
421
+ # @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
422
+ def storage_networks_storage_network_id_volumes_post_with_http_info(storage_network_id, opts = {})
423
+ if @api_client.config.debugging
424
+ @api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_post ...'
425
+ end
426
+ # verify the required parameter 'storage_network_id' is set
427
+ if @api_client.config.client_side_validation && storage_network_id.nil?
428
+ fail ArgumentError, "Missing the required parameter 'storage_network_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_post"
429
+ end
430
+ # resource path
431
+ local_var_path = '/storage-networks/{storageNetworkId}/volumes'.sub('{' + 'storageNetworkId' + '}', CGI.escape(storage_network_id.to_s))
432
+
433
+ # query parameters
434
+ query_params = opts[:query_params] || {}
435
+
436
+ # header parameters
437
+ header_params = opts[:header_params] || {}
438
+ # HTTP header 'Accept' (if needed)
439
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
440
+ # HTTP header 'Content-Type'
441
+ content_type = @api_client.select_header_content_type(['application/json'])
442
+ if !content_type.nil?
443
+ header_params['Content-Type'] = content_type
444
+ end
445
+
446
+ # form parameters
447
+ form_params = opts[:form_params] || {}
448
+
449
+ # http body (model)
450
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'volume_create'])
451
+
452
+ # return_type
453
+ return_type = opts[:debug_return_type] || 'Volume'
454
+
455
+ # auth_names
456
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
457
+
458
+ new_options = opts.merge(
459
+ :operation => :"StorageNetworksApi.storage_networks_storage_network_id_volumes_post",
460
+ :header_params => header_params,
461
+ :query_params => query_params,
462
+ :form_params => form_params,
463
+ :body => post_body,
464
+ :auth_names => auth_names,
465
+ :return_type => return_type
466
+ )
467
+
468
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
469
+ if @api_client.config.debugging
470
+ @api_client.config.logger.debug "API called: StorageNetworksApi#storage_networks_storage_network_id_volumes_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
471
+ end
472
+ return data, status_code, headers
473
+ end
474
+
405
475
  # Delete a Storage Network's Volume
406
476
  # Delete a Storage Network's Volume
407
477
  # @param storage_network_id [String] ID of storage network.
@@ -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.
@@ -111,15 +111,15 @@ module NetworkStorageApi
111
111
  invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
112
112
  end
113
113
 
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.')
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
116
  end
117
117
 
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.')
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
120
  end
121
121
 
122
- pattern = Regexp.new(/^(\/[\w-]+)+$/)
122
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
123
123
  if !@path_suffix.nil? && @path_suffix !~ pattern
124
124
  invalid_properties.push("invalid value for \"path_suffix\", must conform to the pattern #{pattern}.")
125
125
  end
@@ -142,9 +142,9 @@ module NetworkStorageApi
142
142
  return false if @name.to_s.length > 100
143
143
  return false if @name.to_s.length < 1
144
144
  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-]+)+$/)
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
148
  return false if @capacity_in_gb.nil?
149
149
  return false if @capacity_in_gb < 1000
150
150
  true
@@ -181,15 +181,15 @@ module NetworkStorageApi
181
181
  # Custom attribute writer method with validation
182
182
  # @param [Object] path_suffix Value to be assigned
183
183
  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.'
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
186
  end
187
187
 
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.'
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
190
  end
191
191
 
192
- pattern = Regexp.new(/^(\/[\w-]+)+$/)
192
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
193
193
  if !path_suffix.nil? && path_suffix !~ pattern
194
194
  fail ArgumentError, "invalid value for \"path_suffix\", must conform to the pattern #{pattern}."
195
195
  end
@@ -16,13 +16,25 @@ 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
+
22
31
  # Attribute mapping from ruby-style variable name to JSON key.
23
32
  def self.attribute_map
24
33
  {
25
- :'capacity_in_gb' => :'capacityInGb'
34
+ :'name' => :'name',
35
+ :'description' => :'description',
36
+ :'capacity_in_gb' => :'capacityInGb',
37
+ :'path_suffix' => :'pathSuffix'
26
38
  }
27
39
  end
28
40
 
@@ -34,7 +46,10 @@ module NetworkStorageApi
34
46
  # Attribute type mapping.
35
47
  def self.openapi_types
36
48
  {
37
- :'capacity_in_gb' => :'Integer'
49
+ :'name' => :'String',
50
+ :'description' => :'String',
51
+ :'capacity_in_gb' => :'Integer',
52
+ :'path_suffix' => :'String'
38
53
  }
39
54
  end
40
55
 
@@ -59,29 +74,96 @@ module NetworkStorageApi
59
74
  h[k.to_sym] = v
60
75
  }
61
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
+
62
85
  if attributes.key?(:'capacity_in_gb')
63
86
  self.capacity_in_gb = attributes[:'capacity_in_gb']
64
87
  end
88
+
89
+ if attributes.key?(:'path_suffix')
90
+ self.path_suffix = attributes[:'path_suffix']
91
+ end
65
92
  end
66
93
 
67
94
  # Show invalid properties with the reasons. Usually used together with valid?
68
95
  # @return Array for valid properties with the reasons
69
96
  def list_invalid_properties
70
97
  invalid_properties = Array.new
98
+ if !@name.nil? && @name.to_s.length > 100
99
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
100
+ end
101
+
102
+ if !@name.nil? && @name.to_s.length < 1
103
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
104
+ end
105
+
106
+ if !@description.nil? && @description.to_s.length > 250
107
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
108
+ end
109
+
71
110
  if !@capacity_in_gb.nil? && @capacity_in_gb < 2000
72
111
  invalid_properties.push('invalid value for "capacity_in_gb", must be greater than or equal to 2000.')
73
112
  end
74
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
+
75
127
  invalid_properties
76
128
  end
77
129
 
78
130
  # Check to see if the all the properties in the model are valid
79
131
  # @return true if the model is valid
80
132
  def valid?
133
+ return false if !@name.nil? && @name.to_s.length > 100
134
+ return false if !@name.nil? && @name.to_s.length < 1
135
+ return false if !@description.nil? && @description.to_s.length > 250
81
136
  return false if !@capacity_in_gb.nil? && @capacity_in_gb < 2000
137
+ return false if !@path_suffix.nil? && @path_suffix.to_s.length > 27
138
+ return false if !@path_suffix.nil? && @path_suffix.to_s.length < 0
139
+ return false if !@path_suffix.nil? && @path_suffix !~ Regexp.new(/^(\/[\w-]+)+$|^$/)
82
140
  true
83
141
  end
84
142
 
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] name Value to be assigned
145
+ def name=(name)
146
+ if !name.nil? && name.to_s.length > 100
147
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
148
+ end
149
+
150
+ if !name.nil? && name.to_s.length < 1
151
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
152
+ end
153
+
154
+ @name = name
155
+ end
156
+
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] description Value to be assigned
159
+ def description=(description)
160
+ if !description.nil? && description.to_s.length > 250
161
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
162
+ end
163
+
164
+ @description = description
165
+ end
166
+
85
167
  # Custom attribute writer method with validation
86
168
  # @param [Object] capacity_in_gb Value to be assigned
87
169
  def capacity_in_gb=(capacity_in_gb)
@@ -92,12 +174,34 @@ module NetworkStorageApi
92
174
  @capacity_in_gb = capacity_in_gb
93
175
  end
94
176
 
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] path_suffix Value to be assigned
179
+ def path_suffix=(path_suffix)
180
+ if !path_suffix.nil? && path_suffix.to_s.length > 27
181
+ fail ArgumentError, 'invalid value for "path_suffix", the character length must be smaller than or equal to 27.'
182
+ end
183
+
184
+ if !path_suffix.nil? && path_suffix.to_s.length < 0
185
+ fail ArgumentError, 'invalid value for "path_suffix", the character length must be great than or equal to 0.'
186
+ end
187
+
188
+ pattern = Regexp.new(/^(\/[\w-]+)+$|^$/)
189
+ if !path_suffix.nil? && path_suffix !~ pattern
190
+ fail ArgumentError, "invalid value for \"path_suffix\", must conform to the pattern #{pattern}."
191
+ end
192
+
193
+ @path_suffix = path_suffix
194
+ end
195
+
95
196
  # Checks equality by comparing each attribute.
96
197
  # @param [Object] Object to be compared
97
198
  def ==(o)
98
199
  return true if self.equal?(o)
99
200
  self.class == o.class &&
100
- capacity_in_gb == o.capacity_in_gb
201
+ name == o.name &&
202
+ description == o.description &&
203
+ capacity_in_gb == o.capacity_in_gb &&
204
+ path_suffix == o.path_suffix
101
205
  end
102
206
 
103
207
  # @see the `==` method
@@ -109,7 +213,7 @@ module NetworkStorageApi
109
213
  # Calculates hash code according to all attributes.
110
214
  # @return [Integer] Hash code
111
215
  def hash
112
- [capacity_in_gb].hash
216
+ [name, description, capacity_in_gb, path_suffix].hash
113
217
  end
114
218
 
115
219
  # Builds the object from hash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pnap_network_storage_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PhoenixNAP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-07 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -131,14 +131,14 @@ test_files:
131
131
  - spec/api/storage_networks_api_spec.rb
132
132
  - spec/api_client_spec.rb
133
133
  - spec/configuration_spec.rb
134
- - spec/models/permissions_spec.rb
135
- - spec/models/storage_network_create_spec.rb
136
134
  - spec/models/volume_create_spec.rb
135
+ - spec/models/permissions_spec.rb
136
+ - spec/models/storage_network_update_spec.rb
137
137
  - spec/models/error_spec.rb
138
+ - spec/models/volume_spec.rb
138
139
  - spec/models/storage_network_spec.rb
139
140
  - spec/models/nfs_permissions_spec.rb
140
141
  - spec/models/status_spec.rb
141
- - spec/models/volume_spec.rb
142
142
  - spec/models/volume_update_spec.rb
143
- - spec/models/storage_network_update_spec.rb
143
+ - spec/models/storage_network_create_spec.rb
144
144
  - spec/spec_helper.rb