azure_mgmt_netapp 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  3. data/lib/2019-05-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  4. data/lib/2019-06-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  5. data/lib/2019-07-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  6. data/lib/2019-08-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  7. data/lib/2019-10-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  8. data/lib/2019-11-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  9. data/lib/2020-02-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  10. data/lib/2020-06-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  11. data/lib/2020-07-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  12. data/lib/2020-09-01/generated/azure_mgmt_netapp.rb +104 -0
  13. data/lib/2020-09-01/generated/azure_mgmt_netapp/account_backups.rb +373 -0
  14. data/lib/2020-09-01/generated/azure_mgmt_netapp/accounts.rb +709 -0
  15. data/lib/2020-09-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +173 -0
  16. data/lib/2020-09-01/generated/azure_mgmt_netapp/backup_policies.rb +691 -0
  17. data/lib/2020-09-01/generated/azure_mgmt_netapp/backups.rb +747 -0
  18. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/active_directory.rb +275 -0
  19. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/active_directory_status.rb +19 -0
  20. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/authorize_request.rb +46 -0
  21. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/backup.rb +158 -0
  22. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/backup_patch.rb +130 -0
  23. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/backup_policies_list.rb +55 -0
  24. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/backup_policy.rb +212 -0
  25. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/backup_policy_details.rb +212 -0
  26. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/backup_policy_patch.rb +212 -0
  27. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/backups_list.rb +55 -0
  28. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/break_replication_request.rb +47 -0
  29. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +198 -0
  30. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  31. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +132 -0
  32. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/check_availability_response.rb +78 -0
  33. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  34. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/check_quota_name_resource_types.rb +18 -0
  35. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/daily_schedule.rb +81 -0
  36. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  37. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/endpoint_type.rb +16 -0
  38. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +205 -0
  39. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/hourly_schedule.rb +69 -0
  40. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  41. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  42. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/mirror_state.rb +17 -0
  43. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/monthly_schedule.rb +93 -0
  44. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/mount_target.rb +159 -0
  45. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/mount_target_properties.rb +93 -0
  46. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  47. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  48. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  49. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  50. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  51. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  52. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/pool_change_request.rb +46 -0
  53. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/qos_type.rb +16 -0
  54. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/quota_availability_request.rb +73 -0
  55. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/relationship_status.rb +16 -0
  56. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/replication_object.rb +94 -0
  57. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/replication_schedule.rb +17 -0
  58. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/replication_status.rb +93 -0
  59. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  60. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/security_style.rb +16 -0
  61. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  62. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  63. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/snapshot.rb +123 -0
  64. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/snapshot_policies_list.rb +55 -0
  65. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/snapshot_policy.rb +185 -0
  66. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/snapshot_policy_details.rb +185 -0
  67. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/snapshot_policy_patch.rb +185 -0
  68. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/snapshot_policy_volume_list.rb +54 -0
  69. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  70. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/vault.rb +93 -0
  71. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/vault_list.rb +55 -0
  72. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume.rb +409 -0
  73. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_backup_properties.rb +79 -0
  74. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_backups.rb +68 -0
  75. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_list.rb +98 -0
  76. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_patch.rb +178 -0
  77. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_patch_properties_data_protection.rb +50 -0
  78. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  79. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +74 -0
  80. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  81. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_revert.rb +46 -0
  82. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/volume_snapshot_properties.rb +46 -0
  83. data/lib/2020-09-01/generated/azure_mgmt_netapp/models/weekly_schedule.rb +94 -0
  84. data/lib/2020-09-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  85. data/lib/2020-09-01/generated/azure_mgmt_netapp/net_app_resource.rb +424 -0
  86. data/lib/2020-09-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  87. data/lib/2020-09-01/generated/azure_mgmt_netapp/pools.rb +737 -0
  88. data/lib/2020-09-01/generated/azure_mgmt_netapp/snapshot_policies.rb +700 -0
  89. data/lib/2020-09-01/generated/azure_mgmt_netapp/snapshots.rb +794 -0
  90. data/lib/2020-09-01/generated/azure_mgmt_netapp/vaults.rb +128 -0
  91. data/lib/2020-09-01/generated/azure_mgmt_netapp/volumes.rb +2143 -0
  92. data/lib/azure_mgmt_netapp.rb +1 -0
  93. data/lib/profiles/latest/modules/netapp_profile_module.rb +144 -144
  94. data/lib/version.rb +1 -1
  95. metadata +82 -2
@@ -0,0 +1,115 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::NetApp::Mgmt::V2020_09_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureNetAppFilesManagementClient] reference to the AzureNetAppFilesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Describes the Resource Provider
26
+ #
27
+ # Lists all of the available Microsoft.NetApp Rest API operations
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [OperationListResult] operation results.
33
+ #
34
+ def list(custom_headers:nil)
35
+ response = list_async(custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Describes the Resource Provider
41
+ #
42
+ # Lists all of the available Microsoft.NetApp Rest API operations
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(custom_headers:nil)
50
+ list_async(custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Describes the Resource Provider
55
+ #
56
+ # Lists all of the available Microsoft.NetApp Rest API operations
57
+ #
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_async(custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+
66
+
67
+ request_headers = {}
68
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
69
+
70
+ # Set Headers
71
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = 'providers/Microsoft.NetApp/operations'
74
+
75
+ request_url = @base_url || @client.base_url
76
+
77
+ options = {
78
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
96
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
97
+ # Deserialize Response
98
+ if status_code == 200
99
+ begin
100
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
101
+ result_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::OperationListResult.mapper()
102
+ result.body = @client.deserialize(result_mapper, parsed_response)
103
+ rescue Exception => e
104
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
105
+ end
106
+ end
107
+
108
+ result
109
+ end
110
+
111
+ promise.execute
112
+ end
113
+
114
+ end
115
+ end
@@ -0,0 +1,737 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::NetApp::Mgmt::V2020_09_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class Pools
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Pools class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureNetAppFilesManagementClient] reference to the AzureNetAppFilesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Describe all Capacity Pools
26
+ #
27
+ # List all capacity pools in the NetApp Account
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group.
30
+ # @param account_name [String] The name of the NetApp account
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [CapacityPoolList] operation results.
35
+ #
36
+ def list(resource_group_name, account_name, custom_headers:nil)
37
+ response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Describe all Capacity Pools
43
+ #
44
+ # List all capacity pools in the NetApp Account
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group.
47
+ # @param account_name [String] The name of the NetApp account
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_with_http_info(resource_group_name, account_name, custom_headers:nil)
54
+ list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Describe all Capacity Pools
59
+ #
60
+ # List all capacity pools in the NetApp Account
61
+ #
62
+ # @param resource_group_name [String] The name of the resource group.
63
+ # @param account_name [String] The name of the NetApp account
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_async(resource_group_name, account_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
73
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
75
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPoolList.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Describe a Capacity Pool
129
+ #
130
+ # Get details of the specified capacity pool
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group.
133
+ # @param account_name [String] The name of the NetApp account
134
+ # @param pool_name [String] The name of the capacity pool
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [CapacityPool] operation results.
139
+ #
140
+ def get(resource_group_name, account_name, pool_name, custom_headers:nil)
141
+ response = get_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
142
+ response.body unless response.nil?
143
+ end
144
+
145
+ #
146
+ # Describe a Capacity Pool
147
+ #
148
+ # Get details of the specified capacity pool
149
+ #
150
+ # @param resource_group_name [String] The name of the resource group.
151
+ # @param account_name [String] The name of the NetApp account
152
+ # @param pool_name [String] The name of the capacity pool
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
157
+ #
158
+ def get_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
159
+ get_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
160
+ end
161
+
162
+ #
163
+ # Describe a Capacity Pool
164
+ #
165
+ # Get details of the specified capacity pool
166
+ #
167
+ # @param resource_group_name [String] The name of the resource group.
168
+ # @param account_name [String] The name of the NetApp account
169
+ # @param pool_name [String] The name of the capacity pool
170
+ # @param [Hash{String => String}] A hash of custom headers that will be added
171
+ # to the HTTP request.
172
+ #
173
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
174
+ #
175
+ def get_async(resource_group_name, account_name, pool_name, custom_headers:nil)
176
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
177
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
178
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
179
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
180
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
181
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
182
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
183
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'MaxLength': '64'" if !pool_name.nil? && pool_name.length > 64
184
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'MinLength': '1'" if !pool_name.nil? && pool_name.length < 1
185
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$'" if !pool_name.nil? && pool_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$$')).nil?
186
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
187
+
188
+
189
+ request_headers = {}
190
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
191
+
192
+ # Set Headers
193
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
194
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
195
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
196
+
197
+ request_url = @base_url || @client.base_url
198
+
199
+ options = {
200
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
201
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
202
+ query_params: {'api-version' => @client.api_version},
203
+ headers: request_headers.merge(custom_headers || {}),
204
+ base_url: request_url
205
+ }
206
+ promise = @client.make_request_async(:get, path_template, options)
207
+
208
+ promise = promise.then do |result|
209
+ http_response = result.response
210
+ status_code = http_response.status
211
+ response_content = http_response.body
212
+ unless status_code == 200
213
+ error_model = JSON.load(response_content)
214
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
215
+ end
216
+
217
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
218
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
219
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
220
+ # Deserialize Response
221
+ if status_code == 200
222
+ begin
223
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
224
+ result_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPool.mapper()
225
+ result.body = @client.deserialize(result_mapper, parsed_response)
226
+ rescue Exception => e
227
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
228
+ end
229
+ end
230
+
231
+ result
232
+ end
233
+
234
+ promise.execute
235
+ end
236
+
237
+ #
238
+ # Create or Update the specified capacity pool within the resource group
239
+ #
240
+ # Create or Update a capacity pool
241
+ #
242
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
243
+ # operation.
244
+ # @param resource_group_name [String] The name of the resource group.
245
+ # @param account_name [String] The name of the NetApp account
246
+ # @param pool_name [String] The name of the capacity pool
247
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
248
+ # will be added to the HTTP request.
249
+ #
250
+ # @return [CapacityPool] operation results.
251
+ #
252
+ def create_or_update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
253
+ response = create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
254
+ response.body unless response.nil?
255
+ end
256
+
257
+ #
258
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
259
+ # operation.
260
+ # @param resource_group_name [String] The name of the resource group.
261
+ # @param account_name [String] The name of the NetApp account
262
+ # @param pool_name [String] The name of the capacity pool
263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
264
+ # will be added to the HTTP request.
265
+ #
266
+ # @return [Concurrent::Promise] promise which provides async access to http
267
+ # response.
268
+ #
269
+ def create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
270
+ # Send request
271
+ promise = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers)
272
+
273
+ promise = promise.then do |response|
274
+ # Defining deserialization method.
275
+ deserialize_method = lambda do |parsed_response|
276
+ result_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPool.mapper()
277
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
278
+ end
279
+
280
+ # Waiting for response.
281
+ @client.get_long_running_operation_result(response, deserialize_method)
282
+ end
283
+
284
+ promise
285
+ end
286
+
287
+ #
288
+ # Update a capacity pool
289
+ #
290
+ # Patch the specified capacity pool
291
+ #
292
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
293
+ # the operation.
294
+ # @param resource_group_name [String] The name of the resource group.
295
+ # @param account_name [String] The name of the NetApp account
296
+ # @param pool_name [String] The name of the capacity pool
297
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
298
+ # will be added to the HTTP request.
299
+ #
300
+ # @return [CapacityPool] operation results.
301
+ #
302
+ def update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
303
+ response = update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
304
+ response.body unless response.nil?
305
+ end
306
+
307
+ #
308
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
309
+ # the operation.
310
+ # @param resource_group_name [String] The name of the resource group.
311
+ # @param account_name [String] The name of the NetApp account
312
+ # @param pool_name [String] The name of the capacity pool
313
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
314
+ # will be added to the HTTP request.
315
+ #
316
+ # @return [Concurrent::Promise] promise which provides async access to http
317
+ # response.
318
+ #
319
+ def update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
320
+ # Send request
321
+ promise = begin_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers)
322
+
323
+ promise = promise.then do |response|
324
+ # Defining deserialization method.
325
+ deserialize_method = lambda do |parsed_response|
326
+ result_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPool.mapper()
327
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
328
+ end
329
+
330
+ # Waiting for response.
331
+ @client.get_long_running_operation_result(response, deserialize_method)
332
+ end
333
+
334
+ promise
335
+ end
336
+
337
+ #
338
+ # Delete a capacity pool
339
+ #
340
+ # Delete the specified capacity pool
341
+ #
342
+ # @param resource_group_name [String] The name of the resource group.
343
+ # @param account_name [String] The name of the NetApp account
344
+ # @param pool_name [String] The name of the capacity pool
345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
346
+ # will be added to the HTTP request.
347
+ #
348
+ def delete(resource_group_name, account_name, pool_name, custom_headers:nil)
349
+ response = delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
350
+ nil
351
+ end
352
+
353
+ #
354
+ # @param resource_group_name [String] The name of the resource group.
355
+ # @param account_name [String] The name of the NetApp account
356
+ # @param pool_name [String] The name of the capacity pool
357
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
358
+ # will be added to the HTTP request.
359
+ #
360
+ # @return [Concurrent::Promise] promise which provides async access to http
361
+ # response.
362
+ #
363
+ def delete_async(resource_group_name, account_name, pool_name, custom_headers:nil)
364
+ # Send request
365
+ promise = begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers)
366
+
367
+ promise = promise.then do |response|
368
+ # Defining deserialization method.
369
+ deserialize_method = lambda do |parsed_response|
370
+ end
371
+
372
+ # Waiting for response.
373
+ @client.get_long_running_operation_result(response, deserialize_method)
374
+ end
375
+
376
+ promise
377
+ end
378
+
379
+ #
380
+ # Create or Update the specified capacity pool within the resource group
381
+ #
382
+ # Create or Update a capacity pool
383
+ #
384
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
385
+ # operation.
386
+ # @param resource_group_name [String] The name of the resource group.
387
+ # @param account_name [String] The name of the NetApp account
388
+ # @param pool_name [String] The name of the capacity pool
389
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
390
+ # will be added to the HTTP request.
391
+ #
392
+ # @return [CapacityPool] operation results.
393
+ #
394
+ def begin_create_or_update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
395
+ response = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
396
+ response.body unless response.nil?
397
+ end
398
+
399
+ #
400
+ # Create or Update the specified capacity pool within the resource group
401
+ #
402
+ # Create or Update a capacity pool
403
+ #
404
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
405
+ # operation.
406
+ # @param resource_group_name [String] The name of the resource group.
407
+ # @param account_name [String] The name of the NetApp account
408
+ # @param pool_name [String] The name of the capacity pool
409
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
410
+ # will be added to the HTTP request.
411
+ #
412
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
413
+ #
414
+ def begin_create_or_update_with_http_info(body, resource_group_name, account_name, pool_name, custom_headers:nil)
415
+ begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
416
+ end
417
+
418
+ #
419
+ # Create or Update the specified capacity pool within the resource group
420
+ #
421
+ # Create or Update a capacity pool
422
+ #
423
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
424
+ # operation.
425
+ # @param resource_group_name [String] The name of the resource group.
426
+ # @param account_name [String] The name of the NetApp account
427
+ # @param pool_name [String] The name of the capacity pool
428
+ # @param [Hash{String => String}] A hash of custom headers that will be added
429
+ # to the HTTP request.
430
+ #
431
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
432
+ #
433
+ def begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
434
+ fail ArgumentError, 'body is nil' if body.nil?
435
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
436
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
437
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
438
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
439
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
440
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
441
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
442
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'MaxLength': '64'" if !pool_name.nil? && pool_name.length > 64
443
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'MinLength': '1'" if !pool_name.nil? && pool_name.length < 1
444
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$'" if !pool_name.nil? && pool_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$$')).nil?
445
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
446
+
447
+
448
+ request_headers = {}
449
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
450
+
451
+ # Set Headers
452
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
453
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
454
+
455
+ # Serialize Request
456
+ request_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPool.mapper()
457
+ request_content = @client.serialize(request_mapper, body)
458
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
459
+
460
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
461
+
462
+ request_url = @base_url || @client.base_url
463
+
464
+ options = {
465
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
466
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
467
+ query_params: {'api-version' => @client.api_version},
468
+ body: request_content,
469
+ headers: request_headers.merge(custom_headers || {}),
470
+ base_url: request_url
471
+ }
472
+ promise = @client.make_request_async(:put, path_template, options)
473
+
474
+ promise = promise.then do |result|
475
+ http_response = result.response
476
+ status_code = http_response.status
477
+ response_content = http_response.body
478
+ unless status_code == 200 || status_code == 201 || status_code == 202
479
+ error_model = JSON.load(response_content)
480
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
481
+ end
482
+
483
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
484
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
485
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
486
+ # Deserialize Response
487
+ if status_code == 200
488
+ begin
489
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
490
+ result_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPool.mapper()
491
+ result.body = @client.deserialize(result_mapper, parsed_response)
492
+ rescue Exception => e
493
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
494
+ end
495
+ end
496
+ # Deserialize Response
497
+ if status_code == 201
498
+ begin
499
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
500
+ result_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPool.mapper()
501
+ result.body = @client.deserialize(result_mapper, parsed_response)
502
+ rescue Exception => e
503
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
504
+ end
505
+ end
506
+
507
+ result
508
+ end
509
+
510
+ promise.execute
511
+ end
512
+
513
+ #
514
+ # Update a capacity pool
515
+ #
516
+ # Patch the specified capacity pool
517
+ #
518
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
519
+ # the operation.
520
+ # @param resource_group_name [String] The name of the resource group.
521
+ # @param account_name [String] The name of the NetApp account
522
+ # @param pool_name [String] The name of the capacity pool
523
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
524
+ # will be added to the HTTP request.
525
+ #
526
+ # @return [CapacityPool] operation results.
527
+ #
528
+ def begin_update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
529
+ response = begin_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
530
+ response.body unless response.nil?
531
+ end
532
+
533
+ #
534
+ # Update a capacity pool
535
+ #
536
+ # Patch the specified capacity pool
537
+ #
538
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
539
+ # the operation.
540
+ # @param resource_group_name [String] The name of the resource group.
541
+ # @param account_name [String] The name of the NetApp account
542
+ # @param pool_name [String] The name of the capacity pool
543
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
544
+ # will be added to the HTTP request.
545
+ #
546
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
547
+ #
548
+ def begin_update_with_http_info(body, resource_group_name, account_name, pool_name, custom_headers:nil)
549
+ begin_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
550
+ end
551
+
552
+ #
553
+ # Update a capacity pool
554
+ #
555
+ # Patch the specified capacity pool
556
+ #
557
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
558
+ # the operation.
559
+ # @param resource_group_name [String] The name of the resource group.
560
+ # @param account_name [String] The name of the NetApp account
561
+ # @param pool_name [String] The name of the capacity pool
562
+ # @param [Hash{String => String}] A hash of custom headers that will be added
563
+ # to the HTTP request.
564
+ #
565
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
566
+ #
567
+ def begin_update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
568
+ fail ArgumentError, 'body is nil' if body.nil?
569
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
570
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
571
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
572
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
573
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
574
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
575
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
576
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'MaxLength': '64'" if !pool_name.nil? && pool_name.length > 64
577
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'MinLength': '1'" if !pool_name.nil? && pool_name.length < 1
578
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$'" if !pool_name.nil? && pool_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$$')).nil?
579
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
580
+
581
+
582
+ request_headers = {}
583
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
584
+
585
+ # Set Headers
586
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
587
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
588
+
589
+ # Serialize Request
590
+ request_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPoolPatch.mapper()
591
+ request_content = @client.serialize(request_mapper, body)
592
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
593
+
594
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
595
+
596
+ request_url = @base_url || @client.base_url
597
+
598
+ options = {
599
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
600
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
601
+ query_params: {'api-version' => @client.api_version},
602
+ body: request_content,
603
+ headers: request_headers.merge(custom_headers || {}),
604
+ base_url: request_url
605
+ }
606
+ promise = @client.make_request_async(:patch, path_template, options)
607
+
608
+ promise = promise.then do |result|
609
+ http_response = result.response
610
+ status_code = http_response.status
611
+ response_content = http_response.body
612
+ unless status_code == 200 || status_code == 202
613
+ error_model = JSON.load(response_content)
614
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
615
+ end
616
+
617
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
618
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
619
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
620
+ # Deserialize Response
621
+ if status_code == 200
622
+ begin
623
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
624
+ result_mapper = Azure::NetApp::Mgmt::V2020_09_01::Models::CapacityPool.mapper()
625
+ result.body = @client.deserialize(result_mapper, parsed_response)
626
+ rescue Exception => e
627
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
628
+ end
629
+ end
630
+
631
+ result
632
+ end
633
+
634
+ promise.execute
635
+ end
636
+
637
+ #
638
+ # Delete a capacity pool
639
+ #
640
+ # Delete the specified capacity pool
641
+ #
642
+ # @param resource_group_name [String] The name of the resource group.
643
+ # @param account_name [String] The name of the NetApp account
644
+ # @param pool_name [String] The name of the capacity pool
645
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
646
+ # will be added to the HTTP request.
647
+ #
648
+ #
649
+ def begin_delete(resource_group_name, account_name, pool_name, custom_headers:nil)
650
+ response = begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
651
+ nil
652
+ end
653
+
654
+ #
655
+ # Delete a capacity pool
656
+ #
657
+ # Delete the specified capacity pool
658
+ #
659
+ # @param resource_group_name [String] The name of the resource group.
660
+ # @param account_name [String] The name of the NetApp account
661
+ # @param pool_name [String] The name of the capacity pool
662
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
663
+ # will be added to the HTTP request.
664
+ #
665
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
666
+ #
667
+ def begin_delete_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
668
+ begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
669
+ end
670
+
671
+ #
672
+ # Delete a capacity pool
673
+ #
674
+ # Delete the specified capacity pool
675
+ #
676
+ # @param resource_group_name [String] The name of the resource group.
677
+ # @param account_name [String] The name of the NetApp account
678
+ # @param pool_name [String] The name of the capacity pool
679
+ # @param [Hash{String => String}] A hash of custom headers that will be added
680
+ # to the HTTP request.
681
+ #
682
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
683
+ #
684
+ def begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:nil)
685
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
686
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
687
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
688
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
689
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
690
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
691
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
692
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'MaxLength': '64'" if !pool_name.nil? && pool_name.length > 64
693
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'MinLength': '1'" if !pool_name.nil? && pool_name.length < 1
694
+ fail ArgumentError, "'pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$'" if !pool_name.nil? && pool_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$$')).nil?
695
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
696
+
697
+
698
+ request_headers = {}
699
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
700
+
701
+ # Set Headers
702
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
703
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
704
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
705
+
706
+ request_url = @base_url || @client.base_url
707
+
708
+ options = {
709
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
710
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
711
+ query_params: {'api-version' => @client.api_version},
712
+ headers: request_headers.merge(custom_headers || {}),
713
+ base_url: request_url
714
+ }
715
+ promise = @client.make_request_async(:delete, path_template, options)
716
+
717
+ promise = promise.then do |result|
718
+ http_response = result.response
719
+ status_code = http_response.status
720
+ response_content = http_response.body
721
+ unless status_code == 202 || status_code == 204
722
+ error_model = JSON.load(response_content)
723
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
724
+ end
725
+
726
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
727
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
728
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
729
+
730
+ result
731
+ end
732
+
733
+ promise.execute
734
+ end
735
+
736
+ end
737
+ end