1 package netapp
2
3
4
5
6
7
8
9 import (
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
19 type SnapshotsClient struct {
20 BaseClient
21 }
22
23
24 func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
25 return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID)
26 }
27
28
29
30 func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
31 return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)}
32 }
33
34
35
36
37
38
39
40
41
42 func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
43 if tracing.IsEnabled() {
44 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
45 defer func() {
46 sc := -1
47 if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
48 sc = result.FutureAPI.Response().StatusCode
49 }
50 tracing.EndSpan(ctx, sc, err)
51 }()
52 }
53 if err := validation.Validate([]validation.Validation{
54 {TargetValue: body,
55 Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
56 {Target: "body.SnapshotProperties", Name: validation.Null, Rule: false,
57 Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.Null, Rule: false,
58 Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil},
59 {Target: "body.SnapshotProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil},
60 {Target: "body.SnapshotProperties.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},
61 }},
62 {Target: "body.SnapshotProperties.FileSystemID", Name: validation.Null, Rule: false,
63 Chain: []validation.Constraint{{Target: "body.SnapshotProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil},
64 {Target: "body.SnapshotProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil},
65 {Target: "body.SnapshotProperties.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},
66 }},
67 }}}},
68 {TargetValue: resourceGroupName,
69 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
70 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
71 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
72 {TargetValue: poolName,
73 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
74 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
75 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
76 {TargetValue: volumeName,
77 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
78 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
79 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
80 return result, validation.NewError("netapp.SnapshotsClient", "Create", err.Error())
81 }
82
83 req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName)
84 if err != nil {
85 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", nil, "Failure preparing request")
86 return
87 }
88
89 result, err = client.CreateSender(req)
90 if err != nil {
91 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", result.Response(), "Failure sending request")
92 return
93 }
94
95 return
96 }
97
98
99 func (client SnapshotsClient) CreatePreparer(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
100 pathParameters := map[string]interface{}{
101 "accountName": autorest.Encode("path", accountName),
102 "poolName": autorest.Encode("path", poolName),
103 "resourceGroupName": autorest.Encode("path", resourceGroupName),
104 "snapshotName": autorest.Encode("path", snapshotName),
105 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
106 "volumeName": autorest.Encode("path", volumeName),
107 }
108
109 const APIVersion = "2019-11-01"
110 queryParameters := map[string]interface{}{
111 "api-version": APIVersion,
112 }
113
114 body.ID = nil
115 body.Name = nil
116 body.Type = nil
117 preparer := autorest.CreatePreparer(
118 autorest.AsContentType("application/json; charset=utf-8"),
119 autorest.AsPut(),
120 autorest.WithBaseURL(client.BaseURI),
121 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
122 autorest.WithJSON(body),
123 autorest.WithQueryParameters(queryParameters))
124 return preparer.Prepare((&http.Request{}).WithContext(ctx))
125 }
126
127
128
129 func (client SnapshotsClient) CreateSender(req *http.Request) (future SnapshotsCreateFuture, err error) {
130 var resp *http.Response
131 future.FutureAPI = &azure.Future{}
132 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
133 if err != nil {
134 return
135 }
136 var azf azure.Future
137 azf, err = azure.NewFutureFromResponse(resp)
138 future.FutureAPI = &azf
139 future.Result = future.result
140 return
141 }
142
143
144
145 func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snapshot, err error) {
146 err = autorest.Respond(
147 resp,
148 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
149 autorest.ByUnmarshallingJSON(&result),
150 autorest.ByClosing())
151 result.Response = autorest.Response{Response: resp}
152 return
153 }
154
155
156
157
158
159
160
161
162 func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
163 if tracing.IsEnabled() {
164 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
165 defer func() {
166 sc := -1
167 if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
168 sc = result.FutureAPI.Response().StatusCode
169 }
170 tracing.EndSpan(ctx, sc, err)
171 }()
172 }
173 if err := validation.Validate([]validation.Validation{
174 {TargetValue: resourceGroupName,
175 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
176 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
177 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
178 {TargetValue: poolName,
179 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
180 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
181 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
182 {TargetValue: volumeName,
183 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
184 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
185 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
186 return result, validation.NewError("netapp.SnapshotsClient", "Delete", err.Error())
187 }
188
189 req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName)
190 if err != nil {
191 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", nil, "Failure preparing request")
192 return
193 }
194
195 result, err = client.DeleteSender(req)
196 if err != nil {
197 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", result.Response(), "Failure sending request")
198 return
199 }
200
201 return
202 }
203
204
205 func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
206 pathParameters := map[string]interface{}{
207 "accountName": autorest.Encode("path", accountName),
208 "poolName": autorest.Encode("path", poolName),
209 "resourceGroupName": autorest.Encode("path", resourceGroupName),
210 "snapshotName": autorest.Encode("path", snapshotName),
211 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
212 "volumeName": autorest.Encode("path", volumeName),
213 }
214
215 const APIVersion = "2019-11-01"
216 queryParameters := map[string]interface{}{
217 "api-version": APIVersion,
218 }
219
220 preparer := autorest.CreatePreparer(
221 autorest.AsDelete(),
222 autorest.WithBaseURL(client.BaseURI),
223 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
224 autorest.WithQueryParameters(queryParameters))
225 return preparer.Prepare((&http.Request{}).WithContext(ctx))
226 }
227
228
229
230 func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) {
231 var resp *http.Response
232 future.FutureAPI = &azure.Future{}
233 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
234 if err != nil {
235 return
236 }
237 var azf azure.Future
238 azf, err = azure.NewFutureFromResponse(resp)
239 future.FutureAPI = &azf
240 future.Result = future.result
241 return
242 }
243
244
245
246 func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
247 err = autorest.Respond(
248 resp,
249 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
250 autorest.ByClosing())
251 result.Response = resp
252 return
253 }
254
255
256
257
258
259
260
261
262 func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
263 if tracing.IsEnabled() {
264 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
265 defer func() {
266 sc := -1
267 if result.Response.Response != nil {
268 sc = result.Response.Response.StatusCode
269 }
270 tracing.EndSpan(ctx, sc, err)
271 }()
272 }
273 if err := validation.Validate([]validation.Validation{
274 {TargetValue: resourceGroupName,
275 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
276 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
277 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
278 {TargetValue: poolName,
279 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
280 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
281 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
282 {TargetValue: volumeName,
283 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
284 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
285 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
286 return result, validation.NewError("netapp.SnapshotsClient", "Get", err.Error())
287 }
288
289 req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName)
290 if err != nil {
291 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", nil, "Failure preparing request")
292 return
293 }
294
295 resp, err := client.GetSender(req)
296 if err != nil {
297 result.Response = autorest.Response{Response: resp}
298 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure sending request")
299 return
300 }
301
302 result, err = client.GetResponder(resp)
303 if err != nil {
304 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure responding to request")
305 return
306 }
307
308 return
309 }
310
311
312 func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
313 pathParameters := map[string]interface{}{
314 "accountName": autorest.Encode("path", accountName),
315 "poolName": autorest.Encode("path", poolName),
316 "resourceGroupName": autorest.Encode("path", resourceGroupName),
317 "snapshotName": autorest.Encode("path", snapshotName),
318 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
319 "volumeName": autorest.Encode("path", volumeName),
320 }
321
322 const APIVersion = "2019-11-01"
323 queryParameters := map[string]interface{}{
324 "api-version": APIVersion,
325 }
326
327 preparer := autorest.CreatePreparer(
328 autorest.AsGet(),
329 autorest.WithBaseURL(client.BaseURI),
330 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
331 autorest.WithQueryParameters(queryParameters))
332 return preparer.Prepare((&http.Request{}).WithContext(ctx))
333 }
334
335
336
337 func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) {
338 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
339 }
340
341
342
343 func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) {
344 err = autorest.Respond(
345 resp,
346 azure.WithErrorUnlessStatusCode(http.StatusOK),
347 autorest.ByUnmarshallingJSON(&result),
348 autorest.ByClosing())
349 result.Response = autorest.Response{Response: resp}
350 return
351 }
352
353
354
355
356
357
358
359 func (client SnapshotsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SnapshotsList, err error) {
360 if tracing.IsEnabled() {
361 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List")
362 defer func() {
363 sc := -1
364 if result.Response.Response != nil {
365 sc = result.Response.Response.StatusCode
366 }
367 tracing.EndSpan(ctx, sc, err)
368 }()
369 }
370 if err := validation.Validate([]validation.Validation{
371 {TargetValue: resourceGroupName,
372 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
373 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
374 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
375 {TargetValue: poolName,
376 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
377 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
378 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
379 {TargetValue: volumeName,
380 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
381 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
382 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
383 return result, validation.NewError("netapp.SnapshotsClient", "List", err.Error())
384 }
385
386 req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
387 if err != nil {
388 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", nil, "Failure preparing request")
389 return
390 }
391
392 resp, err := client.ListSender(req)
393 if err != nil {
394 result.Response = autorest.Response{Response: resp}
395 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure sending request")
396 return
397 }
398
399 result, err = client.ListResponder(resp)
400 if err != nil {
401 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure responding to request")
402 return
403 }
404
405 return
406 }
407
408
409 func (client SnapshotsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
410 pathParameters := map[string]interface{}{
411 "accountName": autorest.Encode("path", accountName),
412 "poolName": autorest.Encode("path", poolName),
413 "resourceGroupName": autorest.Encode("path", resourceGroupName),
414 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
415 "volumeName": autorest.Encode("path", volumeName),
416 }
417
418 const APIVersion = "2019-11-01"
419 queryParameters := map[string]interface{}{
420 "api-version": APIVersion,
421 }
422
423 preparer := autorest.CreatePreparer(
424 autorest.AsGet(),
425 autorest.WithBaseURL(client.BaseURI),
426 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots", pathParameters),
427 autorest.WithQueryParameters(queryParameters))
428 return preparer.Prepare((&http.Request{}).WithContext(ctx))
429 }
430
431
432
433 func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) {
434 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
435 }
436
437
438
439 func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotsList, err error) {
440 err = autorest.Respond(
441 resp,
442 azure.WithErrorUnlessStatusCode(http.StatusOK),
443 autorest.ByUnmarshallingJSON(&result),
444 autorest.ByClosing())
445 result.Response = autorest.Response{Response: resp}
446 return
447 }
448
449
450
451
452
453
454
455
456
457 func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
458 if tracing.IsEnabled() {
459 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
460 defer func() {
461 sc := -1
462 if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
463 sc = result.FutureAPI.Response().StatusCode
464 }
465 tracing.EndSpan(ctx, sc, err)
466 }()
467 }
468 if err := validation.Validate([]validation.Validation{
469 {TargetValue: resourceGroupName,
470 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
471 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
472 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
473 {TargetValue: poolName,
474 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
475 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
476 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
477 {TargetValue: volumeName,
478 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
479 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
480 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
481 return result, validation.NewError("netapp.SnapshotsClient", "Update", err.Error())
482 }
483
484 req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName)
485 if err != nil {
486 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", nil, "Failure preparing request")
487 return
488 }
489
490 result, err = client.UpdateSender(req)
491 if err != nil {
492 err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", result.Response(), "Failure sending request")
493 return
494 }
495
496 return
497 }
498
499
500 func (client SnapshotsClient) UpdatePreparer(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
501 pathParameters := map[string]interface{}{
502 "accountName": autorest.Encode("path", accountName),
503 "poolName": autorest.Encode("path", poolName),
504 "resourceGroupName": autorest.Encode("path", resourceGroupName),
505 "snapshotName": autorest.Encode("path", snapshotName),
506 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
507 "volumeName": autorest.Encode("path", volumeName),
508 }
509
510 const APIVersion = "2019-11-01"
511 queryParameters := map[string]interface{}{
512 "api-version": APIVersion,
513 }
514
515 preparer := autorest.CreatePreparer(
516 autorest.AsContentType("application/json; charset=utf-8"),
517 autorest.AsPatch(),
518 autorest.WithBaseURL(client.BaseURI),
519 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
520 autorest.WithJSON(body),
521 autorest.WithQueryParameters(queryParameters))
522 return preparer.Prepare((&http.Request{}).WithContext(ctx))
523 }
524
525
526
527 func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) {
528 var resp *http.Response
529 future.FutureAPI = &azure.Future{}
530 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
531 if err != nil {
532 return
533 }
534 var azf azure.Future
535 azf, err = azure.NewFutureFromResponse(resp)
536 future.FutureAPI = &azf
537 future.Result = future.result
538 return
539 }
540
541
542
543 func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) {
544 err = autorest.Respond(
545 resp,
546 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
547 autorest.ByUnmarshallingJSON(&result),
548 autorest.ByClosing())
549 result.Response = autorest.Response{Response: resp}
550 return
551 }
552
View as plain text