1package netapp
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"github.com/Azure/go-autorest/autorest"
12	"github.com/Azure/go-autorest/autorest/azure"
13	"github.com/Azure/go-autorest/autorest/validation"
14	"github.com/Azure/go-autorest/tracing"
15	"net/http"
16)
17
18// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
19type VolumesClient struct {
20	BaseClient
21}
22
23// NewVolumesClient creates an instance of the VolumesClient client.
24func NewVolumesClient(subscriptionID string) VolumesClient {
25	return NewVolumesClientWithBaseURI(DefaultBaseURI, subscriptionID)
26}
27
28// NewVolumesClientWithBaseURI creates an instance of the VolumesClient client using a custom endpoint.  Use this when
29// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
30func NewVolumesClientWithBaseURI(baseURI string, subscriptionID string) VolumesClient {
31	return VolumesClient{NewWithBaseURI(baseURI, subscriptionID)}
32}
33
34// AuthorizeReplication authorize the replication connection on the source volume
35// Parameters:
36// resourceGroupName - the name of the resource group.
37// accountName - the name of the NetApp account
38// poolName - the name of the capacity pool
39// volumeName - the name of the volume
40// body - authorize request object supplied in the body of the operation.
41func (client VolumesClient) AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (result VolumesAuthorizeReplicationFuture, err error) {
42	if tracing.IsEnabled() {
43		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.AuthorizeReplication")
44		defer func() {
45			sc := -1
46			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
47				sc = result.FutureAPI.Response().StatusCode
48			}
49			tracing.EndSpan(ctx, sc, err)
50		}()
51	}
52	if err := validation.Validate([]validation.Validation{
53		{TargetValue: resourceGroupName,
54			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
55				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
56				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
57		{TargetValue: poolName,
58			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
59				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
60				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
61		{TargetValue: volumeName,
62			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
63				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
64				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
65		return result, validation.NewError("netapp.VolumesClient", "AuthorizeReplication", err.Error())
66	}
67
68	req, err := client.AuthorizeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
69	if err != nil {
70		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure preparing request")
71		return
72	}
73
74	result, err = client.AuthorizeReplicationSender(req)
75	if err != nil {
76		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure sending request")
77		return
78	}
79
80	return
81}
82
83// AuthorizeReplicationPreparer prepares the AuthorizeReplication request.
84func (client VolumesClient) AuthorizeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (*http.Request, error) {
85	pathParameters := map[string]interface{}{
86		"accountName":       autorest.Encode("path", accountName),
87		"poolName":          autorest.Encode("path", poolName),
88		"resourceGroupName": autorest.Encode("path", resourceGroupName),
89		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
90		"volumeName":        autorest.Encode("path", volumeName),
91	}
92
93	const APIVersion = "2021-06-01"
94	queryParameters := map[string]interface{}{
95		"api-version": APIVersion,
96	}
97
98	preparer := autorest.CreatePreparer(
99		autorest.AsContentType("application/json; charset=utf-8"),
100		autorest.AsPost(),
101		autorest.WithBaseURL(client.BaseURI),
102		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", pathParameters),
103		autorest.WithJSON(body),
104		autorest.WithQueryParameters(queryParameters))
105	return preparer.Prepare((&http.Request{}).WithContext(ctx))
106}
107
108// AuthorizeReplicationSender sends the AuthorizeReplication request. The method will close the
109// http.Response Body if it receives an error.
110func (client VolumesClient) AuthorizeReplicationSender(req *http.Request) (future VolumesAuthorizeReplicationFuture, err error) {
111	var resp *http.Response
112	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
113	if err != nil {
114		return
115	}
116	var azf azure.Future
117	azf, err = azure.NewFutureFromResponse(resp)
118	future.FutureAPI = &azf
119	future.Result = future.result
120	return
121}
122
123// AuthorizeReplicationResponder handles the response to the AuthorizeReplication request. The method always
124// closes the http.Response Body.
125func (client VolumesClient) AuthorizeReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
126	err = autorest.Respond(
127		resp,
128		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
129		autorest.ByClosing())
130	result.Response = resp
131	return
132}
133
134// BreakReplication break the replication connection on the destination volume
135// Parameters:
136// resourceGroupName - the name of the resource group.
137// accountName - the name of the NetApp account
138// poolName - the name of the capacity pool
139// volumeName - the name of the volume
140// body - optional body to force break the replication.
141func (client VolumesClient) BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (result VolumesBreakReplicationFuture, err error) {
142	if tracing.IsEnabled() {
143		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.BreakReplication")
144		defer func() {
145			sc := -1
146			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
147				sc = result.FutureAPI.Response().StatusCode
148			}
149			tracing.EndSpan(ctx, sc, err)
150		}()
151	}
152	if err := validation.Validate([]validation.Validation{
153		{TargetValue: resourceGroupName,
154			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
155				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
156				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
157		{TargetValue: poolName,
158			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
159				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
160				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
161		{TargetValue: volumeName,
162			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
163				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
164				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
165		return result, validation.NewError("netapp.VolumesClient", "BreakReplication", err.Error())
166	}
167
168	req, err := client.BreakReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
169	if err != nil {
170		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure preparing request")
171		return
172	}
173
174	result, err = client.BreakReplicationSender(req)
175	if err != nil {
176		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure sending request")
177		return
178	}
179
180	return
181}
182
183// BreakReplicationPreparer prepares the BreakReplication request.
184func (client VolumesClient) BreakReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (*http.Request, error) {
185	pathParameters := map[string]interface{}{
186		"accountName":       autorest.Encode("path", accountName),
187		"poolName":          autorest.Encode("path", poolName),
188		"resourceGroupName": autorest.Encode("path", resourceGroupName),
189		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
190		"volumeName":        autorest.Encode("path", volumeName),
191	}
192
193	const APIVersion = "2021-06-01"
194	queryParameters := map[string]interface{}{
195		"api-version": APIVersion,
196	}
197
198	preparer := autorest.CreatePreparer(
199		autorest.AsContentType("application/json; charset=utf-8"),
200		autorest.AsPost(),
201		autorest.WithBaseURL(client.BaseURI),
202		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", pathParameters),
203		autorest.WithQueryParameters(queryParameters))
204	if body != nil {
205		preparer = autorest.DecoratePreparer(preparer,
206			autorest.WithJSON(body))
207	}
208	return preparer.Prepare((&http.Request{}).WithContext(ctx))
209}
210
211// BreakReplicationSender sends the BreakReplication request. The method will close the
212// http.Response Body if it receives an error.
213func (client VolumesClient) BreakReplicationSender(req *http.Request) (future VolumesBreakReplicationFuture, err error) {
214	var resp *http.Response
215	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
216	if err != nil {
217		return
218	}
219	var azf azure.Future
220	azf, err = azure.NewFutureFromResponse(resp)
221	future.FutureAPI = &azf
222	future.Result = future.result
223	return
224}
225
226// BreakReplicationResponder handles the response to the BreakReplication request. The method always
227// closes the http.Response Body.
228func (client VolumesClient) BreakReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
229	err = autorest.Respond(
230		resp,
231		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
232		autorest.ByClosing())
233	result.Response = resp
234	return
235}
236
237// CreateOrUpdate create or update the specified volume within the capacity pool
238// Parameters:
239// body - volume object supplied in the body of the operation.
240// resourceGroupName - the name of the resource group.
241// accountName - the name of the NetApp account
242// poolName - the name of the capacity pool
243// volumeName - the name of the volume
244func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesCreateOrUpdateFuture, err error) {
245	if tracing.IsEnabled() {
246		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.CreateOrUpdate")
247		defer func() {
248			sc := -1
249			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
250				sc = result.FutureAPI.Response().StatusCode
251			}
252			tracing.EndSpan(ctx, sc, err)
253		}()
254	}
255	if err := validation.Validate([]validation.Validation{
256		{TargetValue: body,
257			Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
258				{Target: "body.VolumeProperties", Name: validation.Null, Rule: true,
259					Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.Null, Rule: false,
260						Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil},
261							{Target: "body.VolumeProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil},
262							{Target: "body.VolumeProperties.FileSystemID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
263						}},
264						{Target: "body.VolumeProperties.CreationToken", Name: validation.Null, Rule: true,
265							Chain: []validation.Constraint{{Target: "body.VolumeProperties.CreationToken", Name: validation.MaxLength, Rule: 80, Chain: nil},
266								{Target: "body.VolumeProperties.CreationToken", Name: validation.MinLength, Rule: 1, Chain: nil},
267								{Target: "body.VolumeProperties.CreationToken", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-]{0,79}$`, Chain: nil},
268							}},
269						{Target: "body.VolumeProperties.UsageThreshold", Name: validation.Null, Rule: true,
270							Chain: []validation.Constraint{{Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMaximum, Rule: int64(109951162777600), Chain: nil},
271								{Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMinimum, Rule: int64(107374182400), Chain: nil},
272							}},
273						{Target: "body.VolumeProperties.SnapshotID", Name: validation.Null, Rule: false,
274							Chain: []validation.Constraint{{Target: "body.VolumeProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil},
275								{Target: "body.VolumeProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil},
276								{Target: "body.VolumeProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil},
277							}},
278						{Target: "body.VolumeProperties.BackupID", Name: validation.Null, Rule: false,
279							Chain: []validation.Constraint{{Target: "body.VolumeProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil},
280								{Target: "body.VolumeProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil},
281								{Target: "body.VolumeProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil},
282							}},
283						{Target: "body.VolumeProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil},
284						{Target: "body.VolumeProperties.DataProtection", Name: validation.Null, Rule: false,
285							Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication", Name: validation.Null, Rule: false,
286								Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication.RemoteVolumeResourceID", Name: validation.Null, Rule: true, Chain: nil}}},
287							}},
288						{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false,
289							Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil},
290								{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil},
291							}},
292						{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.Null, Rule: false,
293							Chain: []validation.Constraint{{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMaximum, Rule: int64(63), Chain: nil},
294								{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMinimum, Rule: int64(7), Chain: nil},
295							}},
296						{Target: "body.VolumeProperties.UnixPermissions", Name: validation.Null, Rule: false,
297							Chain: []validation.Constraint{{Target: "body.VolumeProperties.UnixPermissions", Name: validation.MaxLength, Rule: 4, Chain: nil},
298								{Target: "body.VolumeProperties.UnixPermissions", Name: validation.MinLength, Rule: 4, Chain: nil},
299							}},
300					}}}},
301		{TargetValue: resourceGroupName,
302			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
303				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
304				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
305		{TargetValue: poolName,
306			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
307				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
308				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
309		{TargetValue: volumeName,
310			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
311				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
312				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
313		return result, validation.NewError("netapp.VolumesClient", "CreateOrUpdate", err.Error())
314	}
315
316	req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName)
317	if err != nil {
318		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request")
319		return
320	}
321
322	result, err = client.CreateOrUpdateSender(req)
323	if err != nil {
324		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure sending request")
325		return
326	}
327
328	return
329}
330
331// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
332func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
333	pathParameters := map[string]interface{}{
334		"accountName":       autorest.Encode("path", accountName),
335		"poolName":          autorest.Encode("path", poolName),
336		"resourceGroupName": autorest.Encode("path", resourceGroupName),
337		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
338		"volumeName":        autorest.Encode("path", volumeName),
339	}
340
341	const APIVersion = "2021-06-01"
342	queryParameters := map[string]interface{}{
343		"api-version": APIVersion,
344	}
345
346	body.ID = nil
347	body.Name = nil
348	body.Etag = nil
349	body.Type = nil
350	preparer := autorest.CreatePreparer(
351		autorest.AsContentType("application/json; charset=utf-8"),
352		autorest.AsPut(),
353		autorest.WithBaseURL(client.BaseURI),
354		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
355		autorest.WithJSON(body),
356		autorest.WithQueryParameters(queryParameters))
357	return preparer.Prepare((&http.Request{}).WithContext(ctx))
358}
359
360// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
361// http.Response Body if it receives an error.
362func (client VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, err error) {
363	var resp *http.Response
364	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
365	if err != nil {
366		return
367	}
368	var azf azure.Future
369	azf, err = azure.NewFutureFromResponse(resp)
370	future.FutureAPI = &azf
371	future.Result = future.result
372	return
373}
374
375// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
376// closes the http.Response Body.
377func (client VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) {
378	err = autorest.Respond(
379		resp,
380		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
381		autorest.ByUnmarshallingJSON(&result),
382		autorest.ByClosing())
383	result.Response = autorest.Response{Response: resp}
384	return
385}
386
387// Delete delete the specified volume
388// Parameters:
389// resourceGroupName - the name of the resource group.
390// accountName - the name of the NetApp account
391// poolName - the name of the capacity pool
392// volumeName - the name of the volume
393func (client VolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteFuture, err error) {
394	if tracing.IsEnabled() {
395		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete")
396		defer func() {
397			sc := -1
398			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
399				sc = result.FutureAPI.Response().StatusCode
400			}
401			tracing.EndSpan(ctx, sc, err)
402		}()
403	}
404	if err := validation.Validate([]validation.Validation{
405		{TargetValue: resourceGroupName,
406			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
407				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
408				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
409		{TargetValue: poolName,
410			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
411				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
412				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
413		{TargetValue: volumeName,
414			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
415				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
416				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
417		return result, validation.NewError("netapp.VolumesClient", "Delete", err.Error())
418	}
419
420	req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
421	if err != nil {
422		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure preparing request")
423		return
424	}
425
426	result, err = client.DeleteSender(req)
427	if err != nil {
428		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure sending request")
429		return
430	}
431
432	return
433}
434
435// DeletePreparer prepares the Delete request.
436func (client VolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
437	pathParameters := map[string]interface{}{
438		"accountName":       autorest.Encode("path", accountName),
439		"poolName":          autorest.Encode("path", poolName),
440		"resourceGroupName": autorest.Encode("path", resourceGroupName),
441		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
442		"volumeName":        autorest.Encode("path", volumeName),
443	}
444
445	const APIVersion = "2021-06-01"
446	queryParameters := map[string]interface{}{
447		"api-version": APIVersion,
448	}
449
450	preparer := autorest.CreatePreparer(
451		autorest.AsDelete(),
452		autorest.WithBaseURL(client.BaseURI),
453		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
454		autorest.WithQueryParameters(queryParameters))
455	return preparer.Prepare((&http.Request{}).WithContext(ctx))
456}
457
458// DeleteSender sends the Delete request. The method will close the
459// http.Response Body if it receives an error.
460func (client VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, err error) {
461	var resp *http.Response
462	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
463	if err != nil {
464		return
465	}
466	var azf azure.Future
467	azf, err = azure.NewFutureFromResponse(resp)
468	future.FutureAPI = &azf
469	future.Result = future.result
470	return
471}
472
473// DeleteResponder handles the response to the Delete request. The method always
474// closes the http.Response Body.
475func (client VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
476	err = autorest.Respond(
477		resp,
478		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
479		autorest.ByClosing())
480	result.Response = resp
481	return
482}
483
484// DeleteReplication delete the replication connection on the destination volume, and send release to the source
485// replication
486// Parameters:
487// resourceGroupName - the name of the resource group.
488// accountName - the name of the NetApp account
489// poolName - the name of the capacity pool
490// volumeName - the name of the volume
491func (client VolumesClient) DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteReplicationFuture, err error) {
492	if tracing.IsEnabled() {
493		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.DeleteReplication")
494		defer func() {
495			sc := -1
496			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
497				sc = result.FutureAPI.Response().StatusCode
498			}
499			tracing.EndSpan(ctx, sc, err)
500		}()
501	}
502	if err := validation.Validate([]validation.Validation{
503		{TargetValue: resourceGroupName,
504			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
505				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
506				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
507		{TargetValue: poolName,
508			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
509				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
510				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
511		{TargetValue: volumeName,
512			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
513				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
514				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
515		return result, validation.NewError("netapp.VolumesClient", "DeleteReplication", err.Error())
516	}
517
518	req, err := client.DeleteReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
519	if err != nil {
520		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure preparing request")
521		return
522	}
523
524	result, err = client.DeleteReplicationSender(req)
525	if err != nil {
526		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure sending request")
527		return
528	}
529
530	return
531}
532
533// DeleteReplicationPreparer prepares the DeleteReplication request.
534func (client VolumesClient) DeleteReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
535	pathParameters := map[string]interface{}{
536		"accountName":       autorest.Encode("path", accountName),
537		"poolName":          autorest.Encode("path", poolName),
538		"resourceGroupName": autorest.Encode("path", resourceGroupName),
539		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
540		"volumeName":        autorest.Encode("path", volumeName),
541	}
542
543	const APIVersion = "2021-06-01"
544	queryParameters := map[string]interface{}{
545		"api-version": APIVersion,
546	}
547
548	preparer := autorest.CreatePreparer(
549		autorest.AsPost(),
550		autorest.WithBaseURL(client.BaseURI),
551		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", pathParameters),
552		autorest.WithQueryParameters(queryParameters))
553	return preparer.Prepare((&http.Request{}).WithContext(ctx))
554}
555
556// DeleteReplicationSender sends the DeleteReplication request. The method will close the
557// http.Response Body if it receives an error.
558func (client VolumesClient) DeleteReplicationSender(req *http.Request) (future VolumesDeleteReplicationFuture, err error) {
559	var resp *http.Response
560	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
561	if err != nil {
562		return
563	}
564	var azf azure.Future
565	azf, err = azure.NewFutureFromResponse(resp)
566	future.FutureAPI = &azf
567	future.Result = future.result
568	return
569}
570
571// DeleteReplicationResponder handles the response to the DeleteReplication request. The method always
572// closes the http.Response Body.
573func (client VolumesClient) DeleteReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
574	err = autorest.Respond(
575		resp,
576		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
577		autorest.ByClosing())
578	result.Response = resp
579	return
580}
581
582// Get get the details of the specified volume
583// Parameters:
584// resourceGroupName - the name of the resource group.
585// accountName - the name of the NetApp account
586// poolName - the name of the capacity pool
587// volumeName - the name of the volume
588func (client VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) {
589	if tracing.IsEnabled() {
590		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get")
591		defer func() {
592			sc := -1
593			if result.Response.Response != nil {
594				sc = result.Response.Response.StatusCode
595			}
596			tracing.EndSpan(ctx, sc, err)
597		}()
598	}
599	if err := validation.Validate([]validation.Validation{
600		{TargetValue: resourceGroupName,
601			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
602				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
603				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
604		{TargetValue: poolName,
605			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
606				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
607				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
608		{TargetValue: volumeName,
609			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
610				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
611				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
612		return result, validation.NewError("netapp.VolumesClient", "Get", err.Error())
613	}
614
615	req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
616	if err != nil {
617		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", nil, "Failure preparing request")
618		return
619	}
620
621	resp, err := client.GetSender(req)
622	if err != nil {
623		result.Response = autorest.Response{Response: resp}
624		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure sending request")
625		return
626	}
627
628	result, err = client.GetResponder(resp)
629	if err != nil {
630		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure responding to request")
631		return
632	}
633
634	return
635}
636
637// GetPreparer prepares the Get request.
638func (client VolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
639	pathParameters := map[string]interface{}{
640		"accountName":       autorest.Encode("path", accountName),
641		"poolName":          autorest.Encode("path", poolName),
642		"resourceGroupName": autorest.Encode("path", resourceGroupName),
643		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
644		"volumeName":        autorest.Encode("path", volumeName),
645	}
646
647	const APIVersion = "2021-06-01"
648	queryParameters := map[string]interface{}{
649		"api-version": APIVersion,
650	}
651
652	preparer := autorest.CreatePreparer(
653		autorest.AsGet(),
654		autorest.WithBaseURL(client.BaseURI),
655		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
656		autorest.WithQueryParameters(queryParameters))
657	return preparer.Prepare((&http.Request{}).WithContext(ctx))
658}
659
660// GetSender sends the Get request. The method will close the
661// http.Response Body if it receives an error.
662func (client VolumesClient) GetSender(req *http.Request) (*http.Response, error) {
663	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
664}
665
666// GetResponder handles the response to the Get request. The method always
667// closes the http.Response Body.
668func (client VolumesClient) GetResponder(resp *http.Response) (result Volume, err error) {
669	err = autorest.Respond(
670		resp,
671		azure.WithErrorUnlessStatusCode(http.StatusOK),
672		autorest.ByUnmarshallingJSON(&result),
673		autorest.ByClosing())
674	result.Response = autorest.Response{Response: resp}
675	return
676}
677
678// List list all volumes within the capacity pool
679// Parameters:
680// resourceGroupName - the name of the resource group.
681// accountName - the name of the NetApp account
682// poolName - the name of the capacity pool
683func (client VolumesClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListPage, err error) {
684	if tracing.IsEnabled() {
685		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List")
686		defer func() {
687			sc := -1
688			if result.vl.Response.Response != nil {
689				sc = result.vl.Response.Response.StatusCode
690			}
691			tracing.EndSpan(ctx, sc, err)
692		}()
693	}
694	if err := validation.Validate([]validation.Validation{
695		{TargetValue: resourceGroupName,
696			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
697				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
698				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
699		{TargetValue: poolName,
700			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
701				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
702				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
703		return result, validation.NewError("netapp.VolumesClient", "List", err.Error())
704	}
705
706	result.fn = client.listNextResults
707	req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName)
708	if err != nil {
709		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", nil, "Failure preparing request")
710		return
711	}
712
713	resp, err := client.ListSender(req)
714	if err != nil {
715		result.vl.Response = autorest.Response{Response: resp}
716		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure sending request")
717		return
718	}
719
720	result.vl, err = client.ListResponder(resp)
721	if err != nil {
722		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure responding to request")
723		return
724	}
725	if result.vl.hasNextLink() && result.vl.IsEmpty() {
726		err = result.NextWithContext(ctx)
727		return
728	}
729
730	return
731}
732
733// ListPreparer prepares the List request.
734func (client VolumesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
735	pathParameters := map[string]interface{}{
736		"accountName":       autorest.Encode("path", accountName),
737		"poolName":          autorest.Encode("path", poolName),
738		"resourceGroupName": autorest.Encode("path", resourceGroupName),
739		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
740	}
741
742	const APIVersion = "2021-06-01"
743	queryParameters := map[string]interface{}{
744		"api-version": APIVersion,
745	}
746
747	preparer := autorest.CreatePreparer(
748		autorest.AsGet(),
749		autorest.WithBaseURL(client.BaseURI),
750		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", pathParameters),
751		autorest.WithQueryParameters(queryParameters))
752	return preparer.Prepare((&http.Request{}).WithContext(ctx))
753}
754
755// ListSender sends the List request. The method will close the
756// http.Response Body if it receives an error.
757func (client VolumesClient) ListSender(req *http.Request) (*http.Response, error) {
758	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
759}
760
761// ListResponder handles the response to the List request. The method always
762// closes the http.Response Body.
763func (client VolumesClient) ListResponder(resp *http.Response) (result VolumeList, err error) {
764	err = autorest.Respond(
765		resp,
766		azure.WithErrorUnlessStatusCode(http.StatusOK),
767		autorest.ByUnmarshallingJSON(&result),
768		autorest.ByClosing())
769	result.Response = autorest.Response{Response: resp}
770	return
771}
772
773// listNextResults retrieves the next set of results, if any.
774func (client VolumesClient) listNextResults(ctx context.Context, lastResults VolumeList) (result VolumeList, err error) {
775	req, err := lastResults.volumeListPreparer(ctx)
776	if err != nil {
777		return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", nil, "Failure preparing next results request")
778	}
779	if req == nil {
780		return
781	}
782	resp, err := client.ListSender(req)
783	if err != nil {
784		result.Response = autorest.Response{Response: resp}
785		return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure sending next results request")
786	}
787	result, err = client.ListResponder(resp)
788	if err != nil {
789		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure responding to next results request")
790	}
791	return
792}
793
794// ListComplete enumerates all values, automatically crossing page boundaries as required.
795func (client VolumesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListIterator, err error) {
796	if tracing.IsEnabled() {
797		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List")
798		defer func() {
799			sc := -1
800			if result.Response().Response.Response != nil {
801				sc = result.page.Response().Response.Response.StatusCode
802			}
803			tracing.EndSpan(ctx, sc, err)
804		}()
805	}
806	result.page, err = client.List(ctx, resourceGroupName, accountName, poolName)
807	return
808}
809
810// PoolChange moves volume to another pool
811// Parameters:
812// resourceGroupName - the name of the resource group.
813// accountName - the name of the NetApp account
814// poolName - the name of the capacity pool
815// volumeName - the name of the volume
816// body - move volume to the pool supplied in the body of the operation.
817func (client VolumesClient) PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (result VolumesPoolChangeFuture, err error) {
818	if tracing.IsEnabled() {
819		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.PoolChange")
820		defer func() {
821			sc := -1
822			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
823				sc = result.FutureAPI.Response().StatusCode
824			}
825			tracing.EndSpan(ctx, sc, err)
826		}()
827	}
828	if err := validation.Validate([]validation.Validation{
829		{TargetValue: resourceGroupName,
830			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
831				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
832				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
833		{TargetValue: poolName,
834			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
835				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
836				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
837		{TargetValue: volumeName,
838			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
839				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
840				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
841		{TargetValue: body,
842			Constraints: []validation.Constraint{{Target: "body.NewPoolResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
843		return result, validation.NewError("netapp.VolumesClient", "PoolChange", err.Error())
844	}
845
846	req, err := client.PoolChangePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
847	if err != nil {
848		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure preparing request")
849		return
850	}
851
852	result, err = client.PoolChangeSender(req)
853	if err != nil {
854		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure sending request")
855		return
856	}
857
858	return
859}
860
861// PoolChangePreparer prepares the PoolChange request.
862func (client VolumesClient) PoolChangePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (*http.Request, error) {
863	pathParameters := map[string]interface{}{
864		"accountName":       autorest.Encode("path", accountName),
865		"poolName":          autorest.Encode("path", poolName),
866		"resourceGroupName": autorest.Encode("path", resourceGroupName),
867		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
868		"volumeName":        autorest.Encode("path", volumeName),
869	}
870
871	const APIVersion = "2021-06-01"
872	queryParameters := map[string]interface{}{
873		"api-version": APIVersion,
874	}
875
876	preparer := autorest.CreatePreparer(
877		autorest.AsContentType("application/json; charset=utf-8"),
878		autorest.AsPost(),
879		autorest.WithBaseURL(client.BaseURI),
880		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange", pathParameters),
881		autorest.WithJSON(body),
882		autorest.WithQueryParameters(queryParameters))
883	return preparer.Prepare((&http.Request{}).WithContext(ctx))
884}
885
886// PoolChangeSender sends the PoolChange request. The method will close the
887// http.Response Body if it receives an error.
888func (client VolumesClient) PoolChangeSender(req *http.Request) (future VolumesPoolChangeFuture, err error) {
889	var resp *http.Response
890	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
891	if err != nil {
892		return
893	}
894	var azf azure.Future
895	azf, err = azure.NewFutureFromResponse(resp)
896	future.FutureAPI = &azf
897	future.Result = future.result
898	return
899}
900
901// PoolChangeResponder handles the response to the PoolChange request. The method always
902// closes the http.Response Body.
903func (client VolumesClient) PoolChangeResponder(resp *http.Response) (result autorest.Response, err error) {
904	err = autorest.Respond(
905		resp,
906		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
907		autorest.ByClosing())
908	result.Response = resp
909	return
910}
911
912// ReInitializeReplication re-Initializes the replication connection on the destination volume
913// Parameters:
914// resourceGroupName - the name of the resource group.
915// accountName - the name of the NetApp account
916// poolName - the name of the capacity pool
917// volumeName - the name of the volume
918func (client VolumesClient) ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesReInitializeReplicationFuture, err error) {
919	if tracing.IsEnabled() {
920		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReInitializeReplication")
921		defer func() {
922			sc := -1
923			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
924				sc = result.FutureAPI.Response().StatusCode
925			}
926			tracing.EndSpan(ctx, sc, err)
927		}()
928	}
929	if err := validation.Validate([]validation.Validation{
930		{TargetValue: resourceGroupName,
931			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
932				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
933				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
934		{TargetValue: poolName,
935			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
936				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
937				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
938		{TargetValue: volumeName,
939			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
940				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
941				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
942		return result, validation.NewError("netapp.VolumesClient", "ReInitializeReplication", err.Error())
943	}
944
945	req, err := client.ReInitializeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
946	if err != nil {
947		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure preparing request")
948		return
949	}
950
951	result, err = client.ReInitializeReplicationSender(req)
952	if err != nil {
953		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure sending request")
954		return
955	}
956
957	return
958}
959
960// ReInitializeReplicationPreparer prepares the ReInitializeReplication request.
961func (client VolumesClient) ReInitializeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
962	pathParameters := map[string]interface{}{
963		"accountName":       autorest.Encode("path", accountName),
964		"poolName":          autorest.Encode("path", poolName),
965		"resourceGroupName": autorest.Encode("path", resourceGroupName),
966		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
967		"volumeName":        autorest.Encode("path", volumeName),
968	}
969
970	const APIVersion = "2021-06-01"
971	queryParameters := map[string]interface{}{
972		"api-version": APIVersion,
973	}
974
975	preparer := autorest.CreatePreparer(
976		autorest.AsPost(),
977		autorest.WithBaseURL(client.BaseURI),
978		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication", pathParameters),
979		autorest.WithQueryParameters(queryParameters))
980	return preparer.Prepare((&http.Request{}).WithContext(ctx))
981}
982
983// ReInitializeReplicationSender sends the ReInitializeReplication request. The method will close the
984// http.Response Body if it receives an error.
985func (client VolumesClient) ReInitializeReplicationSender(req *http.Request) (future VolumesReInitializeReplicationFuture, err error) {
986	var resp *http.Response
987	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
988	if err != nil {
989		return
990	}
991	var azf azure.Future
992	azf, err = azure.NewFutureFromResponse(resp)
993	future.FutureAPI = &azf
994	future.Result = future.result
995	return
996}
997
998// ReInitializeReplicationResponder handles the response to the ReInitializeReplication request. The method always
999// closes the http.Response Body.
1000func (client VolumesClient) ReInitializeReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
1001	err = autorest.Respond(
1002		resp,
1003		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1004		autorest.ByClosing())
1005	result.Response = resp
1006	return
1007}
1008
1009// ReplicationStatusMethod get the status of the replication
1010// Parameters:
1011// resourceGroupName - the name of the resource group.
1012// accountName - the name of the NetApp account
1013// poolName - the name of the capacity pool
1014// volumeName - the name of the volume
1015func (client VolumesClient) ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result ReplicationStatus, err error) {
1016	if tracing.IsEnabled() {
1017		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReplicationStatusMethod")
1018		defer func() {
1019			sc := -1
1020			if result.Response.Response != nil {
1021				sc = result.Response.Response.StatusCode
1022			}
1023			tracing.EndSpan(ctx, sc, err)
1024		}()
1025	}
1026	if err := validation.Validate([]validation.Validation{
1027		{TargetValue: resourceGroupName,
1028			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
1029				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
1030				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
1031		{TargetValue: poolName,
1032			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1033				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
1034				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
1035		{TargetValue: volumeName,
1036			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1037				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
1038				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
1039		return result, validation.NewError("netapp.VolumesClient", "ReplicationStatusMethod", err.Error())
1040	}
1041
1042	req, err := client.ReplicationStatusMethodPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
1043	if err != nil {
1044		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", nil, "Failure preparing request")
1045		return
1046	}
1047
1048	resp, err := client.ReplicationStatusMethodSender(req)
1049	if err != nil {
1050		result.Response = autorest.Response{Response: resp}
1051		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure sending request")
1052		return
1053	}
1054
1055	result, err = client.ReplicationStatusMethodResponder(resp)
1056	if err != nil {
1057		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure responding to request")
1058		return
1059	}
1060
1061	return
1062}
1063
1064// ReplicationStatusMethodPreparer prepares the ReplicationStatusMethod request.
1065func (client VolumesClient) ReplicationStatusMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
1066	pathParameters := map[string]interface{}{
1067		"accountName":       autorest.Encode("path", accountName),
1068		"poolName":          autorest.Encode("path", poolName),
1069		"resourceGroupName": autorest.Encode("path", resourceGroupName),
1070		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
1071		"volumeName":        autorest.Encode("path", volumeName),
1072	}
1073
1074	const APIVersion = "2021-06-01"
1075	queryParameters := map[string]interface{}{
1076		"api-version": APIVersion,
1077	}
1078
1079	preparer := autorest.CreatePreparer(
1080		autorest.AsGet(),
1081		autorest.WithBaseURL(client.BaseURI),
1082		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", pathParameters),
1083		autorest.WithQueryParameters(queryParameters))
1084	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1085}
1086
1087// ReplicationStatusMethodSender sends the ReplicationStatusMethod request. The method will close the
1088// http.Response Body if it receives an error.
1089func (client VolumesClient) ReplicationStatusMethodSender(req *http.Request) (*http.Response, error) {
1090	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
1091}
1092
1093// ReplicationStatusMethodResponder handles the response to the ReplicationStatusMethod request. The method always
1094// closes the http.Response Body.
1095func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response) (result ReplicationStatus, err error) {
1096	err = autorest.Respond(
1097		resp,
1098		azure.WithErrorUnlessStatusCode(http.StatusOK),
1099		autorest.ByUnmarshallingJSON(&result),
1100		autorest.ByClosing())
1101	result.Response = autorest.Response{Response: resp}
1102	return
1103}
1104
1105// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
1106// will reverse-resync the connection and sync from destination to source.
1107// Parameters:
1108// resourceGroupName - the name of the resource group.
1109// accountName - the name of the NetApp account
1110// poolName - the name of the capacity pool
1111// volumeName - the name of the volume
1112func (client VolumesClient) ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesResyncReplicationFuture, err error) {
1113	if tracing.IsEnabled() {
1114		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ResyncReplication")
1115		defer func() {
1116			sc := -1
1117			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
1118				sc = result.FutureAPI.Response().StatusCode
1119			}
1120			tracing.EndSpan(ctx, sc, err)
1121		}()
1122	}
1123	if err := validation.Validate([]validation.Validation{
1124		{TargetValue: resourceGroupName,
1125			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
1126				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
1127				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
1128		{TargetValue: poolName,
1129			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1130				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
1131				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
1132		{TargetValue: volumeName,
1133			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1134				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
1135				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
1136		return result, validation.NewError("netapp.VolumesClient", "ResyncReplication", err.Error())
1137	}
1138
1139	req, err := client.ResyncReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
1140	if err != nil {
1141		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure preparing request")
1142		return
1143	}
1144
1145	result, err = client.ResyncReplicationSender(req)
1146	if err != nil {
1147		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure sending request")
1148		return
1149	}
1150
1151	return
1152}
1153
1154// ResyncReplicationPreparer prepares the ResyncReplication request.
1155func (client VolumesClient) ResyncReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
1156	pathParameters := map[string]interface{}{
1157		"accountName":       autorest.Encode("path", accountName),
1158		"poolName":          autorest.Encode("path", poolName),
1159		"resourceGroupName": autorest.Encode("path", resourceGroupName),
1160		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
1161		"volumeName":        autorest.Encode("path", volumeName),
1162	}
1163
1164	const APIVersion = "2021-06-01"
1165	queryParameters := map[string]interface{}{
1166		"api-version": APIVersion,
1167	}
1168
1169	preparer := autorest.CreatePreparer(
1170		autorest.AsPost(),
1171		autorest.WithBaseURL(client.BaseURI),
1172		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", pathParameters),
1173		autorest.WithQueryParameters(queryParameters))
1174	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1175}
1176
1177// ResyncReplicationSender sends the ResyncReplication request. The method will close the
1178// http.Response Body if it receives an error.
1179func (client VolumesClient) ResyncReplicationSender(req *http.Request) (future VolumesResyncReplicationFuture, err error) {
1180	var resp *http.Response
1181	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
1182	if err != nil {
1183		return
1184	}
1185	var azf azure.Future
1186	azf, err = azure.NewFutureFromResponse(resp)
1187	future.FutureAPI = &azf
1188	future.Result = future.result
1189	return
1190}
1191
1192// ResyncReplicationResponder handles the response to the ResyncReplication request. The method always
1193// closes the http.Response Body.
1194func (client VolumesClient) ResyncReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
1195	err = autorest.Respond(
1196		resp,
1197		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1198		autorest.ByClosing())
1199	result.Response = resp
1200	return
1201}
1202
1203// Revert revert a volume to the snapshot specified in the body
1204// Parameters:
1205// resourceGroupName - the name of the resource group.
1206// accountName - the name of the NetApp account
1207// poolName - the name of the capacity pool
1208// volumeName - the name of the volume
1209// body - object for snapshot to revert supplied in the body of the operation.
1210func (client VolumesClient) Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (result VolumesRevertFuture, err error) {
1211	if tracing.IsEnabled() {
1212		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Revert")
1213		defer func() {
1214			sc := -1
1215			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
1216				sc = result.FutureAPI.Response().StatusCode
1217			}
1218			tracing.EndSpan(ctx, sc, err)
1219		}()
1220	}
1221	if err := validation.Validate([]validation.Validation{
1222		{TargetValue: resourceGroupName,
1223			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
1224				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
1225				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
1226		{TargetValue: poolName,
1227			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1228				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
1229				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
1230		{TargetValue: volumeName,
1231			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1232				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
1233				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
1234		return result, validation.NewError("netapp.VolumesClient", "Revert", err.Error())
1235	}
1236
1237	req, err := client.RevertPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
1238	if err != nil {
1239		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure preparing request")
1240		return
1241	}
1242
1243	result, err = client.RevertSender(req)
1244	if err != nil {
1245		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure sending request")
1246		return
1247	}
1248
1249	return
1250}
1251
1252// RevertPreparer prepares the Revert request.
1253func (client VolumesClient) RevertPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (*http.Request, error) {
1254	pathParameters := map[string]interface{}{
1255		"accountName":       autorest.Encode("path", accountName),
1256		"poolName":          autorest.Encode("path", poolName),
1257		"resourceGroupName": autorest.Encode("path", resourceGroupName),
1258		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
1259		"volumeName":        autorest.Encode("path", volumeName),
1260	}
1261
1262	const APIVersion = "2021-06-01"
1263	queryParameters := map[string]interface{}{
1264		"api-version": APIVersion,
1265	}
1266
1267	preparer := autorest.CreatePreparer(
1268		autorest.AsContentType("application/json; charset=utf-8"),
1269		autorest.AsPost(),
1270		autorest.WithBaseURL(client.BaseURI),
1271		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert", pathParameters),
1272		autorest.WithJSON(body),
1273		autorest.WithQueryParameters(queryParameters))
1274	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1275}
1276
1277// RevertSender sends the Revert request. The method will close the
1278// http.Response Body if it receives an error.
1279func (client VolumesClient) RevertSender(req *http.Request) (future VolumesRevertFuture, err error) {
1280	var resp *http.Response
1281	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
1282	if err != nil {
1283		return
1284	}
1285	var azf azure.Future
1286	azf, err = azure.NewFutureFromResponse(resp)
1287	future.FutureAPI = &azf
1288	future.Result = future.result
1289	return
1290}
1291
1292// RevertResponder handles the response to the Revert request. The method always
1293// closes the http.Response Body.
1294func (client VolumesClient) RevertResponder(resp *http.Response) (result autorest.Response, err error) {
1295	err = autorest.Respond(
1296		resp,
1297		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1298		autorest.ByClosing())
1299	result.Response = resp
1300	return
1301}
1302
1303// Update patch the specified volume
1304// Parameters:
1305// body - volume object supplied in the body of the operation.
1306// resourceGroupName - the name of the resource group.
1307// accountName - the name of the NetApp account
1308// poolName - the name of the capacity pool
1309// volumeName - the name of the volume
1310func (client VolumesClient) Update(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesUpdateFuture, err error) {
1311	if tracing.IsEnabled() {
1312		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Update")
1313		defer func() {
1314			sc := -1
1315			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
1316				sc = result.FutureAPI.Response().StatusCode
1317			}
1318			tracing.EndSpan(ctx, sc, err)
1319		}()
1320	}
1321	if err := validation.Validate([]validation.Validation{
1322		{TargetValue: resourceGroupName,
1323			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
1324				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
1325				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
1326		{TargetValue: poolName,
1327			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1328				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
1329				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
1330		{TargetValue: volumeName,
1331			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1332				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
1333				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
1334		return result, validation.NewError("netapp.VolumesClient", "Update", err.Error())
1335	}
1336
1337	req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName)
1338	if err != nil {
1339		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure preparing request")
1340		return
1341	}
1342
1343	result, err = client.UpdateSender(req)
1344	if err != nil {
1345		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure sending request")
1346		return
1347	}
1348
1349	return
1350}
1351
1352// UpdatePreparer prepares the Update request.
1353func (client VolumesClient) UpdatePreparer(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
1354	pathParameters := map[string]interface{}{
1355		"accountName":       autorest.Encode("path", accountName),
1356		"poolName":          autorest.Encode("path", poolName),
1357		"resourceGroupName": autorest.Encode("path", resourceGroupName),
1358		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
1359		"volumeName":        autorest.Encode("path", volumeName),
1360	}
1361
1362	const APIVersion = "2021-06-01"
1363	queryParameters := map[string]interface{}{
1364		"api-version": APIVersion,
1365	}
1366
1367	body.ID = nil
1368	body.Name = nil
1369	body.Type = nil
1370	preparer := autorest.CreatePreparer(
1371		autorest.AsContentType("application/json; charset=utf-8"),
1372		autorest.AsPatch(),
1373		autorest.WithBaseURL(client.BaseURI),
1374		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
1375		autorest.WithJSON(body),
1376		autorest.WithQueryParameters(queryParameters))
1377	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1378}
1379
1380// UpdateSender sends the Update request. The method will close the
1381// http.Response Body if it receives an error.
1382func (client VolumesClient) UpdateSender(req *http.Request) (future VolumesUpdateFuture, err error) {
1383	var resp *http.Response
1384	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
1385	if err != nil {
1386		return
1387	}
1388	var azf azure.Future
1389	azf, err = azure.NewFutureFromResponse(resp)
1390	future.FutureAPI = &azf
1391	future.Result = future.result
1392	return
1393}
1394
1395// UpdateResponder handles the response to the Update request. The method always
1396// closes the http.Response Body.
1397func (client VolumesClient) UpdateResponder(resp *http.Response) (result Volume, err error) {
1398	err = autorest.Respond(
1399		resp,
1400		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1401		autorest.ByUnmarshallingJSON(&result),
1402		autorest.ByClosing())
1403	result.Response = autorest.Response{Response: resp}
1404	return
1405}
1406