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