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