Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from Azure/master
Browse files Browse the repository at this point in the history
.
  • Loading branch information
huangpf committed Jul 28, 2015
2 parents 6935504 + d7ae108 commit 92f1920
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions lib/services/commerce/lib/usageAggregationManagementClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,16 @@ var UsageAggregationOperations = ( /** @lends UsageAggregationOperations */ func
if (reportedStartTime === null || reportedStartTime === undefined) {
return callback(new Error('reportedStartTime cannot be null.'));
}
if (isNaN(Date.parse(reportedStartTime))) {
return callback(new Error('reportedStartTime is not a valid date'));
}
if (reportedEndTime === null || reportedEndTime === undefined) {
return callback(new Error('reportedEndTime cannot be null.'));
}

if (isNaN(Date.parse(reportedEndTime))) {
return callback(new Error('reportedEndTime is not a valid date'));
}

// Tracing

// Construct URL
Expand All @@ -150,8 +156,8 @@ var UsageAggregationOperations = ( /** @lends UsageAggregationOperations */ func
url2 = url2 + '/providers/Microsoft.Commerce/UsageAggregates';
var queryParameters = [];
queryParameters.push('api-version=2015-06-01-preview');
queryParameters.push('reportedstartTime=' + encodeURIComponent(reportedStartTime.toISOString()));
queryParameters.push('reportedEndTime=' + encodeURIComponent(reportedEndTime.toISOString()) + ',');
queryParameters.push('reportedstartTime=' + encodeURIComponent(reportedStartTime));
queryParameters.push('reportedEndTime=' + encodeURIComponent(reportedEndTime));
if (showDetails !== null && showDetails !== undefined) {
queryParameters.push('showDetails=' + encodeURIComponent(showDetails.toString()));
}
Expand Down Expand Up @@ -182,7 +188,7 @@ var UsageAggregationOperations = ( /** @lends UsageAggregationOperations */ func
httpRequest.url = url2;

// Set Headers

// Send Request
return this.client.pipeline(httpRequest, function (err, response, body) {
if (err !== null && err !== undefined) {
Expand All @@ -194,7 +200,7 @@ var UsageAggregationOperations = ( /** @lends UsageAggregationOperations */ func
error.statusCode = response.statusCode;
return callback(error);
}

// Create Result
var result = null;
// Deserialize Response
Expand Down
2 changes: 1 addition & 1 deletion lib/services/commerce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"contributors": [
"Commerce Platform Usage Team <[email protected]>"
],
"version": "0.1.0",
"version": "0.1.1",
"description": "Microsoft Azure Commerce Usage Aggregates Management Client Library for Node",
"tags": [
"azure",
Expand Down

0 comments on commit 92f1920

Please sign in to comment.