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

[AutoPR consumption/resource-manager] Adding new properties to Consumption Usage Details #3120

Merged
Prev Previous commit
Generated from b28e418996a4b847984d198b4c0ccbd003466d0a
Changed the CostTagResult to CostTag as per review comments. Also changed operations - Marketplaces_ListByEnrollmentAccount and Marketplaces_ListForBillingPeriodByEnrollmentAccount.
  • Loading branch information
AutorestCI committed Jul 12, 2018
commit 73fdc02e824ba616877bb72e61b8b8ed0ef356a0
53 changes: 48 additions & 5 deletions lib/services/consumptionManagement/lib/models/costTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@

'use strict';

const models = require('./index');

/**
* The cost tag.
* A cost tag resource.
*
* @extends models['ProxyResource']
*/
class CostTag {
class CostTag extends models['ProxyResource'] {
/**
* Create a CostTag.
* @member {string} [key] Cost tag key.
* @member {array} [costTags] Cost tags.
*/
constructor() {
super();
}

/**
Expand All @@ -36,12 +40,51 @@ class CostTag {
name: 'Composite',
className: 'CostTag',
modelProperties: {
key: {
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
readOnly: true,
serializedName: 'type',
type: {
name: 'String'
}
},
eTag: {
required: false,
serializedName: 'key',
serializedName: 'eTag',
type: {
name: 'String'
}
},
costTags: {
required: false,
serializedName: 'properties.costTags',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'CostTagPropertiesElementType',
type: {
name: 'Composite',
className: 'CostTagProperties'
}
}
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/services/consumptionManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,13 +604,13 @@ export interface CostTagProperties {

/**
* @class
* Initializes a new instance of the CostTagsResult class.
* Initializes a new instance of the CostTag class.
* @constructor
* A cost tag resource.
*
* @member {array} [costTags] Cost tags.
*/
export interface CostTagsResult extends ProxyResource {
export interface CostTag extends ProxyResource {
costTags?: CostTagProperties[];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/services/consumptionManagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exports.CurrentSpend = require('./currentSpend');
exports.Notification = require('./notification');
exports.Budget = require('./budget');
exports.CostTagProperties = require('./costTagProperties');
exports.CostTagsResult = require('./costTagsResult');
exports.CostTag = require('./costTag');
exports.PriceSheetProperties = require('./priceSheetProperties');
exports.PriceSheetResult = require('./priceSheetResult');
exports.ForecastPropertiesConfidenceLevelsItem = require('./forecastPropertiesConfidenceLevelsItem');
Expand Down
24 changes: 12 additions & 12 deletions lib/services/consumptionManagement/lib/operations/costTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const WebResource = msRest.WebResource;
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link CostTagsResult} for more information.
* See {@link CostTag} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
Expand Down Expand Up @@ -135,7 +135,7 @@ function _get(billingAccountId, options, callback) {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['CostTagsResult']().mapper();
let resultMapper = new client.models['CostTag']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
Expand Down Expand Up @@ -179,7 +179,7 @@ function _get(billingAccountId, options, callback) {
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link CostTagsResult} for more information.
* See {@link CostTag} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
Expand Down Expand Up @@ -248,7 +248,7 @@ function _createOrUpdate(billingAccountId, parameters, options, callback) {
let requestModel = null;
try {
if (parameters !== null && parameters !== undefined) {
let requestModelMapper = new client.models['CostTagsResult']().mapper();
let requestModelMapper = new client.models['CostTag']().mapper();
requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
requestContent = JSON.stringify(requestModel);
}
Expand Down Expand Up @@ -300,7 +300,7 @@ function _createOrUpdate(billingAccountId, parameters, options, callback) {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['CostTagsResult']().mapper();
let resultMapper = new client.models['CostTag']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
Expand All @@ -317,7 +317,7 @@ function _createOrUpdate(billingAccountId, parameters, options, callback) {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['CostTagsResult']().mapper();
let resultMapper = new client.models['CostTag']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
Expand Down Expand Up @@ -356,7 +356,7 @@ class CostTags {
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<CostTagsResult>} - The deserialized result object.
* @resolve {HttpOperationResponse<CostTag>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
Expand Down Expand Up @@ -391,7 +391,7 @@ class CostTags {
*
* {Promise} A promise is returned
*
* @resolve {CostTagsResult} - The deserialized result object.
* @resolve {CostTag} - The deserialized result object.
*
* @reject {Error} - The error object.
*
Expand All @@ -400,7 +400,7 @@ class CostTags {
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link CostTagsResult} for more information.
* See {@link CostTag} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
Expand Down Expand Up @@ -450,7 +450,7 @@ class CostTags {
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<CostTagsResult>} - The deserialized result object.
* @resolve {HttpOperationResponse<CostTag>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
Expand Down Expand Up @@ -497,7 +497,7 @@ class CostTags {
*
* {Promise} A promise is returned
*
* @resolve {CostTagsResult} - The deserialized result object.
* @resolve {CostTag} - The deserialized result object.
*
* @reject {Error} - The error object.
*
Expand All @@ -506,7 +506,7 @@ class CostTags {
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link CostTagsResult} for more information.
* See {@link CostTag} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
Expand Down
Loading