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 creates or updates a virtual network gateway in the specified resource group.
35// Parameters:
36// resourceGroupName - the name of the resource group.
37// virtualNetworkGatewayName - the name of the virtual network gateway.
38// parameters - parameters supplied to create or update virtual network gateway operation.
39func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysCreateOrUpdateFuture, err error) {
40	if tracing.IsEnabled() {
41		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.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, virtualNetworkGatewayName, parameters)
51	if err != nil {
52		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "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.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure sending request")
59		return
60	}
61
62	return
63}
64
65// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
66func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) {
67	pathParameters := map[string]interface{}{
68		"resourceGroupName":         autorest.Encode("path", resourceGroupName),
69		"subscriptionId":            autorest.Encode("path", client.SubscriptionID),
70		"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
71	}
72
73	const APIVersion = "2015-06-15"
74	queryParameters := map[string]interface{}{
75		"api-version": APIVersion,
76	}
77
78	preparer := autorest.CreatePreparer(
79		autorest.AsContentType("application/json; charset=utf-8"),
80		autorest.AsPut(),
81		autorest.WithBaseURL(client.BaseURI),
82		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
83		autorest.WithJSON(parameters),
84		autorest.WithQueryParameters(queryParameters))
85	return preparer.Prepare((&http.Request{}).WithContext(ctx))
86}
87
88// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
89// http.Response Body if it receives an error.
90func (client VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewaysCreateOrUpdateFuture, err error) {
91	var resp *http.Response
92	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
93	if err != nil {
94		return
95	}
96	var azf azure.Future
97	azf, err = azure.NewFutureFromResponse(resp)
98	future.FutureAPI = &azf
99	future.Result = future.result
100	return
101}
102
103// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
104// closes the http.Response Body.
105func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGateway, err error) {
106	err = autorest.Respond(
107		resp,
108		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
109		autorest.ByUnmarshallingJSON(&result),
110		autorest.ByClosing())
111	result.Response = autorest.Response{Response: resp}
112	return
113}
114
115// Delete deletes the specified virtual network gateway.
116// Parameters:
117// resourceGroupName - the name of the resource group.
118// virtualNetworkGatewayName - the name of the virtual network gateway.
119func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysDeleteFuture, err error) {
120	if tracing.IsEnabled() {
121		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Delete")
122		defer func() {
123			sc := -1
124			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
125				sc = result.FutureAPI.Response().StatusCode
126			}
127			tracing.EndSpan(ctx, sc, err)
128		}()
129	}
130	req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayName)
131	if err != nil {
132		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", nil, "Failure preparing request")
133		return
134	}
135
136	result, err = client.DeleteSender(req)
137	if err != nil {
138		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", nil, "Failure sending request")
139		return
140	}
141
142	return
143}
144
145// DeletePreparer prepares the Delete request.
146func (client VirtualNetworkGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) {
147	pathParameters := map[string]interface{}{
148		"resourceGroupName":         autorest.Encode("path", resourceGroupName),
149		"subscriptionId":            autorest.Encode("path", client.SubscriptionID),
150		"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
151	}
152
153	const APIVersion = "2015-06-15"
154	queryParameters := map[string]interface{}{
155		"api-version": APIVersion,
156	}
157
158	preparer := autorest.CreatePreparer(
159		autorest.AsDelete(),
160		autorest.WithBaseURL(client.BaseURI),
161		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
162		autorest.WithQueryParameters(queryParameters))
163	return preparer.Prepare((&http.Request{}).WithContext(ctx))
164}
165
166// DeleteSender sends the Delete request. The method will close the
167// http.Response Body if it receives an error.
168func (client VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewaysDeleteFuture, err error) {
169	var resp *http.Response
170	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
171	if err != nil {
172		return
173	}
174	var azf azure.Future
175	azf, err = azure.NewFutureFromResponse(resp)
176	future.FutureAPI = &azf
177	future.Result = future.result
178	return
179}
180
181// DeleteResponder handles the response to the Delete request. The method always
182// closes the http.Response Body.
183func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
184	err = autorest.Respond(
185		resp,
186		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
187		autorest.ByClosing())
188	result.Response = resp
189	return
190}
191
192// Generatevpnclientpackage generates VPN client package for P2S client of the virtual network gateway in the specified
193// resource group.
194// Parameters:
195// resourceGroupName - the name of the resource group.
196// virtualNetworkGatewayName - the name of the virtual network gateway.
197// parameters - parameters supplied to the generate virtual network gateway VPN client package operation.
198func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) {
199	if tracing.IsEnabled() {
200		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Generatevpnclientpackage")
201		defer func() {
202			sc := -1
203			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
204				sc = result.FutureAPI.Response().StatusCode
205			}
206			tracing.EndSpan(ctx, sc, err)
207		}()
208	}
209	req, err := client.GeneratevpnclientpackagePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters)
210	if err != nil {
211		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure preparing request")
212		return
213	}
214
215	result, err = client.GeneratevpnclientpackageSender(req)
216	if err != nil {
217		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure sending request")
218		return
219	}
220
221	return
222}
223
224// GeneratevpnclientpackagePreparer prepares the Generatevpnclientpackage request.
225func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) {
226	pathParameters := map[string]interface{}{
227		"resourceGroupName":         autorest.Encode("path", resourceGroupName),
228		"subscriptionId":            autorest.Encode("path", client.SubscriptionID),
229		"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
230	}
231
232	const APIVersion = "2015-06-15"
233	queryParameters := map[string]interface{}{
234		"api-version": APIVersion,
235	}
236
237	preparer := autorest.CreatePreparer(
238		autorest.AsContentType("application/json; charset=utf-8"),
239		autorest.AsPost(),
240		autorest.WithBaseURL(client.BaseURI),
241		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters),
242		autorest.WithJSON(parameters),
243		autorest.WithQueryParameters(queryParameters))
244	return preparer.Prepare((&http.Request{}).WithContext(ctx))
245}
246
247// GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the
248// http.Response Body if it receives an error.
249func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *http.Request) (future VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) {
250	var resp *http.Response
251	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
252	if err != nil {
253		return
254	}
255	var azf azure.Future
256	azf, err = azure.NewFutureFromResponse(resp)
257	future.FutureAPI = &azf
258	future.Result = future.result
259	return
260}
261
262// GeneratevpnclientpackageResponder handles the response to the Generatevpnclientpackage request. The method always
263// closes the http.Response Body.
264func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) {
265	err = autorest.Respond(
266		resp,
267		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
268		autorest.ByUnmarshallingJSON(&result),
269		autorest.ByClosing())
270	result.Response = autorest.Response{Response: resp}
271	return
272}
273
274// Get gets the specified virtual network gateway by resource group.
275// Parameters:
276// resourceGroupName - the name of the resource group.
277// virtualNetworkGatewayName - the name of the virtual network gateway.
278func (client VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) {
279	if tracing.IsEnabled() {
280		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Get")
281		defer func() {
282			sc := -1
283			if result.Response.Response != nil {
284				sc = result.Response.Response.StatusCode
285			}
286			tracing.EndSpan(ctx, sc, err)
287		}()
288	}
289	req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName)
290	if err != nil {
291		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", nil, "Failure preparing request")
292		return
293	}
294
295	resp, err := client.GetSender(req)
296	if err != nil {
297		result.Response = autorest.Response{Response: resp}
298		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure sending request")
299		return
300	}
301
302	result, err = client.GetResponder(resp)
303	if err != nil {
304		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure responding to request")
305		return
306	}
307
308	return
309}
310
311// GetPreparer prepares the Get request.
312func (client VirtualNetworkGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) {
313	pathParameters := map[string]interface{}{
314		"resourceGroupName":         autorest.Encode("path", resourceGroupName),
315		"subscriptionId":            autorest.Encode("path", client.SubscriptionID),
316		"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
317	}
318
319	const APIVersion = "2015-06-15"
320	queryParameters := map[string]interface{}{
321		"api-version": APIVersion,
322	}
323
324	preparer := autorest.CreatePreparer(
325		autorest.AsGet(),
326		autorest.WithBaseURL(client.BaseURI),
327		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
328		autorest.WithQueryParameters(queryParameters))
329	return preparer.Prepare((&http.Request{}).WithContext(ctx))
330}
331
332// GetSender sends the Get request. The method will close the
333// http.Response Body if it receives an error.
334func (client VirtualNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) {
335	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
336}
337
338// GetResponder handles the response to the Get request. The method always
339// closes the http.Response Body.
340func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) {
341	err = autorest.Respond(
342		resp,
343		azure.WithErrorUnlessStatusCode(http.StatusOK),
344		autorest.ByUnmarshallingJSON(&result),
345		autorest.ByClosing())
346	result.Response = autorest.Response{Response: resp}
347	return
348}
349
350// List gets all virtual network gateways by resource group.
351// Parameters:
352// resourceGroupName - the name of the resource group.
353func (client VirtualNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultPage, err error) {
354	if tracing.IsEnabled() {
355		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List")
356		defer func() {
357			sc := -1
358			if result.vnglr.Response.Response != nil {
359				sc = result.vnglr.Response.Response.StatusCode
360			}
361			tracing.EndSpan(ctx, sc, err)
362		}()
363	}
364	result.fn = client.listNextResults
365	req, err := client.ListPreparer(ctx, resourceGroupName)
366	if err != nil {
367		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing request")
368		return
369	}
370
371	resp, err := client.ListSender(req)
372	if err != nil {
373		result.vnglr.Response = autorest.Response{Response: resp}
374		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending request")
375		return
376	}
377
378	result.vnglr, err = client.ListResponder(resp)
379	if err != nil {
380		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to request")
381		return
382	}
383	if result.vnglr.hasNextLink() && result.vnglr.IsEmpty() {
384		err = result.NextWithContext(ctx)
385		return
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		azure.WithErrorUnlessStatusCode(http.StatusOK),
423		autorest.ByUnmarshallingJSON(&result),
424		autorest.ByClosing())
425	result.Response = autorest.Response{Response: resp}
426	return
427}
428
429// listNextResults retrieves the next set of results, if any.
430func (client VirtualNetworkGatewaysClient) listNextResults(ctx context.Context, lastResults VirtualNetworkGatewayListResult) (result VirtualNetworkGatewayListResult, err error) {
431	req, err := lastResults.virtualNetworkGatewayListResultPreparer(ctx)
432	if err != nil {
433		return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", nil, "Failure preparing next results request")
434	}
435	if req == nil {
436		return
437	}
438	resp, err := client.ListSender(req)
439	if err != nil {
440		result.Response = autorest.Response{Response: resp}
441		return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure sending next results request")
442	}
443	result, err = client.ListResponder(resp)
444	if err != nil {
445		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure responding to next results request")
446	}
447	return
448}
449
450// ListComplete enumerates all values, automatically crossing page boundaries as required.
451func (client VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultIterator, err error) {
452	if tracing.IsEnabled() {
453		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List")
454		defer func() {
455			sc := -1
456			if result.Response().Response.Response != nil {
457				sc = result.page.Response().Response.Response.StatusCode
458			}
459			tracing.EndSpan(ctx, sc, err)
460		}()
461	}
462	result.page, err = client.List(ctx, resourceGroupName)
463	return
464}
465
466// Reset resets the primary of the virtual network gateway in the specified resource group.
467// Parameters:
468// resourceGroupName - the name of the resource group.
469// virtualNetworkGatewayName - the name of the virtual network gateway.
470// parameters - virtual network gateway vip address supplied to the begin reset of the active-active feature
471// enabled gateway.
472func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysResetFuture, err error) {
473	if tracing.IsEnabled() {
474		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Reset")
475		defer func() {
476			sc := -1
477			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
478				sc = result.FutureAPI.Response().StatusCode
479			}
480			tracing.EndSpan(ctx, sc, err)
481		}()
482	}
483	req, err := client.ResetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters)
484	if err != nil {
485		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request")
486		return
487	}
488
489	result, err = client.ResetSender(req)
490	if err != nil {
491		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure sending request")
492		return
493	}
494
495	return
496}
497
498// ResetPreparer prepares the Reset request.
499func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) {
500	pathParameters := map[string]interface{}{
501		"resourceGroupName":         autorest.Encode("path", resourceGroupName),
502		"subscriptionId":            autorest.Encode("path", client.SubscriptionID),
503		"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
504	}
505
506	const APIVersion = "2015-06-15"
507	queryParameters := map[string]interface{}{
508		"api-version": APIVersion,
509	}
510
511	preparer := autorest.CreatePreparer(
512		autorest.AsContentType("application/json; charset=utf-8"),
513		autorest.AsPost(),
514		autorest.WithBaseURL(client.BaseURI),
515		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters),
516		autorest.WithJSON(parameters),
517		autorest.WithQueryParameters(queryParameters))
518	return preparer.Prepare((&http.Request{}).WithContext(ctx))
519}
520
521// ResetSender sends the Reset request. The method will close the
522// http.Response Body if it receives an error.
523func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (future VirtualNetworkGatewaysResetFuture, err error) {
524	var resp *http.Response
525	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
526	if err != nil {
527		return
528	}
529	var azf azure.Future
530	azf, err = azure.NewFutureFromResponse(resp)
531	future.FutureAPI = &azf
532	future.Result = future.result
533	return
534}
535
536// ResetResponder handles the response to the Reset request. The method always
537// closes the http.Response Body.
538func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) {
539	err = autorest.Respond(
540		resp,
541		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
542		autorest.ByUnmarshallingJSON(&result),
543		autorest.ByClosing())
544	result.Response = autorest.Response{Response: resp}
545	return
546}
547