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: eligiblechildresources_server.go
    path of file: ./repos/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/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 (
	"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/authorization/armauthorization/v3"
	"net/http"
	"net/url"
	"regexp"
)

// EligibleChildResourcesServer is a fake server for instances of the armauthorization.EligibleChildResourcesClient type.
type EligibleChildResourcesServer struct {
	// NewGetPager is the fake for method EligibleChildResourcesClient.NewGetPager
	// HTTP status codes to indicate success: http.StatusOK
	NewGetPager func(scope string, options *armauthorization.EligibleChildResourcesClientGetOptions) (resp azfake.PagerResponder[armauthorization.EligibleChildResourcesClientGetResponse])
}

// NewEligibleChildResourcesServerTransport creates a new instance of EligibleChildResourcesServerTransport with the provided implementation.
// The returned EligibleChildResourcesServerTransport instance is connected to an instance of armauthorization.EligibleChildResourcesClient via the
// azcore.C
    
func (e *EligibleChildResourcesServerTransport) dispatchNewGetPager(req *http.Request) (*http.Response, error) {
	if e.srv.NewGetPager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewGetPager not implemented")}
	}
	newGetPager := e.newGetPager.get(req)
	if newGetPager == nil {
		const regexStr = `/(?P<scope>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Authorization/eligibleChildResources`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 1 {
			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)
		var options *armauthorization.EligibleChildResourcesClientGetOptions
		if filterParam != nil {
			options = &armauthorization.EligibleChildResourcesClientGetOptions{
				Filter: filterParam,
			}
		}
		resp := e.srv.NewGetPager(scopeParam, options)
		newGetPager = &resp
		e.newGetPager.add(req, newGetPager)
		server.PagerResponderInjectNextLinks(newGetPager, req, func(page *armauthorization.EligibleChildResourcesClientGetResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newGetPager, req)
	if err != nil {
		return nil, err
	}
	if !contains([]int{http.StatusOK}, resp.StatusCode) {
		e.newGetPager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newGetPager) {
		e.newGetPager.remove(req)
	}
	return resp, nil
}