// 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/resources/armdeployments"
	"net/http"
	"net/url"
	"regexp"
	"strconv"
)

// Server is a fake server for instances of the armdeployments.Client type.
type Server struct {
	// CalculateTemplateHash is the fake for method Client.CalculateTemplateHash
	// HTTP status codes to indicate success: http.StatusOK
	CalculateTemplateHash func(ctx context.Context, templateParam any, options *armdeployments.ClientCalculateTemplateHashOptions) (resp azfake.Responder[armdeployments.ClientCalculateTemplateHashResponse], errResp azfake.ErrorResponder)

	// Cancel is the fake for method Client.Cancel
	// HTTP status codes to indicate success: http.StatusNoContent
	Cancel func(ctx context.Context, resourceGroupName string, deploymentName string, options *armdeployments.ClientCancelOptions) (resp azfake.Responder[armdeployments.ClientCancelResponse], errResp azfake.ErrorResponder)

	// CancelAtManagementGroupScope is the fake for method Client.CancelAtManagementGroupScope
	// HTTP status codes to indicate success: http.StatusNoContent
	CancelAtManagementGroupScope func(ctx context.Context, groupID string, deploymentName string, options *armdeployments.ClientCancelAtManagementGroupScopeOptions) (resp azfake.Responder[armdeployments.ClientCancelAtManagementGroupScopeResponse], errResp azfake.ErrorResponder)

	// CancelAtScope is the fake for method Client.CancelAtScope
	// HTTP status codes to indicate success: http.StatusNoContent
	CancelAtScope func(ctx context.Context, scope string, deploymentName string, options *armdeployments.ClientCancelAtScopeOptions) (resp azfake.Responder[armdeployments.ClientCancelAtScopeResponse], errResp azfake.ErrorResponder)

	// CancelAtSubscriptionScope is the fake for method Client.CancelAtSubscriptionScope
	// HTTP status codes to indicate success: http.StatusNoContent
	CancelAtSubscriptionScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientCancelAtSubscriptionScopeOptions) (resp azfake.Responder[armdeployments.ClientCancelAtSubscriptionScopeResponse], errResp azfake.ErrorResponder)

	// CancelAtTenantScope is the fake for method Client.CancelAtTenantScope
	// HTTP status codes to indicate success: http.StatusNoContent
	CancelAtTenantScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientCancelAtTenantScopeOptions) (resp azfake.Responder[armdeployments.ClientCancelAtTenantScopeResponse], errResp azfake.ErrorResponder)

	// CheckExistence is the fake for method Client.CheckExistence
	// HTTP status codes to indicate success: http.StatusNoContent, http.StatusNotFound
	CheckExistence func(ctx context.Context, resourceGroupName string, deploymentName string, options *armdeployments.ClientCheckExistenceOptions) (resp azfake.Responder[armdeployments.ClientCheckExistenceResponse], errResp azfake.ErrorResponder)

	// CheckExistenceAtManagementGroupScope is the fake for method Client.CheckExistenceAtManagementGroupScope
	// HTTP status codes to indicate success: http.StatusNoContent, http.StatusNotFound
	CheckExistenceAtManagementGroupScope func(ctx context.Context, groupID string, deploymentName string, options *armdeployments.ClientCheckExistenceAtManagementGroupScopeOptions) (resp azfake.Responder[armdeployments.ClientCheckExistenceAtManagementGroupScopeResponse], errResp azfake.ErrorResponder)

	// CheckExistenceAtScope is the fake for method Client.CheckExistenceAtScope
	// HTTP status codes to indicate success: http.StatusNoContent, http.StatusNotFound
	CheckExistenceAtScope func(ctx context.Context, scope string, deploymentName string, options *armdeployments.ClientCheckExistenceAtScopeOptions) (resp azfake.Responder[armdeployments.ClientCheckExistenceAtScopeResponse], errResp azfake.ErrorResponder)

	// CheckExistenceAtSubscriptionScope is the fake for method Client.CheckExistenceAtSubscriptionScope
	// HTTP status codes to indicate success: http.StatusNoContent, http.StatusNotFound
	CheckExistenceAtSubscriptionScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientCheckExistenceAtSubscriptionScopeOptions) (resp azfake.Responder[armdeployments.ClientCheckExistenceAtSubscriptionScopeResponse], errResp azfake.ErrorResponder)

	// CheckExistenceAtTenantScope is the fake for method Client.CheckExistenceAtTenantScope
	// HTTP status codes to indicate success: http.StatusNoContent, http.StatusNotFound
	CheckExistenceAtTenantScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientCheckExistenceAtTenantScopeOptions) (resp azfake.Responder[armdeployments.ClientCheckExistenceAtTenantScopeResponse], errResp azfake.ErrorResponder)

	// BeginCreateOrUpdate is the fake for method Client.BeginCreateOrUpdate
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, deploymentName string, parameters armdeployments.Deployment, options *armdeployments.ClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdeployments.ClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)

	// BeginCreateOrUpdateAtManagementGroupScope is the fake for method Client.BeginCreateOrUpdateAtManagementGroupScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	BeginCreateOrUpdateAtManagementGroupScope func(ctx context.Context, groupID string, deploymentName string, parameters armdeployments.ScopedDeployment, options *armdeployments.ClientBeginCreateOrUpdateAtManagementGroupScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtManagementGroupScopeResponse], errResp azfake.ErrorResponder)

	// BeginCreateOrUpdateAtScope is the fake for method Client.BeginCreateOrUpdateAtScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	BeginCreateOrUpdateAtScope func(ctx context.Context, scope string, deploymentName string, parameters armdeployments.Deployment, options *armdeployments.ClientBeginCreateOrUpdateAtScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtScopeResponse], errResp azfake.ErrorResponder)

	// BeginCreateOrUpdateAtSubscriptionScope is the fake for method Client.BeginCreateOrUpdateAtSubscriptionScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	BeginCreateOrUpdateAtSubscriptionScope func(ctx context.Context, deploymentName string, parameters armdeployments.Deployment, options *armdeployments.ClientBeginCreateOrUpdateAtSubscriptionScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtSubscriptionScopeResponse], errResp azfake.ErrorResponder)

	// BeginCreateOrUpdateAtTenantScope is the fake for method Client.BeginCreateOrUpdateAtTenantScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	BeginCreateOrUpdateAtTenantScope func(ctx context.Context, deploymentName string, parameters armdeployments.ScopedDeployment, options *armdeployments.ClientBeginCreateOrUpdateAtTenantScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtTenantScopeResponse], errResp azfake.ErrorResponder)

	// BeginDelete is the fake for method Client.BeginDelete
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDelete func(ctx context.Context, resourceGroupName string, deploymentName string, options *armdeployments.ClientBeginDeleteOptions) (resp azfake.PollerResponder[armdeployments.ClientDeleteResponse], errResp azfake.ErrorResponder)

	// BeginDeleteAtManagementGroupScope is the fake for method Client.BeginDeleteAtManagementGroupScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDeleteAtManagementGroupScope func(ctx context.Context, groupID string, deploymentName string, options *armdeployments.ClientBeginDeleteAtManagementGroupScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientDeleteAtManagementGroupScopeResponse], errResp azfake.ErrorResponder)

	// BeginDeleteAtScope is the fake for method Client.BeginDeleteAtScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDeleteAtScope func(ctx context.Context, scope string, deploymentName string, options *armdeployments.ClientBeginDeleteAtScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientDeleteAtScopeResponse], errResp azfake.ErrorResponder)

	// BeginDeleteAtSubscriptionScope is the fake for method Client.BeginDeleteAtSubscriptionScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDeleteAtSubscriptionScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientBeginDeleteAtSubscriptionScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientDeleteAtSubscriptionScopeResponse], errResp azfake.ErrorResponder)

	// BeginDeleteAtTenantScope is the fake for method Client.BeginDeleteAtTenantScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDeleteAtTenantScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientBeginDeleteAtTenantScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientDeleteAtTenantScopeResponse], errResp azfake.ErrorResponder)

	// ExportTemplate is the fake for method Client.ExportTemplate
	// HTTP status codes to indicate success: http.StatusOK
	ExportTemplate func(ctx context.Context, resourceGroupName string, deploymentName string, options *armdeployments.ClientExportTemplateOptions) (resp azfake.Responder[armdeployments.ClientExportTemplateResponse], errResp azfake.ErrorResponder)

	// ExportTemplateAtManagementGroupScope is the fake for method Client.ExportTemplateAtManagementGroupScope
	// HTTP status codes to indicate success: http.StatusOK
	ExportTemplateAtManagementGroupScope func(ctx context.Context, groupID string, deploymentName string, options *armdeployments.ClientExportTemplateAtManagementGroupScopeOptions) (resp azfake.Responder[armdeployments.ClientExportTemplateAtManagementGroupScopeResponse], errResp azfake.ErrorResponder)

	// ExportTemplateAtScope is the fake for method Client.ExportTemplateAtScope
	// HTTP status codes to indicate success: http.StatusOK
	ExportTemplateAtScope func(ctx context.Context, scope string, deploymentName string, options *armdeployments.ClientExportTemplateAtScopeOptions) (resp azfake.Responder[armdeployments.ClientExportTemplateAtScopeResponse], errResp azfake.ErrorResponder)

	// ExportTemplateAtSubscriptionScope is the fake for method Client.ExportTemplateAtSubscriptionScope
	// HTTP status codes to indicate success: http.StatusOK
	ExportTemplateAtSubscriptionScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientExportTemplateAtSubscriptionScopeOptions) (resp azfake.Responder[armdeployments.ClientExportTemplateAtSubscriptionScopeResponse], errResp azfake.ErrorResponder)

	// ExportTemplateAtTenantScope is the fake for method Client.ExportTemplateAtTenantScope
	// HTTP status codes to indicate success: http.StatusOK
	ExportTemplateAtTenantScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientExportTemplateAtTenantScopeOptions) (resp azfake.Responder[armdeployments.ClientExportTemplateAtTenantScopeResponse], errResp azfake.ErrorResponder)

	// Get is the fake for method Client.Get
	// HTTP status codes to indicate success: http.StatusOK
	Get func(ctx context.Context, resourceGroupName string, deploymentName string, options *armdeployments.ClientGetOptions) (resp azfake.Responder[armdeployments.ClientGetResponse], errResp azfake.ErrorResponder)

	// GetAtManagementGroupScope is the fake for method Client.GetAtManagementGroupScope
	// HTTP status codes to indicate success: http.StatusOK
	GetAtManagementGroupScope func(ctx context.Context, groupID string, deploymentName string, options *armdeployments.ClientGetAtManagementGroupScopeOptions) (resp azfake.Responder[armdeployments.ClientGetAtManagementGroupScopeResponse], errResp azfake.ErrorResponder)

	// GetAtScope is the fake for method Client.GetAtScope
	// HTTP status codes to indicate success: http.StatusOK
	GetAtScope func(ctx context.Context, scope string, deploymentName string, options *armdeployments.ClientGetAtScopeOptions) (resp azfake.Responder[armdeployments.ClientGetAtScopeResponse], errResp azfake.ErrorResponder)

	// GetAtSubscriptionScope is the fake for method Client.GetAtSubscriptionScope
	// HTTP status codes to indicate success: http.StatusOK
	GetAtSubscriptionScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientGetAtSubscriptionScopeOptions) (resp azfake.Responder[armdeployments.ClientGetAtSubscriptionScopeResponse], errResp azfake.ErrorResponder)

	// GetAtTenantScope is the fake for method Client.GetAtTenantScope
	// HTTP status codes to indicate success: http.StatusOK
	GetAtTenantScope func(ctx context.Context, deploymentName string, options *armdeployments.ClientGetAtTenantScopeOptions) (resp azfake.Responder[armdeployments.ClientGetAtTenantScopeResponse], errResp azfake.ErrorResponder)

	// NewListAtManagementGroupScopePager is the fake for method Client.NewListAtManagementGroupScopePager
	// HTTP status codes to indicate success: http.StatusOK
	NewListAtManagementGroupScopePager func(groupID string, options *armdeployments.ClientListAtManagementGroupScopeOptions) (resp azfake.PagerResponder[armdeployments.ClientListAtManagementGroupScopeResponse])

	// NewListAtScopePager is the fake for method Client.NewListAtScopePager
	// HTTP status codes to indicate success: http.StatusOK
	NewListAtScopePager func(scope string, options *armdeployments.ClientListAtScopeOptions) (resp azfake.PagerResponder[armdeployments.ClientListAtScopeResponse])

	// NewListAtSubscriptionScopePager is the fake for method Client.NewListAtSubscriptionScopePager
	// HTTP status codes to indicate success: http.StatusOK
	NewListAtSubscriptionScopePager func(options *armdeployments.ClientListAtSubscriptionScopeOptions) (resp azfake.PagerResponder[armdeployments.ClientListAtSubscriptionScopeResponse])

	// NewListAtTenantScopePager is the fake for method Client.NewListAtTenantScopePager
	// HTTP status codes to indicate success: http.StatusOK
	NewListAtTenantScopePager func(options *armdeployments.ClientListAtTenantScopeOptions) (resp azfake.PagerResponder[armdeployments.ClientListAtTenantScopeResponse])

	// NewListByResourceGroupPager is the fake for method Client.NewListByResourceGroupPager
	// HTTP status codes to indicate success: http.StatusOK
	NewListByResourceGroupPager func(resourceGroupName string, options *armdeployments.ClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdeployments.ClientListByResourceGroupResponse])

	// BeginValidate is the fake for method Client.BeginValidate
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusBadRequest
	BeginValidate func(ctx context.Context, resourceGroupName string, deploymentName string, parameters armdeployments.Deployment, options *armdeployments.ClientBeginValidateOptions) (resp azfake.PollerResponder[armdeployments.ClientValidateResponse], errResp azfake.ErrorResponder)

	// BeginValidateAtManagementGroupScope is the fake for method Client.BeginValidateAtManagementGroupScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusBadRequest
	BeginValidateAtManagementGroupScope func(ctx context.Context, groupID string, deploymentName string, parameters armdeployments.ScopedDeployment, options *armdeployments.ClientBeginValidateAtManagementGroupScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientValidateAtManagementGroupScopeResponse], errResp azfake.ErrorResponder)

	// BeginValidateAtScope is the fake for method Client.BeginValidateAtScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusBadRequest
	BeginValidateAtScope func(ctx context.Context, scope string, deploymentName string, parameters armdeployments.Deployment, options *armdeployments.ClientBeginValidateAtScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientValidateAtScopeResponse], errResp azfake.ErrorResponder)

	// BeginValidateAtSubscriptionScope is the fake for method Client.BeginValidateAtSubscriptionScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusBadRequest
	BeginValidateAtSubscriptionScope func(ctx context.Context, deploymentName string, parameters armdeployments.Deployment, options *armdeployments.ClientBeginValidateAtSubscriptionScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientValidateAtSubscriptionScopeResponse], errResp azfake.ErrorResponder)

	// BeginValidateAtTenantScope is the fake for method Client.BeginValidateAtTenantScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusBadRequest
	BeginValidateAtTenantScope func(ctx context.Context, deploymentName string, parameters armdeployments.ScopedDeployment, options *armdeployments.ClientBeginValidateAtTenantScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientValidateAtTenantScopeResponse], errResp azfake.ErrorResponder)

	// BeginWhatIf is the fake for method Client.BeginWhatIf
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginWhatIf func(ctx context.Context, resourceGroupName string, deploymentName string, parameters armdeployments.DeploymentWhatIf, options *armdeployments.ClientBeginWhatIfOptions) (resp azfake.PollerResponder[armdeployments.ClientWhatIfResponse], errResp azfake.ErrorResponder)

	// BeginWhatIfAtManagementGroupScope is the fake for method Client.BeginWhatIfAtManagementGroupScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginWhatIfAtManagementGroupScope func(ctx context.Context, groupID string, deploymentName string, parameters armdeployments.ScopedDeploymentWhatIf, options *armdeployments.ClientBeginWhatIfAtManagementGroupScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientWhatIfAtManagementGroupScopeResponse], errResp azfake.ErrorResponder)

	// BeginWhatIfAtSubscriptionScope is the fake for method Client.BeginWhatIfAtSubscriptionScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginWhatIfAtSubscriptionScope func(ctx context.Context, deploymentName string, parameters armdeployments.DeploymentWhatIf, options *armdeployments.ClientBeginWhatIfAtSubscriptionScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientWhatIfAtSubscriptionScopeResponse], errResp azfake.ErrorResponder)

	// BeginWhatIfAtTenantScope is the fake for method Client.BeginWhatIfAtTenantScope
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginWhatIfAtTenantScope func(ctx context.Context, deploymentName string, parameters armdeployments.ScopedDeploymentWhatIf, options *armdeployments.ClientBeginWhatIfAtTenantScopeOptions) (resp azfake.PollerResponder[armdeployments.ClientWhatIfAtTenantScopeResponse], errResp azfake.ErrorResponder)
}

// NewServerTransport creates a new instance of ServerTransport with the provided implementation.
// The returned ServerTransport instance is connected to an instance of armdeployments.Client via the
// azcore.ClientOptions.Transporter field in the client's constructor parameters.
func NewServerTransport(srv *Server) *ServerTransport {
	return &ServerTransport{
		srv:                 srv,
		beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateResponse]](),
		beginCreateOrUpdateAtManagementGroupScope: newTracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtManagementGroupScopeResponse]](),
		beginCreateOrUpdateAtScope:                newTracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtScopeResponse]](),
		beginCreateOrUpdateAtSubscriptionScope:    newTracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtSubscriptionScopeResponse]](),
		beginCreateOrUpdateAtTenantScope:          newTracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtTenantScopeResponse]](),
		beginDelete:                               newTracker[azfake.PollerResponder[armdeployments.ClientDeleteResponse]](),
		beginDeleteAtManagementGroupScope:         newTracker[azfake.PollerResponder[armdeployments.ClientDeleteAtManagementGroupScopeResponse]](),
		beginDeleteAtScope:                        newTracker[azfake.PollerResponder[armdeployments.ClientDeleteAtScopeResponse]](),
		beginDeleteAtSubscriptionScope:            newTracker[azfake.PollerResponder[armdeployments.ClientDeleteAtSubscriptionScopeResponse]](),
		beginDeleteAtTenantScope:                  newTracker[azfake.PollerResponder[armdeployments.ClientDeleteAtTenantScopeResponse]](),
		newListAtManagementGroupScopePager:        newTracker[azfake.PagerResponder[armdeployments.ClientListAtManagementGroupScopeResponse]](),
		newListAtScopePager:                       newTracker[azfake.PagerResponder[armdeployments.ClientListAtScopeResponse]](),
		newListAtSubscriptionScopePager:           newTracker[azfake.PagerResponder[armdeployments.ClientListAtSubscriptionScopeResponse]](),
		newListAtTenantScopePager:                 newTracker[azfake.PagerResponder[armdeployments.ClientListAtTenantScopeResponse]](),
		newListByResourceGroupPager:               newTracker[azfake.PagerResponder[armdeployments.ClientListByResourceGroupResponse]](),
		beginValidate:                             newTracker[azfake.PollerResponder[armdeployments.ClientValidateResponse]](),
		beginValidateAtManagementGroupScope:       newTracker[azfake.PollerResponder[armdeployments.ClientValidateAtManagementGroupScopeResponse]](),
		beginValidateAtScope:                      newTracker[azfake.PollerResponder[armdeployments.ClientValidateAtScopeResponse]](),
		beginValidateAtSubscriptionScope:          newTracker[azfake.PollerResponder[armdeployments.ClientValidateAtSubscriptionScopeResponse]](),
		beginValidateAtTenantScope:                newTracker[azfake.PollerResponder[armdeployments.ClientValidateAtTenantScopeResponse]](),
		beginWhatIf:                               newTracker[azfake.PollerResponder[armdeployments.ClientWhatIfResponse]](),
		beginWhatIfAtManagementGroupScope:         newTracker[azfake.PollerResponder[armdeployments.ClientWhatIfAtManagementGroupScopeResponse]](),
		beginWhatIfAtSubscriptionScope:            newTracker[azfake.PollerResponder[armdeployments.ClientWhatIfAtSubscriptionScopeResponse]](),
		beginWhatIfAtTenantScope:                  newTracker[azfake.PollerResponder[armdeployments.ClientWhatIfAtTenantScopeResponse]](),
	}
}

// ServerTransport connects instances of armdeployments.Client to instances of Server.
// Don't use this type directly, use NewServerTransport instead.
type ServerTransport struct {
	srv                                       *Server
	beginCreateOrUpdate                       *tracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateResponse]]
	beginCreateOrUpdateAtManagementGroupScope *tracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtManagementGroupScopeResponse]]
	beginCreateOrUpdateAtScope                *tracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtScopeResponse]]
	beginCreateOrUpdateAtSubscriptionScope    *tracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtSubscriptionScopeResponse]]
	beginCreateOrUpdateAtTenantScope          *tracker[azfake.PollerResponder[armdeployments.ClientCreateOrUpdateAtTenantScopeResponse]]
	beginDelete                               *tracker[azfake.PollerResponder[armdeployments.ClientDeleteResponse]]
	beginDeleteAtManagementGroupScope         *tracker[azfake.PollerResponder[armdeployments.ClientDeleteAtManagementGroupScopeResponse]]
	beginDeleteAtScope                        *tracker[azfake.PollerResponder[armdeployments.ClientDeleteAtScopeResponse]]
	beginDeleteAtSubscriptionScope            *tracker[azfake.PollerResponder[armdeployments.ClientDeleteAtSubscriptionScopeResponse]]
	beginDeleteAtTenantScope                  *tracker[azfake.PollerResponder[armdeployments.ClientDeleteAtTenantScopeResponse]]
	newListAtManagementGroupScopePager        *tracker[azfake.PagerResponder[armdeployments.ClientListAtManagementGroupScopeResponse]]
	newListAtScopePager                       *tracker[azfake.PagerResponder[armdeployments.ClientListAtScopeResponse]]
	newListAtSubscriptionScopePager           *tracker[azfake.PagerResponder[armdeployments.ClientListAtSubscriptionScopeResponse]]
	newListAtTenantScopePager                 *tracker[azfake.PagerResponder[armdeployments.ClientListAtTenantScopeResponse]]
	newListByResourceGroupPager               *tracker[azfake.PagerResponder[armdeployments.ClientListByResourceGroupResponse]]
	beginValidate                             *tracker[azfake.PollerResponder[armdeployments.ClientValidateResponse]]
	beginValidateAtManagementGroupScope       *tracker[azfake.PollerResponder[armdeployments.ClientValidateAtManagementGroupScopeResponse]]
	beginValidateAtScope                      *tracker[azfake.PollerResponder[armdeployments.ClientValidateAtScopeResponse]]
	beginValidateAtSubscriptionScope          *tracker[azfake.PollerResponder[armdeployments.ClientValidateAtSubscriptionScopeResponse]]
	beginValidateAtTenantScope                *tracker[azfake.PollerResponder[armdeployments.ClientValidateAtTenantScopeResponse]]
	beginWhatIf                               *tracker[azfake.PollerResponder[armdeployments.ClientWhatIfResponse]]
	beginWhatIfAtManagementGroupScope         *tracker[azfake.PollerResponder[armdeployments.ClientWhatIfAtManagementGroupScopeResponse]]
	beginWhatIfAtSubscriptionScope            *tracker[azfake.PollerResponder[armdeployments.ClientWhatIfAtSubscriptionScopeResponse]]
	beginWhatIfAtTenantScope                  *tracker[azfake.PollerResponder[armdeployments.ClientWhatIfAtTenantScopeResponse]]
}

// Do implements the policy.Transporter interface for ServerTransport.
func (s *ServerTransport) 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 s.dispatchToMethodFake(req, method)
}

func (s *ServerTransport) 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 serverTransportInterceptor != nil {
			res.resp, res.err, intercepted = serverTransportInterceptor.Do(req)
		}
		if !intercepted {
			switch method {
			case "Client.CalculateTemplateHash":
				res.resp, res.err = s.dispatchCalculateTemplateHash(req)
			case "Client.Cancel":
				res.resp, res.err = s.dispatchCancel(req)
			case "Client.CancelAtManagementGroupScope":
				res.resp, res.err = s.dispatchCancelAtManagementGroupScope(req)
			case "Client.CancelAtScope":
				res.resp, res.err = s.dispatchCancelAtScope(req)
			case "Client.CancelAtSubscriptionScope":
				res.resp, res.err = s.dispatchCancelAtSubscriptionScope(req)
			case "Client.CancelAtTenantScope":
				res.resp, res.err = s.dispatchCancelAtTenantScope(req)
			case "Client.CheckExistence":
				res.resp, res.err = s.dispatchCheckExistence(req)
			case "Client.CheckExistenceAtManagementGroupScope":
				res.resp, res.err = s.dispatchCheckExistenceAtManagementGroupScope(req)
			case "Client.CheckExistenceAtScope":
				res.resp, res.err = s.dispatchCheckExistenceAtScope(req)
			case "Client.CheckExistenceAtSubscriptionScope":
				res.resp, res.err = s.dispatchCheckExistenceAtSubscriptionScope(req)
			case "Client.CheckExistenceAtTenantScope":
				res.resp, res.err = s.dispatchCheckExistenceAtTenantScope(req)
			case "Client.BeginCreateOrUpdate":
				res.resp, res.err = s.dispatchBeginCreateOrUpdate(req)
			case "Client.BeginCreateOrUpdateAtManagementGroupScope":
				res.resp, res.err = s.dispatchBeginCreateOrUpdateAtManagementGroupScope(req)
			case "Client.BeginCreateOrUpdateAtScope":
				res.resp, res.err = s.dispatchBeginCreateOrUpdateAtScope(req)
			case "Client.BeginCreateOrUpdateAtSubscriptionScope":
				res.resp, res.err = s.dispatchBeginCreateOrUpdateAtSubscriptionScope(req)
			case "Client.BeginCreateOrUpdateAtTenantScope":
				res.resp, res.err = s.dispatchBeginCreateOrUpdateAtTenantScope(req)
			case "Client.BeginDelete":
				res.resp, res.err = s.dispatchBeginDelete(req)
			case "Client.BeginDeleteAtManagementGroupScope":
				res.resp, res.err = s.dispatchBeginDeleteAtManagementGroupScope(req)
			case "Client.BeginDeleteAtScope":
				res.resp, res.err = s.dispatchBeginDeleteAtScope(req)
			case "Client.BeginDeleteAtSubscriptionScope":
				res.resp, res.err = s.dispatchBeginDeleteAtSubscriptionScope(req)
			case "Client.BeginDeleteAtTenantScope":
				res.resp, res.err = s.dispatchBeginDeleteAtTenantScope(req)
			case "Client.ExportTemplate":
				res.resp, res.err = s.dispatchExportTemplate(req)
			case "Client.ExportTemplateAtManagementGroupScope":
				res.resp, res.err = s.dispatchExportTemplateAtManagementGroupScope(req)
			case "Client.ExportTemplateAtScope":
				res.resp, res.err = s.dispatchExportTemplateAtScope(req)
			case "Client.ExportTemplateAtSubscriptionScope":
				res.resp, res.err = s.dispatchExportTemplateAtSubscriptionScope(req)
			case "Client.ExportTemplateAtTenantScope":
				res.resp, res.err = s.dispatchExportTemplateAtTenantScope(req)
			case "Client.Get":
				res.resp, res.err = s.dispatchGet(req)
			case "Client.GetAtManagementGroupScope":
				res.resp, res.err = s.dispatchGetAtManagementGroupScope(req)
			case "Client.GetAtScope":
				res.resp, res.err = s.dispatchGetAtScope(req)
			case "Client.GetAtSubscriptionScope":
				res.resp, res.err = s.dispatchGetAtSubscriptionScope(req)
			case "Client.GetAtTenantScope":
				res.resp, res.err = s.dispatchGetAtTenantScope(req)
			case "Client.NewListAtManagementGroupScopePager":
				res.resp, res.err = s.dispatchNewListAtManagementGroupScopePager(req)
			case "Client.NewListAtScopePager":
				res.resp, res.err = s.dispatchNewListAtScopePager(req)
			case "Client.NewListAtSubscriptionScopePager":
				res.resp, res.err = s.dispatchNewListAtSubscriptionScopePager(req)
			case "Client.NewListAtTenantScopePager":
				res.resp, res.err = s.dispatchNewListAtTenantScopePager(req)
			case "Client.NewListByResourceGroupPager":
				res.resp, res.err = s.dispatchNewListByResourceGroupPager(req)
			case "Client.BeginValidate":
				res.resp, res.err = s.dispatchBeginValidate(req)
			case "Client.BeginValidateAtManagementGroupScope":
				res.resp, res.err = s.dispatchBeginValidateAtManagementGroupScope(req)
			case "Client.BeginValidateAtScope":
				res.resp, res.err = s.dispatchBeginValidateAtScope(req)
			case "Client.BeginValidateAtSubscriptionScope":
				res.resp, res.err = s.dispatchBeginValidateAtSubscriptionScope(req)
			case "Client.BeginValidateAtTenantScope":
				res.resp, res.err = s.dispatchBeginValidateAtTenantScope(req)
			case "Client.BeginWhatIf":
				res.resp, res.err = s.dispatchBeginWhatIf(req)
			case "Client.BeginWhatIfAtManagementGroupScope":
				res.resp, res.err = s.dispatchBeginWhatIfAtManagementGroupScope(req)
			case "Client.BeginWhatIfAtSubscriptionScope":
				res.resp, res.err = s.dispatchBeginWhatIfAtSubscriptionScope(req)
			case "Client.BeginWhatIfAtTenantScope":
				res.resp, res.err = s.dispatchBeginWhatIfAtTenantScope(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 (s *ServerTransport) dispatchCalculateTemplateHash(req *http.Request) (*http.Response, error) {
	if s.srv.CalculateTemplateHash == nil {
		return nil, &nonRetriableError{errors.New("fake for method CalculateTemplateHash not implemented")}
	}
	body, err := server.UnmarshalRequestAsJSON[any](req)
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CalculateTemplateHash(req.Context(), 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).TemplateHashResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCancel(req *http.Request) (*http.Response, error) {
	if s.srv.Cancel == nil {
		return nil, &nonRetriableError{errors.New("fake for method Cancel not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 4 {
		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
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.Cancel(req.Context(), resourceGroupNameParam, deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCancelAtManagementGroupScope(req *http.Request) (*http.Response, error) {
	if s.srv.CancelAtManagementGroupScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method CancelAtManagementGroupScope not implemented")}
	}
	const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
	if err != nil {
		return nil, err
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CancelAtManagementGroupScope(req.Context(), groupIDParam, deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCancelAtScope(req *http.Request) (*http.Response, error) {
	if s.srv.CancelAtScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method CancelAtScope not implemented")}
	}
	const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")])
	if err != nil {
		return nil, err
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CancelAtScope(req.Context(), scopeParam, deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCancelAtSubscriptionScope(req *http.Request) (*http.Response, error) {
	if s.srv.CancelAtSubscriptionScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method CancelAtSubscriptionScope not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CancelAtSubscriptionScope(req.Context(), deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCancelAtTenantScope(req *http.Request) (*http.Response, error) {
	if s.srv.CancelAtTenantScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method CancelAtTenantScope not implemented")}
	}
	const regexStr = `/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 2 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CancelAtTenantScope(req.Context(), deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCheckExistence(req *http.Request) (*http.Response, error) {
	if s.srv.CheckExistence == nil {
		return nil, &nonRetriableError{errors.New("fake for method CheckExistence not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 4 {
		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
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CheckExistence(req.Context(), resourceGroupNameParam, deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent, http.StatusNotFound}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent, http.StatusNotFound", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCheckExistenceAtManagementGroupScope(req *http.Request) (*http.Response, error) {
	if s.srv.CheckExistenceAtManagementGroupScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method CheckExistenceAtManagementGroupScope not implemented")}
	}
	const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
	if err != nil {
		return nil, err
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CheckExistenceAtManagementGroupScope(req.Context(), groupIDParam, deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent, http.StatusNotFound}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent, http.StatusNotFound", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCheckExistenceAtScope(req *http.Request) (*http.Response, error) {
	if s.srv.CheckExistenceAtScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method CheckExistenceAtScope not implemented")}
	}
	const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")])
	if err != nil {
		return nil, err
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CheckExistenceAtScope(req.Context(), scopeParam, deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent, http.StatusNotFound}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent, http.StatusNotFound", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCheckExistenceAtSubscriptionScope(req *http.Request) (*http.Response, error) {
	if s.srv.CheckExistenceAtSubscriptionScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method CheckExistenceAtSubscriptionScope not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CheckExistenceAtSubscriptionScope(req.Context(), deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent, http.StatusNotFound}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent, http.StatusNotFound", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchCheckExistenceAtTenantScope(req *http.Request) (*http.Response, error) {
	if s.srv.CheckExistenceAtTenantScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method CheckExistenceAtTenantScope not implemented")}
	}
	const regexStr = `/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 2 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CheckExistenceAtTenantScope(req.Context(), deploymentNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !contains([]int{http.StatusNoContent, http.StatusNotFound}, respContent.HTTPStatus) {
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent, http.StatusNotFound", respContent.HTTPStatus)}
	}
	resp, err := server.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
	if s.srv.BeginCreateOrUpdate == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
	}
	beginCreateOrUpdate := s.beginCreateOrUpdate.get(req)
	if beginCreateOrUpdate == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 4 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.Deployment](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginCreateOrUpdate = &respr
		s.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) {
		s.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) {
		s.beginCreateOrUpdate.remove(req)
	}

	return resp, nil
}

func (s *ServerTransport) dispatchBeginCreateOrUpdateAtManagementGroupScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginCreateOrUpdateAtManagementGroupScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdateAtManagementGroupScope not implemented")}
	}
	beginCreateOrUpdateAtManagementGroupScope := s.beginCreateOrUpdateAtManagementGroupScope.get(req)
	if beginCreateOrUpdateAtManagementGroupScope == nil {
		const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.ScopedDeployment](req)
		if err != nil {
			return nil, err
		}
		groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginCreateOrUpdateAtManagementGroupScope(req.Context(), groupIDParam, deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginCreateOrUpdateAtManagementGroupScope = &respr
		s.beginCreateOrUpdateAtManagementGroupScope.add(req, beginCreateOrUpdateAtManagementGroupScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginCreateOrUpdateAtScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginCreateOrUpdateAtScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdateAtScope not implemented")}
	}
	beginCreateOrUpdateAtScope := s.beginCreateOrUpdateAtScope.get(req)
	if beginCreateOrUpdateAtScope == nil {
		const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.Deployment](req)
		if err != nil {
			return nil, err
		}
		scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginCreateOrUpdateAtScope(req.Context(), scopeParam, deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginCreateOrUpdateAtScope = &respr
		s.beginCreateOrUpdateAtScope.add(req, beginCreateOrUpdateAtScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginCreateOrUpdateAtSubscriptionScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginCreateOrUpdateAtSubscriptionScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdateAtSubscriptionScope not implemented")}
	}
	beginCreateOrUpdateAtSubscriptionScope := s.beginCreateOrUpdateAtSubscriptionScope.get(req)
	if beginCreateOrUpdateAtSubscriptionScope == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.Deployment](req)
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginCreateOrUpdateAtSubscriptionScope(req.Context(), deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginCreateOrUpdateAtSubscriptionScope = &respr
		s.beginCreateOrUpdateAtSubscriptionScope.add(req, beginCreateOrUpdateAtSubscriptionScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginCreateOrUpdateAtTenantScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginCreateOrUpdateAtTenantScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdateAtTenantScope not implemented")}
	}
	beginCreateOrUpdateAtTenantScope := s.beginCreateOrUpdateAtTenantScope.get(req)
	if beginCreateOrUpdateAtTenantScope == nil {
		const regexStr = `/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 2 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.ScopedDeployment](req)
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginCreateOrUpdateAtTenantScope(req.Context(), deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginCreateOrUpdateAtTenantScope = &respr
		s.beginCreateOrUpdateAtTenantScope.add(req, beginCreateOrUpdateAtTenantScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
	if s.srv.BeginDelete == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
	}
	beginDelete := s.beginDelete.get(req)
	if beginDelete == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 4 {
			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
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, deploymentNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginDelete = &respr
		s.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) {
		s.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) {
		s.beginDelete.remove(req)
	}

	return resp, nil
}

func (s *ServerTransport) dispatchBeginDeleteAtManagementGroupScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginDeleteAtManagementGroupScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginDeleteAtManagementGroupScope not implemented")}
	}
	beginDeleteAtManagementGroupScope := s.beginDeleteAtManagementGroupScope.get(req)
	if beginDeleteAtManagementGroupScope == nil {
		const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginDeleteAtManagementGroupScope(req.Context(), groupIDParam, deploymentNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginDeleteAtManagementGroupScope = &respr
		s.beginDeleteAtManagementGroupScope.add(req, beginDeleteAtManagementGroupScope)
	}

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

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		s.beginDeleteAtManagementGroupScope.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(beginDeleteAtManagementGroupScope) {
		s.beginDeleteAtManagementGroupScope.remove(req)
	}

	return resp, nil
}

func (s *ServerTransport) dispatchBeginDeleteAtScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginDeleteAtScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginDeleteAtScope not implemented")}
	}
	beginDeleteAtScope := s.beginDeleteAtScope.get(req)
	if beginDeleteAtScope == nil {
		const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginDeleteAtScope(req.Context(), scopeParam, deploymentNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginDeleteAtScope = &respr
		s.beginDeleteAtScope.add(req, beginDeleteAtScope)
	}

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

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		s.beginDeleteAtScope.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(beginDeleteAtScope) {
		s.beginDeleteAtScope.remove(req)
	}

	return resp, nil
}

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

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

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		s.beginDeleteAtSubscriptionScope.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(beginDeleteAtSubscriptionScope) {
		s.beginDeleteAtSubscriptionScope.remove(req)
	}

	return resp, nil
}

func (s *ServerTransport) dispatchBeginDeleteAtTenantScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginDeleteAtTenantScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginDeleteAtTenantScope not implemented")}
	}
	beginDeleteAtTenantScope := s.beginDeleteAtTenantScope.get(req)
	if beginDeleteAtTenantScope == nil {
		const regexStr = `/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 2 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginDeleteAtTenantScope(req.Context(), deploymentNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginDeleteAtTenantScope = &respr
		s.beginDeleteAtTenantScope.add(req, beginDeleteAtTenantScope)
	}

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

	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		s.beginDeleteAtTenantScope.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(beginDeleteAtTenantScope) {
		s.beginDeleteAtTenantScope.remove(req)
	}

	return resp, nil
}

func (s *ServerTransport) dispatchExportTemplate(req *http.Request) (*http.Response, error) {
	if s.srv.ExportTemplate == nil {
		return nil, &nonRetriableError{errors.New("fake for method ExportTemplate not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/exportTemplate`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 4 {
		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
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.ExportTemplate(req.Context(), resourceGroupNameParam, deploymentNameParam, 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).DeploymentExportResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchExportTemplateAtManagementGroupScope(req *http.Request) (*http.Response, error) {
	if s.srv.ExportTemplateAtManagementGroupScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method ExportTemplateAtManagementGroupScope not implemented")}
	}
	const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/exportTemplate`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
	if err != nil {
		return nil, err
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.ExportTemplateAtManagementGroupScope(req.Context(), groupIDParam, deploymentNameParam, 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).DeploymentExportResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchExportTemplateAtScope(req *http.Request) (*http.Response, error) {
	if s.srv.ExportTemplateAtScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method ExportTemplateAtScope not implemented")}
	}
	const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/exportTemplate`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")])
	if err != nil {
		return nil, err
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.ExportTemplateAtScope(req.Context(), scopeParam, deploymentNameParam, 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).DeploymentExportResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchExportTemplateAtSubscriptionScope(req *http.Request) (*http.Response, error) {
	if s.srv.ExportTemplateAtSubscriptionScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method ExportTemplateAtSubscriptionScope not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/exportTemplate`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.ExportTemplateAtSubscriptionScope(req.Context(), deploymentNameParam, 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).DeploymentExportResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchExportTemplateAtTenantScope(req *http.Request) (*http.Response, error) {
	if s.srv.ExportTemplateAtTenantScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method ExportTemplateAtTenantScope not implemented")}
	}
	const regexStr = `/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/exportTemplate`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 2 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.ExportTemplateAtTenantScope(req.Context(), deploymentNameParam, 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).DeploymentExportResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
	if s.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\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 4 {
		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
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, deploymentNameParam, 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).DeploymentExtended, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchGetAtManagementGroupScope(req *http.Request) (*http.Response, error) {
	if s.srv.GetAtManagementGroupScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method GetAtManagementGroupScope not implemented")}
	}
	const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
	if err != nil {
		return nil, err
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.GetAtManagementGroupScope(req.Context(), groupIDParam, deploymentNameParam, 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).DeploymentExtended, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchGetAtScope(req *http.Request) (*http.Response, error) {
	if s.srv.GetAtScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method GetAtScope not implemented")}
	}
	const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")])
	if err != nil {
		return nil, err
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.GetAtScope(req.Context(), scopeParam, deploymentNameParam, 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).DeploymentExtended, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchGetAtSubscriptionScope(req *http.Request) (*http.Response, error) {
	if s.srv.GetAtSubscriptionScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method GetAtSubscriptionScope not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 3 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.GetAtSubscriptionScope(req.Context(), deploymentNameParam, 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).DeploymentExtended, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchGetAtTenantScope(req *http.Request) (*http.Response, error) {
	if s.srv.GetAtTenantScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method GetAtTenantScope not implemented")}
	}
	const regexStr = `/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 2 {
		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
	}
	deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.GetAtTenantScope(req.Context(), deploymentNameParam, 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).DeploymentExtended, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ServerTransport) dispatchNewListAtManagementGroupScopePager(req *http.Request) (*http.Response, error) {
	if s.srv.NewListAtManagementGroupScopePager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListAtManagementGroupScopePager not implemented")}
	}
	newListAtManagementGroupScopePager := s.newListAtManagementGroupScopePager.get(req)
	if newListAtManagementGroupScopePager == nil {
		const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 2 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
		if err != nil {
			return nil, err
		}
		filterUnescaped, err := url.QueryUnescape(qp.Get("$filter"))
		if err != nil {
			return nil, err
		}
		filterParam := getOptional(filterUnescaped)
		topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
		if err != nil {
			return nil, err
		}
		topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) {
			p, parseErr := strconv.ParseInt(v, 10, 32)
			if parseErr != nil {
				return 0, parseErr
			}
			return int32(p), nil
		})
		if err != nil {
			return nil, err
		}
		var options *armdeployments.ClientListAtManagementGroupScopeOptions
		if filterParam != nil || topParam != nil {
			options = &armdeployments.ClientListAtManagementGroupScopeOptions{
				Filter: filterParam,
				Top:    topParam,
			}
		}
		resp := s.srv.NewListAtManagementGroupScopePager(groupIDParam, options)
		newListAtManagementGroupScopePager = &resp
		s.newListAtManagementGroupScopePager.add(req, newListAtManagementGroupScopePager)
		server.PagerResponderInjectNextLinks(newListAtManagementGroupScopePager, req, func(page *armdeployments.ClientListAtManagementGroupScopeResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListAtManagementGroupScopePager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		s.newListAtManagementGroupScopePager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListAtManagementGroupScopePager) {
		s.newListAtManagementGroupScopePager.remove(req)
	}
	return resp, nil
}

func (s *ServerTransport) dispatchNewListAtScopePager(req *http.Request) (*http.Response, error) {
	if s.srv.NewListAtScopePager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListAtScopePager not implemented")}
	}
	newListAtScopePager := s.newListAtScopePager.get(req)
	if newListAtScopePager == nil {
		const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 2 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")])
		if err != nil {
			return nil, err
		}
		filterUnescaped, err := url.QueryUnescape(qp.Get("$filter"))
		if err != nil {
			return nil, err
		}
		filterParam := getOptional(filterUnescaped)
		topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
		if err != nil {
			return nil, err
		}
		topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) {
			p, parseErr := strconv.ParseInt(v, 10, 32)
			if parseErr != nil {
				return 0, parseErr
			}
			return int32(p), nil
		})
		if err != nil {
			return nil, err
		}
		var options *armdeployments.ClientListAtScopeOptions
		if filterParam != nil || topParam != nil {
			options = &armdeployments.ClientListAtScopeOptions{
				Filter: filterParam,
				Top:    topParam,
			}
		}
		resp := s.srv.NewListAtScopePager(scopeParam, options)
		newListAtScopePager = &resp
		s.newListAtScopePager.add(req, newListAtScopePager)
		server.PagerResponderInjectNextLinks(newListAtScopePager, req, func(page *armdeployments.ClientListAtScopeResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListAtScopePager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		s.newListAtScopePager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListAtScopePager) {
		s.newListAtScopePager.remove(req)
	}
	return resp, nil
}

func (s *ServerTransport) dispatchNewListAtSubscriptionScopePager(req *http.Request) (*http.Response, error) {
	if s.srv.NewListAtSubscriptionScopePager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListAtSubscriptionScopePager not implemented")}
	}
	newListAtSubscriptionScopePager := s.newListAtSubscriptionScopePager.get(req)
	if newListAtSubscriptionScopePager == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 2 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		qp := req.URL.Query()
		filterUnescaped, err := url.QueryUnescape(qp.Get("$filter"))
		if err != nil {
			return nil, err
		}
		filterParam := getOptional(filterUnescaped)
		topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
		if err != nil {
			return nil, err
		}
		topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) {
			p, parseErr := strconv.ParseInt(v, 10, 32)
			if parseErr != nil {
				return 0, parseErr
			}
			return int32(p), nil
		})
		if err != nil {
			return nil, err
		}
		var options *armdeployments.ClientListAtSubscriptionScopeOptions
		if filterParam != nil || topParam != nil {
			options = &armdeployments.ClientListAtSubscriptionScopeOptions{
				Filter: filterParam,
				Top:    topParam,
			}
		}
		resp := s.srv.NewListAtSubscriptionScopePager(options)
		newListAtSubscriptionScopePager = &resp
		s.newListAtSubscriptionScopePager.add(req, newListAtSubscriptionScopePager)
		server.PagerResponderInjectNextLinks(newListAtSubscriptionScopePager, req, func(page *armdeployments.ClientListAtSubscriptionScopeResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListAtSubscriptionScopePager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		s.newListAtSubscriptionScopePager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListAtSubscriptionScopePager) {
		s.newListAtSubscriptionScopePager.remove(req)
	}
	return resp, nil
}

func (s *ServerTransport) dispatchNewListAtTenantScopePager(req *http.Request) (*http.Response, error) {
	if s.srv.NewListAtTenantScopePager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListAtTenantScopePager not implemented")}
	}
	newListAtTenantScopePager := s.newListAtTenantScopePager.get(req)
	if newListAtTenantScopePager == nil {
		qp := req.URL.Query()
		filterUnescaped, err := url.QueryUnescape(qp.Get("$filter"))
		if err != nil {
			return nil, err
		}
		filterParam := getOptional(filterUnescaped)
		topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
		if err != nil {
			return nil, err
		}
		topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) {
			p, parseErr := strconv.ParseInt(v, 10, 32)
			if parseErr != nil {
				return 0, parseErr
			}
			return int32(p), nil
		})
		if err != nil {
			return nil, err
		}
		var options *armdeployments.ClientListAtTenantScopeOptions
		if filterParam != nil || topParam != nil {
			options = &armdeployments.ClientListAtTenantScopeOptions{
				Filter: filterParam,
				Top:    topParam,
			}
		}
		resp := s.srv.NewListAtTenantScopePager(options)
		newListAtTenantScopePager = &resp
		s.newListAtTenantScopePager.add(req, newListAtTenantScopePager)
		server.PagerResponderInjectNextLinks(newListAtTenantScopePager, req, func(page *armdeployments.ClientListAtTenantScopeResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListAtTenantScopePager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		s.newListAtTenantScopePager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListAtTenantScopePager) {
		s.newListAtTenantScopePager.remove(req)
	}
	return resp, nil
}

func (s *ServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) {
	if s.srv.NewListByResourceGroupPager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")}
	}
	newListByResourceGroupPager := s.newListByResourceGroupPager.get(req)
	if newListByResourceGroupPager == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if 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
		}
		filterUnescaped, err := url.QueryUnescape(qp.Get("$filter"))
		if err != nil {
			return nil, err
		}
		filterParam := getOptional(filterUnescaped)
		topUnescaped, err := url.QueryUnescape(qp.Get("$top"))
		if err != nil {
			return nil, err
		}
		topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) {
			p, parseErr := strconv.ParseInt(v, 10, 32)
			if parseErr != nil {
				return 0, parseErr
			}
			return int32(p), nil
		})
		if err != nil {
			return nil, err
		}
		var options *armdeployments.ClientListByResourceGroupOptions
		if filterParam != nil || topParam != nil {
			options = &armdeployments.ClientListByResourceGroupOptions{
				Filter: filterParam,
				Top:    topParam,
			}
		}
		resp := s.srv.NewListByResourceGroupPager(resourceGroupNameParam, options)
		newListByResourceGroupPager = &resp
		s.newListByResourceGroupPager.add(req, newListByResourceGroupPager)
		server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armdeployments.ClientListByResourceGroupResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListByResourceGroupPager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		s.newListByResourceGroupPager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListByResourceGroupPager) {
		s.newListByResourceGroupPager.remove(req)
	}
	return resp, nil
}

func (s *ServerTransport) dispatchBeginValidate(req *http.Request) (*http.Response, error) {
	if s.srv.BeginValidate == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginValidate not implemented")}
	}
	beginValidate := s.beginValidate.get(req)
	if beginValidate == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validate`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 4 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.Deployment](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginValidate(req.Context(), resourceGroupNameParam, deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginValidate = &respr
		s.beginValidate.add(req, beginValidate)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginValidateAtManagementGroupScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginValidateAtManagementGroupScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginValidateAtManagementGroupScope not implemented")}
	}
	beginValidateAtManagementGroupScope := s.beginValidateAtManagementGroupScope.get(req)
	if beginValidateAtManagementGroupScope == nil {
		const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validate`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.ScopedDeployment](req)
		if err != nil {
			return nil, err
		}
		groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginValidateAtManagementGroupScope(req.Context(), groupIDParam, deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginValidateAtManagementGroupScope = &respr
		s.beginValidateAtManagementGroupScope.add(req, beginValidateAtManagementGroupScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginValidateAtScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginValidateAtScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginValidateAtScope not implemented")}
	}
	beginValidateAtScope := s.beginValidateAtScope.get(req)
	if beginValidateAtScope == nil {
		const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validate`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.Deployment](req)
		if err != nil {
			return nil, err
		}
		scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginValidateAtScope(req.Context(), scopeParam, deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginValidateAtScope = &respr
		s.beginValidateAtScope.add(req, beginValidateAtScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginValidateAtSubscriptionScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginValidateAtSubscriptionScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginValidateAtSubscriptionScope not implemented")}
	}
	beginValidateAtSubscriptionScope := s.beginValidateAtSubscriptionScope.get(req)
	if beginValidateAtSubscriptionScope == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validate`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.Deployment](req)
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginValidateAtSubscriptionScope(req.Context(), deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginValidateAtSubscriptionScope = &respr
		s.beginValidateAtSubscriptionScope.add(req, beginValidateAtSubscriptionScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginValidateAtTenantScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginValidateAtTenantScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginValidateAtTenantScope not implemented")}
	}
	beginValidateAtTenantScope := s.beginValidateAtTenantScope.get(req)
	if beginValidateAtTenantScope == nil {
		const regexStr = `/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validate`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 2 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.ScopedDeployment](req)
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginValidateAtTenantScope(req.Context(), deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginValidateAtTenantScope = &respr
		s.beginValidateAtTenantScope.add(req, beginValidateAtTenantScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginWhatIf(req *http.Request) (*http.Response, error) {
	if s.srv.BeginWhatIf == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginWhatIf not implemented")}
	}
	beginWhatIf := s.beginWhatIf.get(req)
	if beginWhatIf == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/whatIf`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 4 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.DeploymentWhatIf](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginWhatIf(req.Context(), resourceGroupNameParam, deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginWhatIf = &respr
		s.beginWhatIf.add(req, beginWhatIf)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginWhatIfAtManagementGroupScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginWhatIfAtManagementGroupScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginWhatIfAtManagementGroupScope not implemented")}
	}
	beginWhatIfAtManagementGroupScope := s.beginWhatIfAtManagementGroupScope.get(req)
	if beginWhatIfAtManagementGroupScope == nil {
		const regexStr = `/providers/Microsoft\.Management/managementGroups/(?P<groupId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/whatIf`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.ScopedDeploymentWhatIf](req)
		if err != nil {
			return nil, err
		}
		groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")])
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginWhatIfAtManagementGroupScope(req.Context(), groupIDParam, deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginWhatIfAtManagementGroupScope = &respr
		s.beginWhatIfAtManagementGroupScope.add(req, beginWhatIfAtManagementGroupScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginWhatIfAtSubscriptionScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginWhatIfAtSubscriptionScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginWhatIfAtSubscriptionScope not implemented")}
	}
	beginWhatIfAtSubscriptionScope := s.beginWhatIfAtSubscriptionScope.get(req)
	if beginWhatIfAtSubscriptionScope == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/whatIf`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 3 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.DeploymentWhatIf](req)
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginWhatIfAtSubscriptionScope(req.Context(), deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginWhatIfAtSubscriptionScope = &respr
		s.beginWhatIfAtSubscriptionScope.add(req, beginWhatIfAtSubscriptionScope)
	}

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

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

	return resp, nil
}

func (s *ServerTransport) dispatchBeginWhatIfAtTenantScope(req *http.Request) (*http.Response, error) {
	if s.srv.BeginWhatIfAtTenantScope == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginWhatIfAtTenantScope not implemented")}
	}
	beginWhatIfAtTenantScope := s.beginWhatIfAtTenantScope.get(req)
	if beginWhatIfAtTenantScope == nil {
		const regexStr = `/providers/Microsoft\.Resources/deployments/(?P<deploymentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/whatIf`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 2 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armdeployments.ScopedDeploymentWhatIf](req)
		if err != nil {
			return nil, err
		}
		deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginWhatIfAtTenantScope(req.Context(), deploymentNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginWhatIfAtTenantScope = &respr
		s.beginWhatIfAtTenantScope.add(req, beginWhatIfAtTenantScope)
	}

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

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

	return resp, nil
}

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