pnap_network_storage_api 1.0.1 → 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: 8f0449183e648db3081fc7c5f624565ec5bba72e17bc4f51f2c29bc700ae6f1f
4
- data.tar.gz: 585150d1732fed839dc3a2acce947cac54ad080e775eb03877885d244562d3e1
3
+ metadata.gz: 825f2d86eab01b72dc080b416b4b20fd8d51ebdf62595e0f564630f8e62bb15b
4
+ data.tar.gz: 3e77f5f15f2154ceb8eca25a3bebac2d418b1d52f94cf5b5a7d180e13c960ccd
5
5
  SHA512:
6
- metadata.gz: 2956fa632df5263b1e0f360807b78fcc7fdd20673c238e1a96062312f6ceffe2445cc154803c09599e02eda46b743188eeb31d1ed91c2ba1301e0bcdd273a150
7
- data.tar.gz: 4d4e3e2fabe648317c2eb3fae49baa35d9590b0cda800c9e1be55695439a6c9d84a9f1ed5605afc777f3b2860258698c90c28e6fadc185fd18e43ac3798ed2a8
6
+ metadata.gz: 5ae1bca9d78dab9bbd1bbd8553f9e4eaabc2c6c512b2790562b1a1c1951da9af03221ef8a011c25c046b0ca7951e1fbd8be6677d233096aa37c2bb57ab07742f
7
+ data.tar.gz: f746fb54257b7774e25be56a40b283d9e2fc7a7ead0b8873e59de563aa1de78ee27f08f1e1aaf20225fdd296517b28b2c34aef745eea333b08d146eaa95dc301
data/README.md CHANGED
@@ -127,7 +127,10 @@ 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.
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
130
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.
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.
131
134
 
132
135
 
133
136
  ## Documentation for Models
@@ -141,6 +144,7 @@ Class | Method | HTTP request | Description
141
144
  - [NetworkStorageApi::StorageNetworkUpdate](docs/StorageNetworkUpdate.md)
142
145
  - [NetworkStorageApi::Volume](docs/Volume.md)
143
146
  - [NetworkStorageApi::VolumeCreate](docs/VolumeCreate.md)
147
+ - [NetworkStorageApi::VolumeUpdate](docs/VolumeUpdate.md)
144
148
 
145
149
 
146
150
  ## Documentation for Authorization
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
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,7 +10,10 @@ 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. |
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 |
13
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. |
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. |
14
17
 
15
18
 
16
19
  ## storage_networks_get
@@ -434,6 +437,149 @@ end
434
437
  - **Accept**: application/json
435
438
 
436
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
+
513
+ ## storage_networks_storage_network_id_volumes_volume_id_delete
514
+
515
+ > storage_networks_storage_network_id_volumes_volume_id_delete(storage_network_id, volume_id)
516
+
517
+ Delete a Storage Network's Volume
518
+
519
+ Delete a Storage Network's Volume
520
+
521
+ ### Examples
522
+
523
+ ```ruby
524
+ require 'time'
525
+ require 'pnap_network_storage_api'
526
+ # setup authorization
527
+ NetworkStorageApi.configure do |config|
528
+ # Configure OAuth2 access token for authorization: OAuth2
529
+ config.access_token = 'YOUR ACCESS TOKEN'
530
+ end
531
+
532
+ api_instance = NetworkStorageApi::StorageNetworksApi.new
533
+ storage_network_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of storage network.
534
+ volume_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of volume.
535
+
536
+ begin
537
+ # Delete a Storage Network's Volume
538
+ api_instance.storage_networks_storage_network_id_volumes_volume_id_delete(storage_network_id, volume_id)
539
+ rescue NetworkStorageApi::ApiError => e
540
+ puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_delete: #{e}"
541
+ end
542
+ ```
543
+
544
+ #### Using the storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info variant
545
+
546
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
547
+
548
+ > <Array(nil, Integer, Hash)> storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_network_id, volume_id)
549
+
550
+ ```ruby
551
+ begin
552
+ # Delete a Storage Network's Volume
553
+ data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_network_id, volume_id)
554
+ p status_code # => 2xx
555
+ p headers # => { ... }
556
+ p data # => nil
557
+ rescue NetworkStorageApi::ApiError => e
558
+ puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info: #{e}"
559
+ end
560
+ ```
561
+
562
+ ### Parameters
563
+
564
+ | Name | Type | Description | Notes |
565
+ | ---- | ---- | ----------- | ----- |
566
+ | **storage_network_id** | **String** | ID of storage network. | |
567
+ | **volume_id** | **String** | ID of volume. | |
568
+
569
+ ### Return type
570
+
571
+ nil (empty response body)
572
+
573
+ ### Authorization
574
+
575
+ [OAuth2](../README.md#OAuth2)
576
+
577
+ ### HTTP request headers
578
+
579
+ - **Content-Type**: Not defined
580
+ - **Accept**: application/json
581
+
582
+
437
583
  ## storage_networks_storage_network_id_volumes_volume_id_get
438
584
 
439
585
  > <Volume> storage_networks_storage_network_id_volumes_volume_id_get(storage_network_id, volume_id)
@@ -504,3 +650,78 @@ end
504
650
  - **Content-Type**: Not defined
505
651
  - **Accept**: application/json
506
652
 
653
+
654
+ ## storage_networks_storage_network_id_volumes_volume_id_patch
655
+
656
+ > <Volume> storage_networks_storage_network_id_volumes_volume_id_patch(storage_network_id, volume_id, opts)
657
+
658
+ Update a storage network's volume details.
659
+
660
+ Update a storage network's volume details.
661
+
662
+ ### Examples
663
+
664
+ ```ruby
665
+ require 'time'
666
+ require 'pnap_network_storage_api'
667
+ # setup authorization
668
+ NetworkStorageApi.configure do |config|
669
+ # Configure OAuth2 access token for authorization: OAuth2
670
+ config.access_token = 'YOUR ACCESS TOKEN'
671
+ end
672
+
673
+ api_instance = NetworkStorageApi::StorageNetworksApi.new
674
+ storage_network_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of storage network.
675
+ volume_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of volume.
676
+ opts = {
677
+ volume_update: NetworkStorageApi::VolumeUpdate.new # VolumeUpdate | Storage network volume to be updated.
678
+ }
679
+
680
+ begin
681
+ # Update a storage network's volume details.
682
+ result = api_instance.storage_networks_storage_network_id_volumes_volume_id_patch(storage_network_id, volume_id, opts)
683
+ p result
684
+ rescue NetworkStorageApi::ApiError => e
685
+ puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_patch: #{e}"
686
+ end
687
+ ```
688
+
689
+ #### Using the storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info variant
690
+
691
+ This returns an Array which contains the response data, status code and headers.
692
+
693
+ > <Array(<Volume>, Integer, Hash)> storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_network_id, volume_id, opts)
694
+
695
+ ```ruby
696
+ begin
697
+ # Update a storage network's volume details.
698
+ data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_network_id, volume_id, opts)
699
+ p status_code # => 2xx
700
+ p headers # => { ... }
701
+ p data # => <Volume>
702
+ rescue NetworkStorageApi::ApiError => e
703
+ puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info: #{e}"
704
+ end
705
+ ```
706
+
707
+ ### Parameters
708
+
709
+ | Name | Type | Description | Notes |
710
+ | ---- | ---- | ----------- | ----- |
711
+ | **storage_network_id** | **String** | ID of storage network. | |
712
+ | **volume_id** | **String** | ID of volume. | |
713
+ | **volume_update** | [**VolumeUpdate**](VolumeUpdate.md) | Storage network volume to be updated. | [optional] |
714
+
715
+ ### Return type
716
+
717
+ [**Volume**](Volume.md)
718
+
719
+ ### Authorization
720
+
721
+ [OAuth2](../README.md#OAuth2)
722
+
723
+ ### HTTP request headers
724
+
725
+ - **Content-Type**: application/json
726
+ - **Accept**: application/json
727
+
data/docs/Volume.md CHANGED
@@ -10,6 +10,7 @@
10
10
  | **path** | **String** | Volume&#39;s full path. It is in form of &#x60;/{volumeId}/pathSuffix&#x60;&#39;. | [optional] |
11
11
  | **path_suffix** | **String** | Last part of volume&#39;s path. | [optional] |
12
12
  | **capacity_in_gb** | **Integer** | Maximum capacity in GB. | [optional] |
13
+ | **used_capacity_in_gb** | **Integer** | Used capacity in GB, updated periodically. | [optional] |
13
14
  | **protocol** | **String** | File system protocol. Currently this field should be set to &#x60;NFS&#x60;. | [optional] |
14
15
  | **status** | [**Status**](Status.md) | | [optional] |
15
16
  | **created_on** | **Time** | | [optional] |
@@ -27,6 +28,7 @@ instance = NetworkStorageApi::Volume.new(
27
28
  path: /qjul77ahf5fplr2ba484/shared-docs,
28
29
  path_suffix: /shared-docs,
29
30
  capacity_in_gb: 2000,
31
+ used_capacity_in_gb: 1000,
30
32
  protocol: NFS,
31
33
  status: null,
32
34
  created_on: 2021-03-13T20:24:32.491Z,
@@ -0,0 +1,24 @@
1
+ # NetworkStorageApi::VolumeUpdate
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | Volume friendly name. | [optional] |
8
+ | **description** | **String** | Volume description. | [optional] |
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] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'pnap_network_storage_api'
16
+
17
+ instance = NetworkStorageApi::VolumeUpdate.new(
18
+ name: New Volume name,
19
+ description: New Volume description,
20
+ capacity_in_gb: 2000,
21
+ path_suffix: null
22
+ )
23
+ ```
24
+
@@ -402,6 +402,145 @@ 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
+
475
+ # Delete a Storage Network's Volume
476
+ # Delete a Storage Network's Volume
477
+ # @param storage_network_id [String] ID of storage network.
478
+ # @param volume_id [String] ID of volume.
479
+ # @param [Hash] opts the optional parameters
480
+ # @return [nil]
481
+ def storage_networks_storage_network_id_volumes_volume_id_delete(storage_network_id, volume_id, opts = {})
482
+ storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_network_id, volume_id, opts)
483
+ nil
484
+ end
485
+
486
+ # Delete a Storage Network&#39;s Volume
487
+ # Delete a Storage Network&#39;s Volume
488
+ # @param storage_network_id [String] ID of storage network.
489
+ # @param volume_id [String] ID of volume.
490
+ # @param [Hash] opts the optional parameters
491
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
492
+ def storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_network_id, volume_id, opts = {})
493
+ if @api_client.config.debugging
494
+ @api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete ...'
495
+ end
496
+ # verify the required parameter 'storage_network_id' is set
497
+ if @api_client.config.client_side_validation && storage_network_id.nil?
498
+ fail ArgumentError, "Missing the required parameter 'storage_network_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete"
499
+ end
500
+ # verify the required parameter 'volume_id' is set
501
+ if @api_client.config.client_side_validation && volume_id.nil?
502
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete"
503
+ end
504
+ # resource path
505
+ local_var_path = '/storage-networks/{storageNetworkId}/volumes/{volumeId}'.sub('{' + 'storageNetworkId' + '}', CGI.escape(storage_network_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
506
+
507
+ # query parameters
508
+ query_params = opts[:query_params] || {}
509
+
510
+ # header parameters
511
+ header_params = opts[:header_params] || {}
512
+ # HTTP header 'Accept' (if needed)
513
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
514
+
515
+ # form parameters
516
+ form_params = opts[:form_params] || {}
517
+
518
+ # http body (model)
519
+ post_body = opts[:debug_body]
520
+
521
+ # return_type
522
+ return_type = opts[:debug_return_type]
523
+
524
+ # auth_names
525
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
526
+
527
+ new_options = opts.merge(
528
+ :operation => :"StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete",
529
+ :header_params => header_params,
530
+ :query_params => query_params,
531
+ :form_params => form_params,
532
+ :body => post_body,
533
+ :auth_names => auth_names,
534
+ :return_type => return_type
535
+ )
536
+
537
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
538
+ if @api_client.config.debugging
539
+ @api_client.config.logger.debug "API called: StorageNetworksApi#storage_networks_storage_network_id_volumes_volume_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
540
+ end
541
+ return data, status_code, headers
542
+ end
543
+
405
544
  # Get a storage network's volume details.
406
545
  # Get a storage network's volume details.
407
546
  # @param storage_network_id [String] ID of storage network.
@@ -470,5 +609,81 @@ module NetworkStorageApi
470
609
  end
471
610
  return data, status_code, headers
472
611
  end
612
+
613
+ # Update a storage network's volume details.
614
+ # Update a storage network's volume details.
615
+ # @param storage_network_id [String] ID of storage network.
616
+ # @param volume_id [String] ID of volume.
617
+ # @param [Hash] opts the optional parameters
618
+ # @option opts [VolumeUpdate] :volume_update Storage network volume to be updated.
619
+ # @return [Volume]
620
+ def storage_networks_storage_network_id_volumes_volume_id_patch(storage_network_id, volume_id, opts = {})
621
+ data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_network_id, volume_id, opts)
622
+ data
623
+ end
624
+
625
+ # Update a storage network&#39;s volume details.
626
+ # Update a storage network&#39;s volume details.
627
+ # @param storage_network_id [String] ID of storage network.
628
+ # @param volume_id [String] ID of volume.
629
+ # @param [Hash] opts the optional parameters
630
+ # @option opts [VolumeUpdate] :volume_update Storage network volume to be updated.
631
+ # @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
632
+ def storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_network_id, volume_id, opts = {})
633
+ if @api_client.config.debugging
634
+ @api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch ...'
635
+ end
636
+ # verify the required parameter 'storage_network_id' is set
637
+ if @api_client.config.client_side_validation && storage_network_id.nil?
638
+ fail ArgumentError, "Missing the required parameter 'storage_network_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch"
639
+ end
640
+ # verify the required parameter 'volume_id' is set
641
+ if @api_client.config.client_side_validation && volume_id.nil?
642
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch"
643
+ end
644
+ # resource path
645
+ local_var_path = '/storage-networks/{storageNetworkId}/volumes/{volumeId}'.sub('{' + 'storageNetworkId' + '}', CGI.escape(storage_network_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
646
+
647
+ # query parameters
648
+ query_params = opts[:query_params] || {}
649
+
650
+ # header parameters
651
+ header_params = opts[:header_params] || {}
652
+ # HTTP header 'Accept' (if needed)
653
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
654
+ # HTTP header 'Content-Type'
655
+ content_type = @api_client.select_header_content_type(['application/json'])
656
+ if !content_type.nil?
657
+ header_params['Content-Type'] = content_type
658
+ end
659
+
660
+ # form parameters
661
+ form_params = opts[:form_params] || {}
662
+
663
+ # http body (model)
664
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'volume_update'])
665
+
666
+ # return_type
667
+ return_type = opts[:debug_return_type] || 'Volume'
668
+
669
+ # auth_names
670
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
671
+
672
+ new_options = opts.merge(
673
+ :operation => :"StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch",
674
+ :header_params => header_params,
675
+ :query_params => query_params,
676
+ :form_params => form_params,
677
+ :body => post_body,
678
+ :auth_names => auth_names,
679
+ :return_type => return_type
680
+ )
681
+
682
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
683
+ if @api_client.config.debugging
684
+ @api_client.config.logger.debug "API called: StorageNetworksApi#storage_networks_storage_network_id_volumes_volume_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
685
+ end
686
+ return data, status_code, headers
687
+ end
473
688
  end
474
689
  end
@@ -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.
@@ -34,6 +34,9 @@ module NetworkStorageApi
34
34
  # Maximum capacity in GB.
35
35
  attr_accessor :capacity_in_gb
36
36
 
37
+ # Used capacity in GB, updated periodically.
38
+ attr_accessor :used_capacity_in_gb
39
+
37
40
  # File system protocol. Currently this field should be set to `NFS`.
38
41
  attr_accessor :protocol
39
42
 
@@ -52,6 +55,7 @@ module NetworkStorageApi
52
55
  :'path' => :'path',
53
56
  :'path_suffix' => :'pathSuffix',
54
57
  :'capacity_in_gb' => :'capacityInGb',
58
+ :'used_capacity_in_gb' => :'usedCapacityInGb',
55
59
  :'protocol' => :'protocol',
56
60
  :'status' => :'status',
57
61
  :'created_on' => :'createdOn',
@@ -73,6 +77,7 @@ module NetworkStorageApi
73
77
  :'path' => :'String',
74
78
  :'path_suffix' => :'String',
75
79
  :'capacity_in_gb' => :'Integer',
80
+ :'used_capacity_in_gb' => :'Integer',
76
81
  :'protocol' => :'String',
77
82
  :'status' => :'Status',
78
83
  :'created_on' => :'Time',
@@ -125,6 +130,10 @@ module NetworkStorageApi
125
130
  self.capacity_in_gb = attributes[:'capacity_in_gb']
126
131
  end
127
132
 
133
+ if attributes.key?(:'used_capacity_in_gb')
134
+ self.used_capacity_in_gb = attributes[:'used_capacity_in_gb']
135
+ end
136
+
128
137
  if attributes.key?(:'protocol')
129
138
  self.protocol = attributes[:'protocol']
130
139
  end
@@ -166,6 +175,7 @@ module NetworkStorageApi
166
175
  path == o.path &&
167
176
  path_suffix == o.path_suffix &&
168
177
  capacity_in_gb == o.capacity_in_gb &&
178
+ used_capacity_in_gb == o.used_capacity_in_gb &&
169
179
  protocol == o.protocol &&
170
180
  status == o.status &&
171
181
  created_on == o.created_on &&
@@ -181,7 +191,7 @@ module NetworkStorageApi
181
191
  # Calculates hash code according to all attributes.
182
192
  # @return [Integer] Hash code
183
193
  def hash
184
- [id, name, description, path, path_suffix, capacity_in_gb, protocol, status, created_on, permissions].hash
194
+ [id, name, description, path, path_suffix, capacity_in_gb, used_capacity_in_gb, protocol, status, created_on, permissions].hash
185
195
  end
186
196
 
187
197
  # Builds the object from hash
@@ -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
@@ -0,0 +1,340 @@
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
+ # Update storage network volume.
18
+ class VolumeUpdate
19
+ # Volume friendly name.
20
+ attr_accessor :name
21
+
22
+ # Volume description.
23
+ attr_accessor :description
24
+
25
+ # Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported.
26
+ attr_accessor :capacity_in_gb
27
+
28
+ # Last part of volume's path.
29
+ attr_accessor :path_suffix
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
+ :'capacity_in_gb' => :'capacityInGb',
37
+ :'path_suffix' => :'pathSuffix'
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
+ :'capacity_in_gb' => :'Integer',
52
+ :'path_suffix' => :'String'
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::VolumeUpdate` 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::VolumeUpdate`. 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?(:'capacity_in_gb')
86
+ self.capacity_in_gb = attributes[:'capacity_in_gb']
87
+ end
88
+
89
+ if attributes.key?(:'path_suffix')
90
+ self.path_suffix = attributes[:'path_suffix']
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? && @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
+
110
+ if !@capacity_in_gb.nil? && @capacity_in_gb < 2000
111
+ invalid_properties.push('invalid value for "capacity_in_gb", must be greater than or equal to 2000.')
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
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
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
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-]+)+$|^$/)
140
+ true
141
+ end
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
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] capacity_in_gb Value to be assigned
169
+ def capacity_in_gb=(capacity_in_gb)
170
+ if !capacity_in_gb.nil? && capacity_in_gb < 2000
171
+ fail ArgumentError, 'invalid value for "capacity_in_gb", must be greater than or equal to 2000.'
172
+ end
173
+
174
+ @capacity_in_gb = capacity_in_gb
175
+ end
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
+
196
+ # Checks equality by comparing each attribute.
197
+ # @param [Object] Object to be compared
198
+ def ==(o)
199
+ return true if self.equal?(o)
200
+ self.class == o.class &&
201
+ name == o.name &&
202
+ description == o.description &&
203
+ capacity_in_gb == o.capacity_in_gb &&
204
+ path_suffix == o.path_suffix
205
+ end
206
+
207
+ # @see the `==` method
208
+ # @param [Object] Object to be compared
209
+ def eql?(o)
210
+ self == o
211
+ end
212
+
213
+ # Calculates hash code according to all attributes.
214
+ # @return [Integer] Hash code
215
+ def hash
216
+ [name, description, capacity_in_gb, path_suffix].hash
217
+ end
218
+
219
+ # Builds the object from hash
220
+ # @param [Hash] attributes Model attributes in the form of hash
221
+ # @return [Object] Returns the model itself
222
+ def self.build_from_hash(attributes)
223
+ new.build_from_hash(attributes)
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def build_from_hash(attributes)
230
+ return nil unless attributes.is_a?(Hash)
231
+ attributes = attributes.transform_keys(&:to_sym)
232
+ self.class.openapi_types.each_pair do |key, type|
233
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
234
+ self.send("#{key}=", nil)
235
+ elsif type =~ /\AArray<(.*)>/i
236
+ # check to ensure the input is an array given that the attribute
237
+ # is documented as an array but the input is not
238
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
239
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
240
+ end
241
+ elsif !attributes[self.class.attribute_map[key]].nil?
242
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
243
+ end
244
+ end
245
+
246
+ self
247
+ end
248
+
249
+ # Deserializes the data based on type
250
+ # @param string type Data type
251
+ # @param string value Value to be deserialized
252
+ # @return [Object] Deserialized data
253
+ def _deserialize(type, value)
254
+ case type.to_sym
255
+ when :Time
256
+ Time.parse(value)
257
+ when :Date
258
+ Date.parse(value)
259
+ when :String
260
+ value.to_s
261
+ when :Integer
262
+ value.to_i
263
+ when :Float
264
+ value.to_f
265
+ when :Boolean
266
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
267
+ true
268
+ else
269
+ false
270
+ end
271
+ when :Object
272
+ # generic object (usually a Hash), return directly
273
+ value
274
+ when /\AArray<(?<inner_type>.+)>\z/
275
+ inner_type = Regexp.last_match[:inner_type]
276
+ value.map { |v| _deserialize(inner_type, v) }
277
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
278
+ k_type = Regexp.last_match[:k_type]
279
+ v_type = Regexp.last_match[:v_type]
280
+ {}.tap do |hash|
281
+ value.each do |k, v|
282
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
283
+ end
284
+ end
285
+ else # model
286
+ # models (e.g. Pet) or oneOf
287
+ klass = NetworkStorageApi.const_get(type)
288
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
289
+ end
290
+ end
291
+
292
+ # Returns the string representation of the object
293
+ # @return [String] String presentation of the object
294
+ def to_s
295
+ to_hash.to_s
296
+ end
297
+
298
+ # to_body is an alias to to_hash (backward compatibility)
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_body
301
+ to_hash
302
+ end
303
+
304
+ # Returns the object in the form of hash
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_hash
307
+ hash = {}
308
+ self.class.attribute_map.each_pair do |attr, param|
309
+ value = self.send(attr)
310
+ if value.nil?
311
+ is_nullable = self.class.openapi_nullable.include?(attr)
312
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
313
+ end
314
+
315
+ hash[param] = _to_hash(value)
316
+ end
317
+ hash
318
+ end
319
+
320
+ # Outputs non-array value in the form of hash
321
+ # For object, use to_hash. Otherwise, just return the value
322
+ # @param [Object] value Any valid value
323
+ # @return [Hash] Returns the value in the form of hash
324
+ def _to_hash(value)
325
+ if value.is_a?(Array)
326
+ value.compact.map { |v| _to_hash(v) }
327
+ elsif value.is_a?(Hash)
328
+ {}.tap do |hash|
329
+ value.each { |k, v| hash[k] = _to_hash(v) }
330
+ end
331
+ elsif value.respond_to? :to_hash
332
+ value.to_hash
333
+ else
334
+ value
335
+ end
336
+ end
337
+
338
+ end
339
+
340
+ end
@@ -26,6 +26,7 @@ require 'pnap_network_storage_api/models/storage_network_create'
26
26
  require 'pnap_network_storage_api/models/storage_network_update'
27
27
  require 'pnap_network_storage_api/models/volume'
28
28
  require 'pnap_network_storage_api/models/volume_create'
29
+ require 'pnap_network_storage_api/models/volume_update'
29
30
 
30
31
  # APIs
31
32
  require 'pnap_network_storage_api/api/storage_networks_api'
@@ -0,0 +1,34 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for NetworkStorageApi::VolumeUpdate
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe NetworkStorageApi::VolumeUpdate do
21
+ let(:instance) { NetworkStorageApi::VolumeUpdate.new }
22
+
23
+ describe 'test an instance of VolumeUpdate' do
24
+ it 'should create an instance of VolumeUpdate' do
25
+ expect(instance).to be_instance_of(NetworkStorageApi::VolumeUpdate)
26
+ end
27
+ end
28
+ describe 'test attribute "capacity_in_gb"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ end
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.0.1
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-10-03 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
@@ -71,6 +71,7 @@ files:
71
71
  - docs/StorageNetworksApi.md
72
72
  - docs/Volume.md
73
73
  - docs/VolumeCreate.md
74
+ - docs/VolumeUpdate.md
74
75
  - lib/pnap_network_storage_api.rb
75
76
  - lib/pnap_network_storage_api/api/storage_networks_api.rb
76
77
  - lib/pnap_network_storage_api/api_client.rb
@@ -85,6 +86,7 @@ files:
85
86
  - lib/pnap_network_storage_api/models/storage_network_update.rb
86
87
  - lib/pnap_network_storage_api/models/volume.rb
87
88
  - lib/pnap_network_storage_api/models/volume_create.rb
89
+ - lib/pnap_network_storage_api/models/volume_update.rb
88
90
  - lib/pnap_network_storage_api/version.rb
89
91
  - pnap_network_storage_api.gemspec
90
92
  - spec/api/storage_networks_api_spec.rb
@@ -99,6 +101,7 @@ files:
99
101
  - spec/models/storage_network_update_spec.rb
100
102
  - spec/models/volume_create_spec.rb
101
103
  - spec/models/volume_spec.rb
104
+ - spec/models/volume_update_spec.rb
102
105
  - spec/spec_helper.rb
103
106
  homepage: https://phoenixnap.com/bare-metal-cloud
104
107
  licenses:
@@ -120,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
123
  - !ruby/object:Gem::Version
121
124
  version: '0'
122
125
  requirements: []
123
- rubygems_version: 3.1.2
126
+ rubygems_version: 3.3.5
124
127
  signing_key:
125
128
  specification_version: 4
126
129
  summary: Network Storage API Ruby Gem
@@ -128,13 +131,14 @@ test_files:
128
131
  - spec/api/storage_networks_api_spec.rb
129
132
  - spec/api_client_spec.rb
130
133
  - spec/configuration_spec.rb
131
- - spec/models/storage_network_spec.rb
132
- - spec/models/volume_spec.rb
134
+ - spec/models/volume_create_spec.rb
135
+ - spec/models/permissions_spec.rb
136
+ - spec/models/storage_network_update_spec.rb
133
137
  - spec/models/error_spec.rb
138
+ - spec/models/volume_spec.rb
139
+ - spec/models/storage_network_spec.rb
134
140
  - spec/models/nfs_permissions_spec.rb
135
141
  - spec/models/status_spec.rb
142
+ - spec/models/volume_update_spec.rb
136
143
  - spec/models/storage_network_create_spec.rb
137
- - spec/models/permissions_spec.rb
138
- - spec/models/volume_create_spec.rb
139
- - spec/models/storage_network_update_spec.rb
140
144
  - spec/spec_helper.rb