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// VirtualNetworkGatewaysClient is the network Client 29type VirtualNetworkGatewaysClient struct { 30 BaseClient 31} 32 33// NewVirtualNetworkGatewaysClient creates an instance of the VirtualNetworkGatewaysClient client. 34func NewVirtualNetworkGatewaysClient(subscriptionID string) VirtualNetworkGatewaysClient { 35 return NewVirtualNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) 36} 37 38// NewVirtualNetworkGatewaysClientWithBaseURI creates an instance of the VirtualNetworkGatewaysClient client using a 39// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, 40// Azure stack). 41func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewaysClient { 42 return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} 43} 44 45// CreateOrUpdate creates or updates a virtual network gateway in the specified resource group. 46// Parameters: 47// resourceGroupName - the name of the resource group. 48// virtualNetworkGatewayName - the name of the virtual network gateway. 49// parameters - parameters supplied to create or update virtual network gateway operation. 50func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysCreateOrUpdateFuture, err error) { 51 if tracing.IsEnabled() { 52 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.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, virtualNetworkGatewayName, parameters) 62 if err != nil { 63 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "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.VirtualNetworkGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") 70 return 71 } 72 73 return 74} 75 76// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 77func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) { 78 pathParameters := map[string]interface{}{ 79 "resourceGroupName": autorest.Encode("path", resourceGroupName), 80 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 81 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 82 } 83 84 const APIVersion = "2015-06-15" 85 queryParameters := map[string]interface{}{ 86 "api-version": APIVersion, 87 } 88 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/virtualNetworkGateways/{virtualNetworkGatewayName}", 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 VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewaysCreateOrUpdateFuture, 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 VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGateway, 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 virtual network gateway. 125// Parameters: 126// resourceGroupName - the name of the resource group. 127// virtualNetworkGatewayName - the name of the virtual network gateway. 128func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysDeleteFuture, err error) { 129 if tracing.IsEnabled() { 130 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.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, virtualNetworkGatewayName) 140 if err != nil { 141 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "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.VirtualNetworkGatewaysClient", "Delete", result.Response(), "Failure sending request") 148 return 149 } 150 151 return 152} 153 154// DeletePreparer prepares the Delete request. 155func (client VirtualNetworkGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { 156 pathParameters := map[string]interface{}{ 157 "resourceGroupName": autorest.Encode("path", resourceGroupName), 158 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 159 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 160 } 161 162 const APIVersion = "2015-06-15" 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/virtualNetworkGateways/{virtualNetworkGatewayName}", 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 VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewaysDeleteFuture, 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 VirtualNetworkGatewaysClient) 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// Generatevpnclientpackage generates VPN client package for P2S client of the virtual network gateway in the specified 200// resource group. 201// Parameters: 202// resourceGroupName - the name of the resource group. 203// virtualNetworkGatewayName - the name of the virtual network gateway. 204// parameters - parameters supplied to the generate virtual network gateway VPN client package operation. 205func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) { 206 if tracing.IsEnabled() { 207 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Generatevpnclientpackage") 208 defer func() { 209 sc := -1 210 if result.Response() != nil { 211 sc = result.Response().StatusCode 212 } 213 tracing.EndSpan(ctx, sc, err) 214 }() 215 } 216 req, err := client.GeneratevpnclientpackagePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) 217 if err != nil { 218 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure preparing request") 219 return 220 } 221 222 result, err = client.GeneratevpnclientpackageSender(req) 223 if err != nil { 224 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", result.Response(), "Failure sending request") 225 return 226 } 227 228 return 229} 230 231// GeneratevpnclientpackagePreparer prepares the Generatevpnclientpackage request. 232func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) { 233 pathParameters := map[string]interface{}{ 234 "resourceGroupName": autorest.Encode("path", resourceGroupName), 235 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 236 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 237 } 238 239 const APIVersion = "2015-06-15" 240 queryParameters := map[string]interface{}{ 241 "api-version": APIVersion, 242 } 243 244 preparer := autorest.CreatePreparer( 245 autorest.AsContentType("application/json; charset=utf-8"), 246 autorest.AsPost(), 247 autorest.WithBaseURL(client.BaseURI), 248 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters), 249 autorest.WithJSON(parameters), 250 autorest.WithQueryParameters(queryParameters)) 251 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 252} 253 254// GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the 255// http.Response Body if it receives an error. 256func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *http.Request) (future VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) { 257 var resp *http.Response 258 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 259 if err != nil { 260 return 261 } 262 future.Future, err = azure.NewFutureFromResponse(resp) 263 return 264} 265 266// GeneratevpnclientpackageResponder handles the response to the Generatevpnclientpackage request. The method always 267// closes the http.Response Body. 268func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) { 269 err = autorest.Respond( 270 resp, 271 client.ByInspecting(), 272 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 273 autorest.ByUnmarshallingJSON(&result), 274 autorest.ByClosing()) 275 result.Response = autorest.Response{Response: resp} 276 return 277} 278 279// Get gets the specified virtual network gateway by resource group. 280// Parameters: 281// resourceGroupName - the name of the resource group. 282// virtualNetworkGatewayName - the name of the virtual network gateway. 283func (client VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) { 284 if tracing.IsEnabled() { 285 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Get") 286 defer func() { 287 sc := -1 288 if result.Response.Response != nil { 289 sc = result.Response.Response.StatusCode 290 } 291 tracing.EndSpan(ctx, sc, err) 292 }() 293 } 294 req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) 295 if err != nil { 296 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", nil, "Failure preparing request") 297 return 298 } 299 300 resp, err := client.GetSender(req) 301 if err != nil { 302 result.Response = autorest.Response{Response: resp} 303 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure sending request") 304 return 305 } 306 307 result, err = client.GetResponder(resp) 308 if err != nil { 309 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure responding to request") 310 } 311 312 return 313} 314 315// GetPreparer prepares the Get request. 316func (client VirtualNetworkGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { 317 pathParameters := map[string]interface{}{ 318 "resourceGroupName": autorest.Encode("path", resourceGroupName), 319 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 320 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 321 } 322 323 const APIVersion = "2015-06-15" 324 queryParameters := map[string]interface{}{ 325 "api-version": APIVersion, 326 } 327 328 preparer := autorest.CreatePreparer( 329 autorest.AsGet(), 330 autorest.WithBaseURL(client.BaseURI), 331 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), 332 autorest.WithQueryParameters(queryParameters)) 333 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 334} 335 336// GetSender sends the Get request. The method will close the 337// http.Response Body if it receives an error. 338func (client VirtualNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { 339 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 340} 341 342// GetResponder handles the response to the Get request. The method always 343// closes the http.Response Body. 344func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { 345 err = autorest.Respond( 346 resp, 347 client.ByInspecting(), 348 azure.WithErrorUnlessStatusCode(http.StatusOK), 349 autorest.ByUnmarshallingJSON(&result), 350 autorest.ByClosing()) 351 result.Response = autorest.Response{Response: resp} 352 return 353} 354 355// List gets all virtual network gateways by resource group. 356// Parameters: 357// resourceGroupName - the name of the resource group. 358func (client VirtualNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultPage, err error) { 359 if tracing.IsEnabled() { 360 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List") 361 defer func() { 362 sc := -1 363 if result.vnglr.Response.Response != nil { 364 sc = result.vnglr.Response.Response.StatusCode 365 } 366 tracing.EndSpan(ctx, sc, err) 367 }() 368 } 369 result.fn = client.listNextResults 370 req, err := client.ListPreparer(ctx, resourceGroupName) 371 if err != nil { 372 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing request") 373 return 374 } 375 376 resp, err := client.ListSender(req) 377 if err != nil { 378 result.vnglr.Response = autorest.Response{Response: resp} 379 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending request") 380 return 381 } 382 383 result.vnglr, err = client.ListResponder(resp) 384 if err != nil { 385 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to request") 386 } 387 388 return 389} 390 391// ListPreparer prepares the List request. 392func (client VirtualNetworkGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { 393 pathParameters := map[string]interface{}{ 394 "resourceGroupName": autorest.Encode("path", resourceGroupName), 395 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 396 } 397 398 const APIVersion = "2015-06-15" 399 queryParameters := map[string]interface{}{ 400 "api-version": APIVersion, 401 } 402 403 preparer := autorest.CreatePreparer( 404 autorest.AsGet(), 405 autorest.WithBaseURL(client.BaseURI), 406 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", pathParameters), 407 autorest.WithQueryParameters(queryParameters)) 408 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 409} 410 411// ListSender sends the List request. The method will close the 412// http.Response Body if it receives an error. 413func (client VirtualNetworkGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { 414 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 415} 416 417// ListResponder handles the response to the List request. The method always 418// closes the http.Response Body. 419func (client VirtualNetworkGatewaysClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayListResult, err error) { 420 err = autorest.Respond( 421 resp, 422 client.ByInspecting(), 423 azure.WithErrorUnlessStatusCode(http.StatusOK), 424 autorest.ByUnmarshallingJSON(&result), 425 autorest.ByClosing()) 426 result.Response = autorest.Response{Response: resp} 427 return 428} 429 430// listNextResults retrieves the next set of results, if any. 431func (client VirtualNetworkGatewaysClient) listNextResults(ctx context.Context, lastResults VirtualNetworkGatewayListResult) (result VirtualNetworkGatewayListResult, err error) { 432 req, err := lastResults.virtualNetworkGatewayListResultPreparer(ctx) 433 if err != nil { 434 return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", nil, "Failure preparing next results request") 435 } 436 if req == nil { 437 return 438 } 439 resp, err := client.ListSender(req) 440 if err != nil { 441 result.Response = autorest.Response{Response: resp} 442 return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure sending next results request") 443 } 444 result, err = client.ListResponder(resp) 445 if err != nil { 446 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure responding to next results request") 447 } 448 return 449} 450 451// ListComplete enumerates all values, automatically crossing page boundaries as required. 452func (client VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultIterator, err error) { 453 if tracing.IsEnabled() { 454 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List") 455 defer func() { 456 sc := -1 457 if result.Response().Response.Response != nil { 458 sc = result.page.Response().Response.Response.StatusCode 459 } 460 tracing.EndSpan(ctx, sc, err) 461 }() 462 } 463 result.page, err = client.List(ctx, resourceGroupName) 464 return 465} 466 467// Reset resets the primary of the virtual network gateway in the specified resource group. 468// Parameters: 469// resourceGroupName - the name of the resource group. 470// virtualNetworkGatewayName - the name of the virtual network gateway. 471// parameters - virtual network gateway vip address supplied to the begin reset of the active-active feature 472// enabled gateway. 473func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysResetFuture, err error) { 474 if tracing.IsEnabled() { 475 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Reset") 476 defer func() { 477 sc := -1 478 if result.Response() != nil { 479 sc = result.Response().StatusCode 480 } 481 tracing.EndSpan(ctx, sc, err) 482 }() 483 } 484 req, err := client.ResetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) 485 if err != nil { 486 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request") 487 return 488 } 489 490 result, err = client.ResetSender(req) 491 if err != nil { 492 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", result.Response(), "Failure sending request") 493 return 494 } 495 496 return 497} 498 499// ResetPreparer prepares the Reset request. 500func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) { 501 pathParameters := map[string]interface{}{ 502 "resourceGroupName": autorest.Encode("path", resourceGroupName), 503 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 504 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 505 } 506 507 const APIVersion = "2015-06-15" 508 queryParameters := map[string]interface{}{ 509 "api-version": APIVersion, 510 } 511 512 preparer := autorest.CreatePreparer( 513 autorest.AsContentType("application/json; charset=utf-8"), 514 autorest.AsPost(), 515 autorest.WithBaseURL(client.BaseURI), 516 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters), 517 autorest.WithJSON(parameters), 518 autorest.WithQueryParameters(queryParameters)) 519 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 520} 521 522// ResetSender sends the Reset request. The method will close the 523// http.Response Body if it receives an error. 524func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (future VirtualNetworkGatewaysResetFuture, err error) { 525 var resp *http.Response 526 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 527 if err != nil { 528 return 529 } 530 future.Future, err = azure.NewFutureFromResponse(resp) 531 return 532} 533 534// ResetResponder handles the response to the Reset request. The method always 535// closes the http.Response Body. 536func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { 537 err = autorest.Respond( 538 resp, 539 client.ByInspecting(), 540 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 541 autorest.ByUnmarshallingJSON(&result), 542 autorest.ByClosing()) 543 result.Response = autorest.Response{Response: resp} 544 return 545} 546