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: sqlpoolvulnerabilityassessmentscans_server.go
    path of file: ./repos/azure-sdk-for-go/sdk/resourcemanager/synapse/armsynapse/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/synapse/armsynapse"
	"net/http"
	"net/url"
	"regexp"
)

// SQLPoolVulnerabilityAssessmentScansServer is a fake server for instances of the armsynapse.SQLPoolVulnerabilityAssessmentScansClient type.
type SQLPoolVulnerabilityAssessmentScansServer struct {
	// Export is the fake for method SQLPoolVulnerabilityAssessmentScansClient.Export
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	Export func(ctx context.Context, resourceGroupName string, workspaceName string, sqlPoolName string, vulnerabilityAssessmentName armsynapse.VulnerabilityAssessmentName, scanID string, options *armsynapse.SQLPoolVulnerabilityAssessmentScansClientExportOptions) (resp azfake.Responder[armsynapse.SQLPoolVulnerabilityAssessmentScansClientExportResponse], errResp azfake.ErrorResponder)

	// Get is the fake for method SQLPoolVulnerabilityAssessmentScansClient.Get
	// HTTP status codes to indicate success: http.StatusOK
	Get func(ctx context.Context, resourceGroupName string, workspaceName string, sqlPoolName string, vulnerabilityAssessmentName armsynapse.VulnerabilityAssessmentName, scanID string, options *armsynapse.SQLPoolVulnerabilityAssessmentScansClientGetOptions) (resp azfake.Responder[armsynapse.SQLPoolVulnerabilityAssessmentScansClientGetResponse], errResp azfake.ErrorResponder)

	// BeginInitiateScan is the fake for method SQLPoolVulnerabilityAssessmentScansClient.BeginInitiateScan
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
	BeginInitiateScan func(ctx context.Context, resourceGroupName string, workspaceName string, sqlPoolName string, vulnerabilityAssessmentName armsynapse.VulnerabilityAsse
    
func (s *SQLPoolVulnerabilityAssessmentScansServerTransport) dispatchBeginInitiateScan(req *http.Request) (*http.Response, error) {
	if s.srv.BeginInitiateScan == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginInitiateScan not implemented")}
	}
	beginInitiateScan := s.beginInitiateScan.get(req)
	if beginInitiateScan == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Synapse/workspaces/(?P<workspaceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sqlPools/(?P<sqlPoolName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/vulnerabilityAssessments/(?P<vulnerabilityAssessmentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/scans/(?P<scanId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/initiateScan`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if matches == nil || len(matches) < 6 {
			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
		}
		workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")])
		if err != nil {
			return nil, err
		}
		sqlPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlPoolName")])
		if err != nil {
			return nil, err
		}
		vulnerabilityAssessmentNameParam, err := parseWithCast(matches[regex.SubexpIndex("vulnerabilityAssessmentName")], func(v string) (armsynapse.VulnerabilityAssessmentName, error) {
			p, unescapeErr := url.PathUnescape(v)
			if unescapeErr != nil {
				return "", unescapeErr
			}
			return armsynapse.VulnerabilityAssessmentName(p), nil
		})
		if err != nil {
			return nil, err
		}
		scanIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("scanId")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginInitiateScan(req.Context(), resourceGroupNameParam, workspaceNameParam, sqlPoolNameParam, vulnerabilityAssessmentNameParam, scanIDParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginInitiateScan = &respr
		s.beginInitiateScan.add(req, beginInitiateScan)
	}

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

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

	return resp, nil
}