You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: activity_server.go
    path of file: ./repos/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation/fake
    
    the code of the file until where you have to start completion: //go:build go1.18
// +build go1.18

// 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/automation/armautomation"
	"net/http"
	"net/url"
	"regexp"
)

// ActivityServer is a fake server for instances of the armautomation.ActivityClient type.
type ActivityServer struct {
	// Get is the fake for method ActivityClient.Get
	// HTTP status codes to indicate success: http.StatusOK
	Get func(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string, options *armautomation.ActivityClientGetOptions) (resp azfake.Responder[armautomation.ActivityClientGetResponse], errResp azfake.ErrorResponder)

	// NewListByModulePager is the fake for method ActivityClient.NewListByModulePager
	// HTTP status codes to indicate success: http.StatusOK
	NewListByModulePager func(resourceGroupName string, automationAccountName string, moduleName string, options *armautomation.ActivityClientListByModuleOptions) (resp azfake.PagerResponder[armautomation.ActivityClientListByModuleResponse])
}

// NewActivityServerTransport creates a new instance of ActivityServerTransport with the provided implementation.
// The returned Activ
    
func (a *ActivityServerTransport) dispatchNewListByModulePager(req *http.Request) (*http.Response, error) {
	if a.srv.NewListByModulePager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListByModulePager not implemented")}
	}
	newListByModulePager := a.newListByModulePager.get(req)
	if newListByModulePager == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Automation/automationAccounts/(?P<automationAccountName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/modules/(?P<moduleName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/activities`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || 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
		}
		automationAccountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("automationAccountName")])
		if err != nil {
			return nil, err
		}
		moduleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("moduleName")])
		if err != nil {
			return nil, err
		}
		resp := a.srv.NewListByModulePager(resourceGroupNameParam, automationAccountNameParam, moduleNameParam, nil)
		newListByModulePager = &resp
		a.newListByModulePager.add(req, newListByModulePager)
		server.PagerResponderInjectNextLinks(newListByModulePager, req, func(page *armautomation.ActivityClientListByModuleResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListByModulePager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		a.newListByModulePager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListByModulePager) {
		a.newListByModulePager.remove(req)
	}
	return resp, nil
}