// 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/operationalinsights/armoperationalinsights/v3"
	"net/http"
	"net/url"
	"regexp"
	"slices"
)

// SummaryLogsServer is a fake server for instances of the armoperationalinsights.SummaryLogsClient type.
type SummaryLogsServer struct {
	// BeginCreateOrUpdate is the fake for method SummaryLogsClient.BeginCreateOrUpdate
	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
	BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, summaryLogsName string, parameters armoperationalinsights.SummaryLogs, options *armoperationalinsights.SummaryLogsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoperationalinsights.SummaryLogsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)

	// BeginDelete is the fake for method SummaryLogsClient.BeginDelete
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, summaryLogsName string, options *armoperationalinsights.SummaryLogsClientBeginDeleteOptions) (resp azfake.PollerResponder[armoperationalinsights.SummaryLogsClientDeleteResponse], errResp azfake.ErrorResponder)

	// Get is the fake for method SummaryLogsClient.Get
	// HTTP status codes to indicate success: http.StatusOK
	Get func(ctx context.Context, resourceGroupName string, workspaceName string, summaryLogsName string, options *armoperationalinsights.SummaryLogsClientGetOptions) (resp azfake.Responder[armoperationalinsights.SummaryLogsClientGetResponse], errResp azfake.ErrorResponder)

	// NewListByWorkspacePager is the fake for method SummaryLogsClient.NewListByWorkspacePager
	// HTTP status codes to indicate success: http.StatusOK
	NewListByWorkspacePager func(resourceGroupName string, workspaceName string, options *armoperationalinsights.SummaryLogsClientListByWorkspaceOptions) (resp azfake.PagerResponder[armoperationalinsights.SummaryLogsClientListByWorkspaceResponse])

	// BeginRetryBin is the fake for method SummaryLogsClient.BeginRetryBin
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginRetryBin func(ctx context.Context, resourceGroupName string, workspaceName string, summaryLogsName string, parameters armoperationalinsights.SummaryLogsRetryBin, options *armoperationalinsights.SummaryLogsClientBeginRetryBinOptions) (resp azfake.PollerResponder[armoperationalinsights.SummaryLogsClientRetryBinResponse], errResp azfake.ErrorResponder)

	// BeginStart is the fake for method SummaryLogsClient.BeginStart
	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
	BeginStart func(ctx context.Context, resourceGroupName string, workspaceName string, summaryLogsName string, options *armoperationalinsights.SummaryLogsClientBeginStartOptions) (resp azfake.PollerResponder[armoperationalinsights.SummaryLogsClientStartResponse], errResp azfake.ErrorResponder)

	// Stop is the fake for method SummaryLogsClient.Stop
	// HTTP status codes to indicate success: http.StatusOK
	Stop func(ctx context.Context, resourceGroupName string, workspaceName string, summaryLogsName string, options *armoperationalinsights.SummaryLogsClientStopOptions) (resp azfake.Responder[armoperationalinsights.SummaryLogsClientStopResponse], errResp azfake.ErrorResponder)
}

// NewSummaryLogsServerTransport creates a new instance of SummaryLogsServerTransport with the provided implementation.
// The returned SummaryLogsServerTransport instance is connected to an instance of armoperationalinsights.SummaryLogsClient via the
// azcore.ClientOptions.Transporter field in the client's constructor parameters.
func NewSummaryLogsServerTransport(srv *SummaryLogsServer) *SummaryLogsServerTransport {
	return &SummaryLogsServerTransport{
		srv:                     srv,
		beginCreateOrUpdate:     newTracker[azfake.PollerResponder[armoperationalinsights.SummaryLogsClientCreateOrUpdateResponse]](),
		beginDelete:             newTracker[azfake.PollerResponder[armoperationalinsights.SummaryLogsClientDeleteResponse]](),
		newListByWorkspacePager: newTracker[azfake.PagerResponder[armoperationalinsights.SummaryLogsClientListByWorkspaceResponse]](),
		beginRetryBin:           newTracker[azfake.PollerResponder[armoperationalinsights.SummaryLogsClientRetryBinResponse]](),
		beginStart:              newTracker[azfake.PollerResponder[armoperationalinsights.SummaryLogsClientStartResponse]](),
	}
}

// SummaryLogsServerTransport connects instances of armoperationalinsights.SummaryLogsClient to instances of SummaryLogsServer.
// Don't use this type directly, use NewSummaryLogsServerTransport instead.
type SummaryLogsServerTransport struct {
	srv                     *SummaryLogsServer
	beginCreateOrUpdate     *tracker[azfake.PollerResponder[armoperationalinsights.SummaryLogsClientCreateOrUpdateResponse]]
	beginDelete             *tracker[azfake.PollerResponder[armoperationalinsights.SummaryLogsClientDeleteResponse]]
	newListByWorkspacePager *tracker[azfake.PagerResponder[armoperationalinsights.SummaryLogsClientListByWorkspaceResponse]]
	beginRetryBin           *tracker[azfake.PollerResponder[armoperationalinsights.SummaryLogsClientRetryBinResponse]]
	beginStart              *tracker[azfake.PollerResponder[armoperationalinsights.SummaryLogsClientStartResponse]]
}

// Do implements the policy.Transporter interface for SummaryLogsServerTransport.
func (s *SummaryLogsServerTransport) 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 *SummaryLogsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
	resultChan := make(chan result, 1)
	go func() {
		var intercepted bool
		var res result
		if summaryLogsServerTransportInterceptor != nil {
			res.resp, res.err, intercepted = summaryLogsServerTransportInterceptor.Do(req)
		}
		if !intercepted {
			switch method {
			case "SummaryLogsClient.BeginCreateOrUpdate":
				res.resp, res.err = s.dispatchBeginCreateOrUpdate(req)
			case "SummaryLogsClient.BeginDelete":
				res.resp, res.err = s.dispatchBeginDelete(req)
			case "SummaryLogsClient.Get":
				res.resp, res.err = s.dispatchGet(req)
			case "SummaryLogsClient.NewListByWorkspacePager":
				res.resp, res.err = s.dispatchNewListByWorkspacePager(req)
			case "SummaryLogsClient.BeginRetryBin":
				res.resp, res.err = s.dispatchBeginRetryBin(req)
			case "SummaryLogsClient.BeginStart":
				res.resp, res.err = s.dispatchBeginStart(req)
			case "SummaryLogsClient.Stop":
				res.resp, res.err = s.dispatchStop(req)
			default:
				res.err = fmt.Errorf("unhandled API %s", method)
			}

		}
		resultChan <- res
	}()

	select {
	case <-req.Context().Done():
		return nil, req.Context().Err()
	case res := <-resultChan:
		return res.resp, res.err
	}
}

func (s *SummaryLogsServerTransport) 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\.OperationalInsights/workspaces/(?P<workspaceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/summaryLogs/(?P<summaryLogsName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 5 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armoperationalinsights.SummaryLogs](req)
		if err != nil {
			return nil, err
		}
		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
		}
		summaryLogsNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("summaryLogsName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, summaryLogsNameParam, 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 !slices.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 *SummaryLogsServerTransport) 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\.OperationalInsights/workspaces/(?P<workspaceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/summaryLogs/(?P<summaryLogsName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 5 {
			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
		}
		summaryLogsNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("summaryLogsName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, summaryLogsNameParam, 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 !slices.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 *SummaryLogsServerTransport) 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\.OperationalInsights/workspaces/(?P<workspaceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/summaryLogs/(?P<summaryLogsName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 5 {
		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
	}
	summaryLogsNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("summaryLogsName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, summaryLogsNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !slices.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).SummaryLogs, req)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (s *SummaryLogsServerTransport) dispatchNewListByWorkspacePager(req *http.Request) (*http.Response, error) {
	if s.srv.NewListByWorkspacePager == nil {
		return nil, &nonRetriableError{errors.New("fake for method NewListByWorkspacePager not implemented")}
	}
	newListByWorkspacePager := s.newListByWorkspacePager.get(req)
	if newListByWorkspacePager == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P<workspaceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/summaryLogs`
		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
		}
		workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")])
		if err != nil {
			return nil, err
		}
		resp := s.srv.NewListByWorkspacePager(resourceGroupNameParam, workspaceNameParam, nil)
		newListByWorkspacePager = &resp
		s.newListByWorkspacePager.add(req, newListByWorkspacePager)
		server.PagerResponderInjectNextLinks(newListByWorkspacePager, req, func(page *armoperationalinsights.SummaryLogsClientListByWorkspaceResponse, createLink func() string) {
			page.NextLink = to.Ptr(createLink())
		})
	}
	resp, err := server.PagerResponderNext(newListByWorkspacePager, req)
	if err != nil {
		return nil, err
	}
	if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) {
		s.newListByWorkspacePager.remove(req)
		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
	}
	if !server.PagerResponderMore(newListByWorkspacePager) {
		s.newListByWorkspacePager.remove(req)
	}
	return resp, nil
}

func (s *SummaryLogsServerTransport) dispatchBeginRetryBin(req *http.Request) (*http.Response, error) {
	if s.srv.BeginRetryBin == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginRetryBin not implemented")}
	}
	beginRetryBin := s.beginRetryBin.get(req)
	if beginRetryBin == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P<workspaceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/summaryLogs/(?P<summaryLogsName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/retrybin`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 5 {
			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
		}
		body, err := server.UnmarshalRequestAsJSON[armoperationalinsights.SummaryLogsRetryBin](req)
		if err != nil {
			return nil, err
		}
		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
		}
		summaryLogsNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("summaryLogsName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginRetryBin(req.Context(), resourceGroupNameParam, workspaceNameParam, summaryLogsNameParam, body, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginRetryBin = &respr
		s.beginRetryBin.add(req, beginRetryBin)
	}

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

	if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		s.beginRetryBin.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(beginRetryBin) {
		s.beginRetryBin.remove(req)
	}

	return resp, nil
}

func (s *SummaryLogsServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) {
	if s.srv.BeginStart == nil {
		return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")}
	}
	beginStart := s.beginStart.get(req)
	if beginStart == nil {
		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P<workspaceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/summaryLogs/(?P<summaryLogsName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start`
		regex := regexp.MustCompile(regexStr)
		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
		if len(matches) < 5 {
			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
		}
		summaryLogsNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("summaryLogsName")])
		if err != nil {
			return nil, err
		}
		respr, errRespr := s.srv.BeginStart(req.Context(), resourceGroupNameParam, workspaceNameParam, summaryLogsNameParam, nil)
		if respErr := server.GetError(errRespr, req); respErr != nil {
			return nil, respErr
		}
		beginStart = &respr
		s.beginStart.add(req, beginStart)
	}

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

	if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
		s.beginStart.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(beginStart) {
		s.beginStart.remove(req)
	}

	return resp, nil
}

func (s *SummaryLogsServerTransport) dispatchStop(req *http.Request) (*http.Response, error) {
	if s.srv.Stop == nil {
		return nil, &nonRetriableError{errors.New("fake for method Stop not implemented")}
	}
	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P<workspaceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/summaryLogs/(?P<summaryLogsName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stop`
	regex := regexp.MustCompile(regexStr)
	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
	if len(matches) < 5 {
		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
	}
	summaryLogsNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("summaryLogsName")])
	if err != nil {
		return nil, err
	}
	respr, errRespr := s.srv.Stop(req.Context(), resourceGroupNameParam, workspaceNameParam, summaryLogsNameParam, nil)
	if respErr := server.GetError(errRespr, req); respErr != nil {
		return nil, respErr
	}
	respContent := server.GetResponseContent(respr)
	if !slices.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
}

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