...

Source file src/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-30/compute/dedicatedhosts.go

Documentation: github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-30/compute

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

View as plain text