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 = "2020-12-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 = "2020-12-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					}}}},
293		{TargetValue: resourceGroupName,
294			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
295				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
296				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
297		{TargetValue: poolName,
298			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
299				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
300				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
301		{TargetValue: volumeName,
302			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
303				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
304				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
305		return result, validation.NewError("netapp.VolumesClient", "CreateOrUpdate", err.Error())
306	}
307
308	req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName)
309	if err != nil {
310		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request")
311		return
312	}
313
314	result, err = client.CreateOrUpdateSender(req)
315	if err != nil {
316		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure sending request")
317		return
318	}
319
320	return
321}
322
323// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
324func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
325	pathParameters := map[string]interface{}{
326		"accountName":       autorest.Encode("path", accountName),
327		"poolName":          autorest.Encode("path", poolName),
328		"resourceGroupName": autorest.Encode("path", resourceGroupName),
329		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
330		"volumeName":        autorest.Encode("path", volumeName),
331	}
332
333	const APIVersion = "2020-12-01"
334	queryParameters := map[string]interface{}{
335		"api-version": APIVersion,
336	}
337
338	body.ID = nil
339	body.Name = nil
340	body.Type = nil
341	preparer := autorest.CreatePreparer(
342		autorest.AsContentType("application/json; charset=utf-8"),
343		autorest.AsPut(),
344		autorest.WithBaseURL(client.BaseURI),
345		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
346		autorest.WithJSON(body),
347		autorest.WithQueryParameters(queryParameters))
348	return preparer.Prepare((&http.Request{}).WithContext(ctx))
349}
350
351// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
352// http.Response Body if it receives an error.
353func (client VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, err error) {
354	var resp *http.Response
355	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
356	if err != nil {
357		return
358	}
359	var azf azure.Future
360	azf, err = azure.NewFutureFromResponse(resp)
361	future.FutureAPI = &azf
362	future.Result = future.result
363	return
364}
365
366// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
367// closes the http.Response Body.
368func (client VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) {
369	err = autorest.Respond(
370		resp,
371		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
372		autorest.ByUnmarshallingJSON(&result),
373		autorest.ByClosing())
374	result.Response = autorest.Response{Response: resp}
375	return
376}
377
378// Delete delete the specified volume
379// Parameters:
380// resourceGroupName - the name of the resource group.
381// accountName - the name of the NetApp account
382// poolName - the name of the capacity pool
383// volumeName - the name of the volume
384func (client VolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteFuture, err error) {
385	if tracing.IsEnabled() {
386		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete")
387		defer func() {
388			sc := -1
389			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
390				sc = result.FutureAPI.Response().StatusCode
391			}
392			tracing.EndSpan(ctx, sc, err)
393		}()
394	}
395	if err := validation.Validate([]validation.Validation{
396		{TargetValue: resourceGroupName,
397			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
398				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
399				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
400		{TargetValue: poolName,
401			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
402				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
403				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
404		{TargetValue: volumeName,
405			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
406				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
407				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
408		return result, validation.NewError("netapp.VolumesClient", "Delete", err.Error())
409	}
410
411	req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
412	if err != nil {
413		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure preparing request")
414		return
415	}
416
417	result, err = client.DeleteSender(req)
418	if err != nil {
419		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure sending request")
420		return
421	}
422
423	return
424}
425
426// DeletePreparer prepares the Delete request.
427func (client VolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
428	pathParameters := map[string]interface{}{
429		"accountName":       autorest.Encode("path", accountName),
430		"poolName":          autorest.Encode("path", poolName),
431		"resourceGroupName": autorest.Encode("path", resourceGroupName),
432		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
433		"volumeName":        autorest.Encode("path", volumeName),
434	}
435
436	const APIVersion = "2020-12-01"
437	queryParameters := map[string]interface{}{
438		"api-version": APIVersion,
439	}
440
441	preparer := autorest.CreatePreparer(
442		autorest.AsDelete(),
443		autorest.WithBaseURL(client.BaseURI),
444		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
445		autorest.WithQueryParameters(queryParameters))
446	return preparer.Prepare((&http.Request{}).WithContext(ctx))
447}
448
449// DeleteSender sends the Delete request. The method will close the
450// http.Response Body if it receives an error.
451func (client VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, err error) {
452	var resp *http.Response
453	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
454	if err != nil {
455		return
456	}
457	var azf azure.Future
458	azf, err = azure.NewFutureFromResponse(resp)
459	future.FutureAPI = &azf
460	future.Result = future.result
461	return
462}
463
464// DeleteResponder handles the response to the Delete request. The method always
465// closes the http.Response Body.
466func (client VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
467	err = autorest.Respond(
468		resp,
469		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
470		autorest.ByClosing())
471	result.Response = resp
472	return
473}
474
475// DeleteReplication delete the replication connection on the destination volume, and send release to the source
476// replication
477// Parameters:
478// resourceGroupName - the name of the resource group.
479// accountName - the name of the NetApp account
480// poolName - the name of the capacity pool
481// volumeName - the name of the volume
482func (client VolumesClient) DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteReplicationFuture, err error) {
483	if tracing.IsEnabled() {
484		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.DeleteReplication")
485		defer func() {
486			sc := -1
487			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
488				sc = result.FutureAPI.Response().StatusCode
489			}
490			tracing.EndSpan(ctx, sc, err)
491		}()
492	}
493	if err := validation.Validate([]validation.Validation{
494		{TargetValue: resourceGroupName,
495			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
496				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
497				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
498		{TargetValue: poolName,
499			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
500				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
501				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
502		{TargetValue: volumeName,
503			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
504				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
505				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
506		return result, validation.NewError("netapp.VolumesClient", "DeleteReplication", err.Error())
507	}
508
509	req, err := client.DeleteReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
510	if err != nil {
511		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure preparing request")
512		return
513	}
514
515	result, err = client.DeleteReplicationSender(req)
516	if err != nil {
517		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure sending request")
518		return
519	}
520
521	return
522}
523
524// DeleteReplicationPreparer prepares the DeleteReplication request.
525func (client VolumesClient) DeleteReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
526	pathParameters := map[string]interface{}{
527		"accountName":       autorest.Encode("path", accountName),
528		"poolName":          autorest.Encode("path", poolName),
529		"resourceGroupName": autorest.Encode("path", resourceGroupName),
530		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
531		"volumeName":        autorest.Encode("path", volumeName),
532	}
533
534	const APIVersion = "2020-12-01"
535	queryParameters := map[string]interface{}{
536		"api-version": APIVersion,
537	}
538
539	preparer := autorest.CreatePreparer(
540		autorest.AsPost(),
541		autorest.WithBaseURL(client.BaseURI),
542		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", pathParameters),
543		autorest.WithQueryParameters(queryParameters))
544	return preparer.Prepare((&http.Request{}).WithContext(ctx))
545}
546
547// DeleteReplicationSender sends the DeleteReplication request. The method will close the
548// http.Response Body if it receives an error.
549func (client VolumesClient) DeleteReplicationSender(req *http.Request) (future VolumesDeleteReplicationFuture, err error) {
550	var resp *http.Response
551	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
552	if err != nil {
553		return
554	}
555	var azf azure.Future
556	azf, err = azure.NewFutureFromResponse(resp)
557	future.FutureAPI = &azf
558	future.Result = future.result
559	return
560}
561
562// DeleteReplicationResponder handles the response to the DeleteReplication request. The method always
563// closes the http.Response Body.
564func (client VolumesClient) DeleteReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
565	err = autorest.Respond(
566		resp,
567		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
568		autorest.ByClosing())
569	result.Response = resp
570	return
571}
572
573// Get get the details of the specified volume
574// Parameters:
575// resourceGroupName - the name of the resource group.
576// accountName - the name of the NetApp account
577// poolName - the name of the capacity pool
578// volumeName - the name of the volume
579func (client VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) {
580	if tracing.IsEnabled() {
581		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get")
582		defer func() {
583			sc := -1
584			if result.Response.Response != nil {
585				sc = result.Response.Response.StatusCode
586			}
587			tracing.EndSpan(ctx, sc, err)
588		}()
589	}
590	if err := validation.Validate([]validation.Validation{
591		{TargetValue: resourceGroupName,
592			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
593				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
594				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
595		{TargetValue: poolName,
596			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
597				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
598				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
599		{TargetValue: volumeName,
600			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
601				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
602				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
603		return result, validation.NewError("netapp.VolumesClient", "Get", err.Error())
604	}
605
606	req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
607	if err != nil {
608		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", nil, "Failure preparing request")
609		return
610	}
611
612	resp, err := client.GetSender(req)
613	if err != nil {
614		result.Response = autorest.Response{Response: resp}
615		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure sending request")
616		return
617	}
618
619	result, err = client.GetResponder(resp)
620	if err != nil {
621		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure responding to request")
622		return
623	}
624
625	return
626}
627
628// GetPreparer prepares the Get request.
629func (client VolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
630	pathParameters := map[string]interface{}{
631		"accountName":       autorest.Encode("path", accountName),
632		"poolName":          autorest.Encode("path", poolName),
633		"resourceGroupName": autorest.Encode("path", resourceGroupName),
634		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
635		"volumeName":        autorest.Encode("path", volumeName),
636	}
637
638	const APIVersion = "2020-12-01"
639	queryParameters := map[string]interface{}{
640		"api-version": APIVersion,
641	}
642
643	preparer := autorest.CreatePreparer(
644		autorest.AsGet(),
645		autorest.WithBaseURL(client.BaseURI),
646		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
647		autorest.WithQueryParameters(queryParameters))
648	return preparer.Prepare((&http.Request{}).WithContext(ctx))
649}
650
651// GetSender sends the Get request. The method will close the
652// http.Response Body if it receives an error.
653func (client VolumesClient) GetSender(req *http.Request) (*http.Response, error) {
654	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
655}
656
657// GetResponder handles the response to the Get request. The method always
658// closes the http.Response Body.
659func (client VolumesClient) GetResponder(resp *http.Response) (result Volume, err error) {
660	err = autorest.Respond(
661		resp,
662		azure.WithErrorUnlessStatusCode(http.StatusOK),
663		autorest.ByUnmarshallingJSON(&result),
664		autorest.ByClosing())
665	result.Response = autorest.Response{Response: resp}
666	return
667}
668
669// List list all volumes within the capacity pool
670// Parameters:
671// resourceGroupName - the name of the resource group.
672// accountName - the name of the NetApp account
673// poolName - the name of the capacity pool
674func (client VolumesClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListPage, err error) {
675	if tracing.IsEnabled() {
676		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List")
677		defer func() {
678			sc := -1
679			if result.vl.Response.Response != nil {
680				sc = result.vl.Response.Response.StatusCode
681			}
682			tracing.EndSpan(ctx, sc, err)
683		}()
684	}
685	if err := validation.Validate([]validation.Validation{
686		{TargetValue: resourceGroupName,
687			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
688				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
689				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
690		{TargetValue: poolName,
691			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
692				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
693				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
694		return result, validation.NewError("netapp.VolumesClient", "List", err.Error())
695	}
696
697	result.fn = client.listNextResults
698	req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName)
699	if err != nil {
700		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", nil, "Failure preparing request")
701		return
702	}
703
704	resp, err := client.ListSender(req)
705	if err != nil {
706		result.vl.Response = autorest.Response{Response: resp}
707		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure sending request")
708		return
709	}
710
711	result.vl, err = client.ListResponder(resp)
712	if err != nil {
713		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure responding to request")
714		return
715	}
716	if result.vl.hasNextLink() && result.vl.IsEmpty() {
717		err = result.NextWithContext(ctx)
718		return
719	}
720
721	return
722}
723
724// ListPreparer prepares the List request.
725func (client VolumesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
726	pathParameters := map[string]interface{}{
727		"accountName":       autorest.Encode("path", accountName),
728		"poolName":          autorest.Encode("path", poolName),
729		"resourceGroupName": autorest.Encode("path", resourceGroupName),
730		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
731	}
732
733	const APIVersion = "2020-12-01"
734	queryParameters := map[string]interface{}{
735		"api-version": APIVersion,
736	}
737
738	preparer := autorest.CreatePreparer(
739		autorest.AsGet(),
740		autorest.WithBaseURL(client.BaseURI),
741		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", pathParameters),
742		autorest.WithQueryParameters(queryParameters))
743	return preparer.Prepare((&http.Request{}).WithContext(ctx))
744}
745
746// ListSender sends the List request. The method will close the
747// http.Response Body if it receives an error.
748func (client VolumesClient) ListSender(req *http.Request) (*http.Response, error) {
749	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
750}
751
752// ListResponder handles the response to the List request. The method always
753// closes the http.Response Body.
754func (client VolumesClient) ListResponder(resp *http.Response) (result VolumeList, err error) {
755	err = autorest.Respond(
756		resp,
757		azure.WithErrorUnlessStatusCode(http.StatusOK),
758		autorest.ByUnmarshallingJSON(&result),
759		autorest.ByClosing())
760	result.Response = autorest.Response{Response: resp}
761	return
762}
763
764// listNextResults retrieves the next set of results, if any.
765func (client VolumesClient) listNextResults(ctx context.Context, lastResults VolumeList) (result VolumeList, err error) {
766	req, err := lastResults.volumeListPreparer(ctx)
767	if err != nil {
768		return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", nil, "Failure preparing next results request")
769	}
770	if req == nil {
771		return
772	}
773	resp, err := client.ListSender(req)
774	if err != nil {
775		result.Response = autorest.Response{Response: resp}
776		return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure sending next results request")
777	}
778	result, err = client.ListResponder(resp)
779	if err != nil {
780		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure responding to next results request")
781	}
782	return
783}
784
785// ListComplete enumerates all values, automatically crossing page boundaries as required.
786func (client VolumesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListIterator, err error) {
787	if tracing.IsEnabled() {
788		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List")
789		defer func() {
790			sc := -1
791			if result.Response().Response.Response != nil {
792				sc = result.page.Response().Response.Response.StatusCode
793			}
794			tracing.EndSpan(ctx, sc, err)
795		}()
796	}
797	result.page, err = client.List(ctx, resourceGroupName, accountName, poolName)
798	return
799}
800
801// PoolChange moves volume to another pool
802// Parameters:
803// resourceGroupName - the name of the resource group.
804// accountName - the name of the NetApp account
805// poolName - the name of the capacity pool
806// volumeName - the name of the volume
807// body - move volume to the pool supplied in the body of the operation.
808func (client VolumesClient) PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (result VolumesPoolChangeFuture, err error) {
809	if tracing.IsEnabled() {
810		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.PoolChange")
811		defer func() {
812			sc := -1
813			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
814				sc = result.FutureAPI.Response().StatusCode
815			}
816			tracing.EndSpan(ctx, sc, err)
817		}()
818	}
819	if err := validation.Validate([]validation.Validation{
820		{TargetValue: resourceGroupName,
821			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
822				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
823				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
824		{TargetValue: poolName,
825			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
826				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
827				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
828		{TargetValue: volumeName,
829			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
830				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
831				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
832		{TargetValue: body,
833			Constraints: []validation.Constraint{{Target: "body.NewPoolResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
834		return result, validation.NewError("netapp.VolumesClient", "PoolChange", err.Error())
835	}
836
837	req, err := client.PoolChangePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
838	if err != nil {
839		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure preparing request")
840		return
841	}
842
843	result, err = client.PoolChangeSender(req)
844	if err != nil {
845		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure sending request")
846		return
847	}
848
849	return
850}
851
852// PoolChangePreparer prepares the PoolChange request.
853func (client VolumesClient) PoolChangePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (*http.Request, error) {
854	pathParameters := map[string]interface{}{
855		"accountName":       autorest.Encode("path", accountName),
856		"poolName":          autorest.Encode("path", poolName),
857		"resourceGroupName": autorest.Encode("path", resourceGroupName),
858		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
859		"volumeName":        autorest.Encode("path", volumeName),
860	}
861
862	const APIVersion = "2020-12-01"
863	queryParameters := map[string]interface{}{
864		"api-version": APIVersion,
865	}
866
867	preparer := autorest.CreatePreparer(
868		autorest.AsContentType("application/json; charset=utf-8"),
869		autorest.AsPost(),
870		autorest.WithBaseURL(client.BaseURI),
871		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange", pathParameters),
872		autorest.WithJSON(body),
873		autorest.WithQueryParameters(queryParameters))
874	return preparer.Prepare((&http.Request{}).WithContext(ctx))
875}
876
877// PoolChangeSender sends the PoolChange request. The method will close the
878// http.Response Body if it receives an error.
879func (client VolumesClient) PoolChangeSender(req *http.Request) (future VolumesPoolChangeFuture, err error) {
880	var resp *http.Response
881	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
882	if err != nil {
883		return
884	}
885	var azf azure.Future
886	azf, err = azure.NewFutureFromResponse(resp)
887	future.FutureAPI = &azf
888	future.Result = future.result
889	return
890}
891
892// PoolChangeResponder handles the response to the PoolChange request. The method always
893// closes the http.Response Body.
894func (client VolumesClient) PoolChangeResponder(resp *http.Response) (result autorest.Response, err error) {
895	err = autorest.Respond(
896		resp,
897		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
898		autorest.ByClosing())
899	result.Response = resp
900	return
901}
902
903// ReInitializeReplication re-Initializes the replication connection on the destination volume
904// Parameters:
905// resourceGroupName - the name of the resource group.
906// accountName - the name of the NetApp account
907// poolName - the name of the capacity pool
908// volumeName - the name of the volume
909func (client VolumesClient) ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesReInitializeReplicationFuture, err error) {
910	if tracing.IsEnabled() {
911		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReInitializeReplication")
912		defer func() {
913			sc := -1
914			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
915				sc = result.FutureAPI.Response().StatusCode
916			}
917			tracing.EndSpan(ctx, sc, err)
918		}()
919	}
920	if err := validation.Validate([]validation.Validation{
921		{TargetValue: resourceGroupName,
922			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
923				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
924				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
925		{TargetValue: poolName,
926			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
927				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
928				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
929		{TargetValue: volumeName,
930			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
931				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
932				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
933		return result, validation.NewError("netapp.VolumesClient", "ReInitializeReplication", err.Error())
934	}
935
936	req, err := client.ReInitializeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
937	if err != nil {
938		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure preparing request")
939		return
940	}
941
942	result, err = client.ReInitializeReplicationSender(req)
943	if err != nil {
944		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure sending request")
945		return
946	}
947
948	return
949}
950
951// ReInitializeReplicationPreparer prepares the ReInitializeReplication request.
952func (client VolumesClient) ReInitializeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
953	pathParameters := map[string]interface{}{
954		"accountName":       autorest.Encode("path", accountName),
955		"poolName":          autorest.Encode("path", poolName),
956		"resourceGroupName": autorest.Encode("path", resourceGroupName),
957		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
958		"volumeName":        autorest.Encode("path", volumeName),
959	}
960
961	const APIVersion = "2020-12-01"
962	queryParameters := map[string]interface{}{
963		"api-version": APIVersion,
964	}
965
966	preparer := autorest.CreatePreparer(
967		autorest.AsPost(),
968		autorest.WithBaseURL(client.BaseURI),
969		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication", pathParameters),
970		autorest.WithQueryParameters(queryParameters))
971	return preparer.Prepare((&http.Request{}).WithContext(ctx))
972}
973
974// ReInitializeReplicationSender sends the ReInitializeReplication request. The method will close the
975// http.Response Body if it receives an error.
976func (client VolumesClient) ReInitializeReplicationSender(req *http.Request) (future VolumesReInitializeReplicationFuture, err error) {
977	var resp *http.Response
978	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
979	if err != nil {
980		return
981	}
982	var azf azure.Future
983	azf, err = azure.NewFutureFromResponse(resp)
984	future.FutureAPI = &azf
985	future.Result = future.result
986	return
987}
988
989// ReInitializeReplicationResponder handles the response to the ReInitializeReplication request. The method always
990// closes the http.Response Body.
991func (client VolumesClient) ReInitializeReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
992	err = autorest.Respond(
993		resp,
994		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
995		autorest.ByClosing())
996	result.Response = resp
997	return
998}
999
1000// ReplicationStatusMethod get the status of the replication
1001// Parameters:
1002// resourceGroupName - the name of the resource group.
1003// accountName - the name of the NetApp account
1004// poolName - the name of the capacity pool
1005// volumeName - the name of the volume
1006func (client VolumesClient) ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result ReplicationStatus, err error) {
1007	if tracing.IsEnabled() {
1008		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReplicationStatusMethod")
1009		defer func() {
1010			sc := -1
1011			if result.Response.Response != nil {
1012				sc = result.Response.Response.StatusCode
1013			}
1014			tracing.EndSpan(ctx, sc, err)
1015		}()
1016	}
1017	if err := validation.Validate([]validation.Validation{
1018		{TargetValue: resourceGroupName,
1019			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
1020				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
1021				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
1022		{TargetValue: poolName,
1023			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1024				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
1025				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
1026		{TargetValue: volumeName,
1027			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1028				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
1029				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
1030		return result, validation.NewError("netapp.VolumesClient", "ReplicationStatusMethod", err.Error())
1031	}
1032
1033	req, err := client.ReplicationStatusMethodPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
1034	if err != nil {
1035		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", nil, "Failure preparing request")
1036		return
1037	}
1038
1039	resp, err := client.ReplicationStatusMethodSender(req)
1040	if err != nil {
1041		result.Response = autorest.Response{Response: resp}
1042		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure sending request")
1043		return
1044	}
1045
1046	result, err = client.ReplicationStatusMethodResponder(resp)
1047	if err != nil {
1048		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure responding to request")
1049		return
1050	}
1051
1052	return
1053}
1054
1055// ReplicationStatusMethodPreparer prepares the ReplicationStatusMethod request.
1056func (client VolumesClient) ReplicationStatusMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
1057	pathParameters := map[string]interface{}{
1058		"accountName":       autorest.Encode("path", accountName),
1059		"poolName":          autorest.Encode("path", poolName),
1060		"resourceGroupName": autorest.Encode("path", resourceGroupName),
1061		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
1062		"volumeName":        autorest.Encode("path", volumeName),
1063	}
1064
1065	const APIVersion = "2020-12-01"
1066	queryParameters := map[string]interface{}{
1067		"api-version": APIVersion,
1068	}
1069
1070	preparer := autorest.CreatePreparer(
1071		autorest.AsGet(),
1072		autorest.WithBaseURL(client.BaseURI),
1073		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", pathParameters),
1074		autorest.WithQueryParameters(queryParameters))
1075	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1076}
1077
1078// ReplicationStatusMethodSender sends the ReplicationStatusMethod request. The method will close the
1079// http.Response Body if it receives an error.
1080func (client VolumesClient) ReplicationStatusMethodSender(req *http.Request) (*http.Response, error) {
1081	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
1082}
1083
1084// ReplicationStatusMethodResponder handles the response to the ReplicationStatusMethod request. The method always
1085// closes the http.Response Body.
1086func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response) (result ReplicationStatus, err error) {
1087	err = autorest.Respond(
1088		resp,
1089		azure.WithErrorUnlessStatusCode(http.StatusOK),
1090		autorest.ByUnmarshallingJSON(&result),
1091		autorest.ByClosing())
1092	result.Response = autorest.Response{Response: resp}
1093	return
1094}
1095
1096// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
1097// will reverse-resync the connection and sync from destination to source.
1098// Parameters:
1099// resourceGroupName - the name of the resource group.
1100// accountName - the name of the NetApp account
1101// poolName - the name of the capacity pool
1102// volumeName - the name of the volume
1103func (client VolumesClient) ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesResyncReplicationFuture, err error) {
1104	if tracing.IsEnabled() {
1105		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ResyncReplication")
1106		defer func() {
1107			sc := -1
1108			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
1109				sc = result.FutureAPI.Response().StatusCode
1110			}
1111			tracing.EndSpan(ctx, sc, err)
1112		}()
1113	}
1114	if err := validation.Validate([]validation.Validation{
1115		{TargetValue: resourceGroupName,
1116			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
1117				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
1118				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
1119		{TargetValue: poolName,
1120			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1121				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
1122				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
1123		{TargetValue: volumeName,
1124			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1125				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
1126				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
1127		return result, validation.NewError("netapp.VolumesClient", "ResyncReplication", err.Error())
1128	}
1129
1130	req, err := client.ResyncReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
1131	if err != nil {
1132		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure preparing request")
1133		return
1134	}
1135
1136	result, err = client.ResyncReplicationSender(req)
1137	if err != nil {
1138		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure sending request")
1139		return
1140	}
1141
1142	return
1143}
1144
1145// ResyncReplicationPreparer prepares the ResyncReplication request.
1146func (client VolumesClient) ResyncReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
1147	pathParameters := map[string]interface{}{
1148		"accountName":       autorest.Encode("path", accountName),
1149		"poolName":          autorest.Encode("path", poolName),
1150		"resourceGroupName": autorest.Encode("path", resourceGroupName),
1151		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
1152		"volumeName":        autorest.Encode("path", volumeName),
1153	}
1154
1155	const APIVersion = "2020-12-01"
1156	queryParameters := map[string]interface{}{
1157		"api-version": APIVersion,
1158	}
1159
1160	preparer := autorest.CreatePreparer(
1161		autorest.AsPost(),
1162		autorest.WithBaseURL(client.BaseURI),
1163		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", pathParameters),
1164		autorest.WithQueryParameters(queryParameters))
1165	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1166}
1167
1168// ResyncReplicationSender sends the ResyncReplication request. The method will close the
1169// http.Response Body if it receives an error.
1170func (client VolumesClient) ResyncReplicationSender(req *http.Request) (future VolumesResyncReplicationFuture, err error) {
1171	var resp *http.Response
1172	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
1173	if err != nil {
1174		return
1175	}
1176	var azf azure.Future
1177	azf, err = azure.NewFutureFromResponse(resp)
1178	future.FutureAPI = &azf
1179	future.Result = future.result
1180	return
1181}
1182
1183// ResyncReplicationResponder handles the response to the ResyncReplication request. The method always
1184// closes the http.Response Body.
1185func (client VolumesClient) ResyncReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
1186	err = autorest.Respond(
1187		resp,
1188		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1189		autorest.ByClosing())
1190	result.Response = resp
1191	return
1192}
1193
1194// Revert revert a volume to the snapshot specified in the body
1195// Parameters:
1196// resourceGroupName - the name of the resource group.
1197// accountName - the name of the NetApp account
1198// poolName - the name of the capacity pool
1199// volumeName - the name of the volume
1200// body - object for snapshot to revert supplied in the body of the operation.
1201func (client VolumesClient) Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (result VolumesRevertFuture, err error) {
1202	if tracing.IsEnabled() {
1203		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Revert")
1204		defer func() {
1205			sc := -1
1206			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
1207				sc = result.FutureAPI.Response().StatusCode
1208			}
1209			tracing.EndSpan(ctx, sc, err)
1210		}()
1211	}
1212	if err := validation.Validate([]validation.Validation{
1213		{TargetValue: resourceGroupName,
1214			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
1215				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
1216				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
1217		{TargetValue: poolName,
1218			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1219				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
1220				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
1221		{TargetValue: volumeName,
1222			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1223				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
1224				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
1225		return result, validation.NewError("netapp.VolumesClient", "Revert", err.Error())
1226	}
1227
1228	req, err := client.RevertPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
1229	if err != nil {
1230		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure preparing request")
1231		return
1232	}
1233
1234	result, err = client.RevertSender(req)
1235	if err != nil {
1236		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure sending request")
1237		return
1238	}
1239
1240	return
1241}
1242
1243// RevertPreparer prepares the Revert request.
1244func (client VolumesClient) RevertPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (*http.Request, error) {
1245	pathParameters := map[string]interface{}{
1246		"accountName":       autorest.Encode("path", accountName),
1247		"poolName":          autorest.Encode("path", poolName),
1248		"resourceGroupName": autorest.Encode("path", resourceGroupName),
1249		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
1250		"volumeName":        autorest.Encode("path", volumeName),
1251	}
1252
1253	const APIVersion = "2020-12-01"
1254	queryParameters := map[string]interface{}{
1255		"api-version": APIVersion,
1256	}
1257
1258	preparer := autorest.CreatePreparer(
1259		autorest.AsContentType("application/json; charset=utf-8"),
1260		autorest.AsPost(),
1261		autorest.WithBaseURL(client.BaseURI),
1262		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert", pathParameters),
1263		autorest.WithJSON(body),
1264		autorest.WithQueryParameters(queryParameters))
1265	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1266}
1267
1268// RevertSender sends the Revert request. The method will close the
1269// http.Response Body if it receives an error.
1270func (client VolumesClient) RevertSender(req *http.Request) (future VolumesRevertFuture, err error) {
1271	var resp *http.Response
1272	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
1273	if err != nil {
1274		return
1275	}
1276	var azf azure.Future
1277	azf, err = azure.NewFutureFromResponse(resp)
1278	future.FutureAPI = &azf
1279	future.Result = future.result
1280	return
1281}
1282
1283// RevertResponder handles the response to the Revert request. The method always
1284// closes the http.Response Body.
1285func (client VolumesClient) RevertResponder(resp *http.Response) (result autorest.Response, err error) {
1286	err = autorest.Respond(
1287		resp,
1288		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1289		autorest.ByClosing())
1290	result.Response = resp
1291	return
1292}
1293
1294// Update patch the specified volume
1295// Parameters:
1296// body - volume object supplied in the body of the operation.
1297// resourceGroupName - the name of the resource group.
1298// accountName - the name of the NetApp account
1299// poolName - the name of the capacity pool
1300// volumeName - the name of the volume
1301func (client VolumesClient) Update(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesUpdateFuture, err error) {
1302	if tracing.IsEnabled() {
1303		ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Update")
1304		defer func() {
1305			sc := -1
1306			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
1307				sc = result.FutureAPI.Response().StatusCode
1308			}
1309			tracing.EndSpan(ctx, sc, err)
1310		}()
1311	}
1312	if err := validation.Validate([]validation.Validation{
1313		{TargetValue: resourceGroupName,
1314			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
1315				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
1316				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
1317		{TargetValue: poolName,
1318			Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1319				{Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
1320				{Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
1321		{TargetValue: volumeName,
1322			Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
1323				{Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
1324				{Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
1325		return result, validation.NewError("netapp.VolumesClient", "Update", err.Error())
1326	}
1327
1328	req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName)
1329	if err != nil {
1330		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure preparing request")
1331		return
1332	}
1333
1334	result, err = client.UpdateSender(req)
1335	if err != nil {
1336		err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure sending request")
1337		return
1338	}
1339
1340	return
1341}
1342
1343// UpdatePreparer prepares the Update request.
1344func (client VolumesClient) UpdatePreparer(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
1345	pathParameters := map[string]interface{}{
1346		"accountName":       autorest.Encode("path", accountName),
1347		"poolName":          autorest.Encode("path", poolName),
1348		"resourceGroupName": autorest.Encode("path", resourceGroupName),
1349		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
1350		"volumeName":        autorest.Encode("path", volumeName),
1351	}
1352
1353	const APIVersion = "2020-12-01"
1354	queryParameters := map[string]interface{}{
1355		"api-version": APIVersion,
1356	}
1357
1358	body.ID = nil
1359	body.Name = nil
1360	body.Type = nil
1361	preparer := autorest.CreatePreparer(
1362		autorest.AsContentType("application/json; charset=utf-8"),
1363		autorest.AsPatch(),
1364		autorest.WithBaseURL(client.BaseURI),
1365		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
1366		autorest.WithJSON(body),
1367		autorest.WithQueryParameters(queryParameters))
1368	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1369}
1370
1371// UpdateSender sends the Update request. The method will close the
1372// http.Response Body if it receives an error.
1373func (client VolumesClient) UpdateSender(req *http.Request) (future VolumesUpdateFuture, err error) {
1374	var resp *http.Response
1375	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
1376	if err != nil {
1377		return
1378	}
1379	var azf azure.Future
1380	azf, err = azure.NewFutureFromResponse(resp)
1381	future.FutureAPI = &azf
1382	future.Result = future.result
1383	return
1384}
1385
1386// UpdateResponder handles the response to the Update request. The method always
1387// closes the http.Response Body.
1388func (client VolumesClient) UpdateResponder(resp *http.Response) (result Volume, err error) {
1389	err = autorest.Respond(
1390		resp,
1391		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1392		autorest.ByUnmarshallingJSON(&result),
1393		autorest.ByClosing())
1394	result.Response = autorest.Response{Response: resp}
1395	return
1396}
1397