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// VirtualNetworkGatewaysClient is the network Client 18type VirtualNetworkGatewaysClient struct { 19 BaseClient 20} 21 22// NewVirtualNetworkGatewaysClient creates an instance of the VirtualNetworkGatewaysClient client. 23func NewVirtualNetworkGatewaysClient(subscriptionID string) VirtualNetworkGatewaysClient { 24 return NewVirtualNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) 25} 26 27// NewVirtualNetworkGatewaysClientWithBaseURI creates an instance of the VirtualNetworkGatewaysClient client using a 28// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, 29// Azure stack). 30func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewaysClient { 31 return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} 32} 33 34// CreateOrUpdate the Put VirtualNetworkGateway operation creates/updates a virtual network gateway in the specified 35// resource group through Network resource provider. 36// Parameters: 37// resourceGroupName - the name of the resource group. 38// virtualNetworkGatewayName - the name of the virtual network gateway. 39// parameters - parameters supplied to the Begin Create or update Virtual Network Gateway operation through 40// Network resource provider. 41func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysCreateOrUpdateFuture, err error) { 42 if tracing.IsEnabled() { 43 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.CreateOrUpdate") 44 defer func() { 45 sc := -1 46 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 47 sc = result.FutureAPI.Response().StatusCode 48 } 49 tracing.EndSpan(ctx, sc, err) 50 }() 51 } 52 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) 53 if err != nil { 54 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") 55 return 56 } 57 58 result, err = client.CreateOrUpdateSender(req) 59 if err != nil { 60 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") 61 return 62 } 63 64 return 65} 66 67// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 68func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) { 69 pathParameters := map[string]interface{}{ 70 "resourceGroupName": autorest.Encode("path", resourceGroupName), 71 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 72 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 73 } 74 75 const APIVersion = "2016-06-01" 76 queryParameters := map[string]interface{}{ 77 "api-version": APIVersion, 78 } 79 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/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), 85 autorest.WithJSON(parameters), 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 VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewaysCreateOrUpdateFuture, 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 VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGateway, 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 the Delete VirtualNetworkGateway operation deletes the specified virtual network Gateway through Network 118// resource provider. 119// Parameters: 120// resourceGroupName - the name of the resource group. 121// virtualNetworkGatewayName - the name of the virtual network gateway. 122func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysDeleteFuture, err error) { 123 if tracing.IsEnabled() { 124 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.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, virtualNetworkGatewayName) 134 if err != nil { 135 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "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.VirtualNetworkGatewaysClient", "Delete", nil, "Failure sending request") 142 return 143 } 144 145 return 146} 147 148// DeletePreparer prepares the Delete request. 149func (client VirtualNetworkGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { 150 pathParameters := map[string]interface{}{ 151 "resourceGroupName": autorest.Encode("path", resourceGroupName), 152 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 153 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 154 } 155 156 const APIVersion = "2016-06-01" 157 queryParameters := map[string]interface{}{ 158 "api-version": APIVersion, 159 } 160 161 preparer := autorest.CreatePreparer( 162 autorest.AsDelete(), 163 autorest.WithBaseURL(client.BaseURI), 164 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), 165 autorest.WithQueryParameters(queryParameters)) 166 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 167} 168 169// DeleteSender sends the Delete request. The method will close the 170// http.Response Body if it receives an error. 171func (client VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewaysDeleteFuture, err error) { 172 var resp *http.Response 173 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 174 if err != nil { 175 return 176 } 177 var azf azure.Future 178 azf, err = azure.NewFutureFromResponse(resp) 179 future.FutureAPI = &azf 180 future.Result = future.result 181 return 182} 183 184// DeleteResponder handles the response to the Delete request. The method always 185// closes the http.Response Body. 186func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 187 err = autorest.Respond( 188 resp, 189 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 190 autorest.ByClosing()) 191 result.Response = resp 192 return 193} 194 195// Generatevpnclientpackage the Generatevpnclientpackage operation generates Vpn client package for P2S client of the 196// virtual network gateway in the specified resource group through Network resource provider. 197// Parameters: 198// resourceGroupName - the name of the resource group. 199// virtualNetworkGatewayName - the name of the virtual network gateway. 200// parameters - parameters supplied to the Begin Generating Virtual Network Gateway Vpn client package 201// operation through Network resource provider. 202func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result String, err error) { 203 if tracing.IsEnabled() { 204 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Generatevpnclientpackage") 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.GeneratevpnclientpackagePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) 214 if err != nil { 215 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure preparing request") 216 return 217 } 218 219 resp, err := client.GeneratevpnclientpackageSender(req) 220 if err != nil { 221 result.Response = autorest.Response{Response: resp} 222 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", resp, "Failure sending request") 223 return 224 } 225 226 result, err = client.GeneratevpnclientpackageResponder(resp) 227 if err != nil { 228 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", resp, "Failure responding to request") 229 return 230 } 231 232 return 233} 234 235// GeneratevpnclientpackagePreparer prepares the Generatevpnclientpackage request. 236func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) { 237 pathParameters := map[string]interface{}{ 238 "resourceGroupName": autorest.Encode("path", resourceGroupName), 239 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 240 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 241 } 242 243 const APIVersion = "2016-06-01" 244 queryParameters := map[string]interface{}{ 245 "api-version": APIVersion, 246 } 247 248 preparer := autorest.CreatePreparer( 249 autorest.AsContentType("application/json; charset=utf-8"), 250 autorest.AsPost(), 251 autorest.WithBaseURL(client.BaseURI), 252 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters), 253 autorest.WithJSON(parameters), 254 autorest.WithQueryParameters(queryParameters)) 255 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 256} 257 258// GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the 259// http.Response Body if it receives an error. 260func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *http.Request) (*http.Response, error) { 261 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 262} 263 264// GeneratevpnclientpackageResponder handles the response to the Generatevpnclientpackage request. The method always 265// closes the http.Response Body. 266func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) { 267 err = autorest.Respond( 268 resp, 269 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 270 autorest.ByUnmarshallingJSON(&result.Value), 271 autorest.ByClosing()) 272 result.Response = autorest.Response{Response: resp} 273 return 274} 275 276// Get the Get VirtualNetworkGateway operation retrieves information about the specified virtual network gateway 277// through Network resource provider. 278// Parameters: 279// resourceGroupName - the name of the resource group. 280// virtualNetworkGatewayName - the name of the virtual network gateway. 281func (client VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) { 282 if tracing.IsEnabled() { 283 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Get") 284 defer func() { 285 sc := -1 286 if result.Response.Response != nil { 287 sc = result.Response.Response.StatusCode 288 } 289 tracing.EndSpan(ctx, sc, err) 290 }() 291 } 292 req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) 293 if err != nil { 294 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", nil, "Failure preparing request") 295 return 296 } 297 298 resp, err := client.GetSender(req) 299 if err != nil { 300 result.Response = autorest.Response{Response: resp} 301 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure sending request") 302 return 303 } 304 305 result, err = client.GetResponder(resp) 306 if err != nil { 307 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure responding to request") 308 return 309 } 310 311 return 312} 313 314// GetPreparer prepares the Get request. 315func (client VirtualNetworkGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { 316 pathParameters := map[string]interface{}{ 317 "resourceGroupName": autorest.Encode("path", resourceGroupName), 318 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 319 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 320 } 321 322 const APIVersion = "2016-06-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/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), 331 autorest.WithQueryParameters(queryParameters)) 332 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 333} 334 335// GetSender sends the Get request. The method will close the 336// http.Response Body if it receives an error. 337func (client VirtualNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { 338 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 339} 340 341// GetResponder handles the response to the Get request. The method always 342// closes the http.Response Body. 343func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { 344 err = autorest.Respond( 345 resp, 346 azure.WithErrorUnlessStatusCode(http.StatusOK), 347 autorest.ByUnmarshallingJSON(&result), 348 autorest.ByClosing()) 349 result.Response = autorest.Response{Response: resp} 350 return 351} 352 353// List the List VirtualNetworkGateways operation retrieves all the virtual network gateways stored. 354// Parameters: 355// resourceGroupName - the name of the resource group. 356func (client VirtualNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultPage, err error) { 357 if tracing.IsEnabled() { 358 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List") 359 defer func() { 360 sc := -1 361 if result.vnglr.Response.Response != nil { 362 sc = result.vnglr.Response.Response.StatusCode 363 } 364 tracing.EndSpan(ctx, sc, err) 365 }() 366 } 367 result.fn = client.listNextResults 368 req, err := client.ListPreparer(ctx, resourceGroupName) 369 if err != nil { 370 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing request") 371 return 372 } 373 374 resp, err := client.ListSender(req) 375 if err != nil { 376 result.vnglr.Response = autorest.Response{Response: resp} 377 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending request") 378 return 379 } 380 381 result.vnglr, err = client.ListResponder(resp) 382 if err != nil { 383 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to request") 384 return 385 } 386 if result.vnglr.hasNextLink() && result.vnglr.IsEmpty() { 387 err = result.NextWithContext(ctx) 388 return 389 } 390 391 return 392} 393 394// ListPreparer prepares the List request. 395func (client VirtualNetworkGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { 396 pathParameters := map[string]interface{}{ 397 "resourceGroupName": autorest.Encode("path", resourceGroupName), 398 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 399 } 400 401 const APIVersion = "2016-06-01" 402 queryParameters := map[string]interface{}{ 403 "api-version": APIVersion, 404 } 405 406 preparer := autorest.CreatePreparer( 407 autorest.AsGet(), 408 autorest.WithBaseURL(client.BaseURI), 409 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", pathParameters), 410 autorest.WithQueryParameters(queryParameters)) 411 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 412} 413 414// ListSender sends the List request. The method will close the 415// http.Response Body if it receives an error. 416func (client VirtualNetworkGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { 417 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 418} 419 420// ListResponder handles the response to the List request. The method always 421// closes the http.Response Body. 422func (client VirtualNetworkGatewaysClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayListResult, err error) { 423 err = autorest.Respond( 424 resp, 425 azure.WithErrorUnlessStatusCode(http.StatusOK), 426 autorest.ByUnmarshallingJSON(&result), 427 autorest.ByClosing()) 428 result.Response = autorest.Response{Response: resp} 429 return 430} 431 432// listNextResults retrieves the next set of results, if any. 433func (client VirtualNetworkGatewaysClient) listNextResults(ctx context.Context, lastResults VirtualNetworkGatewayListResult) (result VirtualNetworkGatewayListResult, err error) { 434 req, err := lastResults.virtualNetworkGatewayListResultPreparer(ctx) 435 if err != nil { 436 return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", nil, "Failure preparing next results request") 437 } 438 if req == nil { 439 return 440 } 441 resp, err := client.ListSender(req) 442 if err != nil { 443 result.Response = autorest.Response{Response: resp} 444 return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure sending next results request") 445 } 446 result, err = client.ListResponder(resp) 447 if err != nil { 448 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure responding to next results request") 449 } 450 return 451} 452 453// ListComplete enumerates all values, automatically crossing page boundaries as required. 454func (client VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultIterator, err error) { 455 if tracing.IsEnabled() { 456 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List") 457 defer func() { 458 sc := -1 459 if result.Response().Response.Response != nil { 460 sc = result.page.Response().Response.Response.StatusCode 461 } 462 tracing.EndSpan(ctx, sc, err) 463 }() 464 } 465 result.page, err = client.List(ctx, resourceGroupName) 466 return 467} 468 469// Reset the Reset VirtualNetworkGateway operation resets the primary of the virtual network gateway in the specified 470// resource group through Network resource provider. 471// Parameters: 472// resourceGroupName - the name of the resource group. 473// virtualNetworkGatewayName - the name of the virtual network gateway. 474// parameters - parameters supplied to the Begin Reset Virtual Network Gateway operation through Network 475// resource provider. 476func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysResetFuture, err error) { 477 if tracing.IsEnabled() { 478 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Reset") 479 defer func() { 480 sc := -1 481 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 482 sc = result.FutureAPI.Response().StatusCode 483 } 484 tracing.EndSpan(ctx, sc, err) 485 }() 486 } 487 req, err := client.ResetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) 488 if err != nil { 489 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request") 490 return 491 } 492 493 result, err = client.ResetSender(req) 494 if err != nil { 495 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure sending request") 496 return 497 } 498 499 return 500} 501 502// ResetPreparer prepares the Reset request. 503func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) { 504 pathParameters := map[string]interface{}{ 505 "resourceGroupName": autorest.Encode("path", resourceGroupName), 506 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 507 "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), 508 } 509 510 const APIVersion = "2016-06-01" 511 queryParameters := map[string]interface{}{ 512 "api-version": APIVersion, 513 } 514 515 preparer := autorest.CreatePreparer( 516 autorest.AsContentType("application/json; charset=utf-8"), 517 autorest.AsPost(), 518 autorest.WithBaseURL(client.BaseURI), 519 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters), 520 autorest.WithJSON(parameters), 521 autorest.WithQueryParameters(queryParameters)) 522 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 523} 524 525// ResetSender sends the Reset request. The method will close the 526// http.Response Body if it receives an error. 527func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (future VirtualNetworkGatewaysResetFuture, err error) { 528 var resp *http.Response 529 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 530 if err != nil { 531 return 532 } 533 var azf azure.Future 534 azf, err = azure.NewFutureFromResponse(resp) 535 future.FutureAPI = &azf 536 future.Result = future.result 537 return 538} 539 540// ResetResponder handles the response to the Reset request. The method always 541// closes the http.Response Body. 542func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { 543 err = autorest.Respond( 544 resp, 545 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 546 autorest.ByUnmarshallingJSON(&result), 547 autorest.ByClosing()) 548 result.Response = autorest.Response{Response: resp} 549 return 550} 551