...

Source file src/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-05-01/network/expressroutegateways.go

Documentation: github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-05-01/network

     1  package network
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"context"
    11  	"github.com/Azure/go-autorest/autorest"
    12  	"github.com/Azure/go-autorest/autorest/azure"
    13  	"github.com/Azure/go-autorest/autorest/validation"
    14  	"github.com/Azure/go-autorest/tracing"
    15  	"net/http"
    16  )
    17  
    18  // ExpressRouteGatewaysClient is the network Client
    19  type ExpressRouteGatewaysClient struct {
    20  	BaseClient
    21  }
    22  
    23  // NewExpressRouteGatewaysClient creates an instance of the ExpressRouteGatewaysClient client.
    24  func NewExpressRouteGatewaysClient(subscriptionID string) ExpressRouteGatewaysClient {
    25  	return NewExpressRouteGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewExpressRouteGatewaysClientWithBaseURI creates an instance of the ExpressRouteGatewaysClient client using a custom
    29  // endpoint.  Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
    30  // stack).
    31  func NewExpressRouteGatewaysClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteGatewaysClient {
    32  	return ExpressRouteGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
    33  }
    34  
    35  // CreateOrUpdate creates or updates a ExpressRoute gateway in a specified resource group.
    36  // Parameters:
    37  // resourceGroupName - the name of the resource group.
    38  // expressRouteGatewayName - the name of the ExpressRoute gateway.
    39  // putExpressRouteGatewayParameters - parameters required in an ExpressRoute gateway PUT operation.
    40  func (client ExpressRouteGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway) (result ExpressRouteGatewaysCreateOrUpdateFuture, err error) {
    41  	if tracing.IsEnabled() {
    42  		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.CreateOrUpdate")
    43  		defer func() {
    44  			sc := -1
    45  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
    46  				sc = result.FutureAPI.Response().StatusCode
    47  			}
    48  			tracing.EndSpan(ctx, sc, err)
    49  		}()
    50  	}
    51  	if err := validation.Validate([]validation.Validation{
    52  		{TargetValue: putExpressRouteGatewayParameters,
    53  			Constraints: []validation.Constraint{{Target: "putExpressRouteGatewayParameters.ExpressRouteGatewayProperties", Name: validation.Null, Rule: false,
    54  				Chain: []validation.Constraint{{Target: "putExpressRouteGatewayParameters.ExpressRouteGatewayProperties.VirtualHub", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
    55  		return result, validation.NewError("network.ExpressRouteGatewaysClient", "CreateOrUpdate", err.Error())
    56  	}
    57  
    58  	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters)
    59  	if err != nil {
    60  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request")
    61  		return
    62  	}
    63  
    64  	result, err = client.CreateOrUpdateSender(req)
    65  	if err != nil {
    66  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request")
    67  		return
    68  	}
    69  
    70  	return
    71  }
    72  
    73  // CreateOrUpdatePreparer prepares the CreateOrUpdate request.
    74  func (client ExpressRouteGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway) (*http.Request, error) {
    75  	pathParameters := map[string]interface{}{
    76  		"expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName),
    77  		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
    78  		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
    79  	}
    80  
    81  	const APIVersion = "2022-05-01"
    82  	queryParameters := map[string]interface{}{
    83  		"api-version": APIVersion,
    84  	}
    85  
    86  	putExpressRouteGatewayParameters.Etag = nil
    87  	preparer := autorest.CreatePreparer(
    88  		autorest.AsContentType("application/json; charset=utf-8"),
    89  		autorest.AsPut(),
    90  		autorest.WithBaseURL(client.BaseURI),
    91  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters),
    92  		autorest.WithJSON(putExpressRouteGatewayParameters),
    93  		autorest.WithQueryParameters(queryParameters))
    94  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
    95  }
    96  
    97  // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
    98  // http.Response Body if it receives an error.
    99  func (client ExpressRouteGatewaysClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteGatewaysCreateOrUpdateFuture, err error) {
   100  	var resp *http.Response
   101  	future.FutureAPI = &azure.Future{}
   102  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   103  	if err != nil {
   104  		return
   105  	}
   106  	var azf azure.Future
   107  	azf, err = azure.NewFutureFromResponse(resp)
   108  	future.FutureAPI = &azf
   109  	future.Result = future.result
   110  	return
   111  }
   112  
   113  // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
   114  // closes the http.Response Body.
   115  func (client ExpressRouteGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteGateway, err error) {
   116  	err = autorest.Respond(
   117  		resp,
   118  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
   119  		autorest.ByUnmarshallingJSON(&result),
   120  		autorest.ByClosing())
   121  	result.Response = autorest.Response{Response: resp}
   122  	return
   123  }
   124  
   125  // Delete deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be
   126  // deleted when there are no connection subresources.
   127  // Parameters:
   128  // resourceGroupName - the name of the resource group.
   129  // expressRouteGatewayName - the name of the ExpressRoute gateway.
   130  func (client ExpressRouteGatewaysClient) Delete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (result ExpressRouteGatewaysDeleteFuture, err error) {
   131  	if tracing.IsEnabled() {
   132  		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.Delete")
   133  		defer func() {
   134  			sc := -1
   135  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   136  				sc = result.FutureAPI.Response().StatusCode
   137  			}
   138  			tracing.EndSpan(ctx, sc, err)
   139  		}()
   140  	}
   141  	req, err := client.DeletePreparer(ctx, resourceGroupName, expressRouteGatewayName)
   142  	if err != nil {
   143  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Delete", nil, "Failure preparing request")
   144  		return
   145  	}
   146  
   147  	result, err = client.DeleteSender(req)
   148  	if err != nil {
   149  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Delete", result.Response(), "Failure sending request")
   150  		return
   151  	}
   152  
   153  	return
   154  }
   155  
   156  // DeletePreparer prepares the Delete request.
   157  func (client ExpressRouteGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (*http.Request, error) {
   158  	pathParameters := map[string]interface{}{
   159  		"expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName),
   160  		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
   161  		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
   162  	}
   163  
   164  	const APIVersion = "2022-05-01"
   165  	queryParameters := map[string]interface{}{
   166  		"api-version": APIVersion,
   167  	}
   168  
   169  	preparer := autorest.CreatePreparer(
   170  		autorest.AsDelete(),
   171  		autorest.WithBaseURL(client.BaseURI),
   172  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters),
   173  		autorest.WithQueryParameters(queryParameters))
   174  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   175  }
   176  
   177  // DeleteSender sends the Delete request. The method will close the
   178  // http.Response Body if it receives an error.
   179  func (client ExpressRouteGatewaysClient) DeleteSender(req *http.Request) (future ExpressRouteGatewaysDeleteFuture, err error) {
   180  	var resp *http.Response
   181  	future.FutureAPI = &azure.Future{}
   182  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   183  	if err != nil {
   184  		return
   185  	}
   186  	var azf azure.Future
   187  	azf, err = azure.NewFutureFromResponse(resp)
   188  	future.FutureAPI = &azf
   189  	future.Result = future.result
   190  	return
   191  }
   192  
   193  // DeleteResponder handles the response to the Delete request. The method always
   194  // closes the http.Response Body.
   195  func (client ExpressRouteGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
   196  	err = autorest.Respond(
   197  		resp,
   198  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   199  		autorest.ByClosing())
   200  	result.Response = resp
   201  	return
   202  }
   203  
   204  // Get fetches the details of a ExpressRoute gateway in a resource group.
   205  // Parameters:
   206  // resourceGroupName - the name of the resource group.
   207  // expressRouteGatewayName - the name of the ExpressRoute gateway.
   208  func (client ExpressRouteGatewaysClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (result ExpressRouteGateway, err error) {
   209  	if tracing.IsEnabled() {
   210  		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.Get")
   211  		defer func() {
   212  			sc := -1
   213  			if result.Response.Response != nil {
   214  				sc = result.Response.Response.StatusCode
   215  			}
   216  			tracing.EndSpan(ctx, sc, err)
   217  		}()
   218  	}
   219  	req, err := client.GetPreparer(ctx, resourceGroupName, expressRouteGatewayName)
   220  	if err != nil {
   221  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", nil, "Failure preparing request")
   222  		return
   223  	}
   224  
   225  	resp, err := client.GetSender(req)
   226  	if err != nil {
   227  		result.Response = autorest.Response{Response: resp}
   228  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", resp, "Failure sending request")
   229  		return
   230  	}
   231  
   232  	result, err = client.GetResponder(resp)
   233  	if err != nil {
   234  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", resp, "Failure responding to request")
   235  		return
   236  	}
   237  
   238  	return
   239  }
   240  
   241  // GetPreparer prepares the Get request.
   242  func (client ExpressRouteGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (*http.Request, error) {
   243  	pathParameters := map[string]interface{}{
   244  		"expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName),
   245  		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
   246  		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
   247  	}
   248  
   249  	const APIVersion = "2022-05-01"
   250  	queryParameters := map[string]interface{}{
   251  		"api-version": APIVersion,
   252  	}
   253  
   254  	preparer := autorest.CreatePreparer(
   255  		autorest.AsGet(),
   256  		autorest.WithBaseURL(client.BaseURI),
   257  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters),
   258  		autorest.WithQueryParameters(queryParameters))
   259  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   260  }
   261  
   262  // GetSender sends the Get request. The method will close the
   263  // http.Response Body if it receives an error.
   264  func (client ExpressRouteGatewaysClient) GetSender(req *http.Request) (*http.Response, error) {
   265  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   266  }
   267  
   268  // GetResponder handles the response to the Get request. The method always
   269  // closes the http.Response Body.
   270  func (client ExpressRouteGatewaysClient) GetResponder(resp *http.Response) (result ExpressRouteGateway, err error) {
   271  	err = autorest.Respond(
   272  		resp,
   273  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   274  		autorest.ByUnmarshallingJSON(&result),
   275  		autorest.ByClosing())
   276  	result.Response = autorest.Response{Response: resp}
   277  	return
   278  }
   279  
   280  // ListByResourceGroup lists ExpressRoute gateways in a given resource group.
   281  // Parameters:
   282  // resourceGroupName - the name of the resource group.
   283  func (client ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ExpressRouteGatewayList, err error) {
   284  	if tracing.IsEnabled() {
   285  		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.ListByResourceGroup")
   286  		defer func() {
   287  			sc := -1
   288  			if result.Response.Response != nil {
   289  				sc = result.Response.Response.StatusCode
   290  			}
   291  			tracing.EndSpan(ctx, sc, err)
   292  		}()
   293  	}
   294  	req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
   295  	if err != nil {
   296  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", nil, "Failure preparing request")
   297  		return
   298  	}
   299  
   300  	resp, err := client.ListByResourceGroupSender(req)
   301  	if err != nil {
   302  		result.Response = autorest.Response{Response: resp}
   303  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", resp, "Failure sending request")
   304  		return
   305  	}
   306  
   307  	result, err = client.ListByResourceGroupResponder(resp)
   308  	if err != nil {
   309  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request")
   310  		return
   311  	}
   312  
   313  	return
   314  }
   315  
   316  // ListByResourceGroupPreparer prepares the ListByResourceGroup request.
   317  func (client ExpressRouteGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
   318  	pathParameters := map[string]interface{}{
   319  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   320  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   321  	}
   322  
   323  	const APIVersion = "2022-05-01"
   324  	queryParameters := map[string]interface{}{
   325  		"api-version": APIVersion,
   326  	}
   327  
   328  	preparer := autorest.CreatePreparer(
   329  		autorest.AsGet(),
   330  		autorest.WithBaseURL(client.BaseURI),
   331  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways", pathParameters),
   332  		autorest.WithQueryParameters(queryParameters))
   333  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   334  }
   335  
   336  // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
   337  // http.Response Body if it receives an error.
   338  func (client ExpressRouteGatewaysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
   339  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   340  }
   341  
   342  // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
   343  // closes the http.Response Body.
   344  func (client ExpressRouteGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) {
   345  	err = autorest.Respond(
   346  		resp,
   347  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   348  		autorest.ByUnmarshallingJSON(&result),
   349  		autorest.ByClosing())
   350  	result.Response = autorest.Response{Response: resp}
   351  	return
   352  }
   353  
   354  // ListBySubscription lists ExpressRoute gateways under a given subscription.
   355  func (client ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context) (result ExpressRouteGatewayList, err error) {
   356  	if tracing.IsEnabled() {
   357  		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.ListBySubscription")
   358  		defer func() {
   359  			sc := -1
   360  			if result.Response.Response != nil {
   361  				sc = result.Response.Response.StatusCode
   362  			}
   363  			tracing.EndSpan(ctx, sc, err)
   364  		}()
   365  	}
   366  	req, err := client.ListBySubscriptionPreparer(ctx)
   367  	if err != nil {
   368  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", nil, "Failure preparing request")
   369  		return
   370  	}
   371  
   372  	resp, err := client.ListBySubscriptionSender(req)
   373  	if err != nil {
   374  		result.Response = autorest.Response{Response: resp}
   375  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", resp, "Failure sending request")
   376  		return
   377  	}
   378  
   379  	result, err = client.ListBySubscriptionResponder(resp)
   380  	if err != nil {
   381  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", resp, "Failure responding to request")
   382  		return
   383  	}
   384  
   385  	return
   386  }
   387  
   388  // ListBySubscriptionPreparer prepares the ListBySubscription request.
   389  func (client ExpressRouteGatewaysClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
   390  	pathParameters := map[string]interface{}{
   391  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   392  	}
   393  
   394  	const APIVersion = "2022-05-01"
   395  	queryParameters := map[string]interface{}{
   396  		"api-version": APIVersion,
   397  	}
   398  
   399  	preparer := autorest.CreatePreparer(
   400  		autorest.AsGet(),
   401  		autorest.WithBaseURL(client.BaseURI),
   402  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways", pathParameters),
   403  		autorest.WithQueryParameters(queryParameters))
   404  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   405  }
   406  
   407  // ListBySubscriptionSender sends the ListBySubscription request. The method will close the
   408  // http.Response Body if it receives an error.
   409  func (client ExpressRouteGatewaysClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
   410  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   411  }
   412  
   413  // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
   414  // closes the http.Response Body.
   415  func (client ExpressRouteGatewaysClient) ListBySubscriptionResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) {
   416  	err = autorest.Respond(
   417  		resp,
   418  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   419  		autorest.ByUnmarshallingJSON(&result),
   420  		autorest.ByClosing())
   421  	result.Response = autorest.Response{Response: resp}
   422  	return
   423  }
   424  
   425  // UpdateTags updates express route gateway tags.
   426  // Parameters:
   427  // resourceGroupName - the resource group name of the ExpressRouteGateway.
   428  // expressRouteGatewayName - the name of the gateway.
   429  // expressRouteGatewayParameters - parameters supplied to update a virtual wan express route gateway tags.
   430  func (client ExpressRouteGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject) (result ExpressRouteGatewaysUpdateTagsFuture, err error) {
   431  	if tracing.IsEnabled() {
   432  		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.UpdateTags")
   433  		defer func() {
   434  			sc := -1
   435  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   436  				sc = result.FutureAPI.Response().StatusCode
   437  			}
   438  			tracing.EndSpan(ctx, sc, err)
   439  		}()
   440  	}
   441  	req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters)
   442  	if err != nil {
   443  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "UpdateTags", nil, "Failure preparing request")
   444  		return
   445  	}
   446  
   447  	result, err = client.UpdateTagsSender(req)
   448  	if err != nil {
   449  		err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "UpdateTags", result.Response(), "Failure sending request")
   450  		return
   451  	}
   452  
   453  	return
   454  }
   455  
   456  // UpdateTagsPreparer prepares the UpdateTags request.
   457  func (client ExpressRouteGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject) (*http.Request, error) {
   458  	pathParameters := map[string]interface{}{
   459  		"expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName),
   460  		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
   461  		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
   462  	}
   463  
   464  	const APIVersion = "2022-05-01"
   465  	queryParameters := map[string]interface{}{
   466  		"api-version": APIVersion,
   467  	}
   468  
   469  	preparer := autorest.CreatePreparer(
   470  		autorest.AsContentType("application/json; charset=utf-8"),
   471  		autorest.AsPatch(),
   472  		autorest.WithBaseURL(client.BaseURI),
   473  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters),
   474  		autorest.WithJSON(expressRouteGatewayParameters),
   475  		autorest.WithQueryParameters(queryParameters))
   476  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   477  }
   478  
   479  // UpdateTagsSender sends the UpdateTags request. The method will close the
   480  // http.Response Body if it receives an error.
   481  func (client ExpressRouteGatewaysClient) UpdateTagsSender(req *http.Request) (future ExpressRouteGatewaysUpdateTagsFuture, err error) {
   482  	var resp *http.Response
   483  	future.FutureAPI = &azure.Future{}
   484  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   485  	if err != nil {
   486  		return
   487  	}
   488  	var azf azure.Future
   489  	azf, err = azure.NewFutureFromResponse(resp)
   490  	future.FutureAPI = &azf
   491  	future.Result = future.result
   492  	return
   493  }
   494  
   495  // UpdateTagsResponder handles the response to the UpdateTags request. The method always
   496  // closes the http.Response Body.
   497  func (client ExpressRouteGatewaysClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteGateway, err error) {
   498  	err = autorest.Respond(
   499  		resp,
   500  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   501  		autorest.ByUnmarshallingJSON(&result),
   502  		autorest.ByClosing())
   503  	result.Response = autorest.Response{Response: resp}
   504  	return
   505  }
   506  

View as plain text