1package dtl
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// DisksClient is the the DevTest Labs Client.
19type DisksClient struct {
20	BaseClient
21}
22
23// NewDisksClient creates an instance of the DisksClient client.
24func NewDisksClient(subscriptionID string) DisksClient {
25	return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID)
26}
27
28// NewDisksClientWithBaseURI creates an instance of the DisksClient 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 NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient {
31	return DisksClient{NewWithBaseURI(baseURI, subscriptionID)}
32}
33
34// Attach attach and create the lease of the disk to the virtual machine. This operation can take a while to complete.
35// Parameters:
36// resourceGroupName - the name of the resource group.
37// labName - the name of the lab.
38// userName - the name of the user profile.
39// name - the name of the disk.
40// attachDiskProperties - properties of the disk to attach.
41func (client DisksClient) Attach(ctx context.Context, resourceGroupName string, labName string, userName string, name string, attachDiskProperties AttachDiskProperties) (result DisksAttachFuture, err error) {
42	if tracing.IsEnabled() {
43		ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Attach")
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	req, err := client.AttachPreparer(ctx, resourceGroupName, labName, userName, name, attachDiskProperties)
53	if err != nil {
54		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Attach", nil, "Failure preparing request")
55		return
56	}
57
58	result, err = client.AttachSender(req)
59	if err != nil {
60		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Attach", nil, "Failure sending request")
61		return
62	}
63
64	return
65}
66
67// AttachPreparer prepares the Attach request.
68func (client DisksClient) AttachPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, attachDiskProperties AttachDiskProperties) (*http.Request, error) {
69	pathParameters := map[string]interface{}{
70		"labName":           autorest.Encode("path", labName),
71		"name":              autorest.Encode("path", name),
72		"resourceGroupName": autorest.Encode("path", resourceGroupName),
73		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
74		"userName":          autorest.Encode("path", userName),
75	}
76
77	const APIVersion = "2016-05-15"
78	queryParameters := map[string]interface{}{
79		"api-version": APIVersion,
80	}
81
82	preparer := autorest.CreatePreparer(
83		autorest.AsContentType("application/json; charset=utf-8"),
84		autorest.AsPost(),
85		autorest.WithBaseURL(client.BaseURI),
86		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/attach", pathParameters),
87		autorest.WithJSON(attachDiskProperties),
88		autorest.WithQueryParameters(queryParameters))
89	return preparer.Prepare((&http.Request{}).WithContext(ctx))
90}
91
92// AttachSender sends the Attach request. The method will close the
93// http.Response Body if it receives an error.
94func (client DisksClient) AttachSender(req *http.Request) (future DisksAttachFuture, err error) {
95	var resp *http.Response
96	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
97	if err != nil {
98		return
99	}
100	var azf azure.Future
101	azf, err = azure.NewFutureFromResponse(resp)
102	future.FutureAPI = &azf
103	future.Result = future.result
104	return
105}
106
107// AttachResponder handles the response to the Attach request. The method always
108// closes the http.Response Body.
109func (client DisksClient) AttachResponder(resp *http.Response) (result autorest.Response, err error) {
110	err = autorest.Respond(
111		resp,
112		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
113		autorest.ByClosing())
114	result.Response = resp
115	return
116}
117
118// CreateOrUpdate create or replace an existing disk. This operation can take a while to complete.
119// Parameters:
120// resourceGroupName - the name of the resource group.
121// labName - the name of the lab.
122// userName - the name of the user profile.
123// name - the name of the disk.
124// disk - a Disk.
125func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, disk Disk) (result DisksCreateOrUpdateFuture, err error) {
126	if tracing.IsEnabled() {
127		ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate")
128		defer func() {
129			sc := -1
130			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
131				sc = result.FutureAPI.Response().StatusCode
132			}
133			tracing.EndSpan(ctx, sc, err)
134		}()
135	}
136	if err := validation.Validate([]validation.Validation{
137		{TargetValue: disk,
138			Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
139		return result, validation.NewError("dtl.DisksClient", "CreateOrUpdate", err.Error())
140	}
141
142	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, labName, userName, name, disk)
143	if err != nil {
144		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "CreateOrUpdate", nil, "Failure preparing request")
145		return
146	}
147
148	result, err = client.CreateOrUpdateSender(req)
149	if err != nil {
150		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "CreateOrUpdate", nil, "Failure sending request")
151		return
152	}
153
154	return
155}
156
157// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
158func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, disk Disk) (*http.Request, error) {
159	pathParameters := map[string]interface{}{
160		"labName":           autorest.Encode("path", labName),
161		"name":              autorest.Encode("path", name),
162		"resourceGroupName": autorest.Encode("path", resourceGroupName),
163		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
164		"userName":          autorest.Encode("path", userName),
165	}
166
167	const APIVersion = "2016-05-15"
168	queryParameters := map[string]interface{}{
169		"api-version": APIVersion,
170	}
171
172	preparer := autorest.CreatePreparer(
173		autorest.AsContentType("application/json; charset=utf-8"),
174		autorest.AsPut(),
175		autorest.WithBaseURL(client.BaseURI),
176		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}", pathParameters),
177		autorest.WithJSON(disk),
178		autorest.WithQueryParameters(queryParameters))
179	return preparer.Prepare((&http.Request{}).WithContext(ctx))
180}
181
182// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
183// http.Response Body if it receives an error.
184func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) {
185	var resp *http.Response
186	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
187	if err != nil {
188		return
189	}
190	var azf azure.Future
191	azf, err = azure.NewFutureFromResponse(resp)
192	future.FutureAPI = &azf
193	future.Result = future.result
194	return
195}
196
197// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
198// closes the http.Response Body.
199func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) {
200	err = autorest.Respond(
201		resp,
202		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
203		autorest.ByUnmarshallingJSON(&result),
204		autorest.ByClosing())
205	result.Response = autorest.Response{Response: resp}
206	return
207}
208
209// Delete delete disk. This operation can take a while to complete.
210// Parameters:
211// resourceGroupName - the name of the resource group.
212// labName - the name of the lab.
213// userName - the name of the user profile.
214// name - the name of the disk.
215func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (result DisksDeleteFuture, err error) {
216	if tracing.IsEnabled() {
217		ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete")
218		defer func() {
219			sc := -1
220			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
221				sc = result.FutureAPI.Response().StatusCode
222			}
223			tracing.EndSpan(ctx, sc, err)
224		}()
225	}
226	req, err := client.DeletePreparer(ctx, resourceGroupName, labName, userName, name)
227	if err != nil {
228		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Delete", nil, "Failure preparing request")
229		return
230	}
231
232	result, err = client.DeleteSender(req)
233	if err != nil {
234		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Delete", nil, "Failure sending request")
235		return
236	}
237
238	return
239}
240
241// DeletePreparer prepares the Delete request.
242func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (*http.Request, error) {
243	pathParameters := map[string]interface{}{
244		"labName":           autorest.Encode("path", labName),
245		"name":              autorest.Encode("path", name),
246		"resourceGroupName": autorest.Encode("path", resourceGroupName),
247		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
248		"userName":          autorest.Encode("path", userName),
249	}
250
251	const APIVersion = "2016-05-15"
252	queryParameters := map[string]interface{}{
253		"api-version": APIVersion,
254	}
255
256	preparer := autorest.CreatePreparer(
257		autorest.AsDelete(),
258		autorest.WithBaseURL(client.BaseURI),
259		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}", pathParameters),
260		autorest.WithQueryParameters(queryParameters))
261	return preparer.Prepare((&http.Request{}).WithContext(ctx))
262}
263
264// DeleteSender sends the Delete request. The method will close the
265// http.Response Body if it receives an error.
266func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) {
267	var resp *http.Response
268	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
269	if err != nil {
270		return
271	}
272	var azf azure.Future
273	azf, err = azure.NewFutureFromResponse(resp)
274	future.FutureAPI = &azf
275	future.Result = future.result
276	return
277}
278
279// DeleteResponder handles the response to the Delete request. The method always
280// closes the http.Response Body.
281func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
282	err = autorest.Respond(
283		resp,
284		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
285		autorest.ByClosing())
286	result.Response = resp
287	return
288}
289
290// Detach detach and break the lease of the disk attached to the virtual machine. This operation can take a while to
291// complete.
292// Parameters:
293// resourceGroupName - the name of the resource group.
294// labName - the name of the lab.
295// userName - the name of the user profile.
296// name - the name of the disk.
297// detachDiskProperties - properties of the disk to detach.
298func (client DisksClient) Detach(ctx context.Context, resourceGroupName string, labName string, userName string, name string, detachDiskProperties DetachDiskProperties) (result DisksDetachFuture, err error) {
299	if tracing.IsEnabled() {
300		ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Detach")
301		defer func() {
302			sc := -1
303			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
304				sc = result.FutureAPI.Response().StatusCode
305			}
306			tracing.EndSpan(ctx, sc, err)
307		}()
308	}
309	req, err := client.DetachPreparer(ctx, resourceGroupName, labName, userName, name, detachDiskProperties)
310	if err != nil {
311		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Detach", nil, "Failure preparing request")
312		return
313	}
314
315	result, err = client.DetachSender(req)
316	if err != nil {
317		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Detach", nil, "Failure sending request")
318		return
319	}
320
321	return
322}
323
324// DetachPreparer prepares the Detach request.
325func (client DisksClient) DetachPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, detachDiskProperties DetachDiskProperties) (*http.Request, error) {
326	pathParameters := map[string]interface{}{
327		"labName":           autorest.Encode("path", labName),
328		"name":              autorest.Encode("path", name),
329		"resourceGroupName": autorest.Encode("path", resourceGroupName),
330		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
331		"userName":          autorest.Encode("path", userName),
332	}
333
334	const APIVersion = "2016-05-15"
335	queryParameters := map[string]interface{}{
336		"api-version": APIVersion,
337	}
338
339	preparer := autorest.CreatePreparer(
340		autorest.AsContentType("application/json; charset=utf-8"),
341		autorest.AsPost(),
342		autorest.WithBaseURL(client.BaseURI),
343		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/detach", pathParameters),
344		autorest.WithJSON(detachDiskProperties),
345		autorest.WithQueryParameters(queryParameters))
346	return preparer.Prepare((&http.Request{}).WithContext(ctx))
347}
348
349// DetachSender sends the Detach request. The method will close the
350// http.Response Body if it receives an error.
351func (client DisksClient) DetachSender(req *http.Request) (future DisksDetachFuture, err error) {
352	var resp *http.Response
353	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
354	if err != nil {
355		return
356	}
357	var azf azure.Future
358	azf, err = azure.NewFutureFromResponse(resp)
359	future.FutureAPI = &azf
360	future.Result = future.result
361	return
362}
363
364// DetachResponder handles the response to the Detach request. The method always
365// closes the http.Response Body.
366func (client DisksClient) DetachResponder(resp *http.Response) (result autorest.Response, err error) {
367	err = autorest.Respond(
368		resp,
369		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
370		autorest.ByClosing())
371	result.Response = resp
372	return
373}
374
375// Get get disk.
376// Parameters:
377// resourceGroupName - the name of the resource group.
378// labName - the name of the lab.
379// userName - the name of the user profile.
380// name - the name of the disk.
381// expand - specify the $expand query. Example: 'properties($select=diskType)'
382func (client DisksClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string, name string, expand string) (result Disk, err error) {
383	if tracing.IsEnabled() {
384		ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Get")
385		defer func() {
386			sc := -1
387			if result.Response.Response != nil {
388				sc = result.Response.Response.StatusCode
389			}
390			tracing.EndSpan(ctx, sc, err)
391		}()
392	}
393	req, err := client.GetPreparer(ctx, resourceGroupName, labName, userName, name, expand)
394	if err != nil {
395		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Get", nil, "Failure preparing request")
396		return
397	}
398
399	resp, err := client.GetSender(req)
400	if err != nil {
401		result.Response = autorest.Response{Response: resp}
402		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Get", resp, "Failure sending request")
403		return
404	}
405
406	result, err = client.GetResponder(resp)
407	if err != nil {
408		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Get", resp, "Failure responding to request")
409		return
410	}
411
412	return
413}
414
415// GetPreparer prepares the Get request.
416func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, expand string) (*http.Request, error) {
417	pathParameters := map[string]interface{}{
418		"labName":           autorest.Encode("path", labName),
419		"name":              autorest.Encode("path", name),
420		"resourceGroupName": autorest.Encode("path", resourceGroupName),
421		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
422		"userName":          autorest.Encode("path", userName),
423	}
424
425	const APIVersion = "2016-05-15"
426	queryParameters := map[string]interface{}{
427		"api-version": APIVersion,
428	}
429	if len(expand) > 0 {
430		queryParameters["$expand"] = autorest.Encode("query", expand)
431	}
432
433	preparer := autorest.CreatePreparer(
434		autorest.AsGet(),
435		autorest.WithBaseURL(client.BaseURI),
436		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}", pathParameters),
437		autorest.WithQueryParameters(queryParameters))
438	return preparer.Prepare((&http.Request{}).WithContext(ctx))
439}
440
441// GetSender sends the Get request. The method will close the
442// http.Response Body if it receives an error.
443func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) {
444	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
445}
446
447// GetResponder handles the response to the Get request. The method always
448// closes the http.Response Body.
449func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) {
450	err = autorest.Respond(
451		resp,
452		azure.WithErrorUnlessStatusCode(http.StatusOK),
453		autorest.ByUnmarshallingJSON(&result),
454		autorest.ByClosing())
455	result.Response = autorest.Response{Response: resp}
456	return
457}
458
459// List list disks in a given user profile.
460// Parameters:
461// resourceGroupName - the name of the resource group.
462// labName - the name of the lab.
463// userName - the name of the user profile.
464// expand - specify the $expand query. Example: 'properties($select=diskType)'
465// filter - the filter to apply to the operation.
466// top - the maximum number of resources to return from the operation.
467// orderby - the ordering expression for the results, using OData notation.
468func (client DisksClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationDiskPage, err error) {
469	if tracing.IsEnabled() {
470		ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List")
471		defer func() {
472			sc := -1
473			if result.rwcd.Response.Response != nil {
474				sc = result.rwcd.Response.Response.StatusCode
475			}
476			tracing.EndSpan(ctx, sc, err)
477		}()
478	}
479	result.fn = client.listNextResults
480	req, err := client.ListPreparer(ctx, resourceGroupName, labName, userName, expand, filter, top, orderby)
481	if err != nil {
482		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "List", nil, "Failure preparing request")
483		return
484	}
485
486	resp, err := client.ListSender(req)
487	if err != nil {
488		result.rwcd.Response = autorest.Response{Response: resp}
489		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "List", resp, "Failure sending request")
490		return
491	}
492
493	result.rwcd, err = client.ListResponder(resp)
494	if err != nil {
495		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "List", resp, "Failure responding to request")
496		return
497	}
498	if result.rwcd.hasNextLink() && result.rwcd.IsEmpty() {
499		err = result.NextWithContext(ctx)
500		return
501	}
502
503	return
504}
505
506// ListPreparer prepares the List request.
507func (client DisksClient) ListPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (*http.Request, error) {
508	pathParameters := map[string]interface{}{
509		"labName":           autorest.Encode("path", labName),
510		"resourceGroupName": autorest.Encode("path", resourceGroupName),
511		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
512		"userName":          autorest.Encode("path", userName),
513	}
514
515	const APIVersion = "2016-05-15"
516	queryParameters := map[string]interface{}{
517		"api-version": APIVersion,
518	}
519	if len(expand) > 0 {
520		queryParameters["$expand"] = autorest.Encode("query", expand)
521	}
522	if len(filter) > 0 {
523		queryParameters["$filter"] = autorest.Encode("query", filter)
524	}
525	if top != nil {
526		queryParameters["$top"] = autorest.Encode("query", *top)
527	}
528	if len(orderby) > 0 {
529		queryParameters["$orderby"] = autorest.Encode("query", orderby)
530	}
531
532	preparer := autorest.CreatePreparer(
533		autorest.AsGet(),
534		autorest.WithBaseURL(client.BaseURI),
535		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks", pathParameters),
536		autorest.WithQueryParameters(queryParameters))
537	return preparer.Prepare((&http.Request{}).WithContext(ctx))
538}
539
540// ListSender sends the List request. The method will close the
541// http.Response Body if it receives an error.
542func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) {
543	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
544}
545
546// ListResponder handles the response to the List request. The method always
547// closes the http.Response Body.
548func (client DisksClient) ListResponder(resp *http.Response) (result ResponseWithContinuationDisk, err error) {
549	err = autorest.Respond(
550		resp,
551		azure.WithErrorUnlessStatusCode(http.StatusOK),
552		autorest.ByUnmarshallingJSON(&result),
553		autorest.ByClosing())
554	result.Response = autorest.Response{Response: resp}
555	return
556}
557
558// listNextResults retrieves the next set of results, if any.
559func (client DisksClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationDisk) (result ResponseWithContinuationDisk, err error) {
560	req, err := lastResults.responseWithContinuationDiskPreparer(ctx)
561	if err != nil {
562		return result, autorest.NewErrorWithError(err, "dtl.DisksClient", "listNextResults", nil, "Failure preparing next results request")
563	}
564	if req == nil {
565		return
566	}
567	resp, err := client.ListSender(req)
568	if err != nil {
569		result.Response = autorest.Response{Response: resp}
570		return result, autorest.NewErrorWithError(err, "dtl.DisksClient", "listNextResults", resp, "Failure sending next results request")
571	}
572	result, err = client.ListResponder(resp)
573	if err != nil {
574		err = autorest.NewErrorWithError(err, "dtl.DisksClient", "listNextResults", resp, "Failure responding to next results request")
575	}
576	return
577}
578
579// ListComplete enumerates all values, automatically crossing page boundaries as required.
580func (client DisksClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationDiskIterator, err error) {
581	if tracing.IsEnabled() {
582		ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List")
583		defer func() {
584			sc := -1
585			if result.Response().Response.Response != nil {
586				sc = result.page.Response().Response.Response.StatusCode
587			}
588			tracing.EndSpan(ctx, sc, err)
589		}()
590	}
591	result.page, err = client.List(ctx, resourceGroupName, labName, userName, expand, filter, top, orderby)
592	return
593}
594