...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/appinsights/mgmt/2022-01-11-preview/insights/workbooktemplates.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/appinsights/mgmt/2022-01-11-preview/insights

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

View as plain text