1package network 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/tracing" 25 "net/http" 26) 27 28// LoadBalancersClient is the network Client 29type LoadBalancersClient struct { 30 BaseClient 31} 32 33// NewLoadBalancersClient creates an instance of the LoadBalancersClient client. 34func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient { 35 return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID) 36} 37 38// NewLoadBalancersClientWithBaseURI creates an instance of the LoadBalancersClient client using a custom endpoint. 39// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 40func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient { 41 return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} 42} 43 44// CreateOrUpdate creates or updates a load balancer. 45// Parameters: 46// resourceGroupName - the name of the resource group. 47// loadBalancerName - the name of the load balancer. 48// parameters - parameters supplied to the create or update load balancer operation. 49func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (result LoadBalancersCreateOrUpdateFuture, err error) { 50 if tracing.IsEnabled() { 51 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.CreateOrUpdate") 52 defer func() { 53 sc := -1 54 if result.Response() != nil { 55 sc = result.Response().StatusCode 56 } 57 tracing.EndSpan(ctx, sc, err) 58 }() 59 } 60 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, parameters) 61 if err != nil { 62 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", nil, "Failure preparing request") 63 return 64 } 65 66 result, err = client.CreateOrUpdateSender(req) 67 if err != nil { 68 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", result.Response(), "Failure sending request") 69 return 70 } 71 72 return 73} 74 75// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 76func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (*http.Request, error) { 77 pathParameters := map[string]interface{}{ 78 "loadBalancerName": autorest.Encode("path", loadBalancerName), 79 "resourceGroupName": autorest.Encode("path", resourceGroupName), 80 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 81 } 82 83 const APIVersion = "2020-04-01" 84 queryParameters := map[string]interface{}{ 85 "api-version": APIVersion, 86 } 87 88 parameters.Etag = nil 89 preparer := autorest.CreatePreparer( 90 autorest.AsContentType("application/json; charset=utf-8"), 91 autorest.AsPut(), 92 autorest.WithBaseURL(client.BaseURI), 93 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), 94 autorest.WithJSON(parameters), 95 autorest.WithQueryParameters(queryParameters)) 96 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 97} 98 99// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 100// http.Response Body if it receives an error. 101func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancersCreateOrUpdateFuture, err error) { 102 var resp *http.Response 103 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 104 if err != nil { 105 return 106 } 107 future.Future, err = azure.NewFutureFromResponse(resp) 108 return 109} 110 111// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 112// closes the http.Response Body. 113func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancer, err error) { 114 err = autorest.Respond( 115 resp, 116 client.ByInspecting(), 117 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 118 autorest.ByUnmarshallingJSON(&result), 119 autorest.ByClosing()) 120 result.Response = autorest.Response{Response: resp} 121 return 122} 123 124// Delete deletes the specified load balancer. 125// Parameters: 126// resourceGroupName - the name of the resource group. 127// loadBalancerName - the name of the load balancer. 128func (client LoadBalancersClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancersDeleteFuture, err error) { 129 if tracing.IsEnabled() { 130 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Delete") 131 defer func() { 132 sc := -1 133 if result.Response() != nil { 134 sc = result.Response().StatusCode 135 } 136 tracing.EndSpan(ctx, sc, err) 137 }() 138 } 139 req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName) 140 if err != nil { 141 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", nil, "Failure preparing request") 142 return 143 } 144 145 result, err = client.DeleteSender(req) 146 if err != nil { 147 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", result.Response(), "Failure sending request") 148 return 149 } 150 151 return 152} 153 154// DeletePreparer prepares the Delete request. 155func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { 156 pathParameters := map[string]interface{}{ 157 "loadBalancerName": autorest.Encode("path", loadBalancerName), 158 "resourceGroupName": autorest.Encode("path", resourceGroupName), 159 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 160 } 161 162 const APIVersion = "2020-04-01" 163 queryParameters := map[string]interface{}{ 164 "api-version": APIVersion, 165 } 166 167 preparer := autorest.CreatePreparer( 168 autorest.AsDelete(), 169 autorest.WithBaseURL(client.BaseURI), 170 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), 171 autorest.WithQueryParameters(queryParameters)) 172 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 173} 174 175// DeleteSender sends the Delete request. The method will close the 176// http.Response Body if it receives an error. 177func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBalancersDeleteFuture, err error) { 178 var resp *http.Response 179 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 180 if err != nil { 181 return 182 } 183 future.Future, err = azure.NewFutureFromResponse(resp) 184 return 185} 186 187// DeleteResponder handles the response to the Delete request. The method always 188// closes the http.Response Body. 189func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 190 err = autorest.Respond( 191 resp, 192 client.ByInspecting(), 193 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 194 autorest.ByClosing()) 195 result.Response = resp 196 return 197} 198 199// Get gets the specified load balancer. 200// Parameters: 201// resourceGroupName - the name of the resource group. 202// loadBalancerName - the name of the load balancer. 203// expand - expands referenced resources. 204func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { 205 if tracing.IsEnabled() { 206 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Get") 207 defer func() { 208 sc := -1 209 if result.Response.Response != nil { 210 sc = result.Response.Response.StatusCode 211 } 212 tracing.EndSpan(ctx, sc, err) 213 }() 214 } 215 req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, expand) 216 if err != nil { 217 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", nil, "Failure preparing request") 218 return 219 } 220 221 resp, err := client.GetSender(req) 222 if err != nil { 223 result.Response = autorest.Response{Response: resp} 224 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure sending request") 225 return 226 } 227 228 result, err = client.GetResponder(resp) 229 if err != nil { 230 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure responding to request") 231 } 232 233 return 234} 235 236// GetPreparer prepares the Get request. 237func (client LoadBalancersClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (*http.Request, error) { 238 pathParameters := map[string]interface{}{ 239 "loadBalancerName": autorest.Encode("path", loadBalancerName), 240 "resourceGroupName": autorest.Encode("path", resourceGroupName), 241 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 242 } 243 244 const APIVersion = "2020-04-01" 245 queryParameters := map[string]interface{}{ 246 "api-version": APIVersion, 247 } 248 if len(expand) > 0 { 249 queryParameters["$expand"] = autorest.Encode("query", expand) 250 } 251 252 preparer := autorest.CreatePreparer( 253 autorest.AsGet(), 254 autorest.WithBaseURL(client.BaseURI), 255 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), 256 autorest.WithQueryParameters(queryParameters)) 257 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 258} 259 260// GetSender sends the Get request. The method will close the 261// http.Response Body if it receives an error. 262func (client LoadBalancersClient) GetSender(req *http.Request) (*http.Response, error) { 263 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 264} 265 266// GetResponder handles the response to the Get request. The method always 267// closes the http.Response Body. 268func (client LoadBalancersClient) GetResponder(resp *http.Response) (result LoadBalancer, err error) { 269 err = autorest.Respond( 270 resp, 271 client.ByInspecting(), 272 azure.WithErrorUnlessStatusCode(http.StatusOK), 273 autorest.ByUnmarshallingJSON(&result), 274 autorest.ByClosing()) 275 result.Response = autorest.Response{Response: resp} 276 return 277} 278 279// List gets all the load balancers in a resource group. 280// Parameters: 281// resourceGroupName - the name of the resource group. 282func (client LoadBalancersClient) List(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultPage, err error) { 283 if tracing.IsEnabled() { 284 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.List") 285 defer func() { 286 sc := -1 287 if result.lblr.Response.Response != nil { 288 sc = result.lblr.Response.Response.StatusCode 289 } 290 tracing.EndSpan(ctx, sc, err) 291 }() 292 } 293 result.fn = client.listNextResults 294 req, err := client.ListPreparer(ctx, resourceGroupName) 295 if err != nil { 296 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", nil, "Failure preparing request") 297 return 298 } 299 300 resp, err := client.ListSender(req) 301 if err != nil { 302 result.lblr.Response = autorest.Response{Response: resp} 303 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure sending request") 304 return 305 } 306 307 result.lblr, err = client.ListResponder(resp) 308 if err != nil { 309 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to request") 310 } 311 312 return 313} 314 315// ListPreparer prepares the List request. 316func (client LoadBalancersClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { 317 pathParameters := map[string]interface{}{ 318 "resourceGroupName": autorest.Encode("path", resourceGroupName), 319 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 320 } 321 322 const APIVersion = "2020-04-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.Network/loadBalancers", pathParameters), 331 autorest.WithQueryParameters(queryParameters)) 332 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 333} 334 335// ListSender sends the List request. The method will close the 336// http.Response Body if it receives an error. 337func (client LoadBalancersClient) ListSender(req *http.Request) (*http.Response, error) { 338 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 339} 340 341// ListResponder handles the response to the List request. The method always 342// closes the http.Response Body. 343func (client LoadBalancersClient) ListResponder(resp *http.Response) (result LoadBalancerListResult, err error) { 344 err = autorest.Respond( 345 resp, 346 client.ByInspecting(), 347 azure.WithErrorUnlessStatusCode(http.StatusOK), 348 autorest.ByUnmarshallingJSON(&result), 349 autorest.ByClosing()) 350 result.Response = autorest.Response{Response: resp} 351 return 352} 353 354// listNextResults retrieves the next set of results, if any. 355func (client LoadBalancersClient) listNextResults(ctx context.Context, lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) { 356 req, err := lastResults.loadBalancerListResultPreparer(ctx) 357 if err != nil { 358 return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", nil, "Failure preparing next results request") 359 } 360 if req == nil { 361 return 362 } 363 resp, err := client.ListSender(req) 364 if err != nil { 365 result.Response = autorest.Response{Response: resp} 366 return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", resp, "Failure sending next results request") 367 } 368 result, err = client.ListResponder(resp) 369 if err != nil { 370 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", resp, "Failure responding to next results request") 371 } 372 return 373} 374 375// ListComplete enumerates all values, automatically crossing page boundaries as required. 376func (client LoadBalancersClient) ListComplete(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultIterator, err error) { 377 if tracing.IsEnabled() { 378 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.List") 379 defer func() { 380 sc := -1 381 if result.Response().Response.Response != nil { 382 sc = result.page.Response().Response.Response.StatusCode 383 } 384 tracing.EndSpan(ctx, sc, err) 385 }() 386 } 387 result.page, err = client.List(ctx, resourceGroupName) 388 return 389} 390 391// ListAll gets all the load balancers in a subscription. 392func (client LoadBalancersClient) ListAll(ctx context.Context) (result LoadBalancerListResultPage, err error) { 393 if tracing.IsEnabled() { 394 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListAll") 395 defer func() { 396 sc := -1 397 if result.lblr.Response.Response != nil { 398 sc = result.lblr.Response.Response.StatusCode 399 } 400 tracing.EndSpan(ctx, sc, err) 401 }() 402 } 403 result.fn = client.listAllNextResults 404 req, err := client.ListAllPreparer(ctx) 405 if err != nil { 406 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", nil, "Failure preparing request") 407 return 408 } 409 410 resp, err := client.ListAllSender(req) 411 if err != nil { 412 result.lblr.Response = autorest.Response{Response: resp} 413 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure sending request") 414 return 415 } 416 417 result.lblr, err = client.ListAllResponder(resp) 418 if err != nil { 419 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to request") 420 } 421 422 return 423} 424 425// ListAllPreparer prepares the ListAll request. 426func (client LoadBalancersClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { 427 pathParameters := map[string]interface{}{ 428 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 429 } 430 431 const APIVersion = "2020-04-01" 432 queryParameters := map[string]interface{}{ 433 "api-version": APIVersion, 434 } 435 436 preparer := autorest.CreatePreparer( 437 autorest.AsGet(), 438 autorest.WithBaseURL(client.BaseURI), 439 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", pathParameters), 440 autorest.WithQueryParameters(queryParameters)) 441 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 442} 443 444// ListAllSender sends the ListAll request. The method will close the 445// http.Response Body if it receives an error. 446func (client LoadBalancersClient) ListAllSender(req *http.Request) (*http.Response, error) { 447 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 448} 449 450// ListAllResponder handles the response to the ListAll request. The method always 451// closes the http.Response Body. 452func (client LoadBalancersClient) ListAllResponder(resp *http.Response) (result LoadBalancerListResult, err error) { 453 err = autorest.Respond( 454 resp, 455 client.ByInspecting(), 456 azure.WithErrorUnlessStatusCode(http.StatusOK), 457 autorest.ByUnmarshallingJSON(&result), 458 autorest.ByClosing()) 459 result.Response = autorest.Response{Response: resp} 460 return 461} 462 463// listAllNextResults retrieves the next set of results, if any. 464func (client LoadBalancersClient) listAllNextResults(ctx context.Context, lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) { 465 req, err := lastResults.loadBalancerListResultPreparer(ctx) 466 if err != nil { 467 return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", nil, "Failure preparing next results request") 468 } 469 if req == nil { 470 return 471 } 472 resp, err := client.ListAllSender(req) 473 if err != nil { 474 result.Response = autorest.Response{Response: resp} 475 return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", resp, "Failure sending next results request") 476 } 477 result, err = client.ListAllResponder(resp) 478 if err != nil { 479 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", resp, "Failure responding to next results request") 480 } 481 return 482} 483 484// ListAllComplete enumerates all values, automatically crossing page boundaries as required. 485func (client LoadBalancersClient) ListAllComplete(ctx context.Context) (result LoadBalancerListResultIterator, err error) { 486 if tracing.IsEnabled() { 487 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListAll") 488 defer func() { 489 sc := -1 490 if result.Response().Response.Response != nil { 491 sc = result.page.Response().Response.Response.StatusCode 492 } 493 tracing.EndSpan(ctx, sc, err) 494 }() 495 } 496 result.page, err = client.ListAll(ctx) 497 return 498} 499 500// UpdateTags updates a load balancer tags. 501// Parameters: 502// resourceGroupName - the name of the resource group. 503// loadBalancerName - the name of the load balancer. 504// parameters - parameters supplied to update load balancer tags. 505func (client LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (result LoadBalancer, err error) { 506 if tracing.IsEnabled() { 507 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.UpdateTags") 508 defer func() { 509 sc := -1 510 if result.Response.Response != nil { 511 sc = result.Response.Response.StatusCode 512 } 513 tracing.EndSpan(ctx, sc, err) 514 }() 515 } 516 req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, loadBalancerName, parameters) 517 if err != nil { 518 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", nil, "Failure preparing request") 519 return 520 } 521 522 resp, err := client.UpdateTagsSender(req) 523 if err != nil { 524 result.Response = autorest.Response{Response: resp} 525 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", resp, "Failure sending request") 526 return 527 } 528 529 result, err = client.UpdateTagsResponder(resp) 530 if err != nil { 531 err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", resp, "Failure responding to request") 532 } 533 534 return 535} 536 537// UpdateTagsPreparer prepares the UpdateTags request. 538func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (*http.Request, error) { 539 pathParameters := map[string]interface{}{ 540 "loadBalancerName": autorest.Encode("path", loadBalancerName), 541 "resourceGroupName": autorest.Encode("path", resourceGroupName), 542 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 543 } 544 545 const APIVersion = "2020-04-01" 546 queryParameters := map[string]interface{}{ 547 "api-version": APIVersion, 548 } 549 550 preparer := autorest.CreatePreparer( 551 autorest.AsContentType("application/json; charset=utf-8"), 552 autorest.AsPatch(), 553 autorest.WithBaseURL(client.BaseURI), 554 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), 555 autorest.WithJSON(parameters), 556 autorest.WithQueryParameters(queryParameters)) 557 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 558} 559 560// UpdateTagsSender sends the UpdateTags request. The method will close the 561// http.Response Body if it receives an error. 562func (client LoadBalancersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { 563 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 564} 565 566// UpdateTagsResponder handles the response to the UpdateTags request. The method always 567// closes the http.Response Body. 568func (client LoadBalancersClient) UpdateTagsResponder(resp *http.Response) (result LoadBalancer, err error) { 569 err = autorest.Respond( 570 resp, 571 client.ByInspecting(), 572 azure.WithErrorUnlessStatusCode(http.StatusOK), 573 autorest.ByUnmarshallingJSON(&result), 574 autorest.ByClosing()) 575 result.Response = autorest.Response{Response: resp} 576 return 577} 578