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