...

Source file src/github.com/Azure/azure-sdk-for-go/services/datalake/store/mgmt/2016-11-01/account/virtualnetworkrules.go

Documentation: github.com/Azure/azure-sdk-for-go/services/datalake/store/mgmt/2016-11-01/account

     1  package account
     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  // VirtualNetworkRulesClient is the creates an Azure Data Lake Store account management client.
    19  type VirtualNetworkRulesClient struct {
    20  	BaseClient
    21  }
    22  
    23  // NewVirtualNetworkRulesClient creates an instance of the VirtualNetworkRulesClient client.
    24  func NewVirtualNetworkRulesClient(subscriptionID string) VirtualNetworkRulesClient {
    25  	return NewVirtualNetworkRulesClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewVirtualNetworkRulesClientWithBaseURI creates an instance of the VirtualNetworkRulesClient 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 NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkRulesClient {
    32  	return VirtualNetworkRulesClient{NewWithBaseURI(baseURI, subscriptionID)}
    33  }
    34  
    35  // CreateOrUpdate creates or updates the specified virtual network rule. During update, the virtual network rule with
    36  // the specified name will be replaced with this new virtual network rule.
    37  // Parameters:
    38  // resourceGroupName - the name of the Azure resource group.
    39  // accountName - the name of the Data Lake Store account.
    40  // virtualNetworkRuleName - the name of the virtual network rule to create or update.
    41  // parameters - parameters supplied to create or update the virtual network rule.
    42  func (client VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, virtualNetworkRuleName string, parameters CreateOrUpdateVirtualNetworkRuleParameters) (result VirtualNetworkRule, err error) {
    43  	if tracing.IsEnabled() {
    44  		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.CreateOrUpdate")
    45  		defer func() {
    46  			sc := -1
    47  			if result.Response.Response != nil {
    48  				sc = result.Response.Response.StatusCode
    49  			}
    50  			tracing.EndSpan(ctx, sc, err)
    51  		}()
    52  	}
    53  	if err := validation.Validate([]validation.Validation{
    54  		{TargetValue: parameters,
    55  			Constraints: []validation.Constraint{{Target: "parameters.CreateOrUpdateVirtualNetworkRuleProperties", Name: validation.Null, Rule: true,
    56  				Chain: []validation.Constraint{{Target: "parameters.CreateOrUpdateVirtualNetworkRuleProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
    57  		return result, validation.NewError("account.VirtualNetworkRulesClient", "CreateOrUpdate", err.Error())
    58  	}
    59  
    60  	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, virtualNetworkRuleName, parameters)
    61  	if err != nil {
    62  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "CreateOrUpdate", nil, "Failure preparing request")
    63  		return
    64  	}
    65  
    66  	resp, err := client.CreateOrUpdateSender(req)
    67  	if err != nil {
    68  		result.Response = autorest.Response{Response: resp}
    69  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "CreateOrUpdate", resp, "Failure sending request")
    70  		return
    71  	}
    72  
    73  	result, err = client.CreateOrUpdateResponder(resp)
    74  	if err != nil {
    75  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "CreateOrUpdate", resp, "Failure responding to request")
    76  		return
    77  	}
    78  
    79  	return
    80  }
    81  
    82  // CreateOrUpdatePreparer prepares the CreateOrUpdate request.
    83  func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, virtualNetworkRuleName string, parameters CreateOrUpdateVirtualNetworkRuleParameters) (*http.Request, error) {
    84  	pathParameters := map[string]interface{}{
    85  		"accountName":            autorest.Encode("path", accountName),
    86  		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
    87  		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
    88  		"virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName),
    89  	}
    90  
    91  	const APIVersion = "2016-11-01"
    92  	queryParameters := map[string]interface{}{
    93  		"api-version": APIVersion,
    94  	}
    95  
    96  	preparer := autorest.CreatePreparer(
    97  		autorest.AsContentType("application/json; charset=utf-8"),
    98  		autorest.AsPut(),
    99  		autorest.WithBaseURL(client.BaseURI),
   100  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters),
   101  		autorest.WithJSON(parameters),
   102  		autorest.WithQueryParameters(queryParameters))
   103  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   104  }
   105  
   106  // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
   107  // http.Response Body if it receives an error.
   108  func (client VirtualNetworkRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
   109  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   110  }
   111  
   112  // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
   113  // closes the http.Response Body.
   114  func (client VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkRule, err error) {
   115  	err = autorest.Respond(
   116  		resp,
   117  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   118  		autorest.ByUnmarshallingJSON(&result),
   119  		autorest.ByClosing())
   120  	result.Response = autorest.Response{Response: resp}
   121  	return
   122  }
   123  
   124  // Delete deletes the specified virtual network rule from the specified Data Lake Store account.
   125  // Parameters:
   126  // resourceGroupName - the name of the Azure resource group.
   127  // accountName - the name of the Data Lake Store account.
   128  // virtualNetworkRuleName - the name of the virtual network rule to delete.
   129  func (client VirtualNetworkRulesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, virtualNetworkRuleName string) (result autorest.Response, err error) {
   130  	if tracing.IsEnabled() {
   131  		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.Delete")
   132  		defer func() {
   133  			sc := -1
   134  			if result.Response != nil {
   135  				sc = result.Response.StatusCode
   136  			}
   137  			tracing.EndSpan(ctx, sc, err)
   138  		}()
   139  	}
   140  	req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, virtualNetworkRuleName)
   141  	if err != nil {
   142  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Delete", nil, "Failure preparing request")
   143  		return
   144  	}
   145  
   146  	resp, err := client.DeleteSender(req)
   147  	if err != nil {
   148  		result.Response = resp
   149  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Delete", resp, "Failure sending request")
   150  		return
   151  	}
   152  
   153  	result, err = client.DeleteResponder(resp)
   154  	if err != nil {
   155  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Delete", resp, "Failure responding to request")
   156  		return
   157  	}
   158  
   159  	return
   160  }
   161  
   162  // DeletePreparer prepares the Delete request.
   163  func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, virtualNetworkRuleName string) (*http.Request, error) {
   164  	pathParameters := map[string]interface{}{
   165  		"accountName":            autorest.Encode("path", accountName),
   166  		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
   167  		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
   168  		"virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName),
   169  	}
   170  
   171  	const APIVersion = "2016-11-01"
   172  	queryParameters := map[string]interface{}{
   173  		"api-version": APIVersion,
   174  	}
   175  
   176  	preparer := autorest.CreatePreparer(
   177  		autorest.AsDelete(),
   178  		autorest.WithBaseURL(client.BaseURI),
   179  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters),
   180  		autorest.WithQueryParameters(queryParameters))
   181  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   182  }
   183  
   184  // DeleteSender sends the Delete request. The method will close the
   185  // http.Response Body if it receives an error.
   186  func (client VirtualNetworkRulesClient) DeleteSender(req *http.Request) (*http.Response, error) {
   187  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   188  }
   189  
   190  // DeleteResponder handles the response to the Delete request. The method always
   191  // closes the http.Response Body.
   192  func (client VirtualNetworkRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
   193  	err = autorest.Respond(
   194  		resp,
   195  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
   196  		autorest.ByClosing())
   197  	result.Response = resp
   198  	return
   199  }
   200  
   201  // Get gets the specified Data Lake Store virtual network rule.
   202  // Parameters:
   203  // resourceGroupName - the name of the Azure resource group.
   204  // accountName - the name of the Data Lake Store account.
   205  // virtualNetworkRuleName - the name of the virtual network rule to retrieve.
   206  func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, accountName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) {
   207  	if tracing.IsEnabled() {
   208  		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.Get")
   209  		defer func() {
   210  			sc := -1
   211  			if result.Response.Response != nil {
   212  				sc = result.Response.Response.StatusCode
   213  			}
   214  			tracing.EndSpan(ctx, sc, err)
   215  		}()
   216  	}
   217  	req, err := client.GetPreparer(ctx, resourceGroupName, accountName, virtualNetworkRuleName)
   218  	if err != nil {
   219  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Get", nil, "Failure preparing request")
   220  		return
   221  	}
   222  
   223  	resp, err := client.GetSender(req)
   224  	if err != nil {
   225  		result.Response = autorest.Response{Response: resp}
   226  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Get", resp, "Failure sending request")
   227  		return
   228  	}
   229  
   230  	result, err = client.GetResponder(resp)
   231  	if err != nil {
   232  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request")
   233  		return
   234  	}
   235  
   236  	return
   237  }
   238  
   239  // GetPreparer prepares the Get request.
   240  func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, virtualNetworkRuleName string) (*http.Request, error) {
   241  	pathParameters := map[string]interface{}{
   242  		"accountName":            autorest.Encode("path", accountName),
   243  		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
   244  		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
   245  		"virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName),
   246  	}
   247  
   248  	const APIVersion = "2016-11-01"
   249  	queryParameters := map[string]interface{}{
   250  		"api-version": APIVersion,
   251  	}
   252  
   253  	preparer := autorest.CreatePreparer(
   254  		autorest.AsGet(),
   255  		autorest.WithBaseURL(client.BaseURI),
   256  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters),
   257  		autorest.WithQueryParameters(queryParameters))
   258  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   259  }
   260  
   261  // GetSender sends the Get request. The method will close the
   262  // http.Response Body if it receives an error.
   263  func (client VirtualNetworkRulesClient) GetSender(req *http.Request) (*http.Response, error) {
   264  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   265  }
   266  
   267  // GetResponder handles the response to the Get request. The method always
   268  // closes the http.Response Body.
   269  func (client VirtualNetworkRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkRule, err error) {
   270  	err = autorest.Respond(
   271  		resp,
   272  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   273  		autorest.ByUnmarshallingJSON(&result),
   274  		autorest.ByClosing())
   275  	result.Response = autorest.Response{Response: resp}
   276  	return
   277  }
   278  
   279  // ListByAccount lists the Data Lake Store virtual network rules within the specified Data Lake Store account.
   280  // Parameters:
   281  // resourceGroupName - the name of the Azure resource group.
   282  // accountName - the name of the Data Lake Store account.
   283  func (client VirtualNetworkRulesClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string) (result VirtualNetworkRuleListResultPage, err error) {
   284  	if tracing.IsEnabled() {
   285  		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.ListByAccount")
   286  		defer func() {
   287  			sc := -1
   288  			if result.vnrlr.Response.Response != nil {
   289  				sc = result.vnrlr.Response.Response.StatusCode
   290  			}
   291  			tracing.EndSpan(ctx, sc, err)
   292  		}()
   293  	}
   294  	result.fn = client.listByAccountNextResults
   295  	req, err := client.ListByAccountPreparer(ctx, resourceGroupName, accountName)
   296  	if err != nil {
   297  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "ListByAccount", nil, "Failure preparing request")
   298  		return
   299  	}
   300  
   301  	resp, err := client.ListByAccountSender(req)
   302  	if err != nil {
   303  		result.vnrlr.Response = autorest.Response{Response: resp}
   304  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "ListByAccount", resp, "Failure sending request")
   305  		return
   306  	}
   307  
   308  	result.vnrlr, err = client.ListByAccountResponder(resp)
   309  	if err != nil {
   310  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "ListByAccount", resp, "Failure responding to request")
   311  		return
   312  	}
   313  	if result.vnrlr.hasNextLink() && result.vnrlr.IsEmpty() {
   314  		err = result.NextWithContext(ctx)
   315  		return
   316  	}
   317  
   318  	return
   319  }
   320  
   321  // ListByAccountPreparer prepares the ListByAccount request.
   322  func (client VirtualNetworkRulesClient) ListByAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
   323  	pathParameters := map[string]interface{}{
   324  		"accountName":       autorest.Encode("path", accountName),
   325  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   326  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   327  	}
   328  
   329  	const APIVersion = "2016-11-01"
   330  	queryParameters := map[string]interface{}{
   331  		"api-version": APIVersion,
   332  	}
   333  
   334  	preparer := autorest.CreatePreparer(
   335  		autorest.AsGet(),
   336  		autorest.WithBaseURL(client.BaseURI),
   337  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules", pathParameters),
   338  		autorest.WithQueryParameters(queryParameters))
   339  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   340  }
   341  
   342  // ListByAccountSender sends the ListByAccount request. The method will close the
   343  // http.Response Body if it receives an error.
   344  func (client VirtualNetworkRulesClient) ListByAccountSender(req *http.Request) (*http.Response, error) {
   345  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   346  }
   347  
   348  // ListByAccountResponder handles the response to the ListByAccount request. The method always
   349  // closes the http.Response Body.
   350  func (client VirtualNetworkRulesClient) ListByAccountResponder(resp *http.Response) (result VirtualNetworkRuleListResult, err error) {
   351  	err = autorest.Respond(
   352  		resp,
   353  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   354  		autorest.ByUnmarshallingJSON(&result),
   355  		autorest.ByClosing())
   356  	result.Response = autorest.Response{Response: resp}
   357  	return
   358  }
   359  
   360  // listByAccountNextResults retrieves the next set of results, if any.
   361  func (client VirtualNetworkRulesClient) listByAccountNextResults(ctx context.Context, lastResults VirtualNetworkRuleListResult) (result VirtualNetworkRuleListResult, err error) {
   362  	req, err := lastResults.virtualNetworkRuleListResultPreparer(ctx)
   363  	if err != nil {
   364  		return result, autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "listByAccountNextResults", nil, "Failure preparing next results request")
   365  	}
   366  	if req == nil {
   367  		return
   368  	}
   369  	resp, err := client.ListByAccountSender(req)
   370  	if err != nil {
   371  		result.Response = autorest.Response{Response: resp}
   372  		return result, autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "listByAccountNextResults", resp, "Failure sending next results request")
   373  	}
   374  	result, err = client.ListByAccountResponder(resp)
   375  	if err != nil {
   376  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "listByAccountNextResults", resp, "Failure responding to next results request")
   377  	}
   378  	return
   379  }
   380  
   381  // ListByAccountComplete enumerates all values, automatically crossing page boundaries as required.
   382  func (client VirtualNetworkRulesClient) ListByAccountComplete(ctx context.Context, resourceGroupName string, accountName string) (result VirtualNetworkRuleListResultIterator, err error) {
   383  	if tracing.IsEnabled() {
   384  		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.ListByAccount")
   385  		defer func() {
   386  			sc := -1
   387  			if result.Response().Response.Response != nil {
   388  				sc = result.page.Response().Response.Response.StatusCode
   389  			}
   390  			tracing.EndSpan(ctx, sc, err)
   391  		}()
   392  	}
   393  	result.page, err = client.ListByAccount(ctx, resourceGroupName, accountName)
   394  	return
   395  }
   396  
   397  // Update updates the specified virtual network rule.
   398  // Parameters:
   399  // resourceGroupName - the name of the Azure resource group.
   400  // accountName - the name of the Data Lake Store account.
   401  // virtualNetworkRuleName - the name of the virtual network rule to update.
   402  // parameters - parameters supplied to update the virtual network rule.
   403  func (client VirtualNetworkRulesClient) Update(ctx context.Context, resourceGroupName string, accountName string, virtualNetworkRuleName string, parameters *UpdateVirtualNetworkRuleParameters) (result VirtualNetworkRule, err error) {
   404  	if tracing.IsEnabled() {
   405  		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.Update")
   406  		defer func() {
   407  			sc := -1
   408  			if result.Response.Response != nil {
   409  				sc = result.Response.Response.StatusCode
   410  			}
   411  			tracing.EndSpan(ctx, sc, err)
   412  		}()
   413  	}
   414  	req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, virtualNetworkRuleName, parameters)
   415  	if err != nil {
   416  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Update", nil, "Failure preparing request")
   417  		return
   418  	}
   419  
   420  	resp, err := client.UpdateSender(req)
   421  	if err != nil {
   422  		result.Response = autorest.Response{Response: resp}
   423  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Update", resp, "Failure sending request")
   424  		return
   425  	}
   426  
   427  	result, err = client.UpdateResponder(resp)
   428  	if err != nil {
   429  		err = autorest.NewErrorWithError(err, "account.VirtualNetworkRulesClient", "Update", resp, "Failure responding to request")
   430  		return
   431  	}
   432  
   433  	return
   434  }
   435  
   436  // UpdatePreparer prepares the Update request.
   437  func (client VirtualNetworkRulesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, virtualNetworkRuleName string, parameters *UpdateVirtualNetworkRuleParameters) (*http.Request, error) {
   438  	pathParameters := map[string]interface{}{
   439  		"accountName":            autorest.Encode("path", accountName),
   440  		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
   441  		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
   442  		"virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName),
   443  	}
   444  
   445  	const APIVersion = "2016-11-01"
   446  	queryParameters := map[string]interface{}{
   447  		"api-version": APIVersion,
   448  	}
   449  
   450  	preparer := autorest.CreatePreparer(
   451  		autorest.AsContentType("application/json; charset=utf-8"),
   452  		autorest.AsPatch(),
   453  		autorest.WithBaseURL(client.BaseURI),
   454  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters),
   455  		autorest.WithQueryParameters(queryParameters))
   456  	if parameters != nil {
   457  		preparer = autorest.DecoratePreparer(preparer,
   458  			autorest.WithJSON(parameters))
   459  	}
   460  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   461  }
   462  
   463  // UpdateSender sends the Update request. The method will close the
   464  // http.Response Body if it receives an error.
   465  func (client VirtualNetworkRulesClient) UpdateSender(req *http.Request) (*http.Response, error) {
   466  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   467  }
   468  
   469  // UpdateResponder handles the response to the Update request. The method always
   470  // closes the http.Response Body.
   471  func (client VirtualNetworkRulesClient) UpdateResponder(resp *http.Response) (result VirtualNetworkRule, err error) {
   472  	err = autorest.Respond(
   473  		resp,
   474  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   475  		autorest.ByUnmarshallingJSON(&result),
   476  		autorest.ByClosing())
   477  	result.Response = autorest.Response{Response: resp}
   478  	return
   479  }
   480  

View as plain text