github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6@v6.2.0/vpnsites_client.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 armnetwork
    10  
    11  import (
    12  	"context"
    13  	"errors"
    14  	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
    15  	"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
    16  	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
    17  	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
    18  	"net/http"
    19  	"net/url"
    20  	"strings"
    21  )
    22  
    23  // VPNSitesClient contains the methods for the VPNSites group.
    24  // Don't use this type directly, use NewVPNSitesClient() instead.
    25  type VPNSitesClient struct {
    26  	internal       *arm.Client
    27  	subscriptionID string
    28  }
    29  
    30  // NewVPNSitesClient creates a new instance of VPNSitesClient with the specified values.
    31  //   - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription
    32  //     ID forms part of the URI for every service call.
    33  //   - credential - used to authorize requests. Usually a credential from azidentity.
    34  //   - options - pass nil to accept the default values.
    35  func NewVPNSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSitesClient, error) {
    36  	cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
    37  	if err != nil {
    38  		return nil, err
    39  	}
    40  	client := &VPNSitesClient{
    41  		subscriptionID: subscriptionID,
    42  		internal:       cl,
    43  	}
    44  	return client, nil
    45  }
    46  
    47  // BeginCreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.
    48  // If the operation fails it returns an *azcore.ResponseError type.
    49  //
    50  // Generated from API version 2024-05-01
    51  //   - resourceGroupName - The resource group name of the VpnSite.
    52  //   - vpnSiteName - The name of the VpnSite being created or updated.
    53  //   - vpnSiteParameters - Parameters supplied to create or update VpnSite.
    54  //   - options - VPNSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNSitesClient.BeginCreateOrUpdate
    55  //     method.
    56  func (client *VPNSitesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNSitesClientCreateOrUpdateResponse], error) {
    57  	if options == nil || options.ResumeToken == "" {
    58  		resp, err := client.createOrUpdate(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options)
    59  		if err != nil {
    60  			return nil, err
    61  		}
    62  		poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNSitesClientCreateOrUpdateResponse]{
    63  			FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
    64  			Tracer:        client.internal.Tracer(),
    65  		})
    66  		return poller, err
    67  	} else {
    68  		return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VPNSitesClientCreateOrUpdateResponse]{
    69  			Tracer: client.internal.Tracer(),
    70  		})
    71  	}
    72  }
    73  
    74  // CreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.
    75  // If the operation fails it returns an *azcore.ResponseError type.
    76  //
    77  // Generated from API version 2024-05-01
    78  func (client *VPNSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
    79  	var err error
    80  	const operationName = "VPNSitesClient.BeginCreateOrUpdate"
    81  	ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
    82  	ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
    83  	defer func() { endSpan(err) }()
    84  	req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options)
    85  	if err != nil {
    86  		return nil, err
    87  	}
    88  	httpResp, err := client.internal.Pipeline().Do(req)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
    93  		err = runtime.NewResponseError(httpResp)
    94  		return nil, err
    95  	}
    96  	return httpResp, nil
    97  }
    98  
    99  // createOrUpdateCreateRequest creates the CreateOrUpdate request.
   100  func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
   101  	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}"
   102  	if client.subscriptionID == "" {
   103  		return nil, errors.New("parameter client.subscriptionID cannot be empty")
   104  	}
   105  	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
   106  	if resourceGroupName == "" {
   107  		return nil, errors.New("parameter resourceGroupName cannot be empty")
   108  	}
   109  	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
   110  	if vpnSiteName == "" {
   111  		return nil, errors.New("parameter vpnSiteName cannot be empty")
   112  	}
   113  	urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName))
   114  	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	reqQP := req.Raw().URL.Query()
   119  	reqQP.Set("api-version", "2024-05-01")
   120  	req.Raw().URL.RawQuery = reqQP.Encode()
   121  	req.Raw().Header["Accept"] = []string{"application/json"}
   122  	if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil {
   123  		return nil, err
   124  	}
   125  	return req, nil
   126  }
   127  
   128  // BeginDelete - Deletes a VpnSite.
   129  // If the operation fails it returns an *azcore.ResponseError type.
   130  //
   131  // Generated from API version 2024-05-01
   132  //   - resourceGroupName - The resource group name of the VpnSite.
   133  //   - vpnSiteName - The name of the VpnSite being deleted.
   134  //   - options - VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method.
   135  func (client *VPNSitesClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*runtime.Poller[VPNSitesClientDeleteResponse], error) {
   136  	if options == nil || options.ResumeToken == "" {
   137  		resp, err := client.deleteOperation(ctx, resourceGroupName, vpnSiteName, options)
   138  		if err != nil {
   139  			return nil, err
   140  		}
   141  		poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNSitesClientDeleteResponse]{
   142  			FinalStateVia: runtime.FinalStateViaLocation,
   143  			Tracer:        client.internal.Tracer(),
   144  		})
   145  		return poller, err
   146  	} else {
   147  		return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VPNSitesClientDeleteResponse]{
   148  			Tracer: client.internal.Tracer(),
   149  		})
   150  	}
   151  }
   152  
   153  // Delete - Deletes a VpnSite.
   154  // If the operation fails it returns an *azcore.ResponseError type.
   155  //
   156  // Generated from API version 2024-05-01
   157  func (client *VPNSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*http.Response, error) {
   158  	var err error
   159  	const operationName = "VPNSitesClient.BeginDelete"
   160  	ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
   161  	ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
   162  	defer func() { endSpan(err) }()
   163  	req, err := client.deleteCreateRequest(ctx, resourceGroupName, vpnSiteName, options)
   164  	if err != nil {
   165  		return nil, err
   166  	}
   167  	httpResp, err := client.internal.Pipeline().Do(req)
   168  	if err != nil {
   169  		return nil, err
   170  	}
   171  	if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
   172  		err = runtime.NewResponseError(httpResp)
   173  		return nil, err
   174  	}
   175  	return httpResp, nil
   176  }
   177  
   178  // deleteCreateRequest creates the Delete request.
   179  func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*policy.Request, error) {
   180  	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}"
   181  	if client.subscriptionID == "" {
   182  		return nil, errors.New("parameter client.subscriptionID cannot be empty")
   183  	}
   184  	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
   185  	if resourceGroupName == "" {
   186  		return nil, errors.New("parameter resourceGroupName cannot be empty")
   187  	}
   188  	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
   189  	if vpnSiteName == "" {
   190  		return nil, errors.New("parameter vpnSiteName cannot be empty")
   191  	}
   192  	urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName))
   193  	req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
   194  	if err != nil {
   195  		return nil, err
   196  	}
   197  	reqQP := req.Raw().URL.Query()
   198  	reqQP.Set("api-version", "2024-05-01")
   199  	req.Raw().URL.RawQuery = reqQP.Encode()
   200  	req.Raw().Header["Accept"] = []string{"application/json"}
   201  	return req, nil
   202  }
   203  
   204  // Get - Retrieves the details of a VPN site.
   205  // If the operation fails it returns an *azcore.ResponseError type.
   206  //
   207  // Generated from API version 2024-05-01
   208  //   - resourceGroupName - The resource group name of the VpnSite.
   209  //   - vpnSiteName - The name of the VpnSite being retrieved.
   210  //   - options - VPNSitesClientGetOptions contains the optional parameters for the VPNSitesClient.Get method.
   211  func (client *VPNSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientGetOptions) (VPNSitesClientGetResponse, error) {
   212  	var err error
   213  	const operationName = "VPNSitesClient.Get"
   214  	ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
   215  	ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
   216  	defer func() { endSpan(err) }()
   217  	req, err := client.getCreateRequest(ctx, resourceGroupName, vpnSiteName, options)
   218  	if err != nil {
   219  		return VPNSitesClientGetResponse{}, err
   220  	}
   221  	httpResp, err := client.internal.Pipeline().Do(req)
   222  	if err != nil {
   223  		return VPNSitesClientGetResponse{}, err
   224  	}
   225  	if !runtime.HasStatusCode(httpResp, http.StatusOK) {
   226  		err = runtime.NewResponseError(httpResp)
   227  		return VPNSitesClientGetResponse{}, err
   228  	}
   229  	resp, err := client.getHandleResponse(httpResp)
   230  	return resp, err
   231  }
   232  
   233  // getCreateRequest creates the Get request.
   234  func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientGetOptions) (*policy.Request, error) {
   235  	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}"
   236  	if client.subscriptionID == "" {
   237  		return nil, errors.New("parameter client.subscriptionID cannot be empty")
   238  	}
   239  	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
   240  	if resourceGroupName == "" {
   241  		return nil, errors.New("parameter resourceGroupName cannot be empty")
   242  	}
   243  	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
   244  	if vpnSiteName == "" {
   245  		return nil, errors.New("parameter vpnSiteName cannot be empty")
   246  	}
   247  	urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName))
   248  	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
   249  	if err != nil {
   250  		return nil, err
   251  	}
   252  	reqQP := req.Raw().URL.Query()
   253  	reqQP.Set("api-version", "2024-05-01")
   254  	req.Raw().URL.RawQuery = reqQP.Encode()
   255  	req.Raw().Header["Accept"] = []string{"application/json"}
   256  	return req, nil
   257  }
   258  
   259  // getHandleResponse handles the Get response.
   260  func (client *VPNSitesClient) getHandleResponse(resp *http.Response) (VPNSitesClientGetResponse, error) {
   261  	result := VPNSitesClientGetResponse{}
   262  	if err := runtime.UnmarshalAsJSON(resp, &result.VPNSite); err != nil {
   263  		return VPNSitesClientGetResponse{}, err
   264  	}
   265  	return result, nil
   266  }
   267  
   268  // NewListPager - Lists all the VpnSites in a subscription.
   269  //
   270  // Generated from API version 2024-05-01
   271  //   - options - VPNSitesClientListOptions contains the optional parameters for the VPNSitesClient.NewListPager method.
   272  func (client *VPNSitesClient) NewListPager(options *VPNSitesClientListOptions) *runtime.Pager[VPNSitesClientListResponse] {
   273  	return runtime.NewPager(runtime.PagingHandler[VPNSitesClientListResponse]{
   274  		More: func(page VPNSitesClientListResponse) bool {
   275  			return page.NextLink != nil && len(*page.NextLink) > 0
   276  		},
   277  		Fetcher: func(ctx context.Context, page *VPNSitesClientListResponse) (VPNSitesClientListResponse, error) {
   278  			ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VPNSitesClient.NewListPager")
   279  			nextLink := ""
   280  			if page != nil {
   281  				nextLink = *page.NextLink
   282  			}
   283  			resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
   284  				return client.listCreateRequest(ctx, options)
   285  			}, nil)
   286  			if err != nil {
   287  				return VPNSitesClientListResponse{}, err
   288  			}
   289  			return client.listHandleResponse(resp)
   290  		},
   291  		Tracer: client.internal.Tracer(),
   292  	})
   293  }
   294  
   295  // listCreateRequest creates the List request.
   296  func (client *VPNSitesClient) listCreateRequest(ctx context.Context, options *VPNSitesClientListOptions) (*policy.Request, error) {
   297  	urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites"
   298  	if client.subscriptionID == "" {
   299  		return nil, errors.New("parameter client.subscriptionID cannot be empty")
   300  	}
   301  	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
   302  	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
   303  	if err != nil {
   304  		return nil, err
   305  	}
   306  	reqQP := req.Raw().URL.Query()
   307  	reqQP.Set("api-version", "2024-05-01")
   308  	req.Raw().URL.RawQuery = reqQP.Encode()
   309  	req.Raw().Header["Accept"] = []string{"application/json"}
   310  	return req, nil
   311  }
   312  
   313  // listHandleResponse handles the List response.
   314  func (client *VPNSitesClient) listHandleResponse(resp *http.Response) (VPNSitesClientListResponse, error) {
   315  	result := VPNSitesClientListResponse{}
   316  	if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSitesResult); err != nil {
   317  		return VPNSitesClientListResponse{}, err
   318  	}
   319  	return result, nil
   320  }
   321  
   322  // NewListByResourceGroupPager - Lists all the vpnSites in a resource group.
   323  //
   324  // Generated from API version 2024-05-01
   325  //   - resourceGroupName - The resource group name of the VpnSite.
   326  //   - options - VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.NewListByResourceGroupPager
   327  //     method.
   328  func (client *VPNSitesClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNSitesClientListByResourceGroupOptions) *runtime.Pager[VPNSitesClientListByResourceGroupResponse] {
   329  	return runtime.NewPager(runtime.PagingHandler[VPNSitesClientListByResourceGroupResponse]{
   330  		More: func(page VPNSitesClientListByResourceGroupResponse) bool {
   331  			return page.NextLink != nil && len(*page.NextLink) > 0
   332  		},
   333  		Fetcher: func(ctx context.Context, page *VPNSitesClientListByResourceGroupResponse) (VPNSitesClientListByResourceGroupResponse, error) {
   334  			ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VPNSitesClient.NewListByResourceGroupPager")
   335  			nextLink := ""
   336  			if page != nil {
   337  				nextLink = *page.NextLink
   338  			}
   339  			resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
   340  				return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
   341  			}, nil)
   342  			if err != nil {
   343  				return VPNSitesClientListByResourceGroupResponse{}, err
   344  			}
   345  			return client.listByResourceGroupHandleResponse(resp)
   346  		},
   347  		Tracer: client.internal.Tracer(),
   348  	})
   349  }
   350  
   351  // listByResourceGroupCreateRequest creates the ListByResourceGroup request.
   352  func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNSitesClientListByResourceGroupOptions) (*policy.Request, error) {
   353  	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites"
   354  	if client.subscriptionID == "" {
   355  		return nil, errors.New("parameter client.subscriptionID cannot be empty")
   356  	}
   357  	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
   358  	if resourceGroupName == "" {
   359  		return nil, errors.New("parameter resourceGroupName cannot be empty")
   360  	}
   361  	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
   362  	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
   363  	if err != nil {
   364  		return nil, err
   365  	}
   366  	reqQP := req.Raw().URL.Query()
   367  	reqQP.Set("api-version", "2024-05-01")
   368  	req.Raw().URL.RawQuery = reqQP.Encode()
   369  	req.Raw().Header["Accept"] = []string{"application/json"}
   370  	return req, nil
   371  }
   372  
   373  // listByResourceGroupHandleResponse handles the ListByResourceGroup response.
   374  func (client *VPNSitesClient) listByResourceGroupHandleResponse(resp *http.Response) (VPNSitesClientListByResourceGroupResponse, error) {
   375  	result := VPNSitesClientListByResourceGroupResponse{}
   376  	if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSitesResult); err != nil {
   377  		return VPNSitesClientListByResourceGroupResponse{}, err
   378  	}
   379  	return result, nil
   380  }
   381  
   382  // UpdateTags - Updates VpnSite tags.
   383  // If the operation fails it returns an *azcore.ResponseError type.
   384  //
   385  // Generated from API version 2024-05-01
   386  //   - resourceGroupName - The resource group name of the VpnSite.
   387  //   - vpnSiteName - The name of the VpnSite being updated.
   388  //   - vpnSiteParameters - Parameters supplied to update VpnSite tags.
   389  //   - options - VPNSitesClientUpdateTagsOptions contains the optional parameters for the VPNSitesClient.UpdateTags method.
   390  func (client *VPNSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, options *VPNSitesClientUpdateTagsOptions) (VPNSitesClientUpdateTagsResponse, error) {
   391  	var err error
   392  	const operationName = "VPNSitesClient.UpdateTags"
   393  	ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
   394  	ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
   395  	defer func() { endSpan(err) }()
   396  	req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options)
   397  	if err != nil {
   398  		return VPNSitesClientUpdateTagsResponse{}, err
   399  	}
   400  	httpResp, err := client.internal.Pipeline().Do(req)
   401  	if err != nil {
   402  		return VPNSitesClientUpdateTagsResponse{}, err
   403  	}
   404  	if !runtime.HasStatusCode(httpResp, http.StatusOK) {
   405  		err = runtime.NewResponseError(httpResp)
   406  		return VPNSitesClientUpdateTagsResponse{}, err
   407  	}
   408  	resp, err := client.updateTagsHandleResponse(httpResp)
   409  	return resp, err
   410  }
   411  
   412  // updateTagsCreateRequest creates the UpdateTags request.
   413  func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, options *VPNSitesClientUpdateTagsOptions) (*policy.Request, error) {
   414  	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}"
   415  	if client.subscriptionID == "" {
   416  		return nil, errors.New("parameter client.subscriptionID cannot be empty")
   417  	}
   418  	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
   419  	if resourceGroupName == "" {
   420  		return nil, errors.New("parameter resourceGroupName cannot be empty")
   421  	}
   422  	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
   423  	if vpnSiteName == "" {
   424  		return nil, errors.New("parameter vpnSiteName cannot be empty")
   425  	}
   426  	urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName))
   427  	req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
   428  	if err != nil {
   429  		return nil, err
   430  	}
   431  	reqQP := req.Raw().URL.Query()
   432  	reqQP.Set("api-version", "2024-05-01")
   433  	req.Raw().URL.RawQuery = reqQP.Encode()
   434  	req.Raw().Header["Accept"] = []string{"application/json"}
   435  	if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil {
   436  		return nil, err
   437  	}
   438  	return req, nil
   439  }
   440  
   441  // updateTagsHandleResponse handles the UpdateTags response.
   442  func (client *VPNSitesClient) updateTagsHandleResponse(resp *http.Response) (VPNSitesClientUpdateTagsResponse, error) {
   443  	result := VPNSitesClientUpdateTagsResponse{}
   444  	if err := runtime.UnmarshalAsJSON(resp, &result.VPNSite); err != nil {
   445  		return VPNSitesClientUpdateTagsResponse{}, err
   446  	}
   447  	return result, nil
   448  }