diff --git a/lib/services/consumptionManagement/LICENSE.txt b/lib/services/consumptionManagement/LICENSE.txt index 5431ba98b9..8f3d856145 100644 --- a/lib/services/consumptionManagement/LICENSE.txt +++ b/lib/services/consumptionManagement/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/services/consumptionManagement/README.md b/lib/services/consumptionManagement/README.md index 098cfb823a..563308b9ae 100644 --- a/lib/services/consumptionManagement/README.md +++ b/lib/services/consumptionManagement/README.md @@ -3,46 +3,41 @@ uid: azure-arm-consumption summary: *content --- -# Microsoft Azure SDK for Node.js - ConsumptionManagementClient +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - ConsumptionManagementClient + This project provides a Node.js package for accessing Azure. Right now it supports: - **Node.js version 6.x.x or higher** -## Features +### Features -## How to Install +### How to Install ```bash npm install azure-arm-consumption ``` -## How to use +### How to use -### Authentication, client creation and list usageDetails as an example. +#### Authentication, client creation, and list operations as an example. ```javascript const msRestAzure = require("ms-rest-azure"); const ConsumptionManagementClient = require("azure-arm-consumption"); msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - 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) => { - console.log("The result is:"); - console.log(result); - }); + const subscriptionId = ""; + const client = new ConsumptionManagementClient(creds, subscriptionId); + + return client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); }).catch((err) => { console.log('An error occurred:'); console.dir(err, {depth: null, colors: true}); }); - -## Related projects +``` +### Related projects - [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-node%2Flib%2Fservices%2FconsumptionManagement%2FREADME.png) diff --git a/lib/services/consumptionManagement/lib/consumptionManagementClient.d.ts b/lib/services/consumptionManagement/lib/consumptionManagementClient.d.ts index b722bb2e6d..ae3271154c 100644 --- a/lib/services/consumptionManagement/lib/consumptionManagementClient.d.ts +++ b/lib/services/consumptionManagement/lib/consumptionManagementClient.d.ts @@ -21,8 +21,6 @@ export default class ConsumptionManagementClient extends AzureServiceClient { * @class * @param {credentials} credentials - Credentials needed for the client to connect to Azure. * - * @param {string} subscriptionId - Azure Subscription ID. - * * @param {string} [baseUri] - The base URI of the service. * * @param {object} [options] - The parameter options @@ -41,14 +39,12 @@ export default class ConsumptionManagementClient extends AzureServiceClient { * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ - constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + constructor(credentials: ServiceClientCredentials, baseUri?: string, options?: AzureServiceClientOptions); credentials: ServiceClientCredentials; apiVersion: string; - subscriptionId: string; - acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -56,19 +52,15 @@ export default class ConsumptionManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups - usageDetails: operations.UsageDetails; - marketplaces: operations.Marketplaces; - balances: operations.Balances; - reservationsSummaries: operations.ReservationsSummaries; - reservationsDetails: operations.ReservationsDetails; - reservationRecommendations: operations.ReservationRecommendations; - budgets: operations.Budgets; - priceSheet: operations.PriceSheet; - tags: operations.Tags; - forecasts: operations.Forecasts; operations: operations.Operations; - aggregatedCost: operations.AggregatedCost; - charges: operations.Charges; + creditSummaryByBillingProfile: operations.CreditSummaryByBillingProfile; + eventsByBillingProfile: operations.EventsByBillingProfile; + lotsByBillingProfile: operations.LotsByBillingProfile; + invoicePricesheet: operations.InvoicePricesheet; + billingProfilePricesheet: operations.BillingProfilePricesheet; + chargesByBillingAccount: operations.ChargesByBillingAccount; + chargesByBillingProfile: operations.ChargesByBillingProfile; + chargesByInvoiceSection: operations.ChargesByInvoiceSection; } export { ConsumptionManagementClient, models as ConsumptionManagementModels }; diff --git a/lib/services/consumptionManagement/lib/consumptionManagementClient.js b/lib/services/consumptionManagement/lib/consumptionManagementClient.js index 57b0c67bcc..e0e0fbc461 100644 --- a/lib/services/consumptionManagement/lib/consumptionManagementClient.js +++ b/lib/services/consumptionManagement/lib/consumptionManagementClient.js @@ -27,7 +27,6 @@ class ConsumptionManagementClient extends ServiceClient { /** * Create a ConsumptionManagementClient. * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * @param {string} subscriptionId - Azure Subscription ID. * @param {string} [baseUri] - The base URI of the service. * @param {object} [options] - The parameter options * @param {Array} [options.filters] - Filters to be added to the request pipeline @@ -38,19 +37,16 @@ class ConsumptionManagementClient extends ServiceClient { * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ - constructor(credentials, subscriptionId, baseUri, options) { + constructor(credentials, baseUri, options) { if (credentials === null || credentials === undefined) { throw new Error('\'credentials\' cannot be null.'); } - if (subscriptionId === null || subscriptionId === undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } if (!options) options = {}; super(credentials, options); - this.apiVersion = '2018-10-01'; + this.apiVersion = '2018-11-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -59,7 +55,6 @@ class ConsumptionManagementClient extends ServiceClient { this.baseUri = 'https://management.azure.com'; } this.credentials = credentials; - this.subscriptionId = subscriptionId; let packageInfo = this.getPackageJsonInfo(__dirname); this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); @@ -72,19 +67,15 @@ 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.balances = new operations.Balances(this); - this.reservationsSummaries = new operations.ReservationsSummaries(this); - this.reservationsDetails = new operations.ReservationsDetails(this); - this.reservationRecommendations = new operations.ReservationRecommendations(this); - this.budgets = new operations.Budgets(this); - this.priceSheet = new operations.PriceSheet(this); - this.tags = new operations.Tags(this); - this.forecasts = new operations.Forecasts(this); this.operations = new operations.Operations(this); - this.aggregatedCost = new operations.AggregatedCost(this); - this.charges = new operations.Charges(this); + this.creditSummaryByBillingProfile = new operations.CreditSummaryByBillingProfile(this); + this.eventsByBillingProfile = new operations.EventsByBillingProfile(this); + this.lotsByBillingProfile = new operations.LotsByBillingProfile(this); + this.invoicePricesheet = new operations.InvoicePricesheet(this); + this.billingProfilePricesheet = new operations.BillingProfilePricesheet(this); + this.chargesByBillingAccount = new operations.ChargesByBillingAccount(this); + this.chargesByBillingProfile = new operations.ChargesByBillingProfile(this); + this.chargesByInvoiceSection = new operations.ChargesByInvoiceSection(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/consumptionManagement/lib/models/address.js b/lib/services/consumptionManagement/lib/models/address.js new file mode 100644 index 0000000000..a3c67c37e8 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/address.js @@ -0,0 +1,108 @@ +/* + * 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'; + +/** + * Address details. + * + */ +class Address { + /** + * Create a Address. + * @property {string} [addressLine1] Address Line1. + * @property {string} [addressLine2] Address Line2. + * @property {string} [addressLine3] Address Line3. + * @property {string} [city] Address City. + * @property {string} [region] Address Region. + * @property {string} [country] Country code uses ISO2, 2-digit format.. + * @property {string} [postalCode] Postal Code. + * @property {string} [phoneNumber] Phone Number. + */ + constructor() { + } + + /** + * Defines the metadata of Address + * + * @returns {object} metadata of Address + * + */ + mapper() { + return { + required: false, + serializedName: 'Address', + type: { + name: 'Composite', + className: 'Address', + modelProperties: { + addressLine1: { + required: false, + serializedName: 'addressLine1', + type: { + name: 'String' + } + }, + addressLine2: { + required: false, + serializedName: 'addressLine2', + type: { + name: 'String' + } + }, + addressLine3: { + required: false, + serializedName: 'addressLine3', + type: { + name: 'String' + } + }, + city: { + required: false, + serializedName: 'city', + type: { + name: 'String' + } + }, + region: { + required: false, + serializedName: 'region', + type: { + name: 'String' + } + }, + country: { + required: false, + serializedName: 'country', + type: { + name: 'String' + } + }, + postalCode: { + required: false, + serializedName: 'postalCode', + type: { + name: 'String' + } + }, + phoneNumber: { + required: false, + serializedName: 'phoneNumber', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Address; diff --git a/lib/services/consumptionManagement/lib/models/amount.js b/lib/services/consumptionManagement/lib/models/amount.js new file mode 100644 index 0000000000..c88d7b32db --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/amount.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Object to represent monetary quantities. + * + */ +class Amount { + /** + * Create a Amount. + * @property {string} [currency] The currency for the amount value. + * @property {number} [value] Amount value. + */ + constructor() { + } + + /** + * Defines the metadata of Amount + * + * @returns {object} metadata of Amount + * + */ + mapper() { + return { + required: false, + serializedName: 'Amount', + type: { + name: 'Composite', + className: 'Amount', + modelProperties: { + currency: { + required: false, + readOnly: true, + serializedName: 'currency', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = Amount; diff --git a/lib/services/consumptionManagement/lib/models/billingAccount.js b/lib/services/consumptionManagement/lib/models/billingAccount.js new file mode 100644 index 0000000000..1f06ccad13 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/billingAccount.js @@ -0,0 +1,258 @@ +/* + * 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 billing account resource. + * + * @extends models['Resource'] + */ +class BillingAccount extends models['Resource'] { + /** + * Create a BillingAccount. + * @property {string} [company] The Company this billing account belongs to. + * @property {string} [accountType] The billing account Type. Possible values + * include: 'CommerceRoot', 'Enrollment' + * @property {object} [address] The address associated with billing account. + * @property {string} [address.addressLine1] Address Line1. + * @property {string} [address.addressLine2] Address Line2. + * @property {string} [address.addressLine3] Address Line3. + * @property {string} [address.city] Address City. + * @property {string} [address.region] Address Region. + * @property {string} [address.country] Country code uses ISO2, 2-digit + * format.. + * @property {string} [address.postalCode] Postal Code. + * @property {string} [address.phoneNumber] Phone Number. + * @property {string} [defaultCurrency] The ISO currency, for example, USD. + * @property {string} [country] The country associated with billing account. + * @property {string} [agreements] Agreements associated with billing account + * @property {array} [invoiceSections] The invoiceSections associated to the + * billing account. + * @property {array} [billingProfiles] The billing profiles associated to the + * billing account. + * @property {object} [enrollmentDetails] The details about the associated + * legacy enrollment. By default this is not populated, unless it's specified + * in $expand. + * @property {date} [enrollmentDetails.startDate] Enrollment Start Date + * @property {date} [enrollmentDetails.endDate] Enrollment End Date + * @property {string} [enrollmentDetails.currency] The currency associated + * with enrollment + * @property {string} [enrollmentDetails.channel] The channel for Enrollment + * @property {object} [enrollmentDetails.policies] The attributes associated + * with legacy enrollment. + * @property {boolean} [enrollmentDetails.policies.accountOwnerViewCharges] + * The accountOwnerViewCharges flag for Enrollment + * @property {boolean} + * [enrollmentDetails.policies.departmentAdminViewCharges] The + * departmentAdminViewCharges flag for Enrollment + * @property {boolean} [enrollmentDetails.policies.marketplacesEnabled] The + * marketplaces flag for Enrollment + * @property {boolean} [enrollmentDetails.policies.reservedInstancesEnabled] + * The reserved instances flag for Enrollment + * @property {string} [enrollmentDetails.language] The language for + * Enrollment + * @property {string} [enrollmentDetails.countryCode] The countryCode for + * Enrollment + * @property {string} [enrollmentDetails.status] Enrollment status + * @property {string} [enrollmentDetails.billingCylce] Enrollment billing + * cycle + * @property {array} [departments] The departments associated to the + * enrollment. + * @property {array} [enrollmentAccounts] The accounts associated to the + * enrollment. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BillingAccount + * + * @returns {object} metadata of BillingAccount + * + */ + mapper() { + return { + required: false, + serializedName: 'BillingAccount', + type: { + name: 'Composite', + className: 'BillingAccount', + 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' + } + } + } + }, + company: { + required: false, + readOnly: true, + serializedName: 'properties.company', + type: { + name: 'String' + } + }, + accountType: { + required: false, + readOnly: true, + serializedName: 'properties.accountType', + type: { + name: 'String' + } + }, + address: { + required: false, + serializedName: 'properties.address', + type: { + name: 'Composite', + className: 'Address' + } + }, + defaultCurrency: { + required: false, + readOnly: true, + serializedName: 'properties.defaultCurrency', + type: { + name: 'String' + } + }, + country: { + required: false, + readOnly: true, + serializedName: 'properties.country', + type: { + name: 'String' + } + }, + agreements: { + required: false, + readOnly: true, + serializedName: 'properties.agreements', + type: { + name: 'String' + } + }, + invoiceSections: { + required: false, + readOnly: true, + serializedName: 'properties.invoiceSections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InvoiceSectionElementType', + type: { + name: 'Composite', + className: 'InvoiceSection' + } + } + } + }, + billingProfiles: { + required: false, + readOnly: true, + serializedName: 'properties.billingProfiles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BillingProfileElementType', + type: { + name: 'Composite', + className: 'BillingProfile' + } + } + } + }, + enrollmentDetails: { + required: false, + readOnly: true, + serializedName: 'properties.enrollmentDetails', + type: { + name: 'Composite', + className: 'Enrollment' + } + }, + departments: { + required: false, + readOnly: true, + serializedName: 'properties.departments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DepartmentElementType', + type: { + name: 'Composite', + className: 'Department' + } + } + } + }, + enrollmentAccounts: { + required: false, + readOnly: true, + serializedName: 'properties.enrollmentAccounts', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EnrollmentAccountElementType', + type: { + name: 'Composite', + className: 'EnrollmentAccount' + } + } + } + } + } + } + }; + } +} + +module.exports = BillingAccount; diff --git a/lib/services/consumptionManagement/lib/models/billingProfile.js b/lib/services/consumptionManagement/lib/models/billingProfile.js new file mode 100644 index 0000000000..e3e06c4bf1 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/billingProfile.js @@ -0,0 +1,157 @@ +/* + * 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 billing profile resource. + * + * @extends models['Resource'] + */ +class BillingProfile extends models['Resource'] { + /** + * Create a BillingProfile. + * @property {string} [displayName] The billing profile name. + * @property {string} [poNumber] Purchase order number. + * @property {object} [billingAddress] Billing address. + * @property {string} [billingAddress.addressLine1] Address Line1. + * @property {string} [billingAddress.addressLine2] Address Line2. + * @property {string} [billingAddress.addressLine3] Address Line3. + * @property {string} [billingAddress.city] Address City. + * @property {string} [billingAddress.region] Address Region. + * @property {string} [billingAddress.country] Country code uses ISO2, + * 2-digit format.. + * @property {string} [billingAddress.postalCode] Postal Code. + * @property {string} [billingAddress.phoneNumber] Phone Number. + * @property {string} [billingContact] Billing contact. + * @property {boolean} [emailInvoice] Email invoice. + * @property {number} [invoiceDay] Invoice day. + * @property {string} [currency] Currency on the billing profile. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BillingProfile + * + * @returns {object} metadata of BillingProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'BillingProfile', + type: { + name: 'Composite', + className: 'BillingProfile', + 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' + } + } + } + }, + displayName: { + required: false, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + }, + poNumber: { + required: false, + serializedName: 'properties.poNumber', + type: { + name: 'String' + } + }, + billingAddress: { + required: false, + serializedName: 'properties.billingAddress', + type: { + name: 'Composite', + className: 'Address' + } + }, + billingContact: { + required: false, + readOnly: true, + serializedName: 'properties.billingContact', + type: { + name: 'String' + } + }, + emailInvoice: { + required: false, + readOnly: true, + serializedName: 'properties.emailInvoice', + type: { + name: 'Boolean' + } + }, + invoiceDay: { + required: false, + readOnly: true, + serializedName: 'properties.invoiceDay', + type: { + name: 'Number' + } + }, + currency: { + required: false, + readOnly: true, + serializedName: 'properties.currency', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BillingProfile; diff --git a/lib/services/consumptionManagement/lib/models/chargeSummaryByBillingAccount.js b/lib/services/consumptionManagement/lib/models/chargeSummaryByBillingAccount.js new file mode 100644 index 0000000000..e1757ffe40 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/chargeSummaryByBillingAccount.js @@ -0,0 +1,184 @@ +/* + * 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 charge summary resource by billing account. + * + * @extends models['Resource'] + */ +class ChargeSummaryByBillingAccount extends models['Resource'] { + /** + * Create a ChargeSummaryByBillingAccount. + * @property {string} [billingPeriodId] The id of the billing period resource + * that the usage belongs to. + * @property {string} [usageStart] Billing period start date. + * @property {string} [usageEnd] Billing period end date. + * @property {object} [azureCharges] Azure Charges. + * @property {string} [azureCharges.currency] The currency for the amount + * value. + * @property {number} [azureCharges.value] Amount value. + * @property {object} [chargesBilledSeparately] Charges Billed separately. + * @property {string} [chargesBilledSeparately.currency] The currency for the + * amount value. + * @property {number} [chargesBilledSeparately.value] Amount value. + * @property {object} [marketplaceCharges] Marketplace Charges. + * @property {string} [marketplaceCharges.currency] The currency for the + * amount value. + * @property {number} [marketplaceCharges.value] Amount value. + * @property {string} [billingAccountId] The id of the billing account + * resource that the charge belongs to. + * @property {string} [billingProfileId] The id of the billing profile + * resource that the charge belongs to. + * @property {string} [invoiceSectionId] The id of the invoice section + * resource that the charge belongs to. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChargeSummaryByBillingAccount + * + * @returns {object} metadata of ChargeSummaryByBillingAccount + * + */ + mapper() { + return { + required: false, + serializedName: 'ChargeSummaryByBillingAccount', + type: { + name: 'Composite', + className: 'ChargeSummaryByBillingAccount', + 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' + } + } + } + }, + billingPeriodId: { + required: false, + readOnly: true, + serializedName: 'properties.billingPeriodId', + type: { + name: 'String' + } + }, + usageStart: { + required: false, + readOnly: true, + serializedName: 'properties.usageStart', + type: { + name: 'String' + } + }, + usageEnd: { + required: false, + readOnly: true, + serializedName: 'properties.usageEnd', + type: { + name: 'String' + } + }, + azureCharges: { + required: false, + readOnly: true, + serializedName: 'properties.azureCharges', + type: { + name: 'Composite', + className: 'Amount' + } + }, + chargesBilledSeparately: { + required: false, + readOnly: true, + serializedName: 'properties.chargesBilledSeparately', + type: { + name: 'Composite', + className: 'Amount' + } + }, + marketplaceCharges: { + required: false, + readOnly: true, + serializedName: 'properties.marketplaceCharges', + type: { + name: 'Composite', + className: 'Amount' + } + }, + billingAccountId: { + required: false, + readOnly: true, + serializedName: 'properties.billingAccountId', + type: { + name: 'String' + } + }, + billingProfileId: { + required: false, + readOnly: true, + serializedName: 'properties.billingProfileId', + type: { + name: 'String' + } + }, + invoiceSectionId: { + required: false, + readOnly: true, + serializedName: 'properties.invoiceSectionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChargeSummaryByBillingAccount; diff --git a/lib/services/consumptionManagement/lib/models/chargeSummaryByBillingProfile.js b/lib/services/consumptionManagement/lib/models/chargeSummaryByBillingProfile.js new file mode 100644 index 0000000000..4be524532e --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/chargeSummaryByBillingProfile.js @@ -0,0 +1,184 @@ +/* + * 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 charge summary resource by billing profile. + * + * @extends models['Resource'] + */ +class ChargeSummaryByBillingProfile extends models['Resource'] { + /** + * Create a ChargeSummaryByBillingProfile. + * @property {string} [billingPeriodId] The id of the billing period resource + * that the usage belongs to. + * @property {string} [usageStart] Billing period start date. + * @property {string} [usageEnd] Billing period end date. + * @property {object} [azureCharges] Azure Charges. + * @property {string} [azureCharges.currency] The currency for the amount + * value. + * @property {number} [azureCharges.value] Amount value. + * @property {object} [chargesBilledSeparately] Charges Billed separately. + * @property {string} [chargesBilledSeparately.currency] The currency for the + * amount value. + * @property {number} [chargesBilledSeparately.value] Amount value. + * @property {object} [marketplaceCharges] Marketplace Charges. + * @property {string} [marketplaceCharges.currency] The currency for the + * amount value. + * @property {number} [marketplaceCharges.value] Amount value. + * @property {string} [billingAccountId] The id of the billing account + * resource that the charge belongs to. + * @property {string} [billingProfileId] The id of the billing profile + * resource that the charge belongs to. + * @property {string} [invoiceSectionId] The id of the invoice section + * resource that the charge belongs to. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChargeSummaryByBillingProfile + * + * @returns {object} metadata of ChargeSummaryByBillingProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ChargeSummaryByBillingProfile', + type: { + name: 'Composite', + className: 'ChargeSummaryByBillingProfile', + 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' + } + } + } + }, + billingPeriodId: { + required: false, + readOnly: true, + serializedName: 'properties.billingPeriodId', + type: { + name: 'String' + } + }, + usageStart: { + required: false, + readOnly: true, + serializedName: 'properties.usageStart', + type: { + name: 'String' + } + }, + usageEnd: { + required: false, + readOnly: true, + serializedName: 'properties.usageEnd', + type: { + name: 'String' + } + }, + azureCharges: { + required: false, + readOnly: true, + serializedName: 'properties.azureCharges', + type: { + name: 'Composite', + className: 'Amount' + } + }, + chargesBilledSeparately: { + required: false, + readOnly: true, + serializedName: 'properties.chargesBilledSeparately', + type: { + name: 'Composite', + className: 'Amount' + } + }, + marketplaceCharges: { + required: false, + readOnly: true, + serializedName: 'properties.marketplaceCharges', + type: { + name: 'Composite', + className: 'Amount' + } + }, + billingAccountId: { + required: false, + readOnly: true, + serializedName: 'properties.billingAccountId', + type: { + name: 'String' + } + }, + billingProfileId: { + required: false, + readOnly: true, + serializedName: 'properties.billingProfileId', + type: { + name: 'String' + } + }, + invoiceSectionId: { + required: false, + readOnly: true, + serializedName: 'properties.invoiceSectionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChargeSummaryByBillingProfile; diff --git a/lib/services/consumptionManagement/lib/models/chargeSummaryByInvoiceSection.js b/lib/services/consumptionManagement/lib/models/chargeSummaryByInvoiceSection.js new file mode 100644 index 0000000000..ae2ff4a10b --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/chargeSummaryByInvoiceSection.js @@ -0,0 +1,184 @@ +/* + * 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 charge summary resource by invoiceSection. + * + * @extends models['Resource'] + */ +class ChargeSummaryByInvoiceSection extends models['Resource'] { + /** + * Create a ChargeSummaryByInvoiceSection. + * @property {string} [billingPeriodId] The id of the billing period resource + * that the usage belongs to. + * @property {string} [usageStart] Billing period start date. + * @property {string} [usageEnd] Billing period end date. + * @property {object} [azureCharges] Azure Charges. + * @property {string} [azureCharges.currency] The currency for the amount + * value. + * @property {number} [azureCharges.value] Amount value. + * @property {object} [chargesBilledSeparately] Charges Billed separately. + * @property {string} [chargesBilledSeparately.currency] The currency for the + * amount value. + * @property {number} [chargesBilledSeparately.value] Amount value. + * @property {object} [marketplaceCharges] Marketplace Charges. + * @property {string} [marketplaceCharges.currency] The currency for the + * amount value. + * @property {number} [marketplaceCharges.value] Amount value. + * @property {string} [billingAccountId] The id of the billing account + * resource that the charge belongs to. + * @property {string} [billingProfileId] The id of the billing profile + * resource that the charge belongs to. + * @property {string} [invoiceSectionId] The id of the invoice section + * resource that the charge belongs to. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChargeSummaryByInvoiceSection + * + * @returns {object} metadata of ChargeSummaryByInvoiceSection + * + */ + mapper() { + return { + required: false, + serializedName: 'ChargeSummaryByInvoiceSection', + type: { + name: 'Composite', + className: 'ChargeSummaryByInvoiceSection', + 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' + } + } + } + }, + billingPeriodId: { + required: false, + readOnly: true, + serializedName: 'properties.billingPeriodId', + type: { + name: 'String' + } + }, + usageStart: { + required: false, + readOnly: true, + serializedName: 'properties.usageStart', + type: { + name: 'String' + } + }, + usageEnd: { + required: false, + readOnly: true, + serializedName: 'properties.usageEnd', + type: { + name: 'String' + } + }, + azureCharges: { + required: false, + readOnly: true, + serializedName: 'properties.azureCharges', + type: { + name: 'Composite', + className: 'Amount' + } + }, + chargesBilledSeparately: { + required: false, + readOnly: true, + serializedName: 'properties.chargesBilledSeparately', + type: { + name: 'Composite', + className: 'Amount' + } + }, + marketplaceCharges: { + required: false, + readOnly: true, + serializedName: 'properties.marketplaceCharges', + type: { + name: 'Composite', + className: 'Amount' + } + }, + billingAccountId: { + required: false, + readOnly: true, + serializedName: 'properties.billingAccountId', + type: { + name: 'String' + } + }, + billingProfileId: { + required: false, + readOnly: true, + serializedName: 'properties.billingProfileId', + type: { + name: 'String' + } + }, + invoiceSectionId: { + required: false, + readOnly: true, + serializedName: 'properties.invoiceSectionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChargeSummaryByInvoiceSection; diff --git a/lib/services/consumptionManagement/lib/models/chargesListByBillingAccount.js b/lib/services/consumptionManagement/lib/models/chargesListByBillingAccount.js new file mode 100644 index 0000000000..f765b1c7b6 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/chargesListByBillingAccount.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Result of listing charge summary by billing account. It contains a list of + * available change summaries in reverse chronological order by billing period. + * + */ +class ChargesListByBillingAccount { + /** + * Create a ChargesListByBillingAccount. + * @property {array} [value] The list of charge summary by billing account. + */ + constructor() { + } + + /** + * Defines the metadata of ChargesListByBillingAccount + * + * @returns {object} metadata of ChargesListByBillingAccount + * + */ + mapper() { + return { + required: false, + serializedName: 'ChargesListByBillingAccount', + type: { + name: 'Composite', + className: 'ChargesListByBillingAccount', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ChargeSummaryByBillingAccountElementType', + type: { + name: 'Composite', + className: 'ChargeSummaryByBillingAccount' + } + } + } + } + } + } + }; + } +} + +module.exports = ChargesListByBillingAccount; diff --git a/lib/services/consumptionManagement/lib/models/chargesListByBillingProfile.js b/lib/services/consumptionManagement/lib/models/chargesListByBillingProfile.js new file mode 100644 index 0000000000..96f780b846 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/chargesListByBillingProfile.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Result of listing charge summary by billing profile. It contains a list of + * available change summaries in reverse chronological order by billing period. + * + */ +class ChargesListByBillingProfile { + /** + * Create a ChargesListByBillingProfile. + * @property {array} [value] The list of charge summary by billing profile. + */ + constructor() { + } + + /** + * Defines the metadata of ChargesListByBillingProfile + * + * @returns {object} metadata of ChargesListByBillingProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ChargesListByBillingProfile', + type: { + name: 'Composite', + className: 'ChargesListByBillingProfile', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ChargeSummaryByBillingProfileElementType', + type: { + name: 'Composite', + className: 'ChargeSummaryByBillingProfile' + } + } + } + } + } + } + }; + } +} + +module.exports = ChargesListByBillingProfile; diff --git a/lib/services/consumptionManagement/lib/models/chargesListByInvoiceSection.js b/lib/services/consumptionManagement/lib/models/chargesListByInvoiceSection.js new file mode 100644 index 0000000000..08e2674ab7 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/chargesListByInvoiceSection.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Result of listing charge summary by invoiceSection. It contains a list of + * available change summaries in reverse chronological order by billing period. + * + */ +class ChargesListByInvoiceSection { + /** + * Create a ChargesListByInvoiceSection. + * @property {array} [value] The list of charge summary by invoiceSection. + */ + constructor() { + } + + /** + * Defines the metadata of ChargesListByInvoiceSection + * + * @returns {object} metadata of ChargesListByInvoiceSection + * + */ + mapper() { + return { + required: false, + serializedName: 'ChargesListByInvoiceSection', + type: { + name: 'Composite', + className: 'ChargesListByInvoiceSection', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ChargeSummaryByInvoiceSectionElementType', + type: { + name: 'Composite', + className: 'ChargeSummaryByInvoiceSection' + } + } + } + } + } + } + }; + } +} + +module.exports = ChargesListByInvoiceSection; diff --git a/lib/services/consumptionManagement/lib/models/creditBalanceSummary.js b/lib/services/consumptionManagement/lib/models/creditBalanceSummary.js new file mode 100644 index 0000000000..ef5dbf4c51 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/creditBalanceSummary.js @@ -0,0 +1,70 @@ +/* + * 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'; + +/** + * Summary of credit balances. + * + */ +class CreditBalanceSummary { + /** + * Create a CreditBalanceSummary. + * @property {object} [estimatedBalance] Estimated balance. + * @property {string} [estimatedBalance.currency] The currency for the amount + * value. + * @property {number} [estimatedBalance.value] Amount value. + * @property {object} [currentBalance] Current balance. + * @property {string} [currentBalance.currency] The currency for the amount + * value. + * @property {number} [currentBalance.value] Amount value. + */ + constructor() { + } + + /** + * Defines the metadata of CreditBalanceSummary + * + * @returns {object} metadata of CreditBalanceSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'CreditBalanceSummary', + type: { + name: 'Composite', + className: 'CreditBalanceSummary', + modelProperties: { + estimatedBalance: { + required: false, + readOnly: true, + serializedName: 'estimatedBalance', + type: { + name: 'Composite', + className: 'Amount' + } + }, + currentBalance: { + required: false, + readOnly: true, + serializedName: 'currentBalance', + type: { + name: 'Composite', + className: 'Amount' + } + } + } + } + }; + } +} + +module.exports = CreditBalanceSummary; diff --git a/lib/services/consumptionManagement/lib/models/creditSummary.js b/lib/services/consumptionManagement/lib/models/creditSummary.js new file mode 100644 index 0000000000..8e5f241913 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/creditSummary.js @@ -0,0 +1,144 @@ +/* + * 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 credit summary resource. + * + * @extends models['Resource'] + */ +class CreditSummary extends models['Resource'] { + /** + * Create a CreditSummary. + * @property {object} [balanceSummary] Summary of balances associated with + * this credit summary. + * @property {object} [balanceSummary.estimatedBalance] Estimated balance. + * @property {string} [balanceSummary.estimatedBalance.currency] The currency + * for the amount value. + * @property {number} [balanceSummary.estimatedBalance.value] Amount value. + * @property {object} [balanceSummary.currentBalance] Current balance. + * @property {string} [balanceSummary.currentBalance.currency] The currency + * for the amount value. + * @property {number} [balanceSummary.currentBalance.value] Amount value. + * @property {object} [pendingCreditAdjustments] Pending Credit Adjustments. + * @property {string} [pendingCreditAdjustments.currency] The currency for + * the amount value. + * @property {number} [pendingCreditAdjustments.value] Amount value. + * @property {object} [expiredCredit] Expired Credit. + * @property {string} [expiredCredit.currency] The currency for the amount + * value. + * @property {number} [expiredCredit.value] Amount value. + * @property {object} [pendingEligibleCharges] Pending Eligible Charges. + * @property {string} [pendingEligibleCharges.currency] The currency for the + * amount value. + * @property {number} [pendingEligibleCharges.value] Amount value. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CreditSummary + * + * @returns {object} metadata of CreditSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'CreditSummary', + type: { + name: 'Composite', + className: 'CreditSummary', + 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' + } + } + } + }, + balanceSummary: { + required: false, + serializedName: 'properties.balanceSummary', + type: { + name: 'Composite', + className: 'CreditBalanceSummary' + } + }, + pendingCreditAdjustments: { + required: false, + readOnly: true, + serializedName: 'properties.pendingCreditAdjustments', + type: { + name: 'Composite', + className: 'Amount' + } + }, + expiredCredit: { + required: false, + readOnly: true, + serializedName: 'properties.expiredCredit', + type: { + name: 'Composite', + className: 'Amount' + } + }, + pendingEligibleCharges: { + required: false, + readOnly: true, + serializedName: 'properties.pendingEligibleCharges', + type: { + name: 'Composite', + className: 'Amount' + } + } + } + } + }; + } +} + +module.exports = CreditSummary; diff --git a/lib/services/consumptionManagement/lib/models/department.js b/lib/services/consumptionManagement/lib/models/department.js new file mode 100644 index 0000000000..3a802d8b5b --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/department.js @@ -0,0 +1,128 @@ +/* + * 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 department resource. + * + * @extends models['Resource'] + */ +class Department extends models['Resource'] { + /** + * Create a Department. + * @property {string} [departmentName] The name for department. + * @property {string} [costCenter] The cost center name. + * @property {string} [status] The status for department. + * @property {array} [enrollmentAccounts] Associated enrollment accounts. By + * default this is not populated, unless it's specified in $expand. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Department + * + * @returns {object} metadata of Department + * + */ + mapper() { + return { + required: false, + serializedName: 'Department', + type: { + name: 'Composite', + className: 'Department', + 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' + } + } + } + }, + departmentName: { + required: false, + serializedName: 'properties.departmentName', + type: { + name: 'String' + } + }, + costCenter: { + required: false, + serializedName: 'properties.costCenter', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + enrollmentAccounts: { + required: false, + serializedName: 'properties.enrollmentAccounts', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EnrollmentAccountElementType', + type: { + name: 'Composite', + className: 'EnrollmentAccount' + } + } + } + } + } + } + }; + } +} + +module.exports = Department; diff --git a/lib/services/consumptionManagement/lib/models/enrollment.js b/lib/services/consumptionManagement/lib/models/enrollment.js new file mode 100644 index 0000000000..d4a3aeb424 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/enrollment.js @@ -0,0 +1,135 @@ +/* + * 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'; + +/** + * Current entity level details + * + */ +class Enrollment { + /** + * Create a Enrollment. + * @property {date} [startDate] Enrollment Start Date + * @property {date} [endDate] Enrollment End Date + * @property {string} [currency] The currency associated with enrollment + * @property {string} [channel] The channel for Enrollment + * @property {object} [policies] The attributes associated with legacy + * enrollment. + * @property {boolean} [policies.accountOwnerViewCharges] The + * accountOwnerViewCharges flag for Enrollment + * @property {boolean} [policies.departmentAdminViewCharges] The + * departmentAdminViewCharges flag for Enrollment + * @property {boolean} [policies.marketplacesEnabled] The marketplaces flag + * for Enrollment + * @property {boolean} [policies.reservedInstancesEnabled] The reserved + * instances flag for Enrollment + * @property {string} [language] The language for Enrollment + * @property {string} [countryCode] The countryCode for Enrollment + * @property {string} [status] Enrollment status + * @property {string} [billingCylce] Enrollment billing cycle + */ + constructor() { + } + + /** + * Defines the metadata of Enrollment + * + * @returns {object} metadata of Enrollment + * + */ + mapper() { + return { + required: false, + serializedName: 'Enrollment', + type: { + name: 'Composite', + className: 'Enrollment', + modelProperties: { + startDate: { + required: false, + readOnly: true, + serializedName: 'startDate', + type: { + name: 'DateTime' + } + }, + endDate: { + required: false, + readOnly: true, + serializedName: 'endDate', + type: { + name: 'DateTime' + } + }, + currency: { + required: false, + readOnly: true, + serializedName: 'currency', + type: { + name: 'String' + } + }, + channel: { + required: false, + readOnly: true, + serializedName: 'channel', + type: { + name: 'String' + } + }, + policies: { + required: false, + readOnly: true, + serializedName: 'policies', + type: { + name: 'Composite', + className: 'EnrollmentPolicies' + } + }, + language: { + required: false, + readOnly: true, + serializedName: 'language', + type: { + name: 'String' + } + }, + countryCode: { + required: false, + readOnly: true, + serializedName: 'countryCode', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + billingCylce: { + required: false, + readOnly: true, + serializedName: 'billingCylce', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Enrollment; diff --git a/lib/services/consumptionManagement/lib/models/enrollmentAccount.js b/lib/services/consumptionManagement/lib/models/enrollmentAccount.js new file mode 100644 index 0000000000..9e129cf8fc --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/enrollmentAccount.js @@ -0,0 +1,151 @@ +/* + * 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'); + +/** + * An account resource. + * + * @extends models['Resource'] + */ +class EnrollmentAccount extends models['Resource'] { + /** + * Create a EnrollmentAccount. + * @property {string} [accountName] The account name. + * @property {string} [costCenter] The cost center name. + * @property {string} [accountOwner] The account owner + * @property {string} [status] The status for account. + * @property {date} [startDate] Account Start Date + * @property {date} [endDate] Account End Date + * @property {object} [department] Associated department. By default this is + * not populated, unless it's specified in $expand. + * @property {string} [department.departmentName] The name for department. + * @property {string} [department.costCenter] The cost center name. + * @property {string} [department.status] The status for department. + * @property {array} [department.enrollmentAccounts] Associated enrollment + * accounts. By default this is not populated, unless it's specified in + * $expand. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EnrollmentAccount + * + * @returns {object} metadata of EnrollmentAccount + * + */ + mapper() { + return { + required: false, + serializedName: 'EnrollmentAccount', + type: { + name: 'Composite', + className: 'EnrollmentAccount', + 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' + } + } + } + }, + accountName: { + required: false, + serializedName: 'properties.accountName', + type: { + name: 'String' + } + }, + costCenter: { + required: false, + serializedName: 'properties.costCenter', + type: { + name: 'String' + } + }, + accountOwner: { + required: false, + serializedName: 'properties.accountOwner', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + startDate: { + required: false, + serializedName: 'properties.startDate', + type: { + name: 'DateTime' + } + }, + endDate: { + required: false, + serializedName: 'properties.endDate', + type: { + name: 'DateTime' + } + }, + department: { + required: false, + serializedName: 'properties.department', + type: { + name: 'Composite', + className: 'Department' + } + } + } + } + }; + } +} + +module.exports = EnrollmentAccount; diff --git a/lib/services/consumptionManagement/lib/models/enrollmentPolicies.js b/lib/services/consumptionManagement/lib/models/enrollmentPolicies.js new file mode 100644 index 0000000000..9c6dbeb19f --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/enrollmentPolicies.js @@ -0,0 +1,84 @@ +/* + * 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'; + +/** + * The attributes associated with legacy enrollment + * + */ +class EnrollmentPolicies { + /** + * Create a EnrollmentPolicies. + * @property {boolean} [accountOwnerViewCharges] The accountOwnerViewCharges + * flag for Enrollment + * @property {boolean} [departmentAdminViewCharges] The + * departmentAdminViewCharges flag for Enrollment + * @property {boolean} [marketplacesEnabled] The marketplaces flag for + * Enrollment + * @property {boolean} [reservedInstancesEnabled] The reserved instances flag + * for Enrollment + */ + constructor() { + } + + /** + * Defines the metadata of EnrollmentPolicies + * + * @returns {object} metadata of EnrollmentPolicies + * + */ + mapper() { + return { + required: false, + serializedName: 'EnrollmentPolicies', + type: { + name: 'Composite', + className: 'EnrollmentPolicies', + modelProperties: { + accountOwnerViewCharges: { + required: false, + readOnly: true, + serializedName: 'accountOwnerViewCharges', + type: { + name: 'Boolean' + } + }, + departmentAdminViewCharges: { + required: false, + readOnly: true, + serializedName: 'departmentAdminViewCharges', + type: { + name: 'Boolean' + } + }, + marketplacesEnabled: { + required: false, + readOnly: true, + serializedName: 'marketplacesEnabled', + type: { + name: 'Boolean' + } + }, + reservedInstancesEnabled: { + required: false, + readOnly: true, + serializedName: 'reservedInstancesEnabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = EnrollmentPolicies; diff --git a/lib/services/consumptionManagement/lib/models/errorDetails.js b/lib/services/consumptionManagement/lib/models/errorDetails.js index 1d4ab7af07..0b9cb890a7 100644 --- a/lib/services/consumptionManagement/lib/models/errorDetails.js +++ b/lib/services/consumptionManagement/lib/models/errorDetails.js @@ -17,8 +17,8 @@ class ErrorDetails { /** * Create a ErrorDetails. - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation + * @property {string} [code] Error code. + * @property {string} [message] Error message indicating why the operation * failed. */ constructor() { diff --git a/lib/services/consumptionManagement/lib/models/errorResponse.js b/lib/services/consumptionManagement/lib/models/errorResponse.js index e203854eeb..4a7fb84e9b 100644 --- a/lib/services/consumptionManagement/lib/models/errorResponse.js +++ b/lib/services/consumptionManagement/lib/models/errorResponse.js @@ -18,9 +18,9 @@ class ErrorResponse { /** * Create a ErrorResponse. - * @member {object} [error] The details of the error. - * @member {string} [error.code] Error code. - * @member {string} [error.message] Error message indicating why the + * @property {object} [error] The details of the error. + * @property {string} [error.code] Error code. + * @property {string} [error.message] Error message indicating why the * operation failed. */ constructor() { diff --git a/lib/services/consumptionManagement/lib/models/eventSummary.js b/lib/services/consumptionManagement/lib/models/eventSummary.js new file mode 100644 index 0000000000..0aa741f673 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/eventSummary.js @@ -0,0 +1,186 @@ +/* + * 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'); + +/** + * An event summary resource. + * + * @extends models['Resource'] + */ +class EventSummary extends models['Resource'] { + /** + * Create a EventSummary. + * @property {date} [transactionDate] Transaction Date. + * @property {string} [description] Transaction description. + * @property {object} [newCredit] New Credit. + * @property {string} [newCredit.currency] The currency for the amount value. + * @property {number} [newCredit.value] Amount value. + * @property {object} [adjustments] Credit Adjustments. + * @property {string} [adjustments.currency] The currency for the amount + * value. + * @property {number} [adjustments.value] Amount value. + * @property {object} [creditExpired] Credit Expired. + * @property {string} [creditExpired.currency] The currency for the amount + * value. + * @property {number} [creditExpired.value] Amount value. + * @property {object} [charges] Credit Eligible Charges. + * @property {string} [charges.currency] The currency for the amount value. + * @property {number} [charges.value] Amount value. + * @property {object} [closedBalance] Closed Balance. + * @property {string} [closedBalance.currency] The currency for the amount + * value. + * @property {number} [closedBalance.value] Amount value. + * @property {string} [eventType] The type of event. Possible values include: + * 'NewCredit', 'ExpiredCredit', 'SettledCharges' + * @property {string} [invoiceNumber] Invoice Number. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EventSummary + * + * @returns {object} metadata of EventSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'EventSummary', + type: { + name: 'Composite', + className: 'EventSummary', + 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' + } + } + } + }, + transactionDate: { + required: false, + readOnly: true, + serializedName: 'properties.transactionDate', + type: { + name: 'DateTime' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + newCredit: { + required: false, + readOnly: true, + serializedName: 'properties.newCredit', + type: { + name: 'Composite', + className: 'Amount' + } + }, + adjustments: { + required: false, + readOnly: true, + serializedName: 'properties.adjustments', + type: { + name: 'Composite', + className: 'Amount' + } + }, + creditExpired: { + required: false, + readOnly: true, + serializedName: 'properties.creditExpired', + type: { + name: 'Composite', + className: 'Amount' + } + }, + charges: { + required: false, + readOnly: true, + serializedName: 'properties.charges', + type: { + name: 'Composite', + className: 'Amount' + } + }, + closedBalance: { + required: false, + readOnly: true, + serializedName: 'properties.closedBalance', + type: { + name: 'Composite', + className: 'Amount' + } + }, + eventType: { + required: false, + serializedName: 'properties.eventType', + type: { + name: 'String' + } + }, + invoiceNumber: { + required: false, + readOnly: true, + serializedName: 'properties.invoiceNumber', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EventSummary; diff --git a/lib/services/consumptionManagement/lib/models/events.js b/lib/services/consumptionManagement/lib/models/events.js new file mode 100644 index 0000000000..f2d2db2c23 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/events.js @@ -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'; + +/** + * Result of listing event summary. + * + */ +class Events { + /** + * Create a Events. + * @property {array} [value] The list of event summary. + */ + constructor() { + } + + /** + * Defines the metadata of Events + * + * @returns {object} metadata of Events + * + */ + mapper() { + return { + required: false, + serializedName: 'Events', + type: { + name: 'Composite', + className: 'Events', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EventSummaryElementType', + type: { + name: 'Composite', + className: 'EventSummary' + } + } + } + } + } + } + }; + } +} + +module.exports = Events; diff --git a/lib/services/consumptionManagement/lib/models/index.d.ts b/lib/services/consumptionManagement/lib/models/index.d.ts index f1570af4bb..c5adc35e02 100644 --- a/lib/services/consumptionManagement/lib/models/index.d.ts +++ b/lib/services/consumptionManagement/lib/models/index.d.ts @@ -1,961 +1,702 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. - */ - -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; - -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; - - -/** - * @class - * Initializes a new instance of the MeterDetails class. - * @constructor - * The properties of the meter detail. - * - * @member {string} [meterName] The name of the meter, within the given meter - * category - * @member {string} [meterCategory] The category of the meter, for example, - * 'Cloud services', 'Networking', etc.. - * @member {string} [meterSubCategory] The subcategory of the meter, for - * example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. - * @member {string} [unit] The unit in which the meter consumption is charged, - * for example, 'Hours', 'GB', etc. - * @member {string} [meterLocation] The location in which the Azure service is - * available. - * @member {number} [totalIncludedQuantity] The total included quantity - * associated with the offer. - * @member {number} [pretaxStandardRate] The pretax listing price. - * @member {string} [serviceName] The name of the service. - * @member {string} [serviceTier] The service tier. - */ -export interface MeterDetails { - readonly meterName?: string; - readonly meterCategory?: string; - readonly meterSubCategory?: string; - readonly unit?: string; - readonly meterLocation?: string; - readonly totalIncludedQuantity?: number; - readonly pretaxStandardRate?: number; - readonly serviceName?: string; - readonly serviceTier?: string; + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; + +export { + + BaseResource, + CloudError +}; + +/** + * The attributes associated with legacy enrollment + */ +export interface EnrollmentPolicies { + /** + * The accountOwnerViewCharges flag for Enrollment + */ + readonly accountOwnerViewCharges?: boolean; + /** + * The departmentAdminViewCharges flag for Enrollment + */ + readonly departmentAdminViewCharges?: boolean; + /** + * The marketplaces flag for Enrollment + */ + readonly marketplacesEnabled?: boolean; + /** + * The reserved instances flag for Enrollment + */ + readonly reservedInstancesEnabled?: boolean; +} + +/** + * Current entity level details + */ +export interface Enrollment { + /** + * Enrollment Start Date + */ + readonly startDate?: Date; + /** + * Enrollment End Date + */ + readonly endDate?: Date; + /** + * The currency associated with enrollment + */ + readonly currency?: string; + /** + * The channel for Enrollment + */ + readonly channel?: string; + /** + * The attributes associated with legacy enrollment. + */ + readonly policies?: EnrollmentPolicies; + /** + * The language for Enrollment + */ + readonly language?: string; + /** + * The countryCode for Enrollment + */ + readonly countryCode?: string; + /** + * Enrollment status + */ + readonly status?: string; + /** + * Enrollment billing cycle + */ + readonly billingCylce?: string; } /** - * @class - * Initializes a new instance of the Resource class. - * @constructor * The Resource model definition. - * - * @member {string} [id] Resource Id. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {object} [tags] Resource tags. */ export interface Resource extends BaseResource { + /** + * Resource Id. + */ readonly id?: string; + /** + * Resource name. + */ readonly name?: string; + /** + * Resource type. + */ readonly type?: string; + /** + * Resource tags. + */ readonly tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the UsageDetail class. - * @constructor - * An usage detail resource. - * - * @member {string} [billingPeriodId] The id of the billing period resource - * that the usage belongs to. - * @member {string} [invoiceId] The id of the invoice resource that the usage - * belongs to. - * @member {date} [usageStart] The start of the date time range covered by the - * usage detail. - * @member {date} [usageEnd] The end of the date time range covered by the - * usage detail. - * @member {string} [instanceName] The name of the resource instance that the - * usage is about. - * @member {string} [instanceId] The uri of the resource instance that the - * usage is about. - * @member {string} [instanceLocation] The location of the resource instance - * that the usage is about. - * @member {string} [currency] The ISO currency in which the meter is charged, - * for example, USD. - * @member {number} [usageQuantity] The quantity of usage. - * @member {number} [billableQuantity] The billable usage quantity. - * @member {number} [pretaxCost] The amount of cost before tax. - * @member {boolean} [isEstimated] The estimated usage is subject to change. - * @member {uuid} [meterId] The meter id (GUID). - * @member {object} [meterDetails] The details about the meter. By default this - * is not populated, unless it's specified in $expand. - * @member {string} [meterDetails.meterName] The name of the meter, within the - * given meter category - * @member {string} [meterDetails.meterCategory] The category of the meter, for - * example, 'Cloud services', 'Networking', etc.. - * @member {string} [meterDetails.meterSubCategory] The subcategory of the - * meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. - * @member {string} [meterDetails.unit] The unit in which the meter consumption - * is charged, for example, 'Hours', 'GB', etc. - * @member {string} [meterDetails.meterLocation] The location in which the - * Azure service is available. - * @member {number} [meterDetails.totalIncludedQuantity] The total included - * quantity associated with the offer. - * @member {number} [meterDetails.pretaxStandardRate] The pretax listing price. - * @member {string} [meterDetails.serviceName] The name of the service. - * @member {string} [meterDetails.serviceTier] The service tier. - * @member {uuid} [subscriptionGuid] Subscription guid. - * @member {string} [subscriptionName] Subscription name. - * @member {string} [accountName] Account name. - * @member {string} [departmentName] Department name. - * @member {string} [product] Product name. - * @member {string} [consumedService] Consumed service name. - * @member {string} [costCenter] The cost center of this department if it is a - * department and a costcenter exists - * @member {string} [partNumber] Part Number - * @member {string} [resourceGuid] Resource Guid - * @member {string} [offerId] Offer Id - * @member {boolean} [chargesBilledSeparately] Charges billed separately - * @member {string} [location] Resource Location - * @member {string} [additionalProperties] Additional details of this usage - * item. By default this is not populated, unless it's specified in $expand. - */ -export interface UsageDetail extends Resource { - readonly billingPeriodId?: string; - readonly invoiceId?: string; - readonly usageStart?: Date; - readonly usageEnd?: Date; - readonly instanceName?: string; - readonly instanceId?: string; - readonly instanceLocation?: string; + * A department resource. + */ +export interface Department extends Resource { + /** + * The name for department. + */ + departmentName?: string; + /** + * The cost center name. + */ + costCenter?: string; + /** + * The status for department. + */ + status?: string; + /** + * Associated enrollment accounts. By default this is not populated, unless it's specified in + * $expand. + */ + enrollmentAccounts?: EnrollmentAccount[]; +} + +/** + * An account resource. + */ +export interface EnrollmentAccount extends Resource { + /** + * The account name. + */ + accountName?: string; + /** + * The cost center name. + */ + costCenter?: string; + /** + * The account owner + */ + accountOwner?: string; + /** + * The status for account. + */ + status?: string; + /** + * Account Start Date + */ + startDate?: Date; + /** + * Account End Date + */ + endDate?: Date; + /** + * Associated department. By default this is not populated, unless it's specified in $expand. + */ + department?: Department; +} + +/** + * Address details. + */ +export interface Address { + /** + * Address Line1. + */ + addressLine1?: string; + /** + * Address Line2. + */ + addressLine2?: string; + /** + * Address Line3. + */ + addressLine3?: string; + /** + * Address City. + */ + city?: string; + /** + * Address Region. + */ + region?: string; + /** + * Country code uses ISO2, 2-digit format.. + */ + country?: string; + /** + * Postal Code. + */ + postalCode?: string; + /** + * Phone Number. + */ + phoneNumber?: string; +} + +/** + * A billing profile resource. + */ +export interface BillingProfile extends Resource { + /** + * The billing profile name. + */ + displayName?: string; + /** + * Purchase order number. + */ + poNumber?: string; + /** + * Billing address. + */ + billingAddress?: Address; + /** + * Billing contact. + */ + readonly billingContact?: string; + /** + * Email invoice. + */ + readonly emailInvoice?: boolean; + /** + * Invoice day. + */ + readonly invoiceDay?: number; + /** + * Currency on the billing profile. + */ readonly currency?: string; - readonly usageQuantity?: number; - readonly billableQuantity?: number; - readonly pretaxCost?: number; - readonly isEstimated?: boolean; - readonly meterId?: string; - readonly meterDetails?: MeterDetails; - readonly subscriptionGuid?: string; - readonly subscriptionName?: string; - readonly accountName?: string; - readonly departmentName?: string; - readonly product?: string; - readonly consumedService?: string; - readonly costCenter?: string; - readonly partNumber?: string; - readonly resourceGuid?: string; - readonly offerId?: string; - readonly chargesBilledSeparately?: boolean; - readonly location?: string; - readonly additionalProperties?: string; } /** - * @class - * Initializes a new instance of the Marketplace class. - * @constructor - * An marketplace resource. - * - * @member {string} [billingPeriodId] The id of the billing period resource - * that the usage belongs to. - * @member {date} [usageStart] The start of the date time range covered by the - * usage detail. - * @member {date} [usageEnd] The end of the date time range covered by the - * usage detail. - * @member {number} [resourceRate] The marketplace resource rate. - * @member {string} [offerName] The type of offer. - * @member {string} [resourceGroup] The name of resource group. - * @member {string} [orderNumber] The order number. - * @member {string} [instanceName] The name of the resource instance that the - * usage is about. - * @member {string} [instanceId] The uri of the resource instance that the - * usage is about. - * @member {string} [currency] The ISO currency in which the meter is charged, - * for example, USD. - * @member {number} [consumedQuantity] The quantity of usage. - * @member {string} [unitOfMeasure] The unit of measure. - * @member {number} [pretaxCost] The amount of cost before tax. - * @member {boolean} [isEstimated] The estimated usage is subject to change. - * @member {uuid} [meterId] The meter id (GUID). - * @member {uuid} [subscriptionGuid] Subscription guid. - * @member {string} [subscriptionName] Subscription name. - * @member {string} [accountName] Account name. - * @member {string} [departmentName] Department name. - * @member {string} [consumedService] Consumed service name. - * @member {string} [costCenter] The cost center of this department if it is a - * department and a costcenter exists - * @member {string} [additionalProperties] Additional details of this usage - * item. By default this is not populated, unless it's specified in $expand. - * @member {string} [publisherName] The name of publisher. - * @member {string} [planName] The name of plan. - * @member {boolean} [isRecurringCharge] Flag indicating whether this is a - * recurring charge or not. - */ -export interface Marketplace extends Resource { - readonly billingPeriodId?: string; - readonly usageStart?: Date; - readonly usageEnd?: Date; - readonly resourceRate?: number; - readonly offerName?: string; - readonly resourceGroup?: string; - readonly orderNumber?: string; - readonly instanceName?: string; - readonly instanceId?: string; + * An InvoiceSection resource. + */ +export interface InvoiceSection extends Resource { + /** + * The name of the InvoiceSection. + */ + displayName?: string; + /** + * The billing profiles associated to the billing account. + */ + billingProfiles?: BillingProfile[]; +} + +/** + * A billing account resource. + */ +export interface BillingAccount extends Resource { + /** + * The Company this billing account belongs to. + */ + readonly company?: string; + /** + * The billing account Type. Possible values include: 'CommerceRoot', 'Enrollment' + */ + readonly accountType?: string; + /** + * The address associated with billing account. + */ + address?: Address; + /** + * The ISO currency, for example, USD. + */ + readonly defaultCurrency?: string; + /** + * The country associated with billing account. + */ + readonly country?: string; + /** + * Agreements associated with billing account + */ + readonly agreements?: string; + /** + * The invoiceSections associated to the billing account. + */ + readonly invoiceSections?: InvoiceSection[]; + /** + * The billing profiles associated to the billing account. + */ + readonly billingProfiles?: BillingProfile[]; + /** + * The details about the associated legacy enrollment. By default this is not populated, unless + * it's specified in $expand. + */ + readonly enrollmentDetails?: Enrollment; + /** + * The departments associated to the enrollment. + */ + readonly departments?: Department[]; + /** + * The accounts associated to the enrollment. + */ + readonly enrollmentAccounts?: EnrollmentAccount[]; +} + +/** + * Object to represent monetary quantities. + */ +export interface Amount { + /** + * The currency for the amount value. + */ readonly currency?: string; - readonly consumedQuantity?: number; - readonly unitOfMeasure?: string; - readonly pretaxCost?: number; - readonly isEstimated?: boolean; - readonly meterId?: string; - readonly subscriptionGuid?: string; - readonly subscriptionName?: string; - readonly accountName?: string; - readonly departmentName?: string; - readonly consumedService?: string; - readonly costCenter?: string; - readonly additionalProperties?: string; - readonly publisherName?: string; - readonly planName?: string; - readonly isRecurringCharge?: boolean; -} - -/** - * @class - * Initializes a new instance of the BalancePropertiesNewPurchasesDetailsItem class. - * @constructor - * @member {string} [name] the name of new purchase. - * @member {number} [value] the value of new purchase. - */ -export interface BalancePropertiesNewPurchasesDetailsItem { - readonly name?: string; + /** + * Amount value. + */ readonly value?: number; } /** - * @class - * Initializes a new instance of the BalancePropertiesAdjustmentDetailsItem class. - * @constructor - * @member {string} [name] the name of new adjustment. - * @member {number} [value] the value of new adjustment. - */ -export interface BalancePropertiesAdjustmentDetailsItem { - readonly name?: string; - readonly value?: number; -} - -/** - * @class - * Initializes a new instance of the Balance class. - * @constructor - * A balance resource. - * - * @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.). - */ -export interface Balance extends Resource { - readonly currency?: string; - readonly beginningBalance?: number; - readonly endingBalance?: number; - readonly newPurchases?: number; - readonly adjustments?: number; - readonly utilized?: number; - readonly serviceOverage?: number; - readonly chargesBilledSeparately?: number; - readonly totalOverage?: number; - readonly totalUsage?: number; - readonly azureMarketplaceServiceCharges?: number; - billingFrequency?: string; - readonly priceHidden?: boolean; - readonly newPurchasesDetails?: BalancePropertiesNewPurchasesDetailsItem[]; - readonly adjustmentDetails?: BalancePropertiesAdjustmentDetailsItem[]; -} - -/** - * @class - * Initializes a new instance of the ReservationSummary class. - * @constructor - * reservation summary resource. - * - * @member {string} [reservationOrderId] The reservation order ID is the - * identifier for a reservation purchase. Each reservation order ID represents - * a single purchase transaction. A reservation order contains reservations. - * The reservation order specifies the VM size and region for the reservations. - * @member {string} [reservationId] The reservation ID is the identifier of a - * reservation within a reservation order. Each reservation is the grouping for - * applying the benefit scope and also specifies the number of instances to - * which the reservation benefit can be applied to. - * @member {string} [skuName] This is the ARM Sku name. It can be used to join - * with the servicetype field in additoinalinfo in usage records. - * @member {number} [reservedHours] This is the total hours reserved. E.g. if - * reservation for 1 instance was made on 1 PM, this will be 11 hours for that - * day and 24 hours from subsequent days - * @member {date} [usageDate] Data corresponding to the utilization record. If - * the grain of data is monthly, it will be first day of month. - * @member {number} [usedHours] Total used hours by the reservation - * @member {number} [minUtilizationPercentage] This is the minimum hourly - * utilization in the usage time (day or month). E.g. if usage record - * corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 10%, - * this field will return 10% for that day - * @member {number} [avgUtilizationPercentage] This is average utilization for - * the entire time range. (day or month depending on the grain) - * @member {number} [maxUtilizationPercentage] This is the maximum hourly - * utilization in the usage time (day or month). E.g. if usage record - * corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was - * 100%, this field will return 100% for that day. - */ -export interface ReservationSummary extends Resource { - readonly reservationOrderId?: string; - readonly reservationId?: string; - readonly skuName?: string; - readonly reservedHours?: number; - readonly usageDate?: Date; - readonly usedHours?: number; - readonly minUtilizationPercentage?: number; - readonly avgUtilizationPercentage?: number; - readonly maxUtilizationPercentage?: number; -} - -/** - * @class - * Initializes a new instance of the ReservationDetail class. - * @constructor - * reservation detail resource. - * - * @member {string} [reservationOrderId] The reservation order ID is the - * identifier for a reservation purchase. Each reservation order ID represents - * a single purchase transaction. A reservation order contains reservations. - * The reservation order specifies the VM size and region for the reservations. - * @member {string} [reservationId] The reservation ID is the identifier of a - * reservation within a reservation order. Each reservation is the grouping for - * applying the benefit scope and also specifies the number of instances to - * which the reservation benefit can be applied to. - * @member {string} [skuName] This is the ARM Sku name. It can be used to join - * with the servicetype field in additoinalinfo in usage records. - * @member {number} [reservedHours] This is the total hours reserved for the - * day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 - * hours for that day and 24 hours from subsequent days. - * @member {date} [usageDate] The date on which consumption occurred. - * @member {number} [usedHours] This is the total hours used by the instance. - * @member {string} [instanceId] This identifier is the name of the resource or - * the fully qualified Resource ID. - * @member {number} [totalReservedQuantity] This is the total count of - * instances that are reserved for the reservationid. - */ -export interface ReservationDetail extends Resource { - readonly reservationOrderId?: string; - readonly reservationId?: string; - readonly skuName?: string; - readonly reservedHours?: number; - readonly usageDate?: Date; - readonly usedHours?: number; - readonly instanceId?: string; - readonly totalReservedQuantity?: number; -} - -/** - * @class - * Initializes a new instance of the ReservationRecommendation class. - * @constructor - * Reservation recommendation resource. - * - * @member {string} [id] Resource Id. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {object} [tags] Resource tags. - * @member {string} [location] Resource location - * @member {string} [sku] Resource sku - * @member {string} [lookBackPeriod] The number of days of usage to look back - * for recommendation. - * @member {uuid} [meterId] The meter id (GUID) - * @member {string} [term] RI recommendations in one or three year terms. - * @member {number} [costWithNoReservedInstances] The total amount of cost - * without reserved instances. - * @member {number} [recommendedQuantity] Recomended quality for reserved - * instances. - * @member {number} [totalCostWithReservedInstances] The total amount of cost - * with reserved instances. - * @member {number} [netSavings] Total estimated savings with reserved - * instances. - * @member {date} [firstUsageDate] The usage date for looking back. - * @member {string} [scope] Shared or single recommendation. - */ -export interface ReservationRecommendation { - readonly id?: string; - readonly name?: string; - readonly type?: string; - readonly tags?: { [propertyName: string]: string }; - readonly location?: string; - readonly sku?: string; - readonly lookBackPeriod?: string; - readonly meterId?: string; - readonly term?: string; - readonly costWithNoReservedInstances?: number; - readonly recommendedQuantity?: number; - readonly totalCostWithReservedInstances?: number; - readonly netSavings?: number; - readonly firstUsageDate?: Date; - readonly scope?: string; -} - -/** - * @class - * Initializes a new instance of the Tag class. - * @constructor - * The tag resource. - * - * @member {string} [key] Tag key. - */ -export interface Tag { - key?: string; -} - -/** - * @class - * Initializes a new instance of the ProxyResource class. - * @constructor - * The Resource model definition. - * - * @member {string} [id] Resource Id. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {string} [eTag] eTag of the resource. To handle concurrent update - * scenarion, this field will be used to determine whether the user is updating - * the latest version or not. - */ -export interface ProxyResource extends BaseResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; - eTag?: string; -} - -/** - * @class - * Initializes a new instance of the TagsResult class. - * @constructor - * A resource listing all tags. - * - * @member {array} [tags] A list of Tag. - */ -export interface TagsResult extends ProxyResource { - tags?: Tag[]; -} - -/** - * @class - * Initializes a new instance of the BudgetTimePeriod class. - * @constructor - * The start and end date for a budget. - * - * @member {date} startDate The start date for the budget. - * @member {date} [endDate] The end date for the budget. If not provided, we - * default this to 10 years from the start date. - */ -export interface BudgetTimePeriod { - startDate: Date; - endDate?: Date; -} - -/** - * @class - * Initializes a new instance of the Filters class. - * @constructor - * May be used to filter budgets by resource group, resource, or meter. - * - * @member {array} [resourceGroups] The list of filters on resource groups, - * allowed at subscription level only. - * @member {array} [resources] The list of filters on resources. - * @member {array} [meters] The list of filters on meters (GUID), mandatory for - * budgets of usage category. - * @member {object} [tags] The dictionary of filters on tags. - */ -export interface Filters { - resourceGroups?: string[]; - resources?: string[]; - meters?: string[]; - tags?: { [propertyName: string]: string[] }; -} - -/** - * @class - * Initializes a new instance of the CurrentSpend class. - * @constructor - * The current amount of cost which is being tracked for a budget. - * - * @member {number} [amount] The total amount of cost which is being tracked by - * the budget. - * @member {string} [unit] The unit of measure for the budget amount. - */ -export interface CurrentSpend { - readonly amount?: number; - readonly unit?: string; -} - -/** - * @class - * Initializes a new instance of the Notification class. - * @constructor - * The notification associated with a budget. - * - * @member {boolean} enabled The notification is enabled or not. - * @member {string} operator The comparison operator. Possible values include: - * 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo' - * @member {number} threshold Threshold value associated with a notification. - * Notification is sent when the cost exceeded the threshold. It is always - * percent and has to be between 0 and 1000. - * @member {array} contactEmails Email addresses to send the budget - * notification to when the threshold is exceeded. - * @member {array} [contactRoles] Contact roles to send the budget notification - * to when the threshold is exceeded. - * @member {array} [contactGroups] Action groups to send the budget - * notification to when the threshold is exceeded. - */ -export interface Notification { - enabled: boolean; - operator: string; - threshold: number; - contactEmails: string[]; - contactRoles?: string[]; - contactGroups?: string[]; -} - -/** - * @class - * Initializes a new instance of the Budget class. - * @constructor - * A budget resource. - * - * @member {string} category The category of the budget, whether the budget - * tracks cost or usage. Possible values include: 'Cost', 'Usage' - * @member {number} amount The total amount of cost to track with the budget - * @member {string} timeGrain The time covered by a budget. Tracking of the - * amount will be reset based on the time grain. Possible values include: - * 'Monthly', 'Quarterly', 'Annually' - * @member {object} timePeriod Has start and end date of the budget. The start - * date must be first of the month and should be less than the end date. Budget - * start date must be on or after June 1, 2017. Future start date should not be - * more than three months. Past start date should be selected within the - * timegrain preiod. There are no restrictions on the end date. - * @member {date} [timePeriod.startDate] The start date for the budget. - * @member {date} [timePeriod.endDate] The end date for the budget. If not - * provided, we default this to 10 years from the start date. - * @member {object} [filters] May be used to filter budgets by resource group, - * resource, or meter. - * @member {array} [filters.resourceGroups] The list of filters on resource - * groups, allowed at subscription level only. - * @member {array} [filters.resources] The list of filters on resources. - * @member {array} [filters.meters] The list of filters on meters (GUID), - * mandatory for budgets of usage category. - * @member {object} [filters.tags] The dictionary of filters on tags. - * @member {object} [currentSpend] The current amount of cost which is being - * tracked for a budget. - * @member {number} [currentSpend.amount] The total amount of cost which is - * being tracked by the budget. - * @member {string} [currentSpend.unit] The unit of measure for the budget - * amount. - * @member {object} [notifications] Dictionary of notifications associated with - * the budget. Budget can have up to five notifications. - */ -export interface Budget extends ProxyResource { - category: string; - amount: number; - timeGrain: string; - timePeriod: BudgetTimePeriod; - filters?: Filters; - readonly currentSpend?: CurrentSpend; - notifications?: { [propertyName: string]: Notification }; -} - -/** - * @class - * Initializes a new instance of the PriceSheetProperties class. - * @constructor - * The properties of the price sheet. - * - * @member {string} [billingPeriodId] The id of the billing period resource - * that the usage belongs to. - * @member {uuid} [meterId] The meter id (GUID) - * @member {object} [meterDetails] The details about the meter. By default this - * is not populated, unless it's specified in $expand. - * @member {string} [meterDetails.meterName] The name of the meter, within the - * given meter category - * @member {string} [meterDetails.meterCategory] The category of the meter, for - * example, 'Cloud services', 'Networking', etc.. - * @member {string} [meterDetails.meterSubCategory] The subcategory of the - * meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. - * @member {string} [meterDetails.unit] The unit in which the meter consumption - * is charged, for example, 'Hours', 'GB', etc. - * @member {string} [meterDetails.meterLocation] The location in which the - * Azure service is available. - * @member {number} [meterDetails.totalIncludedQuantity] The total included - * quantity associated with the offer. - * @member {number} [meterDetails.pretaxStandardRate] The pretax listing price. - * @member {string} [meterDetails.serviceName] The name of the service. - * @member {string} [meterDetails.serviceTier] The service tier. - * @member {string} [unitOfMeasure] Unit of measure - * @member {number} [includedQuantity] Included quality for an offer - * @member {string} [partNumber] Part Number - * @member {number} [unitPrice] Unit Price - * @member {string} [currencyCode] Currency Code - * @member {string} [offerId] Offer Id - */ -export interface PriceSheetProperties { + * Download response of Pricesheets. + */ +export interface PricesheetDownloadResponse extends Resource { + /** + * The URL to the PDF file. + */ + readonly downloadUrl?: string; + /** + * The time in UTC at which this download URL will expire. + */ + readonly expiryTime?: string; +} + +/** + * Summary of credit balances. + */ +export interface CreditBalanceSummary { + /** + * Estimated balance. + */ + readonly estimatedBalance?: Amount; + /** + * Current balance. + */ + readonly currentBalance?: Amount; +} + +/** + * A credit summary resource. + */ +export interface CreditSummary extends Resource { + /** + * Summary of balances associated with this credit summary. + */ + balanceSummary?: CreditBalanceSummary; + /** + * Pending Credit Adjustments. + */ + readonly pendingCreditAdjustments?: Amount; + /** + * Expired Credit. + */ + readonly expiredCredit?: Amount; + /** + * Pending Eligible Charges. + */ + readonly pendingEligibleCharges?: Amount; +} + +/** + * An event summary resource. + */ +export interface EventSummary extends Resource { + /** + * Transaction Date. + */ + readonly transactionDate?: Date; + /** + * Transaction description. + */ + readonly description?: string; + /** + * New Credit. + */ + readonly newCredit?: Amount; + /** + * Credit Adjustments. + */ + readonly adjustments?: Amount; + /** + * Credit Expired. + */ + readonly creditExpired?: Amount; + /** + * Credit Eligible Charges. + */ + readonly charges?: Amount; + /** + * Closed Balance. + */ + readonly closedBalance?: Amount; + /** + * The type of event. Possible values include: 'NewCredit', 'ExpiredCredit', 'SettledCharges' + */ + eventType?: string; + /** + * Invoice Number. + */ + readonly invoiceNumber?: string; +} + +/** + * Result of listing event summary. + */ +export interface Events { + /** + * The list of event summary. + */ + readonly value?: EventSummary[]; +} + +/** + * A lot summary resource. + */ +export interface LotSummary extends Resource { + /** + * Original Amount. + */ + readonly originalAmount?: Amount; + /** + * Closed Balance. + */ + readonly closedBalance?: Amount; + /** + * Lot source. Possible values include: 'PurchasedCredit', 'PromotionalCredit' + */ + readonly source?: string; + /** + * Start Date. + */ + readonly startDate?: Date; + /** + * Expiration Date. + */ + readonly expirationDate?: Date; + /** + * PO Number. + */ + readonly poNumber?: string; +} + +/** + * Result of listing lot summary. + */ +export interface Lots { + /** + * The list of lot summary. + */ + readonly value?: LotSummary[]; +} + +/** + * A charge summary resource by billing account. + */ +export interface ChargeSummaryByBillingAccount extends Resource { + /** + * The id of the billing period resource that the usage belongs to. + */ readonly billingPeriodId?: string; - readonly meterId?: string; - readonly meterDetails?: MeterDetails; - readonly unitOfMeasure?: string; - readonly includedQuantity?: number; - readonly partNumber?: string; - readonly unitPrice?: number; - readonly currencyCode?: string; - readonly offerId?: string; -} - -/** - * @class - * Initializes a new instance of the PriceSheetResult class. - * @constructor - * An pricesheet resource. - * - * @member {array} [pricesheets] Price sheet - * @member {string} [nextLink] The link (url) to the next page of results. - */ -export interface PriceSheetResult extends Resource { - readonly pricesheets?: PriceSheetProperties[]; - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ForecastPropertiesConfidenceLevelsItem class. - * @constructor - * @member {number} [percentage] The percentage level of the confidence - * @member {string} [bound] The boundary of the percentage, values could be - * 'Upper' or 'Lower'. Possible values include: 'Upper', 'Lower' - * @member {number} [value] The amount of forecast within the percentage level - */ -export interface ForecastPropertiesConfidenceLevelsItem { - readonly percentage?: number; - bound?: string; - readonly value?: number; -} - -/** - * @class - * Initializes a new instance of the Forecast class. - * @constructor - * A forecast resource. - * - * @member {string} [usageDate] The usage date of the forecast. - * @member {string} [grain] The granularity of forecast. Possible values - * include: 'Daily', 'Monthly', 'Yearly' - * @member {number} [charge] The amount of charge - * @member {string} [currency] The ISO currency in which the meter is charged, - * for example, USD. - * @member {string} [chargeType] The type of the charge. Could be actual or - * forecast. Possible values include: 'Actual', 'Forecast' - * @member {array} [confidenceLevels] The details about the forecast confidence - * levels. This is populated only when chargeType is Forecast. - */ -export interface Forecast extends Resource { - readonly usageDate?: string; - grain?: string; - readonly charge?: number; - readonly currency?: string; - chargeType?: string; - readonly confidenceLevels?: ForecastPropertiesConfidenceLevelsItem[]; -} - -/** - * @class - * Initializes a new instance of the ManagementGroupAggregatedCostResult class. - * @constructor - * A management group aggregated cost resource. - * - * @member {string} [billingPeriodId] The id of the billing period resource - * that the aggregated cost belongs to. - * @member {date} [usageStart] The start of the date time range covered by - * aggregated cost. - * @member {date} [usageEnd] The end of the date time range covered by the - * aggregated cost. - * @member {number} [azureCharges] Azure Charges. - * @member {number} [marketplaceCharges] Marketplace Charges. - * @member {number} [chargesBilledSeparately] Charges Billed Separately. - * @member {string} [currency] The ISO currency in which the meter is charged, - * for example, USD. - * @member {array} [children] Children of a management group - * @member {array} [includedSubscriptions] List of subscription Guids included - * in the calculation of aggregated cost - * @member {array} [excludedSubscriptions] List of subscription Guids excluded - * from the calculation of aggregated cost - */ -export interface ManagementGroupAggregatedCostResult extends Resource { + /** + * Billing period start date. + */ + readonly usageStart?: string; + /** + * Billing period end date. + */ + readonly usageEnd?: string; + /** + * Azure Charges. + */ + readonly azureCharges?: Amount; + /** + * Charges Billed separately. + */ + readonly chargesBilledSeparately?: Amount; + /** + * Marketplace Charges. + */ + readonly marketplaceCharges?: Amount; + /** + * The id of the billing account resource that the charge belongs to. + */ + readonly billingAccountId?: string; + /** + * The id of the billing profile resource that the charge belongs to. + */ + readonly billingProfileId?: string; + /** + * The id of the invoice section resource that the charge belongs to. + */ + readonly invoiceSectionId?: string; +} + +/** + * Result of listing charge summary by billing account. It contains a list of available change + * summaries in reverse chronological order by billing period. + */ +export interface ChargesListByBillingAccount { + /** + * The list of charge summary by billing account. + */ + readonly value?: ChargeSummaryByBillingAccount[]; +} + +/** + * A charge summary resource by billing profile. + */ +export interface ChargeSummaryByBillingProfile extends Resource { + /** + * The id of the billing period resource that the usage belongs to. + */ readonly billingPeriodId?: string; - readonly usageStart?: Date; - readonly usageEnd?: Date; - readonly azureCharges?: number; - readonly marketplaceCharges?: number; - readonly chargesBilledSeparately?: number; - readonly currency?: string; - children?: ManagementGroupAggregatedCostResult[]; - includedSubscriptions?: string[]; - excludedSubscriptions?: string[]; -} - -/** - * @class - * Initializes a new instance of the ChargeSummary class. - * @constructor - * A charge summary resource. - * - * @member {string} [billingPeriodId] The id of the billing period resource - * that the charge belongs to. - * @member {string} [usageStart] Usage start date. - * @member {string} [usageEnd] Usage end date. - * @member {number} [azureCharges] Azure Charges. - * @member {number} [chargesBilledSeparately] Charges Billed separately. - * @member {number} [marketplaceCharges] Marketplace Charges. - * @member {string} [currency] Currency Code - */ -export interface ChargeSummary extends Resource { + /** + * Billing period start date. + */ + readonly usageStart?: string; + /** + * Billing period end date. + */ + readonly usageEnd?: string; + /** + * Azure Charges. + */ + readonly azureCharges?: Amount; + /** + * Charges Billed separately. + */ + readonly chargesBilledSeparately?: Amount; + /** + * Marketplace Charges. + */ + readonly marketplaceCharges?: Amount; + /** + * The id of the billing account resource that the charge belongs to. + */ + readonly billingAccountId?: string; + /** + * The id of the billing profile resource that the charge belongs to. + */ + readonly billingProfileId?: string; + /** + * The id of the invoice section resource that the charge belongs to. + */ + readonly invoiceSectionId?: string; +} + +/** + * Result of listing charge summary by billing profile. It contains a list of available change + * summaries in reverse chronological order by billing period. + */ +export interface ChargesListByBillingProfile { + /** + * The list of charge summary by billing profile. + */ + readonly value?: ChargeSummaryByBillingProfile[]; +} + +/** + * A charge summary resource by invoiceSection. + */ +export interface ChargeSummaryByInvoiceSection extends Resource { + /** + * The id of the billing period resource that the usage belongs to. + */ readonly billingPeriodId?: string; + /** + * Billing period start date. + */ readonly usageStart?: string; + /** + * Billing period end date. + */ readonly usageEnd?: string; - readonly azureCharges?: number; - readonly chargesBilledSeparately?: number; - readonly marketplaceCharges?: number; - readonly currency?: string; -} - -/** - * @class - * Initializes a new instance of the ChargesListResult class. - * @constructor - * Result of listing charge summary. - * - * @member {array} [value] The list of charge summary - */ -export interface ChargesListResult { - readonly value?: ChargeSummary[]; -} - -/** - * @class - * Initializes a new instance of the ErrorDetails class. - * @constructor - * The details of the error. - * - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation - * failed. - */ -export interface ErrorDetails { - readonly code?: string; - readonly message?: string; + /** + * Azure Charges. + */ + readonly azureCharges?: Amount; + /** + * Charges Billed separately. + */ + readonly chargesBilledSeparately?: Amount; + /** + * Marketplace Charges. + */ + readonly marketplaceCharges?: Amount; + /** + * The id of the billing account resource that the charge belongs to. + */ + readonly billingAccountId?: string; + /** + * The id of the billing profile resource that the charge belongs to. + */ + readonly billingProfileId?: string; + /** + * The id of the invoice section resource that the charge belongs to. + */ + readonly invoiceSectionId?: string; +} + +/** + * Result of listing charge summary by invoiceSection. It contains a list of available change + * summaries in reverse chronological order by billing period. + */ +export interface ChargesListByInvoiceSection { + /** + * The list of charge summary by invoiceSection. + */ + readonly value?: ChargeSummaryByInvoiceSection[]; } /** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor - * Error response indicates that the service is not able to process the - * incoming request. The reason is provided in the error message. - * - * @member {object} [error] The details of the error. - * @member {string} [error.code] Error code. - * @member {string} [error.message] Error message indicating why the operation - * failed. - */ -export interface ErrorResponse { - error?: ErrorDetails; -} - -/** - * @class - * Initializes a new instance of the OperationDisplay class. - * @constructor * The object that represents the operation. - * - * @member {string} [provider] Service provider: Microsoft.Consumption. - * @member {string} [resource] Resource on which the operation is performed: - * UsageDetail, etc. - * @member {string} [operation] Operation type: Read, write, delete, etc. */ export interface OperationDisplay { + /** + * Service provider: Microsoft.Consumption. + */ readonly provider?: string; + /** + * Resource on which the operation is performed: UsageDetail, etc. + */ readonly resource?: string; + /** + * Operation type: Read, write, delete, etc. + */ readonly operation?: string; } /** - * @class - * Initializes a new instance of the Operation class. - * @constructor * A Consumption REST API operation. - * - * @member {string} [name] Operation name: {provider}/{resource}/{operation}. - * @member {object} [display] The object that represents the operation. - * @member {string} [display.provider] Service provider: Microsoft.Consumption. - * @member {string} [display.resource] Resource on which the operation is - * performed: UsageDetail, etc. - * @member {string} [display.operation] Operation type: Read, write, delete, - * etc. */ export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation}. + */ readonly name?: string; + /** + * The object that represents the operation. + */ display?: OperationDisplay; } /** - * @class - * Initializes a new instance of the ResourceAttributes class. - * @constructor - * The Resource model definition. - * - * @member {string} [location] Resource location - * @member {string} [sku] Resource sku - */ -export interface ResourceAttributes { - readonly location?: string; - readonly sku?: string; -} - -/** - * @class - * Initializes a new instance of the QueryOptions class. - * @constructor - * Additional parameters for a set of operations. - * - * @member {string} [apply] OData apply expression to aggregate usageDetails by - * tags or (tags and properties/usageStart) - */ -export interface QueryOptions { - apply?: string; -} - - -/** - * @class - * Initializes a new instance of the UsageDetailsListResult class. - * @constructor - * Result of listing usage details. It contains a list of available usage - * details in reverse chronological order by billing period. - * - * @member {string} [nextLink] The link (url) to the next page of results. - */ -export interface UsageDetailsListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the MarketplacesListResult class. - * @constructor - * Result of listing marketplaces. It contains a list of available marketplaces - * in reverse chronological order by billing period. - * - * @member {string} [nextLink] The link (url) to the next page of results. - */ -export interface MarketplacesListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ReservationSummariesListResult class. - * @constructor - * Result of listing reservation summaries. - * - * @member {string} [nextLink] The link (url) to the next page of results. - */ -export interface ReservationSummariesListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ReservationDetailsListResult class. - * @constructor - * Result of listing reservation details. - * - * @member {string} [nextLink] The link (url) to the next page of results. - */ -export interface ReservationDetailsListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ReservationRecommendationsListResult class. - * @constructor - * Result of listing reservation recommendations. - * - * @member {string} [nextLink] The link (url) to the next page of results. + * The details of the error. */ -export interface ReservationRecommendationsListResult extends Array { - readonly nextLink?: string; +export interface ErrorDetails { + /** + * Error code. + */ + readonly code?: string; + /** + * Error message indicating why the operation failed. + */ + readonly message?: string; } /** - * @class - * Initializes a new instance of the BudgetsListResult class. - * @constructor - * Result of listing budgets. It contains a list of available budgets in the - * scope provided. - * - * @member {string} [nextLink] The link (url) to the next page of results. + * Error response indicates that the service is not able to process the incoming request. The + * reason is provided in the error message. */ -export interface BudgetsListResult extends Array { - readonly nextLink?: string; +export interface ErrorResponse { + /** + * The details of the error. + */ + error?: ErrorDetails; } /** - * @class - * Initializes a new instance of the ForecastsListResult class. - * @constructor - * Result of listing forecasts. It contains a list of available forecasts. - * + * The Resource model definition. */ -export interface ForecastsListResult extends Array { +export interface ProxyResource extends BaseResource { + /** + * Resource Id. + */ + readonly id?: string; + /** + * Resource name. + */ + readonly name?: string; + /** + * Resource type. + */ + readonly type?: string; + /** + * eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + */ + eTag?: string; } /** - * @class - * Initializes a new instance of the OperationListResult class. - * @constructor - * Result of listing consumption operations. It contains a list of operations - * and a URL link to get the next set of results. - * - * @member {string} [nextLink] URL to get the next set of operation list - * results if there are any. + * Result of listing consumption operations. It contains a list of operations and a URL link to get + * the next set of results. */ export interface OperationListResult extends Array { + /** + * URL to get the next set of operation list results if there are any. + */ readonly nextLink?: string; } diff --git a/lib/services/consumptionManagement/lib/models/index.js b/lib/services/consumptionManagement/lib/models/index.js index 7cb073bc78..f69b857c4b 100644 --- a/lib/services/consumptionManagement/lib/models/index.js +++ b/lib/services/consumptionManagement/lib/models/index.js @@ -18,42 +18,32 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; -exports.MeterDetails = require('./meterDetails'); +exports.EnrollmentPolicies = require('./enrollmentPolicies'); +exports.Enrollment = require('./enrollment'); exports.Resource = require('./resource'); -exports.UsageDetail = require('./usageDetail'); -exports.Marketplace = require('./marketplace'); -exports.BalancePropertiesNewPurchasesDetailsItem = require('./balancePropertiesNewPurchasesDetailsItem'); -exports.BalancePropertiesAdjustmentDetailsItem = require('./balancePropertiesAdjustmentDetailsItem'); -exports.Balance = require('./balance'); -exports.ReservationSummary = require('./reservationSummary'); -exports.ReservationDetail = require('./reservationDetail'); -exports.ReservationRecommendation = require('./reservationRecommendation'); -exports.Tag = require('./tag'); -exports.ProxyResource = require('./proxyResource'); -exports.TagsResult = require('./tagsResult'); -exports.BudgetTimePeriod = require('./budgetTimePeriod'); -exports.Filters = require('./filters'); -exports.CurrentSpend = require('./currentSpend'); -exports.Notification = require('./notification'); -exports.Budget = require('./budget'); -exports.PriceSheetProperties = require('./priceSheetProperties'); -exports.PriceSheetResult = require('./priceSheetResult'); -exports.ForecastPropertiesConfidenceLevelsItem = require('./forecastPropertiesConfidenceLevelsItem'); -exports.Forecast = require('./forecast'); -exports.ManagementGroupAggregatedCostResult = require('./managementGroupAggregatedCostResult'); -exports.ChargeSummary = require('./chargeSummary'); -exports.ChargesListResult = require('./chargesListResult'); -exports.ErrorDetails = require('./errorDetails'); -exports.ErrorResponse = require('./errorResponse'); +exports.Department = require('./department'); +exports.EnrollmentAccount = require('./enrollmentAccount'); +exports.Address = require('./address'); +exports.BillingProfile = require('./billingProfile'); +exports.InvoiceSection = require('./invoiceSection'); +exports.BillingAccount = require('./billingAccount'); +exports.Amount = require('./amount'); +exports.PricesheetDownloadResponse = require('./pricesheetDownloadResponse'); +exports.CreditBalanceSummary = require('./creditBalanceSummary'); +exports.CreditSummary = require('./creditSummary'); +exports.EventSummary = require('./eventSummary'); +exports.Events = require('./events'); +exports.LotSummary = require('./lotSummary'); +exports.Lots = require('./lots'); +exports.ChargeSummaryByBillingAccount = require('./chargeSummaryByBillingAccount'); +exports.ChargesListByBillingAccount = require('./chargesListByBillingAccount'); +exports.ChargeSummaryByBillingProfile = require('./chargeSummaryByBillingProfile'); +exports.ChargesListByBillingProfile = require('./chargesListByBillingProfile'); +exports.ChargeSummaryByInvoiceSection = require('./chargeSummaryByInvoiceSection'); +exports.ChargesListByInvoiceSection = require('./chargesListByInvoiceSection'); exports.OperationDisplay = require('./operationDisplay'); exports.Operation = require('./operation'); -exports.ResourceAttributes = require('./resourceAttributes'); -exports.QueryOptions = require('./queryOptions'); -exports.UsageDetailsListResult = require('./usageDetailsListResult'); -exports.MarketplacesListResult = require('./marketplacesListResult'); -exports.ReservationSummariesListResult = require('./reservationSummariesListResult'); -exports.ReservationDetailsListResult = require('./reservationDetailsListResult'); -exports.ReservationRecommendationsListResult = require('./reservationRecommendationsListResult'); -exports.BudgetsListResult = require('./budgetsListResult'); -exports.ForecastsListResult = require('./forecastsListResult'); +exports.ErrorDetails = require('./errorDetails'); +exports.ErrorResponse = require('./errorResponse'); +exports.ProxyResource = require('./proxyResource'); exports.OperationListResult = require('./operationListResult'); diff --git a/lib/services/consumptionManagement/lib/models/invoiceSection.js b/lib/services/consumptionManagement/lib/models/invoiceSection.js new file mode 100644 index 0000000000..98eea542d3 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/invoiceSection.js @@ -0,0 +1,112 @@ +/* + * 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'); + +/** + * An InvoiceSection resource. + * + * @extends models['Resource'] + */ +class InvoiceSection extends models['Resource'] { + /** + * Create a InvoiceSection. + * @property {string} [displayName] The name of the InvoiceSection. + * @property {array} [billingProfiles] The billing profiles associated to the + * billing account. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InvoiceSection + * + * @returns {object} metadata of InvoiceSection + * + */ + mapper() { + return { + required: false, + serializedName: 'InvoiceSection', + type: { + name: 'Composite', + className: 'InvoiceSection', + 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' + } + } + } + }, + displayName: { + required: false, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + }, + billingProfiles: { + required: false, + serializedName: 'properties.billingProfiles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BillingProfileElementType', + type: { + name: 'Composite', + className: 'BillingProfile' + } + } + } + } + } + } + }; + } +} + +module.exports = InvoiceSection; diff --git a/lib/services/consumptionManagement/lib/models/lotSummary.js b/lib/services/consumptionManagement/lib/models/lotSummary.js new file mode 100644 index 0000000000..f34fef0635 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/lotSummary.js @@ -0,0 +1,150 @@ +/* + * 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 lot summary resource. + * + * @extends models['Resource'] + */ +class LotSummary extends models['Resource'] { + /** + * Create a LotSummary. + * @property {object} [originalAmount] Original Amount. + * @property {string} [originalAmount.currency] The currency for the amount + * value. + * @property {number} [originalAmount.value] Amount value. + * @property {object} [closedBalance] Closed Balance. + * @property {string} [closedBalance.currency] The currency for the amount + * value. + * @property {number} [closedBalance.value] Amount value. + * @property {string} [source] Lot source. Possible values include: + * 'PurchasedCredit', 'PromotionalCredit' + * @property {date} [startDate] Start Date. + * @property {date} [expirationDate] Expiration Date. + * @property {string} [poNumber] PO Number. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LotSummary + * + * @returns {object} metadata of LotSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'LotSummary', + type: { + name: 'Composite', + className: 'LotSummary', + 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' + } + } + } + }, + originalAmount: { + required: false, + readOnly: true, + serializedName: 'properties.originalAmount', + type: { + name: 'Composite', + className: 'Amount' + } + }, + closedBalance: { + required: false, + readOnly: true, + serializedName: 'properties.closedBalance', + type: { + name: 'Composite', + className: 'Amount' + } + }, + source: { + required: false, + readOnly: true, + serializedName: 'properties.source', + type: { + name: 'String' + } + }, + startDate: { + required: false, + readOnly: true, + serializedName: 'properties.startDate', + type: { + name: 'DateTime' + } + }, + expirationDate: { + required: false, + readOnly: true, + serializedName: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + poNumber: { + required: false, + readOnly: true, + serializedName: 'properties.poNumber', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LotSummary; diff --git a/lib/services/consumptionManagement/lib/models/lots.js b/lib/services/consumptionManagement/lib/models/lots.js new file mode 100644 index 0000000000..20d8ef7381 --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/lots.js @@ -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'; + +/** + * Result of listing lot summary. + * + */ +class Lots { + /** + * Create a Lots. + * @property {array} [value] The list of lot summary. + */ + constructor() { + } + + /** + * Defines the metadata of Lots + * + * @returns {object} metadata of Lots + * + */ + mapper() { + return { + required: false, + serializedName: 'Lots', + type: { + name: 'Composite', + className: 'Lots', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LotSummaryElementType', + type: { + name: 'Composite', + className: 'LotSummary' + } + } + } + } + } + } + }; + } +} + +module.exports = Lots; diff --git a/lib/services/consumptionManagement/lib/models/operation.js b/lib/services/consumptionManagement/lib/models/operation.js index ba6e19b841..064e7b4af8 100644 --- a/lib/services/consumptionManagement/lib/models/operation.js +++ b/lib/services/consumptionManagement/lib/models/operation.js @@ -17,14 +17,15 @@ class Operation { /** * Create a Operation. - * @member {string} [name] Operation name: {provider}/{resource}/{operation}. - * @member {object} [display] The object that represents the operation. - * @member {string} [display.provider] Service provider: + * @property {string} [name] Operation name: + * {provider}/{resource}/{operation}. + * @property {object} [display] The object that represents the operation. + * @property {string} [display.provider] Service provider: * Microsoft.Consumption. - * @member {string} [display.resource] Resource on which the operation is + * @property {string} [display.resource] Resource on which the operation is * performed: UsageDetail, etc. - * @member {string} [display.operation] Operation type: Read, write, delete, - * etc. + * @property {string} [display.operation] Operation type: Read, write, + * delete, etc. */ constructor() { } diff --git a/lib/services/consumptionManagement/lib/models/operationDisplay.js b/lib/services/consumptionManagement/lib/models/operationDisplay.js index 310f7845fc..dd3a0f79a3 100644 --- a/lib/services/consumptionManagement/lib/models/operationDisplay.js +++ b/lib/services/consumptionManagement/lib/models/operationDisplay.js @@ -17,10 +17,10 @@ class OperationDisplay { /** * Create a OperationDisplay. - * @member {string} [provider] Service provider: Microsoft.Consumption. - * @member {string} [resource] Resource on which the operation is performed: - * UsageDetail, etc. - * @member {string} [operation] Operation type: Read, write, delete, etc. + * @property {string} [provider] Service provider: Microsoft.Consumption. + * @property {string} [resource] Resource on which the operation is + * performed: UsageDetail, etc. + * @property {string} [operation] Operation type: Read, write, delete, etc. */ constructor() { } diff --git a/lib/services/consumptionManagement/lib/models/operationListResult.js b/lib/services/consumptionManagement/lib/models/operationListResult.js index 6f0354dbf6..b7ca0d873f 100644 --- a/lib/services/consumptionManagement/lib/models/operationListResult.js +++ b/lib/services/consumptionManagement/lib/models/operationListResult.js @@ -17,7 +17,7 @@ class OperationListResult extends Array { /** * Create a OperationListResult. - * @member {string} [nextLink] URL to get the next set of operation list + * @property {string} [nextLink] URL to get the next set of operation list * results if there are any. */ constructor() { diff --git a/lib/services/consumptionManagement/lib/models/pricesheetDownloadResponse.js b/lib/services/consumptionManagement/lib/models/pricesheetDownloadResponse.js new file mode 100644 index 0000000000..08a2db521c --- /dev/null +++ b/lib/services/consumptionManagement/lib/models/pricesheetDownloadResponse.js @@ -0,0 +1,106 @@ +/* + * 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'); + +/** + * Download response of Pricesheets. + * + * @extends models['Resource'] + */ +class PricesheetDownloadResponse extends models['Resource'] { + /** + * Create a PricesheetDownloadResponse. + * @property {string} [downloadUrl] The URL to the PDF file. + * @property {string} [expiryTime] The time in UTC at which this download URL + * will expire. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PricesheetDownloadResponse + * + * @returns {object} metadata of PricesheetDownloadResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'PricesheetDownloadResponse', + type: { + name: 'Composite', + className: 'PricesheetDownloadResponse', + 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' + } + } + } + }, + downloadUrl: { + required: false, + readOnly: true, + serializedName: 'properties.downloadUrl', + type: { + name: 'String' + } + }, + expiryTime: { + required: false, + readOnly: true, + serializedName: 'properties.expiryTime', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PricesheetDownloadResponse; diff --git a/lib/services/consumptionManagement/lib/models/proxyResource.js b/lib/services/consumptionManagement/lib/models/proxyResource.js index d973e15776..bfb1882493 100644 --- a/lib/services/consumptionManagement/lib/models/proxyResource.js +++ b/lib/services/consumptionManagement/lib/models/proxyResource.js @@ -20,11 +20,11 @@ const models = require('./index'); class ProxyResource extends models['BaseResource'] { /** * Create a ProxyResource. - * @member {string} [id] Resource Id. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {string} [eTag] eTag of the resource. To handle concurrent update - * scenarion, this field will be used to determine whether the user is + * @property {string} [id] Resource Id. + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. + * @property {string} [eTag] eTag of the resource. To handle concurrent + * update scenario, this field will be used to determine whether the user is * updating the latest version or not. */ constructor() { diff --git a/lib/services/consumptionManagement/lib/models/resource.js b/lib/services/consumptionManagement/lib/models/resource.js index 036218624c..7ba7f750a6 100644 --- a/lib/services/consumptionManagement/lib/models/resource.js +++ b/lib/services/consumptionManagement/lib/models/resource.js @@ -20,10 +20,10 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] Resource Id. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {object} [tags] Resource tags. + * @property {string} [id] Resource Id. + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. + * @property {object} [tags] Resource tags. */ constructor() { super(); diff --git a/lib/services/consumptionManagement/lib/operations/billingProfilePricesheet.js b/lib/services/consumptionManagement/lib/operations/billingProfilePricesheet.js new file mode 100644 index 0000000000..14424af00a --- /dev/null +++ b/lib/services/consumptionManagement/lib/operations/billingProfilePricesheet.js @@ -0,0 +1,427 @@ +/* + * 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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} billingProfileId Azure Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 PricesheetDownloadResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _download(billingAccountId, billingProfileId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDownload(billingAccountId, billingProfileId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PricesheetDownloadResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} billingProfileId Azure Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 PricesheetDownloadResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDownload(billingAccountId, billingProfileId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (billingProfileId === null || billingProfileId === undefined || typeof billingProfileId.valueOf() !== 'string') { + throw new Error('billingProfileId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Consumption/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/pricesheet/default/download'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + requestUrl = requestUrl.replace('{billingProfileId}', encodeURIComponent(billingProfileId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PricesheetDownloadResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a BillingProfilePricesheet. */ +class BillingProfilePricesheet { + /** + * Create a BillingProfilePricesheet. + * @param {ConsumptionManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._download = _download; + this._beginDownload = _beginDownload; + } + + /** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} billingProfileId Azure Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + downloadWithHttpOperationResponse(billingAccountId, billingProfileId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._download(billingAccountId, billingProfileId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} billingProfileId Azure Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PricesheetDownloadResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 PricesheetDownloadResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + download(billingAccountId, billingProfileId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._download(billingAccountId, billingProfileId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._download(billingAccountId, billingProfileId, options, optionalCallback); + } + } + + /** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} billingProfileId Azure Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDownloadWithHttpOperationResponse(billingAccountId, billingProfileId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDownload(billingAccountId, billingProfileId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} billingProfileId Azure Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PricesheetDownloadResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 PricesheetDownloadResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDownload(billingAccountId, billingProfileId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDownload(billingAccountId, billingProfileId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDownload(billingAccountId, billingProfileId, options, optionalCallback); + } + } + +} + +module.exports = BillingProfilePricesheet; diff --git a/lib/services/consumptionManagement/lib/operations/chargesByBillingAccount.js b/lib/services/consumptionManagement/lib/operations/chargesByBillingAccount.js new file mode 100644 index 0000000000..dad0f703a5 --- /dev/null +++ b/lib/services/consumptionManagement/lib/operations/chargesByBillingAccount.js @@ -0,0 +1,295 @@ +/* + * 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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists the charges by billingAccountId for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.apply] May be used to group charges by + * properties/billingProfileId, or properties/invoiceSectionId. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 ChargesListByBillingAccount} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(billingAccountId, startDate, endDate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apply = (options && options.apply !== undefined) ? options.apply : undefined; + // Validate + try { + if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (startDate === null || startDate === undefined || typeof startDate.valueOf() !== 'string') { + throw new Error('startDate cannot be null or undefined and it must be of type string.'); + } + if (endDate === null || endDate === undefined || typeof endDate.valueOf() !== 'string') { + throw new Error('endDate cannot be null or undefined and it must be of type string.'); + } + if (apply !== null && apply !== undefined && typeof apply.valueOf() !== 'string') { + throw new Error('apply must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/charges'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('startDate=' + encodeURIComponent(startDate)); + queryParameters.push('endDate=' + encodeURIComponent(endDate)); + if (apply !== null && apply !== undefined) { + queryParameters.push('$apply=' + encodeURIComponent(apply)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ChargesListByBillingAccount']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ChargesByBillingAccount. */ +class ChargesByBillingAccount { + /** + * Create a ChargesByBillingAccount. + * @param {ConsumptionManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists the charges by billingAccountId for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.apply] May be used to group charges by + * properties/billingProfileId, or properties/invoiceSectionId. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(billingAccountId, startDate, endDate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(billingAccountId, startDate, endDate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the charges by billingAccountId for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.apply] May be used to group charges by + * properties/billingProfileId, or properties/invoiceSectionId. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ChargesListByBillingAccount} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 ChargesListByBillingAccount} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(billingAccountId, startDate, endDate, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(billingAccountId, startDate, endDate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(billingAccountId, startDate, endDate, options, optionalCallback); + } + } + +} + +module.exports = ChargesByBillingAccount; diff --git a/lib/services/consumptionManagement/lib/operations/chargesByBillingProfile.js b/lib/services/consumptionManagement/lib/operations/chargesByBillingProfile.js new file mode 100644 index 0000000000..35acf4dc49 --- /dev/null +++ b/lib/services/consumptionManagement/lib/operations/chargesByBillingProfile.js @@ -0,0 +1,289 @@ +/* + * 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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists the charges by billing profile id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 ChargesListByBillingProfile} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(billingAccountId, billingProfileId, startDate, endDate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (billingProfileId === null || billingProfileId === undefined || typeof billingProfileId.valueOf() !== 'string') { + throw new Error('billingProfileId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (startDate === null || startDate === undefined || typeof startDate.valueOf() !== 'string') { + throw new Error('startDate cannot be null or undefined and it must be of type string.'); + } + if (endDate === null || endDate === undefined || typeof endDate.valueOf() !== 'string') { + throw new Error('endDate cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/charges'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + requestUrl = requestUrl.replace('{billingProfileId}', encodeURIComponent(billingProfileId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('startDate=' + encodeURIComponent(startDate)); + queryParameters.push('endDate=' + encodeURIComponent(endDate)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ChargesListByBillingProfile']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ChargesByBillingProfile. */ +class ChargesByBillingProfile { + /** + * Create a ChargesByBillingProfile. + * @param {ConsumptionManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists the charges by billing profile id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(billingAccountId, billingProfileId, startDate, endDate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(billingAccountId, billingProfileId, startDate, endDate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the charges by billing profile id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ChargesListByBillingProfile} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 ChargesListByBillingProfile} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(billingAccountId, billingProfileId, startDate, endDate, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(billingAccountId, billingProfileId, startDate, endDate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(billingAccountId, billingProfileId, startDate, endDate, options, optionalCallback); + } + } + +} + +module.exports = ChargesByBillingProfile; diff --git a/lib/services/consumptionManagement/lib/operations/chargesByInvoiceSection.js b/lib/services/consumptionManagement/lib/operations/chargesByInvoiceSection.js new file mode 100644 index 0000000000..7605eb9b71 --- /dev/null +++ b/lib/services/consumptionManagement/lib/operations/chargesByInvoiceSection.js @@ -0,0 +1,305 @@ +/* + * 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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists the charges by invoice section id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} invoiceSectionId Invoice Section Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.apply] May be used to group charges by + * properties/productName. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 ChargesListByInvoiceSection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(billingAccountId, invoiceSectionId, startDate, endDate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apply = (options && options.apply !== undefined) ? options.apply : undefined; + // Validate + try { + if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (invoiceSectionId === null || invoiceSectionId === undefined || typeof invoiceSectionId.valueOf() !== 'string') { + throw new Error('invoiceSectionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (startDate === null || startDate === undefined || typeof startDate.valueOf() !== 'string') { + throw new Error('startDate cannot be null or undefined and it must be of type string.'); + } + if (endDate === null || endDate === undefined || typeof endDate.valueOf() !== 'string') { + throw new Error('endDate cannot be null or undefined and it must be of type string.'); + } + if (apply !== null && apply !== undefined && typeof apply.valueOf() !== 'string') { + throw new Error('apply must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/providers/Microsoft.Consumption/charges'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + requestUrl = requestUrl.replace('{invoiceSectionId}', encodeURIComponent(invoiceSectionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('startDate=' + encodeURIComponent(startDate)); + queryParameters.push('endDate=' + encodeURIComponent(endDate)); + if (apply !== null && apply !== undefined) { + queryParameters.push('$apply=' + encodeURIComponent(apply)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ChargesListByInvoiceSection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ChargesByInvoiceSection. */ +class ChargesByInvoiceSection { + /** + * Create a ChargesByInvoiceSection. + * @param {ConsumptionManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists the charges by invoice section id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} invoiceSectionId Invoice Section Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.apply] May be used to group charges by + * properties/productName. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(billingAccountId, invoiceSectionId, startDate, endDate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(billingAccountId, invoiceSectionId, startDate, endDate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the charges by invoice section id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} invoiceSectionId Invoice Section Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.apply] May be used to group charges by + * properties/productName. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ChargesListByInvoiceSection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 ChargesListByInvoiceSection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(billingAccountId, invoiceSectionId, startDate, endDate, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(billingAccountId, invoiceSectionId, startDate, endDate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(billingAccountId, invoiceSectionId, startDate, endDate, options, optionalCallback); + } + } + +} + +module.exports = ChargesByInvoiceSection; diff --git a/lib/services/consumptionManagement/lib/operations/creditSummaryByBillingProfile.js b/lib/services/consumptionManagement/lib/operations/creditSummaryByBillingProfile.js new file mode 100644 index 0000000000..b6b0c45b1b --- /dev/null +++ b/lib/services/consumptionManagement/lib/operations/creditSummaryByBillingProfile.js @@ -0,0 +1,261 @@ +/* + * 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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * The credit summary by billingAccountId and billingProfileId for given start + * and end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 CreditSummary} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(billingAccountId, billingProfileId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (billingProfileId === null || billingProfileId === undefined || typeof billingProfileId.valueOf() !== 'string') { + throw new Error('billingProfileId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + requestUrl = requestUrl.replace('{billingProfileId}', encodeURIComponent(billingProfileId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CreditSummary']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a CreditSummaryByBillingProfile. */ +class CreditSummaryByBillingProfile { + /** + * Create a CreditSummaryByBillingProfile. + * @param {ConsumptionManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + } + + /** + * The credit summary by billingAccountId and billingProfileId for given start + * and end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(billingAccountId, billingProfileId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(billingAccountId, billingProfileId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The credit summary by billingAccountId and billingProfileId for given start + * and end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CreditSummary} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 CreditSummary} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(billingAccountId, billingProfileId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(billingAccountId, billingProfileId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(billingAccountId, billingProfileId, options, optionalCallback); + } + } + +} + +module.exports = CreditSummaryByBillingProfile; diff --git a/lib/services/consumptionManagement/lib/operations/eventsByBillingProfile.js b/lib/services/consumptionManagement/lib/operations/eventsByBillingProfile.js new file mode 100644 index 0000000000..c9dd255e8f --- /dev/null +++ b/lib/services/consumptionManagement/lib/operations/eventsByBillingProfile.js @@ -0,0 +1,281 @@ +/* + * 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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists the events by billingAccountId and billingProfileId for given start + * and end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 Events} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(billingAccountId, billingProfileId, startDate, endDate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (billingProfileId === null || billingProfileId === undefined || typeof billingProfileId.valueOf() !== 'string') { + throw new Error('billingProfileId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (startDate === null || startDate === undefined || typeof startDate.valueOf() !== 'string') { + throw new Error('startDate cannot be null or undefined and it must be of type string.'); + } + if (endDate === null || endDate === undefined || typeof endDate.valueOf() !== 'string') { + throw new Error('endDate cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + requestUrl = requestUrl.replace('{billingProfileId}', encodeURIComponent(billingProfileId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('startDate=' + encodeURIComponent(startDate)); + queryParameters.push('endDate=' + encodeURIComponent(endDate)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Events']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a EventsByBillingProfile. */ +class EventsByBillingProfile { + /** + * Create a EventsByBillingProfile. + * @param {ConsumptionManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists the events by billingAccountId and billingProfileId for given start + * and end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(billingAccountId, billingProfileId, startDate, endDate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(billingAccountId, billingProfileId, startDate, endDate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the events by billingAccountId and billingProfileId for given start + * and end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {string} startDate Start date + * + * @param {string} endDate End date + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Events} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 Events} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(billingAccountId, billingProfileId, startDate, endDate, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(billingAccountId, billingProfileId, startDate, endDate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(billingAccountId, billingProfileId, startDate, endDate, options, optionalCallback); + } + } + +} + +module.exports = EventsByBillingProfile; diff --git a/lib/services/consumptionManagement/lib/operations/index.d.ts b/lib/services/consumptionManagement/lib/operations/index.d.ts index 7c23f1d2ad..c6bc9ccf15 100644 --- a/lib/services/consumptionManagement/lib/operations/index.d.ts +++ b/lib/services/consumptionManagement/lib/operations/index.d.ts @@ -14,4633 +14,15 @@ import * as models from '../models'; /** * @class - * UsageDetails - * __NOTE__: An instance of this class is automatically created for an - * instance of the ConsumptionManagementClient. - */ -export interface UsageDetails { - - - /** - * Lists the usage details for a scope by current billing period. Usage details - * are available via this API only for May 1, 2014 or later. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details for a scope by current billing period. Usage details - * are available via this API only for May 1, 2014 or later. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details for a scope by billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByBillingPeriodWithHttpOperationResponse(billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details for a scope by billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByBillingPeriod(billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listByBillingPeriod(billingPeriodName: string, callback: ServiceCallback): void; - listByBillingPeriod(billingPeriodName: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details by billingAccountId for a scope by current billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByBillingAccountWithHttpOperationResponse(billingAccountId: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details by billingAccountId for a scope by current billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByBillingAccount(billingAccountId: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listByBillingAccount(billingAccountId: string, callback: ServiceCallback): void; - listByBillingAccount(billingAccountId: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details based on billingAccountId for a scope by billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByBillingAccountWithHttpOperationResponse(billingAccountId: string, billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details based on billingAccountId for a scope by billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details by departmentId for a scope by current billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} departmentId Department ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByDepartmentWithHttpOperationResponse(departmentId: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details by departmentId for a scope by current billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} departmentId Department ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByDepartment(departmentId: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listByDepartment(departmentId: string, callback: ServiceCallback): void; - listByDepartment(departmentId: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details based on departmentId for a scope by billing period. - * Usage details are available via this API only for May 1, 2014 or later. - * - * @param {string} departmentId Department ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByDepartmentWithHttpOperationResponse(departmentId: string, billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details based on departmentId for a scope by billing period. - * Usage details are available via this API only for May 1, 2014 or later. - * - * @param {string} departmentId Department ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByDepartment(departmentId: string, billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByDepartment(departmentId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByDepartment(departmentId: string, billingPeriodName: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details by enrollmentAccountId for a scope by current - * billing period. Usage details are available via this API only for May 1, - * 2014 or later. - * - * @param {string} enrollmentAccountId EnrollmentAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByEnrollmentAccountWithHttpOperationResponse(enrollmentAccountId: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details by enrollmentAccountId for a scope by current - * billing period. Usage details are available via this API only for May 1, - * 2014 or later. - * - * @param {string} enrollmentAccountId EnrollmentAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByEnrollmentAccount(enrollmentAccountId: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listByEnrollmentAccount(enrollmentAccountId: string, callback: ServiceCallback): void; - listByEnrollmentAccount(enrollmentAccountId: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details based on enrollmentAccountId for a scope by billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} enrollmentAccountId EnrollmentAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByEnrollmentAccountWithHttpOperationResponse(enrollmentAccountId: string, billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details based on enrollmentAccountId for a scope by billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} enrollmentAccountId EnrollmentAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByEnrollmentAccount(enrollmentAccountId: string, billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByEnrollmentAccount(enrollmentAccountId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByEnrollmentAccount(enrollmentAccountId: string, billingPeriodName: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage detail records for all subscriptions belonging to a - * management group scope by current billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} managementGroupId Azure Management Group ID. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByManagementGroupWithHttpOperationResponse(managementGroupId: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage detail records for all subscriptions belonging to a - * management group scope by current billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} managementGroupId Azure Management Group ID. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName, properties/instanceId or - * tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - * not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByManagementGroup(managementGroupId: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagementGroup(managementGroupId: string, callback: ServiceCallback): void; - listByManagementGroup(managementGroupId: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage detail records for all subscriptions belonging to a - * management group scope by specified billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} managementGroupId Azure Management Group ID. - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByManagementGroupWithHttpOperationResponse(managementGroupId: string, billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage detail records for all subscriptions belonging to a - * management group scope by specified billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} managementGroupId Azure Management Group ID. - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/additionalProperties or properties/meterDetails within a list of - * usage details. By default, these fields are not included when listing usage - * details. - * - * @param {string} [options.filter] May be used to filter usageDetails by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N usageDetails. - * - * @param {object} [options.queryOptions] Additional parameters for the - * operation - * - * @param {string} [options.queryOptions.apply] OData apply expression to - * aggregate usageDetails by tags or (tags and properties/usageStart) - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, options?: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, options: { expand? : string, filter? : string, skiptoken? : string, top? : number, queryOptions? : models.QueryOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details for a scope by current billing period. Usage details - * are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details for a scope by current billing period. Usage details - * are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details for a scope by billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByBillingPeriodNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details for a scope by billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByBillingPeriodNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByBillingPeriodNext(nextPageLink: string, callback: ServiceCallback): void; - listByBillingPeriodNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details by billingAccountId for a scope by current billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByBillingAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details by billingAccountId for a scope by current billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByBillingAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByBillingAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByBillingAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details based on billingAccountId for a scope by billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByBillingAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details based on billingAccountId for a scope by billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByBillingAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByBillingAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listForBillingPeriodByBillingAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details by departmentId for a scope by current billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByDepartmentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details by departmentId for a scope by current billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByDepartmentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDepartmentNext(nextPageLink: string, callback: ServiceCallback): void; - listByDepartmentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details based on departmentId for a scope by billing period. - * Usage details are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByDepartmentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details based on departmentId for a scope by billing period. - * Usage details are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByDepartmentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByDepartmentNext(nextPageLink: string, callback: ServiceCallback): void; - listForBillingPeriodByDepartmentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details by enrollmentAccountId for a scope by current - * billing period. Usage details are available via this API only for May 1, - * 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByEnrollmentAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details by enrollmentAccountId for a scope by current - * billing period. Usage details are available via this API only for May 1, - * 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByEnrollmentAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByEnrollmentAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByEnrollmentAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage details based on enrollmentAccountId for a scope by billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByEnrollmentAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage details based on enrollmentAccountId for a scope by billing - * period. Usage details are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByEnrollmentAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByEnrollmentAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listForBillingPeriodByEnrollmentAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage detail records for all subscriptions belonging to a - * management group scope by current billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByManagementGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage detail records for all subscriptions belonging to a - * management group scope by current billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByManagementGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagementGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByManagementGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the usage detail records for all subscriptions belonging to a - * management group scope by specified billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByManagementGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the usage detail records for all subscriptions belonging to a - * management group scope by specified billing period. Usage details are - * available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {UsageDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByManagementGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByManagementGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listForBillingPeriodByManagementGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Marketplaces - * __NOTE__: An instance of this class is automatically created for an - * instance of the ConsumptionManagementClient. - */ -export interface Marketplaces { - - - /** - * Lists the marketplaces for a scope by subscriptionId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by subscriptionId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billing period and subscripotionId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByBillingPeriodWithHttpOperationResponse(billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billing period and subscripotionId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByBillingPeriod(billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByBillingPeriod(billingPeriodName: string, callback: ServiceCallback): void; - listByBillingPeriod(billingPeriodName: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billingAccountId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByBillingAccountWithHttpOperationResponse(billingAccountId: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billingAccountId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByBillingAccount(billingAccountId: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByBillingAccount(billingAccountId: string, callback: ServiceCallback): void; - listByBillingAccount(billingAccountId: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billing period and billingAccountId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByBillingAccountWithHttpOperationResponse(billingAccountId: string, billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billing period and billingAccountId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by departmentId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} departmentId Department ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByDepartmentWithHttpOperationResponse(departmentId: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by departmentId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} departmentId Department ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByDepartment(departmentId: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByDepartment(departmentId: string, callback: ServiceCallback): void; - listByDepartment(departmentId: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billing period and departmentId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} departmentId Department ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByDepartmentWithHttpOperationResponse(departmentId: string, billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billing period and departmentId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} departmentId Department ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByDepartment(departmentId: string, billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByDepartment(departmentId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByDepartment(departmentId: string, billingPeriodName: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by enrollmentAccountId and current - * billing period. Marketplaces are available via this API only for May 1, 2014 - * or later. - * - * @param {string} enrollmentAccountId EnrollmentAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByEnrollmentAccountWithHttpOperationResponse(enrollmentAccountId: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by enrollmentAccountId and current - * billing period. Marketplaces are available via this API only for May 1, 2014 - * or later. - * - * @param {string} enrollmentAccountId EnrollmentAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByEnrollmentAccount(enrollmentAccountId: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByEnrollmentAccount(enrollmentAccountId: string, callback: ServiceCallback): void; - listByEnrollmentAccount(enrollmentAccountId: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billing period and - * enrollmentAccountId. Marketplaces are available via this API only for May 1, - * 2014 or later. - * - * @param {string} enrollmentAccountId EnrollmentAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByEnrollmentAccountWithHttpOperationResponse(enrollmentAccountId: string, billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billing period and - * enrollmentAccountId. Marketplaces are available via this API only for May 1, - * 2014 or later. - * - * @param {string} enrollmentAccountId EnrollmentAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByEnrollmentAccount(enrollmentAccountId: string, billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByEnrollmentAccount(enrollmentAccountId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByEnrollmentAccount(enrollmentAccountId: string, billingPeriodName: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplace records for all subscriptions belonging to a - * management group scope by current billing period. Marketplaces are available - * via this API only for May 1, 2014 or later. - * - * @param {string} managementGroupId Azure Management Group ID. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByManagementGroupWithHttpOperationResponse(managementGroupId: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplace records for all subscriptions belonging to a - * management group scope by current billing period. Marketplaces are available - * via this API only for May 1, 2014 or later. - * - * @param {string} managementGroupId Azure Management Group ID. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByManagementGroup(managementGroupId: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagementGroup(managementGroupId: string, callback: ServiceCallback): void; - listByManagementGroup(managementGroupId: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplace records for all subscriptions belonging to a - * management group scope by specified billing period. Marketplaces are - * available via this API only for May 1, 2014 or later. - * - * @param {string} managementGroupId Azure Management Group ID. - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByManagementGroupWithHttpOperationResponse(managementGroupId: string, billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplace records for all subscriptions belonging to a - * management group scope by specified billing period. Marketplaces are - * available via this API only for May 1, 2014 or later. - * - * @param {string} managementGroupId Azure Management Group ID. - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter marketplaces by - * properties/usageEnd (Utc time), properties/usageStart (Utc time), - * properties/resourceGroup, properties/instanceName or properties/instanceId. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {number} [options.top] May be used to limit the number of results to - * the most recent N marketplaces. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, options?: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, options: { filter? : string, top? : number, skiptoken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by subscriptionId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by subscriptionId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billing period and subscripotionId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByBillingPeriodNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billing period and subscripotionId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByBillingPeriodNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByBillingPeriodNext(nextPageLink: string, callback: ServiceCallback): void; - listByBillingPeriodNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billingAccountId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByBillingAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billingAccountId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByBillingAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByBillingAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByBillingAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billing period and billingAccountId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByBillingAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billing period and billingAccountId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByBillingAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByBillingAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listForBillingPeriodByBillingAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by departmentId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByDepartmentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by departmentId and current billing - * period. Marketplaces are available via this API only for May 1, 2014 or - * later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByDepartmentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDepartmentNext(nextPageLink: string, callback: ServiceCallback): void; - listByDepartmentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billing period and departmentId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByDepartmentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billing period and departmentId. - * Marketplaces are available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByDepartmentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByDepartmentNext(nextPageLink: string, callback: ServiceCallback): void; - listForBillingPeriodByDepartmentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by enrollmentAccountId and current - * billing period. Marketplaces are available via this API only for May 1, 2014 - * or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByEnrollmentAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by enrollmentAccountId and current - * billing period. Marketplaces are available via this API only for May 1, 2014 - * or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByEnrollmentAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByEnrollmentAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByEnrollmentAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplaces for a scope by billing period and - * enrollmentAccountId. Marketplaces are available via this API only for May 1, - * 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByEnrollmentAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplaces for a scope by billing period and - * enrollmentAccountId. Marketplaces are available via this API only for May 1, - * 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByEnrollmentAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByEnrollmentAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listForBillingPeriodByEnrollmentAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplace records for all subscriptions belonging to a - * management group scope by current billing period. Marketplaces are available - * via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByManagementGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplace records for all subscriptions belonging to a - * management group scope by current billing period. Marketplaces are available - * via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByManagementGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagementGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByManagementGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the marketplace records for all subscriptions belonging to a - * management group scope by specified billing period. Marketplaces are - * available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listForBillingPeriodByManagementGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the marketplace records for all subscriptions belonging to a - * management group scope by specified billing period. Marketplaces are - * available via this API only for May 1, 2014 or later. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MarketplacesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MarketplacesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MarketplacesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listForBillingPeriodByManagementGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByManagementGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listForBillingPeriodByManagementGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Balances - * __NOTE__: An instance of this class is automatically created for an - * instance of the ConsumptionManagementClient. - */ -export interface Balances { - - - /** - * Gets the balances for a scope by billingAccountId. Balances are available - * via this API only for May 1, 2014 or later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getByBillingAccountWithHttpOperationResponse(billingAccountId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the balances for a scope by billingAccountId. Balances are available - * via this API only for May 1, 2014 or later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Balance} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Balance} [result] - The deserialized result object if an error did not occur. - * See {@link Balance} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getByBillingAccount(billingAccountId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getByBillingAccount(billingAccountId: string, callback: ServiceCallback): void; - getByBillingAccount(billingAccountId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the balances for a scope by billing period and billingAccountId. - * Balances are available via this API only for May 1, 2014 or later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getForBillingPeriodByBillingAccountWithHttpOperationResponse(billingAccountId: string, billingPeriodName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the balances for a scope by billing period and billingAccountId. - * Balances are available via this API only for May 1, 2014 or later. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {string} billingPeriodName Billing Period Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Balance} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Balance} [result] - The deserialized result object if an error did not occur. - * See {@link Balance} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, callback: ServiceCallback): void; - getForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ReservationsSummaries - * __NOTE__: An instance of this class is automatically created for an - * instance of the ConsumptionManagementClient. - */ -export interface ReservationsSummaries { - - - /** - * Lists the reservations summaries for daily or monthly grain. - * - * @param {string} reservationOrderId Order Id of the reservation - * - * @param {string} grain Can be daily or monthly. Possible values include: - * 'DailyGrain', 'MonthlyGrain' - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Required only for daily grain. The - * properties/UsageDate for start date and end date. The filter supports 'le' - * and 'ge' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByReservationOrderWithHttpOperationResponse(reservationOrderId: string, grain: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the reservations summaries for daily or monthly grain. - * - * @param {string} reservationOrderId Order Id of the reservation - * - * @param {string} grain Can be daily or monthly. Possible values include: - * 'DailyGrain', 'MonthlyGrain' - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Required only for daily grain. The - * properties/UsageDate for start date and end date. The filter supports 'le' - * and 'ge' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationSummariesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationSummariesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationSummariesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByReservationOrder(reservationOrderId: string, grain: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByReservationOrder(reservationOrderId: string, grain: string, callback: ServiceCallback): void; - listByReservationOrder(reservationOrderId: string, grain: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the reservations summaries for daily or monthly grain. - * - * @param {string} reservationOrderId Order Id of the reservation - * - * @param {string} reservationId Id of the reservation - * - * @param {string} grain Can be daily or monthly. Possible values include: - * 'DailyGrain', 'MonthlyGrain' - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Required only for daily grain. The - * properties/UsageDate for start date and end date. The filter supports 'le' - * and 'ge' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByReservationOrderAndReservationWithHttpOperationResponse(reservationOrderId: string, reservationId: string, grain: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the reservations summaries for daily or monthly grain. - * - * @param {string} reservationOrderId Order Id of the reservation - * - * @param {string} reservationId Id of the reservation - * - * @param {string} grain Can be daily or monthly. Possible values include: - * 'DailyGrain', 'MonthlyGrain' - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Required only for daily grain. The - * properties/UsageDate for start date and end date. The filter supports 'le' - * and 'ge' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationSummariesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationSummariesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationSummariesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, grain: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, grain: string, callback: ServiceCallback): void; - listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, grain: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the reservations summaries for daily or monthly grain. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByReservationOrderNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the reservations summaries for daily or monthly grain. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationSummariesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationSummariesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationSummariesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByReservationOrderNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByReservationOrderNext(nextPageLink: string, callback: ServiceCallback): void; - listByReservationOrderNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the reservations summaries for daily or monthly grain. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByReservationOrderAndReservationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the reservations summaries for daily or monthly grain. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationSummariesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationSummariesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationSummariesListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByReservationOrderAndReservationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByReservationOrderAndReservationNext(nextPageLink: string, callback: ServiceCallback): void; - listByReservationOrderAndReservationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ReservationsDetails - * __NOTE__: An instance of this class is automatically created for an - * instance of the ConsumptionManagementClient. - */ -export interface ReservationsDetails { - - - /** - * Lists the reservations details for provided date range. - * - * @param {string} reservationOrderId Order Id of the reservation - * - * @param {string} filter Filter reservation details by date range. The - * properties/UsageDate for start date and end date. The filter supports 'le' - * and 'ge' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByReservationOrderWithHttpOperationResponse(reservationOrderId: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the reservations details for provided date range. - * - * @param {string} reservationOrderId Order Id of the reservation - * - * @param {string} filter Filter reservation details by date range. The - * properties/UsageDate for start date and end date. The filter supports 'le' - * and 'ge' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByReservationOrder(reservationOrderId: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByReservationOrder(reservationOrderId: string, filter: string, callback: ServiceCallback): void; - listByReservationOrder(reservationOrderId: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the reservations details for provided date range. - * - * @param {string} reservationOrderId Order Id of the reservation - * - * @param {string} reservationId Id of the reservation - * - * @param {string} filter Filter reservation details by date range. The - * properties/UsageDate for start date and end date. The filter supports 'le' - * and 'ge' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByReservationOrderAndReservationWithHttpOperationResponse(reservationOrderId: string, reservationId: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the reservations details for provided date range. - * - * @param {string} reservationOrderId Order Id of the reservation - * - * @param {string} reservationId Id of the reservation - * - * @param {string} filter Filter reservation details by date range. The - * properties/UsageDate for start date and end date. The filter supports 'le' - * and 'ge' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, filter: string, callback: ServiceCallback): void; - listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the reservations details for provided date range. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByReservationOrderNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the reservations details for provided date range. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByReservationOrderNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByReservationOrderNext(nextPageLink: string, callback: ServiceCallback): void; - listByReservationOrderNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the reservations details for provided date range. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByReservationOrderAndReservationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the reservations details for provided date range. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationDetailsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationDetailsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationDetailsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByReservationOrderAndReservationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByReservationOrderAndReservationNext(nextPageLink: string, callback: ServiceCallback): void; - listByReservationOrderAndReservationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ReservationRecommendations - * __NOTE__: An instance of this class is automatically created for an - * instance of the ConsumptionManagementClient. - */ -export interface ReservationRecommendations { - - - /** - * List of recomendations for purchasing reserved instances. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter - * reservationRecommendations by properties/scope and - * properties/lookBackPeriod. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List of recomendations for purchasing reserved instances. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter - * reservationRecommendations by properties/scope and - * properties/lookBackPeriod. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationRecommendationsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationRecommendationsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationRecommendationsListResult} for - * more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List of recomendations for purchasing reserved instances. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List of recomendations for purchasing reserved instances. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ReservationRecommendationsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ReservationRecommendationsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReservationRecommendationsListResult} for - * more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Budgets - * __NOTE__: An instance of this class is automatically created for an - * instance of the ConsumptionManagementClient. - */ -export interface Budgets { - - - /** - * Lists all budgets for a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all budgets for a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {BudgetsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {BudgetsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BudgetsListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all budgets for a resource group under a subscription. - * - * @param {string} resourceGroupName Azure Resource Group Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByResourceGroupNameWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all budgets for a resource group under a subscription. - * - * @param {string} resourceGroupName Azure Resource Group Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {BudgetsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {BudgetsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BudgetsListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroupName(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupName(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroupName(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the budget for a subscription by budget name. - * - * @param {string} budgetName Budget Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(budgetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the budget for a subscription by budget name. - * - * @param {string} budgetName Budget Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Budget} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Budget} [result] - The deserialized result object if an error did not occur. - * See {@link Budget} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(budgetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(budgetName: string, callback: ServiceCallback): void; - get(budgetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The operation to create or update a budget. Update operation requires latest - * eTag to be set in the request mandatorily. You may obtain the latest eTag by - * performing a get operation. Create operation does not require eTag. - * - * @param {string} budgetName Budget Name. - * - * @param {object} parameters Parameters supplied to the Create Budget - * operation. - * - * @param {string} parameters.category The category of the budget, whether the - * budget tracks cost or usage. Possible values include: 'Cost', 'Usage' - * - * @param {number} parameters.amount The total amount of cost to track with the - * budget - * - * @param {string} parameters.timeGrain The time covered by a budget. Tracking - * of the amount will be reset based on the time grain. Possible values - * include: 'Monthly', 'Quarterly', 'Annually' - * - * @param {object} parameters.timePeriod Has start and end date of the budget. - * The start date must be first of the month and should be less than the end - * date. Budget start date must be on or after June 1, 2017. Future start date - * should not be more than three months. Past start date should be selected - * within the timegrain preiod. There are no restrictions on the end date. - * - * @param {date} parameters.timePeriod.startDate The start date for the budget. - * - * @param {date} [parameters.timePeriod.endDate] The end date for the budget. - * If not provided, we default this to 10 years from the start date. - * - * @param {object} [parameters.filters] May be used to filter budgets by - * resource group, resource, or meter. - * - * @param {array} [parameters.filters.resourceGroups] The list of filters on - * resource groups, allowed at subscription level only. - * - * @param {array} [parameters.filters.resources] The list of filters on - * resources. - * - * @param {array} [parameters.filters.meters] The list of filters on meters - * (GUID), mandatory for budgets of usage category. - * - * @param {object} [parameters.filters.tags] The dictionary of filters on tags. - * - * @param {object} [parameters.notifications] Dictionary of notifications - * associated with the budget. Budget can have up to five notifications. - * - * @param {string} [parameters.eTag] eTag of the resource. To handle concurrent - * update scenarion, this field will be used to determine whether the user is - * updating the latest version or not. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(budgetName: string, parameters: models.Budget, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The operation to create or update a budget. Update operation requires latest - * eTag to be set in the request mandatorily. You may obtain the latest eTag by - * performing a get operation. Create operation does not require eTag. - * - * @param {string} budgetName Budget Name. - * - * @param {object} parameters Parameters supplied to the Create Budget - * operation. - * - * @param {string} parameters.category The category of the budget, whether the - * budget tracks cost or usage. Possible values include: 'Cost', 'Usage' - * - * @param {number} parameters.amount The total amount of cost to track with the - * budget - * - * @param {string} parameters.timeGrain The time covered by a budget. Tracking - * of the amount will be reset based on the time grain. Possible values - * include: 'Monthly', 'Quarterly', 'Annually' - * - * @param {object} parameters.timePeriod Has start and end date of the budget. - * The start date must be first of the month and should be less than the end - * date. Budget start date must be on or after June 1, 2017. Future start date - * should not be more than three months. Past start date should be selected - * within the timegrain preiod. There are no restrictions on the end date. - * - * @param {date} parameters.timePeriod.startDate The start date for the budget. - * - * @param {date} [parameters.timePeriod.endDate] The end date for the budget. - * If not provided, we default this to 10 years from the start date. - * - * @param {object} [parameters.filters] May be used to filter budgets by - * resource group, resource, or meter. - * - * @param {array} [parameters.filters.resourceGroups] The list of filters on - * resource groups, allowed at subscription level only. - * - * @param {array} [parameters.filters.resources] The list of filters on - * resources. - * - * @param {array} [parameters.filters.meters] The list of filters on meters - * (GUID), mandatory for budgets of usage category. - * - * @param {object} [parameters.filters.tags] The dictionary of filters on tags. - * - * @param {object} [parameters.notifications] Dictionary of notifications - * associated with the budget. Budget can have up to five notifications. - * - * @param {string} [parameters.eTag] eTag of the resource. To handle concurrent - * update scenarion, this field will be used to determine whether the user is - * updating the latest version or not. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Budget} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Budget} [result] - The deserialized result object if an error did not occur. - * See {@link Budget} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(budgetName: string, parameters: models.Budget, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(budgetName: string, parameters: models.Budget, callback: ServiceCallback): void; - createOrUpdate(budgetName: string, parameters: models.Budget, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The operation to delete a budget. - * - * @param {string} budgetName Budget Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(budgetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The operation to delete a budget. - * - * @param {string} budgetName Budget Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(budgetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(budgetName: string, callback: ServiceCallback): void; - deleteMethod(budgetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the budget for a resource group under a subscription by budget name. - * - * @param {string} resourceGroupName Azure Resource Group Name. - * - * @param {string} budgetName Budget Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getByResourceGroupNameWithHttpOperationResponse(resourceGroupName: string, budgetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the budget for a resource group under a subscription by budget name. - * - * @param {string} resourceGroupName Azure Resource Group Name. - * - * @param {string} budgetName Budget Name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Budget} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Budget} [result] - The deserialized result object if an error did not occur. - * See {@link Budget} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getByResourceGroupName(resourceGroupName: string, budgetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getByResourceGroupName(resourceGroupName: string, budgetName: string, callback: ServiceCallback): void; - getByResourceGroupName(resourceGroupName: string, budgetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The operation to create or update a budget. Update operation requires latest - * eTag to be set in the request mandatorily. You may obtain the latest eTag by - * performing a get operation. Create operation does not require eTag. - * - * @param {string} resourceGroupName Azure Resource Group Name. - * - * @param {string} budgetName Budget Name. - * - * @param {object} parameters Parameters supplied to the Create Budget - * operation. - * - * @param {string} parameters.category The category of the budget, whether the - * budget tracks cost or usage. Possible values include: 'Cost', 'Usage' - * - * @param {number} parameters.amount The total amount of cost to track with the - * budget - * - * @param {string} parameters.timeGrain The time covered by a budget. Tracking - * of the amount will be reset based on the time grain. Possible values - * include: 'Monthly', 'Quarterly', 'Annually' - * - * @param {object} parameters.timePeriod Has start and end date of the budget. - * The start date must be first of the month and should be less than the end - * date. Budget start date must be on or after June 1, 2017. Future start date - * should not be more than three months. Past start date should be selected - * within the timegrain preiod. There are no restrictions on the end date. - * - * @param {date} parameters.timePeriod.startDate The start date for the budget. - * - * @param {date} [parameters.timePeriod.endDate] The end date for the budget. - * If not provided, we default this to 10 years from the start date. - * - * @param {object} [parameters.filters] May be used to filter budgets by - * resource group, resource, or meter. - * - * @param {array} [parameters.filters.resourceGroups] The list of filters on - * resource groups, allowed at subscription level only. - * - * @param {array} [parameters.filters.resources] The list of filters on - * resources. - * - * @param {array} [parameters.filters.meters] The list of filters on meters - * (GUID), mandatory for budgets of usage category. - * - * @param {object} [parameters.filters.tags] The dictionary of filters on tags. - * - * @param {object} [parameters.notifications] Dictionary of notifications - * associated with the budget. Budget can have up to five notifications. - * - * @param {string} [parameters.eTag] eTag of the resource. To handle concurrent - * update scenarion, this field will be used to determine whether the user is - * updating the latest version or not. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateByResourceGroupNameWithHttpOperationResponse(resourceGroupName: string, budgetName: string, parameters: models.Budget, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The operation to create or update a budget. Update operation requires latest - * eTag to be set in the request mandatorily. You may obtain the latest eTag by - * performing a get operation. Create operation does not require eTag. - * - * @param {string} resourceGroupName Azure Resource Group Name. - * - * @param {string} budgetName Budget Name. - * - * @param {object} parameters Parameters supplied to the Create Budget - * operation. - * - * @param {string} parameters.category The category of the budget, whether the - * budget tracks cost or usage. Possible values include: 'Cost', 'Usage' - * - * @param {number} parameters.amount The total amount of cost to track with the - * budget - * - * @param {string} parameters.timeGrain The time covered by a budget. Tracking - * of the amount will be reset based on the time grain. Possible values - * include: 'Monthly', 'Quarterly', 'Annually' - * - * @param {object} parameters.timePeriod Has start and end date of the budget. - * The start date must be first of the month and should be less than the end - * date. Budget start date must be on or after June 1, 2017. Future start date - * should not be more than three months. Past start date should be selected - * within the timegrain preiod. There are no restrictions on the end date. - * - * @param {date} parameters.timePeriod.startDate The start date for the budget. - * - * @param {date} [parameters.timePeriod.endDate] The end date for the budget. - * If not provided, we default this to 10 years from the start date. - * - * @param {object} [parameters.filters] May be used to filter budgets by - * resource group, resource, or meter. - * - * @param {array} [parameters.filters.resourceGroups] The list of filters on - * resource groups, allowed at subscription level only. - * - * @param {array} [parameters.filters.resources] The list of filters on - * resources. - * - * @param {array} [parameters.filters.meters] The list of filters on meters - * (GUID), mandatory for budgets of usage category. - * - * @param {object} [parameters.filters.tags] The dictionary of filters on tags. - * - * @param {object} [parameters.notifications] Dictionary of notifications - * associated with the budget. Budget can have up to five notifications. - * - * @param {string} [parameters.eTag] eTag of the resource. To handle concurrent - * update scenarion, this field will be used to determine whether the user is - * updating the latest version or not. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Budget} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Budget} [result] - The deserialized result object if an error did not occur. - * See {@link Budget} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateByResourceGroupName(resourceGroupName: string, budgetName: string, parameters: models.Budget, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateByResourceGroupName(resourceGroupName: string, budgetName: string, parameters: models.Budget, callback: ServiceCallback): void; - createOrUpdateByResourceGroupName(resourceGroupName: string, budgetName: string, parameters: models.Budget, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ConsumptionManagementClient. + */ +export interface Operations { /** - * The operation to delete a budget. - * - * @param {string} resourceGroupName Azure Resource Group Name. - * - * @param {string} budgetName Budget Name. + * Lists all of the available consumption REST API operations. * * @param {object} [options] Optional Parameters. * @@ -4649,18 +31,14 @@ export interface Budgets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteByResourceGroupNameWithHttpOperationResponse(resourceGroupName: string, budgetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to delete a budget. - * - * @param {string} resourceGroupName Azure Resource Group Name. - * - * @param {string} budgetName Budget Name. + * Lists all of the available consumption REST API operations. * * @param {object} [options] Optional Parameters. * @@ -4674,7 +52,7 @@ export interface Budgets { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4682,19 +60,20 @@ export interface Budgets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteByResourceGroupName(resourceGroupName: string, budgetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteByResourceGroupName(resourceGroupName: string, budgetName: string, callback: ServiceCallback): void; - deleteByResourceGroupName(resourceGroupName: string, budgetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all budgets for a subscription. + * Lists all of the available consumption REST API operations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4706,14 +85,14 @@ export interface Budgets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all budgets for a subscription. + * Lists all of the available consumption REST API operations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4730,7 +109,7 @@ export interface Budgets { * * {Promise} A promise is returned. * - * @resolve {BudgetsListResult} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4738,23 +117,34 @@ export interface Budgets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BudgetsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BudgetsListResult} for more information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * CreditSummaryByBillingProfile + * __NOTE__: An instance of this class is automatically created for an + * instance of the ConsumptionManagementClient. + */ +export interface CreditSummaryByBillingProfile { /** - * Lists all budgets for a resource group under a subscription. + * The credit summary by billingAccountId and billingProfileId for given start + * and end date. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. * * @param {object} [options] Optional Parameters. * @@ -4763,17 +153,19 @@ export interface Budgets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNameNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(billingAccountId: string, billingProfileId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all budgets for a resource group under a subscription. + * The credit summary by billingAccountId and billingProfileId for given start + * and end date. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. * * @param {object} [options] Optional Parameters. * @@ -4787,7 +179,7 @@ export interface Budgets { * * {Promise} A promise is returned. * - * @resolve {BudgetsListResult} - The deserialized result object. + * @resolve {CreditSummary} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4795,154 +187,65 @@ export interface Budgets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BudgetsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BudgetsListResult} for more information. + * {CreditSummary} [result] - The deserialized result object if an error did not occur. + * See {@link CreditSummary} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupNameNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNameNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNameNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(billingAccountId: string, billingProfileId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(billingAccountId: string, billingProfileId: string, callback: ServiceCallback): void; + get(billingAccountId: string, billingProfileId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * PriceSheet + * EventsByBillingProfile * __NOTE__: An instance of this class is automatically created for an * instance of the ConsumptionManagementClient. */ -export interface PriceSheet { - +export interface EventsByBillingProfile { - /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available - * via this API only for May 1, 2014 or later. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/meterDetails within a price sheet. By default, these fields are - * not included when returning price sheet. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the top N results. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(options?: { expand? : string, skiptoken? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available - * via this API only for May 1, 2014 or later. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] May be used to expand the - * properties/meterDetails within a price sheet. By default, these fields are - * not included when returning price sheet. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the top N results. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {PriceSheetResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * Lists the events by billingAccountId and billingProfileId for given start + * and end date. * - * {PriceSheetResult} [result] - The deserialized result object if an error did not occur. - * See {@link PriceSheetResult} for more information. + * @param {string} billingAccountId BillingAccount ID * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} billingProfileId Billing Profile Id. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(options?: { expand? : string, skiptoken? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - get(callback: ServiceCallback): void; - get(options: { expand? : string, skiptoken? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the price sheet for a scope by subscriptionId and billing period. Price - * sheet is available via this API only for May 1, 2014 or later. + * @param {string} startDate Start date * - * @param {string} billingPeriodName Billing Period Name. + * @param {string} endDate End date * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] May be used to expand the - * properties/meterDetails within a price sheet. By default, these fields are - * not included when returning price sheet. - * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. - * - * @param {number} [options.top] May be used to limit the number of results to - * the top N results. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getByBillingPeriodWithHttpOperationResponse(billingPeriodName: string, options?: { expand? : string, skiptoken? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the price sheet for a scope by subscriptionId and billing period. Price - * sheet is available via this API only for May 1, 2014 or later. + * Lists the events by billingAccountId and billingProfileId for given start + * and end date. * - * @param {string} billingPeriodName Billing Period Name. + * @param {string} billingAccountId BillingAccount ID * - * @param {object} [options] Optional Parameters. + * @param {string} billingProfileId Billing Profile Id. * - * @param {string} [options.expand] May be used to expand the - * properties/meterDetails within a price sheet. By default, these fields are - * not included when returning price sheet. + * @param {string} startDate Start date * - * @param {string} [options.skiptoken] Skiptoken is only used if a previous - * operation returned a partial result. If a previous response contains a - * nextLink element, the value of the nextLink element will include a skiptoken - * parameter that specifies a starting point to use for subsequent calls. + * @param {string} endDate End date * - * @param {number} [options.top] May be used to limit the number of results to - * the top N results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4954,7 +257,7 @@ export interface PriceSheet { * * {Promise} A promise is returned. * - * @resolve {PriceSheetResult} - The deserialized result object. + * @resolve {Events} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4962,32 +265,35 @@ export interface PriceSheet { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PriceSheetResult} [result] - The deserialized result object if an error did not occur. - * See {@link PriceSheetResult} for more information. + * {Events} [result] - The deserialized result object if an error did not occur. + * See {@link Events} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getByBillingPeriod(billingPeriodName: string, options?: { expand? : string, skiptoken? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getByBillingPeriod(billingPeriodName: string, callback: ServiceCallback): void; - getByBillingPeriod(billingPeriodName: string, options: { expand? : string, skiptoken? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, callback: ServiceCallback): void; + list(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Tags + * LotsByBillingProfile * __NOTE__: An instance of this class is automatically created for an * instance of the ConsumptionManagementClient. */ -export interface Tags { +export interface LotsByBillingProfile { /** - * Get all available tag keys for a billing account. + * Lists the lots by billingAccountId and billingProfileId for given start and + * end date. * * @param {string} billingAccountId BillingAccount ID * + * @param {string} billingProfileId Billing Profile Id. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4995,17 +301,20 @@ export interface Tags { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(billingAccountId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(billingAccountId: string, billingProfileId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get all available tag keys for a billing account. + * Lists the lots by billingAccountId and billingProfileId for given start and + * end date. * * @param {string} billingAccountId BillingAccount ID * + * @param {string} billingProfileId Billing Profile Id. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5018,7 +327,7 @@ export interface Tags { * * {Promise} A promise is returned. * - * @resolve {TagsResult} - The deserialized result object. + * @resolve {Lots} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5026,99 +335,33 @@ export interface Tags { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TagsResult} [result] - The deserialized result object if an error did not occur. - * See {@link TagsResult} for more information. + * {Lots} [result] - The deserialized result object if an error did not occur. + * See {@link Lots} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(billingAccountId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(billingAccountId: string, callback: ServiceCallback): void; - get(billingAccountId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(billingAccountId: string, billingProfileId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(billingAccountId: string, billingProfileId: string, callback: ServiceCallback): void; + list(billingAccountId: string, billingProfileId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Forecasts + * InvoicePricesheet * __NOTE__: An instance of this class is automatically created for an * instance of the ConsumptionManagementClient. */ -export interface Forecasts { +export interface InvoicePricesheet { /** - * Lists the forecast charges by subscriptionId. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter forecasts by - * properties/usageDate (Utc time), properties/chargeType or properties/grain. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the forecast charges by subscriptionId. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter forecasts by - * properties/usageDate (Utc time), properties/chargeType or properties/grain. - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - * currently support 'ne', 'or', or 'not'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ForecastsListResult} - The deserialized result object. + * Get pricesheet data for invoice id (invoiceName). * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ForecastsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ForecastsListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} billingAccountId Azure Billing Account Id. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Operations - * __NOTE__: An instance of this class is automatically created for an - * instance of the ConsumptionManagementClient. - */ -export interface Operations { - - - /** - * Lists all of the available consumption REST API operations. + * @param {string} invoiceName The name of an invoice resource. * * @param {object} [options] Optional Parameters. * @@ -5127,14 +370,18 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + downloadWithHttpOperationResponse(billingAccountId: string, invoiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available consumption REST API operations. + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. * * @param {object} [options] Optional Parameters. * @@ -5148,7 +395,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {PricesheetDownloadResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5156,23 +403,25 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {PricesheetDownloadResponse} [result] - The deserialized result object if an error did not occur. + * See {@link PricesheetDownloadResponse} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + download(billingAccountId: string, invoiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + download(billingAccountId: string, invoiceName: string, callback: ServiceCallback): void; + download(billingAccountId: string, invoiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the available consumption REST API operations. + * Get pricesheet data for invoice id (invoiceName). * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. * * @param {object} [options] Optional Parameters. * @@ -5181,17 +430,18 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDownloadWithHttpOperationResponse(billingAccountId: string, invoiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available consumption REST API operations. + * Get pricesheet data for invoice id (invoiceName). * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. * * @param {object} [options] Optional Parameters. * @@ -5205,7 +455,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {PricesheetDownloadResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5213,65 +463,56 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {PricesheetDownloadResponse} [result] - The deserialized result object if an error did not occur. + * See {@link PricesheetDownloadResponse} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDownload(billingAccountId: string, invoiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDownload(billingAccountId: string, invoiceName: string, callback: ServiceCallback): void; + beginDownload(billingAccountId: string, invoiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * AggregatedCost + * BillingProfilePricesheet * __NOTE__: An instance of this class is automatically created for an * instance of the ConsumptionManagementClient. */ -export interface AggregatedCost { +export interface BillingProfilePricesheet { /** - * Provides the aggregate cost of a management group and all child management - * groups by current billing period. + * Get pricesheet data for invoice id (invoiceName). * - * @param {string} managementGroupId Azure Management Group ID. + * @param {string} billingAccountId Azure Billing Account Id. * - * @param {object} [options] Optional Parameters. + * @param {string} billingProfileId Azure Billing Profile Id. * - * @param {string} [options.filter] May be used to filter aggregated cost by - * properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getByManagementGroupWithHttpOperationResponse(managementGroupId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + downloadWithHttpOperationResponse(billingAccountId: string, billingProfileId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Provides the aggregate cost of a management group and all child management - * groups by current billing period. + * Get pricesheet data for invoice id (invoiceName). * - * @param {string} managementGroupId Azure Management Group ID. + * @param {string} billingAccountId Azure Billing Account Id. * - * @param {object} [options] Optional Parameters. + * @param {string} billingProfileId Azure Billing Profile Id. * - * @param {string} [options.filter] May be used to filter aggregated cost by - * properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5283,7 +524,7 @@ export interface AggregatedCost { * * {Promise} A promise is returned. * - * @resolve {ManagementGroupAggregatedCostResult} - The deserialized result object. + * @resolve {PricesheetDownloadResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5291,26 +532,25 @@ export interface AggregatedCost { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ManagementGroupAggregatedCostResult} [result] - The deserialized result object if an error did not occur. - * See {@link ManagementGroupAggregatedCostResult} for - * more information. + * {PricesheetDownloadResponse} [result] - The deserialized result object if an error did not occur. + * See {@link PricesheetDownloadResponse} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getByManagementGroup(managementGroupId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getByManagementGroup(managementGroupId: string, callback: ServiceCallback): void; - getByManagementGroup(managementGroupId: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + download(billingAccountId: string, billingProfileId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + download(billingAccountId: string, billingProfileId: string, callback: ServiceCallback): void; + download(billingAccountId: string, billingProfileId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Provides the aggregate cost of a management group and all child management - * groups by specified billing period + * Get pricesheet data for invoice id (invoiceName). * - * @param {string} managementGroupId Azure Management Group ID. + * @param {string} billingAccountId Azure Billing Account Id. * - * @param {string} billingPeriodName Billing Period Name. + * @param {string} billingProfileId Azure Billing Profile Id. * * @param {object} [options] Optional Parameters. * @@ -5319,19 +559,18 @@ export interface AggregatedCost { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getForBillingPeriodByManagementGroupWithHttpOperationResponse(managementGroupId: string, billingPeriodName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDownloadWithHttpOperationResponse(billingAccountId: string, billingProfileId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Provides the aggregate cost of a management group and all child management - * groups by specified billing period + * Get pricesheet data for invoice id (invoiceName). * - * @param {string} managementGroupId Azure Management Group ID. + * @param {string} billingAccountId Azure Billing Account Id. * - * @param {string} billingPeriodName Billing Period Name. + * @param {string} billingProfileId Azure Billing Profile Id. * * @param {object} [options] Optional Parameters. * @@ -5345,7 +584,7 @@ export interface AggregatedCost { * * {Promise} A promise is returned. * - * @resolve {ManagementGroupAggregatedCostResult} - The deserialized result object. + * @resolve {PricesheetDownloadResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5353,68 +592,72 @@ export interface AggregatedCost { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ManagementGroupAggregatedCostResult} [result] - The deserialized result object if an error did not occur. - * See {@link ManagementGroupAggregatedCostResult} for - * more information. + * {PricesheetDownloadResponse} [result] - The deserialized result object if an error did not occur. + * See {@link PricesheetDownloadResponse} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, callback: ServiceCallback): void; - getForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDownload(billingAccountId: string, billingProfileId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDownload(billingAccountId: string, billingProfileId: string, callback: ServiceCallback): void; + beginDownload(billingAccountId: string, billingProfileId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Charges + * ChargesByBillingAccount * __NOTE__: An instance of this class is automatically created for an * instance of the ConsumptionManagementClient. */ -export interface Charges { +export interface ChargesByBillingAccount { /** - * Lists the charges by enrollmentAccountId. + * Lists the charges by billingAccountId for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. * * @param {string} billingAccountId BillingAccount ID * - * @param {string} enrollmentAccountId EnrollmentAccount ID + * @param {string} startDate Start date + * + * @param {string} endDate End date * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] May be used to filter charges by - * properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). + * @param {string} [options.apply] May be used to group charges by + * properties/billingProfileId, or properties/invoiceSectionId. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByEnrollmentAccountWithHttpOperationResponse(billingAccountId: string, enrollmentAccountId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(billingAccountId: string, startDate: string, endDate: string, options?: { apply? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the charges by enrollmentAccountId. + * Lists the charges by billingAccountId for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. * * @param {string} billingAccountId BillingAccount ID * - * @param {string} enrollmentAccountId EnrollmentAccount ID + * @param {string} startDate Start date + * + * @param {string} endDate End date * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] May be used to filter charges by - * properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). + * @param {string} [options.apply] May be used to group charges by + * properties/billingProfileId, or properties/invoiceSectionId. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5426,7 +669,7 @@ export interface Charges { * * {Promise} A promise is returned. * - * @resolve {ChargesListResult} - The deserialized result object. + * @resolve {ChargesListByBillingAccount} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5434,62 +677,70 @@ export interface Charges { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ChargesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ChargesListResult} for more information. + * {ChargesListByBillingAccount} [result] - The deserialized result object if an error did not occur. + * See {@link ChargesListByBillingAccount} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByEnrollmentAccount(billingAccountId: string, enrollmentAccountId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByEnrollmentAccount(billingAccountId: string, enrollmentAccountId: string, callback: ServiceCallback): void; - listByEnrollmentAccount(billingAccountId: string, enrollmentAccountId: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(billingAccountId: string, startDate: string, endDate: string, options?: { apply? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(billingAccountId: string, startDate: string, endDate: string, callback: ServiceCallback): void; + list(billingAccountId: string, startDate: string, endDate: string, options: { apply? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ChargesByBillingProfile + * __NOTE__: An instance of this class is automatically created for an + * instance of the ConsumptionManagementClient. + */ +export interface ChargesByBillingProfile { /** - * Lists the charges based on enrollmentAccountId by billing period. + * Lists the charges by billing profile id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. * * @param {string} billingAccountId BillingAccount ID * - * @param {string} enrollmentAccountId EnrollmentAccount ID + * @param {string} billingProfileId Billing Profile Id. * - * @param {string} billingPeriodName Billing Period Name. + * @param {string} startDate Start date * - * @param {object} [options] Optional Parameters. + * @param {string} endDate End date * - * @param {string} [options.filter] May be used to filter charges by - * properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listForBillingPeriodByEnrollmentAccountWithHttpOperationResponse(billingAccountId: string, enrollmentAccountId: string, billingPeriodName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the charges based on enrollmentAccountId by billing period. + * Lists the charges by billing profile id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. * * @param {string} billingAccountId BillingAccount ID * - * @param {string} enrollmentAccountId EnrollmentAccount ID + * @param {string} billingProfileId Billing Profile Id. * - * @param {string} billingPeriodName Billing Period Name. + * @param {string} startDate Start date * - * @param {object} [options] Optional Parameters. + * @param {string} endDate End date * - * @param {string} [options.filter] May be used to filter charges by - * properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5501,7 +752,7 @@ export interface Charges { * * {Promise} A promise is returned. * - * @resolve {ChargeSummary} - The deserialized result object. + * @resolve {ChargesListByBillingProfile} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5509,133 +760,76 @@ export interface Charges { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ChargeSummary} [result] - The deserialized result object if an error did not occur. - * See {@link ChargeSummary} for more information. + * {ChargesListByBillingProfile} [result] - The deserialized result object if an error did not occur. + * See {@link ChargesListByBillingProfile} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listForBillingPeriodByEnrollmentAccount(billingAccountId: string, enrollmentAccountId: string, billingPeriodName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByEnrollmentAccount(billingAccountId: string, enrollmentAccountId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByEnrollmentAccount(billingAccountId: string, enrollmentAccountId: string, billingPeriodName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, callback: ServiceCallback): void; + list(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} +/** + * @class + * ChargesByInvoiceSection + * __NOTE__: An instance of this class is automatically created for an + * instance of the ConsumptionManagementClient. + */ +export interface ChargesByInvoiceSection { - /** - * Lists the charges by departmentId. - * - * @param {string} billingAccountId BillingAccount ID - * - * @param {string} departmentId Department ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter charges by - * properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByDepartmentWithHttpOperationResponse(billingAccountId: string, departmentId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the charges by departmentId. + * Lists the charges by invoice section id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. * * @param {string} billingAccountId BillingAccount ID * - * @param {string} departmentId Department ID - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] May be used to filter charges by - * properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ChargesListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ChargesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ChargesListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByDepartment(billingAccountId: string, departmentId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByDepartment(billingAccountId: string, departmentId: string, callback: ServiceCallback): void; - listByDepartment(billingAccountId: string, departmentId: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the charges based on departmentId by billing period. + * @param {string} invoiceSectionId Invoice Section Id. * - * @param {string} billingAccountId BillingAccount ID - * - * @param {string} departmentId Department ID + * @param {string} startDate Start date * - * @param {string} billingPeriodName Billing Period Name. + * @param {string} endDate End date * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] May be used to filter charges by - * properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). + * @param {string} [options.apply] May be used to group charges by + * properties/productName. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listForBillingPeriodByDepartmentWithHttpOperationResponse(billingAccountId: string, departmentId: string, billingPeriodName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(billingAccountId: string, invoiceSectionId: string, startDate: string, endDate: string, options?: { apply? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the charges based on departmentId by billing period. + * Lists the charges by invoice section id for given start and end date. Start + * and end date are used to determine the billing period. For current month, + * the data will be provided from month to date. If there are no chages for a + * month then that month will show all zeroes. * * @param {string} billingAccountId BillingAccount ID * - * @param {string} departmentId Department ID + * @param {string} invoiceSectionId Invoice Section Id. * - * @param {string} billingPeriodName Billing Period Name. + * @param {string} startDate Start date + * + * @param {string} endDate End date * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] May be used to filter charges by - * properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter - * supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - * support 'ne', 'or', or 'not'. Tag filter is a key value pair string where - * key and value is separated by a colon (:). + * @param {string} [options.apply] May be used to group charges by + * properties/productName. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5647,7 +841,7 @@ export interface Charges { * * {Promise} A promise is returned. * - * @resolve {ChargeSummary} - The deserialized result object. + * @resolve {ChargesListByInvoiceSection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5655,14 +849,15 @@ export interface Charges { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ChargeSummary} [result] - The deserialized result object if an error did not occur. - * See {@link ChargeSummary} for more information. + * {ChargesListByInvoiceSection} [result] - The deserialized result object if an error did not occur. + * See {@link ChargesListByInvoiceSection} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listForBillingPeriodByDepartment(billingAccountId: string, departmentId: string, billingPeriodName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listForBillingPeriodByDepartment(billingAccountId: string, departmentId: string, billingPeriodName: string, callback: ServiceCallback): void; - listForBillingPeriodByDepartment(billingAccountId: string, departmentId: string, billingPeriodName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(billingAccountId: string, invoiceSectionId: string, startDate: string, endDate: string, options?: { apply? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(billingAccountId: string, invoiceSectionId: string, startDate: string, endDate: string, callback: ServiceCallback): void; + list(billingAccountId: string, invoiceSectionId: string, startDate: string, endDate: string, options: { apply? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/consumptionManagement/lib/operations/index.js b/lib/services/consumptionManagement/lib/operations/index.js index 8ee282df83..143cfe26f9 100644 --- a/lib/services/consumptionManagement/lib/operations/index.js +++ b/lib/services/consumptionManagement/lib/operations/index.js @@ -14,16 +14,12 @@ 'use strict'; -exports.UsageDetails = require('./usageDetails'); -exports.Marketplaces = require('./marketplaces'); -exports.Balances = require('./balances'); -exports.ReservationsSummaries = require('./reservationsSummaries'); -exports.ReservationsDetails = require('./reservationsDetails'); -exports.ReservationRecommendations = require('./reservationRecommendations'); -exports.Budgets = require('./budgets'); -exports.PriceSheet = require('./priceSheet'); -exports.Tags = require('./tags'); -exports.Forecasts = require('./forecasts'); exports.Operations = require('./operations'); -exports.AggregatedCost = require('./aggregatedCost'); -exports.Charges = require('./charges'); +exports.CreditSummaryByBillingProfile = require('./creditSummaryByBillingProfile'); +exports.EventsByBillingProfile = require('./eventsByBillingProfile'); +exports.LotsByBillingProfile = require('./lotsByBillingProfile'); +exports.InvoicePricesheet = require('./invoicePricesheet'); +exports.BillingProfilePricesheet = require('./billingProfilePricesheet'); +exports.ChargesByBillingAccount = require('./chargesByBillingAccount'); +exports.ChargesByBillingProfile = require('./chargesByBillingProfile'); +exports.ChargesByInvoiceSection = require('./chargesByInvoiceSection'); diff --git a/lib/services/consumptionManagement/lib/operations/invoicePricesheet.js b/lib/services/consumptionManagement/lib/operations/invoicePricesheet.js new file mode 100644 index 0000000000..fe30bbbb4c --- /dev/null +++ b/lib/services/consumptionManagement/lib/operations/invoicePricesheet.js @@ -0,0 +1,427 @@ +/* + * 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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 PricesheetDownloadResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _download(billingAccountId, invoiceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDownload(billingAccountId, invoiceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PricesheetDownloadResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 PricesheetDownloadResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDownload(billingAccountId, invoiceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (invoiceName === null || invoiceName === undefined || typeof invoiceName.valueOf() !== 'string') { + throw new Error('invoiceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Consumption/billingAccounts/{billingAccountId}/invoices/{invoiceName}/pricesheet/default/download'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + requestUrl = requestUrl.replace('{invoiceName}', encodeURIComponent(invoiceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PricesheetDownloadResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a InvoicePricesheet. */ +class InvoicePricesheet { + /** + * Create a InvoicePricesheet. + * @param {ConsumptionManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._download = _download; + this._beginDownload = _beginDownload; + } + + /** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + downloadWithHttpOperationResponse(billingAccountId, invoiceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._download(billingAccountId, invoiceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PricesheetDownloadResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 PricesheetDownloadResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + download(billingAccountId, invoiceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._download(billingAccountId, invoiceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._download(billingAccountId, invoiceName, options, optionalCallback); + } + } + + /** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDownloadWithHttpOperationResponse(billingAccountId, invoiceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDownload(billingAccountId, invoiceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get pricesheet data for invoice id (invoiceName). + * + * @param {string} billingAccountId Azure Billing Account Id. + * + * @param {string} invoiceName The name of an invoice resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PricesheetDownloadResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 PricesheetDownloadResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDownload(billingAccountId, invoiceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDownload(billingAccountId, invoiceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDownload(billingAccountId, invoiceName, options, optionalCallback); + } + } + +} + +module.exports = InvoicePricesheet; diff --git a/lib/services/consumptionManagement/lib/operations/lotsByBillingProfile.js b/lib/services/consumptionManagement/lib/operations/lotsByBillingProfile.js new file mode 100644 index 0000000000..9ed3f0b892 --- /dev/null +++ b/lib/services/consumptionManagement/lib/operations/lotsByBillingProfile.js @@ -0,0 +1,261 @@ +/* + * 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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists the lots by billingAccountId and billingProfileId for given start and + * end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {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 Lots} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(billingAccountId, billingProfileId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (billingProfileId === null || billingProfileId === undefined || typeof billingProfileId.valueOf() !== 'string') { + throw new Error('billingProfileId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + requestUrl = requestUrl.replace('{billingProfileId}', encodeURIComponent(billingProfileId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Lots']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a LotsByBillingProfile. */ +class LotsByBillingProfile { + /** + * Create a LotsByBillingProfile. + * @param {ConsumptionManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists the lots by billingAccountId and billingProfileId for given start and + * end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(billingAccountId, billingProfileId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(billingAccountId, billingProfileId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the lots by billingAccountId and billingProfileId for given start and + * end date. + * + * @param {string} billingAccountId BillingAccount ID + * + * @param {string} billingProfileId Billing Profile Id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Lots} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {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 Lots} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(billingAccountId, billingProfileId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(billingAccountId, billingProfileId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(billingAccountId, billingProfileId, options, optionalCallback); + } + } + +} + +module.exports = LotsByBillingProfile; diff --git a/lib/services/consumptionManagement/package.json b/lib/services/consumptionManagement/package.json index 28da549223..1e5ebb3c58 100644 --- a/lib/services/consumptionManagement/package.json +++ b/lib/services/consumptionManagement/package.json @@ -22,4 +22,4 @@ "bugs": { "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}