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