...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-05-01-preview/metrics/metrics.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-05-01-preview/metrics

     1  package metrics
     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  // Client is the monitor Management Client
    19  type Client struct {
    20  	BaseClient
    21  }
    22  
    23  // NewClient creates an instance of the Client client.
    24  func NewClient(subscriptionID string) Client {
    25  	return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewClientWithBaseURI creates an instance of the Client client using a custom endpoint.  Use this when interacting
    29  // with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
    30  func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
    31  	return Client{NewWithBaseURI(baseURI, subscriptionID)}
    32  }
    33  
    34  // List **Lists the metric values for a resource**.
    35  // Parameters:
    36  // resourceURI - the identifier of the resource.
    37  // timespan - the timespan of the query. It is a string with the following format
    38  // 'startDateTime_ISO/endDateTime_ISO'.
    39  // interval - the interval (i.e. timegrain) of the query.
    40  // metricnames - the names of the metrics (comma separated) to retrieve.
    41  // aggregation - the list of aggregation types (comma separated) to retrieve.
    42  // top - the maximum number of records to retrieve.
    43  // Valid only if $filter is specified.
    44  // Defaults to 10.
    45  // orderby - the aggregation to use for sorting results and the direction of the sort.
    46  // Only one order can be specified.
    47  // Examples: sum asc.
    48  // filter - the **$filter** is used to reduce the set of metric data returned.<br>Example:<br>Metric contains
    49  // metadata A, B and C.<br>- Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’
    50  // and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C
    51  // eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical or operator cannot separate two different
    52  // metadata names.<br>- Return all time series where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq
    53  // ‘b1’ and C eq ‘c1’**<br>- Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq
    54  // ‘*’**.
    55  // resultType - reduces the set of data collected. The syntax allowed depends on the operation. See the
    56  // operation's description for details.
    57  // metricnamespace - metric namespace where the metrics you want reside.
    58  // autoAdjustTimegrain - when set to true, if the timespan passed in is not supported by this metric, the API
    59  // will return the result using the closest supported timespan. When set to false, an error is returned for
    60  // invalid timespan parameters. Defaults to false.
    61  // validateDimensions - when set to false, invalid filter parameter values will be ignored. When set to true,
    62  // an error is returned for invalid filter parameters. Defaults to true.
    63  func (client Client) List(ctx context.Context, resourceURI string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType ResultType, metricnamespace string, autoAdjustTimegrain *bool, validateDimensions *bool) (result Response, err error) {
    64  	if tracing.IsEnabled() {
    65  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.List")
    66  		defer func() {
    67  			sc := -1
    68  			if result.Response.Response != nil {
    69  				sc = result.Response.Response.StatusCode
    70  			}
    71  			tracing.EndSpan(ctx, sc, err)
    72  		}()
    73  	}
    74  	req, err := client.ListPreparer(ctx, resourceURI, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions)
    75  	if err != nil {
    76  		err = autorest.NewErrorWithError(err, "metrics.Client", "List", nil, "Failure preparing request")
    77  		return
    78  	}
    79  
    80  	resp, err := client.ListSender(req)
    81  	if err != nil {
    82  		result.Response = autorest.Response{Response: resp}
    83  		err = autorest.NewErrorWithError(err, "metrics.Client", "List", resp, "Failure sending request")
    84  		return
    85  	}
    86  
    87  	result, err = client.ListResponder(resp)
    88  	if err != nil {
    89  		err = autorest.NewErrorWithError(err, "metrics.Client", "List", resp, "Failure responding to request")
    90  		return
    91  	}
    92  
    93  	return
    94  }
    95  
    96  // ListPreparer prepares the List request.
    97  func (client Client) ListPreparer(ctx context.Context, resourceURI string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType ResultType, metricnamespace string, autoAdjustTimegrain *bool, validateDimensions *bool) (*http.Request, error) {
    98  	pathParameters := map[string]interface{}{
    99  		"resourceUri": resourceURI,
   100  	}
   101  
   102  	const APIVersion = "2021-05-01"
   103  	queryParameters := map[string]interface{}{
   104  		"api-version": APIVersion,
   105  	}
   106  	if len(timespan) > 0 {
   107  		queryParameters["timespan"] = autorest.Encode("query", timespan)
   108  	}
   109  	if interval != nil {
   110  		queryParameters["interval"] = autorest.Encode("query", *interval)
   111  	}
   112  	if len(metricnames) > 0 {
   113  		queryParameters["metricnames"] = autorest.Encode("query", metricnames)
   114  	}
   115  	if len(aggregation) > 0 {
   116  		queryParameters["aggregation"] = autorest.Encode("query", aggregation)
   117  	}
   118  	if top != nil {
   119  		queryParameters["top"] = autorest.Encode("query", *top)
   120  	}
   121  	if len(orderby) > 0 {
   122  		queryParameters["orderby"] = autorest.Encode("query", orderby)
   123  	}
   124  	if len(filter) > 0 {
   125  		queryParameters["$filter"] = autorest.Encode("query", filter)
   126  	}
   127  	if len(string(resultType)) > 0 {
   128  		queryParameters["resultType"] = autorest.Encode("query", resultType)
   129  	}
   130  	if len(metricnamespace) > 0 {
   131  		queryParameters["metricnamespace"] = autorest.Encode("query", metricnamespace)
   132  	}
   133  	if autoAdjustTimegrain != nil {
   134  		queryParameters["AutoAdjustTimegrain"] = autorest.Encode("query", *autoAdjustTimegrain)
   135  	}
   136  	if validateDimensions != nil {
   137  		queryParameters["ValidateDimensions"] = autorest.Encode("query", *validateDimensions)
   138  	}
   139  
   140  	preparer := autorest.CreatePreparer(
   141  		autorest.AsGet(),
   142  		autorest.WithBaseURL(client.BaseURI),
   143  		autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.Insights/metrics", pathParameters),
   144  		autorest.WithQueryParameters(queryParameters))
   145  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   146  }
   147  
   148  // ListSender sends the List request. The method will close the
   149  // http.Response Body if it receives an error.
   150  func (client Client) ListSender(req *http.Request) (*http.Response, error) {
   151  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   152  }
   153  
   154  // ListResponder handles the response to the List request. The method always
   155  // closes the http.Response Body.
   156  func (client Client) ListResponder(resp *http.Response) (result Response, err error) {
   157  	err = autorest.Respond(
   158  		resp,
   159  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   160  		autorest.ByUnmarshallingJSON(&result),
   161  		autorest.ByClosing())
   162  	result.Response = autorest.Response{Response: resp}
   163  	return
   164  }
   165  
   166  // ListAtSubscriptionScope **Lists the metric data for a subscription**.
   167  // Parameters:
   168  // region - the region where the metrics you want reside.
   169  // timespan - the timespan of the query. It is a string with the following format
   170  // 'startDateTime_ISO/endDateTime_ISO'.
   171  // interval - the interval (i.e. timegrain) of the query.
   172  // metricnames - the names of the metrics (comma separated) to retrieve.
   173  // aggregation - the list of aggregation types (comma separated) to retrieve.
   174  // top - the maximum number of records to retrieve.
   175  // Valid only if $filter is specified.
   176  // Defaults to 10.
   177  // orderby - the aggregation to use for sorting results and the direction of the sort.
   178  // Only one order can be specified.
   179  // Examples: sum asc.
   180  // filter - the **$filter** is used to reduce the set of metric data returned.<br>Example:<br>Metric contains
   181  // metadata A, B and C.<br>- Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’
   182  // and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C
   183  // eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical or operator cannot separate two different
   184  // metadata names.<br>- Return all time series where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq
   185  // ‘b1’ and C eq ‘c1’**<br>- Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq
   186  // ‘*’**.
   187  // resultType - reduces the set of data collected. The syntax allowed depends on the operation. See the
   188  // operation's description for details.
   189  // metricnamespace - metric namespace where the metrics you want reside.
   190  // autoAdjustTimegrain - when set to true, if the timespan passed in is not supported by this metric, the API
   191  // will return the result using the closest supported timespan. When set to false, an error is returned for
   192  // invalid timespan parameters. Defaults to false.
   193  // validateDimensions - when set to false, invalid filter parameter values will be ignored. When set to true,
   194  // an error is returned for invalid filter parameters. Defaults to true.
   195  func (client Client) ListAtSubscriptionScope(ctx context.Context, region string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType MetricResultType, metricnamespace string, autoAdjustTimegrain *bool, validateDimensions *bool) (result SubscriptionScopeMetricResponse, err error) {
   196  	if tracing.IsEnabled() {
   197  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAtSubscriptionScope")
   198  		defer func() {
   199  			sc := -1
   200  			if result.Response.Response != nil {
   201  				sc = result.Response.Response.StatusCode
   202  			}
   203  			tracing.EndSpan(ctx, sc, err)
   204  		}()
   205  	}
   206  	if err := validation.Validate([]validation.Validation{
   207  		{TargetValue: client.SubscriptionID,
   208  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
   209  		return result, validation.NewError("metrics.Client", "ListAtSubscriptionScope", err.Error())
   210  	}
   211  
   212  	req, err := client.ListAtSubscriptionScopePreparer(ctx, region, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions)
   213  	if err != nil {
   214  		err = autorest.NewErrorWithError(err, "metrics.Client", "ListAtSubscriptionScope", nil, "Failure preparing request")
   215  		return
   216  	}
   217  
   218  	resp, err := client.ListAtSubscriptionScopeSender(req)
   219  	if err != nil {
   220  		result.Response = autorest.Response{Response: resp}
   221  		err = autorest.NewErrorWithError(err, "metrics.Client", "ListAtSubscriptionScope", resp, "Failure sending request")
   222  		return
   223  	}
   224  
   225  	result, err = client.ListAtSubscriptionScopeResponder(resp)
   226  	if err != nil {
   227  		err = autorest.NewErrorWithError(err, "metrics.Client", "ListAtSubscriptionScope", resp, "Failure responding to request")
   228  		return
   229  	}
   230  
   231  	return
   232  }
   233  
   234  // ListAtSubscriptionScopePreparer prepares the ListAtSubscriptionScope request.
   235  func (client Client) ListAtSubscriptionScopePreparer(ctx context.Context, region string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType MetricResultType, metricnamespace string, autoAdjustTimegrain *bool, validateDimensions *bool) (*http.Request, error) {
   236  	pathParameters := map[string]interface{}{
   237  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   238  	}
   239  
   240  	const APIVersion = "2021-05-01"
   241  	queryParameters := map[string]interface{}{
   242  		"api-version": APIVersion,
   243  		"region":      autorest.Encode("query", region),
   244  	}
   245  	if len(timespan) > 0 {
   246  		queryParameters["timespan"] = autorest.Encode("query", timespan)
   247  	}
   248  	if interval != nil {
   249  		queryParameters["interval"] = autorest.Encode("query", *interval)
   250  	}
   251  	if len(metricnames) > 0 {
   252  		queryParameters["metricnames"] = autorest.Encode("query", metricnames)
   253  	}
   254  	if len(aggregation) > 0 {
   255  		queryParameters["aggregation"] = autorest.Encode("query", aggregation)
   256  	}
   257  	if top != nil {
   258  		queryParameters["top"] = autorest.Encode("query", *top)
   259  	}
   260  	if len(orderby) > 0 {
   261  		queryParameters["orderby"] = autorest.Encode("query", orderby)
   262  	}
   263  	if len(filter) > 0 {
   264  		queryParameters["$filter"] = autorest.Encode("query", filter)
   265  	}
   266  	if len(string(resultType)) > 0 {
   267  		queryParameters["resultType"] = autorest.Encode("query", resultType)
   268  	}
   269  	if len(metricnamespace) > 0 {
   270  		queryParameters["metricnamespace"] = autorest.Encode("query", metricnamespace)
   271  	}
   272  	if autoAdjustTimegrain != nil {
   273  		queryParameters["AutoAdjustTimegrain"] = autorest.Encode("query", *autoAdjustTimegrain)
   274  	}
   275  	if validateDimensions != nil {
   276  		queryParameters["ValidateDimensions"] = autorest.Encode("query", *validateDimensions)
   277  	}
   278  
   279  	preparer := autorest.CreatePreparer(
   280  		autorest.AsGet(),
   281  		autorest.WithBaseURL(client.BaseURI),
   282  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics", pathParameters),
   283  		autorest.WithQueryParameters(queryParameters))
   284  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   285  }
   286  
   287  // ListAtSubscriptionScopeSender sends the ListAtSubscriptionScope request. The method will close the
   288  // http.Response Body if it receives an error.
   289  func (client Client) ListAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
   290  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   291  }
   292  
   293  // ListAtSubscriptionScopeResponder handles the response to the ListAtSubscriptionScope request. The method always
   294  // closes the http.Response Body.
   295  func (client Client) ListAtSubscriptionScopeResponder(resp *http.Response) (result SubscriptionScopeMetricResponse, err error) {
   296  	err = autorest.Respond(
   297  		resp,
   298  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   299  		autorest.ByUnmarshallingJSON(&result),
   300  		autorest.ByClosing())
   301  	result.Response = autorest.Response{Response: resp}
   302  	return
   303  }
   304  
   305  // ListAtSubscriptionScopePost **Lists the metric data for a subscription**. Parameters can be specified on either
   306  // query params or the body.
   307  // Parameters:
   308  // region - the region where the metrics you want reside.
   309  // timespan - the timespan of the query. It is a string with the following format
   310  // 'startDateTime_ISO/endDateTime_ISO'.
   311  // interval - the interval (i.e. timegrain) of the query.
   312  // metricnames - the names of the metrics (comma separated) to retrieve.
   313  // aggregation - the list of aggregation types (comma separated) to retrieve.
   314  // top - the maximum number of records to retrieve.
   315  // Valid only if $filter is specified.
   316  // Defaults to 10.
   317  // orderby - the aggregation to use for sorting results and the direction of the sort.
   318  // Only one order can be specified.
   319  // Examples: sum asc.
   320  // filter - the **$filter** is used to reduce the set of metric data returned.<br>Example:<br>Metric contains
   321  // metadata A, B and C.<br>- Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’
   322  // and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C
   323  // eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical or operator cannot separate two different
   324  // metadata names.<br>- Return all time series where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq
   325  // ‘b1’ and C eq ‘c1’**<br>- Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq
   326  // ‘*’**.
   327  // resultType - reduces the set of data collected. The syntax allowed depends on the operation. See the
   328  // operation's description for details.
   329  // metricnamespace - metric namespace where the metrics you want reside.
   330  // autoAdjustTimegrain - when set to true, if the timespan passed in is not supported by this metric, the API
   331  // will return the result using the closest supported timespan. When set to false, an error is returned for
   332  // invalid timespan parameters. Defaults to false.
   333  // validateDimensions - when set to false, invalid filter parameter values will be ignored. When set to true,
   334  // an error is returned for invalid filter parameters. Defaults to true.
   335  // body - parameters serialized in the body
   336  func (client Client) ListAtSubscriptionScopePost(ctx context.Context, region string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType MetricResultType, metricnamespace string, autoAdjustTimegrain *bool, validateDimensions *bool, body *SubscriptionScopeMetricsRequestBodyParameters) (result SubscriptionScopeMetricResponse, err error) {
   337  	if tracing.IsEnabled() {
   338  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAtSubscriptionScopePost")
   339  		defer func() {
   340  			sc := -1
   341  			if result.Response.Response != nil {
   342  				sc = result.Response.Response.StatusCode
   343  			}
   344  			tracing.EndSpan(ctx, sc, err)
   345  		}()
   346  	}
   347  	if err := validation.Validate([]validation.Validation{
   348  		{TargetValue: client.SubscriptionID,
   349  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
   350  		return result, validation.NewError("metrics.Client", "ListAtSubscriptionScopePost", err.Error())
   351  	}
   352  
   353  	req, err := client.ListAtSubscriptionScopePostPreparer(ctx, region, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, body)
   354  	if err != nil {
   355  		err = autorest.NewErrorWithError(err, "metrics.Client", "ListAtSubscriptionScopePost", nil, "Failure preparing request")
   356  		return
   357  	}
   358  
   359  	resp, err := client.ListAtSubscriptionScopePostSender(req)
   360  	if err != nil {
   361  		result.Response = autorest.Response{Response: resp}
   362  		err = autorest.NewErrorWithError(err, "metrics.Client", "ListAtSubscriptionScopePost", resp, "Failure sending request")
   363  		return
   364  	}
   365  
   366  	result, err = client.ListAtSubscriptionScopePostResponder(resp)
   367  	if err != nil {
   368  		err = autorest.NewErrorWithError(err, "metrics.Client", "ListAtSubscriptionScopePost", resp, "Failure responding to request")
   369  		return
   370  	}
   371  
   372  	return
   373  }
   374  
   375  // ListAtSubscriptionScopePostPreparer prepares the ListAtSubscriptionScopePost request.
   376  func (client Client) ListAtSubscriptionScopePostPreparer(ctx context.Context, region string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType MetricResultType, metricnamespace string, autoAdjustTimegrain *bool, validateDimensions *bool, body *SubscriptionScopeMetricsRequestBodyParameters) (*http.Request, error) {
   377  	pathParameters := map[string]interface{}{
   378  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   379  	}
   380  
   381  	const APIVersion = "2021-05-01"
   382  	queryParameters := map[string]interface{}{
   383  		"api-version": APIVersion,
   384  		"region":      autorest.Encode("query", region),
   385  	}
   386  	if len(timespan) > 0 {
   387  		queryParameters["timespan"] = autorest.Encode("query", timespan)
   388  	}
   389  	if interval != nil {
   390  		queryParameters["interval"] = autorest.Encode("query", *interval)
   391  	}
   392  	if len(metricnames) > 0 {
   393  		queryParameters["metricnames"] = autorest.Encode("query", metricnames)
   394  	}
   395  	if len(aggregation) > 0 {
   396  		queryParameters["aggregation"] = autorest.Encode("query", aggregation)
   397  	}
   398  	if top != nil {
   399  		queryParameters["top"] = autorest.Encode("query", *top)
   400  	}
   401  	if len(orderby) > 0 {
   402  		queryParameters["orderby"] = autorest.Encode("query", orderby)
   403  	}
   404  	if len(filter) > 0 {
   405  		queryParameters["$filter"] = autorest.Encode("query", filter)
   406  	}
   407  	if len(string(resultType)) > 0 {
   408  		queryParameters["resultType"] = autorest.Encode("query", resultType)
   409  	}
   410  	if len(metricnamespace) > 0 {
   411  		queryParameters["metricnamespace"] = autorest.Encode("query", metricnamespace)
   412  	}
   413  	if autoAdjustTimegrain != nil {
   414  		queryParameters["AutoAdjustTimegrain"] = autorest.Encode("query", *autoAdjustTimegrain)
   415  	}
   416  	if validateDimensions != nil {
   417  		queryParameters["ValidateDimensions"] = autorest.Encode("query", *validateDimensions)
   418  	}
   419  
   420  	preparer := autorest.CreatePreparer(
   421  		autorest.AsContentType("application/json; charset=utf-8"),
   422  		autorest.AsPost(),
   423  		autorest.WithBaseURL(client.BaseURI),
   424  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics", pathParameters),
   425  		autorest.WithQueryParameters(queryParameters))
   426  	if body != nil {
   427  		preparer = autorest.DecoratePreparer(preparer,
   428  			autorest.WithJSON(body))
   429  	}
   430  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   431  }
   432  
   433  // ListAtSubscriptionScopePostSender sends the ListAtSubscriptionScopePost request. The method will close the
   434  // http.Response Body if it receives an error.
   435  func (client Client) ListAtSubscriptionScopePostSender(req *http.Request) (*http.Response, error) {
   436  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   437  }
   438  
   439  // ListAtSubscriptionScopePostResponder handles the response to the ListAtSubscriptionScopePost request. The method always
   440  // closes the http.Response Body.
   441  func (client Client) ListAtSubscriptionScopePostResponder(resp *http.Response) (result SubscriptionScopeMetricResponse, err error) {
   442  	err = autorest.Respond(
   443  		resp,
   444  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   445  		autorest.ByUnmarshallingJSON(&result),
   446  		autorest.ByClosing())
   447  	result.Response = autorest.Response{Response: resp}
   448  	return
   449  }
   450  

View as plain text