// 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"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
	"net/http"
	"strings"
	"sync"
)

// ServerFactory is a fake server for instances of the armmigrationassessment.ClientFactory type.
type ServerFactory struct {
	// AksAssessmentOperationsServer contains the fakes for client AksAssessmentOperationsClient
	AksAssessmentOperationsServer AksAssessmentOperationsServer

	// AksClusterOperationsServer contains the fakes for client AksClusterOperationsClient
	AksClusterOperationsServer AksClusterOperationsServer

	// AksCostDetailOperationsServer contains the fakes for client AksCostDetailOperationsClient
	AksCostDetailOperationsServer AksCostDetailOperationsServer

	// AksOptionsOperationsServer contains the fakes for client AksOptionsOperationsClient
	AksOptionsOperationsServer AksOptionsOperationsServer

	// AksSummaryOperationsServer contains the fakes for client AksSummaryOperationsClient
	AksSummaryOperationsServer AksSummaryOperationsServer

	// AssessedMachinesOperationsServer contains the fakes for client AssessedMachinesOperationsClient
	AssessedMachinesOperationsServer AssessedMachinesOperationsServer

	// AssessedSQLDatabaseV2OperationsServer contains the fakes for client AssessedSQLDatabaseV2OperationsClient
	AssessedSQLDatabaseV2OperationsServer AssessedSQLDatabaseV2OperationsServer

	// AssessedSQLInstanceV2OperationsServer contains the fakes for client AssessedSQLInstanceV2OperationsClient
	AssessedSQLInstanceV2OperationsServer AssessedSQLInstanceV2OperationsServer

	// AssessedSQLMachinesOperationsServer contains the fakes for client AssessedSQLMachinesOperationsClient
	AssessedSQLMachinesOperationsServer AssessedSQLMachinesOperationsServer

	// AssessedSQLRecommendedEntityOperationsServer contains the fakes for client AssessedSQLRecommendedEntityOperationsClient
	AssessedSQLRecommendedEntityOperationsServer AssessedSQLRecommendedEntityOperationsServer

	// AssessedWebAppV2OperationsServer contains the fakes for client AssessedWebAppV2OperationsClient
	AssessedWebAppV2OperationsServer AssessedWebAppV2OperationsServer

	// AssessedWebApplicationOperationsServer contains the fakes for client AssessedWebApplicationOperationsClient
	AssessedWebApplicationOperationsServer AssessedWebApplicationOperationsServer

	// AssessmentOptionsOperationsServer contains the fakes for client AssessmentOptionsOperationsClient
	AssessmentOptionsOperationsServer AssessmentOptionsOperationsServer

	// AssessmentProjectSummaryOperationsServer contains the fakes for client AssessmentProjectSummaryOperationsClient
	AssessmentProjectSummaryOperationsServer AssessmentProjectSummaryOperationsServer

	// AssessmentProjectsOperationsServer contains the fakes for client AssessmentProjectsOperationsClient
	AssessmentProjectsOperationsServer AssessmentProjectsOperationsServer

	// AssessmentsOperationsServer contains the fakes for client AssessmentsOperationsClient
	AssessmentsOperationsServer AssessmentsOperationsServer

	// AvsAssessedMachinesOperationsServer contains the fakes for client AvsAssessedMachinesOperationsClient
	AvsAssessedMachinesOperationsServer AvsAssessedMachinesOperationsServer

	// AvsAssessmentOptionsOperationsServer contains the fakes for client AvsAssessmentOptionsOperationsClient
	AvsAssessmentOptionsOperationsServer AvsAssessmentOptionsOperationsServer

	// AvsAssessmentsOperationsServer contains the fakes for client AvsAssessmentsOperationsClient
	AvsAssessmentsOperationsServer AvsAssessmentsOperationsServer

	// BusinessCaseAvsSummaryOperationsServer contains the fakes for client BusinessCaseAvsSummaryOperationsClient
	BusinessCaseAvsSummaryOperationsServer BusinessCaseAvsSummaryOperationsServer

	// BusinessCaseIaasSummaryOperationsServer contains the fakes for client BusinessCaseIaasSummaryOperationsClient
	BusinessCaseIaasSummaryOperationsServer BusinessCaseIaasSummaryOperationsServer

	// BusinessCaseOperationsServer contains the fakes for client BusinessCaseOperationsClient
	BusinessCaseOperationsServer BusinessCaseOperationsServer

	// BusinessCaseOverviewSummaryOperationsServer contains the fakes for client BusinessCaseOverviewSummaryOperationsClient
	BusinessCaseOverviewSummaryOperationsServer BusinessCaseOverviewSummaryOperationsServer

	// BusinessCasePaasSummaryOperationsServer contains the fakes for client BusinessCasePaasSummaryOperationsClient
	BusinessCasePaasSummaryOperationsServer BusinessCasePaasSummaryOperationsServer

	// EvaluatedAvsMachinesOperationsServer contains the fakes for client EvaluatedAvsMachinesOperationsClient
	EvaluatedAvsMachinesOperationsServer EvaluatedAvsMachinesOperationsServer

	// EvaluatedMachinesOperationsServer contains the fakes for client EvaluatedMachinesOperationsClient
	EvaluatedMachinesOperationsServer EvaluatedMachinesOperationsServer

	// EvaluatedSQLEntitiesOperationsServer contains the fakes for client EvaluatedSQLEntitiesOperationsClient
	EvaluatedSQLEntitiesOperationsServer EvaluatedSQLEntitiesOperationsServer

	// EvaluatedWebAppsOperationsServer contains the fakes for client EvaluatedWebAppsOperationsClient
	EvaluatedWebAppsOperationsServer EvaluatedWebAppsOperationsServer

	// GroupsOperationsServer contains the fakes for client GroupsOperationsClient
	GroupsOperationsServer GroupsOperationsServer

	// HypervCollectorsOperationsServer contains the fakes for client HypervCollectorsOperationsClient
	HypervCollectorsOperationsServer HypervCollectorsOperationsServer

	// ImportCollectorsOperationsServer contains the fakes for client ImportCollectorsOperationsClient
	ImportCollectorsOperationsServer ImportCollectorsOperationsServer

	// MachinesOperationsServer contains the fakes for client MachinesOperationsClient
	MachinesOperationsServer MachinesOperationsServer

	// OperationsServer contains the fakes for client OperationsClient
	OperationsServer OperationsServer

	// PrivateEndpointConnectionOperationsServer contains the fakes for client PrivateEndpointConnectionOperationsClient
	PrivateEndpointConnectionOperationsServer PrivateEndpointConnectionOperationsServer

	// PrivateLinkResourceOperationsServer contains the fakes for client PrivateLinkResourceOperationsClient
	PrivateLinkResourceOperationsServer PrivateLinkResourceOperationsServer

	// SQLAssessmentOptionsOperationsServer contains the fakes for client SQLAssessmentOptionsOperationsClient
	SQLAssessmentOptionsOperationsServer SQLAssessmentOptionsOperationsServer

	// SQLAssessmentV2OperationsServer contains the fakes for client SQLAssessmentV2OperationsClient
	SQLAssessmentV2OperationsServer SQLAssessmentV2OperationsServer

	// SQLAssessmentV2SummaryOperationsServer contains the fakes for client SQLAssessmentV2SummaryOperationsClient
	SQLAssessmentV2SummaryOperationsServer SQLAssessmentV2SummaryOperationsServer

	// SQLCollectorOperationsServer contains the fakes for client SQLCollectorOperationsClient
	SQLCollectorOperationsServer SQLCollectorOperationsServer

	// ServerCollectorsOperationsServer contains the fakes for client ServerCollectorsOperationsClient
	ServerCollectorsOperationsServer ServerCollectorsOperationsServer

	// VmwareCollectorsOperationsServer contains the fakes for client VmwareCollectorsOperationsClient
	VmwareCollectorsOperationsServer VmwareCollectorsOperationsServer

	// WebAppAssessmentOptionsOperationsServer contains the fakes for client WebAppAssessmentOptionsOperationsClient
	WebAppAssessmentOptionsOperationsServer WebAppAssessmentOptionsOperationsServer

	// WebAppAssessmentV2OperationsServer contains the fakes for client WebAppAssessmentV2OperationsClient
	WebAppAssessmentV2OperationsServer WebAppAssessmentV2OperationsServer

	// WebAppAssessmentV2SummaryOperationsServer contains the fakes for client WebAppAssessmentV2SummaryOperationsClient
	WebAppAssessmentV2SummaryOperationsServer WebAppAssessmentV2SummaryOperationsServer

	// WebAppCollectorOperationsServer contains the fakes for client WebAppCollectorOperationsClient
	WebAppCollectorOperationsServer WebAppCollectorOperationsServer

	// WebAppServicePlanV2OperationsServer contains the fakes for client WebAppServicePlanV2OperationsClient
	WebAppServicePlanV2OperationsServer WebAppServicePlanV2OperationsServer
}

// NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation.
// The returned ServerFactoryTransport instance is connected to an instance of armmigrationassessment.ClientFactory via the
// azcore.ClientOptions.Transporter field in the client's constructor parameters.
func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport {
	return &ServerFactoryTransport{
		srv: srv,
	}
}

// ServerFactoryTransport connects instances of armmigrationassessment.ClientFactory to instances of ServerFactory.
// Don't use this type directly, use NewServerFactoryTransport instead.
type ServerFactoryTransport struct {
	srv                                            *ServerFactory
	trMu                                           sync.Mutex
	trAksAssessmentOperationsServer                *AksAssessmentOperationsServerTransport
	trAksClusterOperationsServer                   *AksClusterOperationsServerTransport
	trAksCostDetailOperationsServer                *AksCostDetailOperationsServerTransport
	trAksOptionsOperationsServer                   *AksOptionsOperationsServerTransport
	trAksSummaryOperationsServer                   *AksSummaryOperationsServerTransport
	trAssessedMachinesOperationsServer             *AssessedMachinesOperationsServerTransport
	trAssessedSQLDatabaseV2OperationsServer        *AssessedSQLDatabaseV2OperationsServerTransport
	trAssessedSQLInstanceV2OperationsServer        *AssessedSQLInstanceV2OperationsServerTransport
	trAssessedSQLMachinesOperationsServer          *AssessedSQLMachinesOperationsServerTransport
	trAssessedSQLRecommendedEntityOperationsServer *AssessedSQLRecommendedEntityOperationsServerTransport
	trAssessedWebAppV2OperationsServer             *AssessedWebAppV2OperationsServerTransport
	trAssessedWebApplicationOperationsServer       *AssessedWebApplicationOperationsServerTransport
	trAssessmentOptionsOperationsServer            *AssessmentOptionsOperationsServerTransport
	trAssessmentProjectSummaryOperationsServer     *AssessmentProjectSummaryOperationsServerTransport
	trAssessmentProjectsOperationsServer           *AssessmentProjectsOperationsServerTransport
	trAssessmentsOperationsServer                  *AssessmentsOperationsServerTransport
	trAvsAssessedMachinesOperationsServer          *AvsAssessedMachinesOperationsServerTransport
	trAvsAssessmentOptionsOperationsServer         *AvsAssessmentOptionsOperationsServerTransport
	trAvsAssessmentsOperationsServer               *AvsAssessmentsOperationsServerTransport
	trBusinessCaseAvsSummaryOperationsServer       *BusinessCaseAvsSummaryOperationsServerTransport
	trBusinessCaseIaasSummaryOperationsServer      *BusinessCaseIaasSummaryOperationsServerTransport
	trBusinessCaseOperationsServer                 *BusinessCaseOperationsServerTransport
	trBusinessCaseOverviewSummaryOperationsServer  *BusinessCaseOverviewSummaryOperationsServerTransport
	trBusinessCasePaasSummaryOperationsServer      *BusinessCasePaasSummaryOperationsServerTransport
	trEvaluatedAvsMachinesOperationsServer         *EvaluatedAvsMachinesOperationsServerTransport
	trEvaluatedMachinesOperationsServer            *EvaluatedMachinesOperationsServerTransport
	trEvaluatedSQLEntitiesOperationsServer         *EvaluatedSQLEntitiesOperationsServerTransport
	trEvaluatedWebAppsOperationsServer             *EvaluatedWebAppsOperationsServerTransport
	trGroupsOperationsServer                       *GroupsOperationsServerTransport
	trHypervCollectorsOperationsServer             *HypervCollectorsOperationsServerTransport
	trImportCollectorsOperationsServer             *ImportCollectorsOperationsServerTransport
	trMachinesOperationsServer                     *MachinesOperationsServerTransport
	trOperationsServer                             *OperationsServerTransport
	trPrivateEndpointConnectionOperationsServer    *PrivateEndpointConnectionOperationsServerTransport
	trPrivateLinkResourceOperationsServer          *PrivateLinkResourceOperationsServerTransport
	trSQLAssessmentOptionsOperationsServer         *SQLAssessmentOptionsOperationsServerTransport
	trSQLAssessmentV2OperationsServer              *SQLAssessmentV2OperationsServerTransport
	trSQLAssessmentV2SummaryOperationsServer       *SQLAssessmentV2SummaryOperationsServerTransport
	trSQLCollectorOperationsServer                 *SQLCollectorOperationsServerTransport
	trServerCollectorsOperationsServer             *ServerCollectorsOperationsServerTransport
	trVmwareCollectorsOperationsServer             *VmwareCollectorsOperationsServerTransport
	trWebAppAssessmentOptionsOperationsServer      *WebAppAssessmentOptionsOperationsServerTransport
	trWebAppAssessmentV2OperationsServer           *WebAppAssessmentV2OperationsServerTransport
	trWebAppAssessmentV2SummaryOperationsServer    *WebAppAssessmentV2SummaryOperationsServerTransport
	trWebAppCollectorOperationsServer              *WebAppCollectorOperationsServerTransport
	trWebAppServicePlanV2OperationsServer          *WebAppServicePlanV2OperationsServerTransport
}

// Do implements the policy.Transporter interface for ServerFactoryTransport.
func (s *ServerFactoryTransport) 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")}
	}

	client := method[:strings.Index(method, ".")]
	var resp *http.Response
	var err error

	switch client {
	case "AksAssessmentOperationsClient":
		initServer(s, &s.trAksAssessmentOperationsServer, func() *AksAssessmentOperationsServerTransport {
			return NewAksAssessmentOperationsServerTransport(&s.srv.AksAssessmentOperationsServer)
		})
		resp, err = s.trAksAssessmentOperationsServer.Do(req)
	case "AksClusterOperationsClient":
		initServer(s, &s.trAksClusterOperationsServer, func() *AksClusterOperationsServerTransport {
			return NewAksClusterOperationsServerTransport(&s.srv.AksClusterOperationsServer)
		})
		resp, err = s.trAksClusterOperationsServer.Do(req)
	case "AksCostDetailOperationsClient":
		initServer(s, &s.trAksCostDetailOperationsServer, func() *AksCostDetailOperationsServerTransport {
			return NewAksCostDetailOperationsServerTransport(&s.srv.AksCostDetailOperationsServer)
		})
		resp, err = s.trAksCostDetailOperationsServer.Do(req)
	case "AksOptionsOperationsClient":
		initServer(s, &s.trAksOptionsOperationsServer, func() *AksOptionsOperationsServerTransport {
			return NewAksOptionsOperationsServerTransport(&s.srv.AksOptionsOperationsServer)
		})
		resp, err = s.trAksOptionsOperationsServer.Do(req)
	case "AksSummaryOperationsClient":
		initServer(s, &s.trAksSummaryOperationsServer, func() *AksSummaryOperationsServerTransport {
			return NewAksSummaryOperationsServerTransport(&s.srv.AksSummaryOperationsServer)
		})
		resp, err = s.trAksSummaryOperationsServer.Do(req)
	case "AssessedMachinesOperationsClient":
		initServer(s, &s.trAssessedMachinesOperationsServer, func() *AssessedMachinesOperationsServerTransport {
			return NewAssessedMachinesOperationsServerTransport(&s.srv.AssessedMachinesOperationsServer)
		})
		resp, err = s.trAssessedMachinesOperationsServer.Do(req)
	case "AssessedSQLDatabaseV2OperationsClient":
		initServer(s, &s.trAssessedSQLDatabaseV2OperationsServer, func() *AssessedSQLDatabaseV2OperationsServerTransport {
			return NewAssessedSQLDatabaseV2OperationsServerTransport(&s.srv.AssessedSQLDatabaseV2OperationsServer)
		})
		resp, err = s.trAssessedSQLDatabaseV2OperationsServer.Do(req)
	case "AssessedSQLInstanceV2OperationsClient":
		initServer(s, &s.trAssessedSQLInstanceV2OperationsServer, func() *AssessedSQLInstanceV2OperationsServerTransport {
			return NewAssessedSQLInstanceV2OperationsServerTransport(&s.srv.AssessedSQLInstanceV2OperationsServer)
		})
		resp, err = s.trAssessedSQLInstanceV2OperationsServer.Do(req)
	case "AssessedSQLMachinesOperationsClient":
		initServer(s, &s.trAssessedSQLMachinesOperationsServer, func() *AssessedSQLMachinesOperationsServerTransport {
			return NewAssessedSQLMachinesOperationsServerTransport(&s.srv.AssessedSQLMachinesOperationsServer)
		})
		resp, err = s.trAssessedSQLMachinesOperationsServer.Do(req)
	case "AssessedSQLRecommendedEntityOperationsClient":
		initServer(s, &s.trAssessedSQLRecommendedEntityOperationsServer, func() *AssessedSQLRecommendedEntityOperationsServerTransport {
			return NewAssessedSQLRecommendedEntityOperationsServerTransport(&s.srv.AssessedSQLRecommendedEntityOperationsServer)
		})
		resp, err = s.trAssessedSQLRecommendedEntityOperationsServer.Do(req)
	case "AssessedWebAppV2OperationsClient":
		initServer(s, &s.trAssessedWebAppV2OperationsServer, func() *AssessedWebAppV2OperationsServerTransport {
			return NewAssessedWebAppV2OperationsServerTransport(&s.srv.AssessedWebAppV2OperationsServer)
		})
		resp, err = s.trAssessedWebAppV2OperationsServer.Do(req)
	case "AssessedWebApplicationOperationsClient":
		initServer(s, &s.trAssessedWebApplicationOperationsServer, func() *AssessedWebApplicationOperationsServerTransport {
			return NewAssessedWebApplicationOperationsServerTransport(&s.srv.AssessedWebApplicationOperationsServer)
		})
		resp, err = s.trAssessedWebApplicationOperationsServer.Do(req)
	case "AssessmentOptionsOperationsClient":
		initServer(s, &s.trAssessmentOptionsOperationsServer, func() *AssessmentOptionsOperationsServerTransport {
			return NewAssessmentOptionsOperationsServerTransport(&s.srv.AssessmentOptionsOperationsServer)
		})
		resp, err = s.trAssessmentOptionsOperationsServer.Do(req)
	case "AssessmentProjectSummaryOperationsClient":
		initServer(s, &s.trAssessmentProjectSummaryOperationsServer, func() *AssessmentProjectSummaryOperationsServerTransport {
			return NewAssessmentProjectSummaryOperationsServerTransport(&s.srv.AssessmentProjectSummaryOperationsServer)
		})
		resp, err = s.trAssessmentProjectSummaryOperationsServer.Do(req)
	case "AssessmentProjectsOperationsClient":
		initServer(s, &s.trAssessmentProjectsOperationsServer, func() *AssessmentProjectsOperationsServerTransport {
			return NewAssessmentProjectsOperationsServerTransport(&s.srv.AssessmentProjectsOperationsServer)
		})
		resp, err = s.trAssessmentProjectsOperationsServer.Do(req)
	case "AssessmentsOperationsClient":
		initServer(s, &s.trAssessmentsOperationsServer, func() *AssessmentsOperationsServerTransport {
			return NewAssessmentsOperationsServerTransport(&s.srv.AssessmentsOperationsServer)
		})
		resp, err = s.trAssessmentsOperationsServer.Do(req)
	case "AvsAssessedMachinesOperationsClient":
		initServer(s, &s.trAvsAssessedMachinesOperationsServer, func() *AvsAssessedMachinesOperationsServerTransport {
			return NewAvsAssessedMachinesOperationsServerTransport(&s.srv.AvsAssessedMachinesOperationsServer)
		})
		resp, err = s.trAvsAssessedMachinesOperationsServer.Do(req)
	case "AvsAssessmentOptionsOperationsClient":
		initServer(s, &s.trAvsAssessmentOptionsOperationsServer, func() *AvsAssessmentOptionsOperationsServerTransport {
			return NewAvsAssessmentOptionsOperationsServerTransport(&s.srv.AvsAssessmentOptionsOperationsServer)
		})
		resp, err = s.trAvsAssessmentOptionsOperationsServer.Do(req)
	case "AvsAssessmentsOperationsClient":
		initServer(s, &s.trAvsAssessmentsOperationsServer, func() *AvsAssessmentsOperationsServerTransport {
			return NewAvsAssessmentsOperationsServerTransport(&s.srv.AvsAssessmentsOperationsServer)
		})
		resp, err = s.trAvsAssessmentsOperationsServer.Do(req)
	case "BusinessCaseAvsSummaryOperationsClient":
		initServer(s, &s.trBusinessCaseAvsSummaryOperationsServer, func() *BusinessCaseAvsSummaryOperationsServerTransport {
			return NewBusinessCaseAvsSummaryOperationsServerTransport(&s.srv.BusinessCaseAvsSummaryOperationsServer)
		})
		resp, err = s.trBusinessCaseAvsSummaryOperationsServer.Do(req)
	case "BusinessCaseIaasSummaryOperationsClient":
		initServer(s, &s.trBusinessCaseIaasSummaryOperationsServer, func() *BusinessCaseIaasSummaryOperationsServerTransport {
			return NewBusinessCaseIaasSummaryOperationsServerTransport(&s.srv.BusinessCaseIaasSummaryOperationsServer)
		})
		resp, err = s.trBusinessCaseIaasSummaryOperationsServer.Do(req)
	case "BusinessCaseOperationsClient":
		initServer(s, &s.trBusinessCaseOperationsServer, func() *BusinessCaseOperationsServerTransport {
			return NewBusinessCaseOperationsServerTransport(&s.srv.BusinessCaseOperationsServer)
		})
		resp, err = s.trBusinessCaseOperationsServer.Do(req)
	case "BusinessCaseOverviewSummaryOperationsClient":
		initServer(s, &s.trBusinessCaseOverviewSummaryOperationsServer, func() *BusinessCaseOverviewSummaryOperationsServerTransport {
			return NewBusinessCaseOverviewSummaryOperationsServerTransport(&s.srv.BusinessCaseOverviewSummaryOperationsServer)
		})
		resp, err = s.trBusinessCaseOverviewSummaryOperationsServer.Do(req)
	case "BusinessCasePaasSummaryOperationsClient":
		initServer(s, &s.trBusinessCasePaasSummaryOperationsServer, func() *BusinessCasePaasSummaryOperationsServerTransport {
			return NewBusinessCasePaasSummaryOperationsServerTransport(&s.srv.BusinessCasePaasSummaryOperationsServer)
		})
		resp, err = s.trBusinessCasePaasSummaryOperationsServer.Do(req)
	case "EvaluatedAvsMachinesOperationsClient":
		initServer(s, &s.trEvaluatedAvsMachinesOperationsServer, func() *EvaluatedAvsMachinesOperationsServerTransport {
			return NewEvaluatedAvsMachinesOperationsServerTransport(&s.srv.EvaluatedAvsMachinesOperationsServer)
		})
		resp, err = s.trEvaluatedAvsMachinesOperationsServer.Do(req)
	case "EvaluatedMachinesOperationsClient":
		initServer(s, &s.trEvaluatedMachinesOperationsServer, func() *EvaluatedMachinesOperationsServerTransport {
			return NewEvaluatedMachinesOperationsServerTransport(&s.srv.EvaluatedMachinesOperationsServer)
		})
		resp, err = s.trEvaluatedMachinesOperationsServer.Do(req)
	case "EvaluatedSQLEntitiesOperationsClient":
		initServer(s, &s.trEvaluatedSQLEntitiesOperationsServer, func() *EvaluatedSQLEntitiesOperationsServerTransport {
			return NewEvaluatedSQLEntitiesOperationsServerTransport(&s.srv.EvaluatedSQLEntitiesOperationsServer)
		})
		resp, err = s.trEvaluatedSQLEntitiesOperationsServer.Do(req)
	case "EvaluatedWebAppsOperationsClient":
		initServer(s, &s.trEvaluatedWebAppsOperationsServer, func() *EvaluatedWebAppsOperationsServerTransport {
			return NewEvaluatedWebAppsOperationsServerTransport(&s.srv.EvaluatedWebAppsOperationsServer)
		})
		resp, err = s.trEvaluatedWebAppsOperationsServer.Do(req)
	case "GroupsOperationsClient":
		initServer(s, &s.trGroupsOperationsServer, func() *GroupsOperationsServerTransport {
			return NewGroupsOperationsServerTransport(&s.srv.GroupsOperationsServer)
		})
		resp, err = s.trGroupsOperationsServer.Do(req)
	case "HypervCollectorsOperationsClient":
		initServer(s, &s.trHypervCollectorsOperationsServer, func() *HypervCollectorsOperationsServerTransport {
			return NewHypervCollectorsOperationsServerTransport(&s.srv.HypervCollectorsOperationsServer)
		})
		resp, err = s.trHypervCollectorsOperationsServer.Do(req)
	case "ImportCollectorsOperationsClient":
		initServer(s, &s.trImportCollectorsOperationsServer, func() *ImportCollectorsOperationsServerTransport {
			return NewImportCollectorsOperationsServerTransport(&s.srv.ImportCollectorsOperationsServer)
		})
		resp, err = s.trImportCollectorsOperationsServer.Do(req)
	case "MachinesOperationsClient":
		initServer(s, &s.trMachinesOperationsServer, func() *MachinesOperationsServerTransport {
			return NewMachinesOperationsServerTransport(&s.srv.MachinesOperationsServer)
		})
		resp, err = s.trMachinesOperationsServer.Do(req)
	case "OperationsClient":
		initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) })
		resp, err = s.trOperationsServer.Do(req)
	case "PrivateEndpointConnectionOperationsClient":
		initServer(s, &s.trPrivateEndpointConnectionOperationsServer, func() *PrivateEndpointConnectionOperationsServerTransport {
			return NewPrivateEndpointConnectionOperationsServerTransport(&s.srv.PrivateEndpointConnectionOperationsServer)
		})
		resp, err = s.trPrivateEndpointConnectionOperationsServer.Do(req)
	case "PrivateLinkResourceOperationsClient":
		initServer(s, &s.trPrivateLinkResourceOperationsServer, func() *PrivateLinkResourceOperationsServerTransport {
			return NewPrivateLinkResourceOperationsServerTransport(&s.srv.PrivateLinkResourceOperationsServer)
		})
		resp, err = s.trPrivateLinkResourceOperationsServer.Do(req)
	case "SQLAssessmentOptionsOperationsClient":
		initServer(s, &s.trSQLAssessmentOptionsOperationsServer, func() *SQLAssessmentOptionsOperationsServerTransport {
			return NewSQLAssessmentOptionsOperationsServerTransport(&s.srv.SQLAssessmentOptionsOperationsServer)
		})
		resp, err = s.trSQLAssessmentOptionsOperationsServer.Do(req)
	case "SQLAssessmentV2OperationsClient":
		initServer(s, &s.trSQLAssessmentV2OperationsServer, func() *SQLAssessmentV2OperationsServerTransport {
			return NewSQLAssessmentV2OperationsServerTransport(&s.srv.SQLAssessmentV2OperationsServer)
		})
		resp, err = s.trSQLAssessmentV2OperationsServer.Do(req)
	case "SQLAssessmentV2SummaryOperationsClient":
		initServer(s, &s.trSQLAssessmentV2SummaryOperationsServer, func() *SQLAssessmentV2SummaryOperationsServerTransport {
			return NewSQLAssessmentV2SummaryOperationsServerTransport(&s.srv.SQLAssessmentV2SummaryOperationsServer)
		})
		resp, err = s.trSQLAssessmentV2SummaryOperationsServer.Do(req)
	case "SQLCollectorOperationsClient":
		initServer(s, &s.trSQLCollectorOperationsServer, func() *SQLCollectorOperationsServerTransport {
			return NewSQLCollectorOperationsServerTransport(&s.srv.SQLCollectorOperationsServer)
		})
		resp, err = s.trSQLCollectorOperationsServer.Do(req)
	case "ServerCollectorsOperationsClient":
		initServer(s, &s.trServerCollectorsOperationsServer, func() *ServerCollectorsOperationsServerTransport {
			return NewServerCollectorsOperationsServerTransport(&s.srv.ServerCollectorsOperationsServer)
		})
		resp, err = s.trServerCollectorsOperationsServer.Do(req)
	case "VmwareCollectorsOperationsClient":
		initServer(s, &s.trVmwareCollectorsOperationsServer, func() *VmwareCollectorsOperationsServerTransport {
			return NewVmwareCollectorsOperationsServerTransport(&s.srv.VmwareCollectorsOperationsServer)
		})
		resp, err = s.trVmwareCollectorsOperationsServer.Do(req)
	case "WebAppAssessmentOptionsOperationsClient":
		initServer(s, &s.trWebAppAssessmentOptionsOperationsServer, func() *WebAppAssessmentOptionsOperationsServerTransport {
			return NewWebAppAssessmentOptionsOperationsServerTransport(&s.srv.WebAppAssessmentOptionsOperationsServer)
		})
		resp, err = s.trWebAppAssessmentOptionsOperationsServer.Do(req)
	case "WebAppAssessmentV2OperationsClient":
		initServer(s, &s.trWebAppAssessmentV2OperationsServer, func() *WebAppAssessmentV2OperationsServerTransport {
			return NewWebAppAssessmentV2OperationsServerTransport(&s.srv.WebAppAssessmentV2OperationsServer)
		})
		resp, err = s.trWebAppAssessmentV2OperationsServer.Do(req)
	case "WebAppAssessmentV2SummaryOperationsClient":
		initServer(s, &s.trWebAppAssessmentV2SummaryOperationsServer, func() *WebAppAssessmentV2SummaryOperationsServerTransport {
			return NewWebAppAssessmentV2SummaryOperationsServerTransport(&s.srv.WebAppAssessmentV2SummaryOperationsServer)
		})
		resp, err = s.trWebAppAssessmentV2SummaryOperationsServer.Do(req)
	case "WebAppCollectorOperationsClient":
		initServer(s, &s.trWebAppCollectorOperationsServer, func() *WebAppCollectorOperationsServerTransport {
			return NewWebAppCollectorOperationsServerTransport(&s.srv.WebAppCollectorOperationsServer)
		})
		resp, err = s.trWebAppCollectorOperationsServer.Do(req)
	case "WebAppServicePlanV2OperationsClient":
		initServer(s, &s.trWebAppServicePlanV2OperationsServer, func() *WebAppServicePlanV2OperationsServerTransport {
			return NewWebAppServicePlanV2OperationsServerTransport(&s.srv.WebAppServicePlanV2OperationsServer)
		})
		resp, err = s.trWebAppServicePlanV2OperationsServer.Do(req)
	default:
		err = fmt.Errorf("unhandled client %s", client)
	}

	if err != nil {
		return nil, err
	}

	return resp, nil
}

func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) {
	s.trMu.Lock()
	if *dst == nil {
		*dst = src()
	}
	s.trMu.Unlock()
}
