azure_mgmt_netapp 0.22.0 → 0.23.0

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