github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6@v6.2.0/fake/privatelinkservices_server.go (about)

     1  //go:build go1.18
     2  // +build go1.18
     3  
     4  // Copyright (c) Microsoft Corporation. All rights reserved.
     5  // Licensed under the MIT License. See License.txt in the project root for license information.
     6  // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  package fake
    10  
    11  import (
    12  	"context"
    13  	"errors"
    14  	"fmt"
    15  	azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
    16  	"github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
    17  	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
    18  	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
    19  	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
    20  	"net/http"
    21  	"net/url"
    22  	"regexp"
    23  )
    24  
    25  // PrivateLinkServicesServer is a fake server for instances of the armnetwork.PrivateLinkServicesClient type.
    26  type PrivateLinkServicesServer struct {
    27  	// BeginCheckPrivateLinkServiceVisibility is the fake for method PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility
    28  	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
    29  	BeginCheckPrivateLinkServiceVisibility func(ctx context.Context, location string, parameters armnetwork.CheckPrivateLinkServiceVisibilityRequest, options *armnetwork.PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (resp azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse], errResp azfake.ErrorResponder)
    30  
    31  	// BeginCheckPrivateLinkServiceVisibilityByResourceGroup is the fake for method PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup
    32  	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted
    33  	BeginCheckPrivateLinkServiceVisibilityByResourceGroup func(ctx context.Context, location string, resourceGroupName string, parameters armnetwork.CheckPrivateLinkServiceVisibilityRequest, options *armnetwork.PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (resp azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse], errResp azfake.ErrorResponder)
    34  
    35  	// BeginCreateOrUpdate is the fake for method PrivateLinkServicesClient.BeginCreateOrUpdate
    36  	// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
    37  	BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serviceName string, parameters armnetwork.PrivateLinkService, options *armnetwork.PrivateLinkServicesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder)
    38  
    39  	// BeginDelete is the fake for method PrivateLinkServicesClient.BeginDelete
    40  	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
    41  	BeginDelete func(ctx context.Context, resourceGroupName string, serviceName string, options *armnetwork.PrivateLinkServicesClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.PrivateLinkServicesClientDeleteResponse], errResp azfake.ErrorResponder)
    42  
    43  	// BeginDeletePrivateEndpointConnection is the fake for method PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection
    44  	// HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent
    45  	BeginDeletePrivateEndpointConnection func(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *armnetwork.PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (resp azfake.PollerResponder[armnetwork.PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse], errResp azfake.ErrorResponder)
    46  
    47  	// Get is the fake for method PrivateLinkServicesClient.Get
    48  	// HTTP status codes to indicate success: http.StatusOK
    49  	Get func(ctx context.Context, resourceGroupName string, serviceName string, options *armnetwork.PrivateLinkServicesClientGetOptions) (resp azfake.Responder[armnetwork.PrivateLinkServicesClientGetResponse], errResp azfake.ErrorResponder)
    50  
    51  	// GetPrivateEndpointConnection is the fake for method PrivateLinkServicesClient.GetPrivateEndpointConnection
    52  	// HTTP status codes to indicate success: http.StatusOK
    53  	GetPrivateEndpointConnection func(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionOptions) (resp azfake.Responder[armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionResponse], errResp azfake.ErrorResponder)
    54  
    55  	// NewListPager is the fake for method PrivateLinkServicesClient.NewListPager
    56  	// HTTP status codes to indicate success: http.StatusOK
    57  	NewListPager func(resourceGroupName string, options *armnetwork.PrivateLinkServicesClientListOptions) (resp azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListResponse])
    58  
    59  	// NewListAutoApprovedPrivateLinkServicesPager is the fake for method PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager
    60  	// HTTP status codes to indicate success: http.StatusOK
    61  	NewListAutoApprovedPrivateLinkServicesPager func(location string, options *armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions) (resp azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse])
    62  
    63  	// NewListAutoApprovedPrivateLinkServicesByResourceGroupPager is the fake for method PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager
    64  	// HTTP status codes to indicate success: http.StatusOK
    65  	NewListAutoApprovedPrivateLinkServicesByResourceGroupPager func(location string, resourceGroupName string, options *armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions) (resp azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse])
    66  
    67  	// NewListBySubscriptionPager is the fake for method PrivateLinkServicesClient.NewListBySubscriptionPager
    68  	// HTTP status codes to indicate success: http.StatusOK
    69  	NewListBySubscriptionPager func(options *armnetwork.PrivateLinkServicesClientListBySubscriptionOptions) (resp azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListBySubscriptionResponse])
    70  
    71  	// NewListPrivateEndpointConnectionsPager is the fake for method PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager
    72  	// HTTP status codes to indicate success: http.StatusOK
    73  	NewListPrivateEndpointConnectionsPager func(resourceGroupName string, serviceName string, options *armnetwork.PrivateLinkServicesClientListPrivateEndpointConnectionsOptions) (resp azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListPrivateEndpointConnectionsResponse])
    74  
    75  	// UpdatePrivateEndpointConnection is the fake for method PrivateLinkServicesClient.UpdatePrivateEndpointConnection
    76  	// HTTP status codes to indicate success: http.StatusOK
    77  	UpdatePrivateEndpointConnection func(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters armnetwork.PrivateEndpointConnection, options *armnetwork.PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions) (resp azfake.Responder[armnetwork.PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse], errResp azfake.ErrorResponder)
    78  }
    79  
    80  // NewPrivateLinkServicesServerTransport creates a new instance of PrivateLinkServicesServerTransport with the provided implementation.
    81  // The returned PrivateLinkServicesServerTransport instance is connected to an instance of armnetwork.PrivateLinkServicesClient via the
    82  // azcore.ClientOptions.Transporter field in the client's constructor parameters.
    83  func NewPrivateLinkServicesServerTransport(srv *PrivateLinkServicesServer) *PrivateLinkServicesServerTransport {
    84  	return &PrivateLinkServicesServerTransport{
    85  		srv:                                    srv,
    86  		beginCheckPrivateLinkServiceVisibility: newTracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse]](),
    87  		beginCheckPrivateLinkServiceVisibilityByResourceGroup: newTracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse]](),
    88  		beginCreateOrUpdate:                         newTracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCreateOrUpdateResponse]](),
    89  		beginDelete:                                 newTracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientDeleteResponse]](),
    90  		beginDeletePrivateEndpointConnection:        newTracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse]](),
    91  		newListPager:                                newTracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListResponse]](),
    92  		newListAutoApprovedPrivateLinkServicesPager: newTracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse]](),
    93  		newListAutoApprovedPrivateLinkServicesByResourceGroupPager: newTracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse]](),
    94  		newListBySubscriptionPager:                                 newTracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListBySubscriptionResponse]](),
    95  		newListPrivateEndpointConnectionsPager:                     newTracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListPrivateEndpointConnectionsResponse]](),
    96  	}
    97  }
    98  
    99  // PrivateLinkServicesServerTransport connects instances of armnetwork.PrivateLinkServicesClient to instances of PrivateLinkServicesServer.
   100  // Don't use this type directly, use NewPrivateLinkServicesServerTransport instead.
   101  type PrivateLinkServicesServerTransport struct {
   102  	srv                                                        *PrivateLinkServicesServer
   103  	beginCheckPrivateLinkServiceVisibility                     *tracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse]]
   104  	beginCheckPrivateLinkServiceVisibilityByResourceGroup      *tracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse]]
   105  	beginCreateOrUpdate                                        *tracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientCreateOrUpdateResponse]]
   106  	beginDelete                                                *tracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientDeleteResponse]]
   107  	beginDeletePrivateEndpointConnection                       *tracker[azfake.PollerResponder[armnetwork.PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse]]
   108  	newListPager                                               *tracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListResponse]]
   109  	newListAutoApprovedPrivateLinkServicesPager                *tracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse]]
   110  	newListAutoApprovedPrivateLinkServicesByResourceGroupPager *tracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse]]
   111  	newListBySubscriptionPager                                 *tracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListBySubscriptionResponse]]
   112  	newListPrivateEndpointConnectionsPager                     *tracker[azfake.PagerResponder[armnetwork.PrivateLinkServicesClientListPrivateEndpointConnectionsResponse]]
   113  }
   114  
   115  // Do implements the policy.Transporter interface for PrivateLinkServicesServerTransport.
   116  func (p *PrivateLinkServicesServerTransport) Do(req *http.Request) (*http.Response, error) {
   117  	rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
   118  	method, ok := rawMethod.(string)
   119  	if !ok {
   120  		return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
   121  	}
   122  
   123  	var resp *http.Response
   124  	var err error
   125  
   126  	switch method {
   127  	case "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility":
   128  		resp, err = p.dispatchBeginCheckPrivateLinkServiceVisibility(req)
   129  	case "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup":
   130  		resp, err = p.dispatchBeginCheckPrivateLinkServiceVisibilityByResourceGroup(req)
   131  	case "PrivateLinkServicesClient.BeginCreateOrUpdate":
   132  		resp, err = p.dispatchBeginCreateOrUpdate(req)
   133  	case "PrivateLinkServicesClient.BeginDelete":
   134  		resp, err = p.dispatchBeginDelete(req)
   135  	case "PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection":
   136  		resp, err = p.dispatchBeginDeletePrivateEndpointConnection(req)
   137  	case "PrivateLinkServicesClient.Get":
   138  		resp, err = p.dispatchGet(req)
   139  	case "PrivateLinkServicesClient.GetPrivateEndpointConnection":
   140  		resp, err = p.dispatchGetPrivateEndpointConnection(req)
   141  	case "PrivateLinkServicesClient.NewListPager":
   142  		resp, err = p.dispatchNewListPager(req)
   143  	case "PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager":
   144  		resp, err = p.dispatchNewListAutoApprovedPrivateLinkServicesPager(req)
   145  	case "PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager":
   146  		resp, err = p.dispatchNewListAutoApprovedPrivateLinkServicesByResourceGroupPager(req)
   147  	case "PrivateLinkServicesClient.NewListBySubscriptionPager":
   148  		resp, err = p.dispatchNewListBySubscriptionPager(req)
   149  	case "PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager":
   150  		resp, err = p.dispatchNewListPrivateEndpointConnectionsPager(req)
   151  	case "PrivateLinkServicesClient.UpdatePrivateEndpointConnection":
   152  		resp, err = p.dispatchUpdatePrivateEndpointConnection(req)
   153  	default:
   154  		err = fmt.Errorf("unhandled API %s", method)
   155  	}
   156  
   157  	if err != nil {
   158  		return nil, err
   159  	}
   160  
   161  	return resp, nil
   162  }
   163  
   164  func (p *PrivateLinkServicesServerTransport) dispatchBeginCheckPrivateLinkServiceVisibility(req *http.Request) (*http.Response, error) {
   165  	if p.srv.BeginCheckPrivateLinkServiceVisibility == nil {
   166  		return nil, &nonRetriableError{errors.New("fake for method BeginCheckPrivateLinkServiceVisibility not implemented")}
   167  	}
   168  	beginCheckPrivateLinkServiceVisibility := p.beginCheckPrivateLinkServiceVisibility.get(req)
   169  	if beginCheckPrivateLinkServiceVisibility == nil {
   170  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/locations/(?P<location>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkPrivateLinkServiceVisibility`
   171  		regex := regexp.MustCompile(regexStr)
   172  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   173  		if matches == nil || len(matches) < 2 {
   174  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   175  		}
   176  		body, err := server.UnmarshalRequestAsJSON[armnetwork.CheckPrivateLinkServiceVisibilityRequest](req)
   177  		if err != nil {
   178  			return nil, err
   179  		}
   180  		locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")])
   181  		if err != nil {
   182  			return nil, err
   183  		}
   184  		respr, errRespr := p.srv.BeginCheckPrivateLinkServiceVisibility(req.Context(), locationParam, body, nil)
   185  		if respErr := server.GetError(errRespr, req); respErr != nil {
   186  			return nil, respErr
   187  		}
   188  		beginCheckPrivateLinkServiceVisibility = &respr
   189  		p.beginCheckPrivateLinkServiceVisibility.add(req, beginCheckPrivateLinkServiceVisibility)
   190  	}
   191  
   192  	resp, err := server.PollerResponderNext(beginCheckPrivateLinkServiceVisibility, req)
   193  	if err != nil {
   194  		return nil, err
   195  	}
   196  
   197  	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
   198  		p.beginCheckPrivateLinkServiceVisibility.remove(req)
   199  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
   200  	}
   201  	if !server.PollerResponderMore(beginCheckPrivateLinkServiceVisibility) {
   202  		p.beginCheckPrivateLinkServiceVisibility.remove(req)
   203  	}
   204  
   205  	return resp, nil
   206  }
   207  
   208  func (p *PrivateLinkServicesServerTransport) dispatchBeginCheckPrivateLinkServiceVisibilityByResourceGroup(req *http.Request) (*http.Response, error) {
   209  	if p.srv.BeginCheckPrivateLinkServiceVisibilityByResourceGroup == nil {
   210  		return nil, &nonRetriableError{errors.New("fake for method BeginCheckPrivateLinkServiceVisibilityByResourceGroup not implemented")}
   211  	}
   212  	beginCheckPrivateLinkServiceVisibilityByResourceGroup := p.beginCheckPrivateLinkServiceVisibilityByResourceGroup.get(req)
   213  	if beginCheckPrivateLinkServiceVisibilityByResourceGroup == nil {
   214  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/locations/(?P<location>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkPrivateLinkServiceVisibility`
   215  		regex := regexp.MustCompile(regexStr)
   216  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   217  		if matches == nil || len(matches) < 3 {
   218  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   219  		}
   220  		body, err := server.UnmarshalRequestAsJSON[armnetwork.CheckPrivateLinkServiceVisibilityRequest](req)
   221  		if err != nil {
   222  			return nil, err
   223  		}
   224  		locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")])
   225  		if err != nil {
   226  			return nil, err
   227  		}
   228  		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   229  		if err != nil {
   230  			return nil, err
   231  		}
   232  		respr, errRespr := p.srv.BeginCheckPrivateLinkServiceVisibilityByResourceGroup(req.Context(), locationParam, resourceGroupNameParam, body, nil)
   233  		if respErr := server.GetError(errRespr, req); respErr != nil {
   234  			return nil, respErr
   235  		}
   236  		beginCheckPrivateLinkServiceVisibilityByResourceGroup = &respr
   237  		p.beginCheckPrivateLinkServiceVisibilityByResourceGroup.add(req, beginCheckPrivateLinkServiceVisibilityByResourceGroup)
   238  	}
   239  
   240  	resp, err := server.PollerResponderNext(beginCheckPrivateLinkServiceVisibilityByResourceGroup, req)
   241  	if err != nil {
   242  		return nil, err
   243  	}
   244  
   245  	if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) {
   246  		p.beginCheckPrivateLinkServiceVisibilityByResourceGroup.remove(req)
   247  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)}
   248  	}
   249  	if !server.PollerResponderMore(beginCheckPrivateLinkServiceVisibilityByResourceGroup) {
   250  		p.beginCheckPrivateLinkServiceVisibilityByResourceGroup.remove(req)
   251  	}
   252  
   253  	return resp, nil
   254  }
   255  
   256  func (p *PrivateLinkServicesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) {
   257  	if p.srv.BeginCreateOrUpdate == nil {
   258  		return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")}
   259  	}
   260  	beginCreateOrUpdate := p.beginCreateOrUpdate.get(req)
   261  	if beginCreateOrUpdate == nil {
   262  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices/(?P<serviceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
   263  		regex := regexp.MustCompile(regexStr)
   264  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   265  		if matches == nil || len(matches) < 3 {
   266  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   267  		}
   268  		body, err := server.UnmarshalRequestAsJSON[armnetwork.PrivateLinkService](req)
   269  		if err != nil {
   270  			return nil, err
   271  		}
   272  		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   273  		if err != nil {
   274  			return nil, err
   275  		}
   276  		serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")])
   277  		if err != nil {
   278  			return nil, err
   279  		}
   280  		respr, errRespr := p.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serviceNameParam, body, nil)
   281  		if respErr := server.GetError(errRespr, req); respErr != nil {
   282  			return nil, respErr
   283  		}
   284  		beginCreateOrUpdate = &respr
   285  		p.beginCreateOrUpdate.add(req, beginCreateOrUpdate)
   286  	}
   287  
   288  	resp, err := server.PollerResponderNext(beginCreateOrUpdate, req)
   289  	if err != nil {
   290  		return nil, err
   291  	}
   292  
   293  	if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
   294  		p.beginCreateOrUpdate.remove(req)
   295  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
   296  	}
   297  	if !server.PollerResponderMore(beginCreateOrUpdate) {
   298  		p.beginCreateOrUpdate.remove(req)
   299  	}
   300  
   301  	return resp, nil
   302  }
   303  
   304  func (p *PrivateLinkServicesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
   305  	if p.srv.BeginDelete == nil {
   306  		return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
   307  	}
   308  	beginDelete := p.beginDelete.get(req)
   309  	if beginDelete == nil {
   310  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices/(?P<serviceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
   311  		regex := regexp.MustCompile(regexStr)
   312  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   313  		if matches == nil || len(matches) < 3 {
   314  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   315  		}
   316  		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   317  		if err != nil {
   318  			return nil, err
   319  		}
   320  		serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")])
   321  		if err != nil {
   322  			return nil, err
   323  		}
   324  		respr, errRespr := p.srv.BeginDelete(req.Context(), resourceGroupNameParam, serviceNameParam, nil)
   325  		if respErr := server.GetError(errRespr, req); respErr != nil {
   326  			return nil, respErr
   327  		}
   328  		beginDelete = &respr
   329  		p.beginDelete.add(req, beginDelete)
   330  	}
   331  
   332  	resp, err := server.PollerResponderNext(beginDelete, req)
   333  	if err != nil {
   334  		return nil, err
   335  	}
   336  
   337  	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
   338  		p.beginDelete.remove(req)
   339  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
   340  	}
   341  	if !server.PollerResponderMore(beginDelete) {
   342  		p.beginDelete.remove(req)
   343  	}
   344  
   345  	return resp, nil
   346  }
   347  
   348  func (p *PrivateLinkServicesServerTransport) dispatchBeginDeletePrivateEndpointConnection(req *http.Request) (*http.Response, error) {
   349  	if p.srv.BeginDeletePrivateEndpointConnection == nil {
   350  		return nil, &nonRetriableError{errors.New("fake for method BeginDeletePrivateEndpointConnection not implemented")}
   351  	}
   352  	beginDeletePrivateEndpointConnection := p.beginDeletePrivateEndpointConnection.get(req)
   353  	if beginDeletePrivateEndpointConnection == nil {
   354  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices/(?P<serviceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P<peConnectionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
   355  		regex := regexp.MustCompile(regexStr)
   356  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   357  		if matches == nil || len(matches) < 4 {
   358  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   359  		}
   360  		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   361  		if err != nil {
   362  			return nil, err
   363  		}
   364  		serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")])
   365  		if err != nil {
   366  			return nil, err
   367  		}
   368  		peConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("peConnectionName")])
   369  		if err != nil {
   370  			return nil, err
   371  		}
   372  		respr, errRespr := p.srv.BeginDeletePrivateEndpointConnection(req.Context(), resourceGroupNameParam, serviceNameParam, peConnectionNameParam, nil)
   373  		if respErr := server.GetError(errRespr, req); respErr != nil {
   374  			return nil, respErr
   375  		}
   376  		beginDeletePrivateEndpointConnection = &respr
   377  		p.beginDeletePrivateEndpointConnection.add(req, beginDeletePrivateEndpointConnection)
   378  	}
   379  
   380  	resp, err := server.PollerResponderNext(beginDeletePrivateEndpointConnection, req)
   381  	if err != nil {
   382  		return nil, err
   383  	}
   384  
   385  	if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
   386  		p.beginDeletePrivateEndpointConnection.remove(req)
   387  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
   388  	}
   389  	if !server.PollerResponderMore(beginDeletePrivateEndpointConnection) {
   390  		p.beginDeletePrivateEndpointConnection.remove(req)
   391  	}
   392  
   393  	return resp, nil
   394  }
   395  
   396  func (p *PrivateLinkServicesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
   397  	if p.srv.Get == nil {
   398  		return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
   399  	}
   400  	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices/(?P<serviceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
   401  	regex := regexp.MustCompile(regexStr)
   402  	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   403  	if matches == nil || len(matches) < 3 {
   404  		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   405  	}
   406  	qp := req.URL.Query()
   407  	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   408  	if err != nil {
   409  		return nil, err
   410  	}
   411  	serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")])
   412  	if err != nil {
   413  		return nil, err
   414  	}
   415  	expandUnescaped, err := url.QueryUnescape(qp.Get("$expand"))
   416  	if err != nil {
   417  		return nil, err
   418  	}
   419  	expandParam := getOptional(expandUnescaped)
   420  	var options *armnetwork.PrivateLinkServicesClientGetOptions
   421  	if expandParam != nil {
   422  		options = &armnetwork.PrivateLinkServicesClientGetOptions{
   423  			Expand: expandParam,
   424  		}
   425  	}
   426  	respr, errRespr := p.srv.Get(req.Context(), resourceGroupNameParam, serviceNameParam, options)
   427  	if respErr := server.GetError(errRespr, req); respErr != nil {
   428  		return nil, respErr
   429  	}
   430  	respContent := server.GetResponseContent(respr)
   431  	if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
   432  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
   433  	}
   434  	resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateLinkService, req)
   435  	if err != nil {
   436  		return nil, err
   437  	}
   438  	return resp, nil
   439  }
   440  
   441  func (p *PrivateLinkServicesServerTransport) dispatchGetPrivateEndpointConnection(req *http.Request) (*http.Response, error) {
   442  	if p.srv.GetPrivateEndpointConnection == nil {
   443  		return nil, &nonRetriableError{errors.New("fake for method GetPrivateEndpointConnection not implemented")}
   444  	}
   445  	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices/(?P<serviceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P<peConnectionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
   446  	regex := regexp.MustCompile(regexStr)
   447  	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   448  	if matches == nil || len(matches) < 4 {
   449  		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   450  	}
   451  	qp := req.URL.Query()
   452  	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   453  	if err != nil {
   454  		return nil, err
   455  	}
   456  	serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")])
   457  	if err != nil {
   458  		return nil, err
   459  	}
   460  	peConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("peConnectionName")])
   461  	if err != nil {
   462  		return nil, err
   463  	}
   464  	expandUnescaped, err := url.QueryUnescape(qp.Get("$expand"))
   465  	if err != nil {
   466  		return nil, err
   467  	}
   468  	expandParam := getOptional(expandUnescaped)
   469  	var options *armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionOptions
   470  	if expandParam != nil {
   471  		options = &armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionOptions{
   472  			Expand: expandParam,
   473  		}
   474  	}
   475  	respr, errRespr := p.srv.GetPrivateEndpointConnection(req.Context(), resourceGroupNameParam, serviceNameParam, peConnectionNameParam, options)
   476  	if respErr := server.GetError(errRespr, req); respErr != nil {
   477  		return nil, respErr
   478  	}
   479  	respContent := server.GetResponseContent(respr)
   480  	if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
   481  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
   482  	}
   483  	resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req)
   484  	if err != nil {
   485  		return nil, err
   486  	}
   487  	return resp, nil
   488  }
   489  
   490  func (p *PrivateLinkServicesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) {
   491  	if p.srv.NewListPager == nil {
   492  		return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")}
   493  	}
   494  	newListPager := p.newListPager.get(req)
   495  	if newListPager == nil {
   496  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices`
   497  		regex := regexp.MustCompile(regexStr)
   498  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   499  		if matches == nil || len(matches) < 2 {
   500  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   501  		}
   502  		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   503  		if err != nil {
   504  			return nil, err
   505  		}
   506  		resp := p.srv.NewListPager(resourceGroupNameParam, nil)
   507  		newListPager = &resp
   508  		p.newListPager.add(req, newListPager)
   509  		server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.PrivateLinkServicesClientListResponse, createLink func() string) {
   510  			page.NextLink = to.Ptr(createLink())
   511  		})
   512  	}
   513  	resp, err := server.PagerResponderNext(newListPager, req)
   514  	if err != nil {
   515  		return nil, err
   516  	}
   517  	if !contains([]int{http.StatusOK}, resp.StatusCode) {
   518  		p.newListPager.remove(req)
   519  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
   520  	}
   521  	if !server.PagerResponderMore(newListPager) {
   522  		p.newListPager.remove(req)
   523  	}
   524  	return resp, nil
   525  }
   526  
   527  func (p *PrivateLinkServicesServerTransport) dispatchNewListAutoApprovedPrivateLinkServicesPager(req *http.Request) (*http.Response, error) {
   528  	if p.srv.NewListAutoApprovedPrivateLinkServicesPager == nil {
   529  		return nil, &nonRetriableError{errors.New("fake for method NewListAutoApprovedPrivateLinkServicesPager not implemented")}
   530  	}
   531  	newListAutoApprovedPrivateLinkServicesPager := p.newListAutoApprovedPrivateLinkServicesPager.get(req)
   532  	if newListAutoApprovedPrivateLinkServicesPager == nil {
   533  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/locations/(?P<location>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/autoApprovedPrivateLinkServices`
   534  		regex := regexp.MustCompile(regexStr)
   535  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   536  		if matches == nil || len(matches) < 2 {
   537  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   538  		}
   539  		locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")])
   540  		if err != nil {
   541  			return nil, err
   542  		}
   543  		resp := p.srv.NewListAutoApprovedPrivateLinkServicesPager(locationParam, nil)
   544  		newListAutoApprovedPrivateLinkServicesPager = &resp
   545  		p.newListAutoApprovedPrivateLinkServicesPager.add(req, newListAutoApprovedPrivateLinkServicesPager)
   546  		server.PagerResponderInjectNextLinks(newListAutoApprovedPrivateLinkServicesPager, req, func(page *armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse, createLink func() string) {
   547  			page.NextLink = to.Ptr(createLink())
   548  		})
   549  	}
   550  	resp, err := server.PagerResponderNext(newListAutoApprovedPrivateLinkServicesPager, req)
   551  	if err != nil {
   552  		return nil, err
   553  	}
   554  	if !contains([]int{http.StatusOK}, resp.StatusCode) {
   555  		p.newListAutoApprovedPrivateLinkServicesPager.remove(req)
   556  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
   557  	}
   558  	if !server.PagerResponderMore(newListAutoApprovedPrivateLinkServicesPager) {
   559  		p.newListAutoApprovedPrivateLinkServicesPager.remove(req)
   560  	}
   561  	return resp, nil
   562  }
   563  
   564  func (p *PrivateLinkServicesServerTransport) dispatchNewListAutoApprovedPrivateLinkServicesByResourceGroupPager(req *http.Request) (*http.Response, error) {
   565  	if p.srv.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager == nil {
   566  		return nil, &nonRetriableError{errors.New("fake for method NewListAutoApprovedPrivateLinkServicesByResourceGroupPager not implemented")}
   567  	}
   568  	newListAutoApprovedPrivateLinkServicesByResourceGroupPager := p.newListAutoApprovedPrivateLinkServicesByResourceGroupPager.get(req)
   569  	if newListAutoApprovedPrivateLinkServicesByResourceGroupPager == nil {
   570  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/locations/(?P<location>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/autoApprovedPrivateLinkServices`
   571  		regex := regexp.MustCompile(regexStr)
   572  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   573  		if matches == nil || len(matches) < 3 {
   574  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   575  		}
   576  		locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")])
   577  		if err != nil {
   578  			return nil, err
   579  		}
   580  		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   581  		if err != nil {
   582  			return nil, err
   583  		}
   584  		resp := p.srv.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager(locationParam, resourceGroupNameParam, nil)
   585  		newListAutoApprovedPrivateLinkServicesByResourceGroupPager = &resp
   586  		p.newListAutoApprovedPrivateLinkServicesByResourceGroupPager.add(req, newListAutoApprovedPrivateLinkServicesByResourceGroupPager)
   587  		server.PagerResponderInjectNextLinks(newListAutoApprovedPrivateLinkServicesByResourceGroupPager, req, func(page *armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse, createLink func() string) {
   588  			page.NextLink = to.Ptr(createLink())
   589  		})
   590  	}
   591  	resp, err := server.PagerResponderNext(newListAutoApprovedPrivateLinkServicesByResourceGroupPager, req)
   592  	if err != nil {
   593  		return nil, err
   594  	}
   595  	if !contains([]int{http.StatusOK}, resp.StatusCode) {
   596  		p.newListAutoApprovedPrivateLinkServicesByResourceGroupPager.remove(req)
   597  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
   598  	}
   599  	if !server.PagerResponderMore(newListAutoApprovedPrivateLinkServicesByResourceGroupPager) {
   600  		p.newListAutoApprovedPrivateLinkServicesByResourceGroupPager.remove(req)
   601  	}
   602  	return resp, nil
   603  }
   604  
   605  func (p *PrivateLinkServicesServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) {
   606  	if p.srv.NewListBySubscriptionPager == nil {
   607  		return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")}
   608  	}
   609  	newListBySubscriptionPager := p.newListBySubscriptionPager.get(req)
   610  	if newListBySubscriptionPager == nil {
   611  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices`
   612  		regex := regexp.MustCompile(regexStr)
   613  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   614  		if matches == nil || len(matches) < 1 {
   615  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   616  		}
   617  		resp := p.srv.NewListBySubscriptionPager(nil)
   618  		newListBySubscriptionPager = &resp
   619  		p.newListBySubscriptionPager.add(req, newListBySubscriptionPager)
   620  		server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armnetwork.PrivateLinkServicesClientListBySubscriptionResponse, createLink func() string) {
   621  			page.NextLink = to.Ptr(createLink())
   622  		})
   623  	}
   624  	resp, err := server.PagerResponderNext(newListBySubscriptionPager, req)
   625  	if err != nil {
   626  		return nil, err
   627  	}
   628  	if !contains([]int{http.StatusOK}, resp.StatusCode) {
   629  		p.newListBySubscriptionPager.remove(req)
   630  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
   631  	}
   632  	if !server.PagerResponderMore(newListBySubscriptionPager) {
   633  		p.newListBySubscriptionPager.remove(req)
   634  	}
   635  	return resp, nil
   636  }
   637  
   638  func (p *PrivateLinkServicesServerTransport) dispatchNewListPrivateEndpointConnectionsPager(req *http.Request) (*http.Response, error) {
   639  	if p.srv.NewListPrivateEndpointConnectionsPager == nil {
   640  		return nil, &nonRetriableError{errors.New("fake for method NewListPrivateEndpointConnectionsPager not implemented")}
   641  	}
   642  	newListPrivateEndpointConnectionsPager := p.newListPrivateEndpointConnectionsPager.get(req)
   643  	if newListPrivateEndpointConnectionsPager == nil {
   644  		const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices/(?P<serviceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections`
   645  		regex := regexp.MustCompile(regexStr)
   646  		matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   647  		if matches == nil || len(matches) < 3 {
   648  			return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   649  		}
   650  		resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   651  		if err != nil {
   652  			return nil, err
   653  		}
   654  		serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")])
   655  		if err != nil {
   656  			return nil, err
   657  		}
   658  		resp := p.srv.NewListPrivateEndpointConnectionsPager(resourceGroupNameParam, serviceNameParam, nil)
   659  		newListPrivateEndpointConnectionsPager = &resp
   660  		p.newListPrivateEndpointConnectionsPager.add(req, newListPrivateEndpointConnectionsPager)
   661  		server.PagerResponderInjectNextLinks(newListPrivateEndpointConnectionsPager, req, func(page *armnetwork.PrivateLinkServicesClientListPrivateEndpointConnectionsResponse, createLink func() string) {
   662  			page.NextLink = to.Ptr(createLink())
   663  		})
   664  	}
   665  	resp, err := server.PagerResponderNext(newListPrivateEndpointConnectionsPager, req)
   666  	if err != nil {
   667  		return nil, err
   668  	}
   669  	if !contains([]int{http.StatusOK}, resp.StatusCode) {
   670  		p.newListPrivateEndpointConnectionsPager.remove(req)
   671  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
   672  	}
   673  	if !server.PagerResponderMore(newListPrivateEndpointConnectionsPager) {
   674  		p.newListPrivateEndpointConnectionsPager.remove(req)
   675  	}
   676  	return resp, nil
   677  }
   678  
   679  func (p *PrivateLinkServicesServerTransport) dispatchUpdatePrivateEndpointConnection(req *http.Request) (*http.Response, error) {
   680  	if p.srv.UpdatePrivateEndpointConnection == nil {
   681  		return nil, &nonRetriableError{errors.New("fake for method UpdatePrivateEndpointConnection not implemented")}
   682  	}
   683  	const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/privateLinkServices/(?P<serviceName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P<peConnectionName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
   684  	regex := regexp.MustCompile(regexStr)
   685  	matches := regex.FindStringSubmatch(req.URL.EscapedPath())
   686  	if matches == nil || len(matches) < 4 {
   687  		return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
   688  	}
   689  	body, err := server.UnmarshalRequestAsJSON[armnetwork.PrivateEndpointConnection](req)
   690  	if err != nil {
   691  		return nil, err
   692  	}
   693  	resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
   694  	if err != nil {
   695  		return nil, err
   696  	}
   697  	serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")])
   698  	if err != nil {
   699  		return nil, err
   700  	}
   701  	peConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("peConnectionName")])
   702  	if err != nil {
   703  		return nil, err
   704  	}
   705  	respr, errRespr := p.srv.UpdatePrivateEndpointConnection(req.Context(), resourceGroupNameParam, serviceNameParam, peConnectionNameParam, body, nil)
   706  	if respErr := server.GetError(errRespr, req); respErr != nil {
   707  		return nil, respErr
   708  	}
   709  	respContent := server.GetResponseContent(respr)
   710  	if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
   711  		return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
   712  	}
   713  	resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req)
   714  	if err != nil {
   715  		return nil, err
   716  	}
   717  	return resp, nil
   718  }