// 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) Go Code Generator. DO NOT EDIT.

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/computeschedule/armcomputeschedule"
	"net/http"
	"net/url"
	"regexp"
)

// ScheduledActionsServer is a fake server for instances of the armcomputeschedule.ScheduledActionsClient type.
type ScheduledActionsServer struct {
	// AttachResources is the fake for method ScheduledActionsClient.AttachResources
	// HTTP status codes to indicate success: http.StatusOK
	AttachResources func(ctx context.Context, resourceGroupName string, scheduledActionName string, body armcomputeschedule.ResourceAttachRequest, options *armcomputeschedule.ScheduledActionsClientAttachResourcesOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientAttachResourcesResponse], errResp azfake.ErrorResponder)

	// CancelNextOccurrence is the fake for method ScheduledActionsClient.CancelNextOccurrence
	// HTTP status codes to indicate success: http.StatusOK
	CancelNextOccurrence func(ctx context.Context, resourceGroupName string, scheduledActionName string, body armcomputeschedule.CancelOccurrenceRequest, options *armcomputeschedule.ScheduledActionsClientCancelNextOccurrenceOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientCancelNextOccurrenceResponse], errResp azfake.ErrorResponder)

	// BeginCreateOrUpdate is the fake for method ScheduledActionsClient.BeginCreateOrUpdate
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, scheduledActionName string, resource armcomputeschedule.ScheduledAction, options *armcomputeschedule.ScheduledActionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcomputeschedule.ScheduledActionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)

	// BeginDelete is the fake for method ScheduledActionsClient.BeginDelete
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDelete func(ctx context.Context, resourceGroupName string, scheduledActionName string, options *armcomputeschedule.ScheduledActionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcomputeschedule.ScheduledActionsClientDeleteResponse], errResp azfake.ErrorResponder)

	// DetachResources is the fake for method ScheduledActionsClient.DetachResources
	// HTTP status codes to indicate success: http.StatusOK
	DetachResources func(ctx context.Context, resourceGroupName string, scheduledActionName string, body armcomputeschedule.ResourceDetachRequest, options *armcomputeschedule.ScheduledActionsClientDetachResourcesOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientDetachResourcesResponse], errResp azfake.ErrorResponder)

	// Disable is the fake for method ScheduledActionsClient.Disable
	// HTTP status codes to indicate success: http.StatusOK
	Disable func(ctx context.Context, resourceGroupName string, scheduledActionName string, options *armcomputeschedule.ScheduledActionsClientDisableOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientDisableResponse], errResp azfake.ErrorResponder)

	// Enable is the fake for method ScheduledActionsClient.Enable
	// HTTP status codes to indicate success: http.StatusOK
	Enable func(ctx context.Context, resourceGroupName string, scheduledActionName string, options *armcomputeschedule.ScheduledActionsClientEnableOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientEnableResponse], errResp azfake.ErrorResponder)

	// Get is the fake for method ScheduledActionsClient.Get
	// HTTP status codes to indicate success: http.StatusOK
	Get func(ctx context.Context, resourceGroupName string, scheduledActionName string, options *armcomputeschedule.ScheduledActionsClientGetOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientGetResponse], errResp azfake.ErrorResponder)

	// NewListByResourceGroupPager is the fake for method ScheduledActionsClient.NewListByResourceGroupPager
	// HTTP status codes to indicate success: http.StatusOK
	NewListByResourceGroupPager func(resourceGroupName string, options *armcomputeschedule.ScheduledActionsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListByResourceGroupResponse])

	// NewListBySubscriptionPager is the fake for method ScheduledActionsClient.NewListBySubscriptionPager
	// HTTP status codes to indicate success: http.StatusOK
	NewListBySubscriptionPager func(options *armcomputeschedule.ScheduledActionsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListBySubscriptionResponse])

	// NewListResourcesPager is the fake for method ScheduledActionsClient.NewListResourcesPager
	// HTTP status codes to indicate success: http.StatusOK
	NewListResourcesPager func(resourceGroupName string, scheduledActionName string, options *armcomputeschedule.ScheduledActionsClientListResourcesOptions) (resp azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListResourcesResponse])

	// PatchResources is the fake for method ScheduledActionsClient.PatchResources
	// HTTP status codes to indicate success: http.StatusOK
	PatchResources func(ctx context.Context, resourceGroupName string, scheduledActionName string, body armcomputeschedule.ResourcePatchRequest, options *armcomputeschedule.ScheduledActionsClientPatchResourcesOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientPatchResourcesResponse], errResp azfake.ErrorResponder)

	// TriggerManualOccurrence is the fake for method ScheduledActionsClient.TriggerManualOccurrence
	// HTTP status codes to indicate success: http.StatusOK
	TriggerManualOccurrence func(ctx context.Context, resourceGroupName string, scheduledActionName string, options *armcomputeschedule.ScheduledActionsClientTriggerManualOccurrenceOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientTriggerManualOccurrenceResponse], errResp azfake.ErrorResponder)

	// Update is the fake for method ScheduledActionsClient.Update
	// HTTP status codes to indicate success: http.StatusOK
	Update func(ctx context.Context, resourceGroupName string, scheduledActionName string, properties armcomputeschedule.ScheduledActionUpdate, options *armcomputeschedule.ScheduledActionsClientUpdateOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientUpdateResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesCancelOperations is the fake for method ScheduledActionsClient.VirtualMachinesCancelOperations
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesCancelOperations func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.CancelOperationsRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesCancelOperationsOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesCancelOperationsResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesExecuteCreate is the fake for method ScheduledActionsClient.VirtualMachinesExecuteCreate
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesExecuteCreate func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.ExecuteCreateRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteCreateOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteCreateResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesExecuteDeallocate is the fake for method ScheduledActionsClient.VirtualMachinesExecuteDeallocate
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesExecuteDeallocate func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.ExecuteDeallocateRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteDeallocateOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteDeallocateResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesExecuteDelete is the fake for method ScheduledActionsClient.VirtualMachinesExecuteDelete
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesExecuteDelete func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.ExecuteDeleteRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteDeleteOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteDeleteResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesExecuteHibernate is the fake for method ScheduledActionsClient.VirtualMachinesExecuteHibernate
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesExecuteHibernate func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.ExecuteHibernateRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteHibernateOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteHibernateResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesExecuteStart is the fake for method ScheduledActionsClient.VirtualMachinesExecuteStart
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesExecuteStart func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.ExecuteStartRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteStartOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesExecuteStartResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesGetOperationErrors is the fake for method ScheduledActionsClient.VirtualMachinesGetOperationErrors
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesGetOperationErrors func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.GetOperationErrorsRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesGetOperationErrorsOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesGetOperationErrorsResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesGetOperationStatus is the fake for method ScheduledActionsClient.VirtualMachinesGetOperationStatus
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesGetOperationStatus func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.GetOperationStatusRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesGetOperationStatusOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesGetOperationStatusResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesSubmitDeallocate is the fake for method ScheduledActionsClient.VirtualMachinesSubmitDeallocate
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesSubmitDeallocate func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.SubmitDeallocateRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesSubmitDeallocateOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesSubmitDeallocateResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesSubmitHibernate is the fake for method ScheduledActionsClient.VirtualMachinesSubmitHibernate
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesSubmitHibernate func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.SubmitHibernateRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesSubmitHibernateOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesSubmitHibernateResponse], errResp azfake.ErrorResponder)

	// VirtualMachinesSubmitStart is the fake for method ScheduledActionsClient.VirtualMachinesSubmitStart
	// HTTP status codes to indicate success: http.StatusOK
	VirtualMachinesSubmitStart func(ctx context.Context, locationparameter string, requestBody armcomputeschedule.SubmitStartRequest, options *armcomputeschedule.ScheduledActionsClientVirtualMachinesSubmitStartOptions) (resp azfake.Responder[armcomputeschedule.ScheduledActionsClientVirtualMachinesSubmitStartResponse], errResp azfake.ErrorResponder)
}

// NewScheduledActionsServerTransport creates a new instance of ScheduledActionsServerTransport with the provided implementation.
// The returned ScheduledActionsServerTransport instance is connected to an instance of armcomputeschedule.ScheduledActionsClient via the
// azcore.ClientOptions.Transporter field in the client's constructor parameters.
func NewScheduledActionsServerTransport(srv *ScheduledActionsServer) *ScheduledActionsServerTransport {
	return &ScheduledActionsServerTransport{
		srv:                         srv,
		beginCreateOrUpdate:         newTracker[azfake.PollerResponder[armcomputeschedule.ScheduledActionsClientCreateOrUpdateResponse]](),
		beginDelete:                 newTracker[azfake.PollerResponder[armcomputeschedule.ScheduledActionsClientDeleteResponse]](),
		newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListByResourceGroupResponse]](),
		newListBySubscriptionPager:  newTracker[azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListBySubscriptionResponse]](),
		newListResourcesPager:       newTracker[azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListResourcesResponse]](),
	}
}

// ScheduledActionsServerTransport connects instances of armcomputeschedule.ScheduledActionsClient to instances of ScheduledActionsServer.
// Don't use this type directly, use NewScheduledActionsServerTransport instead.
type ScheduledActionsServerTransport struct {
	srv                         *ScheduledActionsServer
	beginCreateOrUpdate         *tracker[azfake.PollerResponder[armcomputeschedule.ScheduledActionsClientCreateOrUpdateResponse]]
	beginDelete                 *tracker[azfake.PollerResponder[armcomputeschedule.ScheduledActionsClientDeleteResponse]]
	newListByResourceGroupPager *tracker[azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListByResourceGroupResponse]]
	newListBySubscriptionPager  *tracker[azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListBySubscriptionResponse]]
	newListResourcesPager       *tracker[azfake.PagerResponder[armcomputeschedule.ScheduledActionsClientListResourcesResponse]]
}

// Do implements the policy.Transporter interface for ScheduledActionsServerTransport.
func (s *ScheduledActionsServerTransport) 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 *ScheduledActionsServerTransport) 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 scheduledActionsServerTransportInterceptor != nil {
			res.resp, res.err, intercepted = scheduledActionsServerTransportInterceptor.Do(req)
		}
		if !intercepted {
			switch method {
			case "ScheduledActionsClient.AttachResources":
				res.resp, res.err = s.dispatchAttachResources(req)
			case "ScheduledActionsClient.CancelNextOccurrence":
				res.resp, res.err = s.dispatchCancelNextOccurrence(req)
			case "ScheduledActionsClient.BeginCreateOrUpdate":
				res.resp, res.err = s.dispatchBeginCreateOrUpdate(req)
			case "ScheduledActionsClient.BeginDelete":
				res.resp, res.err = s.dispatchBeginDelete(req)
			case "ScheduledActionsClient.DetachResources":
				res.resp, res.err = s.dispatchDetachResources(req)
			case "ScheduledActionsClient.Disable":
				res.resp, res.err = s.dispatchDisable(req)
			case "ScheduledActionsClient.Enable":
				res.resp, res.err = s.dispatchEnable(req)
			case "ScheduledActionsClient.Get":
				res.resp, res.err = s.dispatchGet(req)
			case "ScheduledActionsClient.NewListByResourceGroupPager":
				res.resp, res.err = s.dispatchNewListByResourceGroupPager(req)
			case "ScheduledActionsClient.NewListBySubscriptionPager":
				res.resp, res.err = s.dispatchNewListBySubscriptionPager(req)
			case "ScheduledActionsClient.NewListResourcesPager":
				res.resp, res.err = s.dispatchNewListResourcesPager(req)
			case "ScheduledActionsClient.PatchResources":
				res.resp, res.err = s.dispatchPatchResources(req)
			case "ScheduledActionsClient.TriggerManualOccurrence":
				res.resp, res.err = s.dispatchTriggerManualOccurrence(req)
			case "ScheduledActionsClient.Update":
				res.resp, res.err = s.dispatchUpdate(req)
			case "ScheduledActionsClient.VirtualMachinesCancelOperations":
				res.resp, res.err = s.dispatchVirtualMachinesCancelOperations(req)
			case "ScheduledActionsClient.VirtualMachinesExecuteCreate":
				res.resp, res.err = s.dispatchVirtualMachinesExecuteCreate(req)
			case "ScheduledActionsClient.VirtualMachinesExecuteDeallocate":
				res.resp, res.err = s.dispatchVirtualMachinesExecuteDeallocate(req)
			case "ScheduledActionsClient.VirtualMachinesExecuteDelete":
				res.resp, res.err = s.dispatchVirtualMachinesExecuteDelete(req)
			case "ScheduledActionsClient.VirtualMachinesExecuteHibernate":
				res.resp, res.err = s.dispatchVirtualMachinesExecuteHibernate(req)
			case "ScheduledActionsClient.VirtualMachinesExecuteStart":
				res.resp, res.err = s.dispatchVirtualMachinesExecuteStart(req)
			case "ScheduledActionsClient.VirtualMachinesGetOperationErrors":
				res.resp, res.err = s.dispatchVirtualMachinesGetOperationErrors(req)
			case "ScheduledActionsClient.VirtualMachinesGetOperationStatus":
				res.resp, res.err = s.dispatchVirtualMachinesGetOperationStatus(req)
			case "ScheduledActionsClient.VirtualMachinesSubmitDeallocate":
				res.resp, res.err = s.dispatchVirtualMachinesSubmitDeallocate(req)
			case "ScheduledActionsClient.VirtualMachinesSubmitHibernate":
				res.resp, res.err = s.dispatchVirtualMachinesSubmitHibernate(req)
			case "ScheduledActionsClient.VirtualMachinesSubmitStart":
				res.resp, res.err = s.dispatchVirtualMachinesSubmitStart(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 *ScheduledActionsServerTransport) dispatchAttachResources(req *http.Request) (*http.Response, error) {
	if s.srv.AttachResources == nil {
		return nil, &nonRetriableError{errors.New("fake for method AttachResources not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/attachResources`
	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[armcomputeschedule.ResourceAttachRequest](req)
	if err != nil {
		return nil, err
	}
	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
	if err != nil {
		return nil, err
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.AttachResources(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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).RecurringActionsResourceOperationResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchCancelNextOccurrence(req *http.Request) (*http.Response, error) {
	if s.srv.CancelNextOccurrence == nil {
		return nil, &nonRetriableError{errors.New("fake for method CancelNextOccurrence not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancelNextOccurrence`
	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[armcomputeschedule.CancelOccurrenceRequest](req)
	if err != nil {
		return nil, err
	}
	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
	if err != nil {
		return nil, err
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.CancelNextOccurrence(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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).RecurringActionsResourceOperationResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) 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\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_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[armcomputeschedule.ScheduledAction](req)
		if err != nil {
			return nil, err
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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 *ScheduledActionsServerTransport) 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\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_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
		}
		scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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 *ScheduledActionsServerTransport) dispatchDetachResources(req *http.Request) (*http.Response, error) {
	if s.srv.DetachResources == nil {
		return nil, &nonRetriableError{errors.New("fake for method DetachResources not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/detachResources`
	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[armcomputeschedule.ResourceDetachRequest](req)
	if err != nil {
		return nil, err
	}
	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
	if err != nil {
		return nil, err
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.DetachResources(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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).RecurringActionsResourceOperationResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchDisable(req *http.Request) (*http.Response, error) {
	if s.srv.Disable == nil {
		return nil, &nonRetriableError{errors.New("fake for method Disable not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disable`
	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
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.Disable(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchEnable(req *http.Request) (*http.Response, error) {
	if s.srv.Enable == nil {
		return nil, &nonRetriableError{errors.New("fake for method Enable not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enable`
	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
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.Enable(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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.NewResponse(respContent, req, nil)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) 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\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_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
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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).ScheduledAction, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) 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\.ComputeSchedule/scheduledActions`
		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)
		}
		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
		if err != nil {
			return nil, err
		}
		resp := s.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil)
		newListByResourceGroupPager = &resp
		s.newListByResourceGroupPager.add(req, newListByResourceGroupPager)
		server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcomputeschedule.ScheduledActionsClientListByResourceGroupResponse, 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 *ScheduledActionsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) {
	if s.srv.NewListBySubscriptionPager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")}
	}
	newListBySubscriptionPager := s.newListBySubscriptionPager.get(req)
	if newListBySubscriptionPager == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions`
		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)
		}
		resp := s.srv.NewListBySubscriptionPager(nil)
		newListBySubscriptionPager = &resp
		s.newListBySubscriptionPager.add(req, newListBySubscriptionPager)
		server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armcomputeschedule.ScheduledActionsClientListBySubscriptionResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListBySubscriptionPager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		s.newListBySubscriptionPager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListBySubscriptionPager) {
		s.newListBySubscriptionPager.remove(req)
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchNewListResourcesPager(req *http.Request) (*http.Response, error) {
	if s.srv.NewListResourcesPager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListResourcesPager not implemented")}
	}
	newListResourcesPager := s.newListResourcesPager.get(req)
	if newListResourcesPager == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resources`
		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
		}
		scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
		if err != nil {
			return nil, err
		}
		resp := s.srv.NewListResourcesPager(resourceGroupNameParam, scheduledActionNameParam, nil)
		newListResourcesPager = &resp
		s.newListResourcesPager.add(req, newListResourcesPager)
		server.PagerResponderInjectNextLinks(newListResourcesPager, req, func(page *armcomputeschedule.ScheduledActionsClientListResourcesResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListResourcesPager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		s.newListResourcesPager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListResourcesPager) {
		s.newListResourcesPager.remove(req)
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchPatchResources(req *http.Request) (*http.Response, error) {
	if s.srv.PatchResources == nil {
		return nil, &nonRetriableError{errors.New("fake for method PatchResources not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/patchResources`
	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[armcomputeschedule.ResourcePatchRequest](req)
	if err != nil {
		return nil, err
	}
	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
	if err != nil {
		return nil, err
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.PatchResources(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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).RecurringActionsResourceOperationResult, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchTriggerManualOccurrence(req *http.Request) (*http.Response, error) {
	if s.srv.TriggerManualOccurrence == nil {
		return nil, &nonRetriableError{errors.New("fake for method TriggerManualOccurrence not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/triggerManualOccurrence`
	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
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.TriggerManualOccurrence(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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).Occurrence, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) {
	if s.srv.Update == nil {
		return nil, &nonRetriableError{errors.New("fake for method Update not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/scheduledActions/(?P<scheduledActionName>[!#&$-;=?-\[\]_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[armcomputeschedule.ScheduledActionUpdate](req)
	if err != nil {
		return nil, err
	}
	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
	if err != nil {
		return nil, err
	}
	scheduledActionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("scheduledActionName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.Update(req.Context(), resourceGroupNameParam, scheduledActionNameParam, 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).ScheduledAction, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesCancelOperations(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesCancelOperations == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesCancelOperations not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesCancelOperations`
	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[armcomputeschedule.CancelOperationsRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesCancelOperations(req.Context(), locationparameterParam, 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).CancelOperationsResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesExecuteCreate(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesExecuteCreate == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesExecuteCreate not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesExecuteCreate`
	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[armcomputeschedule.ExecuteCreateRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesExecuteCreate(req.Context(), locationparameterParam, 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).CreateResourceOperationResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesExecuteDeallocate(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesExecuteDeallocate == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesExecuteDeallocate not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesExecuteDeallocate`
	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[armcomputeschedule.ExecuteDeallocateRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesExecuteDeallocate(req.Context(), locationparameterParam, 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).DeallocateResourceOperationResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesExecuteDelete(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesExecuteDelete == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesExecuteDelete not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesExecuteDelete`
	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[armcomputeschedule.ExecuteDeleteRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesExecuteDelete(req.Context(), locationparameterParam, 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).DeleteResourceOperationResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesExecuteHibernate(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesExecuteHibernate == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesExecuteHibernate not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesExecuteHibernate`
	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[armcomputeschedule.ExecuteHibernateRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesExecuteHibernate(req.Context(), locationparameterParam, 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).HibernateResourceOperationResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesExecuteStart(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesExecuteStart == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesExecuteStart not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesExecuteStart`
	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[armcomputeschedule.ExecuteStartRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesExecuteStart(req.Context(), locationparameterParam, 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).StartResourceOperationResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesGetOperationErrors(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesGetOperationErrors == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesGetOperationErrors not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesGetOperationErrors`
	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[armcomputeschedule.GetOperationErrorsRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesGetOperationErrors(req.Context(), locationparameterParam, 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).GetOperationErrorsResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesGetOperationStatus(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesGetOperationStatus == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesGetOperationStatus not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesGetOperationStatus`
	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[armcomputeschedule.GetOperationStatusRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesGetOperationStatus(req.Context(), locationparameterParam, 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).GetOperationStatusResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesSubmitDeallocate(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesSubmitDeallocate == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesSubmitDeallocate not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesSubmitDeallocate`
	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[armcomputeschedule.SubmitDeallocateRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesSubmitDeallocate(req.Context(), locationparameterParam, 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).DeallocateResourceOperationResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesSubmitHibernate(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesSubmitHibernate == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesSubmitHibernate not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesSubmitHibernate`
	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[armcomputeschedule.SubmitHibernateRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesSubmitHibernate(req.Context(), locationparameterParam, 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).HibernateResourceOperationResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *ScheduledActionsServerTransport) dispatchVirtualMachinesSubmitStart(req *http.Request) (*http.Response, error) {
	if s.srv.VirtualMachinesSubmitStart == nil {
		return nil, &nonRetriableError{errors.New("fake for method VirtualMachinesSubmitStart not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ComputeSchedule/locations/(?P<locationparameter>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachinesSubmitStart`
	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[armcomputeschedule.SubmitStartRequest](req)
	if err != nil {
		return nil, err
	}
	locationparameterParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationparameter")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.VirtualMachinesSubmitStart(req.Context(), locationparameterParam, 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).StartResourceOperationResponse, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

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