// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

package fake

import (
	"context"
	"errors"
	"fmt"
	azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7"
	"net/http"
	"net/url"
	"reflect"
	"regexp"
	"strconv"
)

// VirtualNetworkGatewaysServer is a fake server for instances of the armnetwork.VirtualNetworkGatewaysClient type.
type VirtualNetworkGatewaysServer struct {
	// BeginCreateOrUpdate is the fake for method VirtualNetworkGatewaysClient.BeginCreateOrUpdate
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters armnetwork.VirtualNetworkGateway, options *armnetwork.VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)

	// BeginDelete is the fake for method VirtualNetworkGatewaysClient.BeginDelete
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDelete func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDeleteResponse], errResp azfake.ErrorResponder)

	// BeginDisconnectVirtualNetworkGatewayVPNConnections is the fake for method VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDisconnectVirtualNetworkGatewayVPNConnections func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request armnetwork.P2SVPNConnectionRequest, options *armnetwork.VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse], errResp azfake.ErrorResponder)

	// BeginGenerateVPNProfile is the fake for method VirtualNetworkGatewaysClient.BeginGenerateVPNProfile
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGenerateVPNProfile func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters armnetwork.VPNClientParameters, options *armnetwork.VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGenerateVPNProfileResponse], errResp azfake.ErrorResponder)

	// BeginGeneratevpnclientpackage is the fake for method VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGeneratevpnclientpackage func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters armnetwork.VPNClientParameters, options *armnetwork.VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse], errResp azfake.ErrorResponder)

	// Get is the fake for method VirtualNetworkGatewaysClient.Get
	// HTTP status codes to indicate success: http.StatusOK
	Get func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientGetOptions) (resp azfake.Responder[armnetwork.VirtualNetworkGatewaysClientGetResponse], errResp azfake.ErrorResponder)

	// BeginGetAdvertisedRoutes is the fake for method VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetAdvertisedRoutes func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse], errResp azfake.ErrorResponder)

	// BeginGetBgpPeerStatus is the fake for method VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetBgpPeerStatus func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetBgpPeerStatusResponse], errResp azfake.ErrorResponder)

	// BeginGetFailoverAllTestDetails is the fake for method VirtualNetworkGatewaysClient.BeginGetFailoverAllTestDetails
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetFailoverAllTestDetails func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, typeParam string, fetchLatest bool, options *armnetwork.VirtualNetworkGatewaysClientBeginGetFailoverAllTestDetailsOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse], errResp azfake.ErrorResponder)

	// BeginGetFailoverSingleTestDetails is the fake for method VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetFailoverSingleTestDetails func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, failoverTestID string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse], errResp azfake.ErrorResponder)

	// BeginGetLearnedRoutes is the fake for method VirtualNetworkGatewaysClient.BeginGetLearnedRoutes
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetLearnedRoutes func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetLearnedRoutesResponse], errResp azfake.ErrorResponder)

	// BeginGetResiliencyInformation is the fake for method VirtualNetworkGatewaysClient.BeginGetResiliencyInformation
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetResiliencyInformation func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetResiliencyInformationResponse], errResp azfake.ErrorResponder)

	// BeginGetRoutesInformation is the fake for method VirtualNetworkGatewaysClient.BeginGetRoutesInformation
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetRoutesInformation func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetRoutesInformationResponse], errResp azfake.ErrorResponder)

	// BeginGetVPNProfilePackageURL is the fake for method VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetVPNProfilePackageURL func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse], errResp azfake.ErrorResponder)

	// BeginGetVpnclientConnectionHealth is the fake for method VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginGetVpnclientConnectionHealth func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse], errResp azfake.ErrorResponder)

	// BeginGetVpnclientIPSecParameters is the fake for method VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters
	// HTTP status codes to indicate success: http.StatusOK
	BeginGetVpnclientIPSecParameters func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse], errResp azfake.ErrorResponder)

	// BeginInvokeAbortMigration is the fake for method VirtualNetworkGatewaysClient.BeginInvokeAbortMigration
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginInvokeAbortMigration func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeAbortMigrationResponse], errResp azfake.ErrorResponder)

	// BeginInvokeCommitMigration is the fake for method VirtualNetworkGatewaysClient.BeginInvokeCommitMigration
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginInvokeCommitMigration func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeCommitMigrationResponse], errResp azfake.ErrorResponder)

	// BeginInvokeExecuteMigration is the fake for method VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginInvokeExecuteMigration func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse], errResp azfake.ErrorResponder)

	// BeginInvokePrepareMigration is the fake for method VirtualNetworkGatewaysClient.BeginInvokePrepareMigration
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginInvokePrepareMigration func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, migrationParams armnetwork.VirtualNetworkGatewayMigrationParameters, options *armnetwork.VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokePrepareMigrationResponse], errResp azfake.ErrorResponder)

	// NewListPager is the fake for method VirtualNetworkGatewaysClient.NewListPager
	// HTTP status codes to indicate success: http.StatusOK
	NewListPager func(resourceGroupName string, options *armnetwork.VirtualNetworkGatewaysClientListOptions) (resp azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListResponse])

	// NewListConnectionsPager is the fake for method VirtualNetworkGatewaysClient.NewListConnectionsPager
	// HTTP status codes to indicate success: http.StatusOK
	NewListConnectionsPager func(resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientListConnectionsOptions) (resp azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListConnectionsResponse])

	// BeginReset is the fake for method VirtualNetworkGatewaysClient.BeginReset
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginReset func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginResetOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetResponse], errResp azfake.ErrorResponder)

	// BeginResetVPNClientSharedKey is the fake for method VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginResetVPNClientSharedKey func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse], errResp azfake.ErrorResponder)

	// BeginSetVpnclientIPSecParameters is the fake for method VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginSetVpnclientIPSecParameters func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams armnetwork.VPNClientIPsecParameters, options *armnetwork.VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse], errResp azfake.ErrorResponder)

	// BeginStartExpressRouteSiteFailoverSimulation is the fake for method VirtualNetworkGatewaysClient.BeginStartExpressRouteSiteFailoverSimulation
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginStartExpressRouteSiteFailoverSimulation func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, options *armnetwork.VirtualNetworkGatewaysClientBeginStartExpressRouteSiteFailoverSimulationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse], errResp azfake.ErrorResponder)

	// BeginStartPacketCapture is the fake for method VirtualNetworkGatewaysClient.BeginStartPacketCapture
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginStartPacketCapture func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStartPacketCaptureResponse], errResp azfake.ErrorResponder)

	// BeginStopExpressRouteSiteFailoverSimulation is the fake for method VirtualNetworkGatewaysClient.BeginStopExpressRouteSiteFailoverSimulation
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginStopExpressRouteSiteFailoverSimulation func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, stopParameters armnetwork.ExpressRouteFailoverStopAPIParameters, options *armnetwork.VirtualNetworkGatewaysClientBeginStopExpressRouteSiteFailoverSimulationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse], errResp azfake.ErrorResponder)

	// BeginStopPacketCapture is the fake for method VirtualNetworkGatewaysClient.BeginStopPacketCapture
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginStopPacketCapture func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters armnetwork.VPNPacketCaptureStopParameters, options *armnetwork.VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStopPacketCaptureResponse], errResp azfake.ErrorResponder)

	// SupportedVPNDevices is the fake for method VirtualNetworkGatewaysClient.SupportedVPNDevices
	// HTTP status codes to indicate success: http.StatusOK
	SupportedVPNDevices func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientSupportedVPNDevicesOptions) (resp azfake.Responder[armnetwork.VirtualNetworkGatewaysClientSupportedVPNDevicesResponse], errResp azfake.ErrorResponder)

	// BeginUpdateTags is the fake for method VirtualNetworkGatewaysClient.BeginUpdateTags
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginUpdateTags func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters armnetwork.TagsObject, options *armnetwork.VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientUpdateTagsResponse], errResp azfake.ErrorResponder)

	// VPNDeviceConfigurationScript is the fake for method VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript
	// HTTP status codes to indicate success: http.StatusOK
	VPNDeviceConfigurationScript func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters armnetwork.VPNDeviceScriptParameters, options *armnetwork.VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions) (resp azfake.Responder[armnetwork.VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse], errResp azfake.ErrorResponder)
}

// NewVirtualNetworkGatewaysServerTransport creates a new instance of VirtualNetworkGatewaysServerTransport with the provided implementation.
// The returned VirtualNetworkGatewaysServerTransport instance is connected to an instance of armnetwork.VirtualNetworkGatewaysClient via the
// azcore.ClientOptions.Transporter field in the client's constructor parameters.
func NewVirtualNetworkGatewaysServerTransport(srv *VirtualNetworkGatewaysServer) *VirtualNetworkGatewaysServerTransport {
	return &VirtualNetworkGatewaysServerTransport{
		srv:                 srv,
		beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientCreateOrUpdateResponse]](),
		beginDelete:         newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDeleteResponse]](),
		beginDisconnectVirtualNetworkGatewayVPNConnections: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse]](),
		beginGenerateVPNProfile:                            newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGenerateVPNProfileResponse]](),
		beginGeneratevpnclientpackage:                      newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse]](),
		beginGetAdvertisedRoutes:                           newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse]](),
		beginGetBgpPeerStatus:                              newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetBgpPeerStatusResponse]](),
		beginGetFailoverAllTestDetails:                     newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse]](),
		beginGetFailoverSingleTestDetails:                  newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse]](),
		beginGetLearnedRoutes:                              newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetLearnedRoutesResponse]](),
		beginGetResiliencyInformation:                      newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetResiliencyInformationResponse]](),
		beginGetRoutesInformation:                          newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetRoutesInformationResponse]](),
		beginGetVPNProfilePackageURL:                       newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse]](),
		beginGetVpnclientConnectionHealth:                  newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse]](),
		beginGetVpnclientIPSecParameters:                   newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse]](),
		beginInvokeAbortMigration:                          newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeAbortMigrationResponse]](),
		beginInvokeCommitMigration:                         newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeCommitMigrationResponse]](),
		beginInvokeExecuteMigration:                        newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse]](),
		beginInvokePrepareMigration:                        newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokePrepareMigrationResponse]](),
		newListPager:                                       newTracker[azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListResponse]](),
		newListConnectionsPager:                            newTracker[azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListConnectionsResponse]](),
		beginReset:                                         newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetResponse]](),
		beginResetVPNClientSharedKey:                       newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse]](),
		beginSetVpnclientIPSecParameters:                   newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse]](),
		beginStartExpressRouteSiteFailoverSimulation:       newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse]](),
		beginStartPacketCapture:                            newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStartPacketCaptureResponse]](),
		beginStopExpressRouteSiteFailoverSimulation:        newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse]](),
		beginStopPacketCapture:                             newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStopPacketCaptureResponse]](),
		beginUpdateTags:                                    newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientUpdateTagsResponse]](),
	}
}

// VirtualNetworkGatewaysServerTransport connects instances of armnetwork.VirtualNetworkGatewaysClient to instances of VirtualNetworkGatewaysServer.
// Don't use this type directly, use NewVirtualNetworkGatewaysServerTransport instead.
type VirtualNetworkGatewaysServerTransport struct {
	srv                                                *VirtualNetworkGatewaysServer
	beginCreateOrUpdate                                *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientCreateOrUpdateResponse]]
	beginDelete                                        *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDeleteResponse]]
	beginDisconnectVirtualNetworkGatewayVPNConnections *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse]]
	beginGenerateVPNProfile                            *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGenerateVPNProfileResponse]]
	beginGeneratevpnclientpackage                      *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse]]
	beginGetAdvertisedRoutes                           *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse]]
	beginGetBgpPeerStatus                              *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetBgpPeerStatusResponse]]
	beginGetFailoverAllTestDetails                     *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse]]
	beginGetFailoverSingleTestDetails                  *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse]]
	beginGetLearnedRoutes                              *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetLearnedRoutesResponse]]
	beginGetResiliencyInformation                      *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetResiliencyInformationResponse]]
	beginGetRoutesInformation                          *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetRoutesInformationResponse]]
	beginGetVPNProfilePackageURL                       *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse]]
	beginGetVpnclientConnectionHealth                  *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse]]
	beginGetVpnclientIPSecParameters                   *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse]]
	beginInvokeAbortMigration                          *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeAbortMigrationResponse]]
	beginInvokeCommitMigration                         *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeCommitMigrationResponse]]
	beginInvokeExecuteMigration                        *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse]]
	beginInvokePrepareMigration                        *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokePrepareMigrationResponse]]
	newListPager                                       *tracker[azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListResponse]]
	newListConnectionsPager                            *tracker[azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListConnectionsResponse]]
	beginReset                                         *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetResponse]]
	beginResetVPNClientSharedKey                       *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse]]
	beginSetVpnclientIPSecParameters                   *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse]]
	beginStartExpressRouteSiteFailoverSimulation       *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse]]
	beginStartPacketCapture                            *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStartPacketCaptureResponse]]
	beginStopExpressRouteSiteFailoverSimulation        *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse]]
	beginStopPacketCapture                             *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientStopPacketCaptureResponse]]
	beginUpdateTags                                    *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientUpdateTagsResponse]]
}

// Do implements the policy.Transporter interface for VirtualNetworkGatewaysServerTransport.
func (v *VirtualNetworkGatewaysServerTransport) Do(req *http.Request) (*http.Response, error) {
	rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
	method, ok := rawMethod.(string)
	if !ok {
		return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
	}

	return v.dispatchToMethodFake(req, method)
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
	resultChan := make(chan result)
	defer close(resultChan)

	go func() {
		var intercepted bool
		var res result
		if virtualNetworkGatewaysServerTransportInterceptor != nil {
			res.resp, res.err, intercepted = virtualNetworkGatewaysServerTransportInterceptor.Do(req)
		}
		if !intercepted {
			switch method {
			case "VirtualNetworkGatewaysClient.BeginCreateOrUpdate":
				res.resp, res.err = v.dispatchBeginCreateOrUpdate(req)
			case "VirtualNetworkGatewaysClient.BeginDelete":
				res.resp, res.err = v.dispatchBeginDelete(req)
			case "VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections":
				res.resp, res.err = v.dispatchBeginDisconnectVirtualNetworkGatewayVPNConnections(req)
			case "VirtualNetworkGatewaysClient.BeginGenerateVPNProfile":
				res.resp, res.err = v.dispatchBeginGenerateVPNProfile(req)
			case "VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage":
				res.resp, res.err = v.dispatchBeginGeneratevpnclientpackage(req)
			case "VirtualNetworkGatewaysClient.Get":
				res.resp, res.err = v.dispatchGet(req)
			case "VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes":
				res.resp, res.err = v.dispatchBeginGetAdvertisedRoutes(req)
			case "VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus":
				res.resp, res.err = v.dispatchBeginGetBgpPeerStatus(req)
			case "VirtualNetworkGatewaysClient.BeginGetFailoverAllTestDetails":
				res.resp, res.err = v.dispatchBeginGetFailoverAllTestDetails(req)
			case "VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails":
				res.resp, res.err = v.dispatchBeginGetFailoverSingleTestDetails(req)
			case "VirtualNetworkGatewaysClient.BeginGetLearnedRoutes":
				res.resp, res.err = v.dispatchBeginGetLearnedRoutes(req)
			case "VirtualNetworkGatewaysClient.BeginGetResiliencyInformation":
				res.resp, res.err = v.dispatchBeginGetResiliencyInformation(req)
			case "VirtualNetworkGatewaysClient.BeginGetRoutesInformation":
				res.resp, res.err = v.dispatchBeginGetRoutesInformation(req)
			case "VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL":
				res.resp, res.err = v.dispatchBeginGetVPNProfilePackageURL(req)
			case "VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth":
				res.resp, res.err = v.dispatchBeginGetVpnclientConnectionHealth(req)
			case "VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters":
				res.resp, res.err = v.dispatchBeginGetVpnclientIPSecParameters(req)
			case "VirtualNetworkGatewaysClient.BeginInvokeAbortMigration":
				res.resp, res.err = v.dispatchBeginInvokeAbortMigration(req)
			case "VirtualNetworkGatewaysClient.BeginInvokeCommitMigration":
				res.resp, res.err = v.dispatchBeginInvokeCommitMigration(req)
			case "VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration":
				res.resp, res.err = v.dispatchBeginInvokeExecuteMigration(req)
			case "VirtualNetworkGatewaysClient.BeginInvokePrepareMigration":
				res.resp, res.err = v.dispatchBeginInvokePrepareMigration(req)
			case "VirtualNetworkGatewaysClient.NewListPager":
				res.resp, res.err = v.dispatchNewListPager(req)
			case "VirtualNetworkGatewaysClient.NewListConnectionsPager":
				res.resp, res.err = v.dispatchNewListConnectionsPager(req)
			case "VirtualNetworkGatewaysClient.BeginReset":
				res.resp, res.err = v.dispatchBeginReset(req)
			case "VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey":
				res.resp, res.err = v.dispatchBeginResetVPNClientSharedKey(req)
			case "VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters":
				res.resp, res.err = v.dispatchBeginSetVpnclientIPSecParameters(req)
			case "VirtualNetworkGatewaysClient.BeginStartExpressRouteSiteFailoverSimulation":
				res.resp, res.err = v.dispatchBeginStartExpressRouteSiteFailoverSimulation(req)
			case "VirtualNetworkGatewaysClient.BeginStartPacketCapture":
				res.resp, res.err = v.dispatchBeginStartPacketCapture(req)
			case "VirtualNetworkGatewaysClient.BeginStopExpressRouteSiteFailoverSimulation":
				res.resp, res.err = v.dispatchBeginStopExpressRouteSiteFailoverSimulation(req)
			case "VirtualNetworkGatewaysClient.BeginStopPacketCapture":
				res.resp, res.err = v.dispatchBeginStopPacketCapture(req)
			case "VirtualNetworkGatewaysClient.SupportedVPNDevices":
				res.resp, res.err = v.dispatchSupportedVPNDevices(req)
			case "VirtualNetworkGatewaysClient.BeginUpdateTags":
				res.resp, res.err = v.dispatchBeginUpdateTags(req)
			case "VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript":
				res.resp, res.err = v.dispatchVPNDeviceConfigurationScript(req)
			default:
				res.err = fmt.Errorf("unhandled API %s", method)
			}

		}
		select {
		case resultChan <- res:
		case <-req.Context().Done():
		}
	}()

	select {
	case <-req.Context().Done():
		return nil, req.Context().Err()
	case res := <-resultChan:
		return res.resp, res.err
	}
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
	if v.srv.BeginCreateOrUpdate == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
	}
	beginCreateOrUpdate := v.beginCreateOrUpdate.get(req)
	if beginCreateOrUpdate == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.VirtualNetworkGateway](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginCreateOrUpdate = &respr
		v.beginCreateOrUpdate.add(req, beginCreateOrUpdate)
	}

	resp, err := server.PollerResponderNext(beginCreateOrUpdate, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
		v.beginCreateOrUpdate.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginCreateOrUpdate) {
		v.beginCreateOrUpdate.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
	if v.srv.BeginDelete == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
	}
	beginDelete := v.beginDelete.get(req)
	if beginDelete == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginDelete(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginDelete = &respr
		v.beginDelete.add(req, beginDelete)
	}

	resp, err := server.PollerResponderNext(beginDelete, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		v.beginDelete.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginDelete) {
		v.beginDelete.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginDisconnectVirtualNetworkGatewayVPNConnections(req *http.Request) (*http.Response, error) {
	if v.srv.BeginDisconnectVirtualNetworkGatewayVPNConnections == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginDisconnectVirtualNetworkGatewayVPNConnections not implemented")}
	}
	beginDisconnectVirtualNetworkGatewayVPNConnections := v.beginDisconnectVirtualNetworkGatewayVPNConnections.get(req)
	if beginDisconnectVirtualNetworkGatewayVPNConnections == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disconnectVirtualNetworkGatewayVpnConnections`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.P2SVPNConnectionRequest](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginDisconnectVirtualNetworkGatewayVPNConnections(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginDisconnectVirtualNetworkGatewayVPNConnections = &respr
		v.beginDisconnectVirtualNetworkGatewayVPNConnections.add(req, beginDisconnectVirtualNetworkGatewayVPNConnections)
	}

	resp, err := server.PollerResponderNext(beginDisconnectVirtualNetworkGatewayVPNConnections, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		v.beginDisconnectVirtualNetworkGatewayVPNConnections.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginDisconnectVirtualNetworkGatewayVPNConnections) {
		v.beginDisconnectVirtualNetworkGatewayVPNConnections.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGenerateVPNProfile(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGenerateVPNProfile == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGenerateVPNProfile not implemented")}
	}
	beginGenerateVPNProfile := v.beginGenerateVPNProfile.get(req)
	if beginGenerateVPNProfile == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/generatevpnprofile`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.VPNClientParameters](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGenerateVPNProfile(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGenerateVPNProfile = &respr
		v.beginGenerateVPNProfile.add(req, beginGenerateVPNProfile)
	}

	resp, err := server.PollerResponderNext(beginGenerateVPNProfile, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGenerateVPNProfile.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGenerateVPNProfile) {
		v.beginGenerateVPNProfile.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGeneratevpnclientpackage(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGeneratevpnclientpackage == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGeneratevpnclientpackage not implemented")}
	}
	beginGeneratevpnclientpackage := v.beginGeneratevpnclientpackage.get(req)
	if beginGeneratevpnclientpackage == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/generatevpnclientpackage`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.VPNClientParameters](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGeneratevpnclientpackage(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGeneratevpnclientpackage = &respr
		v.beginGeneratevpnclientpackage.add(req, beginGeneratevpnclientpackage)
	}

	resp, err := server.PollerResponderNext(beginGeneratevpnclientpackage, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGeneratevpnclientpackage.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGeneratevpnclientpackage) {
		v.beginGeneratevpnclientpackage.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
	if v.srv.Get == nil {
		return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if matches == nil || len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
	if err != nil {
		return nil, err
	}
	virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := v.srv.Get(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
	}
	resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkGateway, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetAdvertisedRoutes(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetAdvertisedRoutes == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetAdvertisedRoutes not implemented")}
	}
	beginGetAdvertisedRoutes := v.beginGetAdvertisedRoutes.get(req)
	if beginGetAdvertisedRoutes == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getAdvertisedRoutes`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		peerParam, err := url.QueryUnescape(qp.Get("peer"))
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGetAdvertisedRoutes(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, peerParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetAdvertisedRoutes = &respr
		v.beginGetAdvertisedRoutes.add(req, beginGetAdvertisedRoutes)
	}

	resp, err := server.PollerResponderNext(beginGetAdvertisedRoutes, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetAdvertisedRoutes.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetAdvertisedRoutes) {
		v.beginGetAdvertisedRoutes.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetBgpPeerStatus(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetBgpPeerStatus == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetBgpPeerStatus not implemented")}
	}
	beginGetBgpPeerStatus := v.beginGetBgpPeerStatus.get(req)
	if beginGetBgpPeerStatus == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getBgpPeerStatus`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		peerUnescaped, err := url.QueryUnescape(qp.Get("peer"))
		if err != nil {
			return nil, err
		}
		peerParam := getOptional(peerUnescaped)
		var options *armnetwork.VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions
		if peerParam != nil {
			options = &armnetwork.VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions{
				Peer: peerParam,
			}
		}
		respr, errRespr := v.srv.BeginGetBgpPeerStatus(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, options)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetBgpPeerStatus = &respr
		v.beginGetBgpPeerStatus.add(req, beginGetBgpPeerStatus)
	}

	resp, err := server.PollerResponderNext(beginGetBgpPeerStatus, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetBgpPeerStatus.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetBgpPeerStatus) {
		v.beginGetBgpPeerStatus.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetFailoverAllTestDetails(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetFailoverAllTestDetails == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetFailoverAllTestDetails not implemented")}
	}
	beginGetFailoverAllTestDetails := v.beginGetFailoverAllTestDetails.get(req)
	if beginGetFailoverAllTestDetails == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getFailoverAllTestsDetails`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		typeParamParam, err := url.QueryUnescape(qp.Get("type"))
		if err != nil {
			return nil, err
		}
		fetchLatestUnescaped, err := url.QueryUnescape(qp.Get("fetchLatest"))
		if err != nil {
			return nil, err
		}
		fetchLatestParam, err := strconv.ParseBool(fetchLatestUnescaped)
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGetFailoverAllTestDetails(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, typeParamParam, fetchLatestParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetFailoverAllTestDetails = &respr
		v.beginGetFailoverAllTestDetails.add(req, beginGetFailoverAllTestDetails)
	}

	resp, err := server.PollerResponderNext(beginGetFailoverAllTestDetails, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetFailoverAllTestDetails.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetFailoverAllTestDetails) {
		v.beginGetFailoverAllTestDetails.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetFailoverSingleTestDetails(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetFailoverSingleTestDetails == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetFailoverSingleTestDetails not implemented")}
	}
	beginGetFailoverSingleTestDetails := v.beginGetFailoverSingleTestDetails.get(req)
	if beginGetFailoverSingleTestDetails == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getFailoverSingleTestDetails`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		peeringLocationParam, err := url.QueryUnescape(qp.Get("peeringLocation"))
		if err != nil {
			return nil, err
		}
		failoverTestIDParam, err := url.QueryUnescape(qp.Get("failoverTestId"))
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGetFailoverSingleTestDetails(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, peeringLocationParam, failoverTestIDParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetFailoverSingleTestDetails = &respr
		v.beginGetFailoverSingleTestDetails.add(req, beginGetFailoverSingleTestDetails)
	}

	resp, err := server.PollerResponderNext(beginGetFailoverSingleTestDetails, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetFailoverSingleTestDetails.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetFailoverSingleTestDetails) {
		v.beginGetFailoverSingleTestDetails.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetLearnedRoutes(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetLearnedRoutes == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetLearnedRoutes not implemented")}
	}
	beginGetLearnedRoutes := v.beginGetLearnedRoutes.get(req)
	if beginGetLearnedRoutes == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getLearnedRoutes`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGetLearnedRoutes(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetLearnedRoutes = &respr
		v.beginGetLearnedRoutes.add(req, beginGetLearnedRoutes)
	}

	resp, err := server.PollerResponderNext(beginGetLearnedRoutes, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetLearnedRoutes.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetLearnedRoutes) {
		v.beginGetLearnedRoutes.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetResiliencyInformation(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetResiliencyInformation == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetResiliencyInformation not implemented")}
	}
	beginGetResiliencyInformation := v.beginGetResiliencyInformation.get(req)
	if beginGetResiliencyInformation == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getResiliencyInformation`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		attemptRefreshUnescaped, err := url.QueryUnescape(qp.Get("attemptRefresh"))
		if err != nil {
			return nil, err
		}
		attemptRefreshParam, err := parseOptional(attemptRefreshUnescaped, strconv.ParseBool)
		if err != nil {
			return nil, err
		}
		var options *armnetwork.VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions
		if attemptRefreshParam != nil {
			options = &armnetwork.VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions{
				AttemptRefresh: attemptRefreshParam,
			}
		}
		respr, errRespr := v.srv.BeginGetResiliencyInformation(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, options)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetResiliencyInformation = &respr
		v.beginGetResiliencyInformation.add(req, beginGetResiliencyInformation)
	}

	resp, err := server.PollerResponderNext(beginGetResiliencyInformation, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetResiliencyInformation.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetResiliencyInformation) {
		v.beginGetResiliencyInformation.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetRoutesInformation(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetRoutesInformation == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetRoutesInformation not implemented")}
	}
	beginGetRoutesInformation := v.beginGetRoutesInformation.get(req)
	if beginGetRoutesInformation == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getRoutesInformation`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		attemptRefreshUnescaped, err := url.QueryUnescape(qp.Get("attemptRefresh"))
		if err != nil {
			return nil, err
		}
		attemptRefreshParam, err := parseOptional(attemptRefreshUnescaped, strconv.ParseBool)
		if err != nil {
			return nil, err
		}
		var options *armnetwork.VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions
		if attemptRefreshParam != nil {
			options = &armnetwork.VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions{
				AttemptRefresh: attemptRefreshParam,
			}
		}
		respr, errRespr := v.srv.BeginGetRoutesInformation(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, options)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetRoutesInformation = &respr
		v.beginGetRoutesInformation.add(req, beginGetRoutesInformation)
	}

	resp, err := server.PollerResponderNext(beginGetRoutesInformation, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetRoutesInformation.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetRoutesInformation) {
		v.beginGetRoutesInformation.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetVPNProfilePackageURL(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetVPNProfilePackageURL == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetVPNProfilePackageURL not implemented")}
	}
	beginGetVPNProfilePackageURL := v.beginGetVPNProfilePackageURL.get(req)
	if beginGetVPNProfilePackageURL == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getvpnprofilepackageurl`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGetVPNProfilePackageURL(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetVPNProfilePackageURL = &respr
		v.beginGetVPNProfilePackageURL.add(req, beginGetVPNProfilePackageURL)
	}

	resp, err := server.PollerResponderNext(beginGetVPNProfilePackageURL, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetVPNProfilePackageURL.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetVPNProfilePackageURL) {
		v.beginGetVPNProfilePackageURL.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetVpnclientConnectionHealth(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetVpnclientConnectionHealth == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetVpnclientConnectionHealth not implemented")}
	}
	beginGetVpnclientConnectionHealth := v.beginGetVpnclientConnectionHealth.get(req)
	if beginGetVpnclientConnectionHealth == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getVpnClientConnectionHealth`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGetVpnclientConnectionHealth(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetVpnclientConnectionHealth = &respr
		v.beginGetVpnclientConnectionHealth.add(req, beginGetVpnclientConnectionHealth)
	}

	resp, err := server.PollerResponderNext(beginGetVpnclientConnectionHealth, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginGetVpnclientConnectionHealth.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetVpnclientConnectionHealth) {
		v.beginGetVpnclientConnectionHealth.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetVpnclientIPSecParameters(req *http.Request) (*http.Response, error) {
	if v.srv.BeginGetVpnclientIPSecParameters == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginGetVpnclientIPSecParameters not implemented")}
	}
	beginGetVpnclientIPSecParameters := v.beginGetVpnclientIPSecParameters.get(req)
	if beginGetVpnclientIPSecParameters == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getvpnclientipsecparameters`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginGetVpnclientIPSecParameters(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginGetVpnclientIPSecParameters = &respr
		v.beginGetVpnclientIPSecParameters.add(req, beginGetVpnclientIPSecParameters)
	}

	resp, err := server.PollerResponderNext(beginGetVpnclientIPSecParameters, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		v.beginGetVpnclientIPSecParameters.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginGetVpnclientIPSecParameters) {
		v.beginGetVpnclientIPSecParameters.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeAbortMigration(req *http.Request) (*http.Response, error) {
	if v.srv.BeginInvokeAbortMigration == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginInvokeAbortMigration not implemented")}
	}
	beginInvokeAbortMigration := v.beginInvokeAbortMigration.get(req)
	if beginInvokeAbortMigration == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/abortMigration`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginInvokeAbortMigration(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginInvokeAbortMigration = &respr
		v.beginInvokeAbortMigration.add(req, beginInvokeAbortMigration)
	}

	resp, err := server.PollerResponderNext(beginInvokeAbortMigration, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		v.beginInvokeAbortMigration.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginInvokeAbortMigration) {
		v.beginInvokeAbortMigration.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeCommitMigration(req *http.Request) (*http.Response, error) {
	if v.srv.BeginInvokeCommitMigration == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginInvokeCommitMigration not implemented")}
	}
	beginInvokeCommitMigration := v.beginInvokeCommitMigration.get(req)
	if beginInvokeCommitMigration == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/commitMigration`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginInvokeCommitMigration(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginInvokeCommitMigration = &respr
		v.beginInvokeCommitMigration.add(req, beginInvokeCommitMigration)
	}

	resp, err := server.PollerResponderNext(beginInvokeCommitMigration, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		v.beginInvokeCommitMigration.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginInvokeCommitMigration) {
		v.beginInvokeCommitMigration.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeExecuteMigration(req *http.Request) (*http.Response, error) {
	if v.srv.BeginInvokeExecuteMigration == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginInvokeExecuteMigration not implemented")}
	}
	beginInvokeExecuteMigration := v.beginInvokeExecuteMigration.get(req)
	if beginInvokeExecuteMigration == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/executeMigration`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginInvokeExecuteMigration(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginInvokeExecuteMigration = &respr
		v.beginInvokeExecuteMigration.add(req, beginInvokeExecuteMigration)
	}

	resp, err := server.PollerResponderNext(beginInvokeExecuteMigration, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		v.beginInvokeExecuteMigration.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginInvokeExecuteMigration) {
		v.beginInvokeExecuteMigration.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokePrepareMigration(req *http.Request) (*http.Response, error) {
	if v.srv.BeginInvokePrepareMigration == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginInvokePrepareMigration not implemented")}
	}
	beginInvokePrepareMigration := v.beginInvokePrepareMigration.get(req)
	if beginInvokePrepareMigration == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/prepareMigration`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.VirtualNetworkGatewayMigrationParameters](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginInvokePrepareMigration(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginInvokePrepareMigration = &respr
		v.beginInvokePrepareMigration.add(req, beginInvokePrepareMigration)
	}

	resp, err := server.PollerResponderNext(beginInvokePrepareMigration, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		v.beginInvokePrepareMigration.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginInvokePrepareMigration) {
		v.beginInvokePrepareMigration.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) {
	if v.srv.NewListPager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")}
	}
	newListPager := v.newListPager.get(req)
	if newListPager == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 2 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		resp := v.srv.NewListPager(resourceGroupNameParam, nil)
		newListPager = &resp
		v.newListPager.add(req, newListPager)
		server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.VirtualNetworkGatewaysClientListResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListPager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		v.newListPager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListPager) {
		v.newListPager.remove(req)
	}
	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchNewListConnectionsPager(req *http.Request) (*http.Response, error) {
	if v.srv.NewListConnectionsPager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListConnectionsPager not implemented")}
	}
	newListConnectionsPager := v.newListConnectionsPager.get(req)
	if newListConnectionsPager == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		resp := v.srv.NewListConnectionsPager(resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		newListConnectionsPager = &resp
		v.newListConnectionsPager.add(req, newListConnectionsPager)
		server.PagerResponderInjectNextLinks(newListConnectionsPager, req, func(page *armnetwork.VirtualNetworkGatewaysClientListConnectionsResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListConnectionsPager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		v.newListConnectionsPager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListConnectionsPager) {
		v.newListConnectionsPager.remove(req)
	}
	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginReset(req *http.Request) (*http.Response, error) {
	if v.srv.BeginReset == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginReset not implemented")}
	}
	beginReset := v.beginReset.get(req)
	if beginReset == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reset`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		gatewayVipUnescaped, err := url.QueryUnescape(qp.Get("gatewayVip"))
		if err != nil {
			return nil, err
		}
		gatewayVipParam := getOptional(gatewayVipUnescaped)
		var options *armnetwork.VirtualNetworkGatewaysClientBeginResetOptions
		if gatewayVipParam != nil {
			options = &armnetwork.VirtualNetworkGatewaysClientBeginResetOptions{
				GatewayVip: gatewayVipParam,
			}
		}
		respr, errRespr := v.srv.BeginReset(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, options)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginReset = &respr
		v.beginReset.add(req, beginReset)
	}

	resp, err := server.PollerResponderNext(beginReset, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginReset.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginReset) {
		v.beginReset.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginResetVPNClientSharedKey(req *http.Request) (*http.Response, error) {
	if v.srv.BeginResetVPNClientSharedKey == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginResetVPNClientSharedKey not implemented")}
	}
	beginResetVPNClientSharedKey := v.beginResetVPNClientSharedKey.get(req)
	if beginResetVPNClientSharedKey == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resetvpnclientsharedkey`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginResetVPNClientSharedKey(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginResetVPNClientSharedKey = &respr
		v.beginResetVPNClientSharedKey.add(req, beginResetVPNClientSharedKey)
	}

	resp, err := server.PollerResponderNext(beginResetVPNClientSharedKey, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		v.beginResetVPNClientSharedKey.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginResetVPNClientSharedKey) {
		v.beginResetVPNClientSharedKey.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginSetVpnclientIPSecParameters(req *http.Request) (*http.Response, error) {
	if v.srv.BeginSetVpnclientIPSecParameters == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginSetVpnclientIPSecParameters not implemented")}
	}
	beginSetVpnclientIPSecParameters := v.beginSetVpnclientIPSecParameters.get(req)
	if beginSetVpnclientIPSecParameters == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/setvpnclientipsecparameters`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.VPNClientIPsecParameters](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginSetVpnclientIPSecParameters(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginSetVpnclientIPSecParameters = &respr
		v.beginSetVpnclientIPSecParameters.add(req, beginSetVpnclientIPSecParameters)
	}

	resp, err := server.PollerResponderNext(beginSetVpnclientIPSecParameters, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginSetVpnclientIPSecParameters.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginSetVpnclientIPSecParameters) {
		v.beginSetVpnclientIPSecParameters.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStartExpressRouteSiteFailoverSimulation(req *http.Request) (*http.Response, error) {
	if v.srv.BeginStartExpressRouteSiteFailoverSimulation == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginStartExpressRouteSiteFailoverSimulation not implemented")}
	}
	beginStartExpressRouteSiteFailoverSimulation := v.beginStartExpressRouteSiteFailoverSimulation.get(req)
	if beginStartExpressRouteSiteFailoverSimulation == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startSiteFailoverTest`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		peeringLocationParam, err := url.QueryUnescape(qp.Get("peeringLocation"))
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginStartExpressRouteSiteFailoverSimulation(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, peeringLocationParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginStartExpressRouteSiteFailoverSimulation = &respr
		v.beginStartExpressRouteSiteFailoverSimulation.add(req, beginStartExpressRouteSiteFailoverSimulation)
	}

	resp, err := server.PollerResponderNext(beginStartExpressRouteSiteFailoverSimulation, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginStartExpressRouteSiteFailoverSimulation.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginStartExpressRouteSiteFailoverSimulation) {
		v.beginStartExpressRouteSiteFailoverSimulation.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStartPacketCapture(req *http.Request) (*http.Response, error) {
	if v.srv.BeginStartPacketCapture == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginStartPacketCapture not implemented")}
	}
	beginStartPacketCapture := v.beginStartPacketCapture.get(req)
	if beginStartPacketCapture == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startPacketCapture`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.VPNPacketCaptureStartParameters](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		var options *armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions
		if !reflect.ValueOf(body).IsZero() {
			options = &armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions{
				Parameters: &body,
			}
		}
		respr, errRespr := v.srv.BeginStartPacketCapture(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, options)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginStartPacketCapture = &respr
		v.beginStartPacketCapture.add(req, beginStartPacketCapture)
	}

	resp, err := server.PollerResponderNext(beginStartPacketCapture, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginStartPacketCapture.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginStartPacketCapture) {
		v.beginStartPacketCapture.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStopExpressRouteSiteFailoverSimulation(req *http.Request) (*http.Response, error) {
	if v.srv.BeginStopExpressRouteSiteFailoverSimulation == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginStopExpressRouteSiteFailoverSimulation not implemented")}
	}
	beginStopExpressRouteSiteFailoverSimulation := v.beginStopExpressRouteSiteFailoverSimulation.get(req)
	if beginStopExpressRouteSiteFailoverSimulation == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stopSiteFailoverTest`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.ExpressRouteFailoverStopAPIParameters](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginStopExpressRouteSiteFailoverSimulation(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginStopExpressRouteSiteFailoverSimulation = &respr
		v.beginStopExpressRouteSiteFailoverSimulation.add(req, beginStopExpressRouteSiteFailoverSimulation)
	}

	resp, err := server.PollerResponderNext(beginStopExpressRouteSiteFailoverSimulation, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginStopExpressRouteSiteFailoverSimulation.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginStopExpressRouteSiteFailoverSimulation) {
		v.beginStopExpressRouteSiteFailoverSimulation.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStopPacketCapture(req *http.Request) (*http.Response, error) {
	if v.srv.BeginStopPacketCapture == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginStopPacketCapture not implemented")}
	}
	beginStopPacketCapture := v.beginStopPacketCapture.get(req)
	if beginStopPacketCapture == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stopPacketCapture`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.VPNPacketCaptureStopParameters](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginStopPacketCapture(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginStopPacketCapture = &respr
		v.beginStopPacketCapture.add(req, beginStopPacketCapture)
	}

	resp, err := server.PollerResponderNext(beginStopPacketCapture, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginStopPacketCapture.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginStopPacketCapture) {
		v.beginStopPacketCapture.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchSupportedVPNDevices(req *http.Request) (*http.Response, error) {
	if v.srv.SupportedVPNDevices == nil {
		return nil, &nonRetriableError{errors.New("fake for method SupportedVPNDevices not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/supportedvpndevices`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if matches == nil || len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
	if err != nil {
		return nil, err
	}
	virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := v.srv.SupportedVPNDevices(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
	}
	resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Value, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginUpdateTags(req *http.Request) (*http.Response, error) {
	if v.srv.BeginUpdateTags == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginUpdateTags not implemented")}
	}
	beginUpdateTags := v.beginUpdateTags.get(req)
	if beginUpdateTags == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P<virtualNetworkGatewayName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armnetwork.TagsObject](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := v.srv.BeginUpdateTags(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginUpdateTags = &respr
		v.beginUpdateTags.add(req, beginUpdateTags)
	}

	resp, err := server.PollerResponderNext(beginUpdateTags, req)
	if err != nil {
		return nil, err
	}

	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
		v.beginUpdateTags.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
	}
	if !server.PollerResponderMore(beginUpdateTags) {
		v.beginUpdateTags.remove(req)
	}

	return resp, nil
}

func (v *VirtualNetworkGatewaysServerTransport) dispatchVPNDeviceConfigurationScript(req *http.Request) (*http.Response, error) {
	if v.srv.VPNDeviceConfigurationScript == nil {
		return nil, &nonRetriableError{errors.New("fake for method VPNDeviceConfigurationScript not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/connections/(?P<virtualNetworkGatewayConnectionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/vpndeviceconfigurationscript`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if matches == nil || len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	body, err := server.UnmarshalRequestAsJSON[armnetwork.VPNDeviceScriptParameters](req)
	if err != nil {
		return nil, err
	}
	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
	if err != nil {
		return nil, err
	}
	virtualNetworkGatewayConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayConnectionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := v.srv.VPNDeviceConfigurationScript(req.Context(), resourceGroupNameParam, virtualNetworkGatewayConnectionNameParam, body, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
	}
	resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Value, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

// set this to conditionally intercept incoming requests to VirtualNetworkGatewaysServerTransport
var virtualNetworkGatewaysServerTransportInterceptor interface {
	// Do returns true if the server transport should use the returned response/error
	Do(*http.Request) (*http.Response, error, bool)
}
