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

Commit

Permalink
[AutoPR consumption/resource-manager] Adding swagger for new api-vers…
Browse files Browse the repository at this point in the history
…ion consumption 2018-05-31, introducing new Forecast api swagger (#2888)

* Generated from 25b0d1453bdaa98490469e256ae818f67a4472c0

Forecast Api swagger

* Generated from b837fe768eb097b3fc2e90f3a4e1f393ff6831dc

consumption readme file update for the new swagger version

* Generated from 75834e902cf575b384abc67d9934b74f8e2b64f0

addressing review comment on adding nextLink

* Generated from a40766016116112dbd0d8c66b60a117c3e20fc9d

fixing build error

* Generated from eadf28195eb82433cf2003d9f5c42640d3b6e80e

Addressed feedback on enum and fixed a typo
  • Loading branch information
AutorestCI authored May 30, 2018
1 parent 4e3af14 commit d9fe641
Show file tree
Hide file tree
Showing 27 changed files with 8,126 additions and 3,126 deletions.
8 changes: 2 additions & 6 deletions lib/services/consumptionManagement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ npm install azure-arm-consumption

## How to use

### Authentication, client creation and list usageDetails as an example.
### Authentication, client creation and list forecasts as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const ConsumptionManagementClient = require("azure-arm-consumption");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new ConsumptionManagementClient(creds, subscriptionId);
const expand = "testexpand";
const filter = "testfilter";
const skiptoken = "testskiptoken";
const top = 1;
const apply = "testapply";
return client.usageDetails.list(expand, filter, skiptoken, top, apply).then((result) => {
return client.forecasts.list(filter).then((result) => {
console.log("The result is:");
console.log(result);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,8 @@ export default class ConsumptionManagementClient extends AzureServiceClient {
generateClientRequestId: boolean;

// Operation groups
usageDetails: operations.UsageDetails;
marketplaces: operations.Marketplaces;
reservationsSummaries: operations.ReservationsSummaries;
reservationsDetails: operations.ReservationsDetails;
reservationRecommendationsOperations: operations.ReservationRecommendationsOperations;
budgets: operations.Budgets;
forecasts: operations.Forecasts;
operations: operations.Operations;
priceSheet: operations.PriceSheet;
costTagsOperations: operations.CostTagsOperations;
tagsOperations: operations.TagsOperations;
}

export { ConsumptionManagementClient, models as ConsumptionManagementModels };
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ConsumptionManagementClient extends ServiceClient {

super(credentials, options);

this.apiVersion = '2018-03-31';
this.apiVersion = '2018-05-31';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
Expand All @@ -72,16 +72,8 @@ class ConsumptionManagementClient extends ServiceClient {
if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) {
this.generateClientRequestId = options.generateClientRequestId;
}
this.usageDetails = new operations.UsageDetails(this);
this.marketplaces = new operations.Marketplaces(this);
this.reservationsSummaries = new operations.ReservationsSummaries(this);
this.reservationsDetails = new operations.ReservationsDetails(this);
this.reservationRecommendationsOperations = new operations.ReservationRecommendationsOperations(this);
this.budgets = new operations.Budgets(this);
this.forecasts = new operations.Forecasts(this);
this.operations = new operations.Operations(this);
this.priceSheet = new operations.PriceSheet(this);
this.costTagsOperations = new operations.CostTagsOperations(this);
this.tagsOperations = new operations.TagsOperations(this);
this.models = models;
msRest.addSerializationMixin(this);
}
Expand Down
243 changes: 243 additions & 0 deletions lib/services/consumptionManagement/lib/models/balance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

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

/**
* A balance resource.
*
* @extends models['Resource']
*/
class Balance extends models['Resource'] {
/**
* Create a Balance.
* @member {string} [currency] The ISO currency in which the meter is
* charged, for example, USD.
* @member {number} [beginningBalance] The beginning balance for the billing
* period.
* @member {number} [endingBalance] The ending balance for the billing period
* (for open periods this will be updated daily).
* @member {number} [newPurchases] Total new purchase amount.
* @member {number} [adjustments] Total adjustment amount.
* @member {number} [utilized] Total Commitment usage.
* @member {number} [serviceOverage] Overage for Azure services.
* @member {number} [chargesBilledSeparately] Charges Billed separately.
* @member {number} [totalOverage] serviceOverage + chargesBilledSeparately.
* @member {number} [totalUsage] Azure service commitment + total Overage.
* @member {number} [azureMarketplaceServiceCharges] Total charges for Azure
* Marketplace.
* @member {string} [billingFrequency] The billing frequency. Possible values
* include: 'Month', 'Quarter', 'Year'
* @member {boolean} [priceHidden] Price is hidden or not.
* @member {array} [newPurchasesDetails] List of new purchases.
* @member {array} [adjustmentDetails] List of Adjustments (Promo credit, SIE
* credit etc.).
*/
constructor() {
super();
}

/**
* Defines the metadata of Balance
*
* @returns {object} metadata of Balance
*
*/
mapper() {
return {
required: false,
serializedName: 'Balance',
type: {
name: 'Composite',
className: 'Balance',
modelProperties: {
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'
}
},
tags: {
required: false,
readOnly: true,
serializedName: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
},
currency: {
required: false,
readOnly: true,
serializedName: 'properties.currency',
type: {
name: 'String'
}
},
beginningBalance: {
required: false,
readOnly: true,
serializedName: 'properties.beginningBalance',
type: {
name: 'Number'
}
},
endingBalance: {
required: false,
readOnly: true,
serializedName: 'properties.endingBalance',
type: {
name: 'Number'
}
},
newPurchases: {
required: false,
readOnly: true,
serializedName: 'properties.newPurchases',
type: {
name: 'Number'
}
},
adjustments: {
required: false,
readOnly: true,
serializedName: 'properties.adjustments',
type: {
name: 'Number'
}
},
utilized: {
required: false,
readOnly: true,
serializedName: 'properties.utilized',
type: {
name: 'Number'
}
},
serviceOverage: {
required: false,
readOnly: true,
serializedName: 'properties.serviceOverage',
type: {
name: 'Number'
}
},
chargesBilledSeparately: {
required: false,
readOnly: true,
serializedName: 'properties.chargesBilledSeparately',
type: {
name: 'Number'
}
},
totalOverage: {
required: false,
readOnly: true,
serializedName: 'properties.totalOverage',
type: {
name: 'Number'
}
},
totalUsage: {
required: false,
readOnly: true,
serializedName: 'properties.totalUsage',
type: {
name: 'Number'
}
},
azureMarketplaceServiceCharges: {
required: false,
readOnly: true,
serializedName: 'properties.azureMarketplaceServiceCharges',
type: {
name: 'Number'
}
},
billingFrequency: {
required: false,
serializedName: 'properties.billingFrequency',
type: {
name: 'String'
}
},
priceHidden: {
required: false,
readOnly: true,
serializedName: 'properties.priceHidden',
type: {
name: 'Boolean'
}
},
newPurchasesDetails: {
required: false,
readOnly: true,
serializedName: 'properties.newPurchasesDetails',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'BalancePropertiesNewPurchasesDetailsItemElementType',
type: {
name: 'Composite',
className: 'BalancePropertiesNewPurchasesDetailsItem'
}
}
}
},
adjustmentDetails: {
required: false,
readOnly: true,
serializedName: 'properties.adjustmentDetails',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'BalancePropertiesAdjustmentDetailsItemElementType',
type: {
name: 'Composite',
className: 'BalancePropertiesAdjustmentDetailsItem'
}
}
}
}
}
}
};
}
}

module.exports = Balance;
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Class representing a BalancePropertiesAdjustmentDetailsItem.
*/
class BalancePropertiesAdjustmentDetailsItem {
/**
* Create a BalancePropertiesAdjustmentDetailsItem.
* @member {string} [name] the name of new adjustment.
* @member {number} [value] the value of new adjustment.
*/
constructor() {
}

/**
* Defines the metadata of BalancePropertiesAdjustmentDetailsItem
*
* @returns {object} metadata of BalancePropertiesAdjustmentDetailsItem
*
*/
mapper() {
return {
required: false,
serializedName: 'BalanceProperties_adjustmentDetailsItem',
type: {
name: 'Composite',
className: 'BalancePropertiesAdjustmentDetailsItem',
modelProperties: {
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
value: {
required: false,
readOnly: true,
serializedName: 'value',
type: {
name: 'Number'
}
}
}
}
};
}
}

module.exports = BalancePropertiesAdjustmentDetailsItem;
Loading

0 comments on commit d9fe641

Please sign in to comment.