From d2349fef3943680d397b056c5f8330bc71247172 Mon Sep 17 00:00:00 2001 From: colawwj Date: Mon, 15 Nov 2021 17:43:46 +0800 Subject: [PATCH 01/14] update --- sdk/consumption/arm-consumption/CHANGELOG.md | 14 + .../arm-consumption/{LICENSE.txt => LICENSE} | 2 +- sdk/consumption/arm-consumption/README.md | 154 +- sdk/consumption/arm-consumption/_meta.json | 7 + .../arm-consumption/api-extractor.json | 18 + sdk/consumption/arm-consumption/package.json | 92 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-consumption.api.md | 1611 +++++ .../arm-consumption/rollup.config.js | 205 +- .../src/consumptionManagementClient.ts | 140 +- .../src/consumptionManagementClientContext.ts | 88 +- sdk/consumption/arm-consumption/src/index.ts | 13 + .../src/models/aggregatedCostMappers.ts | 37 - .../src/models/balancesMappers.ts | 37 - .../src/models/budgetsMappers.ts | 38 - .../src/models/chargesMappers.ts | 38 - .../src/models/forecastsMappers.ts | 38 - .../arm-consumption/src/models/index.ts | 5785 ++++++++--------- .../arm-consumption/src/models/mappers.ts | 4643 +++++++++---- .../src/models/marketplacesMappers.ts | 38 - .../src/models/operationsMappers.ts | 15 - .../arm-consumption/src/models/parameters.ts | 294 +- .../src/models/priceSheetMappers.ts | 37 - .../reservationRecommendationsMappers.ts | 14 - .../src/models/reservationsDetailsMappers.ts | 38 - .../models/reservationsSummariesMappers.ts | 38 - .../arm-consumption/src/models/tagsMappers.ts | 37 - .../src/models/tenantsMappers.ts | 38 - .../src/models/usageDetailsMappers.ts | 38 - .../src/operations/aggregatedCost.ts | 150 +- .../src/operations/balances.ts | 146 +- .../arm-consumption/src/operations/budgets.ts | 756 +-- .../arm-consumption/src/operations/charges.ts | 345 +- .../arm-consumption/src/operations/credits.ts | 69 + .../src/operations/eventsOperations.ts | 358 + .../src/operations/forecasts.ts | 79 - .../arm-consumption/src/operations/index.ts | 16 +- .../src/operations/lotsOperations.ts | 321 + .../src/operations/marketplaces.ts | 1514 +---- .../src/operations/operations.ts | 164 +- .../src/operations/priceSheet.ts | 144 +- .../reservationRecommendationDetails.ts | 89 + .../operations/reservationRecommendations.ts | 200 +- .../src/operations/reservationTransactions.ts | 311 + .../src/operations/reservationsDetails.ts | 590 +- .../src/operations/reservationsSummaries.ts | 603 +- .../arm-consumption/src/operations/tags.ts | 85 +- .../arm-consumption/src/operations/tenants.ts | 98 - .../src/operations/usageDetails.ts | 1566 +---- .../operationsInterfaces/aggregatedCost.ts | 40 + .../src/operationsInterfaces/balances.ts | 40 + .../src/operationsInterfaces/budgets.ts | 117 + .../src/operationsInterfaces/charges.ts | 37 + .../src/operationsInterfaces/credits.ts | 24 + .../operationsInterfaces/eventsOperations.ts | 45 + .../src/operationsInterfaces/index.ts | 25 + .../operationsInterfaces/lotsOperations.ts | 43 + .../src/operationsInterfaces/marketplaces.ts | 35 + .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/priceSheet.ts | 34 + .../reservationRecommendationDetails.ts | 41 + .../reservationRecommendations.ts | 32 + .../reservationTransactions.ts | 40 + .../reservationsDetails.ts | 59 + .../reservationsSummaries.ts | 60 + .../src/operationsInterfaces/tags.ts | 27 + .../src/operationsInterfaces/usageDetails.ts | 43 + .../arm-consumption/test/sampleTest.ts | 48 + sdk/consumption/arm-consumption/tsconfig.json | 6 +- 69 files changed, 12026 insertions(+), 9948 deletions(-) create mode 100644 sdk/consumption/arm-consumption/CHANGELOG.md rename sdk/consumption/arm-consumption/{LICENSE.txt => LICENSE} (99%) create mode 100644 sdk/consumption/arm-consumption/_meta.json create mode 100644 sdk/consumption/arm-consumption/api-extractor.json create mode 100644 sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/consumption/arm-consumption/review/arm-consumption.api.md create mode 100644 sdk/consumption/arm-consumption/src/index.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/balancesMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/budgetsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/chargesMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/forecastsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/marketplacesMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/operationsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/priceSheetMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/reservationRecommendationsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/reservationsDetailsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/reservationsSummariesMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/tagsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/tenantsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/usageDetailsMappers.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/credits.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/eventsOperations.ts delete mode 100644 sdk/consumption/arm-consumption/src/operations/forecasts.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/lotsOperations.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts delete mode 100644 sdk/consumption/arm-consumption/src/operations/tenants.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/aggregatedCost.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/balances.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/credits.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/eventsOperations.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/index.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/marketplaces.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/operations.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/tags.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts create mode 100644 sdk/consumption/arm-consumption/test/sampleTest.ts diff --git a/sdk/consumption/arm-consumption/CHANGELOG.md b/sdk/consumption/arm-consumption/CHANGELOG.md new file mode 100644 index 000000000000..3cc08780c368 --- /dev/null +++ b/sdk/consumption/arm-consumption/CHANGELOG.md @@ -0,0 +1,14 @@ +## 9.0.0-beta.1 (2021-11-15) + +This is the first preview for the new version of the `@azure/arm-consumption` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services. + +While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/). + +Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies. + +**Noteworthy changes and features** +- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice. +- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead. +- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page. +- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`. +- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6. diff --git a/sdk/consumption/arm-consumption/LICENSE.txt b/sdk/consumption/arm-consumption/LICENSE similarity index 99% rename from sdk/consumption/arm-consumption/LICENSE.txt rename to sdk/consumption/arm-consumption/LICENSE index 2d3163745319..ccb63b166732 100644 --- a/sdk/consumption/arm-consumption/LICENSE.txt +++ b/sdk/consumption/arm-consumption/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/README.md b/sdk/consumption/arm-consumption/README.md index f89dec55ae63..28c2ebe0ee72 100644 --- a/sdk/consumption/arm-consumption/README.md +++ b/sdk/consumption/arm-consumption/README.md @@ -1,118 +1,94 @@ -## Azure ConsumptionManagementClient SDK for JavaScript +# Azure ConsumptionManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for ConsumptionManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ConsumptionManagement client. + +Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-consumption) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-consumption) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-consumption` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-consumption` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure ConsumptionManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-consumption @azure/identity +npm install @azure/arm-consumption ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `ConsumptionManagementClient` -### How to use +To create a client object to access the Azure ConsumptionManagement API, you will need the `endpoint` of your Azure ConsumptionManagement resource and a `credential`. The Azure ConsumptionManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ConsumptionManagement resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list usageDetails as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure ConsumptionManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { ConsumptionManagementClient } = require("@azure/arm-consumption"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new ConsumptionManagementClient(creds, subscriptionId); -const expand = "testexpand"; -const filter = "testfilter"; -const skiptoken = "testskiptoken"; -const top = 1; -const apply = "testapply"; -client.usageDetails.list(expand, filter, skiptoken, top, apply).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ConsumptionManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list usageDetails as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-consumption sample - - - - - - - +## Key concepts + +### ConsumptionManagementClient + +`ConsumptionManagementClient` is the primary interface for developers using the Azure ConsumptionManagement client library. Explore the methods on this client object to understand the different features of the Azure ConsumptionManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fconsumption%2Farm-consumption%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/consumption/arm-consumption/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/consumption/arm-consumption/_meta.json b/sdk/consumption/arm-consumption/_meta.json new file mode 100644 index 000000000000..f609791c1a66 --- /dev/null +++ b/sdk/consumption/arm-consumption/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "1e65d778939ea2f0859a81bde55740169a9b8dbb", + "readme": "specification/consumption/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/consumption/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.14", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-beta.14" +} \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/api-extractor.json b/sdk/consumption/arm-consumption/api-extractor.json new file mode 100644 index 000000000000..64cf6e492117 --- /dev/null +++ b/sdk/consumption/arm-consumption/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-consumption.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/consumption/arm-consumption/package.json b/sdk/consumption/arm-consumption/package.json index b1ebe75e9646..e9b32f95233f 100644 --- a/sdk/consumption/arm-consumption/package.json +++ b/sdk/consumption/arm-consumption/package.json @@ -1,58 +1,88 @@ { "name": "@azure/arm-consumption", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "ConsumptionManagementClient Library with typescript type definitions for node.js and browser.", - "version": "7.1.0", + "description": "A generated SDK for ConsumptionManagementClient.", + "version": "9.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-consumption.js", - "module": "./esm/consumptionManagementClient.js", - "types": "./esm/consumptionManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-consumption.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "@azure/identity": "2.0.0-beta.6", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-consumption.js.map'\" -o ./dist/arm-consumption.min.js ./dist/arm-consumption.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "echo skipped", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/consumption/arm-consumption/review/arm-consumption.api.md b/sdk/consumption/arm-consumption/review/arm-consumption.api.md new file mode 100644 index 000000000000..c8c1e970bcc2 --- /dev/null +++ b/sdk/consumption/arm-consumption/review/arm-consumption.api.md @@ -0,0 +1,1611 @@ +## API Report File for "@azure/arm-consumption" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; + +// @public +export interface AggregatedCost { + getByManagementGroup(managementGroupId: string, options?: AggregatedCostGetByManagementGroupOptionalParams): Promise; + getForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, options?: AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams): Promise; +} + +// @public +export interface AggregatedCostGetByManagementGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type AggregatedCostGetByManagementGroupResponse = ManagementGroupAggregatedCostResult; + +// @public +export interface AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AggregatedCostGetForBillingPeriodByManagementGroupResponse = ManagementGroupAggregatedCostResult; + +// @public +export interface Amount { + readonly currency?: string; + readonly value?: number; +} + +// @public +export type AmountWithExchangeRate = Amount & { + readonly exchangeRate?: number; + readonly exchangeRateMonth?: number; +}; + +// @public +export type Balance = 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?: BillingFrequency; + readonly priceHidden?: boolean; + readonly newPurchasesDetails?: BalancePropertiesNewPurchasesDetailsItem[]; + readonly adjustmentDetails?: BalancePropertiesAdjustmentDetailsItem[]; +}; + +// @public (undocumented) +export interface BalancePropertiesAdjustmentDetailsItem { + readonly name?: string; + readonly value?: number; +} + +// @public (undocumented) +export interface BalancePropertiesNewPurchasesDetailsItem { + readonly name?: string; + readonly value?: number; +} + +// @public +export interface Balances { + getByBillingAccount(billingAccountId: string, options?: BalancesGetByBillingAccountOptionalParams): Promise; + getForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, options?: BalancesGetForBillingPeriodByBillingAccountOptionalParams): Promise; +} + +// @public +export interface BalancesGetByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BalancesGetByBillingAccountResponse = Balance; + +// @public +export interface BalancesGetForBillingPeriodByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BalancesGetForBillingPeriodByBillingAccountResponse = Balance; + +// @public +export type BillingFrequency = string; + +// @public +export type Budget = ProxyResource & { + category?: CategoryType; + amount?: number; + timeGrain?: TimeGrainType; + timePeriod?: BudgetTimePeriod; + filter?: BudgetFilter; + readonly currentSpend?: CurrentSpend; + notifications?: { + [propertyName: string]: Notification_2; + }; + readonly forecastSpend?: ForecastSpend; +}; + +// @public +export interface BudgetComparisonExpression { + name: string; + operator: BudgetOperatorType; + values: string[]; +} + +// @public +export interface BudgetFilter { + and?: BudgetFilterProperties[]; + dimensions?: BudgetComparisonExpression; + not?: BudgetFilterProperties; + tags?: BudgetComparisonExpression; +} + +// @public +export interface BudgetFilterProperties { + dimensions?: BudgetComparisonExpression; + tags?: BudgetComparisonExpression; +} + +// @public +export type BudgetOperatorType = string; + +// @public +export interface Budgets { + createOrUpdate(scope: string, budgetName: string, parameters: Budget, options?: BudgetsCreateOrUpdateOptionalParams): Promise; + delete(scope: string, budgetName: string, options?: BudgetsDeleteOptionalParams): Promise; + get(scope: string, budgetName: string, options?: BudgetsGetOptionalParams): Promise; + list(scope: string, options?: BudgetsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BudgetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BudgetsCreateOrUpdateResponse = Budget; + +// @public +export interface BudgetsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface BudgetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BudgetsGetResponse = Budget; + +// @public +export interface BudgetsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BudgetsListNextResponse = BudgetsListResult; + +// @public +export interface BudgetsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BudgetsListResponse = BudgetsListResult; + +// @public +export interface BudgetsListResult { + readonly nextLink?: string; + readonly value?: Budget[]; +} + +// @public +export interface BudgetTimePeriod { + endDate?: Date; + startDate: Date; +} + +// @public +export type CategoryType = string; + +// @public +export interface Charges { + list(scope: string, options?: ChargesListOptionalParams): Promise; +} + +// @public +export interface ChargesListOptionalParams extends coreClient.OperationOptions { + apply?: string; + endDate?: string; + filter?: string; + startDate?: string; +} + +// @public +export type ChargesListResponse = ChargesListResult; + +// @public +export interface ChargesListResult { + readonly value?: ChargeSummaryUnion[]; +} + +// @public +export type ChargeSummary = ProxyResource & { + kind: ChargeSummaryKind; +}; + +// @public +export type ChargeSummaryKind = string; + +// @public (undocumented) +export type ChargeSummaryUnion = ChargeSummary | LegacyChargeSummary | ModernChargeSummary; + +// @public (undocumented) +export class ConsumptionManagementClient extends ConsumptionManagementClientContext { + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConsumptionManagementClientOptionalParams); + // (undocumented) + aggregatedCost: AggregatedCost; + // (undocumented) + balances: Balances; + // (undocumented) + budgets: Budgets; + // (undocumented) + charges: Charges; + // (undocumented) + credits: Credits; + // (undocumented) + eventsOperations: EventsOperations; + // (undocumented) + lotsOperations: LotsOperations; + // (undocumented) + marketplaces: Marketplaces; + // (undocumented) + operations: Operations; + // (undocumented) + priceSheet: PriceSheet; + // (undocumented) + reservationRecommendationDetails: ReservationRecommendationDetails; + // (undocumented) + reservationRecommendations: ReservationRecommendations; + // (undocumented) + reservationsDetails: ReservationsDetails; + // (undocumented) + reservationsSummaries: ReservationsSummaries; + // (undocumented) + reservationTransactions: ReservationTransactions; + // (undocumented) + tags: Tags; + // (undocumented) + usageDetails: UsageDetails; +} + +// @public (undocumented) +export class ConsumptionManagementClientContext extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConsumptionManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface ConsumptionManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface CreditBalanceSummary { + readonly currentBalance?: Amount; + readonly estimatedBalance?: Amount; + readonly estimatedBalanceInBillingCurrency?: AmountWithExchangeRate; +} + +// @public +export interface Credits { + get(billingAccountId: string, billingProfileId: string, options?: CreditsGetOptionalParams): Promise; +} + +// @public +export interface CreditsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CreditsGetResponse = CreditSummary; + +// @public +export type CreditSummary = Resource & { + readonly balanceSummary?: CreditBalanceSummary; + readonly pendingCreditAdjustments?: Amount; + readonly expiredCredit?: Amount; + readonly pendingEligibleCharges?: Amount; + readonly creditCurrency?: string; + readonly billingCurrency?: string; + readonly reseller?: Reseller; + readonly eTag?: string; +}; + +// @public +export type CultureCode = string; + +// @public +export interface CurrentSpend { + readonly amount?: number; + readonly unit?: string; +} + +// @public +export type Datagrain = string; + +// @public +export interface DownloadProperties { + readonly downloadUrl?: string; + readonly validTill?: string; +} + +// @public +export interface ErrorDetails { + readonly code?: string; + readonly message?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetails; +} + +// @public +export interface Events { + readonly nextLink?: string; + readonly value?: EventSummary[]; +} + +// @public +export interface EventsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type EventsListByBillingAccountNextResponse = Events; + +// @public +export interface EventsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type EventsListByBillingAccountResponse = Events; + +// @public +export interface EventsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventsListByBillingProfileNextResponse = Events; + +// @public +export interface EventsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventsListByBillingProfileResponse = Events; + +// @public +export interface EventsOperations { + listByBillingAccount(billingAccountId: string, options?: EventsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, options?: EventsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type EventSummary = ProxyResource & { + readonly transactionDate?: Date; + readonly description?: string; + readonly newCredit?: Amount; + readonly adjustments?: Amount; + readonly creditExpired?: Amount; + readonly charges?: Amount; + readonly closedBalance?: Amount; + eventType?: EventType; + readonly invoiceNumber?: string; + readonly billingProfileId?: string; + readonly billingProfileDisplayName?: string; + readonly lotId?: string; + readonly lotSource?: string; + readonly canceledCredit?: Amount; + readonly creditCurrency?: string; + readonly billingCurrency?: string; + readonly reseller?: Reseller; + readonly creditExpiredInBillingCurrency?: AmountWithExchangeRate; + readonly newCreditInBillingCurrency?: AmountWithExchangeRate; + readonly adjustmentsInBillingCurrency?: AmountWithExchangeRate; + readonly chargesInBillingCurrency?: AmountWithExchangeRate; + readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; + readonly eTagPropertiesETag?: string; +}; + +// @public +export type EventType = string; + +// @public +export interface ForecastSpend { + readonly amount?: number; + readonly unit?: string; +} + +// @public +export interface HighCasedErrorDetails { + readonly code?: string; + readonly message?: string; +} + +// @public +export interface HighCasedErrorResponse { + error?: HighCasedErrorDetails; +} + +// @public +export enum KnownBillingFrequency { + // (undocumented) + Month = "Month", + // (undocumented) + Quarter = "Quarter", + // (undocumented) + Year = "Year" +} + +// @public +export enum KnownBudgetOperatorType { + // (undocumented) + In = "In" +} + +// @public +export enum KnownCategoryType { + // (undocumented) + Cost = "Cost" +} + +// @public +export enum KnownChargeSummaryKind { + // (undocumented) + Legacy = "legacy", + // (undocumented) + Modern = "modern" +} + +// @public +export enum KnownCultureCode { + // (undocumented) + CsCz = "cs-cz", + // (undocumented) + DaDk = "da-dk", + // (undocumented) + DeDe = "de-de", + // (undocumented) + EnGb = "en-gb", + // (undocumented) + EnUs = "en-us", + // (undocumented) + EsEs = "es-es", + // (undocumented) + FrFr = "fr-fr", + // (undocumented) + HuHu = "hu-hu", + // (undocumented) + ItIt = "it-it", + // (undocumented) + JaJp = "ja-jp", + // (undocumented) + KoKr = "ko-kr", + // (undocumented) + NbNo = "nb-no", + // (undocumented) + NlNl = "nl-nl", + // (undocumented) + PlPl = "pl-pl", + // (undocumented) + PtBr = "pt-br", + // (undocumented) + PtPt = "pt-pt", + // (undocumented) + RuRu = "ru-ru", + // (undocumented) + SvSe = "sv-se", + // (undocumented) + TrTr = "tr-tr", + // (undocumented) + ZhCn = "zh-cn", + // (undocumented) + ZhTw = "zh-tw" +} + +// @public +export enum KnownDatagrain { + DailyGrain = "daily", + MonthlyGrain = "monthly" +} + +// @public +export enum KnownEventType { + // (undocumented) + NewCredit = "NewCredit", + // (undocumented) + PendingAdjustments = "PendingAdjustments", + // (undocumented) + PendingCharges = "PendingCharges", + // (undocumented) + PendingExpiredCredit = "PendingExpiredCredit", + // (undocumented) + PendingNewCredit = "PendingNewCredit", + // (undocumented) + SettledCharges = "SettledCharges", + // (undocumented) + UnKnown = "UnKnown" +} + +// @public +export enum KnownLookBackPeriod { + Last07Days = "Last7Days", + Last30Days = "Last30Days", + Last60Days = "Last60Days" +} + +// @public +export enum KnownLotSource { + // (undocumented) + ConsumptionCommitment = "ConsumptionCommitment", + // (undocumented) + PromotionalCredit = "PromotionalCredit", + // (undocumented) + PurchasedCredit = "PurchasedCredit" +} + +// @public +export enum KnownMetrictype { + ActualCostMetricType = "actualcost", + AmortizedCostMetricType = "amortizedcost", + UsageMetricType = "usage" +} + +// @public +export enum KnownOperatorType { + // (undocumented) + EqualTo = "EqualTo", + // (undocumented) + GreaterThan = "GreaterThan", + // (undocumented) + GreaterThanOrEqualTo = "GreaterThanOrEqualTo" +} + +// @public +export enum KnownPricingModelType { + // (undocumented) + OnDemand = "On Demand", + // (undocumented) + Reservation = "Reservation", + // (undocumented) + Spot = "Spot" +} + +// @public +export enum KnownReservationRecommendationKind { + // (undocumented) + Legacy = "legacy", + // (undocumented) + Modern = "modern" +} + +// @public +export enum KnownScope { + // (undocumented) + Shared = "Shared", + // (undocumented) + Single = "Single" +} + +// @public +export enum KnownStatus { + // (undocumented) + Active = "Active", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Complete = "Complete", + // (undocumented) + Expired = "Expired", + // (undocumented) + Inactive = "Inactive", + // (undocumented) + None = "None" +} + +// @public +export enum KnownTerm { + P1Y = "P1Y", + P3Y = "P3Y" +} + +// @public +export enum KnownThresholdType { + // (undocumented) + Actual = "Actual", + // (undocumented) + Forecasted = "Forecasted" +} + +// @public +export enum KnownTimeGrainType { + // (undocumented) + Annually = "Annually", + // (undocumented) + BillingAnnual = "BillingAnnual", + // (undocumented) + BillingMonth = "BillingMonth", + // (undocumented) + BillingQuarter = "BillingQuarter", + // (undocumented) + Monthly = "Monthly", + // (undocumented) + Quarterly = "Quarterly" +} + +// @public +export enum KnownUsageDetailsKind { + // (undocumented) + Legacy = "legacy", + // (undocumented) + Modern = "modern" +} + +// @public +export type LegacyChargeSummary = ChargeSummary & { + readonly billingPeriodId?: string; + readonly usageStart?: string; + readonly usageEnd?: string; + readonly azureCharges?: number; + readonly chargesBilledSeparately?: number; + readonly marketplaceCharges?: number; + readonly currency?: string; +}; + +// @public +export type LegacyReservationRecommendation = ReservationRecommendation & { + readonly lookBackPeriod?: string; + readonly instanceFlexibilityRatio?: number; + readonly instanceFlexibilityGroup?: string; + readonly normalizedSize?: string; + readonly recommendedQuantityNormalized?: number; + readonly meterId?: string; + readonly resourceType?: string; + readonly term?: string; + readonly costWithNoReservedInstances?: number; + readonly recommendedQuantity?: number; + readonly totalCostWithReservedInstances?: number; + readonly netSavings?: number; + readonly firstUsageDate?: Date; + readonly scope?: string; + readonly skuProperties?: SkuProperty[]; +}; + +// @public +export type LegacyReservationTransaction = ReservationTransaction & {}; + +// @public +export type LegacyUsageDetail = UsageDetail & { + readonly billingAccountId?: string; + readonly billingAccountName?: string; + readonly billingPeriodStartDate?: Date; + readonly billingPeriodEndDate?: Date; + readonly billingProfileId?: string; + readonly billingProfileName?: string; + readonly accountOwnerId?: string; + readonly accountName?: string; + readonly subscriptionId?: string; + readonly subscriptionName?: string; + readonly date?: Date; + readonly product?: string; + readonly partNumber?: string; + readonly meterId?: string; + readonly meterDetails?: MeterDetailsResponse; + readonly quantity?: number; + readonly effectivePrice?: number; + readonly cost?: number; + readonly unitPrice?: number; + readonly billingCurrency?: string; + readonly resourceLocation?: string; + readonly consumedService?: string; + readonly resourceId?: string; + readonly resourceName?: string; + readonly serviceInfo1?: string; + readonly serviceInfo2?: string; + readonly additionalInfo?: string; + readonly invoiceSection?: string; + readonly costCenter?: string; + readonly resourceGroup?: string; + readonly reservationId?: string; + readonly reservationName?: string; + readonly productOrderId?: string; + readonly productOrderName?: string; + readonly offerId?: string; + readonly isAzureCreditEligible?: boolean; + readonly term?: string; + readonly publisherName?: string; + readonly publisherType?: string; + readonly planName?: string; + readonly chargeType?: string; + readonly frequency?: string; + readonly payGPrice?: number; + readonly pricingModel?: PricingModelType; +}; + +// @public +export type LookBackPeriod = string; + +// @public +export interface Lots { + readonly nextLink?: string; + readonly value?: LotSummary[]; +} + +// @public +export interface LotsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LotsListByBillingAccountNextResponse = Lots; + +// @public +export interface LotsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LotsListByBillingAccountResponse = Lots; + +// @public +export interface LotsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LotsListByBillingProfileNextResponse = Lots; + +// @public +export interface LotsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LotsListByBillingProfileResponse = Lots; + +// @public +export interface LotsOperations { + listByBillingAccount(billingAccountId: string, options?: LotsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountId: string, billingProfileId: string, options?: LotsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type LotSource = string; + +// @public +export type LotSummary = ProxyResource & { + readonly originalAmount?: Amount; + readonly closedBalance?: Amount; + readonly source?: LotSource; + readonly startDate?: Date; + readonly expirationDate?: Date; + readonly poNumber?: string; + readonly purchasedDate?: Date; + readonly status?: Status; + readonly creditCurrency?: string; + readonly billingCurrency?: string; + readonly originalAmountInBillingCurrency?: AmountWithExchangeRate; + readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; + readonly reseller?: Reseller; + readonly eTagPropertiesETag?: string; +}; + +// @public +export type ManagementGroupAggregatedCostResult = Resource & { + 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[]; +}; + +// @public +export type Marketplace = Resource & { + readonly billingPeriodId?: string; + readonly usageStart?: Date; + readonly usageEnd?: Date; + readonly resourceRate?: number; + readonly offerName?: string; + readonly resourceGroup?: string; + readonly additionalInfo?: string; + readonly orderNumber?: string; + readonly instanceName?: string; + readonly instanceId?: string; + 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; +}; + +// @public +export interface Marketplaces { + list(scope: string, options?: MarketplacesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MarketplacesListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skiptoken?: string; + top?: number; +} + +// @public +export type MarketplacesListNextResponse = MarketplacesListResult; + +// @public +export interface MarketplacesListOptionalParams extends coreClient.OperationOptions { + filter?: string; + skiptoken?: string; + top?: number; +} + +// @public +export type MarketplacesListResponse = MarketplacesListResult; + +// @public +export interface MarketplacesListResult { + readonly nextLink?: string; + readonly value?: Marketplace[]; +} + +// @public +export interface MeterDetails { + readonly meterCategory?: string; + readonly meterLocation?: string; + readonly meterName?: string; + readonly meterSubCategory?: string; + readonly pretaxStandardRate?: number; + readonly serviceName?: string; + readonly serviceTier?: string; + readonly totalIncludedQuantity?: number; + readonly unit?: string; +} + +// @public +export interface MeterDetailsResponse { + readonly meterCategory?: string; + readonly meterName?: string; + readonly meterSubCategory?: string; + readonly serviceFamily?: string; + readonly unitOfMeasure?: string; +} + +// @public +export type Metrictype = string; + +// @public +export type ModernChargeSummary = ChargeSummary & { + readonly billingPeriodId?: string; + readonly usageStart?: string; + readonly usageEnd?: string; + readonly azureCharges?: Amount; + readonly chargesBilledSeparately?: Amount; + readonly marketplaceCharges?: Amount; + readonly billingAccountId?: string; + readonly billingProfileId?: string; + readonly invoiceSectionId?: string; + readonly customerId?: string; + readonly isInvoiced?: boolean; +}; + +// @public +export type ModernReservationRecommendation = ReservationRecommendation & { + readonly locationPropertiesLocation?: string; + readonly lookBackPeriod?: number; + readonly instanceFlexibilityRatio?: number; + readonly instanceFlexibilityGroup?: string; + readonly normalizedSize?: string; + readonly recommendedQuantityNormalized?: number; + readonly meterId?: string; + readonly term?: string; + readonly costWithNoReservedInstances?: Amount; + readonly recommendedQuantity?: number; + readonly totalCostWithReservedInstances?: Amount; + readonly netSavings?: Amount; + readonly firstUsageDate?: Date; + readonly scope?: string; + readonly skuProperties?: SkuProperty[]; + readonly skuName?: string; +}; + +// @public +export type ModernReservationTransaction = ReservationTransactionResource & { + readonly amount?: number; + readonly armSkuName?: string; + readonly billingFrequency?: string; + readonly billingProfileId?: string; + readonly billingProfileName?: string; + readonly currency?: string; + readonly description?: string; + readonly eventDate?: Date; + readonly eventType?: string; + readonly invoice?: string; + readonly invoiceId?: string; + readonly invoiceSectionId?: string; + readonly invoiceSectionName?: string; + readonly purchasingSubscriptionGuid?: string; + readonly purchasingSubscriptionName?: string; + readonly quantity?: number; + readonly region?: string; + readonly reservationOrderId?: string; + readonly reservationOrderName?: string; + readonly term?: string; +}; + +// @public +export interface ModernReservationTransactionsListResult { + readonly nextLink?: string; + readonly value?: ModernReservationTransaction[]; +} + +// @public +export type ModernUsageDetail = UsageDetail & { + readonly billingAccountId?: string; + readonly effectivePrice?: number; + readonly pricingModel?: PricingModelType; + readonly billingAccountName?: string; + readonly billingPeriodStartDate?: Date; + readonly billingPeriodEndDate?: Date; + readonly billingProfileId?: string; + readonly billingProfileName?: string; + readonly subscriptionGuid?: string; + readonly subscriptionName?: string; + readonly date?: Date; + readonly product?: string; + readonly meterId?: string; + readonly meterName?: string; + readonly meterRegion?: string; + readonly meterCategory?: string; + readonly meterSubCategory?: string; + readonly serviceFamily?: string; + readonly quantity?: number; + readonly unitOfMeasure?: string; + readonly instanceName?: string; + readonly costInUSD?: number; + readonly unitPrice?: number; + readonly billingCurrencyCode?: string; + readonly resourceLocation?: string; + readonly consumedService?: string; + readonly serviceInfo1?: string; + readonly serviceInfo2?: string; + readonly additionalInfo?: string; + readonly invoiceSectionId?: string; + readonly invoiceSectionName?: string; + readonly costCenter?: string; + readonly resourceGroup?: string; + readonly reservationId?: string; + readonly reservationName?: string; + readonly productOrderId?: string; + readonly productOrderName?: string; + readonly isAzureCreditEligible?: boolean; + readonly term?: string; + readonly publisherName?: string; + readonly publisherType?: string; + readonly chargeType?: string; + readonly frequency?: string; + readonly costInBillingCurrency?: number; + readonly costInPricingCurrency?: number; + readonly exchangeRate?: string; + readonly exchangeRateDate?: Date; + readonly invoiceId?: string; + readonly previousInvoiceId?: string; + readonly pricingCurrencyCode?: string; + readonly productIdentifier?: string; + readonly resourceLocationNormalized?: string; + readonly servicePeriodStartDate?: Date; + readonly servicePeriodEndDate?: Date; + readonly customerTenantId?: string; + readonly customerName?: string; + readonly partnerTenantId?: string; + readonly partnerName?: string; + readonly resellerMpnId?: string; + readonly resellerName?: string; + readonly publisherId?: string; + readonly marketPrice?: number; + readonly exchangeRatePricingToBilling?: number; + readonly paygCostInBillingCurrency?: number; + readonly paygCostInUSD?: number; + readonly partnerEarnedCreditRate?: number; + readonly partnerEarnedCreditApplied?: string; + readonly payGPrice?: number; + readonly benefitId?: string; + readonly benefitName?: string; + readonly provider?: string; + readonly costAllocationRuleName?: string; +}; + +// @public +interface Notification_2 { + contactEmails: string[]; + contactGroups?: string[]; + contactRoles?: string[]; + enabled: boolean; + locale?: CultureCode; + operator: OperatorType; + threshold: number; + thresholdType?: ThresholdType; +} +export { Notification_2 as Notification } + +// @public +export interface Operation { + display?: OperationDisplay; + readonly id?: string; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type OperatorType = string; + +// @public +export interface PriceSheet { + get(options?: PriceSheetGetOptionalParams): Promise; + getByBillingPeriod(billingPeriodName: string, options?: PriceSheetGetByBillingPeriodOptionalParams): Promise; +} + +// @public +export interface PriceSheetGetByBillingPeriodOptionalParams extends coreClient.OperationOptions { + expand?: string; + skiptoken?: string; + top?: number; +} + +// @public +export type PriceSheetGetByBillingPeriodResponse = PriceSheetResult; + +// @public +export interface PriceSheetGetOptionalParams extends coreClient.OperationOptions { + expand?: string; + skiptoken?: string; + top?: number; +} + +// @public +export type PriceSheetGetResponse = PriceSheetResult; + +// @public +export interface PriceSheetProperties { + readonly billingPeriodId?: string; + readonly currencyCode?: string; + readonly includedQuantity?: number; + readonly meterDetails?: MeterDetails; + readonly meterId?: string; + readonly offerId?: string; + readonly partNumber?: string; + readonly unitOfMeasure?: string; + readonly unitPrice?: number; +} + +// @public +export type PriceSheetResult = Resource & { + readonly pricesheets?: PriceSheetProperties[]; + readonly nextLink?: string; + readonly download?: MeterDetails; +}; + +// @public +export type PricingModelType = string; + +// @public +export interface ProxyResource { + eTag?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface Reseller { + readonly resellerDescription?: string; + readonly resellerId?: string; +} + +// @public +export type ReservationDetail = Resource & { + readonly reservationOrderId?: string; + readonly instanceFlexibilityRatio?: string; + readonly instanceFlexibilityGroup?: string; + readonly reservationId?: string; + readonly skuName?: string; + readonly reservedHours?: number; + readonly usageDate?: Date; + readonly usedHours?: number; + readonly instanceId?: string; + readonly totalReservedQuantity?: number; + readonly kind?: string; +}; + +// @public +export interface ReservationDetailsListResult { + readonly nextLink?: string; + readonly value?: ReservationDetail[]; +} + +// @public +export type ReservationRecommendation = Resource & ResourceAttributes & { + kind: ReservationRecommendationKind; +}; + +// @public +export interface ReservationRecommendationDetails { + get(scope: string, region: string, term: Term, lookBackPeriod: LookBackPeriod, product: string, options?: ReservationRecommendationDetailsGetOptionalParams): Promise; +} + +// @public +export interface ReservationRecommendationDetailsCalculatedSavingsProperties { + readonly onDemandCost?: number; + readonly overageCost?: number; + readonly quantity?: number; + readonly reservationCost?: number; + reservedUnitCount?: number; + readonly savings?: number; + readonly totalReservationCost?: number; +} + +// @public +export interface ReservationRecommendationDetailsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationRecommendationDetailsGetResponse = ReservationRecommendationDetailsModel; + +// @public +export type ReservationRecommendationDetailsModel = Resource & { + location?: string; + sku?: string; + readonly currency?: string; + readonly resource?: ReservationRecommendationDetailsResourceProperties; + readonly resourceGroup?: string; + readonly savings?: ReservationRecommendationDetailsSavingsProperties; + readonly scope?: string; + readonly usage?: ReservationRecommendationDetailsUsageProperties; +}; + +// @public +export interface ReservationRecommendationDetailsResourceProperties { + readonly appliedScopes?: string[]; + readonly onDemandRate?: number; + readonly product?: string; + readonly region?: string; + readonly reservationRate?: number; + readonly resourceType?: string; +} + +// @public +export interface ReservationRecommendationDetailsSavingsProperties { + calculatedSavings?: ReservationRecommendationDetailsCalculatedSavingsProperties[]; + readonly lookBackPeriod?: number; + readonly recommendedQuantity?: number; + readonly reservationOrderTerm?: string; + readonly savingsType?: string; + readonly unitOfMeasure?: string; +} + +// @public +export interface ReservationRecommendationDetailsUsageProperties { + readonly firstConsumptionDate?: string; + readonly lastConsumptionDate?: string; + readonly lookBackUnitType?: string; + readonly usageData?: number[]; + readonly usageGrain?: string; +} + +// @public +export type ReservationRecommendationKind = string; + +// @public +export interface ReservationRecommendations { + list(scope: string, options?: ReservationRecommendationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationRecommendationsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationRecommendationsListNextResponse = ReservationRecommendationsListResult; + +// @public +export interface ReservationRecommendationsListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationRecommendationsListResponse = ReservationRecommendationsListResult; + +// @public +export interface ReservationRecommendationsListResult { + readonly nextLink?: string; + readonly previousLink?: string; + readonly value?: ReservationRecommendationUnion[]; +} + +// @public (undocumented) +export type ReservationRecommendationUnion = ReservationRecommendation | LegacyReservationRecommendation | ModernReservationRecommendation; + +// @public +export interface ReservationsDetails { + list(scope: string, options?: ReservationsDetailsListOptionalParams): PagedAsyncIterableIterator; + listByReservationOrder(reservationOrderId: string, filter: string, options?: ReservationsDetailsListByReservationOrderOptionalParams): PagedAsyncIterableIterator; + listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, filter: string, options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationsDetailsListByReservationOrderAndReservationNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationsDetailsListByReservationOrderAndReservationNextResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListByReservationOrderAndReservationOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationsDetailsListByReservationOrderAndReservationResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListByReservationOrderNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationsDetailsListByReservationOrderNextResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListByReservationOrderOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationsDetailsListByReservationOrderResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListNextOptionalParams extends coreClient.OperationOptions { + endDate?: string; + filter?: string; + reservationId?: string; + reservationOrderId?: string; + startDate?: string; +} + +// @public +export type ReservationsDetailsListNextResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListOptionalParams extends coreClient.OperationOptions { + endDate?: string; + filter?: string; + reservationId?: string; + reservationOrderId?: string; + startDate?: string; +} + +// @public +export type ReservationsDetailsListResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsSummaries { + list(scope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams): PagedAsyncIterableIterator; + listByReservationOrder(reservationOrderId: string, grain: Datagrain, options?: ReservationsSummariesListByReservationOrderOptionalParams): PagedAsyncIterableIterator; + listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, grain: Datagrain, options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationsSummariesListByReservationOrderAndReservationNextResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListByReservationOrderAndReservationOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationsSummariesListByReservationOrderAndReservationResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListByReservationOrderNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationsSummariesListByReservationOrderNextResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListByReservationOrderOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationsSummariesListByReservationOrderResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListNextOptionalParams extends coreClient.OperationOptions { + endDate?: string; + filter?: string; + reservationId?: string; + reservationOrderId?: string; + startDate?: string; +} + +// @public +export type ReservationsSummariesListNextResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListOptionalParams extends coreClient.OperationOptions { + endDate?: string; + filter?: string; + reservationId?: string; + reservationOrderId?: string; + startDate?: string; +} + +// @public +export type ReservationsSummariesListResponse = ReservationSummariesListResult; + +// @public +export interface ReservationSummariesListResult { + readonly nextLink?: string; + readonly value?: ReservationSummary[]; +} + +// @public +export type ReservationSummary = 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; + readonly kind?: string; + readonly purchasedQuantity?: number; + readonly remainingQuantity?: number; + readonly totalReservedQuantity?: number; + readonly usedQuantity?: number; + readonly utilizedPercentage?: number; +}; + +// @public +export type ReservationTransaction = ReservationTransactionResource & { + readonly eventDate?: Date; + readonly reservationOrderId?: string; + readonly description?: string; + readonly eventType?: string; + readonly quantity?: number; + readonly amount?: number; + readonly currency?: string; + readonly reservationOrderName?: string; + readonly purchasingEnrollment?: string; + readonly purchasingSubscriptionGuid?: string; + readonly purchasingSubscriptionName?: string; + readonly armSkuName?: string; + readonly term?: string; + readonly region?: string; + readonly accountName?: string; + readonly accountOwnerEmail?: string; + readonly departmentName?: string; + readonly costCenter?: string; + readonly currentEnrollment?: string; + readonly billingFrequency?: string; + readonly billingMonth?: number; + readonly monetaryCommitment?: number; + readonly overage?: number; +}; + +// @public +export interface ReservationTransactionResource { + readonly id?: string; + readonly name?: string; + readonly tags?: string[]; + readonly type?: string; +} + +// @public +export interface ReservationTransactions { + list(billingAccountId: string, options?: ReservationTransactionsListOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountId: string, billingProfileId: string, options?: ReservationTransactionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationTransactionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationTransactionsListByBillingProfileNextResponse = ModernReservationTransactionsListResult; + +// @public +export interface ReservationTransactionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationTransactionsListByBillingProfileResponse = ModernReservationTransactionsListResult; + +// @public +export interface ReservationTransactionsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationTransactionsListNextResponse = ReservationTransactionsListResult; + +// @public +export interface ReservationTransactionsListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationTransactionsListResponse = ReservationTransactionsListResult; + +// @public +export interface ReservationTransactionsListResult { + readonly nextLink?: string; + readonly value?: ReservationTransaction[]; +} + +// @public +export interface Resource { + readonly etag?: string; + readonly id?: string; + readonly name?: string; + readonly tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ResourceAttributes { + readonly location?: string; + readonly sku?: string; +} + +// @public +export type Scope = string; + +// @public +export interface SkuProperty { + readonly name?: string; + readonly value?: string; +} + +// @public +export type Status = string; + +// @public +export interface Tag { + key?: string; + value?: string[]; +} + +// @public +export interface Tags { + get(scope: string, options?: TagsGetOptionalParams): Promise; +} + +// @public +export interface TagsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsGetResponse = TagsResult; + +// @public +export type TagsResult = ProxyResource & { + tags?: Tag[]; + readonly nextLink?: string; + readonly previousLink?: string; +}; + +// @public +export type Term = string; + +// @public +export type ThresholdType = string; + +// @public +export type TimeGrainType = string; + +// @public +export type UsageDetail = Resource & { + kind: UsageDetailsKind; +}; + +// @public +export interface UsageDetails { + list(scope: string, options?: UsageDetailsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type UsageDetailsKind = string; + +// @public +export interface UsageDetailsListNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + metric?: Metrictype; + skiptoken?: string; + top?: number; +} + +// @public +export type UsageDetailsListNextResponse = UsageDetailsListResult; + +// @public +export interface UsageDetailsListOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + metric?: Metrictype; + skiptoken?: string; + top?: number; +} + +// @public +export type UsageDetailsListResponse = UsageDetailsListResult; + +// @public +export interface UsageDetailsListResult { + readonly nextLink?: string; + readonly value?: UsageDetailUnion[]; +} + +// @public (undocumented) +export type UsageDetailUnion = UsageDetail | LegacyUsageDetail | ModernUsageDetail; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/consumption/arm-consumption/rollup.config.js b/sdk/consumption/arm-consumption/rollup.config.js index 9cdb9c96cbb5..9be1955eb7f1 100644 --- a/sdk/consumption/arm-consumption/rollup.config.js +++ b/sdk/consumption/arm-consumption/rollup.config.js @@ -1,31 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -/** - * @type {rollup.RollupFileOptions} - */ -const config = { - input: "./esm/consumptionManagementClient.js", - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-consumption.js", - format: "umd", - name: "Azure.ArmConsumption", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" - }, - banner: `/* +/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()] + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts index d9b9c1705ca0..10eb7bfa3ec8 100644 --- a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts +++ b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts @@ -3,74 +3,100 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; +import * as coreAuth from "@azure/core-auth"; +import { + UsageDetailsImpl, + MarketplacesImpl, + BudgetsImpl, + TagsImpl, + ChargesImpl, + BalancesImpl, + ReservationsSummariesImpl, + ReservationsDetailsImpl, + ReservationRecommendationsImpl, + ReservationRecommendationDetailsImpl, + ReservationTransactionsImpl, + PriceSheetImpl, + OperationsImpl, + AggregatedCostImpl, + EventsOperationsImpl, + LotsOperationsImpl, + CreditsImpl +} from "./operations"; +import { + UsageDetails, + Marketplaces, + Budgets, + Tags, + Charges, + Balances, + ReservationsSummaries, + ReservationsDetails, + ReservationRecommendations, + ReservationRecommendationDetails, + ReservationTransactions, + PriceSheet, + Operations, + AggregatedCost, + EventsOperations, + LotsOperations, + Credits +} from "./operationsInterfaces"; import { ConsumptionManagementClientContext } from "./consumptionManagementClientContext"; +import { ConsumptionManagementClientOptionalParams } from "./models"; -class ConsumptionManagementClient extends ConsumptionManagementClientContext { - // 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; - tenants: operations.Tenants; - +export class ConsumptionManagementClient extends ConsumptionManagementClientContext { /** * Initializes a new instance of the ConsumptionManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Azure Subscription ID. - * @param [options] The parameter options + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: Models.ConsumptionManagementClientOptions + options?: ConsumptionManagementClientOptionalParams ) { super(credentials, subscriptionId, options); - 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.tenants = new operations.Tenants(this); + this.usageDetails = new UsageDetailsImpl(this); + this.marketplaces = new MarketplacesImpl(this); + this.budgets = new BudgetsImpl(this); + this.tags = new TagsImpl(this); + this.charges = new ChargesImpl(this); + this.balances = new BalancesImpl(this); + this.reservationsSummaries = new ReservationsSummariesImpl(this); + this.reservationsDetails = new ReservationsDetailsImpl(this); + this.reservationRecommendations = new ReservationRecommendationsImpl(this); + this.reservationRecommendationDetails = new ReservationRecommendationDetailsImpl( + this + ); + this.reservationTransactions = new ReservationTransactionsImpl(this); + this.priceSheet = new PriceSheetImpl(this); + this.operations = new OperationsImpl(this); + this.aggregatedCost = new AggregatedCostImpl(this); + this.eventsOperations = new EventsOperationsImpl(this); + this.lotsOperations = new LotsOperationsImpl(this); + this.credits = new CreditsImpl(this); } -} -// Operation Specifications - -export { - ConsumptionManagementClient, - ConsumptionManagementClientContext, - Models as ConsumptionManagementModels, - Mappers as ConsumptionManagementMappers -}; -export * from "./operations"; + usageDetails: UsageDetails; + marketplaces: Marketplaces; + budgets: Budgets; + tags: Tags; + charges: Charges; + balances: Balances; + reservationsSummaries: ReservationsSummaries; + reservationsDetails: ReservationsDetails; + reservationRecommendations: ReservationRecommendations; + reservationRecommendationDetails: ReservationRecommendationDetails; + reservationTransactions: ReservationTransactions; + priceSheet: PriceSheet; + operations: Operations; + aggregatedCost: AggregatedCost; + eventsOperations: EventsOperations; + lotsOperations: LotsOperations; + credits: Credits; +} diff --git a/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts b/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts index 072c5c28af97..2bdc0c9c9dc3 100644 --- a/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts +++ b/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts @@ -3,72 +3,68 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { ConsumptionManagementClientOptionalParams } from "./models"; -const packageName = "@azure/arm-consumption"; -const packageVersion = "7.1.0"; - -export class ConsumptionManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - apiVersion?: string; +export class ConsumptionManagementClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; subscriptionId: string; /** - * Initializes a new instance of the ConsumptionManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * Initializes a new instance of the ConsumptionManagementClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Azure Subscription ID. - * @param [options] The parameter options + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: Models.ConsumptionManagementClientOptions + options?: ConsumptionManagementClientOptionalParams ) { - if (credentials == undefined) { - throw new Error("'credentials' cannot be null."); + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); } - if (subscriptionId == undefined) { - throw new Error("'subscriptionId' cannot be null."); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); } + // Initializing default values for options if (!options) { options = {}; } - if (!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } + const defaults: ConsumptionManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; - super(credentials, options); + const packageDetails = `azsdk-js-arm-consumption/9.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; - this.apiVersion = "2018-10-01"; - this.acceptLanguage = "en-US"; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments this.subscriptionId = subscriptionId; - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if ( - options.longRunningOperationRetryTimeout !== null && - options.longRunningOperationRetryTimeout !== undefined - ) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-10-01"; } } diff --git a/sdk/consumption/arm-consumption/src/index.ts b/sdk/consumption/arm-consumption/src/index.ts new file mode 100644 index 000000000000..85be07789c30 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { ConsumptionManagementClient } from "./consumptionManagementClient"; +export { ConsumptionManagementClientContext } from "./consumptionManagementClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts b/sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts deleted file mode 100644 index 70a8fb00f854..000000000000 --- a/sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/balancesMappers.ts b/sdk/consumption/arm-consumption/src/models/balancesMappers.ts deleted file mode 100644 index 70a8fb00f854..000000000000 --- a/sdk/consumption/arm-consumption/src/models/balancesMappers.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/budgetsMappers.ts b/sdk/consumption/arm-consumption/src/models/budgetsMappers.ts deleted file mode 100644 index fb151b3d3890..000000000000 --- a/sdk/consumption/arm-consumption/src/models/budgetsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetsListResult, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/chargesMappers.ts b/sdk/consumption/arm-consumption/src/models/chargesMappers.ts deleted file mode 100644 index fc3a7b3f6d3b..000000000000 --- a/sdk/consumption/arm-consumption/src/models/chargesMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargesListResult, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/forecastsMappers.ts b/sdk/consumption/arm-consumption/src/models/forecastsMappers.ts deleted file mode 100644 index 6ad088786be4..000000000000 --- a/sdk/consumption/arm-consumption/src/models/forecastsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ForecastsListResult, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/index.ts b/sdk/consumption/arm-consumption/src/models/index.ts index 452029932107..3a01d3d767f3 100644 --- a/sdk/consumption/arm-consumption/src/models/index.ts +++ b/sdk/consumption/arm-consumption/src/models/index.ts @@ -6,4129 +6,3522 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +export type UsageDetailUnion = + | UsageDetail + | LegacyUsageDetail + | ModernUsageDetail; +export type ReservationRecommendationUnion = + | ReservationRecommendation + | LegacyReservationRecommendation + | ModernReservationRecommendation; +export type ChargeSummaryUnion = + | ChargeSummary + | LegacyChargeSummary + | ModernChargeSummary; -/** - * The properties of the meter detail. - */ -export interface MeterDetails { - /** - * The name of the meter, within the given meter category - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterName?: string; - /** - * The category of the meter, for example, 'Cloud services', 'Networking', etc.. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterCategory?: string; - /** - * The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterSubCategory?: string; - /** - * The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly unit?: string; - /** - * The location in which the Azure service is available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterLocation?: string; - /** - * The total included quantity associated with the offer. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalIncludedQuantity?: number; - /** - * The pretax listing price. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly pretaxStandardRate?: number; +/** Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing period. */ +export interface UsageDetailsListResult { /** - * The name of the service. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of usage details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly serviceName?: string; + readonly value?: UsageDetailUnion[]; /** - * The service tier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly serviceTier?: string; + readonly nextLink?: string; } -/** - * The Resource model definition. - */ -export interface Resource extends BaseResource { +/** The Resource model definition. */ +export interface Resource { /** - * Resource Id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The full qualified ARM ID of an event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * Resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ID that uniquely identifies an event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** + * The etag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; /** * Resource tags. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tags?: { [propertyName: string]: string }; } /** - * An usage detail resource. + * Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + * + * Some Error responses: + * + * * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + * + * * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. */ -export interface UsageDetail extends Resource { +export interface ErrorResponse { + /** The details of the error. */ + error?: ErrorDetails; +} + +/** The details of the error. */ +export interface ErrorDetails { /** - * The id of the billing period resource that the usage belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodId?: string; + readonly code?: string; /** - * The id of the invoice resource that the usage belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceId?: string; + readonly message?: string; +} + +/** Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing period. */ +export interface MarketplacesListResult { /** - * The start of the date time range covered by the usage detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of marketplaces. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageStart?: Date; + readonly value?: Marketplace[]; /** - * The end of the date time range covered by the usage detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageEnd?: Date; + readonly nextLink?: string; +} + +/** Result of listing budgets. It contains a list of available budgets in the scope provided. */ +export interface BudgetsListResult { /** - * The name of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of budgets. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceName?: string; + readonly value?: Budget[]; /** - * The uri of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceId?: string; + readonly nextLink?: string; +} + +/** The Resource model definition. */ +export interface ProxyResource { /** - * The location of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceLocation?: string; + readonly id?: string; /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly name?: string; /** - * The quantity of usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageQuantity?: number; + 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; +} + +/** The start and end date for a budget. */ +export interface BudgetTimePeriod { + /** The start date for the budget. */ + startDate: Date; + /** The end date for the budget. If not provided, we default this to 10 years from the start date. */ + endDate?: Date; +} + +/** May be used to filter budgets by resource group, resource, or meter. */ +export interface BudgetFilter { + /** The logical "AND" expression. Must have at least 2 items. */ + and?: BudgetFilterProperties[]; + /** The logical "NOT" expression. */ + not?: BudgetFilterProperties; + /** Has comparison expression for a dimension */ + dimensions?: BudgetComparisonExpression; + /** Has comparison expression for a tag */ + tags?: BudgetComparisonExpression; +} + +/** The Dimensions or Tags to filter a budget by. */ +export interface BudgetFilterProperties { + /** Has comparison expression for a dimension */ + dimensions?: BudgetComparisonExpression; + /** Has comparison expression for a tag */ + tags?: BudgetComparisonExpression; +} + +/** The comparison expression to be used in the budgets. */ +export interface BudgetComparisonExpression { + /** The name of the column to use in comparison. */ + name: string; + /** The operator to use for comparison. */ + operator: BudgetOperatorType; + /** Array of values to use for comparison */ + values: string[]; +} + +/** The current amount of cost which is being tracked for a budget. */ +export interface CurrentSpend { /** - * The billable usage quantity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The total amount of cost which is being tracked by the budget. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billableQuantity?: number; + readonly amount?: number; /** - * The amount of cost before tax. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unit of measure for the budget amount. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly pretaxCost?: number; + readonly unit?: string; +} + +/** The notification associated with a budget. */ +export interface Notification { + /** The notification is enabled or not. */ + enabled: boolean; + /** The comparison operator. */ + operator: OperatorType; + /** 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. */ + threshold: number; + /** Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified. */ + contactEmails: string[]; + /** Contact roles to send the budget notification to when the threshold is exceeded. */ + contactRoles?: string[]; + /** Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes. */ + contactGroups?: string[]; + /** The type of threshold */ + thresholdType?: ThresholdType; + /** Language in which the recipient will receive the notification */ + locale?: CultureCode; +} + +/** The forecasted cost which is being tracked for a budget. */ +export interface ForecastSpend { /** - * The estimated usage is subject to change. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the budget contains a forecast alert type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isEstimated?: boolean; + readonly amount?: number; /** - * The meter id (GUID). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unit of measure for the budget amount. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterId?: string; + readonly unit?: string; +} + +/** The tag resource. */ +export interface Tag { + /** Tag key. */ + key?: string; + /** Tag values. */ + value?: string[]; +} + +/** Result of listing charge summary. */ +export interface ChargesListResult { /** - * The details about the meter. By default this is not populated, unless it's specified in - * $expand. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of charge summary + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterDetails?: MeterDetails; + readonly value?: ChargeSummaryUnion[]; +} + +export interface BalancePropertiesNewPurchasesDetailsItem { /** - * Subscription guid. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the name of new purchase. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionGuid?: string; + readonly name?: string; /** - * Subscription name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the value of new purchase. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionName?: string; + readonly value?: number; +} + +export interface BalancePropertiesAdjustmentDetailsItem { /** - * Account name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the name of new adjustment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountName?: string; + readonly name?: string; /** - * Department name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the value of new adjustment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly departmentName?: string; + readonly value?: number; +} + +/** Result of listing reservation summaries. */ +export interface ReservationSummariesListResult { /** - * Product name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation summaries. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly product?: string; + readonly value?: ReservationSummary[]; /** - * Consumed service name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly consumedService?: string; + readonly nextLink?: string; +} + +/** Result of listing reservation details. */ +export interface ReservationDetailsListResult { /** - * The cost center of this department if it is a department and a costcenter exists - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly costCenter?: string; + readonly value?: ReservationDetail[]; /** - * Part Number - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly partNumber?: string; + readonly nextLink?: string; +} + +/** Result of listing reservation recommendations. */ +export interface ReservationRecommendationsListResult { /** - * Resource Guid - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation recommendations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceGuid?: string; + readonly value?: ReservationRecommendationUnion[]; /** - * Offer Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offerId?: string; + readonly nextLink?: string; /** - * Charges billed separately - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the previous page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly chargesBilledSeparately?: boolean; + readonly previousLink?: string; +} + +/** The Resource model definition. */ +export interface ResourceAttributes { /** - * Resource Location - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource location + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly location?: string; /** - * Additional details of this usage item. By default this is not populated, unless it's specified - * in $expand. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource sku + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalProperties?: string; + readonly sku?: string; } -/** - * An marketplace resource. - */ -export interface Marketplace extends Resource { - /** - * The id of the billing period resource that the usage belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly billingPeriodId?: string; +/** Details of the resource. */ +export interface ReservationRecommendationDetailsResourceProperties { /** - * The start of the date time range covered by the usage detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of subscriptions for which the reservation is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageStart?: Date; + readonly appliedScopes?: string[]; /** - * The end of the date time range covered by the usage detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * On demand rate of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageEnd?: Date; + readonly onDemandRate?: number; /** - * The marketplace resource rate. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Azure product ex: Standard_E8s_v3 etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceRate?: number; + readonly product?: string; /** - * The type of offer. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Azure resource region ex:EastUS, WestUS etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offerName?: string; + readonly region?: string; /** - * The name of resource group. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Reservation rate of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceGroup?: string; + readonly reservationRate?: number; /** - * The order number. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The azure resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly orderNumber?: string; + readonly resourceType?: string; +} + +/** Details of the estimated savings. */ +export interface ReservationRecommendationDetailsSavingsProperties { + /** List of calculated savings. */ + calculatedSavings?: ReservationRecommendationDetailsCalculatedSavingsProperties[]; /** - * The name of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Number of days of usage to look back used for computing the recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceName?: string; + readonly lookBackPeriod?: number; /** - * The uri of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Number of recommended units of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceId?: string; + readonly recommendedQuantity?: number; /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Term period of the reservation, ex: P1Y or P3Y. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly reservationOrderTerm?: string; /** - * The quantity of usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Type of savings, ex: instance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly consumedQuantity?: number; + readonly savingsType?: string; /** - * The unit of measure. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Measurement unit ex: hour etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly unitOfMeasure?: string; +} + +/** Details of estimated savings. */ +export interface ReservationRecommendationDetailsCalculatedSavingsProperties { /** - * The amount of cost before tax. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly pretaxCost?: number; - /** - * The estimated usage is subject to change. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly isEstimated?: boolean; - /** - * The meter id (GUID). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The cost without reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterId?: string; + readonly onDemandCost?: number; /** - * Subscription guid. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The difference between total reservation cost and reservation cost. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionGuid?: string; + readonly overageCost?: number; /** - * Subscription name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The quantity for calculated savings. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionName?: string; + readonly quantity?: number; /** - * Account name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The exact cost of the estimated usage using reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountName?: string; + readonly reservationCost?: number; /** - * Department name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The cost of the suggested quantity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly departmentName?: string; + readonly totalReservationCost?: number; + /** The number of reserved units used to calculate savings. Always 1 for virtual machines. */ + reservedUnitCount?: number; /** - * Consumed service name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The amount saved by purchasing the recommended quantity of reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly consumedService?: string; + readonly savings?: number; +} + +/** Details about historical usage data that has been used for computing the recommendation. */ +export interface ReservationRecommendationDetailsUsageProperties { /** - * The cost center of this department if it is a department and a costcenter exists - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The first usage date used for looking back for computing the recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly costCenter?: string; + readonly firstConsumptionDate?: string; /** - * Additional details of this usage item. By default this is not populated, unless it's specified - * in $expand. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The last usage date used for looking back for computing the recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalProperties?: string; + readonly lastConsumptionDate?: string; /** - * The name of publisher. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * What the usage data values represent ex: virtual machine instance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly publisherName?: string; + readonly lookBackUnitType?: string; /** - * The name of plan. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and the lastConsumptionDate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly planName?: string; + readonly usageData?: number[]; /** - * Flag indicating whether this is a recurring charge or not. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The grain of the values represented in the usage data ex: hourly. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isRecurringCharge?: boolean; + readonly usageGrain?: string; } /** - * An tenant detail resource. + * Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + * + * Some Error responses: + * + * * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + * + * * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. */ -export interface Tenant extends Resource { +export interface HighCasedErrorResponse { + /** The details of the error. */ + error?: HighCasedErrorDetails; +} + +/** The details of the error. */ +export interface HighCasedErrorDetails { /** - * The Billing Profile name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileName?: string; + readonly code?: string; /** - * The Billing AccountId. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingAccountId?: string; - /** - * The TenantId. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tenantId?: string; - /** - * The Billing Account Name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly billingAccountName?: string; + readonly message?: string; } -/** - * A Tenant properties Resource - */ -export interface TenantListResult { +/** Result of listing reservation recommendations. */ +export interface ReservationTransactionsListResult { /** - * The list of tenant details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation recommendations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Tenant[]; + readonly value?: ReservationTransaction[]; /** * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nextLink?: string; } -/** - * An interface representing BalancePropertiesNewPurchasesDetailsItem. - */ -export interface BalancePropertiesNewPurchasesDetailsItem { +/** The Resource model definition. */ +export interface ReservationTransactionResource { /** - * the name of new purchase. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly id?: string; /** - * the value of new purchase. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: number; -} - -/** - * An interface representing BalancePropertiesAdjustmentDetailsItem. - */ -export interface BalancePropertiesAdjustmentDetailsItem { + readonly name?: string; /** - * the name of new adjustment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly type?: string; /** - * the value of new adjustment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource tags. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: number; + readonly tags?: string[]; } -/** - * A balance resource. - */ -export interface Balance extends Resource { - /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly currency?: string; - /** - * The beginning balance for the billing period. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly beginningBalance?: number; - /** - * The ending balance for the billing period (for open periods this will be updated daily). - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly endingBalance?: number; - /** - * Total new purchase amount. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly newPurchases?: number; +/** Result of listing reservation recommendations. */ +export interface ModernReservationTransactionsListResult { /** - * Total adjustment amount. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation recommendations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly adjustments?: number; + readonly value?: ModernReservationTransaction[]; /** - * Total Commitment usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly utilized?: number; + readonly nextLink?: string; +} + +/** The properties of the price sheet. */ +export interface PriceSheetProperties { /** - * Overage for Azure services. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The id of the billing period resource that the usage belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly serviceOverage?: number; + readonly billingPeriodId?: string; /** - * Charges Billed separately. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The meter id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly chargesBilledSeparately?: number; + readonly meterId?: string; /** - * serviceOverage + chargesBilledSeparately. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The details about the meter. By default this is not populated, unless it's specified in $expand. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalOverage?: number; + readonly meterDetails?: MeterDetails; /** - * Azure service commitment + total Overage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unit of measure + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalUsage?: number; + readonly unitOfMeasure?: string; /** - * Total charges for Azure Marketplace. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Included quality for an offer + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azureMarketplaceServiceCharges?: number; + readonly includedQuantity?: number; /** - * The billing frequency. Possible values include: 'Month', 'Quarter', 'Year' + * Part Number + * NOTE: This property will not be serialized. It can only be populated by the server. */ - billingFrequency?: BillingFrequency; + readonly partNumber?: string; /** - * Price is hidden or not. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unit Price + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly priceHidden?: boolean; + readonly unitPrice?: number; /** - * List of new purchases. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Currency Code + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly newPurchasesDetails?: BalancePropertiesNewPurchasesDetailsItem[]; + readonly currencyCode?: string; /** - * List of Adjustments (Promo credit, SIE credit etc.). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Offer Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly adjustmentDetails?: BalancePropertiesAdjustmentDetailsItem[]; + readonly offerId?: string; } -/** - * reservation summary resource. - */ -export interface ReservationSummary extends Resource { +/** The properties of the meter detail. */ +export interface MeterDetails { /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the meter, within the given meter category + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservationOrderId?: string; + readonly meterName?: string; /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The category of the meter, for example, 'Cloud services', 'Networking', etc.. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservationId?: string; + readonly meterCategory?: string; /** - * This is the ARM Sku name. It can be used to join with the serviceType field in additional info - * in usage records. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuName?: string; + readonly meterSubCategory?: string; /** - * 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 - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservedHours?: number; + readonly unit?: string; /** - * Data corresponding to the utilization record. If the grain of data is monthly, it will be - * first day of month. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The location in which the Azure service is available. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageDate?: Date; + readonly meterLocation?: string; /** - * Total used hours by the reservation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The total included quantity associated with the offer. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usedHours?: number; + readonly totalIncludedQuantity?: number; /** - * 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 - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The pretax listing price. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly minUtilizationPercentage?: number; + readonly pretaxStandardRate?: number; /** - * This is average utilization for the entire time range. (day or month depending on the grain) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the service. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly avgUtilizationPercentage?: number; + readonly serviceName?: string; /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The service tier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly maxUtilizationPercentage?: number; + readonly serviceTier?: string; } -/** - * reservation detail resource. - */ -export interface ReservationDetail extends Resource { +/** 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 { /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of consumption operations supported by the Microsoft.Consumption resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservationOrderId?: string; + readonly value?: Operation[]; /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * URL to get the next set of operation list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservationId?: string; + readonly nextLink?: string; +} + +/** A Consumption REST API operation. */ +export interface Operation { /** - * This is the ARM Sku name. It can be used to join with the serviceType field in additional info - * in usage records. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Operation Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuName?: string; + readonly id?: string; /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Operation name: {provider}/{resource}/{operation}. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservedHours?: number; + readonly name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; +} + +/** The object that represents the operation. */ +export interface OperationDisplay { /** - * The date on which consumption occurred. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Service provider: Microsoft.Consumption. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageDate?: Date; + readonly provider?: string; /** - * This is the total hours used by the instance. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource on which the operation is performed: UsageDetail, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usedHours?: number; + readonly resource?: string; /** - * This identifier is the name of the resource or the fully qualified Resource ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Operation type: Read, write, delete, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceId?: string; + readonly operation?: string; /** - * This is the total count of instances that are reserved for the reservationId. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Description of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalReservedQuantity?: number; + readonly description?: string; } -/** - * Reservation recommendation resource. - */ -export interface ReservationRecommendation { +/** Result of listing event summary. */ +export interface Events { /** - * Resource Id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of event summary. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly value?: EventSummary[]; /** - * Resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly nextLink?: string; +} + +/** The amount plus currency . */ +export interface Amount { /** - * Resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Amount currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly currency?: string; /** - * Resource tags. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Amount. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly tags?: { [propertyName: string]: string }; + readonly value?: number; +} + +/** The reseller properties. */ +export interface Reseller { /** - * Resource location - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The reseller property ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly location?: string; + readonly resellerId?: string; /** - * Resource sku - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The reseller property description. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sku?: string; + readonly resellerDescription?: string; +} + +/** Result of listing lot summary. */ +export interface Lots { /** - * The number of days of usage to look back for recommendation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of lot summary. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lookBackPeriod?: string; + readonly value?: LotSummary[]; /** - * The meter id (GUID) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterId?: string; + readonly nextLink?: string; +} + +/** Summary of credit balances. */ +export interface CreditBalanceSummary { /** - * RI recommendations in one or three year terms. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Estimated balance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly term?: string; + readonly estimatedBalance?: Amount; /** - * The total amount of cost without reserved instances. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current balance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly costWithNoReservedInstances?: number; + readonly currentBalance?: Amount; /** - * Recommended quality for reserved instances. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Estimated balance in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly recommendedQuantity?: number; + readonly estimatedBalanceInBillingCurrency?: AmountWithExchangeRate; +} + +/** The properties of the meter detail. */ +export interface MeterDetailsResponse { /** - * The total amount of cost with reserved instances. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the meter, within the given meter category + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalCostWithReservedInstances?: number; + readonly meterName?: string; /** - * Total estimated savings with reserved instances. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The category of the meter, for example, 'Cloud services', 'Networking', etc.. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly netSavings?: number; + readonly meterCategory?: string; /** - * The usage date for looking back. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly firstUsageDate?: Date; + readonly meterSubCategory?: string; /** - * Shared or single recommendation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scope?: string; -} - -/** - * The tag resource. - */ -export interface Tag { + readonly unitOfMeasure?: string; /** - * Tag key. + * The service family. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - key?: string; + readonly serviceFamily?: string; } -/** - * The Resource model definition. - */ -export interface ProxyResource extends BaseResource { - /** - * Resource Id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; +/** The Sku property */ +export interface SkuProperty { /** - * Resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of sku property. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * Resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - 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; -} - -/** - * A resource listing all tags. - */ -export interface TagsResult extends ProxyResource { - /** - * A list of Tag. + * The value of sku property. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: Tag[]; + readonly value?: string; } -/** - * The start and end date for a budget. - */ -export interface BudgetTimePeriod { +/** The properties of the price sheet download. */ +export interface DownloadProperties { /** - * The start date for the budget. + * The link (url) to download the pricesheet. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - startDate: Date; + readonly downloadUrl?: string; /** - * The end date for the budget. If not provided, we default this to 10 years from the start date. + * Download link validity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - endDate?: Date; + readonly validTill?: string; } -/** - * May be used to filter budgets by resource group, resource, or meter. - */ -export interface Filters { +/** An usage detail resource. */ +export type UsageDetail = Resource & { + /** Specifies the kind of usage details. */ + kind: UsageDetailsKind; +}; + +/** A marketplace resource. */ +export type Marketplace = Resource & { /** - * The list of filters on resource groups, allowed at subscription level only. + * The id of the billing period resource that the usage belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceGroups?: string[]; + readonly billingPeriodId?: string; /** - * The list of filters on resources. + * The start of the date time range covered by the usage detail. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resources?: string[]; + readonly usageStart?: Date; /** - * The list of filters on meters (GUID), mandatory for budgets of usage category. + * The end of the date time range covered by the usage detail. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - meters?: string[]; + readonly usageEnd?: Date; /** - * The dictionary of filters on tags. + * The marketplace resource rate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string[] }; -} - -/** - * The current amount of cost which is being tracked for a budget. - */ -export interface CurrentSpend { + readonly resourceRate?: number; /** - * The total amount of cost which is being tracked by the budget. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of offer. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly amount?: number; + readonly offerName?: string; /** - * The unit of measure for the budget amount. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of resource group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unit?: string; -} - -/** - * The notification associated with a budget. - */ -export interface Notification { + readonly resourceGroup?: string; /** - * The notification is enabled or not. + * Additional information. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enabled: boolean; + readonly additionalInfo?: string; /** - * The comparison operator. Possible values include: 'EqualTo', 'GreaterThan', - * 'GreaterThanOrEqualTo' + * The order number. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operator: OperatorType; + readonly orderNumber?: string; /** - * 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. + * The name of the resource instance that the usage is about. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - threshold: number; + readonly instanceName?: string; /** - * Email addresses to send the budget notification to when the threshold is exceeded. + * The uri of the resource instance that the usage is about. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactEmails: string[]; + readonly instanceId?: string; /** - * Contact roles to send the budget notification to when the threshold is exceeded. + * The ISO currency in which the meter is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactRoles?: string[]; + readonly currency?: string; /** - * Action groups to send the budget notification to when the threshold is exceeded. + * The quantity of usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactGroups?: string[]; -} - -/** - * A budget resource. - */ -export interface Budget extends ProxyResource { + readonly consumedQuantity?: number; /** - * The category of the budget, whether the budget tracks cost or usage. Possible values include: - * 'Cost', 'Usage' + * The unit of measure. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - category: CategoryType; + readonly unitOfMeasure?: string; /** - * The total amount of cost to track with the budget + * The amount of cost before tax. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - amount: number; + readonly pretaxCost?: number; /** - * The time covered by a budget. Tracking of the amount will be reset based on the time grain. - * Possible values include: 'Monthly', 'Quarterly', 'Annually' + * The estimated usage is subject to change. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timeGrain: TimeGrainType; + readonly isEstimated?: boolean; /** - * 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 - * period. There are no restrictions on the end date. + * The meter id (GUID). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timePeriod: BudgetTimePeriod; + readonly meterId?: string; /** - * May be used to filter budgets by resource group, resource, or meter. + * Subscription guid. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filters?: Filters; + readonly subscriptionGuid?: string; /** - * The current amount of cost which is being tracked for a budget. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Subscription name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currentSpend?: CurrentSpend; + readonly subscriptionName?: string; /** - * Dictionary of notifications associated with the budget. Budget can have up to five - * notifications. + * Account name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - notifications?: { [propertyName: string]: Notification }; -} - -/** - * The properties of the price sheet. - */ -export interface PriceSheetProperties { + readonly accountName?: string; /** - * The id of the billing period resource that the usage belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Department name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodId?: string; + readonly departmentName?: string; /** - * The meter id (GUID) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Consumed service name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterId?: string; + readonly consumedService?: string; /** - * The details about the meter. By default this is not populated, unless it's specified in - * $expand. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The cost center of this department if it is a department and a costcenter exists + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterDetails?: MeterDetails; + readonly costCenter?: string; /** - * Unit of measure - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unitOfMeasure?: string; + readonly additionalProperties?: string; /** - * Included quality for an offer - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of publisher. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly includedQuantity?: number; + readonly publisherName?: string; /** - * Part Number - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of plan. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly partNumber?: string; + readonly planName?: string; /** - * Unit Price - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Flag indicating whether this is a recurring charge or not. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unitPrice?: number; + readonly isRecurringCharge?: boolean; +}; + +/** A balance resource. */ +export type Balance = Resource & { /** - * Currency Code - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ISO currency in which the meter is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currencyCode?: string; + readonly currency?: string; /** - * Offer Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The beginning balance for the billing period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offerId?: string; -} - -/** - * An pricesheet resource. - */ -export interface PriceSheetResult extends Resource { + readonly beginningBalance?: number; /** - * Price sheet - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ending balance for the billing period (for open periods this will be updated daily). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly pricesheets?: PriceSheetProperties[]; + readonly endingBalance?: number; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Total new purchase amount. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * An interface representing ForecastPropertiesConfidenceLevelsItem. - */ -export interface ForecastPropertiesConfidenceLevelsItem { + readonly newPurchases?: number; + /** + * Total adjustment amount. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly adjustments?: number; /** - * The percentage level of the confidence - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Total Commitment usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly percentage?: number; + readonly utilized?: number; /** - * The boundary of the percentage, values could be 'Upper' or 'Lower'. Possible values include: - * 'Upper', 'Lower' + * Overage for Azure services. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - bound?: Bound; + readonly serviceOverage?: number; /** - * The amount of forecast within the percentage level - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Charges Billed separately. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: number; -} - -/** - * A forecast resource. - */ -export interface Forecast extends Resource { + readonly chargesBilledSeparately?: number; /** - * The usage date of the forecast. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * serviceOverage + chargesBilledSeparately. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageDate?: string; + readonly totalOverage?: number; /** - * The granularity of forecast. Possible values include: 'Daily', 'Monthly', 'Yearly' + * Azure service commitment + total Overage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - grain?: Grain; + readonly totalUsage?: number; /** - * The amount of charge - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Total charges for Azure Marketplace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly charge?: number; + readonly azureMarketplaceServiceCharges?: number; + /** The billing frequency. */ + billingFrequency?: BillingFrequency; /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Price is hidden or not. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly priceHidden?: boolean; /** - * The type of the charge. Could be actual or forecast. Possible values include: 'Actual', - * 'Forecast' + * List of new purchases. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - chargeType?: ChargeType; + readonly newPurchasesDetails?: BalancePropertiesNewPurchasesDetailsItem[]; /** - * The details about the forecast confidence levels. This is populated only when chargeType is - * Forecast. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of Adjustments (Promo credit, SIE credit etc.). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly confidenceLevels?: ForecastPropertiesConfidenceLevelsItem[]; -} + readonly adjustmentDetails?: BalancePropertiesAdjustmentDetailsItem[]; +}; -/** - * A management group aggregated cost resource. - */ -export interface ManagementGroupAggregatedCostResult extends Resource { +/** reservation summary resource. */ +export type ReservationSummary = Resource & { /** - * The id of the billing period resource that the aggregated cost belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodId?: string; + readonly reservationOrderId?: string; /** - * The start of the date time range covered by aggregated cost. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageStart?: Date; + readonly reservationId?: string; /** - * The end of the date time range covered by the aggregated cost. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageEnd?: Date; + readonly skuName?: string; /** - * Azure Charges. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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 + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azureCharges?: number; + readonly reservedHours?: number; /** - * Marketplace Charges. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly marketplaceCharges?: number; + readonly usageDate?: Date; /** - * Charges Billed Separately. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Total used hours by the reservation + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly chargesBilledSeparately?: number; + readonly usedHours?: number; /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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 + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly minUtilizationPercentage?: number; /** - * Children of a management group + * This is average utilization for the entire time range. (day or month depending on the grain) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - children?: ManagementGroupAggregatedCostResult[]; + readonly avgUtilizationPercentage?: number; /** - * List of subscription Guids included in the calculation of aggregated cost + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - includedSubscriptions?: string[]; + readonly maxUtilizationPercentage?: number; /** - * List of subscription Guids excluded from the calculation of aggregated cost + * The reservation kind. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - excludedSubscriptions?: string[]; -} - -/** - * A charge summary resource. - */ -export interface ChargeSummary extends Resource { + readonly kind?: string; /** - * The id of the billing period resource that the charge belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the purchased quantity for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodId?: string; + readonly purchasedQuantity?: number; /** - * Usage start date. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the remaining quantity for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageStart?: string; + readonly remainingQuantity?: number; /** - * Usage end date. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the total count of instances that are reserved for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageEnd?: string; + readonly totalReservedQuantity?: number; /** - * Azure Charges. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the used quantity for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azureCharges?: number; + readonly usedQuantity?: number; /** - * Charges Billed separately. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the utilized percentage for the reservation Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly chargesBilledSeparately?: number; + readonly utilizedPercentage?: number; +}; + +/** reservation detail resource. */ +export type ReservationDetail = Resource & { /** - * Marketplace Charges. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly marketplaceCharges?: number; + readonly reservationOrderId?: string; /** - * Currency Code - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The instance Flexibility Ratio. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; -} - -/** - * Result of listing charge summary. - */ -export interface ChargesListResult { + readonly instanceFlexibilityRatio?: string; /** - * The list of charge summary - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The instance Flexibility Group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: ChargeSummary[]; -} - -/** - * The details of the error. - */ -export interface ErrorDetails { + readonly instanceFlexibilityGroup?: string; /** - * Error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly reservationId?: string; /** - * Error message indicating why the operation failed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; -} - -/** - * Error response indicates that the service is not able to process the incoming request. The - * reason is provided in the error message. - */ -export interface ErrorResponse { + readonly skuName?: string; /** - * The details of the error. + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - error?: ErrorDetails; -} - -/** - * The object that represents the operation. - */ -export interface OperationDisplay { + readonly reservedHours?: number; /** - * Service provider: Microsoft.Consumption. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The date on which consumption occurred. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provider?: string; + readonly usageDate?: Date; /** - * Resource on which the operation is performed: UsageDetail, etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the total hours used by the instance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resource?: string; + readonly usedHours?: number; /** - * Operation type: Read, write, delete, etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This identifier is the name of the resource or the fully qualified Resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; -} - -/** - * A Consumption REST API operation. - */ -export interface Operation { + readonly instanceId?: string; /** - * Operation name: {provider}/{resource}/{operation}. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the total count of instances that are reserved for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly totalReservedQuantity?: number; /** - * The object that represents the operation. + * The reservation kind. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; -} + readonly kind?: string; +}; -/** - * The Resource model definition. - */ -export interface ResourceAttributes { +/** A reservation recommendation resource. */ +export type ReservationRecommendation = Resource & + ResourceAttributes & { + /** Specifies the kind of reservation recommendation. */ + kind: ReservationRecommendationKind; + }; + +/** Reservation recommendation details. */ +export type ReservationRecommendationDetailsModel = Resource & { + /** Resource Location. */ + location?: string; + /** Resource sku */ + sku?: string; /** - * Resource location - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * An ISO 4217 currency code identifier for the costs and savings + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly location?: string; + readonly currency?: string; /** - * Resource sku - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource specific properties. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sku?: string; -} - -/** - * Additional parameters for a set of operations. - */ -export interface QueryOptions { + readonly resource?: ReservationRecommendationDetailsResourceProperties; /** - * OData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) + * Resource Group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - apply?: string; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListOptionalParams extends msRest.RequestOptionsBase { + readonly resourceGroup?: string; /** - * 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. + * Savings information for the recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly savings?: ReservationRecommendationDetailsSavingsProperties; /** - * 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 (:). + * Scope of the reservation, ex: Single or Shared. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly scope?: string; /** - * 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. + * Historical usage details used to calculate the estimated savings. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly usage?: ReservationRecommendationDetailsUsageProperties; +}; + +/** An pricesheet resource. */ +export type PriceSheetResult = Resource & { /** - * May be used to limit the number of results to the most recent N usageDetails. + * Price sheet + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly pricesheets?: PriceSheetProperties[]; /** - * Additional parameters for the operation + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} + readonly nextLink?: string; + /** + * Pricesheet download details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly download?: MeterDetails; +}; -/** - * Optional Parameters. - */ -export interface UsageDetailsListByBillingPeriodOptionalParams extends msRest.RequestOptionsBase { +/** A management group aggregated cost resource. */ +export type ManagementGroupAggregatedCostResult = Resource & { /** - * 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. + * The id of the billing period resource that the aggregated cost belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly billingPeriodId?: string; /** - * 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 (:). + * The start of the date time range covered by aggregated cost. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly usageStart?: Date; /** - * 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. + * The end of the date time range covered by the aggregated cost. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly usageEnd?: Date; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Azure Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly azureCharges?: number; /** - * Additional parameters for the operation + * Marketplace Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByBillingAccountOptionalParams extends msRest.RequestOptionsBase { + readonly marketplaceCharges?: number; /** - * 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. + * Charges Billed Separately. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly chargesBilledSeparately?: number; /** - * 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 (:). + * The ISO currency in which the meter is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly currency?: string; + /** Children of a management group */ + children?: ManagementGroupAggregatedCostResult[]; + /** List of subscription Guids included in the calculation of aggregated cost */ + includedSubscriptions?: string[]; + /** List of subscription Guids excluded from the calculation of aggregated cost */ + excludedSubscriptions?: string[]; +}; + +/** A credit summary resource. */ +export type CreditSummary = Resource & { /** - * 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. + * Summary of balances associated with this credit summary. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly balanceSummary?: CreditBalanceSummary; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Pending credit adjustments. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly pendingCreditAdjustments?: Amount; /** - * Additional parameters for the operation + * Expired credit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByBillingAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly expiredCredit?: Amount; /** - * 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. + * Pending eligible charges. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly pendingEligibleCharges?: Amount; /** - * 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 (:). + * The credit currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly creditCurrency?: string; /** - * 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. + * The billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly billingCurrency?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Credit's reseller. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly reseller?: Reseller; /** - * Additional parameters for the operation + * The eTag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} + readonly eTag?: string; +}; -/** - * Optional Parameters. - */ -export interface UsageDetailsListByDepartmentOptionalParams extends msRest.RequestOptionsBase { +/** A budget resource. */ +export type Budget = ProxyResource & { + /** The category of the budget, whether the budget tracks cost or usage. */ + category?: CategoryType; + /** The total amount of cost to track with the budget */ + amount?: number; + /** The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers */ + timeGrain?: TimeGrainType; + /** 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 twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date. */ + timePeriod?: BudgetTimePeriod; + /** May be used to filter budgets by user-specified dimensions and/or tags. */ + filter?: BudgetFilter; /** - * 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. + * The current amount of cost which is being tracked for a budget. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly currentSpend?: CurrentSpend; + /** Dictionary of notifications associated with the budget. Budget can have up to five notifications. */ + notifications?: { [propertyName: string]: Notification }; /** - * 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 (:). + * The forecasted cost which is being tracked for a budget. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly forecastSpend?: ForecastSpend; +}; + +/** A resource listing all tags. */ +export type TagsResult = ProxyResource & { + /** A list of Tag. */ + tags?: Tag[]; /** - * 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. + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly nextLink?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The link (url) to the previous page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly previousLink?: string; +}; + +/** A charge summary resource. */ +export type ChargeSummary = ProxyResource & { + /** Specifies the kind of charge summary. */ + kind: ChargeSummaryKind; +}; + +/** An event summary resource. */ +export type EventSummary = ProxyResource & { /** - * Additional parameters for the operation + * The date of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByDepartmentOptionalParams - extends msRest.RequestOptionsBase { + readonly transactionDate?: Date; /** - * 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. + * The description of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly description?: string; /** - * 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 (:). + * The amount of new credit or commitment for NewCredit or SettleCharges event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly newCredit?: Amount; /** - * 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. + * The amount of balance adjustment. The property is not available for ConsumptionCommitment lots. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly adjustments?: Amount; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The amount of expired credit or commitment for NewCredit or SettleCharges event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly creditExpired?: Amount; /** - * Additional parameters for the operation + * The amount of charges for events of type SettleCharges and PendingEligibleCharges. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly charges?: Amount; /** - * 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. + * The balance after the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly closedBalance?: Amount; + /** Identifies the type of the event. */ + eventType?: EventType; /** - * 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 (:). + * The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly invoiceNumber?: string; /** - * 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. + * The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing account of type MicrosoftCustomerAgreement. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly billingProfileId?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The display name of the billing profile for which the event happened. The property is only available for billing account of type MicrosoftCustomerAgreement. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly billingProfileDisplayName?: string; /** - * Additional parameters for the operation + * The ID that uniquely identifies the lot for which the event happened. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly lotId?: string; /** - * 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. + * Identifies the source of the lot for which the event happened. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly lotSource?: string; /** - * 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 (:). + * Amount of canceled credit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly canceledCredit?: Amount; /** - * 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. + * The credit currency of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly creditCurrency?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The billing currency of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly billingCurrency?: string; /** - * Additional parameters for the operation + * The reseller of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByManagementGroupOptionalParams extends msRest.RequestOptionsBase { + readonly reseller?: Reseller; /** - * 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. + * The amount of expired credit or commitment for NewCredit or SettleCharges event in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly creditExpiredInBillingCurrency?: AmountWithExchangeRate; /** - * 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 (:). + * The amount of new credit or commitment for NewCredit or SettleCharges event in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly newCreditInBillingCurrency?: AmountWithExchangeRate; /** - * 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. + * The amount of balance adjustment in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly adjustmentsInBillingCurrency?: AmountWithExchangeRate; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The amount of charges for events of type SettleCharges and PendingEligibleCharges in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly chargesInBillingCurrency?: AmountWithExchangeRate; /** - * Additional parameters for the operation + * The balance in billing currency after the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} + readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; + /** + * The eTag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eTagPropertiesETag?: string; +}; -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByManagementGroupOptionalParams - extends msRest.RequestOptionsBase { +/** A lot summary resource. */ +export type LotSummary = ProxyResource & { /** - * 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. + * The original amount of a lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly originalAmount?: Amount; /** - * 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 (:). + * The balance as of the last invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly closedBalance?: Amount; /** - * 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. + * The source of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly source?: LotSource; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The date when the lot became effective. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly startDate?: Date; /** - * Additional parameters for the operation + * The expiration date of a lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListNextOptionalParams extends msRest.RequestOptionsBase { + readonly expirationDate?: Date; /** - * 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. + * The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly poNumber?: string; /** - * 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 (:). + * The date when the lot was added. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly purchasedDate?: Date; /** - * 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. + * The status of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly status?: Status; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The currency of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByBillingPeriodNextOptionalParams - extends msRest.RequestOptionsBase { + readonly creditCurrency?: string; /** - * 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. + * The billing currency of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly billingCurrency?: string; /** - * 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 (:). + * The original amount of a lot in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly originalAmountInBillingCurrency?: AmountWithExchangeRate; /** - * 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. + * The balance as of the last invoice in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The reseller of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByBillingAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly reseller?: Reseller; /** - * 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. + * The eTag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly eTagPropertiesETag?: string; +}; + +/** Reservation transaction resource. */ +export type ReservationTransaction = ReservationTransactionResource & { /** - * 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 (:). + * The date of the transaction + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly eventDate?: Date; /** - * 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. + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly reservationOrderId?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The description of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByBillingAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly description?: string; /** - * 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. + * The type of the transaction (Purchase, Cancel, etc.) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly eventType?: string; /** - * 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 (:). + * The quantity of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly quantity?: number; /** - * 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. + * The charge of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly amount?: number; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The ISO currency in which the transaction is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByDepartmentNextOptionalParams extends msRest.RequestOptionsBase { + readonly currency?: string; /** - * 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. + * The name of the reservation order. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly reservationOrderName?: string; /** - * 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 (:). + * The purchasing enrollment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly purchasingEnrollment?: string; /** - * 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. + * The subscription guid that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly purchasingSubscriptionGuid?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The subscription name that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByDepartmentNextOptionalParams - extends msRest.RequestOptionsBase { + readonly purchasingSubscriptionName?: string; /** - * 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. + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly armSkuName?: string; /** - * 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 (:). + * This is the term of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly term?: string; /** - * 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. + * The region of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly region?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The name of the account that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByEnrollmentAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly accountName?: string; /** - * 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. + * The email of the account owner that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly accountOwnerEmail?: string; /** - * 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 (:). + * The department name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly departmentName?: string; /** - * 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. + * The cost center of this department if it is a department and a cost center is provided. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly costCenter?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The current enrollment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByEnrollmentAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly currentEnrollment?: string; /** - * 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. + * The billing frequency, which can be either one-time or recurring. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly billingFrequency?: string; /** - * 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 (:). + * The billing month(yyyyMMdd), on which the event initiated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingMonth?: number; /** - * 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. + * The monetary commitment amount at the enrollment scope. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly monetaryCommitment?: number; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The overage amount at the enrollment scope. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} + readonly overage?: number; +}; -/** - * Optional Parameters. - */ -export interface UsageDetailsListByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { +/** Modern Reservation transaction resource. */ +export type ModernReservationTransaction = ReservationTransactionResource & { /** - * 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. + * The charge of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly amount?: number; /** - * 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 (:). + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly armSkuName?: string; /** - * 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. + * The billing frequency, which can be either one-time or recurring. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly billingFrequency?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Billing profile Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { + readonly billingProfileId?: string; /** - * 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. + * Billing profile name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly billingProfileName?: string; /** - * 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 (:). + * The ISO currency in which the transaction is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly currency?: string; /** - * 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. + * The description of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly description?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The date of the transaction + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListOptionalParams extends msRest.RequestOptionsBase { + readonly eventDate?: Date; /** - * 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'. + * The type of the transaction (Purchase, Cancel, etc.) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly eventType?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Invoice Number + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly invoice?: string; /** - * 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. + * Invoice Id as on the invoice where the specific transaction appears. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByBillingPeriodOptionalParams extends msRest.RequestOptionsBase { + readonly invoiceId?: string; /** - * 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'. + * Invoice Section Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly invoiceSectionId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Invoice Section Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly invoiceSectionName?: string; /** - * 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. + * The subscription guid that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByBillingAccountOptionalParams extends msRest.RequestOptionsBase { + readonly purchasingSubscriptionGuid?: string; /** - * 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'. + * The subscription name that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly purchasingSubscriptionName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The quantity of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly quantity?: number; /** - * 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. + * The region of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByBillingAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly region?: string; /** - * 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'. + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly reservationOrderId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The name of the reservation order. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly reservationOrderName?: string; /** - * 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. + * This is the term of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} + readonly term?: string; +}; -/** - * Optional Parameters. - */ -export interface MarketplacesListByDepartmentOptionalParams extends msRest.RequestOptionsBase { +/** The amount with exchange rate. */ +export type AmountWithExchangeRate = Amount & { /** - * 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'. + * The exchange rate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly exchangeRate?: number; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The exchange rate month. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly exchangeRateMonth?: number; +}; + +/** Legacy usage detail. */ +export type LegacyUsageDetail = UsageDetail & { /** - * 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. + * Billing Account identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByDepartmentOptionalParams - extends msRest.RequestOptionsBase { + readonly billingAccountId?: string; /** - * 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'. + * Billing Account Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingAccountName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The billing period start date. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly billingPeriodStartDate?: Date; /** - * 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. + * The billing period end date. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly billingPeriodEndDate?: Date; /** - * 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'. + * Billing Profile identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingProfileId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Billing Profile Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly billingProfileName?: string; /** - * 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. + * Account Owner Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly accountOwnerId?: string; /** - * 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'. + * Account Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly accountName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Subscription guid. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly subscriptionId?: string; /** - * 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. + * Subscription name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByManagementGroupOptionalParams extends msRest.RequestOptionsBase { + readonly subscriptionName?: string; /** - * 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'. + * Date for the usage record. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly date?: Date; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Product name for the consumed service or purchase. Not available for Marketplace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly product?: string; /** - * 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. + * Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByManagementGroupOptionalParams - extends msRest.RequestOptionsBase { + readonly partNumber?: string; /** - * 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'. + * The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly meterId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The details about the meter. By default this is not populated, unless it's specified in $expand. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly meterDetails?: MeterDetailsResponse; /** - * 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. + * The usage quantity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListNextOptionalParams extends msRest.RequestOptionsBase { + readonly quantity?: number; /** - * 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'. + * Effective Price that's charged for the usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly effectivePrice?: number; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The amount of cost before tax. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly cost?: number; /** - * 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. + * Unit Price is the price applicable to you. (your EA or other contract price). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByBillingPeriodNextOptionalParams - extends msRest.RequestOptionsBase { + readonly unitPrice?: number; /** - * 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'. + * Billing Currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingCurrency?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Resource Location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly resourceLocation?: string; /** - * 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. + * Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByBillingAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly consumedService?: string; /** - * 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'. + * Unique identifier of the Azure Resource Manager usage detail resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly resourceId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Resource Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly resourceName?: string; /** - * 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. + * Service-specific metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByBillingAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly serviceInfo1?: string; /** - * 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'. + * Legacy field with optional service-specific metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly serviceInfo2?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly additionalInfo?: string; /** - * 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. + * Invoice Section Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByDepartmentNextOptionalParams extends msRest.RequestOptionsBase { + readonly invoiceSection?: string; /** - * 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'. + * The cost center of this department if it is a department and a cost center is provided. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly costCenter?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Resource Group Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly resourceGroup?: string; /** - * 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. + * ARM resource id of the reservation. Only applies to records relevant to reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByDepartmentNextOptionalParams - extends msRest.RequestOptionsBase { + readonly reservationId?: string; /** - * 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'. + * User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only applies to records relevant to reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly reservationName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Product Order Id. For reservations this is the Reservation Order ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly productOrderId?: string; /** - * 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. + * Product Order Name. For reservations this is the SKU that was purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByEnrollmentAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly productOrderName?: string; /** - * 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'. + * Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly offerId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Is Azure Credit Eligible. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly isAzureCreditEligible?: boolean; /** - * 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. + * Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByEnrollmentAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly term?: string; /** - * 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'. + * Publisher Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly publisherName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Publisher Type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly publisherType?: string; /** - * 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. + * Plan Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { + readonly planName?: string; /** - * 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'. + * Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly chargeType?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is used. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly frequency?: string; /** - * 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. + * Retail price for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} + readonly payGPrice?: number; + /** + * Identifier that indicates how the meter is priced. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pricingModel?: PricingModelType; +}; -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { +/** Modern usage detail. */ +export type ModernUsageDetail = UsageDetail & { /** - * 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'. + * Billing Account identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingAccountId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Effective Price that's charged for the usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly effectivePrice?: number; /** - * 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. + * Identifier that indicates how the meter is priced + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationsSummariesListByReservationOrderOptionalParams - extends msRest.RequestOptionsBase { + readonly pricingModel?: PricingModelType; /** - * Required only for daily grain. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge' + * Name of the Billing Account. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationsSummariesListByReservationOrderAndReservationOptionalParams - extends msRest.RequestOptionsBase { + readonly billingAccountName?: string; /** - * Required only for daily grain. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge' + * Billing Period Start Date as in the invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationsSummariesListByReservationOrderNextOptionalParams - extends msRest.RequestOptionsBase { + readonly billingPeriodStartDate?: Date; /** - * Required only for daily grain. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge' + * Billing Period End Date as in the invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams - extends msRest.RequestOptionsBase { + readonly billingPeriodEndDate?: Date; /** - * Required only for daily grain. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge' + * Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationRecommendationsListOptionalParams extends msRest.RequestOptionsBase { + readonly billingProfileId?: string; /** - * May be used to filter reservationRecommendations by properties/scope and - * properties/lookBackPeriod. + * Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationRecommendationsListNextOptionalParams - extends msRest.RequestOptionsBase { + readonly billingProfileName?: string; /** - * May be used to filter reservationRecommendations by properties/scope and - * properties/lookBackPeriod. + * Unique Microsoft generated identifier for the Azure Subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface PriceSheetGetOptionalParams extends msRest.RequestOptionsBase { + readonly subscriptionGuid?: string; /** - * May be used to expand the properties/meterDetails within a price sheet. By default, these - * fields are not included when returning price sheet. + * Name of the Azure Subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly subscriptionName?: string; /** - * 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. + * Date for the usage record. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly date?: Date; /** - * May be used to limit the number of results to the top N results. + * Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface PriceSheetGetByBillingPeriodOptionalParams extends msRest.RequestOptionsBase { + readonly product?: string; /** - * May be used to expand the properties/meterDetails within a price sheet. By default, these - * fields are not included when returning price sheet. + * The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly meterId?: string; /** - * 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. + * Identifies the name of the meter against which consumption is measured. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly meterName?: string; /** - * May be used to limit the number of results to the top N results. + * Identifies the location of the datacenter for certain services that are priced based on datacenter location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface ForecastsListOptionalParams extends msRest.RequestOptionsBase { + readonly meterRegion?: string; /** - * 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'. + * Identifies the top-level service for the usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface AggregatedCostGetByManagementGroupOptionalParams - extends msRest.RequestOptionsBase { + readonly meterCategory?: string; /** - * 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 (:). + * Defines the type or sub-category of Azure service that can affect the rate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ChargesListByEnrollmentAccountOptionalParams extends msRest.RequestOptionsBase { + readonly meterSubCategory?: string; /** - * 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 (:). + * List the service family for the product purchased or charged (Example: Storage ; Compute). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ChargesListForBillingPeriodByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly serviceFamily?: string; /** - * 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 (:). + * Measure the quantity purchased or consumed.The amount of the meter used during the billing period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ChargesListByDepartmentOptionalParams extends msRest.RequestOptionsBase { + readonly quantity?: number; /** - * 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 (:). + * Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ChargesListForBillingPeriodByDepartmentOptionalParams - extends msRest.RequestOptionsBase { + readonly unitOfMeasure?: string; /** - * 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 (:). + * Instance Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * An interface representing ConsumptionManagementClientOptions. - */ -export interface ConsumptionManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} - -/** - * @interface - * Result of listing usage details. It contains a list of available usage details in reverse - * chronological order by billing period. - * @extends Array - */ -export interface UsageDetailsListResult extends Array { + readonly instanceName?: string; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Estimated extendedCost or blended cost before tax in USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing marketplaces. It contains a list of available marketplaces in reverse - * chronological order by billing period. - * @extends Array - */ -export interface MarketplacesListResult extends Array { + readonly costInUSD?: number; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unit Price is the price applicable to you. (your EA or other contract price). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing reservation summaries. - * @extends Array - */ -export interface ReservationSummariesListResult extends Array { + readonly unitPrice?: number; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The currency defining the billed cost. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing reservation details. - * @extends Array - */ -export interface ReservationDetailsListResult extends Array { + readonly billingCurrencyCode?: string; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Name of the resource location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing reservation recommendations. - * @extends Array - */ -export interface ReservationRecommendationsListResult extends Array { + readonly resourceLocation?: string; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing budgets. It contains a list of available budgets in the scope provided. - * @extends Array - */ -export interface BudgetsListResult extends Array { + readonly consumedService?: string; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Service-specific metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing forecasts. It contains a list of available forecasts. - * @extends Array - */ -export interface ForecastsListResult extends Array {} - -/** - * @interface - * Result of listing consumption operations. It contains a list of operations and a URL link to get - * the next set of results. - * @extends Array - */ -export interface OperationListResult extends Array { + readonly serviceInfo1?: string; /** - * URL to get the next set of operation list results if there are any. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Legacy field with optional service-specific metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * Defines values for BillingFrequency. - * Possible values include: 'Month', 'Quarter', 'Year' - * @readonly - * @enum {string} - */ -export type BillingFrequency = "Month" | "Quarter" | "Year"; - -/** - * Defines values for CategoryType. - * Possible values include: 'Cost', 'Usage' - * @readonly - * @enum {string} - */ -export type CategoryType = "Cost" | "Usage"; - -/** - * Defines values for TimeGrainType. - * Possible values include: 'Monthly', 'Quarterly', 'Annually' - * @readonly - * @enum {string} - */ -export type TimeGrainType = "Monthly" | "Quarterly" | "Annually"; - -/** - * Defines values for OperatorType. - * Possible values include: 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo' - * @readonly - * @enum {string} - */ -export type OperatorType = "EqualTo" | "GreaterThan" | "GreaterThanOrEqualTo"; - -/** - * Defines values for Grain. - * Possible values include: 'Daily', 'Monthly', 'Yearly' - * @readonly - * @enum {string} - */ -export type Grain = "Daily" | "Monthly" | "Yearly"; - -/** - * Defines values for ChargeType. - * Possible values include: 'Actual', 'Forecast' - * @readonly - * @enum {string} - */ -export type ChargeType = "Actual" | "Forecast"; - -/** - * Defines values for Bound. - * Possible values include: 'Upper', 'Lower' - * @readonly - * @enum {string} - */ -export type Bound = "Upper" | "Lower"; - -/** - * Defines values for Datagrain. - * Possible values include: 'DailyGrain', 'MonthlyGrain' - * @readonly - * @enum {string} - */ -export type Datagrain = "daily" | "monthly"; - -/** - * Contains response data for the list operation. - */ -export type UsageDetailsListResponse = UsageDetailsListResult & { + readonly serviceInfo2?: string; /** - * The underlying HTTP response. + * Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByBillingPeriod operation. - */ -export type UsageDetailsListByBillingPeriodResponse = UsageDetailsListResult & { + readonly additionalInfo?: string; /** - * The underlying HTTP response. + * Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by partners. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByBillingAccount operation. - */ -export type UsageDetailsListByBillingAccountResponse = UsageDetailsListResult & { + readonly invoiceSectionId?: string; /** - * The underlying HTTP response. + * Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by partners. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByBillingAccount operation. - */ -export type UsageDetailsListForBillingPeriodByBillingAccountResponse = UsageDetailsListResult & { + readonly invoiceSectionName?: string; /** - * The underlying HTTP response. + * The cost center of this department if it is a department and a cost center is provided. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByDepartment operation. - */ -export type UsageDetailsListByDepartmentResponse = UsageDetailsListResult & { + readonly costCenter?: string; /** - * The underlying HTTP response. + * Name of the Azure resource group used for cohesive lifecycle management of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByDepartment operation. - */ -export type UsageDetailsListForBillingPeriodByDepartmentResponse = UsageDetailsListResult & { + readonly resourceGroup?: string; /** - * The underlying HTTP response. + * ARM resource id of the reservation. Only applies to records relevant to reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByEnrollmentAccount operation. - */ -export type UsageDetailsListByEnrollmentAccountResponse = UsageDetailsListResult & { + readonly reservationId?: string; /** - * The underlying HTTP response. + * User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only applies to records relevant to reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByEnrollmentAccount operation. - */ -export type UsageDetailsListForBillingPeriodByEnrollmentAccountResponse = UsageDetailsListResult & { + readonly reservationName?: string; /** - * The underlying HTTP response. + * The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations this is the Reservation Order ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByManagementGroup operation. - */ -export type UsageDetailsListByManagementGroupResponse = UsageDetailsListResult & { + readonly productOrderId?: string; /** - * The underlying HTTP response. + * Product Order Name. For reservations this is the SKU that was purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByManagementGroup operation. - */ -export type UsageDetailsListForBillingPeriodByManagementGroupResponse = UsageDetailsListResult & { + readonly productOrderName?: string; /** - * The underlying HTTP response. + * Determines if the cost is eligible to be paid for using Azure credits. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type UsageDetailsListNextResponse = UsageDetailsListResult & { + readonly isAzureCreditEligible?: boolean; /** - * The underlying HTTP response. + * Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; This is not applicable for Azure consumption. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByBillingPeriodNext operation. - */ -export type UsageDetailsListByBillingPeriodNextResponse = UsageDetailsListResult & { + readonly term?: string; /** - * The underlying HTTP response. + * Name of the publisher of the service including Microsoft or Third Party publishers. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByBillingAccountNext operation. - */ -export type UsageDetailsListByBillingAccountNextResponse = UsageDetailsListResult & { + readonly publisherName?: string; /** - * The underlying HTTP response. + * Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByBillingAccountNext operation. - */ -export type UsageDetailsListForBillingPeriodByBillingAccountNextResponse = UsageDetailsListResult & { + readonly publisherType?: string; /** - * The underlying HTTP response. + * Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByDepartmentNext operation. - */ -export type UsageDetailsListByDepartmentNextResponse = UsageDetailsListResult & { + readonly chargeType?: string; /** - * The underlying HTTP response. + * Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is used. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByDepartmentNext operation. - */ -export type UsageDetailsListForBillingPeriodByDepartmentNextResponse = UsageDetailsListResult & { + readonly frequency?: string; /** - * The underlying HTTP response. + * ExtendedCost or blended cost before tax in billed currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByEnrollmentAccountNext operation. - */ -export type UsageDetailsListByEnrollmentAccountNextResponse = UsageDetailsListResult & { + readonly costInBillingCurrency?: number; /** - * The underlying HTTP response. + * ExtendedCost or blended cost before tax in pricing currency to correlate with prices. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByEnrollmentAccountNext operation. - */ -export type UsageDetailsListForBillingPeriodByEnrollmentAccountNextResponse = UsageDetailsListResult & { + readonly costInPricingCurrency?: number; /** - * The underlying HTTP response. + * Exchange rate used in conversion from pricing currency to billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByManagementGroupNext operation. - */ -export type UsageDetailsListByManagementGroupNextResponse = UsageDetailsListResult & { + readonly exchangeRate?: string; /** - * The underlying HTTP response. + * Date on which exchange rate used in conversion from pricing currency to billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByManagementGroupNext operation. - */ -export type UsageDetailsListForBillingPeriodByManagementGroupNextResponse = UsageDetailsListResult & { + readonly exchangeRateDate?: Date; /** - * The underlying HTTP response. + * Invoice ID as on the invoice where the specific transaction appears. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type MarketplacesListResponse = MarketplacesListResult & { + readonly invoiceId?: string; /** - * The underlying HTTP response. + * Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByBillingPeriod operation. - */ -export type MarketplacesListByBillingPeriodResponse = MarketplacesListResult & { + readonly previousInvoiceId?: string; /** - * The underlying HTTP response. + * Pricing Billing Currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByBillingAccount operation. - */ -export type MarketplacesListByBillingAccountResponse = MarketplacesListResult & { + readonly pricingCurrencyCode?: string; /** - * The underlying HTTP response. + * Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId and SkuId in partner center. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByBillingAccount operation. - */ -export type MarketplacesListForBillingPeriodByBillingAccountResponse = MarketplacesListResult & { + readonly productIdentifier?: string; /** - * The underlying HTTP response. + * Resource Location Normalized. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByDepartment operation. - */ -export type MarketplacesListByDepartmentResponse = MarketplacesListResult & { + readonly resourceLocationNormalized?: string; /** - * The underlying HTTP response. + * Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined for the rating period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByDepartment operation. - */ -export type MarketplacesListForBillingPeriodByDepartmentResponse = MarketplacesListResult & { + readonly servicePeriodStartDate?: Date; /** - * The underlying HTTP response. + * End date for the period when the service usage was rated for charges. The prices for Azure services are determined based on the rating period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByEnrollmentAccount operation. - */ -export type MarketplacesListByEnrollmentAccountResponse = MarketplacesListResult & { + readonly servicePeriodEndDate?: Date; /** - * The underlying HTTP response. + * Identifier of the customer's AAD tenant. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByEnrollmentAccount operation. - */ -export type MarketplacesListForBillingPeriodByEnrollmentAccountResponse = MarketplacesListResult & { + readonly customerTenantId?: string; /** - * The underlying HTTP response. + * Name of the customer's AAD tenant. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByManagementGroup operation. - */ -export type MarketplacesListByManagementGroupResponse = MarketplacesListResult & { + readonly customerName?: string; /** - * The underlying HTTP response. + * Identifier for the partner's AAD tenant. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByManagementGroup operation. - */ -export type MarketplacesListForBillingPeriodByManagementGroupResponse = MarketplacesListResult & { + readonly partnerTenantId?: string; /** - * The underlying HTTP response. + * Name of the partner' AAD tenant. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type MarketplacesListNextResponse = MarketplacesListResult & { + readonly partnerName?: string; /** - * The underlying HTTP response. + * MPNId for the reseller associated with the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByBillingPeriodNext operation. - */ -export type MarketplacesListByBillingPeriodNextResponse = MarketplacesListResult & { + readonly resellerMpnId?: string; /** - * The underlying HTTP response. + * Reseller Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByBillingAccountNext operation. - */ -export type MarketplacesListByBillingAccountNextResponse = MarketplacesListResult & { + readonly resellerName?: string; /** - * The underlying HTTP response. + * Publisher Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByBillingAccountNext operation. - */ -export type MarketplacesListForBillingPeriodByBillingAccountNextResponse = MarketplacesListResult & { + readonly publisherId?: string; /** - * The underlying HTTP response. + * Market Price that's charged for the usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByDepartmentNext operation. - */ -export type MarketplacesListByDepartmentNextResponse = MarketplacesListResult & { + readonly marketPrice?: number; /** - * The underlying HTTP response. + * Exchange Rate from pricing currency to billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByDepartmentNext operation. - */ -export type MarketplacesListForBillingPeriodByDepartmentNextResponse = MarketplacesListResult & { + readonly exchangeRatePricingToBilling?: number; /** - * The underlying HTTP response. + * The amount of PayG cost before tax in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByEnrollmentAccountNext operation. - */ -export type MarketplacesListByEnrollmentAccountNextResponse = MarketplacesListResult & { + readonly paygCostInBillingCurrency?: number; /** - * The underlying HTTP response. + * The amount of PayG cost before tax in US Dollar currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByEnrollmentAccountNext operation. - */ -export type MarketplacesListForBillingPeriodByEnrollmentAccountNextResponse = MarketplacesListResult & { + readonly paygCostInUSD?: number; /** - * The underlying HTTP response. + * Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByManagementGroupNext operation. - */ -export type MarketplacesListByManagementGroupNextResponse = MarketplacesListResult & { + readonly partnerEarnedCreditRate?: number; /** - * The underlying HTTP response. + * Flag to indicate if partner earned credit has been applied or not. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByManagementGroupNext operation. - */ -export type MarketplacesListForBillingPeriodByManagementGroupNextResponse = MarketplacesListResult & { + readonly partnerEarnedCreditApplied?: string; /** - * The underlying HTTP response. + * Retail price for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the getByBillingAccount operation. - */ -export type BalancesGetByBillingAccountResponse = Balance & { + readonly payGPrice?: number; /** - * The underlying HTTP response. + * Unique identifier for the applicable benefit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Balance; - }; -}; - -/** - * Contains response data for the getForBillingPeriodByBillingAccount operation. - */ -export type BalancesGetForBillingPeriodByBillingAccountResponse = Balance & { + readonly benefitId?: string; /** - * The underlying HTTP response. + * Name of the applicable benefit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Balance; - }; -}; - -/** - * Contains response data for the listByReservationOrder operation. - */ -export type ReservationsSummariesListByReservationOrderResponse = ReservationSummariesListResult & { + readonly benefitName?: string; /** - * The underlying HTTP response. + * Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationSummariesListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderAndReservation operation. - */ -export type ReservationsSummariesListByReservationOrderAndReservationResponse = ReservationSummariesListResult & { + readonly provider?: string; /** - * The underlying HTTP response. + * Name for Cost Allocation Rule. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationSummariesListResult; - }; + readonly costAllocationRuleName?: string; }; -/** - * Contains response data for the listByReservationOrderNext operation. - */ -export type ReservationsSummariesListByReservationOrderNextResponse = ReservationSummariesListResult & { +/** Legacy reservation recommendation. */ +export type LegacyReservationRecommendation = ReservationRecommendation & { /** - * The underlying HTTP response. + * The number of days of usage to look back for recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationSummariesListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderAndReservationNext operation. - */ -export type ReservationsSummariesListByReservationOrderAndReservationNextResponse = ReservationSummariesListResult & { + readonly lookBackPeriod?: string; /** - * The underlying HTTP response. + * The instance Flexibility Ratio. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationSummariesListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrder operation. - */ -export type ReservationsDetailsListByReservationOrderResponse = ReservationDetailsListResult & { + readonly instanceFlexibilityRatio?: number; /** - * The underlying HTTP response. + * The instance Flexibility Group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationDetailsListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderAndReservation operation. - */ -export type ReservationsDetailsListByReservationOrderAndReservationResponse = ReservationDetailsListResult & { + readonly instanceFlexibilityGroup?: string; /** - * The underlying HTTP response. + * The normalized Size. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationDetailsListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderNext operation. - */ -export type ReservationsDetailsListByReservationOrderNextResponse = ReservationDetailsListResult & { + readonly normalizedSize?: string; /** - * The underlying HTTP response. + * The recommended Quantity Normalized. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationDetailsListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderAndReservationNext operation. - */ -export type ReservationsDetailsListByReservationOrderAndReservationNextResponse = ReservationDetailsListResult & { + readonly recommendedQuantityNormalized?: number; /** - * The underlying HTTP response. + * The meter id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationDetailsListResult; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type ReservationRecommendationsListResponse = ReservationRecommendationsListResult & { + readonly meterId?: string; /** - * The underlying HTTP response. + * The azure resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationRecommendationsListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type ReservationRecommendationsListNextResponse = ReservationRecommendationsListResult & { + readonly resourceType?: string; /** - * The underlying HTTP response. + * RI recommendations in one or three year terms. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationRecommendationsListResult; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type BudgetsListResponse = BudgetsListResult & { + readonly term?: string; /** - * The underlying HTTP response. + * The total amount of cost without reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BudgetsListResult; - }; -}; - -/** - * Contains response data for the listByResourceGroupName operation. - */ -export type BudgetsListByResourceGroupNameResponse = BudgetsListResult & { + readonly costWithNoReservedInstances?: number; /** - * The underlying HTTP response. + * Recommended quality for reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BudgetsListResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type BudgetsGetResponse = Budget & { + readonly recommendedQuantity?: number; /** - * The underlying HTTP response. + * The total amount of cost with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Budget; - }; -}; - -/** - * Contains response data for the createOrUpdate operation. - */ -export type BudgetsCreateOrUpdateResponse = Budget & { + readonly totalCostWithReservedInstances?: number; /** - * The underlying HTTP response. + * Total estimated savings with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Budget; - }; -}; - -/** - * Contains response data for the getByResourceGroupName operation. - */ -export type BudgetsGetByResourceGroupNameResponse = Budget & { + readonly netSavings?: number; /** - * The underlying HTTP response. + * The usage date for looking back. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Budget; - }; -}; - -/** - * Contains response data for the createOrUpdateByResourceGroupName operation. - */ -export type BudgetsCreateOrUpdateByResourceGroupNameResponse = Budget & { + readonly firstUsageDate?: Date; /** - * The underlying HTTP response. + * Shared or single recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Budget; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type BudgetsListNextResponse = BudgetsListResult & { + readonly scope?: string; /** - * The underlying HTTP response. + * List of sku properties + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BudgetsListResult; - }; + readonly skuProperties?: SkuProperty[]; }; -/** - * Contains response data for the listByResourceGroupNameNext operation. - */ -export type BudgetsListByResourceGroupNameNextResponse = BudgetsListResult & { +/** Modern reservation recommendation. */ +export type ModernReservationRecommendation = ReservationRecommendation & { /** - * The underlying HTTP response. + * Resource Location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BudgetsListResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type PriceSheetGetResponse = PriceSheetResult & { + readonly locationPropertiesLocation?: string; /** - * The underlying HTTP response. + * The number of days of usage to look back for recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PriceSheetResult; - }; -}; - -/** - * Contains response data for the getByBillingPeriod operation. - */ -export type PriceSheetGetByBillingPeriodResponse = PriceSheetResult & { + readonly lookBackPeriod?: number; /** - * The underlying HTTP response. + * The instance Flexibility Ratio. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PriceSheetResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type TagsGetResponse = TagsResult & { + readonly instanceFlexibilityRatio?: number; /** - * The underlying HTTP response. + * The instance Flexibility Group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: TagsResult; - }; + readonly instanceFlexibilityGroup?: string; + /** + * The normalized Size. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly normalizedSize?: string; + /** + * The recommended Quantity Normalized. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedQuantityNormalized?: number; + /** + * The meter id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly meterId?: string; + /** + * RI recommendations in one or three year terms. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly term?: string; + /** + * The total amount of cost without reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly costWithNoReservedInstances?: Amount; + /** + * Recommended quality for reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedQuantity?: number; + /** + * The total amount of cost with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalCostWithReservedInstances?: Amount; + /** + * Total estimated savings with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly netSavings?: Amount; + /** + * The usage date for looking back. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly firstUsageDate?: Date; + /** + * Shared or single recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scope?: string; + /** + * List of sku properties + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuProperties?: SkuProperty[]; + /** + * This is the ARM Sku name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuName?: string; }; -/** - * Contains response data for the list operation. - */ -export type ForecastsListResponse = ForecastsListResult & { +/** Legacy charge summary. */ +export type LegacyChargeSummary = ChargeSummary & { /** - * The underlying HTTP response. + * The id of the billing period resource that the charge belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ForecastsListResult; - }; + readonly billingPeriodId?: string; + /** + * Usage start date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usageStart?: string; + /** + * Usage end date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usageEnd?: string; + /** + * Azure Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureCharges?: number; + /** + * Charges Billed separately. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly chargesBilledSeparately?: number; + /** + * Marketplace Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly marketplaceCharges?: number; + /** + * Currency Code + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currency?: string; }; -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { +/** Modern charge summary. */ +export type ModernChargeSummary = ChargeSummary & { /** - * The underlying HTTP response. + * The id of the billing period resource that the charge belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; + readonly billingPeriodId?: string; + /** + * Usage start date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usageStart?: string; + /** + * Usage end date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usageEnd?: string; + /** + * Azure Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureCharges?: Amount; + /** + * Charges Billed separately. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly chargesBilledSeparately?: Amount; + /** + * Marketplace Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly marketplaceCharges?: Amount; + /** + * Billing Account Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingAccountId?: string; + /** + * Billing Profile Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileId?: string; + /** + * Invoice Section Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionId?: string; + /** + * Customer Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerId?: string; + /** + * Is charge Invoiced + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isInvoiced?: boolean; }; +/** Legacy Reservation transaction resource. */ +export type LegacyReservationTransaction = ReservationTransaction & {}; + +/** Known values of {@link Metrictype} that the service accepts. */ +export enum KnownMetrictype { + /** Actual cost data. */ + ActualCostMetricType = "actualcost", + /** Amortized cost data. */ + AmortizedCostMetricType = "amortizedcost", + /** Usage data. */ + UsageMetricType = "usage" +} + /** - * Contains response data for the listNext operation. + * Defines values for Metrictype. \ + * {@link KnownMetrictype} can be used interchangeably with Metrictype, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **actualcost**: Actual cost data. \ + * **amortizedcost**: Amortized cost data. \ + * **usage**: Usage data. */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type Metrictype = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Known values of {@link UsageDetailsKind} that the service accepts. */ +export enum KnownUsageDetailsKind { + Legacy = "legacy", + Modern = "modern" +} /** - * Contains response data for the getByManagementGroup operation. + * Defines values for UsageDetailsKind. \ + * {@link KnownUsageDetailsKind} can be used interchangeably with UsageDetailsKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **legacy** \ + * **modern** */ -export type AggregatedCostGetByManagementGroupResponse = ManagementGroupAggregatedCostResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type UsageDetailsKind = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagementGroupAggregatedCostResult; - }; -}; +/** Known values of {@link CategoryType} that the service accepts. */ +export enum KnownCategoryType { + Cost = "Cost" +} /** - * Contains response data for the getForBillingPeriodByManagementGroup operation. + * Defines values for CategoryType. \ + * {@link KnownCategoryType} can be used interchangeably with CategoryType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Cost** */ -export type AggregatedCostGetForBillingPeriodByManagementGroupResponse = ManagementGroupAggregatedCostResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type CategoryType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagementGroupAggregatedCostResult; - }; -}; +/** Known values of {@link TimeGrainType} that the service accepts. */ +export enum KnownTimeGrainType { + Monthly = "Monthly", + Quarterly = "Quarterly", + Annually = "Annually", + BillingMonth = "BillingMonth", + BillingQuarter = "BillingQuarter", + BillingAnnual = "BillingAnnual" +} /** - * Contains response data for the listByEnrollmentAccount operation. + * Defines values for TimeGrainType. \ + * {@link KnownTimeGrainType} can be used interchangeably with TimeGrainType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Monthly** \ + * **Quarterly** \ + * **Annually** \ + * **BillingMonth** \ + * **BillingQuarter** \ + * **BillingAnnual** */ -export type ChargesListByEnrollmentAccountResponse = ChargesListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type TimeGrainType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChargesListResult; - }; -}; +/** Known values of {@link BudgetOperatorType} that the service accepts. */ +export enum KnownBudgetOperatorType { + In = "In" +} + +/** + * Defines values for BudgetOperatorType. \ + * {@link KnownBudgetOperatorType} can be used interchangeably with BudgetOperatorType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **In** + */ +export type BudgetOperatorType = string; + +/** Known values of {@link OperatorType} that the service accepts. */ +export enum KnownOperatorType { + EqualTo = "EqualTo", + GreaterThan = "GreaterThan", + GreaterThanOrEqualTo = "GreaterThanOrEqualTo" +} + +/** + * Defines values for OperatorType. \ + * {@link KnownOperatorType} can be used interchangeably with OperatorType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EqualTo** \ + * **GreaterThan** \ + * **GreaterThanOrEqualTo** + */ +export type OperatorType = string; + +/** Known values of {@link ThresholdType} that the service accepts. */ +export enum KnownThresholdType { + Actual = "Actual", + Forecasted = "Forecasted" +} + +/** + * Defines values for ThresholdType. \ + * {@link KnownThresholdType} can be used interchangeably with ThresholdType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Actual** \ + * **Forecasted** + */ +export type ThresholdType = string; + +/** Known values of {@link CultureCode} that the service accepts. */ +export enum KnownCultureCode { + EnUs = "en-us", + JaJp = "ja-jp", + ZhCn = "zh-cn", + DeDe = "de-de", + EsEs = "es-es", + FrFr = "fr-fr", + ItIt = "it-it", + KoKr = "ko-kr", + PtBr = "pt-br", + RuRu = "ru-ru", + ZhTw = "zh-tw", + CsCz = "cs-cz", + PlPl = "pl-pl", + TrTr = "tr-tr", + DaDk = "da-dk", + EnGb = "en-gb", + HuHu = "hu-hu", + NbNo = "nb-no", + NlNl = "nl-nl", + PtPt = "pt-pt", + SvSe = "sv-se" +} + +/** + * Defines values for CultureCode. \ + * {@link KnownCultureCode} can be used interchangeably with CultureCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **en-us** \ + * **ja-jp** \ + * **zh-cn** \ + * **de-de** \ + * **es-es** \ + * **fr-fr** \ + * **it-it** \ + * **ko-kr** \ + * **pt-br** \ + * **ru-ru** \ + * **zh-tw** \ + * **cs-cz** \ + * **pl-pl** \ + * **tr-tr** \ + * **da-dk** \ + * **en-gb** \ + * **hu-hu** \ + * **nb-no** \ + * **nl-nl** \ + * **pt-pt** \ + * **sv-se** + */ +export type CultureCode = string; + +/** Known values of {@link ChargeSummaryKind} that the service accepts. */ +export enum KnownChargeSummaryKind { + Legacy = "legacy", + Modern = "modern" +} + +/** + * Defines values for ChargeSummaryKind. \ + * {@link KnownChargeSummaryKind} can be used interchangeably with ChargeSummaryKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **legacy** \ + * **modern** + */ +export type ChargeSummaryKind = string; + +/** Known values of {@link BillingFrequency} that the service accepts. */ +export enum KnownBillingFrequency { + Month = "Month", + Quarter = "Quarter", + Year = "Year" +} + +/** + * Defines values for BillingFrequency. \ + * {@link KnownBillingFrequency} can be used interchangeably with BillingFrequency, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Month** \ + * **Quarter** \ + * **Year** + */ +export type BillingFrequency = string; + +/** Known values of {@link Datagrain} that the service accepts. */ +export enum KnownDatagrain { + /** Daily grain of data */ + DailyGrain = "daily", + /** Monthly grain of data */ + MonthlyGrain = "monthly" +} + +/** + * Defines values for Datagrain. \ + * {@link KnownDatagrain} can be used interchangeably with Datagrain, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **daily**: Daily grain of data \ + * **monthly**: Monthly grain of data + */ +export type Datagrain = string; + +/** Known values of {@link ReservationRecommendationKind} that the service accepts. */ +export enum KnownReservationRecommendationKind { + Legacy = "legacy", + Modern = "modern" +} + +/** + * Defines values for ReservationRecommendationKind. \ + * {@link KnownReservationRecommendationKind} can be used interchangeably with ReservationRecommendationKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **legacy** \ + * **modern** + */ +export type ReservationRecommendationKind = string; + +/** Known values of {@link Term} that the service accepts. */ +export enum KnownTerm { + /** 1 year reservation term */ + P1Y = "P1Y", + /** 3 year reservation term */ + P3Y = "P3Y" +} + +/** + * Defines values for Term. \ + * {@link KnownTerm} can be used interchangeably with Term, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **P1Y**: 1 year reservation term \ + * **P3Y**: 3 year reservation term + */ +export type Term = string; + +/** Known values of {@link LookBackPeriod} that the service accepts. */ +export enum KnownLookBackPeriod { + /** Use 7 days of data for recommendations */ + Last07Days = "Last7Days", + /** Use 30 days of data for recommendations */ + Last30Days = "Last30Days", + /** Use 60 days of data for recommendations */ + Last60Days = "Last60Days" +} /** - * Contains response data for the listForBillingPeriodByEnrollmentAccount operation. + * Defines values for LookBackPeriod. \ + * {@link KnownLookBackPeriod} can be used interchangeably with LookBackPeriod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Last7Days**: Use 7 days of data for recommendations \ + * **Last30Days**: Use 30 days of data for recommendations \ + * **Last60Days**: Use 60 days of data for recommendations */ -export type ChargesListForBillingPeriodByEnrollmentAccountResponse = ChargeSummary & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type LookBackPeriod = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChargeSummary; - }; -}; +/** Known values of {@link EventType} that the service accepts. */ +export enum KnownEventType { + SettledCharges = "SettledCharges", + PendingCharges = "PendingCharges", + PendingAdjustments = "PendingAdjustments", + PendingNewCredit = "PendingNewCredit", + PendingExpiredCredit = "PendingExpiredCredit", + UnKnown = "UnKnown", + NewCredit = "NewCredit" +} /** - * Contains response data for the listByDepartment operation. + * Defines values for EventType. \ + * {@link KnownEventType} can be used interchangeably with EventType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SettledCharges** \ + * **PendingCharges** \ + * **PendingAdjustments** \ + * **PendingNewCredit** \ + * **PendingExpiredCredit** \ + * **UnKnown** \ + * **NewCredit** */ -export type ChargesListByDepartmentResponse = ChargesListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type EventType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChargesListResult; - }; -}; +/** Known values of {@link LotSource} that the service accepts. */ +export enum KnownLotSource { + PurchasedCredit = "PurchasedCredit", + PromotionalCredit = "PromotionalCredit", + ConsumptionCommitment = "ConsumptionCommitment" +} /** - * Contains response data for the listForBillingPeriodByDepartment operation. + * Defines values for LotSource. \ + * {@link KnownLotSource} can be used interchangeably with LotSource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PurchasedCredit** \ + * **PromotionalCredit** \ + * **ConsumptionCommitment** */ -export type ChargesListForBillingPeriodByDepartmentResponse = ChargeSummary & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type LotSource = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChargeSummary; - }; -}; +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + None = "None", + Active = "Active", + Inactive = "Inactive", + Expired = "Expired", + Complete = "Complete", + Canceled = "Canceled" +} + +/** + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Active** \ + * **Inactive** \ + * **Expired** \ + * **Complete** \ + * **Canceled** + */ +export type Status = string; + +/** Known values of {@link PricingModelType} that the service accepts. */ +export enum KnownPricingModelType { + OnDemand = "On Demand", + Reservation = "Reservation", + Spot = "Spot" +} /** - * Contains response data for the get operation. + * Defines values for PricingModelType. \ + * {@link KnownPricingModelType} can be used interchangeably with PricingModelType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **On Demand** \ + * **Reservation** \ + * **Spot** */ -export type TenantsGetResponse = TenantListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type PricingModelType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TenantListResult; - }; -}; +/** Known values of {@link Scope} that the service accepts. */ +export enum KnownScope { + Single = "Single", + Shared = "Shared" +} + +/** + * Defines values for Scope. \ + * {@link KnownScope} can be used interchangeably with Scope, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Single** \ + * **Shared** + */ +export type Scope = string; + +/** Optional parameters. */ +export interface UsageDetailsListOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. */ + expand?: string; + /** May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType 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 (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type */ + filter?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the most recent N usageDetails. */ + top?: number; + /** Allows to select different type of cost/usage records. */ + metric?: Metrictype; +} + +/** Contains response data for the list operation. */ +export type UsageDetailsListResponse = UsageDetailsListResult; + +/** Optional parameters. */ +export interface UsageDetailsListNextOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. */ + expand?: string; + /** May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType 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 (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type */ + filter?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the most recent N usageDetails. */ + top?: number; + /** Allows to select different type of cost/usage records. */ + metric?: Metrictype; +} + +/** Contains response data for the listNext operation. */ +export type UsageDetailsListNextResponse = UsageDetailsListResult; + +/** Optional parameters. */ +export interface MarketplacesListOptionalParams + extends coreClient.OperationOptions { + /** 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'. */ + filter?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the most recent N marketplaces. */ + top?: number; +} + +/** Contains response data for the list operation. */ +export type MarketplacesListResponse = MarketplacesListResult; + +/** Optional parameters. */ +export interface MarketplacesListNextOptionalParams + extends coreClient.OperationOptions { + /** 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'. */ + filter?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the most recent N marketplaces. */ + top?: number; +} + +/** Contains response data for the listNext operation. */ +export type MarketplacesListNextResponse = MarketplacesListResult; + +/** Optional parameters. */ +export interface BudgetsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type BudgetsListResponse = BudgetsListResult; + +/** Optional parameters. */ +export interface BudgetsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BudgetsGetResponse = Budget; + +/** Optional parameters. */ +export interface BudgetsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type BudgetsCreateOrUpdateResponse = Budget; + +/** Optional parameters. */ +export interface BudgetsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface BudgetsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type BudgetsListNextResponse = BudgetsListResult; + +/** Optional parameters. */ +export interface TagsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TagsGetResponse = TagsResult; + +/** Optional parameters. */ +export interface ChargesListOptionalParams extends coreClient.OperationOptions { + /** 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 (:). */ + filter?: string; + /** Start date */ + startDate?: string; + /** End date */ + endDate?: string; + /** May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. */ + apply?: string; +} + +/** Contains response data for the list operation. */ +export type ChargesListResponse = ChargesListResult; + +/** Optional parameters. */ +export interface BalancesGetByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingAccount operation. */ +export type BalancesGetByBillingAccountResponse = Balance; + +/** Optional parameters. */ +export interface BalancesGetForBillingPeriodByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getForBillingPeriodByBillingAccount operation. */ +export type BalancesGetForBillingPeriodByBillingAccountResponse = Balance; + +/** Optional parameters. */ +export interface ReservationsSummariesListByReservationOrderOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByReservationOrder operation. */ +export type ReservationsSummariesListByReservationOrderResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListByReservationOrderAndReservationOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByReservationOrderAndReservation operation. */ +export type ReservationsSummariesListByReservationOrderAndReservationResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile */ + filter?: string; + /** Start date. Only applicable when querying with billing profile */ + startDate?: string; + /** End date. Only applicable when querying with billing profile */ + endDate?: string; + /** Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation */ + reservationId?: string; + /** Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order */ + reservationOrderId?: string; +} + +/** Contains response data for the list operation. */ +export type ReservationsSummariesListResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListByReservationOrderNextOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByReservationOrderNext operation. */ +export type ReservationsSummariesListByReservationOrderNextResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByReservationOrderAndReservationNext operation. */ +export type ReservationsSummariesListByReservationOrderAndReservationNextResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListNextOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile */ + filter?: string; + /** Start date. Only applicable when querying with billing profile */ + startDate?: string; + /** End date. Only applicable when querying with billing profile */ + endDate?: string; + /** Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation */ + reservationId?: string; + /** Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order */ + reservationOrderId?: string; +} + +/** Contains response data for the listNext operation. */ +export type ReservationsSummariesListNextResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListByReservationOrderOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByReservationOrder operation. */ +export type ReservationsDetailsListByReservationOrderResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListByReservationOrderAndReservationOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByReservationOrderAndReservation operation. */ +export type ReservationsDetailsListByReservationOrderAndReservationResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile */ + filter?: string; + /** Start date. Only applicable when querying with billing profile */ + startDate?: string; + /** End date. Only applicable when querying with billing profile */ + endDate?: string; + /** Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation */ + reservationId?: string; + /** Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order */ + reservationOrderId?: string; +} + +/** Contains response data for the list operation. */ +export type ReservationsDetailsListResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListByReservationOrderNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByReservationOrderNext operation. */ +export type ReservationsDetailsListByReservationOrderNextResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListByReservationOrderAndReservationNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByReservationOrderAndReservationNext operation. */ +export type ReservationsDetailsListByReservationOrderAndReservationNextResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListNextOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile */ + filter?: string; + /** Start date. Only applicable when querying with billing profile */ + startDate?: string; + /** End date. Only applicable when querying with billing profile */ + endDate?: string; + /** Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation */ + reservationId?: string; + /** Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order */ + reservationOrderId?: string; +} + +/** Contains response data for the listNext operation. */ +export type ReservationsDetailsListNextResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationRecommendationsListOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type ReservationRecommendationsListResponse = ReservationRecommendationsListResult; + +/** Optional parameters. */ +export interface ReservationRecommendationsListNextOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. */ + filter?: string; +} + +/** Contains response data for the listNext operation. */ +export type ReservationRecommendationsListNextResponse = ReservationRecommendationsListResult; + +/** Optional parameters. */ +export interface ReservationRecommendationDetailsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ReservationRecommendationDetailsGetResponse = ReservationRecommendationDetailsModel; + +/** Optional parameters. */ +export interface ReservationTransactionsListOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type ReservationTransactionsListResponse = ReservationTransactionsListResult; + +/** Optional parameters. */ +export interface ReservationTransactionsListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByBillingProfile operation. */ +export type ReservationTransactionsListByBillingProfileResponse = ModernReservationTransactionsListResult; + +/** Optional parameters. */ +export interface ReservationTransactionsListNextOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listNext operation. */ +export type ReservationTransactionsListNextResponse = ReservationTransactionsListResult; + +/** Optional parameters. */ +export interface ReservationTransactionsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type ReservationTransactionsListByBillingProfileNextResponse = ModernReservationTransactionsListResult; + +/** Optional parameters. */ +export interface PriceSheetGetOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. */ + expand?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the top N results. */ + top?: number; +} + +/** Contains response data for the get operation. */ +export type PriceSheetGetResponse = PriceSheetResult; + +/** Optional parameters. */ +export interface PriceSheetGetByBillingPeriodOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. */ + expand?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the top N results. */ + top?: number; +} + +/** Contains response data for the getByBillingPeriod operation. */ +export type PriceSheetGetByBillingPeriodResponse = PriceSheetResult; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface AggregatedCostGetByManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** 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 (:). */ + filter?: string; +} + +/** Contains response data for the getByManagementGroup operation. */ +export type AggregatedCostGetByManagementGroupResponse = ManagementGroupAggregatedCostResult; + +/** Optional parameters. */ +export interface AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getForBillingPeriodByManagementGroup operation. */ +export type AggregatedCostGetForBillingPeriodByManagementGroupResponse = ManagementGroupAggregatedCostResult; + +/** Optional parameters. */ +export interface EventsListByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfile operation. */ +export type EventsListByBillingProfileResponse = Events; + +/** Optional parameters. */ +export interface EventsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the events by lotId, lotSource etc. 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 (:). */ + filter?: string; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type EventsListByBillingAccountResponse = Events; + +/** Optional parameters. */ +export interface EventsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type EventsListByBillingProfileNextResponse = Events; + +/** Optional parameters. */ +export interface EventsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the events by lotId, lotSource etc. 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 (:). */ + filter?: string; +} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type EventsListByBillingAccountNextResponse = Events; + +/** Optional parameters. */ +export interface LotsListByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfile operation. */ +export type LotsListByBillingProfileResponse = Lots; + +/** Optional parameters. */ +export interface LotsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the lots by Status, Source etc. 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 (:). */ + filter?: string; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type LotsListByBillingAccountResponse = Lots; + +/** Optional parameters. */ +export interface LotsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type LotsListByBillingProfileNextResponse = Lots; + +/** Optional parameters. */ +export interface LotsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the lots by Status, Source etc. 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 (:). */ + filter?: string; +} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type LotsListByBillingAccountNextResponse = Lots; + +/** Optional parameters. */ +export interface CreditsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CreditsGetResponse = CreditSummary; + +/** Optional parameters. */ +export interface ConsumptionManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/consumption/arm-consumption/src/models/mappers.ts b/sdk/consumption/arm-consumption/src/models/mappers.ts index 517f8a782f58..206c50f3893a 100644 --- a/sdk/consumption/arm-consumption/src/models/mappers.ts +++ b/sdk/consumption/arm-consumption/src/models/mappers.ts @@ -6,321 +6,3040 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const MeterDetails: msRest.CompositeMapper = { - serializedName: "MeterDetails", +export const UsageDetailsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MeterDetails", + className: "UsageDetailsListResult", modelProperties: { - meterName: { + value: { + serializedName: "value", readOnly: true, - serializedName: "meterName", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UsageDetail" + } + } } }, - meterCategory: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "meterCategory", type: { name: "String" } - }, - meterSubCategory: { + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "meterSubCategory", type: { name: "String" } }, - unit: { + name: { + serializedName: "name", readOnly: true, - serializedName: "unit", type: { name: "String" } }, - meterLocation: { + type: { + serializedName: "type", readOnly: true, - serializedName: "meterLocation", type: { name: "String" } }, - totalIncludedQuantity: { - readOnly: true, - serializedName: "totalIncludedQuantity", - type: { - name: "Number" - } - }, - pretaxStandardRate: { - readOnly: true, - serializedName: "pretaxStandardRate", - type: { - name: "Number" - } - }, - serviceName: { + etag: { + serializedName: "etag", readOnly: true, - serializedName: "serviceName", type: { name: "String" } }, - serviceTier: { + tags: { + serializedName: "tags", readOnly: true, - serializedName: "serviceTier", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ErrorResponse", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorDetails" } - }, - name: { + } + } + } +}; + +export const ErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetails", + modelProperties: { + code: { + serializedName: "code", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + message: { + serializedName: "message", readOnly: true, - serializedName: "type", type: { name: "String" } - }, - tags: { - readOnly: true, - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const UsageDetail: msRest.CompositeMapper = { - serializedName: "UsageDetail", +export const MarketplacesListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UsageDetail", + className: "MarketplacesListResult", modelProperties: { - ...Resource.type.modelProperties, - billingPeriodId: { + value: { + serializedName: "value", readOnly: true, - serializedName: "properties.billingPeriodId", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Marketplace" + } + } } }, - invoiceId: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "properties.invoiceId", type: { name: "String" } - }, - usageStart: { + } + } + } +}; + +export const BudgetsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetsListResult", + modelProperties: { + value: { + serializedName: "value", readOnly: true, - serializedName: "properties.usageStart", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Budget" + } + } } }, - usageEnd: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "properties.usageEnd", type: { - name: "DateTime" + name: "String" } - }, - instanceName: { + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "properties.instanceName", type: { name: "String" } }, - instanceId: { + name: { + serializedName: "name", readOnly: true, - serializedName: "properties.instanceId", type: { name: "String" } }, - instanceLocation: { + type: { + serializedName: "type", readOnly: true, - serializedName: "properties.instanceLocation", type: { name: "String" } }, - currency: { - readOnly: true, - serializedName: "properties.currency", + eTag: { + serializedName: "eTag", type: { name: "String" } - }, - usageQuantity: { - readOnly: true, - serializedName: "properties.usageQuantity", + } + } + } +}; + +export const BudgetTimePeriod: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetTimePeriod", + modelProperties: { + startDate: { + serializedName: "startDate", + required: true, type: { - name: "Number" + name: "DateTime" } }, - billableQuantity: { - readOnly: true, - serializedName: "properties.billableQuantity", + endDate: { + serializedName: "endDate", type: { - name: "Number" + name: "DateTime" } - }, - pretaxCost: { - readOnly: true, - serializedName: "properties.pretaxCost", + } + } + } +}; + +export const BudgetFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetFilter", + modelProperties: { + and: { + serializedName: "and", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BudgetFilterProperties" + } + } } }, - isEstimated: { - readOnly: true, - serializedName: "properties.isEstimated", + not: { + serializedName: "not", type: { - name: "Boolean" + name: "Composite", + className: "BudgetFilterProperties" } }, - meterId: { - readOnly: true, - serializedName: "properties.meterId", + dimensions: { + serializedName: "dimensions", type: { - name: "Uuid" + name: "Composite", + className: "BudgetComparisonExpression" } }, - meterDetails: { - readOnly: true, - serializedName: "properties.meterDetails", + tags: { + serializedName: "tags", type: { name: "Composite", - className: "MeterDetails" + className: "BudgetComparisonExpression" } - }, - subscriptionGuid: { - readOnly: true, - serializedName: "properties.subscriptionGuid", + } + } + } +}; + +export const BudgetFilterProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetFilterProperties", + modelProperties: { + dimensions: { + serializedName: "dimensions", type: { - name: "Uuid" + name: "Composite", + className: "BudgetComparisonExpression" } }, - subscriptionName: { - readOnly: true, - serializedName: "properties.subscriptionName", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Composite", + className: "BudgetComparisonExpression" } - }, - accountName: { - readOnly: true, - serializedName: "properties.accountName", + } + } + } +}; + +export const BudgetComparisonExpression: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetComparisonExpression", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + operator: { + serializedName: "operator", + required: true, + type: { + name: "String" + } + }, + values: { + serializedName: "values", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CurrentSpend: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CurrentSpend", + modelProperties: { + amount: { + serializedName: "amount", + readOnly: true, + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Notification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Notification", + modelProperties: { + enabled: { + serializedName: "enabled", + required: true, + type: { + name: "Boolean" + } + }, + operator: { + serializedName: "operator", + required: true, + type: { + name: "String" + } + }, + threshold: { + serializedName: "threshold", + required: true, + type: { + name: "Number" + } + }, + contactEmails: { + constraints: { + MaxItems: 50 + }, + serializedName: "contactEmails", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + contactRoles: { + serializedName: "contactRoles", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + contactGroups: { + constraints: { + MaxItems: 50 + }, + serializedName: "contactGroups", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + thresholdType: { + defaultValue: "Actual", + serializedName: "thresholdType", + type: { + name: "String" + } + }, + locale: { + serializedName: "locale", + type: { + name: "String" + } + } + } + } +}; + +export const ForecastSpend: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ForecastSpend", + modelProperties: { + amount: { + serializedName: "amount", + readOnly: true, + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Tag: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Tag", + modelProperties: { + key: { + serializedName: "key", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ChargesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChargesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ChargeSummary" + } + } + } + } + } + } +}; + +export const BalancePropertiesNewPurchasesDetailsItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BalancePropertiesNewPurchasesDetailsItem", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const BalancePropertiesAdjustmentDetailsItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BalancePropertiesAdjustmentDetailsItem", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ReservationSummariesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationSummariesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationSummary" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationDetailsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationDetailsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationDetail" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationRecommendation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + }, + previousLink: { + serializedName: "previousLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResourceAttributes: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceAttributes", + modelProperties: { + location: { + serializedName: "location", + readOnly: true, + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationDetailsResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsResourceProperties", + modelProperties: { + appliedScopes: { + serializedName: "appliedScopes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + onDemandRate: { + serializedName: "onDemandRate", + readOnly: true, + type: { + name: "Number" + } + }, + product: { + serializedName: "product", + readOnly: true, + type: { + name: "String" + } + }, + region: { + serializedName: "region", + readOnly: true, + type: { + name: "String" + } + }, + reservationRate: { + serializedName: "reservationRate", + readOnly: true, + type: { + name: "Number" + } + }, + resourceType: { + serializedName: "resourceType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationDetailsSavingsProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsSavingsProperties", + modelProperties: { + calculatedSavings: { + serializedName: "calculatedSavings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: + "ReservationRecommendationDetailsCalculatedSavingsProperties" + } + } + } + }, + lookBackPeriod: { + serializedName: "lookBackPeriod", + readOnly: true, + type: { + name: "Number" + } + }, + recommendedQuantity: { + serializedName: "recommendedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + reservationOrderTerm: { + serializedName: "reservationOrderTerm", + readOnly: true, + type: { + name: "String" + } + }, + savingsType: { + serializedName: "savingsType", + readOnly: true, + type: { + name: "String" + } + }, + unitOfMeasure: { + serializedName: "unitOfMeasure", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationDetailsCalculatedSavingsProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsCalculatedSavingsProperties", + modelProperties: { + onDemandCost: { + serializedName: "onDemandCost", + readOnly: true, + type: { + name: "Number" + } + }, + overageCost: { + serializedName: "overageCost", + readOnly: true, + type: { + name: "Number" + } + }, + quantity: { + serializedName: "quantity", + readOnly: true, + type: { + name: "Number" + } + }, + reservationCost: { + serializedName: "reservationCost", + readOnly: true, + type: { + name: "Number" + } + }, + totalReservationCost: { + serializedName: "totalReservationCost", + readOnly: true, + type: { + name: "Number" + } + }, + reservedUnitCount: { + serializedName: "reservedUnitCount", + type: { + name: "Number" + } + }, + savings: { + serializedName: "savings", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ReservationRecommendationDetailsUsageProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsUsageProperties", + modelProperties: { + firstConsumptionDate: { + serializedName: "firstConsumptionDate", + readOnly: true, + type: { + name: "String" + } + }, + lastConsumptionDate: { + serializedName: "lastConsumptionDate", + readOnly: true, + type: { + name: "String" + } + }, + lookBackUnitType: { + serializedName: "lookBackUnitType", + readOnly: true, + type: { + name: "String" + } + }, + usageData: { + serializedName: "usageData", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + }, + usageGrain: { + serializedName: "usageGrain", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const HighCasedErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HighCasedErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "HighCasedErrorDetails" + } + } + } + } +}; + +export const HighCasedErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HighCasedErrorDetails", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationTransactionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationTransactionsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationTransaction" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationTransactionResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationTransactionResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ModernReservationTransactionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModernReservationTransactionsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ModernReservationTransaction" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PriceSheetProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PriceSheetProperties", + modelProperties: { + billingPeriodId: { + serializedName: "billingPeriodId", + readOnly: true, + type: { + name: "String" + } + }, + meterId: { + serializedName: "meterId", + readOnly: true, + type: { + name: "Uuid" + } + }, + meterDetails: { + serializedName: "meterDetails", + type: { + name: "Composite", + className: "MeterDetails" + } + }, + unitOfMeasure: { + serializedName: "unitOfMeasure", + readOnly: true, + type: { + name: "String" + } + }, + includedQuantity: { + serializedName: "includedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + partNumber: { + serializedName: "partNumber", + readOnly: true, + type: { + name: "String" + } + }, + unitPrice: { + serializedName: "unitPrice", + readOnly: true, + type: { + name: "Number" + } + }, + currencyCode: { + serializedName: "currencyCode", + readOnly: true, + type: { + name: "String" + } + }, + offerId: { + serializedName: "offerId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MeterDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MeterDetails", + modelProperties: { + meterName: { + serializedName: "meterName", + readOnly: true, + type: { + name: "String" + } + }, + meterCategory: { + serializedName: "meterCategory", + readOnly: true, + type: { + name: "String" + } + }, + meterSubCategory: { + serializedName: "meterSubCategory", + readOnly: true, + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String" + } + }, + meterLocation: { + serializedName: "meterLocation", + readOnly: true, + type: { + name: "String" + } + }, + totalIncludedQuantity: { + serializedName: "totalIncludedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + pretaxStandardRate: { + serializedName: "pretaxStandardRate", + readOnly: true, + type: { + name: "Number" + } + }, + serviceName: { + serializedName: "serviceName", + readOnly: true, + type: { + name: "String" + } + }, + serviceTier: { + serializedName: "serviceTier", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Events: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Events", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventSummary" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Amount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Amount", + modelProperties: { + currency: { + serializedName: "currency", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const Reseller: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Reseller", + modelProperties: { + resellerId: { + serializedName: "resellerId", + readOnly: true, + type: { + name: "String" + } + }, + resellerDescription: { + serializedName: "resellerDescription", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Lots: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Lots", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LotSummary" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CreditBalanceSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreditBalanceSummary", + modelProperties: { + estimatedBalance: { + serializedName: "estimatedBalance", + type: { + name: "Composite", + className: "Amount" + } + }, + currentBalance: { + serializedName: "currentBalance", + type: { + name: "Composite", + className: "Amount" + } + }, + estimatedBalanceInBillingCurrency: { + serializedName: "estimatedBalanceInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + } + } + } +}; + +export const MeterDetailsResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MeterDetailsResponse", + modelProperties: { + meterName: { + serializedName: "meterName", + readOnly: true, + type: { + name: "String" + } + }, + meterCategory: { + serializedName: "meterCategory", + readOnly: true, + type: { + name: "String" + } + }, + meterSubCategory: { + serializedName: "meterSubCategory", + readOnly: true, + type: { + name: "String" + } + }, + unitOfMeasure: { + serializedName: "unitOfMeasure", + readOnly: true, + type: { + name: "String" + } + }, + serviceFamily: { + serializedName: "serviceFamily", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SkuProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuProperty", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DownloadProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DownloadProperties", + modelProperties: { + downloadUrl: { + serializedName: "downloadUrl", + readOnly: true, + type: { + name: "String" + } + }, + validTill: { + serializedName: "validTill", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const UsageDetail: coreClient.CompositeMapper = { + serializedName: "UsageDetail", + type: { + name: "Composite", + className: "UsageDetail", + uberParent: "Resource", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...Resource.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Marketplace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Marketplace", + modelProperties: { + ...Resource.type.modelProperties, + billingPeriodId: { + serializedName: "properties.billingPeriodId", + readOnly: true, + type: { + name: "String" + } + }, + usageStart: { + serializedName: "properties.usageStart", + readOnly: true, + type: { + name: "DateTime" + } + }, + usageEnd: { + serializedName: "properties.usageEnd", + readOnly: true, + type: { + name: "DateTime" + } + }, + resourceRate: { + serializedName: "properties.resourceRate", + readOnly: true, + type: { + name: "Number" + } + }, + offerName: { + serializedName: "properties.offerName", + readOnly: true, + type: { + name: "String" + } + }, + resourceGroup: { + serializedName: "properties.resourceGroup", + readOnly: true, + type: { + name: "String" + } + }, + additionalInfo: { + serializedName: "properties.additionalInfo", + readOnly: true, + type: { + name: "String" + } + }, + orderNumber: { + serializedName: "properties.orderNumber", + readOnly: true, + type: { + name: "String" + } + }, + instanceName: { + serializedName: "properties.instanceName", + readOnly: true, + type: { + name: "String" + } + }, + instanceId: { + serializedName: "properties.instanceId", + readOnly: true, + type: { + name: "String" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + consumedQuantity: { + serializedName: "properties.consumedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + unitOfMeasure: { + serializedName: "properties.unitOfMeasure", + readOnly: true, + type: { + name: "String" + } + }, + pretaxCost: { + serializedName: "properties.pretaxCost", + readOnly: true, + type: { + name: "Number" + } + }, + isEstimated: { + serializedName: "properties.isEstimated", + readOnly: true, + type: { + name: "Boolean" + } + }, + meterId: { + serializedName: "properties.meterId", + readOnly: true, + type: { + name: "Uuid" + } + }, + subscriptionGuid: { + serializedName: "properties.subscriptionGuid", + readOnly: true, + type: { + name: "Uuid" + } + }, + subscriptionName: { + serializedName: "properties.subscriptionName", + readOnly: true, + type: { + name: "String" + } + }, + accountName: { + serializedName: "properties.accountName", + readOnly: true, + type: { + name: "String" + } + }, + departmentName: { + serializedName: "properties.departmentName", + readOnly: true, + type: { + name: "String" + } + }, + consumedService: { + serializedName: "properties.consumedService", + readOnly: true, + type: { + name: "String" + } + }, + costCenter: { + serializedName: "properties.costCenter", + readOnly: true, + type: { + name: "String" + } + }, + additionalProperties: { + serializedName: "properties.additionalProperties", + readOnly: true, + type: { + name: "String" + } + }, + publisherName: { + serializedName: "properties.publisherName", + readOnly: true, + type: { + name: "String" + } + }, + planName: { + serializedName: "properties.planName", + readOnly: true, + type: { + name: "String" + } + }, + isRecurringCharge: { + serializedName: "properties.isRecurringCharge", + readOnly: true, + type: { + name: "Boolean" + } + } + } + } +}; + +export const Balance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Balance", + modelProperties: { + ...Resource.type.modelProperties, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + beginningBalance: { + serializedName: "properties.beginningBalance", + readOnly: true, + type: { + name: "Number" + } + }, + endingBalance: { + serializedName: "properties.endingBalance", + readOnly: true, + type: { + name: "Number" + } + }, + newPurchases: { + serializedName: "properties.newPurchases", + readOnly: true, + type: { + name: "Number" + } + }, + adjustments: { + serializedName: "properties.adjustments", + readOnly: true, + type: { + name: "Number" + } + }, + utilized: { + serializedName: "properties.utilized", + readOnly: true, + type: { + name: "Number" + } + }, + serviceOverage: { + serializedName: "properties.serviceOverage", + readOnly: true, + type: { + name: "Number" + } + }, + chargesBilledSeparately: { + serializedName: "properties.chargesBilledSeparately", + readOnly: true, + type: { + name: "Number" + } + }, + totalOverage: { + serializedName: "properties.totalOverage", + readOnly: true, + type: { + name: "Number" + } + }, + totalUsage: { + serializedName: "properties.totalUsage", + readOnly: true, + type: { + name: "Number" + } + }, + azureMarketplaceServiceCharges: { + serializedName: "properties.azureMarketplaceServiceCharges", + readOnly: true, + type: { + name: "Number" + } + }, + billingFrequency: { + serializedName: "properties.billingFrequency", + type: { + name: "String" + } + }, + priceHidden: { + serializedName: "properties.priceHidden", + readOnly: true, + type: { + name: "Boolean" + } + }, + newPurchasesDetails: { + serializedName: "properties.newPurchasesDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BalancePropertiesNewPurchasesDetailsItem" + } + } + } + }, + adjustmentDetails: { + serializedName: "properties.adjustmentDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BalancePropertiesAdjustmentDetailsItem" + } + } + } + } + } + } +}; + +export const ReservationSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationSummary", + modelProperties: { + ...Resource.type.modelProperties, + reservationOrderId: { + serializedName: "properties.reservationOrderId", + readOnly: true, + type: { + name: "String" + } + }, + reservationId: { + serializedName: "properties.reservationId", + readOnly: true, + type: { + name: "String" + } + }, + skuName: { + serializedName: "properties.skuName", + readOnly: true, + type: { + name: "String" + } + }, + reservedHours: { + serializedName: "properties.reservedHours", + readOnly: true, + type: { + name: "Number" + } + }, + usageDate: { + serializedName: "properties.usageDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + usedHours: { + serializedName: "properties.usedHours", + readOnly: true, + type: { + name: "Number" + } + }, + minUtilizationPercentage: { + serializedName: "properties.minUtilizationPercentage", + readOnly: true, + type: { + name: "Number" + } + }, + avgUtilizationPercentage: { + serializedName: "properties.avgUtilizationPercentage", + readOnly: true, + type: { + name: "Number" + } + }, + maxUtilizationPercentage: { + serializedName: "properties.maxUtilizationPercentage", + readOnly: true, + type: { + name: "Number" + } + }, + kind: { + serializedName: "properties.kind", + readOnly: true, + type: { + name: "String" + } + }, + purchasedQuantity: { + serializedName: "properties.purchasedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + remainingQuantity: { + serializedName: "properties.remainingQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + totalReservedQuantity: { + serializedName: "properties.totalReservedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + usedQuantity: { + serializedName: "properties.usedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + utilizedPercentage: { + serializedName: "properties.utilizedPercentage", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ReservationDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationDetail", + modelProperties: { + ...Resource.type.modelProperties, + reservationOrderId: { + serializedName: "properties.reservationOrderId", + readOnly: true, + type: { + name: "String" + } + }, + instanceFlexibilityRatio: { + serializedName: "properties.instanceFlexibilityRatio", + readOnly: true, + type: { + name: "String" + } + }, + instanceFlexibilityGroup: { + serializedName: "properties.instanceFlexibilityGroup", + readOnly: true, + type: { + name: "String" + } + }, + reservationId: { + serializedName: "properties.reservationId", + readOnly: true, + type: { + name: "String" + } + }, + skuName: { + serializedName: "properties.skuName", + readOnly: true, + type: { + name: "String" + } + }, + reservedHours: { + serializedName: "properties.reservedHours", + readOnly: true, + type: { + name: "Number" + } + }, + usageDate: { + serializedName: "properties.usageDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + usedHours: { + serializedName: "properties.usedHours", + readOnly: true, + type: { + name: "Number" + } + }, + instanceId: { + serializedName: "properties.instanceId", + readOnly: true, + type: { + name: "String" + } + }, + totalReservedQuantity: { + serializedName: "properties.totalReservedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + kind: { + serializedName: "properties.kind", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendation: coreClient.CompositeMapper = { + serializedName: "ReservationRecommendation", + type: { + name: "Composite", + className: "ReservationRecommendation", + uberParent: "Resource", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...Resource.type.modelProperties, + ...ResourceAttributes.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationDetailsModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsModel", + modelProperties: { + ...Resource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "String" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "ReservationRecommendationDetailsResourceProperties" + } + }, + resourceGroup: { + serializedName: "properties.resourceGroup", + readOnly: true, + type: { + name: "String" + } + }, + savings: { + serializedName: "properties.savings", + type: { + name: "Composite", + className: "ReservationRecommendationDetailsSavingsProperties" + } + }, + scope: { + serializedName: "properties.scope", + readOnly: true, + type: { + name: "String" + } + }, + usage: { + serializedName: "properties.usage", + type: { + name: "Composite", + className: "ReservationRecommendationDetailsUsageProperties" + } + } + } + } +}; + +export const PriceSheetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PriceSheetResult", + modelProperties: { + ...Resource.type.modelProperties, + pricesheets: { + serializedName: "properties.pricesheets", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PriceSheetProperties" + } + } + } + }, + nextLink: { + serializedName: "properties.nextLink", + readOnly: true, + type: { + name: "String" + } + }, + download: { + serializedName: "properties.download", + type: { + name: "Composite", + className: "MeterDetails" + } + } + } + } +}; + +export const ManagementGroupAggregatedCostResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagementGroupAggregatedCostResult", + modelProperties: { + ...Resource.type.modelProperties, + billingPeriodId: { + serializedName: "properties.billingPeriodId", + readOnly: true, + type: { + name: "String" + } + }, + usageStart: { + serializedName: "properties.usageStart", + readOnly: true, + type: { + name: "DateTime" + } + }, + usageEnd: { + serializedName: "properties.usageEnd", + readOnly: true, + type: { + name: "DateTime" + } + }, + azureCharges: { + serializedName: "properties.azureCharges", + readOnly: true, + type: { + name: "Number" + } + }, + marketplaceCharges: { + serializedName: "properties.marketplaceCharges", + readOnly: true, + type: { + name: "Number" + } + }, + chargesBilledSeparately: { + serializedName: "properties.chargesBilledSeparately", + readOnly: true, + type: { + name: "Number" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + children: { + serializedName: "properties.children", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagementGroupAggregatedCostResult" + } + } + } + }, + includedSubscriptions: { + serializedName: "properties.includedSubscriptions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + excludedSubscriptions: { + serializedName: "properties.excludedSubscriptions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CreditSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreditSummary", + modelProperties: { + ...Resource.type.modelProperties, + balanceSummary: { + serializedName: "properties.balanceSummary", + type: { + name: "Composite", + className: "CreditBalanceSummary" + } + }, + pendingCreditAdjustments: { + serializedName: "properties.pendingCreditAdjustments", + type: { + name: "Composite", + className: "Amount" + } + }, + expiredCredit: { + serializedName: "properties.expiredCredit", + type: { + name: "Composite", + className: "Amount" + } + }, + pendingEligibleCharges: { + serializedName: "properties.pendingEligibleCharges", + type: { + name: "Composite", + className: "Amount" + } + }, + creditCurrency: { + serializedName: "properties.creditCurrency", + readOnly: true, + type: { + name: "String" + } + }, + billingCurrency: { + serializedName: "properties.billingCurrency", + readOnly: true, + type: { + name: "String" + } + }, + reseller: { + serializedName: "properties.reseller", + type: { + name: "Composite", + className: "Reseller" + } + }, + eTag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Budget: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Budget", + modelProperties: { + ...ProxyResource.type.modelProperties, + category: { + serializedName: "properties.category", + type: { + name: "String" + } + }, + amount: { + serializedName: "properties.amount", + type: { + name: "Number" + } + }, + timeGrain: { + serializedName: "properties.timeGrain", + type: { + name: "String" + } + }, + timePeriod: { + serializedName: "properties.timePeriod", + type: { + name: "Composite", + className: "BudgetTimePeriod" + } + }, + filter: { + serializedName: "properties.filter", + type: { + name: "Composite", + className: "BudgetFilter" + } + }, + currentSpend: { + serializedName: "properties.currentSpend", + type: { + name: "Composite", + className: "CurrentSpend" + } + }, + notifications: { + serializedName: "properties.notifications", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "Notification" } } + } + }, + forecastSpend: { + serializedName: "properties.forecastSpend", + type: { + name: "Composite", + className: "ForecastSpend" + } + } + } + } +}; + +export const TagsResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsResult", + modelProperties: { + ...ProxyResource.type.modelProperties, + tags: { + serializedName: "properties.tags", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Tag" + } + } + } + }, + nextLink: { + serializedName: "properties.nextLink", + readOnly: true, + type: { + name: "String" + } + }, + previousLink: { + serializedName: "properties.previousLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ChargeSummary: coreClient.CompositeMapper = { + serializedName: "ChargeSummary", + type: { + name: "Composite", + className: "ChargeSummary", + uberParent: "ProxyResource", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...ProxyResource.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const EventSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventSummary", + modelProperties: { + ...ProxyResource.type.modelProperties, + transactionDate: { + serializedName: "properties.transactionDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + newCredit: { + serializedName: "properties.newCredit", + type: { + name: "Composite", + className: "Amount" + } + }, + adjustments: { + serializedName: "properties.adjustments", + type: { + name: "Composite", + className: "Amount" + } + }, + creditExpired: { + serializedName: "properties.creditExpired", + type: { + name: "Composite", + className: "Amount" + } + }, + charges: { + serializedName: "properties.charges", + type: { + name: "Composite", + className: "Amount" + } + }, + closedBalance: { + serializedName: "properties.closedBalance", + type: { + name: "Composite", + className: "Amount" + } + }, + eventType: { + serializedName: "properties.eventType", + type: { + name: "String" + } + }, + invoiceNumber: { + serializedName: "properties.invoiceNumber", + readOnly: true, + type: { + name: "String" + } + }, + billingProfileId: { + serializedName: "properties.billingProfileId", + readOnly: true, + type: { + name: "String" + } + }, + billingProfileDisplayName: { + serializedName: "properties.billingProfileDisplayName", + readOnly: true, + type: { + name: "String" + } + }, + lotId: { + serializedName: "properties.lotId", + readOnly: true, + type: { + name: "String" + } + }, + lotSource: { + serializedName: "properties.lotSource", + readOnly: true, + type: { + name: "String" + } + }, + canceledCredit: { + serializedName: "properties.canceledCredit", + type: { + name: "Composite", + className: "Amount" + } + }, + creditCurrency: { + serializedName: "properties.creditCurrency", + readOnly: true, + type: { + name: "String" + } + }, + billingCurrency: { + serializedName: "properties.billingCurrency", + readOnly: true, + type: { + name: "String" + } + }, + reseller: { + serializedName: "properties.reseller", + type: { + name: "Composite", + className: "Reseller" + } + }, + creditExpiredInBillingCurrency: { + serializedName: "properties.creditExpiredInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + newCreditInBillingCurrency: { + serializedName: "properties.newCreditInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + adjustmentsInBillingCurrency: { + serializedName: "properties.adjustmentsInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + chargesInBillingCurrency: { + serializedName: "properties.chargesInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + closedBalanceInBillingCurrency: { + serializedName: "properties.closedBalanceInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + eTagPropertiesETag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const LotSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LotSummary", + modelProperties: { + ...ProxyResource.type.modelProperties, + originalAmount: { + serializedName: "properties.originalAmount", + type: { + name: "Composite", + className: "Amount" + } + }, + closedBalance: { + serializedName: "properties.closedBalance", + type: { + name: "Composite", + className: "Amount" + } + }, + source: { + serializedName: "properties.source", + readOnly: true, + type: { + name: "String" + } + }, + startDate: { + serializedName: "properties.startDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + expirationDate: { + serializedName: "properties.expirationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + poNumber: { + serializedName: "properties.poNumber", + readOnly: true, + type: { + name: "String" + } + }, + purchasedDate: { + serializedName: "properties.purchasedDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + }, + creditCurrency: { + serializedName: "properties.creditCurrency", + readOnly: true, + type: { + name: "String" + } + }, + billingCurrency: { + serializedName: "properties.billingCurrency", + readOnly: true, + type: { + name: "String" + } + }, + originalAmountInBillingCurrency: { + serializedName: "properties.originalAmountInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + closedBalanceInBillingCurrency: { + serializedName: "properties.closedBalanceInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + reseller: { + serializedName: "properties.reseller", + type: { + name: "Composite", + className: "Reseller" + } + }, + eTagPropertiesETag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationTransaction: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationTransaction", + modelProperties: { + ...ReservationTransactionResource.type.modelProperties, + eventDate: { + serializedName: "properties.eventDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + reservationOrderId: { + serializedName: "properties.reservationOrderId", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + eventType: { + serializedName: "properties.eventType", + readOnly: true, + type: { + name: "String" + } + }, + quantity: { + serializedName: "properties.quantity", + readOnly: true, + type: { + name: "Number" + } + }, + amount: { + serializedName: "properties.amount", + readOnly: true, + type: { + name: "Number" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + reservationOrderName: { + serializedName: "properties.reservationOrderName", + readOnly: true, + type: { + name: "String" + } + }, + purchasingEnrollment: { + serializedName: "properties.purchasingEnrollment", + readOnly: true, + type: { + name: "String" + } + }, + purchasingSubscriptionGuid: { + serializedName: "properties.purchasingSubscriptionGuid", + readOnly: true, + type: { + name: "Uuid" + } + }, + purchasingSubscriptionName: { + serializedName: "properties.purchasingSubscriptionName", + readOnly: true, + type: { + name: "String" + } + }, + armSkuName: { + serializedName: "properties.armSkuName", + readOnly: true, + type: { + name: "String" + } + }, + term: { + serializedName: "properties.term", + readOnly: true, + type: { + name: "String" + } + }, + region: { + serializedName: "properties.region", + readOnly: true, + type: { + name: "String" + } + }, + accountName: { + serializedName: "properties.accountName", + readOnly: true, + type: { + name: "String" + } + }, + accountOwnerEmail: { + serializedName: "properties.accountOwnerEmail", + readOnly: true, + type: { + name: "String" + } + }, + departmentName: { + serializedName: "properties.departmentName", + readOnly: true, + type: { + name: "String" + } + }, + costCenter: { + serializedName: "properties.costCenter", + readOnly: true, + type: { + name: "String" + } + }, + currentEnrollment: { + serializedName: "properties.currentEnrollment", + readOnly: true, + type: { + name: "String" + } + }, + billingFrequency: { + serializedName: "properties.billingFrequency", + readOnly: true, + type: { + name: "String" + } + }, + billingMonth: { + serializedName: "properties.billingMonth", + readOnly: true, + type: { + name: "Number" + } + }, + monetaryCommitment: { + serializedName: "properties.monetaryCommitment", + readOnly: true, + type: { + name: "Number" + } + }, + overage: { + serializedName: "properties.overage", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ModernReservationTransaction: coreClient.CompositeMapper = { + serializedName: "Modern", + type: { + name: "Composite", + className: "ModernReservationTransaction", + modelProperties: { + ...ReservationTransactionResource.type.modelProperties, + amount: { + serializedName: "properties.amount", + readOnly: true, + type: { + name: "Number" + } + }, + armSkuName: { + serializedName: "properties.armSkuName", + readOnly: true, + type: { + name: "String" + } + }, + billingFrequency: { + serializedName: "properties.billingFrequency", + readOnly: true, + type: { + name: "String" + } + }, + billingProfileId: { + serializedName: "properties.billingProfileId", + readOnly: true, + type: { + name: "String" + } + }, + billingProfileName: { + serializedName: "properties.billingProfileName", + readOnly: true, + type: { + name: "String" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + eventDate: { + serializedName: "properties.eventDate", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - departmentName: { + eventType: { + serializedName: "properties.eventType", readOnly: true, - serializedName: "properties.departmentName", type: { name: "String" } }, - product: { + invoice: { + serializedName: "properties.invoice", readOnly: true, - serializedName: "properties.product", type: { name: "String" } }, - consumedService: { + invoiceId: { + serializedName: "properties.invoiceId", readOnly: true, - serializedName: "properties.consumedService", type: { name: "String" } }, - costCenter: { + invoiceSectionId: { + serializedName: "properties.invoiceSectionId", readOnly: true, - serializedName: "properties.costCenter", type: { name: "String" } }, - partNumber: { + invoiceSectionName: { + serializedName: "properties.invoiceSectionName", readOnly: true, - serializedName: "properties.partNumber", type: { name: "String" } }, - resourceGuid: { + purchasingSubscriptionGuid: { + serializedName: "properties.purchasingSubscriptionGuid", + readOnly: true, + type: { + name: "Uuid" + } + }, + purchasingSubscriptionName: { + serializedName: "properties.purchasingSubscriptionName", readOnly: true, - serializedName: "properties.resourceGuid", type: { name: "String" } }, - offerId: { + quantity: { + serializedName: "properties.quantity", + readOnly: true, + type: { + name: "Number" + } + }, + region: { + serializedName: "properties.region", readOnly: true, - serializedName: "properties.offerId", type: { name: "String" } }, - chargesBilledSeparately: { + reservationOrderId: { + serializedName: "properties.reservationOrderId", readOnly: true, - serializedName: "properties.chargesBilledSeparately", type: { - name: "Boolean" + name: "String" } }, - location: { + reservationOrderName: { + serializedName: "properties.reservationOrderName", readOnly: true, - serializedName: "properties.location", type: { name: "String" } }, - additionalProperties: { + term: { + serializedName: "properties.term", readOnly: true, - serializedName: "properties.additionalProperties", type: { name: "String" } @@ -329,1128 +3048,860 @@ export const UsageDetail: msRest.CompositeMapper = { } }; -export const Marketplace: msRest.CompositeMapper = { - serializedName: "Marketplace", +export const AmountWithExchangeRate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Marketplace", + className: "AmountWithExchangeRate", modelProperties: { - ...Resource.type.modelProperties, - billingPeriodId: { + ...Amount.type.modelProperties, + exchangeRate: { + serializedName: "exchangeRate", readOnly: true, - serializedName: "properties.billingPeriodId", type: { - name: "String" + name: "Number" } }, - usageStart: { + exchangeRateMonth: { + serializedName: "exchangeRateMonth", readOnly: true, - serializedName: "properties.usageStart", type: { - name: "DateTime" + name: "Number" } - }, - usageEnd: { + } + } + } +}; + +export const LegacyUsageDetail: coreClient.CompositeMapper = { + serializedName: "legacy", + type: { + name: "Composite", + className: "LegacyUsageDetail", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, + modelProperties: { + ...UsageDetail.type.modelProperties, + billingAccountId: { + serializedName: "properties.billingAccountId", readOnly: true, - serializedName: "properties.usageEnd", type: { - name: "DateTime" + name: "String" } }, - resourceRate: { + billingAccountName: { + serializedName: "properties.billingAccountName", readOnly: true, - serializedName: "properties.resourceRate", type: { - name: "Number" + name: "String" } }, - offerName: { + billingPeriodStartDate: { + serializedName: "properties.billingPeriodStartDate", readOnly: true, - serializedName: "properties.offerName", type: { - name: "String" + name: "DateTime" } }, - resourceGroup: { + billingPeriodEndDate: { + serializedName: "properties.billingPeriodEndDate", readOnly: true, - serializedName: "properties.resourceGroup", type: { - name: "String" + name: "DateTime" } }, - orderNumber: { + billingProfileId: { + serializedName: "properties.billingProfileId", readOnly: true, - serializedName: "properties.orderNumber", type: { name: "String" } }, - instanceName: { + billingProfileName: { + serializedName: "properties.billingProfileName", readOnly: true, - serializedName: "properties.instanceName", type: { name: "String" } }, - instanceId: { + accountOwnerId: { + serializedName: "properties.accountOwnerId", readOnly: true, - serializedName: "properties.instanceId", type: { name: "String" } }, - currency: { + accountName: { + serializedName: "properties.accountName", readOnly: true, - serializedName: "properties.currency", type: { name: "String" } }, - consumedQuantity: { + subscriptionId: { + serializedName: "properties.subscriptionId", readOnly: true, - serializedName: "properties.consumedQuantity", type: { - name: "Number" + name: "String" } }, - unitOfMeasure: { + subscriptionName: { + serializedName: "properties.subscriptionName", readOnly: true, - serializedName: "properties.unitOfMeasure", type: { name: "String" } }, - pretaxCost: { + date: { + serializedName: "properties.date", readOnly: true, - serializedName: "properties.pretaxCost", type: { - name: "Number" + name: "DateTime" } }, - isEstimated: { + product: { + serializedName: "properties.product", readOnly: true, - serializedName: "properties.isEstimated", type: { - name: "Boolean" + name: "String" } }, - meterId: { + partNumber: { + serializedName: "properties.partNumber", readOnly: true, - serializedName: "properties.meterId", type: { - name: "Uuid" + name: "String" } }, - subscriptionGuid: { + meterId: { + serializedName: "properties.meterId", readOnly: true, - serializedName: "properties.subscriptionGuid", type: { name: "Uuid" } }, - subscriptionName: { - readOnly: true, - serializedName: "properties.subscriptionName", + meterDetails: { + serializedName: "properties.meterDetails", type: { - name: "String" + name: "Composite", + className: "MeterDetailsResponse" } }, - accountName: { + quantity: { + serializedName: "properties.quantity", readOnly: true, - serializedName: "properties.accountName", type: { - name: "String" + name: "Number" } }, - departmentName: { + effectivePrice: { + serializedName: "properties.effectivePrice", readOnly: true, - serializedName: "properties.departmentName", type: { - name: "String" + name: "Number" } }, - consumedService: { + cost: { + serializedName: "properties.cost", readOnly: true, - serializedName: "properties.consumedService", type: { - name: "String" + name: "Number" } }, - costCenter: { + unitPrice: { + serializedName: "properties.unitPrice", readOnly: true, - serializedName: "properties.costCenter", type: { - name: "String" + name: "Number" } }, - additionalProperties: { + billingCurrency: { + serializedName: "properties.billingCurrency", readOnly: true, - serializedName: "properties.additionalProperties", type: { name: "String" } }, - publisherName: { + resourceLocation: { + serializedName: "properties.resourceLocation", readOnly: true, - serializedName: "properties.publisherName", type: { name: "String" } }, - planName: { + consumedService: { + serializedName: "properties.consumedService", readOnly: true, - serializedName: "properties.planName", type: { name: "String" } }, - isRecurringCharge: { - readOnly: true, - serializedName: "properties.isRecurringCharge", - type: { - name: "Boolean" - } - } - } - } -}; - -export const Tenant: msRest.CompositeMapper = { - serializedName: "Tenant", - type: { - name: "Composite", - className: "Tenant", - modelProperties: { - ...Resource.type.modelProperties, - billingProfileName: { + resourceId: { + serializedName: "properties.resourceId", readOnly: true, - serializedName: "properties.billingProfileName", type: { name: "String" } }, - billingAccountId: { + resourceName: { + serializedName: "properties.resourceName", readOnly: true, - serializedName: "properties.billingAccountId", type: { name: "String" } }, - tenantId: { + serviceInfo1: { + serializedName: "properties.serviceInfo1", readOnly: true, - serializedName: "properties.tenantId", type: { name: "String" } }, - billingAccountName: { + serviceInfo2: { + serializedName: "properties.serviceInfo2", readOnly: true, - serializedName: "properties.billingAccountName", type: { name: "String" } - } - } - } -}; - -export const TenantListResult: msRest.CompositeMapper = { - serializedName: "TenantListResult", - type: { - name: "Composite", - className: "TenantListResult", - modelProperties: { - value: { - readOnly: true, - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Tenant" - } - } - } }, - nextLink: { + additionalInfo: { + serializedName: "properties.additionalInfo", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const BalancePropertiesNewPurchasesDetailsItem: msRest.CompositeMapper = { - serializedName: "BalanceProperties_newPurchasesDetailsItem", - type: { - name: "Composite", - className: "BalancePropertiesNewPurchasesDetailsItem", - modelProperties: { - name: { + }, + invoiceSection: { + serializedName: "properties.invoiceSection", readOnly: true, - serializedName: "name", type: { name: "String" } }, - value: { - readOnly: true, - serializedName: "value", - type: { - name: "Number" - } - } - } - } -}; - -export const BalancePropertiesAdjustmentDetailsItem: msRest.CompositeMapper = { - serializedName: "BalanceProperties_adjustmentDetailsItem", - type: { - name: "Composite", - className: "BalancePropertiesAdjustmentDetailsItem", - modelProperties: { - name: { + costCenter: { + serializedName: "properties.costCenter", readOnly: true, - serializedName: "name", type: { name: "String" } }, - value: { - readOnly: true, - serializedName: "value", - type: { - name: "Number" - } - } - } - } -}; - -export const Balance: msRest.CompositeMapper = { - serializedName: "Balance", - type: { - name: "Composite", - className: "Balance", - modelProperties: { - ...Resource.type.modelProperties, - currency: { + resourceGroup: { + serializedName: "properties.resourceGroup", readOnly: true, - serializedName: "properties.currency", type: { name: "String" } }, - beginningBalance: { + reservationId: { + serializedName: "properties.reservationId", readOnly: true, - serializedName: "properties.beginningBalance", type: { - name: "Number" + name: "String" } }, - endingBalance: { + reservationName: { + serializedName: "properties.reservationName", readOnly: true, - serializedName: "properties.endingBalance", type: { - name: "Number" + name: "String" } }, - newPurchases: { + productOrderId: { + serializedName: "properties.productOrderId", readOnly: true, - serializedName: "properties.newPurchases", type: { - name: "Number" + name: "String" } }, - adjustments: { + productOrderName: { + serializedName: "properties.productOrderName", readOnly: true, - serializedName: "properties.adjustments", type: { - name: "Number" + name: "String" } }, - utilized: { + offerId: { + serializedName: "properties.offerId", readOnly: true, - serializedName: "properties.utilized", type: { - name: "Number" + name: "String" } }, - serviceOverage: { + isAzureCreditEligible: { + serializedName: "properties.isAzureCreditEligible", readOnly: true, - serializedName: "properties.serviceOverage", type: { - name: "Number" + name: "Boolean" } }, - chargesBilledSeparately: { + term: { + serializedName: "properties.term", readOnly: true, - serializedName: "properties.chargesBilledSeparately", type: { - name: "Number" + name: "String" } }, - totalOverage: { + publisherName: { + serializedName: "properties.publisherName", readOnly: true, - serializedName: "properties.totalOverage", type: { - name: "Number" + name: "String" } }, - totalUsage: { + publisherType: { + serializedName: "properties.publisherType", readOnly: true, - serializedName: "properties.totalUsage", type: { - name: "Number" + name: "String" } }, - azureMarketplaceServiceCharges: { + planName: { + serializedName: "properties.planName", readOnly: true, - serializedName: "properties.azureMarketplaceServiceCharges", type: { - name: "Number" + name: "String" } }, - billingFrequency: { - serializedName: "properties.billingFrequency", + chargeType: { + serializedName: "properties.chargeType", + readOnly: true, type: { name: "String" } }, - priceHidden: { + frequency: { + serializedName: "properties.frequency", readOnly: true, - serializedName: "properties.priceHidden", type: { - name: "Boolean" + name: "String" } }, - newPurchasesDetails: { + payGPrice: { + serializedName: "properties.payGPrice", readOnly: true, - serializedName: "properties.newPurchasesDetails", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BalancePropertiesNewPurchasesDetailsItem" - } - } + name: "Number" } }, - adjustmentDetails: { + pricingModel: { + serializedName: "properties.pricingModel", readOnly: true, - serializedName: "properties.adjustmentDetails", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BalancePropertiesAdjustmentDetailsItem" - } - } + name: "String" } } } } }; -export const ReservationSummary: msRest.CompositeMapper = { - serializedName: "ReservationSummary", +export const ModernUsageDetail: coreClient.CompositeMapper = { + serializedName: "modern", type: { name: "Composite", - className: "ReservationSummary", + className: "ModernUsageDetail", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - ...Resource.type.modelProperties, - reservationOrderId: { + ...UsageDetail.type.modelProperties, + billingAccountId: { + serializedName: "properties.billingAccountId", readOnly: true, - serializedName: "properties.reservationOrderId", type: { name: "String" } }, - reservationId: { + effectivePrice: { + serializedName: "properties.effectivePrice", readOnly: true, - serializedName: "properties.reservationId", type: { - name: "String" + name: "Number" } }, - skuName: { + pricingModel: { + serializedName: "properties.pricingModel", readOnly: true, - serializedName: "properties.skuName", type: { name: "String" } }, - reservedHours: { + billingAccountName: { + serializedName: "properties.billingAccountName", readOnly: true, - serializedName: "properties.reservedHours", type: { - name: "Number" + name: "String" } }, - usageDate: { + billingPeriodStartDate: { + serializedName: "properties.billingPeriodStartDate", readOnly: true, - serializedName: "properties.usageDate", type: { name: "DateTime" } }, - usedHours: { + billingPeriodEndDate: { + serializedName: "properties.billingPeriodEndDate", readOnly: true, - serializedName: "properties.usedHours", type: { - name: "Number" + name: "DateTime" } }, - minUtilizationPercentage: { + billingProfileId: { + serializedName: "properties.billingProfileId", readOnly: true, - serializedName: "properties.minUtilizationPercentage", type: { - name: "Number" + name: "String" } }, - avgUtilizationPercentage: { + billingProfileName: { + serializedName: "properties.billingProfileName", readOnly: true, - serializedName: "properties.avgUtilizationPercentage", type: { - name: "Number" + name: "String" } }, - maxUtilizationPercentage: { + subscriptionGuid: { + serializedName: "properties.subscriptionGuid", readOnly: true, - serializedName: "properties.maxUtilizationPercentage", type: { - name: "Number" + name: "String" } - } - } - } -}; - -export const ReservationDetail: msRest.CompositeMapper = { - serializedName: "ReservationDetail", - type: { - name: "Composite", - className: "ReservationDetail", - modelProperties: { - ...Resource.type.modelProperties, - reservationOrderId: { + }, + subscriptionName: { + serializedName: "properties.subscriptionName", readOnly: true, - serializedName: "properties.reservationOrderId", type: { name: "String" } }, - reservationId: { + date: { + serializedName: "properties.date", readOnly: true, - serializedName: "properties.reservationId", type: { - name: "String" + name: "DateTime" } }, - skuName: { + product: { + serializedName: "properties.product", readOnly: true, - serializedName: "properties.skuName", type: { name: "String" } }, - reservedHours: { + meterId: { + serializedName: "properties.meterId", readOnly: true, - serializedName: "properties.reservedHours", type: { - name: "Number" + name: "Uuid" } }, - usageDate: { + meterName: { + serializedName: "properties.meterName", readOnly: true, - serializedName: "properties.usageDate", type: { - name: "DateTime" + name: "String" } }, - usedHours: { + meterRegion: { + serializedName: "properties.meterRegion", readOnly: true, - serializedName: "properties.usedHours", type: { - name: "Number" + name: "String" } }, - instanceId: { + meterCategory: { + serializedName: "properties.meterCategory", readOnly: true, - serializedName: "properties.instanceId", type: { name: "String" } }, - totalReservedQuantity: { + meterSubCategory: { + serializedName: "properties.meterSubCategory", readOnly: true, - serializedName: "properties.totalReservedQuantity", type: { - name: "Number" + name: "String" } - } - } - } -}; - -export const ReservationRecommendation: msRest.CompositeMapper = { - serializedName: "ReservationRecommendation", - type: { - name: "Composite", - className: "ReservationRecommendation", - modelProperties: { - id: { + }, + serviceFamily: { + serializedName: "properties.serviceFamily", readOnly: true, - serializedName: "id", type: { name: "String" } }, - name: { + quantity: { + serializedName: "properties.quantity", + readOnly: true, + type: { + name: "Number" + } + }, + unitOfMeasure: { + serializedName: "properties.unitOfMeasure", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + instanceName: { + serializedName: "properties.instanceName", readOnly: true, - serializedName: "type", type: { name: "String" } }, - tags: { + costInUSD: { + serializedName: "properties.costInUSD", readOnly: true, - serializedName: "tags", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Number" } }, - location: { + unitPrice: { + serializedName: "properties.unitPrice", readOnly: true, - serializedName: "location", type: { - name: "String" + name: "Number" } }, - sku: { + billingCurrencyCode: { + serializedName: "properties.billingCurrencyCode", readOnly: true, - serializedName: "sku", type: { name: "String" } }, - lookBackPeriod: { + resourceLocation: { + serializedName: "properties.resourceLocation", readOnly: true, - serializedName: "properties.lookBackPeriod", type: { name: "String" } }, - meterId: { + consumedService: { + serializedName: "properties.consumedService", readOnly: true, - serializedName: "properties.meterId", type: { - name: "Uuid" + name: "String" } }, - term: { + serviceInfo1: { + serializedName: "properties.serviceInfo1", readOnly: true, - serializedName: "properties.term", type: { name: "String" } }, - costWithNoReservedInstances: { + serviceInfo2: { + serializedName: "properties.serviceInfo2", readOnly: true, - serializedName: "properties.costWithNoReservedInstances", type: { - name: "Number" + name: "String" } }, - recommendedQuantity: { + additionalInfo: { + serializedName: "properties.additionalInfo", readOnly: true, - serializedName: "properties.recommendedQuantity", type: { - name: "Number" + name: "String" } }, - totalCostWithReservedInstances: { + invoiceSectionId: { + serializedName: "properties.invoiceSectionId", readOnly: true, - serializedName: "properties.totalCostWithReservedInstances", type: { - name: "Number" + name: "String" } }, - netSavings: { + invoiceSectionName: { + serializedName: "properties.invoiceSectionName", readOnly: true, - serializedName: "properties.netSavings", type: { - name: "Number" + name: "String" } }, - firstUsageDate: { + costCenter: { + serializedName: "properties.costCenter", readOnly: true, - serializedName: "properties.firstUsageDate", type: { - name: "DateTime" + name: "String" } }, - scope: { + resourceGroup: { + serializedName: "properties.resourceGroup", readOnly: true, - serializedName: "properties.scope", type: { name: "String" } - } - } - } -}; - -export const Tag: msRest.CompositeMapper = { - serializedName: "Tag", - type: { - name: "Composite", - className: "Tag", - modelProperties: { - key: { - serializedName: "key", + }, + reservationId: { + serializedName: "properties.reservationId", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - id: { + }, + reservationName: { + serializedName: "properties.reservationName", readOnly: true, - serializedName: "id", type: { name: "String" } }, - name: { + productOrderId: { + serializedName: "properties.productOrderId", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + productOrderName: { + serializedName: "properties.productOrderName", readOnly: true, - serializedName: "type", type: { name: "String" } }, - eTag: { - serializedName: "eTag", + isAzureCreditEligible: { + serializedName: "properties.isAzureCreditEligible", + readOnly: true, + type: { + name: "Boolean" + } + }, + term: { + serializedName: "properties.term", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const TagsResult: msRest.CompositeMapper = { - serializedName: "TagsResult", - type: { - name: "Composite", - className: "TagsResult", - modelProperties: { - ...ProxyResource.type.modelProperties, - tags: { - serializedName: "properties.tags", + }, + publisherName: { + serializedName: "properties.publisherName", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Tag" - } - } + name: "String" } - } - } - } -}; - -export const BudgetTimePeriod: msRest.CompositeMapper = { - serializedName: "BudgetTimePeriod", - type: { - name: "Composite", - className: "BudgetTimePeriod", - modelProperties: { - startDate: { - required: true, - serializedName: "startDate", + }, + publisherType: { + serializedName: "properties.publisherType", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - endDate: { - serializedName: "endDate", + chargeType: { + serializedName: "properties.chargeType", + readOnly: true, type: { - name: "DateTime" + name: "String" } - } - } - } -}; - -export const Filters: msRest.CompositeMapper = { - serializedName: "Filters", - type: { - name: "Composite", - className: "Filters", - modelProperties: { - resourceGroups: { - serializedName: "resourceGroups", - constraints: { - MaxItems: 10, - MinItems: 0 - }, + }, + frequency: { + serializedName: "properties.frequency", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - resources: { - serializedName: "resources", - constraints: { - MaxItems: 10, - MinItems: 0 - }, + costInBillingCurrency: { + serializedName: "properties.costInBillingCurrency", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Number" } }, - meters: { - serializedName: "meters", - constraints: { - MaxItems: 10, - MinItems: 0 - }, + costInPricingCurrency: { + serializedName: "properties.costInPricingCurrency", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Uuid" - } - } + name: "Number" } }, - tags: { - serializedName: "tags", + exchangeRate: { + serializedName: "properties.exchangeRate", + readOnly: true, type: { - name: "Dictionary", - value: { - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } + name: "String" } - } - } - } -}; - -export const CurrentSpend: msRest.CompositeMapper = { - serializedName: "CurrentSpend", - type: { - name: "Composite", - className: "CurrentSpend", - modelProperties: { - amount: { + }, + exchangeRateDate: { + serializedName: "properties.exchangeRateDate", readOnly: true, - serializedName: "amount", type: { - name: "Number" + name: "DateTime" } }, - unit: { + invoiceId: { + serializedName: "properties.invoiceId", readOnly: true, - serializedName: "unit", type: { name: "String" } - } - } - } -}; - -export const Notification: msRest.CompositeMapper = { - serializedName: "Notification", - type: { - name: "Composite", - className: "Notification", - modelProperties: { - enabled: { - required: true, - serializedName: "enabled", + }, + previousInvoiceId: { + serializedName: "properties.previousInvoiceId", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - operator: { - required: true, - serializedName: "operator", + pricingCurrencyCode: { + serializedName: "properties.pricingCurrencyCode", + readOnly: true, type: { name: "String" } }, - threshold: { - required: true, - serializedName: "threshold", + productIdentifier: { + serializedName: "properties.productIdentifier", + readOnly: true, type: { - name: "Number" + name: "String" } }, - contactEmails: { - required: true, - serializedName: "contactEmails", - constraints: { - MaxItems: 50, - MinItems: 1 - }, + resourceLocationNormalized: { + serializedName: "properties.resourceLocationNormalized", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - contactRoles: { - serializedName: "contactRoles", + servicePeriodStartDate: { + serializedName: "properties.servicePeriodStartDate", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTime" } }, - contactGroups: { - serializedName: "contactGroups", - constraints: { - MaxItems: 50, - MinItems: 0 - }, + servicePeriodEndDate: { + serializedName: "properties.servicePeriodEndDate", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTime" } - } - } - } -}; - -export const Budget: msRest.CompositeMapper = { - serializedName: "Budget", - type: { - name: "Composite", - className: "Budget", - modelProperties: { - ...ProxyResource.type.modelProperties, - category: { - required: true, - serializedName: "properties.category", + }, + customerTenantId: { + serializedName: "properties.customerTenantId", + readOnly: true, type: { name: "String" } }, - amount: { - required: true, - serializedName: "properties.amount", + customerName: { + serializedName: "properties.customerName", + readOnly: true, type: { - name: "Number" + name: "String" } }, - timeGrain: { - required: true, - serializedName: "properties.timeGrain", + partnerTenantId: { + serializedName: "properties.partnerTenantId", + readOnly: true, type: { name: "String" } }, - timePeriod: { - required: true, - serializedName: "properties.timePeriod", + partnerName: { + serializedName: "properties.partnerName", + readOnly: true, type: { - name: "Composite", - className: "BudgetTimePeriod" + name: "String" } }, - filters: { - serializedName: "properties.filters", + resellerMpnId: { + serializedName: "properties.resellerMpnId", + readOnly: true, type: { - name: "Composite", - className: "Filters" + name: "String" } }, - currentSpend: { + resellerName: { + serializedName: "properties.resellerName", readOnly: true, - serializedName: "properties.currentSpend", type: { - name: "Composite", - className: "CurrentSpend" + name: "String" } }, - notifications: { - serializedName: "properties.notifications", + publisherId: { + serializedName: "properties.publisherId", + readOnly: true, type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "Notification" - } - } + name: "String" } - } - } - } -}; - -export const PriceSheetProperties: msRest.CompositeMapper = { - serializedName: "PriceSheetProperties", - type: { - name: "Composite", - className: "PriceSheetProperties", - modelProperties: { - billingPeriodId: { + }, + marketPrice: { + serializedName: "properties.marketPrice", readOnly: true, - serializedName: "billingPeriodId", type: { - name: "String" + name: "Number" } }, - meterId: { + exchangeRatePricingToBilling: { + serializedName: "properties.exchangeRatePricingToBilling", readOnly: true, - serializedName: "meterId", type: { - name: "Uuid" + name: "Number" } }, - meterDetails: { + paygCostInBillingCurrency: { + serializedName: "properties.paygCostInBillingCurrency", readOnly: true, - serializedName: "meterDetails", type: { - name: "Composite", - className: "MeterDetails" + name: "Number" } }, - unitOfMeasure: { + paygCostInUSD: { + serializedName: "properties.paygCostInUSD", readOnly: true, - serializedName: "unitOfMeasure", type: { - name: "String" + name: "Number" } }, - includedQuantity: { + partnerEarnedCreditRate: { + serializedName: "properties.partnerEarnedCreditRate", readOnly: true, - serializedName: "includedQuantity", type: { name: "Number" } }, - partNumber: { + partnerEarnedCreditApplied: { + serializedName: "properties.partnerEarnedCreditApplied", readOnly: true, - serializedName: "partNumber", type: { name: "String" } }, - unitPrice: { + payGPrice: { + serializedName: "properties.payGPrice", readOnly: true, - serializedName: "unitPrice", type: { name: "Number" } }, - currencyCode: { + benefitId: { + serializedName: "properties.benefitId", readOnly: true, - serializedName: "currencyCode", type: { name: "String" } }, - offerId: { + benefitName: { + serializedName: "properties.benefitName", readOnly: true, - serializedName: "offerId", type: { name: "String" } - } - } - } -}; - -export const PriceSheetResult: msRest.CompositeMapper = { - serializedName: "PriceSheetResult", - type: { - name: "Composite", - className: "PriceSheetResult", - modelProperties: { - ...Resource.type.modelProperties, - pricesheets: { + }, + provider: { + serializedName: "properties.provider", readOnly: true, - serializedName: "properties.pricesheets", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PriceSheetProperties" - } - } + name: "String" } }, - nextLink: { + costAllocationRuleName: { + serializedName: "properties.costAllocationRuleName", readOnly: true, - serializedName: "properties.nextLink", type: { name: "String" } @@ -1459,179 +3910,122 @@ export const PriceSheetResult: msRest.CompositeMapper = { } }; -export const ForecastPropertiesConfidenceLevelsItem: msRest.CompositeMapper = { - serializedName: "ForecastProperties_confidenceLevelsItem", +export const LegacyReservationRecommendation: coreClient.CompositeMapper = { + serializedName: "legacy", type: { name: "Composite", - className: "ForecastPropertiesConfidenceLevelsItem", + className: "LegacyReservationRecommendation", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - percentage: { + ...ReservationRecommendation.type.modelProperties, + lookBackPeriod: { + serializedName: "properties.lookBackPeriod", readOnly: true, - serializedName: "percentage", - type: { - name: "Number" - } - }, - bound: { - serializedName: "bound", type: { name: "String" } }, - value: { + instanceFlexibilityRatio: { + serializedName: "properties.instanceFlexibilityRatio", readOnly: true, - serializedName: "value", type: { name: "Number" } - } - } - } -}; - -export const Forecast: msRest.CompositeMapper = { - serializedName: "Forecast", - type: { - name: "Composite", - className: "Forecast", - modelProperties: { - ...Resource.type.modelProperties, - usageDate: { + }, + instanceFlexibilityGroup: { + serializedName: "properties.instanceFlexibilityGroup", readOnly: true, - serializedName: "properties.usageDate", type: { name: "String" } }, - grain: { - serializedName: "properties.grain", + normalizedSize: { + serializedName: "properties.normalizedSize", + readOnly: true, type: { name: "String" } }, - charge: { + recommendedQuantityNormalized: { + serializedName: "properties.recommendedQuantityNormalized", readOnly: true, - serializedName: "properties.charge", type: { name: "Number" } }, - currency: { + meterId: { + serializedName: "properties.meterId", readOnly: true, - serializedName: "properties.currency", type: { - name: "String" + name: "Uuid" } }, - chargeType: { - serializedName: "properties.chargeType", + resourceType: { + serializedName: "properties.resourceType", + readOnly: true, type: { name: "String" } }, - confidenceLevels: { - readOnly: true, - serializedName: "properties.confidenceLevels", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ForecastPropertiesConfidenceLevelsItem" - } - } - } - } - } - } -}; - -export const ManagementGroupAggregatedCostResult: msRest.CompositeMapper = { - serializedName: "ManagementGroupAggregatedCostResult", - type: { - name: "Composite", - className: "ManagementGroupAggregatedCostResult", - modelProperties: { - ...Resource.type.modelProperties, - billingPeriodId: { + term: { + serializedName: "properties.term", readOnly: true, - serializedName: "properties.billingPeriodId", type: { name: "String" } }, - usageStart: { + costWithNoReservedInstances: { + serializedName: "properties.costWithNoReservedInstances", readOnly: true, - serializedName: "properties.usageStart", type: { - name: "DateTime" + name: "Number" } }, - usageEnd: { + recommendedQuantity: { + serializedName: "properties.recommendedQuantity", readOnly: true, - serializedName: "properties.usageEnd", type: { - name: "DateTime" + name: "Number" } }, - azureCharges: { + totalCostWithReservedInstances: { + serializedName: "properties.totalCostWithReservedInstances", readOnly: true, - serializedName: "properties.azureCharges", type: { name: "Number" } }, - marketplaceCharges: { + netSavings: { + serializedName: "properties.netSavings", readOnly: true, - serializedName: "properties.marketplaceCharges", type: { name: "Number" } }, - chargesBilledSeparately: { + firstUsageDate: { + serializedName: "properties.firstUsageDate", readOnly: true, - serializedName: "properties.chargesBilledSeparately", type: { - name: "Number" + name: "DateTime" } }, - currency: { + scope: { + serializedName: "properties.scope", readOnly: true, - serializedName: "properties.currency", type: { name: "String" } }, - children: { - serializedName: "properties.children", + skuProperties: { + serializedName: "properties.skuProperties", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ManagementGroupAggregatedCostResult" - } - } - } - }, - includedSubscriptions: { - serializedName: "properties.includedSubscriptions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - excludedSubscriptions: { - serializedName: "properties.excludedSubscriptions", - type: { - name: "Sequence", - element: { - type: { - name: "String" + className: "SkuProperty" } } } @@ -1640,275 +4034,191 @@ export const ManagementGroupAggregatedCostResult: msRest.CompositeMapper = { } }; -export const ChargeSummary: msRest.CompositeMapper = { - serializedName: "ChargeSummary", +export const ModernReservationRecommendation: coreClient.CompositeMapper = { + serializedName: "modern", type: { name: "Composite", - className: "ChargeSummary", + className: "ModernReservationRecommendation", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - ...Resource.type.modelProperties, - billingPeriodId: { + ...ReservationRecommendation.type.modelProperties, + locationPropertiesLocation: { + serializedName: "properties.location", readOnly: true, - serializedName: "properties.billingPeriodId", type: { name: "String" } }, - usageStart: { + lookBackPeriod: { + serializedName: "properties.lookBackPeriod", readOnly: true, - serializedName: "properties.usageStart", type: { - name: "String" + name: "Number" } }, - usageEnd: { + instanceFlexibilityRatio: { + serializedName: "properties.instanceFlexibilityRatio", readOnly: true, - serializedName: "properties.usageEnd", type: { - name: "String" + name: "Number" } }, - azureCharges: { + instanceFlexibilityGroup: { + serializedName: "properties.instanceFlexibilityGroup", readOnly: true, - serializedName: "properties.azureCharges", type: { - name: "Number" + name: "String" } }, - chargesBilledSeparately: { + normalizedSize: { + serializedName: "properties.normalizedSize", readOnly: true, - serializedName: "properties.chargesBilledSeparately", type: { - name: "Number" + name: "String" } }, - marketplaceCharges: { + recommendedQuantityNormalized: { + serializedName: "properties.recommendedQuantityNormalized", readOnly: true, - serializedName: "properties.marketplaceCharges", type: { name: "Number" } }, - currency: { + meterId: { + serializedName: "properties.meterId", readOnly: true, - serializedName: "properties.currency", type: { - name: "String" + name: "Uuid" } - } - } - } -}; - -export const ChargesListResult: msRest.CompositeMapper = { - serializedName: "ChargesListResult", - type: { - name: "Composite", - className: "ChargesListResult", - modelProperties: { - value: { + }, + term: { + serializedName: "properties.term", readOnly: true, - serializedName: "value", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ChargeSummary" - } - } + name: "String" } - } - } - } -}; - -export const ErrorDetails: msRest.CompositeMapper = { - serializedName: "ErrorDetails", - type: { - name: "Composite", - className: "ErrorDetails", - modelProperties: { - code: { - readOnly: true, - serializedName: "code", + }, + costWithNoReservedInstances: { + serializedName: "properties.costWithNoReservedInstances", type: { - name: "String" + name: "Composite", + className: "Amount" } }, - message: { + recommendedQuantity: { + serializedName: "properties.recommendedQuantity", readOnly: true, - serializedName: "message", type: { - name: "String" + name: "Number" } - } - } - } -}; - -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", + }, + totalCostWithReservedInstances: { + serializedName: "properties.totalCostWithReservedInstances", type: { - name: "Composite", - className: "ErrorDetails" - } - } - } - } -}; - -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", + name: "Composite", + className: "Amount" + } + }, + netSavings: { + serializedName: "properties.netSavings", type: { - name: "String" + name: "Composite", + className: "Amount" } }, - resource: { + firstUsageDate: { + serializedName: "properties.firstUsageDate", readOnly: true, - serializedName: "resource", type: { - name: "String" + name: "DateTime" } }, - operation: { + scope: { + serializedName: "properties.scope", readOnly: true, - serializedName: "operation", type: { name: "String" } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { + }, + skuProperties: { + serializedName: "properties.skuProperties", readOnly: true, - serializedName: "name", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuProperty" + } + } } }, - display: { - serializedName: "display", + skuName: { + serializedName: "properties.skuName", + readOnly: true, type: { - name: "Composite", - className: "OperationDisplay" + name: "String" } } } } }; -export const ResourceAttributes: msRest.CompositeMapper = { - serializedName: "ResourceAttributes", +export const LegacyChargeSummary: coreClient.CompositeMapper = { + serializedName: "legacy", type: { name: "Composite", - className: "ResourceAttributes", + className: "LegacyChargeSummary", + uberParent: "ProxyResource", + polymorphicDiscriminator: ProxyResource.type.polymorphicDiscriminator, modelProperties: { - location: { + ...ChargeSummary.type.modelProperties, + billingPeriodId: { + serializedName: "properties.billingPeriodId", readOnly: true, - serializedName: "location", type: { name: "String" } }, - sku: { + usageStart: { + serializedName: "properties.usageStart", readOnly: true, - serializedName: "sku", type: { name: "String" } - } - } - } -}; - -export const QueryOptions: msRest.CompositeMapper = { - type: { - name: "Composite", - className: "QueryOptions", - modelProperties: { - apply: { + }, + usageEnd: { + serializedName: "properties.usageEnd", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const UsageDetailsListResult: msRest.CompositeMapper = { - serializedName: "UsageDetailsListResult", - type: { - name: "Composite", - className: "UsageDetailsListResult", - modelProperties: { - value: { + }, + azureCharges: { + serializedName: "properties.azureCharges", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UsageDetail" - } - } + name: "Number" } }, - nextLink: { + chargesBilledSeparately: { + serializedName: "properties.chargesBilledSeparately", readOnly: true, - serializedName: "nextLink", type: { - name: "String" + name: "Number" } - } - } - } -}; - -export const MarketplacesListResult: msRest.CompositeMapper = { - serializedName: "MarketplacesListResult", - type: { - name: "Composite", - className: "MarketplacesListResult", - modelProperties: { - value: { + }, + marketplaceCharges: { + serializedName: "properties.marketplaceCharges", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Marketplace" - } - } + name: "Number" } }, - nextLink: { + currency: { + serializedName: "properties.currency", readOnly: true, - serializedName: "nextLink", type: { name: "String" } @@ -1917,175 +4227,112 @@ export const MarketplacesListResult: msRest.CompositeMapper = { } }; -export const ReservationSummariesListResult: msRest.CompositeMapper = { - serializedName: "ReservationSummariesListResult", +export const ModernChargeSummary: coreClient.CompositeMapper = { + serializedName: "modern", type: { name: "Composite", - className: "ReservationSummariesListResult", + className: "ModernChargeSummary", + uberParent: "ProxyResource", + polymorphicDiscriminator: ProxyResource.type.polymorphicDiscriminator, modelProperties: { - value: { + ...ChargeSummary.type.modelProperties, + billingPeriodId: { + serializedName: "properties.billingPeriodId", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReservationSummary" - } - } + name: "String" } }, - nextLink: { + usageStart: { + serializedName: "properties.usageStart", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const ReservationDetailsListResult: msRest.CompositeMapper = { - serializedName: "ReservationDetailsListResult", - type: { - name: "Composite", - className: "ReservationDetailsListResult", - modelProperties: { - value: { + }, + usageEnd: { + serializedName: "properties.usageEnd", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReservationDetail" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + azureCharges: { + serializedName: "properties.azureCharges", type: { - name: "String" + name: "Composite", + className: "Amount" } - } - } - } -}; - -export const ReservationRecommendationsListResult: msRest.CompositeMapper = { - serializedName: "ReservationRecommendationsListResult", - type: { - name: "Composite", - className: "ReservationRecommendationsListResult", - modelProperties: { - value: { + }, + chargesBilledSeparately: { + serializedName: "properties.chargesBilledSeparately", + type: { + name: "Composite", + className: "Amount" + } + }, + marketplaceCharges: { + serializedName: "properties.marketplaceCharges", + type: { + name: "Composite", + className: "Amount" + } + }, + billingAccountId: { + serializedName: "properties.billingAccountId", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReservationRecommendation" - } - } + name: "String" } }, - nextLink: { + billingProfileId: { + serializedName: "properties.billingProfileId", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const BudgetsListResult: msRest.CompositeMapper = { - serializedName: "BudgetsListResult", - type: { - name: "Composite", - className: "BudgetsListResult", - modelProperties: { - value: { + }, + invoiceSectionId: { + serializedName: "properties.invoiceSectionId", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Budget" - } - } + name: "String" } }, - nextLink: { + customerId: { + serializedName: "properties.customerId", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const ForecastsListResult: msRest.CompositeMapper = { - serializedName: "ForecastsListResult", - type: { - name: "Composite", - className: "ForecastsListResult", - modelProperties: { - value: { + }, + isInvoiced: { + serializedName: "properties.isInvoiced", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Forecast" - } - } + name: "Boolean" } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const LegacyReservationTransaction: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "LegacyReservationTransaction", modelProperties: { - value: { - readOnly: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } - } + ...ReservationTransaction.type.modelProperties } } }; + +export let discriminators = { + "Resource.UsageDetail": UsageDetail, + "Resource.ReservationRecommendation": ReservationRecommendation, + "ProxyResource.ChargeSummary": ChargeSummary, + "Resource.legacy": LegacyReservationRecommendation, + "Resource.modern": ModernReservationRecommendation, + "ProxyResource.legacy": LegacyChargeSummary, + "ProxyResource.modern": ModernChargeSummary +}; diff --git a/sdk/consumption/arm-consumption/src/models/marketplacesMappers.ts b/sdk/consumption/arm-consumption/src/models/marketplacesMappers.ts deleted file mode 100644 index 2236243f41ac..000000000000 --- a/sdk/consumption/arm-consumption/src/models/marketplacesMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MarketplacesListResult, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/operationsMappers.ts b/sdk/consumption/arm-consumption/src/models/operationsMappers.ts deleted file mode 100644 index 1503eabc4389..000000000000 --- a/sdk/consumption/arm-consumption/src/models/operationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - ErrorResponse, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/parameters.ts b/sdk/consumption/arm-consumption/src/models/parameters.ts index c1813e59d7a5..d3cccb1067c2 100644 --- a/sdk/consumption/arm-consumption/src/models/parameters.ts +++ b/sdk/consumption/arm-consumption/src/models/parameters.ts @@ -3,219 +3,369 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { Budget as BudgetMapper } from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: "en-US", + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const scope: OperationURLParameter = { + parameterPath: "scope", mapper: { + serializedName: "scope", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; + +export const skiptoken: OperationQueryParameter = { + parameterPath: ["options", "skiptoken"], + mapper: { + serializedName: "$skiptoken", + type: { + name: "String" + } + } +}; + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], + mapper: { + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 1 + }, + serializedName: "$top", + type: { + name: "Number" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-10-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const apply: msRest.OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "apply"], + +export const metric: OperationQueryParameter = { + parameterPath: ["options", "metric"], mapper: { - serializedName: "$apply", + serializedName: "metric", type: { name: "String" } } }; -export const billingAccountId: msRest.OperationURLParameter = { - parameterPath: "billingAccountId", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const budgetName: OperationURLParameter = { + parameterPath: "budgetName", + mapper: { + serializedName: "budgetName", required: true, - serializedName: "billingAccountId", type: { name: "String" } } }; -export const billingPeriodName: msRest.OperationURLParameter = { - parameterPath: "billingPeriodName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: BudgetMapper +}; + +export const startDate: OperationQueryParameter = { + parameterPath: ["options", "startDate"], mapper: { + serializedName: "startDate", + type: { + name: "String" + } + } +}; + +export const endDate: OperationQueryParameter = { + parameterPath: ["options", "endDate"], + mapper: { + serializedName: "endDate", + type: { + name: "String" + } + } +}; + +export const apply: OperationQueryParameter = { + parameterPath: ["options", "apply"], + mapper: { + serializedName: "$apply", + type: { + name: "String" + } + } +}; + +export const billingAccountId: OperationURLParameter = { + parameterPath: "billingAccountId", + mapper: { + serializedName: "billingAccountId", required: true, - serializedName: "billingPeriodName", type: { name: "String" } } }; -export const billingProfileId: msRest.OperationURLParameter = { - parameterPath: "billingProfileId", + +export const billingPeriodName: OperationURLParameter = { + parameterPath: "billingPeriodName", mapper: { + serializedName: "billingPeriodName", required: true, - serializedName: "billingProfileId", type: { name: "String" } } }; -export const budgetName: msRest.OperationURLParameter = { - parameterPath: "budgetName", + +export const reservationOrderId: OperationURLParameter = { + parameterPath: "reservationOrderId", mapper: { + serializedName: "reservationOrderId", required: true, - serializedName: "budgetName", type: { name: "String" } } }; -export const departmentId: msRest.OperationURLParameter = { - parameterPath: "departmentId", + +export const grain: OperationQueryParameter = { + parameterPath: "grain", mapper: { + serializedName: "grain", required: true, - serializedName: "departmentId", type: { name: "String" } } }; -export const enrollmentAccountId: msRest.OperationURLParameter = { - parameterPath: "enrollmentAccountId", + +export const reservationId: OperationURLParameter = { + parameterPath: "reservationId", mapper: { + serializedName: "reservationId", required: true, - serializedName: "enrollmentAccountId", type: { name: "String" } } }; -export const expand: msRest.OperationQueryParameter = { - parameterPath: ["options", "expand"], + +export const reservationId1: OperationQueryParameter = { + parameterPath: ["options", "reservationId"], mapper: { - serializedName: "$expand", + serializedName: "reservationId", type: { name: "String" } } }; -export const filter0: msRest.OperationQueryParameter = { - parameterPath: ["options", "filter"], + +export const reservationOrderId1: OperationQueryParameter = { + parameterPath: ["options", "reservationOrderId"], mapper: { - serializedName: "$filter", + serializedName: "reservationOrderId", type: { name: "String" } } }; -export const filter1: msRest.OperationQueryParameter = { + +export const filter1: OperationQueryParameter = { parameterPath: "filter", mapper: { - required: true, serializedName: "$filter", + required: true, type: { name: "String" } } }; -export const grain: msRest.OperationQueryParameter = { - parameterPath: "grain", + +export const region: OperationQueryParameter = { + parameterPath: "region", mapper: { + serializedName: "region", required: true, - serializedName: "grain", type: { name: "String" } } }; -export const managementGroupId: msRest.OperationURLParameter = { - parameterPath: "managementGroupId", + +export const term: OperationQueryParameter = { + parameterPath: "term", mapper: { + serializedName: "term", required: true, - serializedName: "managementGroupId", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const lookBackPeriod: OperationQueryParameter = { + parameterPath: "lookBackPeriod", mapper: { + serializedName: "lookBackPeriod", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const reservationId: msRest.OperationURLParameter = { - parameterPath: "reservationId", + +export const product: OperationQueryParameter = { + parameterPath: "product", mapper: { + serializedName: "product", required: true, - serializedName: "reservationId", type: { name: "String" } } }; -export const reservationOrderId: msRest.OperationURLParameter = { - parameterPath: "reservationOrderId", + +export const billingProfileId: OperationURLParameter = { + parameterPath: "billingProfileId", mapper: { + serializedName: "billingProfileId", required: true, - serializedName: "reservationOrderId", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const skiptoken: msRest.OperationQueryParameter = { - parameterPath: ["options", "skiptoken"], + +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", mapper: { - serializedName: "$skiptoken", + serializedName: "managementGroupId", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const startDate1: OperationQueryParameter = { + parameterPath: "startDate", mapper: { + serializedName: "startDate", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: ["options", "top"], + +export const endDate1: OperationQueryParameter = { + parameterPath: "endDate", mapper: { - serializedName: "$top", - constraints: { - InclusiveMaximum: 1000, - InclusiveMinimum: 1 - }, + serializedName: "endDate", + required: true, type: { - name: "Number" + name: "String" } } }; diff --git a/sdk/consumption/arm-consumption/src/models/priceSheetMappers.ts b/sdk/consumption/arm-consumption/src/models/priceSheetMappers.ts deleted file mode 100644 index 70a8fb00f854..000000000000 --- a/sdk/consumption/arm-consumption/src/models/priceSheetMappers.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/reservationRecommendationsMappers.ts b/sdk/consumption/arm-consumption/src/models/reservationRecommendationsMappers.ts deleted file mode 100644 index 6f98170189c0..000000000000 --- a/sdk/consumption/arm-consumption/src/models/reservationRecommendationsMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - ErrorResponse, - ReservationRecommendation, - ReservationRecommendationsListResult -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/reservationsDetailsMappers.ts b/sdk/consumption/arm-consumption/src/models/reservationsDetailsMappers.ts deleted file mode 100644 index 563c5ea25813..000000000000 --- a/sdk/consumption/arm-consumption/src/models/reservationsDetailsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationDetailsListResult, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/reservationsSummariesMappers.ts b/sdk/consumption/arm-consumption/src/models/reservationsSummariesMappers.ts deleted file mode 100644 index dd4d32b87905..000000000000 --- a/sdk/consumption/arm-consumption/src/models/reservationsSummariesMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummariesListResult, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/tagsMappers.ts b/sdk/consumption/arm-consumption/src/models/tagsMappers.ts deleted file mode 100644 index 70a8fb00f854..000000000000 --- a/sdk/consumption/arm-consumption/src/models/tagsMappers.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/tenantsMappers.ts b/sdk/consumption/arm-consumption/src/models/tenantsMappers.ts deleted file mode 100644 index f8edf5d24d07..000000000000 --- a/sdk/consumption/arm-consumption/src/models/tenantsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - TenantListResult, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/usageDetailsMappers.ts b/sdk/consumption/arm-consumption/src/models/usageDetailsMappers.ts deleted file mode 100644 index 02f1b9ed4f4e..000000000000 --- a/sdk/consumption/arm-consumption/src/models/usageDetailsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail, - UsageDetailsListResult -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts b/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts index a3a6ccdbbba0..3c7e7b24ad40 100644 --- a/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts +++ b/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts @@ -3,72 +3,47 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/aggregatedCostMappers"; +import { AggregatedCost } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + AggregatedCostGetByManagementGroupOptionalParams, + AggregatedCostGetByManagementGroupResponse, + AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams, + AggregatedCostGetForBillingPeriodByManagementGroupResponse +} from "../models"; -/** Class representing a AggregatedCost. */ -export class AggregatedCost { +/** Class containing AggregatedCost operations. */ +export class AggregatedCostImpl implements AggregatedCost { private readonly client: ConsumptionManagementClientContext; /** - * Create a AggregatedCost. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AggregatedCost class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Provides the aggregate cost of a management group and all child management groups by current - * billing period. + * Provides the aggregate cost of a management group and all child management groups by current billing + * period. * @param managementGroupId Azure Management Group ID. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ getByManagementGroup( managementGroupId: string, - options?: Models.AggregatedCostGetByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param callback The callback - */ - getByManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param options The optional parameters - * @param callback The callback - */ - getByManagementGroup( - managementGroupId: string, - options: Models.AggregatedCostGetByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - getByManagementGroup( - managementGroupId: string, - options?: - | Models.AggregatedCostGetByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: AggregatedCostGetByManagementGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - managementGroupId, - options - }, - getByManagementGroupOperationSpec, - callback - ) as Promise; + { managementGroupId, options }, + getByManagementGroupOperationSpec + ); } /** @@ -76,65 +51,26 @@ export class AggregatedCost { * billing period * @param managementGroupId Azure Management Group ID. * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - getForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param callback The callback + * @param options The options parameters. */ getForBillingPeriodByManagementGroup( managementGroupId: string, billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - getForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - managementGroupId, - billingPeriodName, - options - }, - getForBillingPeriodByManagementGroupOperationSpec, - callback - ) as Promise; + { managementGroupId, billingPeriodName, options }, + getForBillingPeriodByManagementGroupOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getByManagementGroupOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost", - urlParameters: [Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ManagementGroupAggregatedCostResult @@ -143,16 +79,15 @@ const getByManagementGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.managementGroupId], + headerParameters: [Parameters.accept], serializer }; - -const getForBillingPeriodByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getForBillingPeriodByManagementGroupOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedcost", - urlParameters: [Parameters.managementGroupId, Parameters.billingPeriodName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ManagementGroupAggregatedCostResult @@ -161,5 +96,12 @@ const getForBillingPeriodByManagementGroupOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingPeriodName, + Parameters.managementGroupId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/balances.ts b/sdk/consumption/arm-consumption/src/operations/balances.ts index 43c18bd38cbf..f14871fbfe93 100644 --- a/sdk/consumption/arm-consumption/src/operations/balances.ts +++ b/sdk/consumption/arm-consumption/src/operations/balances.ts @@ -3,70 +3,47 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/balancesMappers"; +import { Balances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + BalancesGetByBillingAccountOptionalParams, + BalancesGetByBillingAccountResponse, + BalancesGetForBillingPeriodByBillingAccountOptionalParams, + BalancesGetForBillingPeriodByBillingAccountResponse +} from "../models"; -/** Class representing a Balances. */ -export class Balances { +/** Class containing Balances operations. */ +export class BalancesImpl implements Balances { private readonly client: ConsumptionManagementClientContext; /** - * Create a Balances. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Balances class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Gets the balances for a scope by billingAccountId. Balances are available via this API only for - * May 1, 2014 or later. + * Gets the balances for a scope by billingAccountId. Balances are available via this API only for May + * 1, 2014 or later. * @param billingAccountId BillingAccount ID - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ getByBillingAccount( billingAccountId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param callback The callback - */ - getByBillingAccount( - billingAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param options The optional parameters - * @param callback The callback - */ - getByBillingAccount( - billingAccountId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getByBillingAccount( - billingAccountId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: BalancesGetByBillingAccountOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingAccountId, - options - }, - getByBillingAccountOperationSpec, - callback - ) as Promise; + { billingAccountId, options }, + getByBillingAccountOperationSpec + ); } /** @@ -74,63 +51,26 @@ export class Balances { * this API only for May 1, 2014 or later. * @param billingAccountId BillingAccount ID * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - getForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - getForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ getForBillingPeriodByBillingAccount( billingAccountId: string, billingPeriodName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: BalancesGetForBillingPeriodByBillingAccountOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingAccountId, - billingPeriodName, - options - }, - getForBillingPeriodByBillingAccountOperationSpec, - callback - ) as Promise; + { billingAccountId, billingPeriodName, options }, + getForBillingPeriodByBillingAccountOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getByBillingAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances", - urlParameters: [Parameters.billingAccountId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Balance @@ -139,16 +79,15 @@ const getByBillingAccountOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountId], + headerParameters: [Parameters.accept], serializer }; - -const getForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getForBillingPeriodByBillingAccountOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances", - urlParameters: [Parameters.billingAccountId, Parameters.billingPeriodName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Balance @@ -157,5 +96,12 @@ const getForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingPeriodName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/budgets.ts b/sdk/consumption/arm-consumption/src/operations/budgets.ts index 2104fe889d95..14d5d108ec9d 100644 --- a/sdk/consumption/arm-consumption/src/operations/budgets.ts +++ b/sdk/consumption/arm-consumption/src/operations/budgets.ts @@ -3,505 +3,252 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/budgetsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Budgets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + Budget, + BudgetsListNextOptionalParams, + BudgetsListOptionalParams, + BudgetsListResponse, + BudgetsGetOptionalParams, + BudgetsGetResponse, + BudgetsCreateOrUpdateOptionalParams, + BudgetsCreateOrUpdateResponse, + BudgetsDeleteOptionalParams, + BudgetsListNextResponse +} from "../models"; -/** Class representing a Budgets. */ -export class Budgets { +/// +/** Class containing Budgets operations. */ +export class BudgetsImpl implements Budgets { private readonly client: ConsumptionManagementClientContext; /** - * Create a Budgets. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Budgets class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Lists all budgets for a subscription. - * @param [options] The optional parameters - * @returns Promise + * Lists all budgets for the defined scope. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options + public list( + scope: string, + options?: BudgetsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); }, - listOperationSpec, - callback - ) as Promise; - } - - /** - * Lists all budgets for a resource group under a subscription. - * @param resourceGroupName Azure Resource Group Name. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupName( - resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param callback The callback - */ - listByResourceGroupName( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroupName( - resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroupName( - resourceGroupName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options + [Symbol.asyncIterator]() { + return this; }, - listByResourceGroupNameOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(scope, options); + } + }; } - /** - * Gets the budget for a subscription by budget name. - * @param budgetName Budget Name. - * @param [options] The optional parameters - * @returns Promise - */ - get(budgetName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param budgetName Budget Name. - * @param callback The callback - */ - get(budgetName: string, callback: msRest.ServiceCallback): void; - /** - * @param budgetName Budget Name. - * @param options The optional parameters - * @param callback The callback - */ - get( - budgetName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - budgetName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - budgetName, - options - }, - getOperationSpec, - callback - ) as Promise; + private async *listPagingPage( + scope: string, + options?: BudgetsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * 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 budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate( - budgetName: string, - parameters: Models.Budget, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param callback The callback - */ - createOrUpdate( - budgetName: string, - parameters: Models.Budget, - callback: msRest.ServiceCallback - ): void; - /** - * @param budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate( - budgetName: string, - parameters: Models.Budget, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdate( - budgetName: string, - parameters: Models.Budget, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - budgetName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback - ) as Promise; + private async *listPagingAll( + scope: string, + options?: BudgetsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } } /** - * The operation to delete a budget. - * @param budgetName Budget Name. - * @param [options] The optional parameters - * @returns Promise + * Lists all budgets for the defined scope. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param options The options parameters. */ - deleteMethod( - budgetName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param budgetName Budget Name. - * @param callback The callback - */ - deleteMethod(budgetName: string, callback: msRest.ServiceCallback): void; - /** - * @param budgetName Budget Name. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod( - budgetName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteMethod( - budgetName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _list( + scope: string, + options?: BudgetsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - budgetName, - options - }, - deleteMethodOperationSpec, - callback + { scope, options }, + listOperationSpec ); } /** - * Gets the budget for a resource group under a subscription by budget name. - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param [options] The optional parameters - * @returns Promise - */ - getByResourceGroupName( - resourceGroupName: string, - budgetName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName Azure Resource Group Name. + * Gets the budget for the scope by budget name. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. * @param budgetName Budget Name. - * @param callback The callback + * @param options The options parameters. */ - getByResourceGroupName( - resourceGroupName: string, - budgetName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param options The optional parameters - * @param callback The callback - */ - getByResourceGroupName( - resourceGroupName: string, - budgetName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getByResourceGroupName( - resourceGroupName: string, + get( + scope: string, budgetName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: BudgetsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - budgetName, - options - }, - getByResourceGroupNameOperationSpec, - callback - ) as Promise; + { scope, budgetName, options }, + getOperationSpec + ); } /** - * 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 resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateByResourceGroupName( - resourceGroupName: string, - budgetName: string, - parameters: Models.Budget, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName Azure Resource Group Name. + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form + * of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior + * to your put operation. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. - * @param callback The callback + * @param options The options parameters. */ - createOrUpdateByResourceGroupName( - resourceGroupName: string, - budgetName: string, - parameters: Models.Budget, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdateByResourceGroupName( - resourceGroupName: string, - budgetName: string, - parameters: Models.Budget, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdateByResourceGroupName( - resourceGroupName: string, + createOrUpdate( + scope: string, budgetName: string, - parameters: Models.Budget, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + parameters: Budget, + options?: BudgetsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - budgetName, - parameters, - options - }, - createOrUpdateByResourceGroupNameOperationSpec, - callback - ) as Promise; + { scope, budgetName, parameters, options }, + createOrUpdateOperationSpec + ); } /** * The operation to delete a budget. - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteByResourceGroupName( - resourceGroupName: string, - budgetName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param callback The callback - */ - deleteByResourceGroupName( - resourceGroupName: string, - budgetName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName Azure Resource Group Name. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. * @param budgetName Budget Name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteByResourceGroupName( - resourceGroupName: string, - budgetName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteByResourceGroupName( - resourceGroupName: string, + delete( + scope: string, budgetName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: BudgetsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - budgetName, - options - }, - deleteByResourceGroupNameOperationSpec, - callback + { scope, budgetName, options }, + deleteOperationSpec ); } /** - * Lists all budgets for a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListNext + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + scope: string, + nextLink: string, + options?: BudgetsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; - } - - /** - * Lists all budgets for a resource group under a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNameNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNameNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroupNameNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroupNameNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNameNextOperationSpec, - callback - ) as Promise; + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.BudgetsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByResourceGroupNameOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/budgets", httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.BudgetsListResult @@ -510,75 +257,14 @@ const listByResourceGroupNameOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.Budget - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Budget, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.Budget - }, - 201: { - bodyMapper: Mappers.Budget - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.budgetName], queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const getByResourceGroupNameOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.Budget @@ -587,23 +273,14 @@ const getByResourceGroupNameOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.budgetName], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateByResourceGroupNameOperationSpec: msRest.OperationSpec = { +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Budget, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.Budget @@ -615,50 +292,30 @@ const createOrUpdateByResourceGroupNameOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.budgetName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const deleteByResourceGroupNameOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.BudgetsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope, Parameters.budgetName], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNameNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BudgetsListResult @@ -667,5 +324,8 @@ const listByResourceGroupNameNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/charges.ts b/sdk/consumption/arm-consumption/src/operations/charges.ts index 0b4be641297d..84cf290ccf3e 100644 --- a/sdk/consumption/arm-consumption/src/operations/charges.ts +++ b/sdk/consumption/arm-consumption/src/operations/charges.ts @@ -3,306 +3,64 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/chargesMappers"; +import { Charges } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ChargesListOptionalParams, ChargesListResponse } from "../models"; -/** Class representing a Charges. */ -export class Charges { +/** Class containing Charges operations. */ +export class ChargesImpl implements Charges { private readonly client: ConsumptionManagementClientContext; /** - * Create a Charges. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Charges class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Lists the charges by enrollmentAccountId. - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param [options] The optional parameters - * @returns Promise + * Lists the charges based for the defined scope. + * @param scope The scope associated with charges operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period + * to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to + * specify billing period at department scope use + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. */ - listByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - options?: Models.ChargesListByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param callback The callback - */ - listByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - options: Models.ChargesListByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - options?: - | Models.ChargesListByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list( + scope: string, + options?: ChargesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingAccountId, - enrollmentAccountId, - options - }, - listByEnrollmentAccountOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the charges based on enrollmentAccountId by billing period. - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - billingPeriodName: string, - options?: Models.ChargesListForBillingPeriodByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - billingPeriodName: string, - options: Models.ChargesListForBillingPeriodByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - billingPeriodName: string, - options?: - | Models.ChargesListForBillingPeriodByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - enrollmentAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByEnrollmentAccountOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the charges by departmentId. - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartment( - billingAccountId: string, - departmentId: string, - options?: Models.ChargesListByDepartmentOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param callback The callback - */ - listByDepartment( - billingAccountId: string, - departmentId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param options The optional parameters - * @param callback The callback - */ - listByDepartment( - billingAccountId: string, - departmentId: string, - options: Models.ChargesListByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartment( - billingAccountId: string, - departmentId: string, - options?: - | Models.ChargesListByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - departmentId, - options - }, - listByDepartmentOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the charges based on departmentId by billing period. - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartment( - billingAccountId: string, - departmentId: string, - billingPeriodName: string, - options?: Models.ChargesListForBillingPeriodByDepartmentOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByDepartment( - billingAccountId: string, - departmentId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartment( - billingAccountId: string, - departmentId: string, - billingPeriodName: string, - options: Models.ChargesListForBillingPeriodByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartment( - billingAccountId: string, - departmentId: string, - billingPeriodName: string, - options?: - | Models.ChargesListForBillingPeriodByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - departmentId, - billingPeriodName, - options - }, - listForBillingPeriodByDepartmentOperationSpec, - callback - ) as Promise; + { scope, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/charges", - urlParameters: [Parameters.billingAccountId, Parameters.enrollmentAccountId], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ChargesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listForBillingPeriodByEnrollmentAccountOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/charges", httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/charges", - urlParameters: [ - Parameters.billingAccountId, - Parameters.enrollmentAccountId, - Parameters.billingPeriodName - ], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ChargeSummary - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Consumption/charges", - urlParameters: [Parameters.billingAccountId, Parameters.departmentId], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ChargesListResult @@ -311,27 +69,14 @@ const listByDepartmentOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listForBillingPeriodByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/charges", - urlParameters: [ - Parameters.billingAccountId, - Parameters.departmentId, - Parameters.billingPeriodName + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.apply ], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ChargeSummary - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/credits.ts b/sdk/consumption/arm-consumption/src/operations/credits.ts new file mode 100644 index 000000000000..ba7de30ac696 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/credits.ts @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Credits } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { CreditsGetOptionalParams, CreditsGetResponse } from "../models"; + +/** Class containing Credits operations. */ +export class CreditsImpl implements Credits { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class Credits class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * The credit summary by billingAccountId and billingProfileId. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + get( + billingAccountId: string, + billingProfileId: string, + options?: CreditsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CreditSummary + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts b/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts new file mode 100644 index 000000000000..27b8dfbcc29c --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts @@ -0,0 +1,358 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { EventsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + EventSummary, + EventsListByBillingProfileNextOptionalParams, + EventsListByBillingProfileOptionalParams, + EventsListByBillingAccountNextOptionalParams, + EventsListByBillingAccountOptionalParams, + EventsListByBillingProfileResponse, + EventsListByBillingAccountResponse, + EventsListByBillingProfileNextResponse, + EventsListByBillingAccountNextResponse +} from "../models"; + +/// +/** Class containing EventsOperations operations. */ +export class EventsOperationsImpl implements EventsOperations { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class EventsOperations class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param startDate Start date + * @param endDate End date + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountId, + billingProfileId, + startDate, + endDate, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + startDate, + endDate, + options + ); + } + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingProfile( + billingAccountId, + billingProfileId, + startDate, + endDate, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountId, + billingProfileId, + startDate, + endDate, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + startDate, + endDate, + options + )) { + yield* page; + } + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll(billingAccountId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingAccountPagingPage(billingAccountId, options); + } + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingAccount(billingAccountId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountId, + options + )) { + yield* page; + } + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param startDate Start date + * @param endDate End date + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, startDate, endDate, options }, + listByBillingProfileOperationSpec + ); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, options }, + listByBillingAccountOperationSpec + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param startDate Start date + * @param endDate End date + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + nextLink: string, + options?: EventsListByBillingProfileNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountId, + billingProfileId, + startDate, + endDate, + nextLink, + options + }, + listByBillingProfileNextOperationSpec + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountId BillingAccount ID + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountId: string, + nextLink: string, + options?: EventsListByBillingAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, nextLink, options }, + listByBillingAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.startDate1, + Parameters.endDate1 + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/events", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountId], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.startDate1, + Parameters.endDate1 + ], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/forecasts.ts b/sdk/consumption/arm-consumption/src/operations/forecasts.ts deleted file mode 100644 index 4b122284fcfc..000000000000 --- a/sdk/consumption/arm-consumption/src/operations/forecasts.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/forecastsMappers"; -import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; - -/** Class representing a Forecasts. */ -export class Forecasts { - private readonly client: ConsumptionManagementClientContext; - - /** - * Create a Forecasts. - * @param {ConsumptionManagementClientContext} client Reference to the service client. - */ - constructor(client: ConsumptionManagementClientContext) { - this.client = client; - } - - /** - * Lists the forecast charges by subscriptionId. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.ForecastsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.ForecastsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.ForecastsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ForecastsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/consumption/arm-consumption/src/operations/index.ts b/sdk/consumption/arm-consumption/src/operations/index.ts index cb46c500811d..b751ef901317 100644 --- a/sdk/consumption/arm-consumption/src/operations/index.ts +++ b/sdk/consumption/arm-consumption/src/operations/index.ts @@ -3,21 +3,23 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./usageDetails"; export * from "./marketplaces"; +export * from "./budgets"; +export * from "./tags"; +export * from "./charges"; export * from "./balances"; export * from "./reservationsSummaries"; export * from "./reservationsDetails"; export * from "./reservationRecommendations"; -export * from "./budgets"; +export * from "./reservationRecommendationDetails"; +export * from "./reservationTransactions"; export * from "./priceSheet"; -export * from "./tags"; -export * from "./forecasts"; export * from "./operations"; export * from "./aggregatedCost"; -export * from "./charges"; -export * from "./tenants"; +export * from "./eventsOperations"; +export * from "./lotsOperations"; +export * from "./credits"; diff --git a/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts new file mode 100644 index 000000000000..29761c54ad5b --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts @@ -0,0 +1,321 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { LotsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + LotSummary, + LotsListByBillingProfileNextOptionalParams, + LotsListByBillingProfileOptionalParams, + LotsListByBillingAccountNextOptionalParams, + LotsListByBillingAccountOptionalParams, + LotsListByBillingProfileResponse, + LotsListByBillingAccountResponse, + LotsListByBillingProfileNextResponse, + LotsListByBillingAccountNextResponse +} from "../models"; + +/// +/** Class containing LotsOperations operations. */ +export class LotsOperationsImpl implements LotsOperations { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class LotsOperations class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountId, + billingProfileId, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + options + ); + } + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingProfile( + billingAccountId, + billingProfileId, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountId, + billingProfileId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + options + )) { + yield* page; + } + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll(billingAccountId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingAccountPagingPage(billingAccountId, options); + } + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingAccount(billingAccountId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountId, + options + )) { + yield* page; + } + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, options }, + listByBillingProfileOperationSpec + ); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, options }, + listByBillingAccountOperationSpec + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountId: string, + billingProfileId: string, + nextLink: string, + options?: LotsListByBillingProfileNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, nextLink, options }, + listByBillingProfileNextOperationSpec + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountId BillingAccount ID + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountId: string, + nextLink: string, + options?: LotsListByBillingAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, nextLink, options }, + listByBillingAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountId], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/marketplaces.ts b/sdk/consumption/arm-consumption/src/operations/marketplaces.ts index 14050e0d2d8c..91d834f18a26 100644 --- a/sdk/consumption/arm-consumption/src/operations/marketplaces.ts +++ b/sdk/consumption/arm-consumption/src/operations/marketplaces.ts @@ -3,1005 +3,152 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/marketplacesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Marketplaces } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; - -/** Class representing a Marketplaces. */ -export class Marketplaces { +import { + Marketplace, + MarketplacesListNextOptionalParams, + MarketplacesListOptionalParams, + MarketplacesListResponse, + MarketplacesListNextResponse +} from "../models"; + +/// +/** Class containing Marketplaces operations. */ +export class MarketplacesImpl implements Marketplaces { private readonly client: ConsumptionManagementClientContext; /** - * Create a Marketplaces. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Marketplaces class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * 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 [options] The optional parameters - * @returns Promise - */ - list(options?: Models.MarketplacesListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.MarketplacesListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.MarketplacesListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the marketplaces for a scope by billing period and subscriptionId. Marketplaces are - * available via this API only for May 1, 2014 or later. - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingPeriod( - billingPeriodName: string, - options?: Models.MarketplacesListByBillingPeriodOptionalParams - ): Promise; - /** - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listByBillingPeriod( - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingPeriod( - billingPeriodName: string, - options: Models.MarketplacesListByBillingPeriodOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingPeriod( - billingPeriodName: string, - options?: - | Models.MarketplacesListByBillingPeriodOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingPeriodName, - options - }, - listByBillingPeriodOperationSpec, - callback - ) as 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 billingAccountId BillingAccount ID - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingAccount( - billingAccountId: string, - options?: Models.MarketplacesListByBillingAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param callback The callback - */ - listByBillingAccount( - billingAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByBillingAccount( - billingAccountId: string, - options: Models.MarketplacesListByBillingAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingAccount( - billingAccountId: string, - options?: - | Models.MarketplacesListByBillingAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - options - }, - listByBillingAccountOperationSpec, - callback - ) as 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 billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: Models.MarketplacesListForBillingPeriodByBillingAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options: Models.MarketplacesListForBillingPeriodByBillingAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: - | Models.MarketplacesListForBillingPeriodByBillingAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByBillingAccountOperationSpec, - callback - ) as 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 departmentId Department ID - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartment( - departmentId: string, - options?: Models.MarketplacesListByDepartmentOptionalParams - ): Promise; - /** - * @param departmentId Department ID - * @param callback The callback - */ - listByDepartment( - departmentId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param departmentId Department ID - * @param options The optional parameters - * @param callback The callback - */ - listByDepartment( - departmentId: string, - options: Models.MarketplacesListByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartment( - departmentId: string, - options?: - | Models.MarketplacesListByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - departmentId, - options - }, - listByDepartmentOperationSpec, - callback - ) as 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 departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options?: Models.MarketplacesListForBillingPeriodByDepartmentOptionalParams - ): Promise; - /** - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options: Models.MarketplacesListForBillingPeriodByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options?: - | Models.MarketplacesListForBillingPeriodByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - departmentId, - billingPeriodName, - options - }, - listForBillingPeriodByDepartmentOperationSpec, - callback - ) as 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 enrollmentAccountId EnrollmentAccount ID - * @param [options] The optional parameters - * @returns Promise - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - options?: Models.MarketplacesListByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param callback The callback - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - options: Models.MarketplacesListByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccount( - enrollmentAccountId: string, - options?: - | Models.MarketplacesListByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - enrollmentAccountId, - options - }, - listByEnrollmentAccountOperationSpec, - callback - ) as 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 enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options?: Models.MarketplacesListForBillingPeriodByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options: Models.MarketplacesListForBillingPeriodByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options?: - | Models.MarketplacesListForBillingPeriodByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - enrollmentAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByEnrollmentAccountOperationSpec, - callback - ) as 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 managementGroupId Azure Management Group ID. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagementGroup( - managementGroupId: string, - options?: Models.MarketplacesListByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param callback The callback - */ - listByManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param options The optional parameters - * @param callback The callback - */ - listByManagementGroup( - managementGroupId: string, - options: Models.MarketplacesListByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroup( - managementGroupId: string, - options?: - | Models.MarketplacesListByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - options - }, - listByManagementGroupOperationSpec, - callback - ) as 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 managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: Models.MarketplacesListForBillingPeriodByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options: Models.MarketplacesListForBillingPeriodByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: - | Models.MarketplacesListForBillingPeriodByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - billingPeriodName, - options - }, - listForBillingPeriodByManagementGroupOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: Models.MarketplacesListNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext( - nextPageLink: string, - options: Models.MarketplacesListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.MarketplacesListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the marketplaces for a scope by billing period and subscriptionId. Marketplaces are - * available via this API only for May 1, 2014 or later. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingPeriodNext( - nextPageLink: string, - options?: Models.MarketplacesListByBillingPeriodNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByBillingPeriodNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingPeriodNext( - nextPageLink: string, - options: Models.MarketplacesListByBillingPeriodNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingPeriodNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByBillingPeriodNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByBillingPeriodNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingAccountNext( - nextPageLink: string, - options?: Models.MarketplacesListByBillingAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByBillingAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingAccountNext( - nextPageLink: string, - options: Models.MarketplacesListByBillingAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingAccountNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByBillingAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByBillingAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options?: Models.MarketplacesListForBillingPeriodByBillingAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options: Models.MarketplacesListForBillingPeriodByBillingAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options?: - | Models.MarketplacesListForBillingPeriodByBillingAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByBillingAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartmentNext( - nextPageLink: string, - options?: Models.MarketplacesListByDepartmentNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDepartmentNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByDepartmentNext( - nextPageLink: string, - options: Models.MarketplacesListByDepartmentNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartmentNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByDepartmentNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDepartmentNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options?: Models.MarketplacesListForBillingPeriodByDepartmentNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options: Models.MarketplacesListForBillingPeriodByDepartmentNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options?: - | Models.MarketplacesListForBillingPeriodByDepartmentNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByDepartmentNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByEnrollmentAccountNext( - nextPageLink: string, - options?: Models.MarketplacesListByEnrollmentAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByEnrollmentAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccountNext( - nextPageLink: string, - options: Models.MarketplacesListByEnrollmentAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccountNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByEnrollmentAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByEnrollmentAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options?: Models.MarketplacesListForBillingPeriodByEnrollmentAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options: Models.MarketplacesListForBillingPeriodByEnrollmentAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options?: - | Models.MarketplacesListForBillingPeriodByEnrollmentAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByEnrollmentAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagementGroupNext( - nextPageLink: string, - options?: Models.MarketplacesListByManagementGroupNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByManagementGroupNext( - nextPageLink: string, - options: Models.MarketplacesListByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroupNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagementGroupNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options?: Models.MarketplacesListForBillingPeriodByManagementGroupNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options: Models.MarketplacesListForBillingPeriodByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options?: - | Models.MarketplacesListForBillingPeriodByManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByManagementGroupNextOperationSpec, - callback - ) as Promise; + * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API + * only for May 1, 2014 or later. + * @param scope The scope associated with marketplace operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and ManagementGroup, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + * @param options The options parameters. + */ + public list( + scope: string, + options?: MarketplacesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scope, options); + } + }; + } + + private async *listPagingPage( + scope: string, + options?: MarketplacesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + options?: MarketplacesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } + } + + /** + * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API + * only for May 1, 2014 or later. + * @param scope The scope associated with marketplace operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and ManagementGroup, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + * @param options The options parameters. + */ + private _list( + scope: string, + options?: MarketplacesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param scope The scope associated with marketplace operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and ManagementGroup, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scope: string, + nextLink: string, + options?: MarketplacesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.subscriptionId], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingPeriodOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/marketplaces", httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.subscriptionId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.MarketplacesListResult @@ -1010,44 +157,19 @@ const listByBillingPeriodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByBillingAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.billingAccountId], queryParameters: [ - Parameters.filter0, - Parameters.top, + Parameters.filter, Parameters.skiptoken, + Parameters.top, Parameters.apiVersion ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const listForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = { +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.billingAccountId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.MarketplacesListResult @@ -1056,373 +178,13 @@ const listForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.departmentId], queryParameters: [ - Parameters.filter0, - Parameters.top, + Parameters.filter, Parameters.skiptoken, + Parameters.top, Parameters.apiVersion ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.departmentId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.enrollmentAccountId], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.enrollmentAccountId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.managementGroupId], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.managementGroupId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByBillingPeriodNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByBillingAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByBillingAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByDepartmentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByDepartmentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByEnrollmentAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByEnrollmentAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByManagementGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/operations.ts b/sdk/consumption/arm-consumption/src/operations/operations.ts index ba8bbd16333f..e06f354b8e36 100644 --- a/sdk/consumption/arm-consumption/src/operations/operations.ts +++ b/sdk/consumption/arm-consumption/src/operations/operations.ts @@ -3,23 +3,31 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { private readonly client: ConsumptionManagementClientContext; /** - * Create a Operations. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; @@ -27,86 +35,77 @@ export class Operations { /** * Lists all of the available consumption REST API operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists all of the available consumption REST API operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Consumption/operations", httpMethod: "GET", - path: "providers/Microsoft.Consumption/operations", - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -115,16 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -133,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/priceSheet.ts b/sdk/consumption/arm-consumption/src/operations/priceSheet.ts index 6486e0e32bdf..7f1f87b93f3a 100644 --- a/sdk/consumption/arm-consumption/src/operations/priceSheet.ts +++ b/sdk/consumption/arm-consumption/src/operations/priceSheet.ts @@ -3,115 +3,65 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/priceSheetMappers"; +import { PriceSheet } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + PriceSheetGetOptionalParams, + PriceSheetGetResponse, + PriceSheetGetByBillingPeriodOptionalParams, + PriceSheetGetByBillingPeriodResponse +} from "../models"; -/** Class representing a PriceSheet. */ -export class PriceSheet { +/** Class containing PriceSheet operations. */ +export class PriceSheetImpl implements PriceSheet { private readonly client: ConsumptionManagementClientContext; /** - * Create a PriceSheet. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PriceSheet class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only - * for May 1, 2014 or later. - * @param [options] The optional parameters - * @returns Promise + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 + * or later. + * @param options The options parameters. */ - get(options?: Models.PriceSheetGetOptionalParams): Promise; - /** - * @param callback The callback - */ - get(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - get( - options: Models.PriceSheetGetOptionalParams, - callback: msRest.ServiceCallback - ): void; - get( - options?: Models.PriceSheetGetOptionalParams | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - getOperationSpec, - callback - ) as Promise; + get(options?: PriceSheetGetOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, getOperationSpec); } /** - * 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 billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - getByBillingPeriod( - billingPeriodName: string, - options?: Models.PriceSheetGetByBillingPeriodOptionalParams - ): 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. * @param billingPeriodName Billing Period Name. - * @param callback The callback + * @param options The options parameters. */ getByBillingPeriod( billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - getByBillingPeriod( - billingPeriodName: string, - options: Models.PriceSheetGetByBillingPeriodOptionalParams, - callback: msRest.ServiceCallback - ): void; - getByBillingPeriod( - billingPeriodName: string, - options?: - | Models.PriceSheetGetByBillingPeriodOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: PriceSheetGetByBillingPeriodOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingPeriodName, - options - }, - getByBillingPeriodOperationSpec, - callback - ) as Promise; + { billingPeriodName, options }, + getByBillingPeriodOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.expand, Parameters.skiptoken, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.PriceSheetResult @@ -120,16 +70,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.expand, + Parameters.skiptoken, + Parameters.top, + Parameters.apiVersion + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getByBillingPeriodOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getByBillingPeriodOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default", - urlParameters: [Parameters.subscriptionId, Parameters.billingPeriodName], - queryParameters: [Parameters.expand, Parameters.skiptoken, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PriceSheetResult @@ -138,5 +92,17 @@ const getByBillingPeriodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.expand, + Parameters.skiptoken, + Parameters.top, + Parameters.apiVersion + ], + urlParameters: [ + Parameters.$host, + Parameters.billingPeriodName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts b/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts new file mode 100644 index 000000000000..b8aaa6b5a949 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { ReservationRecommendationDetails } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + Term, + LookBackPeriod, + ReservationRecommendationDetailsGetOptionalParams, + ReservationRecommendationDetailsGetResponse +} from "../models"; + +/** Class containing ReservationRecommendationDetails operations. */ +export class ReservationRecommendationDetailsImpl + implements ReservationRecommendationDetails { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class ReservationRecommendationDetails class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * Details of a reservation recommendation for what-if analysis of reserved instances. + * @param scope The scope associated with reservation recommendation details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param region Used to select the region the recommendation should be generated for. + * @param term Specify length of reservation recommendation term. + * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. + * @param product Filter the products for which reservation recommendation results are generated. + * Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + * @param options The options parameters. + */ + get( + scope: string, + region: string, + term: Term, + lookBackPeriod: LookBackPeriod, + product: string, + options?: ReservationRecommendationDetailsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, region, term, lookBackPeriod, product, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationRecommendationDetailsModel + }, + 204: {}, + default: { + bodyMapper: Mappers.HighCasedErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.region, + Parameters.term, + Parameters.lookBackPeriod, + Parameters.product + ], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts b/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts index 0251b1883aff..c4592c3fe5bb 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts @@ -3,23 +3,32 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/reservationRecommendationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ReservationRecommendations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + ReservationRecommendationUnion, + ReservationRecommendationsListNextOptionalParams, + ReservationRecommendationsListOptionalParams, + ReservationRecommendationsListResponse, + ReservationRecommendationsListNextResponse +} from "../models"; -/** Class representing a ReservationRecommendations. */ -export class ReservationRecommendations { +/// +/** Class containing ReservationRecommendations operations. */ +export class ReservationRecommendationsImpl + implements ReservationRecommendations { private readonly client: ConsumptionManagementClientContext; /** - * Create a ReservationRecommendations. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ReservationRecommendations class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; @@ -27,118 +36,131 @@ export class ReservationRecommendations { /** * List of recommendations for purchasing reserved instances. - * @param [options] The optional parameters - * @returns Promise + * @param scope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param options The options parameters. */ - list( - options?: Models.ReservationRecommendationsListOptionalParams - ): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.ReservationRecommendationsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.ReservationRecommendationsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options + public list( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(scope, options); + } + }; + } + + private async *listPagingPage( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } } /** * List of recommendations for purchasing reserved instances. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * @param scope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options?: Models.ReservationRecommendationsListNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + private _list( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param scope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: Models.ReservationRecommendationsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.ReservationRecommendationsListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + scope: string, + nextLink: string, + options?: ReservationRecommendationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/reservationRecommendations", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/reservationRecommendations", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ReservationRecommendationsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationRecommendationsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts b/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts new file mode 100644 index 000000000000..33b2fec8e592 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts @@ -0,0 +1,311 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ReservationTransactions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + ReservationTransaction, + ReservationTransactionsListNextOptionalParams, + ReservationTransactionsListOptionalParams, + ModernReservationTransaction, + ReservationTransactionsListByBillingProfileNextOptionalParams, + ReservationTransactionsListByBillingProfileOptionalParams, + ReservationTransactionsListResponse, + ReservationTransactionsListByBillingProfileResponse, + ReservationTransactionsListNextResponse, + ReservationTransactionsListByBillingProfileNextResponse +} from "../models"; + +/// +/** Class containing ReservationTransactions operations. */ +export class ReservationTransactionsImpl implements ReservationTransactions { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class ReservationTransactions class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + public list( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(billingAccountId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(billingAccountId, options); + } + }; + } + + private async *listPagingPage( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(billingAccountId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + billingAccountId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(billingAccountId, options)) { + yield* page; + } + } + + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountId, + billingProfileId, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + options + ); + } + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingProfile( + billingAccountId, + billingProfileId, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountId, + billingProfileId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + options + )) { + yield* page; + } + } + + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + private _list( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, options }, + listOperationSpec + ); + } + + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, options }, + listByBillingProfileOperationSpec + ); + } + + /** + * ListNext + * @param billingAccountId BillingAccount ID + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + billingAccountId: string, + nextLink: string, + options?: ReservationTransactionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountId: string, + billingProfileId: string, + nextLink: string, + options?: ReservationTransactionsListByBillingProfileNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, nextLink, options }, + listByBillingProfileNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationTransactionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountId], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/reservationTransactions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModernReservationTransactionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationTransactionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModernReservationTransactionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts b/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts index 3f3eb2a7bb59..ed32d2487a8f 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts @@ -3,23 +3,39 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/reservationsDetailsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ReservationsDetails } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + ReservationDetail, + ReservationsDetailsListByReservationOrderNextOptionalParams, + ReservationsDetailsListByReservationOrderOptionalParams, + ReservationsDetailsListByReservationOrderAndReservationNextOptionalParams, + ReservationsDetailsListByReservationOrderAndReservationOptionalParams, + ReservationsDetailsListNextOptionalParams, + ReservationsDetailsListOptionalParams, + ReservationsDetailsListByReservationOrderResponse, + ReservationsDetailsListByReservationOrderAndReservationResponse, + ReservationsDetailsListResponse, + ReservationsDetailsListByReservationOrderNextResponse, + ReservationsDetailsListByReservationOrderAndReservationNextResponse, + ReservationsDetailsListNextResponse +} from "../models"; -/** Class representing a ReservationsDetails. */ -export class ReservationsDetails { +/// +/** Class containing ReservationsDetails operations. */ +export class ReservationsDetailsImpl implements ReservationsDetails { private readonly client: ConsumptionManagementClientContext; /** - * Create a ReservationsDetails. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ReservationsDetails class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; @@ -28,245 +44,336 @@ export class ReservationsDetails { /** * Lists the reservations details for provided date range. * @param reservationOrderId Order Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param [options] The optional parameters - * @returns Promise + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. */ - listByReservationOrder( + public listByReservationOrder( reservationOrderId: string, filter: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param reservationOrderId Order Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param callback The callback - */ - listByReservationOrder( - reservationOrderId: string, - filter: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param reservationOrderId Order Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param options The optional parameters - * @param callback The callback - */ - listByReservationOrder( - reservationOrderId: string, - filter: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByReservationOrder( + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderPagingAll( + reservationOrderId, + filter, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByReservationOrderPagingPage( + reservationOrderId, + filter, + options + ); + } + }; + } + + private async *listByReservationOrderPagingPage( reservationOrderId: string, filter: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): AsyncIterableIterator { + let result = await this._listByReservationOrder( + reservationOrderId, + filter, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByReservationOrderNext( reservationOrderId, filter, + continuationToken, options - }, - listByReservationOrderOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Lists the reservations details for provided date range. - * @param reservationOrderId Order Id of the reservation - * @param reservationId Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param [options] The optional parameters - * @returns Promise - */ - listByReservationOrderAndReservation( - reservationOrderId: string, - reservationId: string, - filter: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param reservationOrderId Order Id of the reservation - * @param reservationId Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param callback The callback - */ - listByReservationOrderAndReservation( + private async *listByReservationOrderPagingAll( reservationOrderId: string, - reservationId: string, filter: string, - callback: msRest.ServiceCallback - ): void; + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderPagingPage( + reservationOrderId, + filter, + options + )) { + yield* page; + } + } + /** + * Lists the reservations details for provided date range. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param options The optional parameters - * @param callback The callback + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. */ - listByReservationOrderAndReservation( + public listByReservationOrderAndReservation( reservationOrderId: string, reservationId: string, filter: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderAndReservation( + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderAndReservationPagingAll( + reservationOrderId, + reservationId, + filter, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByReservationOrderAndReservationPagingPage( + reservationOrderId, + reservationId, + filter, + options + ); + } + }; + } + + private async *listByReservationOrderAndReservationPagingPage( reservationOrderId: string, reservationId: string, filter: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): AsyncIterableIterator { + let result = await this._listByReservationOrderAndReservation( + reservationOrderId, + reservationId, + filter, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByReservationOrderAndReservationNext( reservationOrderId, reservationId, filter, + continuationToken, options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByReservationOrderAndReservationPagingAll( + reservationOrderId: string, + reservationId: string, + filter: string, + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderAndReservationPagingPage( + reservationOrderId, + reservationId, + filter, + options + )) { + yield* page; + } + } + + /** + * Lists the reservations details for the defined scope and provided date range. + * @param scope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param options The options parameters. + */ + public list( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); }, - listByReservationOrderAndReservationOperationSpec, - callback - ) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scope, options); + } + }; + } + + private async *listPagingPage( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } } /** * Lists the reservations details for provided date range. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param [options] The optional parameters - * @returns Promise + * @param reservationOrderId Order Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, + private _listByReservationOrder( + reservationOrderId: string, filter: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, filter, options }, + listByReservationOrderOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param callback The callback + * Lists the reservations details for provided date range. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, + private _listByReservationOrderAndReservation( + reservationOrderId: string, + reservationId: string, filter: string, - callback: msRest.ServiceCallback - ): void; + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, filter, options }, + listByReservationOrderAndReservationOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param options The optional parameters - * @param callback The callback + * Lists the reservations details for the defined scope and provided date range. + * @param scope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, - filter: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderNext( - nextPageLink: string, - filter: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _list( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - filter, - options - }, - listByReservationOrderNextOperationSpec, - callback - ) as Promise; + { scope, options }, + listOperationSpec + ); } /** - * Lists the reservations details for provided date range. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param [options] The optional parameters - * @returns Promise + * ListByReservationOrderNext + * @param reservationOrderId Order Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param nextLink The nextLink from the previous successful call to the ListByReservationOrder method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, + private _listByReservationOrderNext( + reservationOrderId: string, filter: string, - options?: msRest.RequestOptionsBase - ): Promise; + nextLink: string, + options?: ReservationsDetailsListByReservationOrderNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, filter, nextLink, options }, + listByReservationOrderNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param callback The callback + * ListByReservationOrderAndReservationNext + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param nextLink The nextLink from the previous successful call to the + * ListByReservationOrderAndReservation method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, + private _listByReservationOrderAndReservationNext( + reservationOrderId: string, + reservationId: string, filter: string, - callback: msRest.ServiceCallback - ): void; + nextLink: string, + options?: ReservationsDetailsListByReservationOrderAndReservationNextOptionalParams + ): Promise< + ReservationsDetailsListByReservationOrderAndReservationNextResponse + > { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, filter, nextLink, options }, + listByReservationOrderAndReservationNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param scope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, - filter: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderAndReservationNext( - nextPageLink: string, - filter: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + scope: string, + nextLink: string, + options?: ReservationsDetailsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - filter, - options - }, - listByReservationOrderAndReservationNextOperationSpec, - callback - ) as Promise; + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByReservationOrderOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByReservationOrderOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails", - urlParameters: [Parameters.reservationOrderId], - queryParameters: [Parameters.filter1, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationDetailsListResult @@ -275,16 +382,15 @@ const listByReservationOrderOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.filter1], + urlParameters: [Parameters.$host, Parameters.reservationOrderId], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderAndReservationOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listByReservationOrderAndReservationOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails", - urlParameters: [Parameters.reservationOrderId, Parameters.reservationId], - queryParameters: [Parameters.filter1, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationDetailsListResult @@ -293,16 +399,41 @@ const listByReservationOrderAndReservationOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.filter1], + urlParameters: [ + Parameters.$host, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderNextOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/reservationDetails", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ReservationDetailsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.reservationId1, + Parameters.reservationOrderId1 + ], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const listByReservationOrderNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter1, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationDetailsListResult @@ -311,16 +442,39 @@ const listByReservationOrderNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.filter1], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.reservationOrderId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderAndReservationNextOperationSpec: msRest.OperationSpec = { +const listByReservationOrderAndReservationNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ReservationDetailsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter1], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter1, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationDetailsListResult @@ -329,5 +483,15 @@ const listByReservationOrderAndReservationNextOperationSpec: msRest.OperationSpe bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.reservationId1, + Parameters.reservationOrderId1 + ], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts b/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts index 884abf8b1256..c4a5b4a96256 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts @@ -3,23 +3,40 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/reservationsSummariesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ReservationsSummaries } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + ReservationSummary, + Datagrain, + ReservationsSummariesListByReservationOrderNextOptionalParams, + ReservationsSummariesListByReservationOrderOptionalParams, + ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams, + ReservationsSummariesListByReservationOrderAndReservationOptionalParams, + ReservationsSummariesListNextOptionalParams, + ReservationsSummariesListOptionalParams, + ReservationsSummariesListByReservationOrderResponse, + ReservationsSummariesListByReservationOrderAndReservationResponse, + ReservationsSummariesListResponse, + ReservationsSummariesListByReservationOrderNextResponse, + ReservationsSummariesListByReservationOrderAndReservationNextResponse, + ReservationsSummariesListNextResponse +} from "../models"; -/** Class representing a ReservationsSummaries. */ -export class ReservationsSummaries { +/// +/** Class containing ReservationsSummaries operations. */ +export class ReservationsSummariesImpl implements ReservationsSummaries { private readonly client: ConsumptionManagementClientContext; /** - * Create a ReservationsSummaries. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ReservationsSummaries class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; @@ -28,233 +45,340 @@ export class ReservationsSummaries { /** * Lists the reservations summaries for daily or monthly grain. * @param reservationOrderId Order Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param [options] The optional parameters - * @returns Promise + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrder( + public listByReservationOrder( reservationOrderId: string, - grain: Models.Datagrain, - options?: Models.ReservationsSummariesListByReservationOrderOptionalParams - ): Promise; - /** - * @param reservationOrderId Order Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param callback The callback - */ - listByReservationOrder( - reservationOrderId: string, - grain: Models.Datagrain, - callback: msRest.ServiceCallback - ): void; - /** - * @param reservationOrderId Order Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param options The optional parameters - * @param callback The callback - */ - listByReservationOrder( - reservationOrderId: string, - grain: Models.Datagrain, - options: Models.ReservationsSummariesListByReservationOrderOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByReservationOrder( + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderPagingAll( + reservationOrderId, + grain, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByReservationOrderPagingPage( + reservationOrderId, + grain, + options + ); + } + }; + } + + private async *listByReservationOrderPagingPage( reservationOrderId: string, - grain: Models.Datagrain, - options?: - | Models.ReservationsSummariesListByReservationOrderOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): AsyncIterableIterator { + let result = await this._listByReservationOrder( + reservationOrderId, + grain, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByReservationOrderNext( reservationOrderId, grain, + continuationToken, options - }, - listByReservationOrderOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Lists the reservations summaries for daily or monthly grain. - * @param reservationOrderId Order Id of the reservation - * @param reservationId Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param [options] The optional parameters - * @returns Promise - */ - listByReservationOrderAndReservation( + private async *listByReservationOrderPagingAll( reservationOrderId: string, - reservationId: string, - grain: Models.Datagrain, - options?: Models.ReservationsSummariesListByReservationOrderAndReservationOptionalParams - ): Promise; - /** - * @param reservationOrderId Order Id of the reservation - * @param reservationId Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param callback The callback - */ - listByReservationOrderAndReservation( - reservationOrderId: string, - reservationId: string, - grain: Models.Datagrain, - callback: msRest.ServiceCallback - ): void; + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderPagingPage( + reservationOrderId, + grain, + options + )) { + yield* page; + } + } + /** + * Lists the reservations summaries for daily or monthly grain. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param options The optional parameters - * @param callback The callback + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrderAndReservation( + public listByReservationOrderAndReservation( reservationOrderId: string, reservationId: string, - grain: Models.Datagrain, - options: Models.ReservationsSummariesListByReservationOrderAndReservationOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderAndReservation( + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderAndReservationPagingAll( + reservationOrderId, + reservationId, + grain, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByReservationOrderAndReservationPagingPage( + reservationOrderId, + reservationId, + grain, + options + ); + } + }; + } + + private async *listByReservationOrderAndReservationPagingPage( reservationOrderId: string, reservationId: string, - grain: Models.Datagrain, - options?: - | Models.ReservationsSummariesListByReservationOrderAndReservationOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): AsyncIterableIterator { + let result = await this._listByReservationOrderAndReservation( + reservationOrderId, + reservationId, + grain, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByReservationOrderAndReservationNext( reservationOrderId, reservationId, grain, + continuationToken, options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByReservationOrderAndReservationPagingAll( + reservationOrderId: string, + reservationId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderAndReservationPagingPage( + reservationOrderId, + reservationId, + grain, + options + )) { + yield* page; + } + } + + /** + * Lists the reservations summaries for the defined scope daily or monthly grain. + * @param scope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param grain Can be daily or monthly + * @param options The options parameters. + */ + public list( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, grain, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listByReservationOrderAndReservationOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(scope, grain, options); + } + }; + } + + private async *listPagingPage( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, grain, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, grain, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, grain, options)) { + yield* page; + } } /** * Lists the reservations summaries for daily or monthly grain. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param [options] The optional parameters - * @returns Promise + * @param reservationOrderId Order Id of the reservation + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, - grain: Models.Datagrain, - options?: Models.ReservationsSummariesListByReservationOrderNextOptionalParams - ): Promise; + private _listByReservationOrder( + reservationOrderId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, grain, options }, + listByReservationOrderOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param callback The callback + * Lists the reservations summaries for daily or monthly grain. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, - grain: Models.Datagrain, - callback: msRest.ServiceCallback - ): void; + private _listByReservationOrderAndReservation( + reservationOrderId: string, + reservationId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): Promise< + ReservationsSummariesListByReservationOrderAndReservationResponse + > { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, grain, options }, + listByReservationOrderAndReservationOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param options The optional parameters - * @param callback The callback + * Lists the reservations summaries for the defined scope daily or monthly grain. + * @param scope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, - grain: Models.Datagrain, - options: Models.ReservationsSummariesListByReservationOrderNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderNext( - nextPageLink: string, - grain: Models.Datagrain, - options?: - | Models.ReservationsSummariesListByReservationOrderNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _list( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - grain, - options - }, - listByReservationOrderNextOperationSpec, - callback - ) as Promise; + { scope, grain, options }, + listOperationSpec + ); } /** - * Lists the reservations summaries for daily or monthly grain. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param [options] The optional parameters - * @returns Promise + * ListByReservationOrderNext + * @param reservationOrderId Order Id of the reservation + * @param grain Can be daily or monthly + * @param nextLink The nextLink from the previous successful call to the ListByReservationOrder method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, - grain: Models.Datagrain, - options?: Models.ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams - ): Promise; + private _listByReservationOrderNext( + reservationOrderId: string, + grain: Datagrain, + nextLink: string, + options?: ReservationsSummariesListByReservationOrderNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, grain, nextLink, options }, + listByReservationOrderNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param callback The callback + * ListByReservationOrderAndReservationNext + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param grain Can be daily or monthly + * @param nextLink The nextLink from the previous successful call to the + * ListByReservationOrderAndReservation method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, - grain: Models.Datagrain, - callback: msRest.ServiceCallback - ): void; + private _listByReservationOrderAndReservationNext( + reservationOrderId: string, + reservationId: string, + grain: Datagrain, + nextLink: string, + options?: ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams + ): Promise< + ReservationsSummariesListByReservationOrderAndReservationNextResponse + > { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, grain, nextLink, options }, + listByReservationOrderAndReservationNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param scope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param grain Can be daily or monthly + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, - grain: Models.Datagrain, - options: Models.ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderAndReservationNext( - nextPageLink: string, - grain: Models.Datagrain, - options?: - | Models.ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + scope: string, + grain: Datagrain, + nextLink: string, + options?: ReservationsSummariesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - grain, - options - }, - listByReservationOrderAndReservationNextOperationSpec, - callback - ) as Promise; + { scope, grain, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByReservationOrderOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByReservationOrderOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries", - urlParameters: [Parameters.reservationOrderId], - queryParameters: [Parameters.grain, Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationSummariesListResult @@ -263,16 +387,15 @@ const listByReservationOrderOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion, Parameters.grain], + urlParameters: [Parameters.$host, Parameters.reservationOrderId], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderAndReservationOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listByReservationOrderAndReservationOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries", - urlParameters: [Parameters.reservationOrderId, Parameters.reservationId], - queryParameters: [Parameters.grain, Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationSummariesListResult @@ -281,16 +404,42 @@ const listByReservationOrderAndReservationOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion, Parameters.grain], + urlParameters: [ + Parameters.$host, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderNextOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/reservationSummaries", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ReservationSummariesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.grain, + Parameters.reservationId1, + Parameters.reservationOrderId1 + ], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const listByReservationOrderNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.grain, Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationSummariesListResult @@ -299,16 +448,39 @@ const listByReservationOrderNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion, Parameters.grain], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.reservationOrderId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderAndReservationNextOperationSpec: msRest.OperationSpec = { +const listByReservationOrderAndReservationNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ReservationSummariesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion, Parameters.grain], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.grain, Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationSummariesListResult @@ -317,5 +489,16 @@ const listByReservationOrderAndReservationNextOperationSpec: msRest.OperationSpe bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.grain, + Parameters.reservationId1, + Parameters.reservationOrderId1 + ], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/tags.ts b/sdk/consumption/arm-consumption/src/operations/tags.ts index 67a71e3fcd11..2e3b656eae7f 100644 --- a/sdk/consumption/arm-consumption/src/operations/tags.ts +++ b/sdk/consumption/arm-consumption/src/operations/tags.ts @@ -3,85 +3,68 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/tagsMappers"; +import { Tags } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { TagsGetOptionalParams, TagsGetResponse } from "../models"; -/** Class representing a Tags. */ -export class Tags { +/** Class containing Tags operations. */ +export class TagsImpl implements Tags { private readonly client: ConsumptionManagementClientContext; /** - * Create a Tags. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Tags class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Get all available tag keys for a billing account. - * @param billingAccountId BillingAccount ID - * @param [options] The optional parameters - * @returns Promise + * Get all available tag keys for the defined scope + * @param scope The scope associated with tags operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope.. + * @param options The options parameters. */ get( - billingAccountId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param callback The callback - */ - get(billingAccountId: string, callback: msRest.ServiceCallback): void; - /** - * @param billingAccountId BillingAccount ID - * @param options The optional parameters - * @param callback The callback - */ - get( - billingAccountId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - billingAccountId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + scope: string, + options?: TagsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingAccountId, - options - }, - getOperationSpec, - callback - ) as Promise; + { scope, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/tags", httpMethod: "GET", - path: - "providers/Microsoft.CostManagement/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/tags", - urlParameters: [Parameters.billingAccountId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.TagsResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/tenants.ts b/sdk/consumption/arm-consumption/src/operations/tenants.ts deleted file mode 100644 index d05a1527540a..000000000000 --- a/sdk/consumption/arm-consumption/src/operations/tenants.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/tenantsMappers"; -import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; - -/** Class representing a Tenants. */ -export class Tenants { - private readonly client: ConsumptionManagementClientContext; - - /** - * Create a Tenants. - * @param {ConsumptionManagementClientContext} client Reference to the service client. - */ - constructor(client: ConsumptionManagementClientContext) { - this.client = client; - } - - /** - * Gets a Tenant Properties. - * @param billingAccountId Billing Account Id. - * @param billingProfileId Billing Profile Id. - * @param [options] The optional parameters - * @returns Promise - */ - get( - billingAccountId: string, - billingProfileId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param billingAccountId Billing Account Id. - * @param billingProfileId Billing Profile Id. - * @param callback The callback - */ - get( - billingAccountId: string, - billingProfileId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId Billing Account Id. - * @param billingProfileId Billing Profile Id. - * @param options The optional parameters - * @param callback The callback - */ - get( - billingAccountId: string, - billingProfileId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - billingAccountId: string, - billingProfileId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - billingProfileId, - options - }, - getOperationSpec, - callback - ) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/tenants", - urlParameters: [Parameters.billingAccountId, Parameters.billingProfileId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.TenantListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts index 68cb3a7d6122..8f1ebaf6a65c 100644 --- a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts @@ -3,1011 +3,176 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/usageDetailsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { UsageDetails } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; - -/** Class representing a UsageDetails. */ -export class UsageDetails { +import { + UsageDetailUnion, + UsageDetailsListNextOptionalParams, + UsageDetailsListOptionalParams, + UsageDetailsListResponse, + UsageDetailsListNextResponse +} from "../models"; + +/// +/** Class containing UsageDetails operations. */ +export class UsageDetailsImpl implements UsageDetails { private readonly client: ConsumptionManagementClientContext; /** - * Create a UsageDetails. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class UsageDetails class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * 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 [options] The optional parameters - * @returns Promise - */ - list(options?: Models.UsageDetailsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.UsageDetailsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.UsageDetailsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as 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 billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingPeriod( - billingPeriodName: string, - options?: Models.UsageDetailsListByBillingPeriodOptionalParams - ): Promise; - /** - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listByBillingPeriod( - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingPeriod( - billingPeriodName: string, - options: Models.UsageDetailsListByBillingPeriodOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingPeriod( - billingPeriodName: string, - options?: - | Models.UsageDetailsListByBillingPeriodOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingPeriodName, - options - }, - listByBillingPeriodOperationSpec, - callback - ) as 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 billingAccountId BillingAccount ID - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingAccount( - billingAccountId: string, - options?: Models.UsageDetailsListByBillingAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param callback The callback - */ - listByBillingAccount( - billingAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByBillingAccount( - billingAccountId: string, - options: Models.UsageDetailsListByBillingAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingAccount( - billingAccountId: string, - options?: - | Models.UsageDetailsListByBillingAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - options - }, - listByBillingAccountOperationSpec, - callback - ) as 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 billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: Models.UsageDetailsListForBillingPeriodByBillingAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options: Models.UsageDetailsListForBillingPeriodByBillingAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: - | Models.UsageDetailsListForBillingPeriodByBillingAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByBillingAccountOperationSpec, - callback - ) as 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 departmentId Department ID - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartment( - departmentId: string, - options?: Models.UsageDetailsListByDepartmentOptionalParams - ): Promise; - /** - * @param departmentId Department ID - * @param callback The callback - */ - listByDepartment( - departmentId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param departmentId Department ID - * @param options The optional parameters - * @param callback The callback - */ - listByDepartment( - departmentId: string, - options: Models.UsageDetailsListByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartment( - departmentId: string, - options?: - | Models.UsageDetailsListByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - departmentId, - options - }, - listByDepartmentOperationSpec, - callback - ) as 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 departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options?: Models.UsageDetailsListForBillingPeriodByDepartmentOptionalParams - ): Promise; - /** - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options: Models.UsageDetailsListForBillingPeriodByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options?: - | Models.UsageDetailsListForBillingPeriodByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - departmentId, - billingPeriodName, - options - }, - listForBillingPeriodByDepartmentOperationSpec, - callback - ) as 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 enrollmentAccountId EnrollmentAccount ID - * @param [options] The optional parameters - * @returns Promise - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - options?: Models.UsageDetailsListByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param callback The callback - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - options: Models.UsageDetailsListByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccount( - enrollmentAccountId: string, - options?: - | Models.UsageDetailsListByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - enrollmentAccountId, - options - }, - listByEnrollmentAccountOperationSpec, - callback - ) as 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 enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options?: Models.UsageDetailsListForBillingPeriodByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options: Models.UsageDetailsListForBillingPeriodByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options?: - | Models.UsageDetailsListForBillingPeriodByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - enrollmentAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByEnrollmentAccountOperationSpec, - callback - ) as 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 managementGroupId Azure Management Group ID. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagementGroup( - managementGroupId: string, - options?: Models.UsageDetailsListByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param callback The callback - */ - listByManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param options The optional parameters - * @param callback The callback - */ - listByManagementGroup( - managementGroupId: string, - options: Models.UsageDetailsListByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroup( - managementGroupId: string, - options?: - | Models.UsageDetailsListByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - options - }, - listByManagementGroupOperationSpec, - callback - ) as 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 managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: Models.UsageDetailsListForBillingPeriodByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options: Models.UsageDetailsListForBillingPeriodByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: - | Models.UsageDetailsListForBillingPeriodByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - billingPeriodName, - options - }, - listForBillingPeriodByManagementGroupOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: Models.UsageDetailsListNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext( - nextPageLink: string, - options: Models.UsageDetailsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingPeriodNext( - nextPageLink: string, - options?: Models.UsageDetailsListByBillingPeriodNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByBillingPeriodNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingPeriodNext( - nextPageLink: string, - options: Models.UsageDetailsListByBillingPeriodNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingPeriodNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByBillingPeriodNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByBillingPeriodNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingAccountNext( - nextPageLink: string, - options?: Models.UsageDetailsListByBillingAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByBillingAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingAccountNext( - nextPageLink: string, - options: Models.UsageDetailsListByBillingAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingAccountNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByBillingAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByBillingAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options?: Models.UsageDetailsListForBillingPeriodByBillingAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options: Models.UsageDetailsListForBillingPeriodByBillingAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListForBillingPeriodByBillingAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByBillingAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartmentNext( - nextPageLink: string, - options?: Models.UsageDetailsListByDepartmentNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDepartmentNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByDepartmentNext( - nextPageLink: string, - options: Models.UsageDetailsListByDepartmentNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartmentNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByDepartmentNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDepartmentNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options?: Models.UsageDetailsListForBillingPeriodByDepartmentNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options: Models.UsageDetailsListForBillingPeriodByDepartmentNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListForBillingPeriodByDepartmentNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByDepartmentNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByEnrollmentAccountNext( - nextPageLink: string, - options?: Models.UsageDetailsListByEnrollmentAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByEnrollmentAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccountNext( - nextPageLink: string, - options: Models.UsageDetailsListByEnrollmentAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccountNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByEnrollmentAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByEnrollmentAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options?: Models.UsageDetailsListForBillingPeriodByEnrollmentAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options: Models.UsageDetailsListForBillingPeriodByEnrollmentAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListForBillingPeriodByEnrollmentAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByEnrollmentAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagementGroupNext( - nextPageLink: string, - options?: Models.UsageDetailsListByManagementGroupNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByManagementGroupNext( - nextPageLink: string, - options: Models.UsageDetailsListByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroupNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagementGroupNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options?: Models.UsageDetailsListForBillingPeriodByManagementGroupNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options: Models.UsageDetailsListForBillingPeriodByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListForBillingPeriodByManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByManagementGroupNextOperationSpec, - callback - ) as Promise; + * Lists the usage details for the defined scope. Usage details are available via this API only for May + * 1, 2014 or later. + * @param scope The scope associated with usage details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and management group, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. + */ + public list( + scope: string, + options?: UsageDetailsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scope, options); + } + }; + } + + private async *listPagingPage( + scope: string, + options?: UsageDetailsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + options?: UsageDetailsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } + } + + /** + * Lists the usage details for the defined scope. Usage details are available via this API only for May + * 1, 2014 or later. + * @param scope The scope associated with usage details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and management group, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. + */ + private _list( + scope: string, + options?: UsageDetailsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param scope The scope associated with usage details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and management group, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scope: string, + nextLink: string, + options?: UsageDetailsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.subscriptionId], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingPeriodOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/usageDetails", httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.subscriptionId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.UsageDetailsListResult @@ -1016,48 +181,21 @@ const listByBillingPeriodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByBillingAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.billingAccountId], queryParameters: [ Parameters.expand, - Parameters.filter0, + Parameters.filter, Parameters.skiptoken, Parameters.top, Parameters.apiVersion, - Parameters.apply + Parameters.metric ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const listForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = { +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.billingAccountId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.UsageDetailsListResult @@ -1066,395 +204,15 @@ const listForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.departmentId], queryParameters: [ Parameters.expand, - Parameters.filter0, + Parameters.filter, Parameters.skiptoken, Parameters.top, Parameters.apiVersion, - Parameters.apply + Parameters.metric ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.departmentId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.enrollmentAccountId], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.enrollmentAccountId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.managementGroupId], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.managementGroupId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByBillingPeriodNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByBillingAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByBillingAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByDepartmentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByDepartmentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByEnrollmentAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByEnrollmentAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByManagementGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/aggregatedCost.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/aggregatedCost.ts new file mode 100644 index 000000000000..5cd517b364c0 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/aggregatedCost.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + AggregatedCostGetByManagementGroupOptionalParams, + AggregatedCostGetByManagementGroupResponse, + AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams, + AggregatedCostGetForBillingPeriodByManagementGroupResponse +} from "../models"; + +/** Interface representing a AggregatedCost. */ +export interface AggregatedCost { + /** + * Provides the aggregate cost of a management group and all child management groups by current billing + * period. + * @param managementGroupId Azure Management Group ID. + * @param options The options parameters. + */ + getByManagementGroup( + managementGroupId: string, + options?: AggregatedCostGetByManagementGroupOptionalParams + ): Promise; + /** + * Provides the aggregate cost of a management group and all child management groups by specified + * billing period + * @param managementGroupId Azure Management Group ID. + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + getForBillingPeriodByManagementGroup( + managementGroupId: string, + billingPeriodName: string, + options?: AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/balances.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/balances.ts new file mode 100644 index 000000000000..b6d7cf515aeb --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/balances.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + BalancesGetByBillingAccountOptionalParams, + BalancesGetByBillingAccountResponse, + BalancesGetForBillingPeriodByBillingAccountOptionalParams, + BalancesGetForBillingPeriodByBillingAccountResponse +} from "../models"; + +/** Interface representing a Balances. */ +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 billingAccountId BillingAccount ID + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountId: string, + options?: BalancesGetByBillingAccountOptionalParams + ): 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 billingAccountId BillingAccount ID + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + getForBillingPeriodByBillingAccount( + billingAccountId: string, + billingPeriodName: string, + options?: BalancesGetForBillingPeriodByBillingAccountOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts new file mode 100644 index 000000000000..ef12d70ae33e --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Budget, + BudgetsListOptionalParams, + BudgetsGetOptionalParams, + BudgetsGetResponse, + BudgetsCreateOrUpdateOptionalParams, + BudgetsCreateOrUpdateResponse, + BudgetsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Budgets. */ +export interface Budgets { + /** + * Lists all budgets for the defined scope. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param options The options parameters. + */ + list( + scope: string, + options?: BudgetsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the budget for the scope by budget name. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param budgetName Budget Name. + * @param options The options parameters. + */ + get( + scope: string, + budgetName: string, + options?: BudgetsGetOptionalParams + ): Promise; + /** + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form + * of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior + * to your put operation. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param budgetName Budget Name. + * @param parameters Parameters supplied to the Create Budget operation. + * @param options The options parameters. + */ + createOrUpdate( + scope: string, + budgetName: string, + parameters: Budget, + options?: BudgetsCreateOrUpdateOptionalParams + ): Promise; + /** + * The operation to delete a budget. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param budgetName Budget Name. + * @param options The options parameters. + */ + delete( + scope: string, + budgetName: string, + options?: BudgetsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts new file mode 100644 index 000000000000..074f8c6d24ee --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { ChargesListOptionalParams, ChargesListResponse } from "../models"; + +/** Interface representing a Charges. */ +export interface Charges { + /** + * Lists the charges based for the defined scope. + * @param scope The scope associated with charges operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period + * to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to + * specify billing period at department scope use + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. + */ + list( + scope: string, + options?: ChargesListOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/credits.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/credits.ts new file mode 100644 index 000000000000..4a074f54853d --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/credits.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { CreditsGetOptionalParams, CreditsGetResponse } from "../models"; + +/** Interface representing a Credits. */ +export interface Credits { + /** + * The credit summary by billingAccountId and billingProfileId. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + get( + billingAccountId: string, + billingProfileId: string, + options?: CreditsGetOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/eventsOperations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/eventsOperations.ts new file mode 100644 index 000000000000..82b66c5d5513 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/eventsOperations.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + EventSummary, + EventsListByBillingProfileOptionalParams, + EventsListByBillingAccountOptionalParams +} from "../models"; + +/// +/** Interface representing a EventsOperations. */ +export interface EventsOperations { + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param startDate Start date + * @param endDate End date + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/index.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..b751ef901317 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/index.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./usageDetails"; +export * from "./marketplaces"; +export * from "./budgets"; +export * from "./tags"; +export * from "./charges"; +export * from "./balances"; +export * from "./reservationsSummaries"; +export * from "./reservationsDetails"; +export * from "./reservationRecommendations"; +export * from "./reservationRecommendationDetails"; +export * from "./reservationTransactions"; +export * from "./priceSheet"; +export * from "./operations"; +export * from "./aggregatedCost"; +export * from "./eventsOperations"; +export * from "./lotsOperations"; +export * from "./credits"; diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts new file mode 100644 index 000000000000..cee7524cb172 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + LotSummary, + LotsListByBillingProfileOptionalParams, + LotsListByBillingAccountOptionalParams +} from "../models"; + +/// +/** Interface representing a LotsOperations. */ +export interface LotsOperations { + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/marketplaces.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/marketplaces.ts new file mode 100644 index 000000000000..5998f4baed58 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/marketplaces.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Marketplace, MarketplacesListOptionalParams } from "../models"; + +/// +/** Interface representing a Marketplaces. */ +export interface Marketplaces { + /** + * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API + * only for May 1, 2014 or later. + * @param scope The scope associated with marketplace operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and ManagementGroup, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + * @param options The options parameters. + */ + list( + scope: string, + options?: MarketplacesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/operations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..f057fff6bf38 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available consumption REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts new file mode 100644 index 000000000000..b9ce965b0936 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + PriceSheetGetOptionalParams, + PriceSheetGetResponse, + PriceSheetGetByBillingPeriodOptionalParams, + PriceSheetGetByBillingPeriodResponse +} from "../models"; + +/** Interface representing a PriceSheet. */ +export interface PriceSheet { + /** + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 + * or later. + * @param options The options parameters. + */ + get(options?: PriceSheetGetOptionalParams): 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. + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + getByBillingPeriod( + billingPeriodName: string, + options?: PriceSheetGetByBillingPeriodOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts new file mode 100644 index 000000000000..563830545ff9 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Term, + LookBackPeriod, + ReservationRecommendationDetailsGetOptionalParams, + ReservationRecommendationDetailsGetResponse +} from "../models"; + +/** Interface representing a ReservationRecommendationDetails. */ +export interface ReservationRecommendationDetails { + /** + * Details of a reservation recommendation for what-if analysis of reserved instances. + * @param scope The scope associated with reservation recommendation details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param region Used to select the region the recommendation should be generated for. + * @param term Specify length of reservation recommendation term. + * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. + * @param product Filter the products for which reservation recommendation results are generated. + * Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + * @param options The options parameters. + */ + get( + scope: string, + region: string, + term: Term, + lookBackPeriod: LookBackPeriod, + product: string, + options?: ReservationRecommendationDetailsGetOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts new file mode 100644 index 000000000000..e4df3b2a4d35 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationRecommendationUnion, + ReservationRecommendationsListOptionalParams +} from "../models"; + +/// +/** Interface representing a ReservationRecommendations. */ +export interface ReservationRecommendations { + /** + * List of recommendations for purchasing reserved instances. + * @param scope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param options The options parameters. + */ + list( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts new file mode 100644 index 000000000000..bc3dd77c5727 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationTransaction, + ReservationTransactionsListOptionalParams, + ModernReservationTransaction, + ReservationTransactionsListByBillingProfileOptionalParams +} from "../models"; + +/// +/** Interface representing a ReservationTransactions. */ +export interface ReservationTransactions { + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + list( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts new file mode 100644 index 000000000000..771aedbfc513 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationDetail, + ReservationsDetailsListByReservationOrderOptionalParams, + ReservationsDetailsListByReservationOrderAndReservationOptionalParams, + ReservationsDetailsListOptionalParams +} from "../models"; + +/// +/** Interface representing a ReservationsDetails. */ +export interface ReservationsDetails { + /** + * Lists the reservations details for provided date range. + * @param reservationOrderId Order Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. + */ + listByReservationOrder( + reservationOrderId: string, + filter: string, + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the reservations details for provided date range. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. + */ + listByReservationOrderAndReservation( + reservationOrderId: string, + reservationId: string, + filter: string, + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the reservations details for the defined scope and provided date range. + * @param scope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param options The options parameters. + */ + list( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts new file mode 100644 index 000000000000..935d9eeaef13 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationSummary, + Datagrain, + ReservationsSummariesListByReservationOrderOptionalParams, + ReservationsSummariesListByReservationOrderAndReservationOptionalParams, + ReservationsSummariesListOptionalParams +} from "../models"; + +/// +/** Interface representing a ReservationsSummaries. */ +export interface ReservationsSummaries { + /** + * Lists the reservations summaries for daily or monthly grain. + * @param reservationOrderId Order Id of the reservation + * @param grain Can be daily or monthly + * @param options The options parameters. + */ + listByReservationOrder( + reservationOrderId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the reservations summaries for daily or monthly grain. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param grain Can be daily or monthly + * @param options The options parameters. + */ + listByReservationOrderAndReservation( + reservationOrderId: string, + reservationId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the reservations summaries for the defined scope daily or monthly grain. + * @param scope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param grain Can be daily or monthly + * @param options The options parameters. + */ + list( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/tags.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/tags.ts new file mode 100644 index 000000000000..55499202f7c2 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/tags.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { TagsGetOptionalParams, TagsGetResponse } from "../models"; + +/** Interface representing a Tags. */ +export interface Tags { + /** + * Get all available tag keys for the defined scope + * @param scope The scope associated with tags operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope.. + * @param options The options parameters. + */ + get(scope: string, options?: TagsGetOptionalParams): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts new file mode 100644 index 000000000000..b705a0dfe826 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { UsageDetailUnion, UsageDetailsListOptionalParams } from "../models"; + +/// +/** Interface representing a UsageDetails. */ +export interface UsageDetails { + /** + * Lists the usage details for the defined scope. Usage details are available via this API only for May + * 1, 2014 or later. + * @param scope The scope associated with usage details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and management group, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. + */ + list( + scope: string, + options?: UsageDetailsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/test/sampleTest.ts b/sdk/consumption/arm-consumption/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/consumption/arm-consumption/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/consumption/arm-consumption/tsconfig.json b/sdk/consumption/arm-consumption/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/consumption/arm-consumption/tsconfig.json +++ b/sdk/consumption/arm-consumption/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } From 8d9d4e628b898814e0ff1d8ff2891d190c6e160b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 15 Nov 2021 11:18:52 -0800 Subject: [PATCH 02/14] Sync eng/common directory with azure-sdk-tools for PR 2265 (#18683) * Improve devops logging for link checker * Update eng/common/scripts/Verify-Links.ps1 Co-authored-by: Wes Haggard Co-authored-by: Wes Haggard --- eng/common/scripts/Verify-Links.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/eng/common/scripts/Verify-Links.ps1 b/eng/common/scripts/Verify-Links.ps1 index 3808d1f8bb5e..275d4bbde5bd 100644 --- a/eng/common/scripts/Verify-Links.ps1 +++ b/eng/common/scripts/Verify-Links.ps1 @@ -244,10 +244,10 @@ function CheckLink ([System.Uri]$linkUri, $allowRetry=$true) if ($statusCode -in $errorStatusCodes) { if ($originalLinkUri -ne $linkUri) { - LogWarning "[$statusCode] broken link $originalLinkUri (resolved to $linkUri)" + LogError "[$statusCode] broken link $originalLinkUri (resolved to $linkUri)" } else { - LogWarning "[$statusCode] broken link $linkUri" + LogError "[$statusCode] broken link $linkUri" } $linkValid = $false @@ -423,6 +423,9 @@ foreach ($url in $urls) { $pageUrisToCheck.Enqueue($uri); } +if ($devOpsLogging) { + Write-Host "##[group]Link checking details" +} while ($pageUrisToCheck.Count -ne 0) { $pageUri = $pageUrisToCheck.Dequeue(); @@ -430,7 +433,7 @@ while ($pageUrisToCheck.Count -ne 0) $checkedPages[$pageUri] = $true; $linkUris = GetLinks $pageUri - Write-Host "Found $($linkUris.Count) links on page $pageUri"; + Write-Host "Checking $($linkUris.Count) links found on page $pageUri"; $badLinksPerPage = @(); foreach ($linkUri in $linkUris) { $isLinkValid = CheckLink $linkUri @@ -450,6 +453,9 @@ while ($pageUrisToCheck.Count -ne 0) $badLinks[$pageUri] = $badLinksPerPage } } +if ($devOpsLogging) { + Write-Host "##[endgroup]" +} if ($badLinks.Count -gt 0) { Write-Host "Summary of broken links:" @@ -464,7 +470,7 @@ foreach ($pageLink in $badLinks.Keys) { $linksChecked = $checkedLinks.Count - $cachedLinksCount if ($badLinks.Count -gt 0) { - LogError "Checked $linksChecked links with $($badLinks.Count) page(s) broken." + Write-Host "Checked $linksChecked links with $($badLinks.Count) broken link(s) found." } else { Write-Host "Checked $linksChecked links. No broken links found." From 26ca5a778e19e8d40ed84fb85b470963d9b6a1c8 Mon Sep 17 00:00:00 2001 From: praveenkuttappan <55455725+praveenkuttappan@users.noreply.github.com> Date: Mon, 15 Nov 2021 15:11:04 -0500 Subject: [PATCH 03/14] Build and test predefined set of packages only in identity pipelines (#18686) * Build and test predefined set of packages only in identity pipelines --- eng/tools/rush-runner.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/eng/tools/rush-runner.js b/eng/tools/rush-runner.js index 0ef2a0298afe..6a615786f90e 100644 --- a/eng/tools/rush-runner.js +++ b/eng/tools/rush-runner.js @@ -34,7 +34,22 @@ const reducedDependencyTestMatrix = { '@azure/identity-vscode', '@azure/storage-file-share', '@azure/template' - ] + ], + 'identity': [ + '@azure-rest/core-client', + '@azure-rest/core-client-lro', + '@azure-rest/core-client-paging', + '@azure-rest/purview-account', + '@azure-tests/perf-storage-blob', + '@azure/ai-text-analytics', + '@azure/arm-compute', + '@azure/identity-cache-persistence', + '@azure/identity-vscode', + '@azure/service-bus', + '@azure/storage-blob', + '@azure/template', + '@azure/synapse-monitoring' + ], }; const parseArgs = () => { From eeee0835ed500c03e14393af485d1fbd543852f6 Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 09:18:17 +0800 Subject: [PATCH 04/14] update --- common/config/rush/pnpm-lock.yaml | 29 +- rush.json | 7 +- sdk/consumption/arm-consumption/CHANGELOG.md | 14 + .../arm-consumption/{LICENSE.txt => LICENSE} | 2 +- sdk/consumption/arm-consumption/README.md | 154 +- sdk/consumption/arm-consumption/_meta.json | 7 + .../arm-consumption/api-extractor.json | 18 + sdk/consumption/arm-consumption/package.json | 92 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-consumption.api.md | 1611 +++++ .../arm-consumption/rollup.config.js | 205 +- .../src/consumptionManagementClient.ts | 140 +- .../src/consumptionManagementClientContext.ts | 88 +- sdk/consumption/arm-consumption/src/index.ts | 13 + .../src/models/aggregatedCostMappers.ts | 37 - .../src/models/balancesMappers.ts | 37 - .../src/models/budgetsMappers.ts | 38 - .../src/models/chargesMappers.ts | 38 - .../src/models/forecastsMappers.ts | 38 - .../arm-consumption/src/models/index.ts | 5785 ++++++++--------- .../arm-consumption/src/models/mappers.ts | 4643 +++++++++---- .../src/models/marketplacesMappers.ts | 38 - .../src/models/operationsMappers.ts | 15 - .../arm-consumption/src/models/parameters.ts | 294 +- .../src/models/priceSheetMappers.ts | 37 - .../reservationRecommendationsMappers.ts | 14 - .../src/models/reservationsDetailsMappers.ts | 38 - .../models/reservationsSummariesMappers.ts | 38 - .../arm-consumption/src/models/tagsMappers.ts | 37 - .../src/models/tenantsMappers.ts | 38 - .../src/models/usageDetailsMappers.ts | 38 - .../src/operations/aggregatedCost.ts | 150 +- .../src/operations/balances.ts | 146 +- .../arm-consumption/src/operations/budgets.ts | 756 +-- .../arm-consumption/src/operations/charges.ts | 345 +- .../arm-consumption/src/operations/credits.ts | 69 + .../src/operations/eventsOperations.ts | 358 + .../src/operations/forecasts.ts | 79 - .../arm-consumption/src/operations/index.ts | 16 +- .../src/operations/lotsOperations.ts | 321 + .../src/operations/marketplaces.ts | 1514 +---- .../src/operations/operations.ts | 164 +- .../src/operations/priceSheet.ts | 144 +- .../reservationRecommendationDetails.ts | 89 + .../operations/reservationRecommendations.ts | 200 +- .../src/operations/reservationTransactions.ts | 311 + .../src/operations/reservationsDetails.ts | 590 +- .../src/operations/reservationsSummaries.ts | 603 +- .../arm-consumption/src/operations/tags.ts | 85 +- .../arm-consumption/src/operations/tenants.ts | 98 - .../src/operations/usageDetails.ts | 1566 +---- .../operationsInterfaces/aggregatedCost.ts | 40 + .../src/operationsInterfaces/balances.ts | 40 + .../src/operationsInterfaces/budgets.ts | 117 + .../src/operationsInterfaces/charges.ts | 37 + .../src/operationsInterfaces/credits.ts | 24 + .../operationsInterfaces/eventsOperations.ts | 45 + .../src/operationsInterfaces/index.ts | 25 + .../operationsInterfaces/lotsOperations.ts | 43 + .../src/operationsInterfaces/marketplaces.ts | 35 + .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/priceSheet.ts | 34 + .../reservationRecommendationDetails.ts | 41 + .../reservationRecommendations.ts | 32 + .../reservationTransactions.ts | 40 + .../reservationsDetails.ts | 59 + .../reservationsSummaries.ts | 60 + .../src/operationsInterfaces/tags.ts | 27 + .../src/operationsInterfaces/usageDetails.ts | 43 + .../arm-consumption/test/sampleTest.ts | 48 + sdk/consumption/arm-consumption/tsconfig.json | 6 +- sdk/consumption/ci.yml | 29 + 72 files changed, 12088 insertions(+), 9951 deletions(-) create mode 100644 sdk/consumption/arm-consumption/CHANGELOG.md rename sdk/consumption/arm-consumption/{LICENSE.txt => LICENSE} (99%) create mode 100644 sdk/consumption/arm-consumption/_meta.json create mode 100644 sdk/consumption/arm-consumption/api-extractor.json create mode 100644 sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/consumption/arm-consumption/review/arm-consumption.api.md create mode 100644 sdk/consumption/arm-consumption/src/index.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/balancesMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/budgetsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/chargesMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/forecastsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/marketplacesMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/operationsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/priceSheetMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/reservationRecommendationsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/reservationsDetailsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/reservationsSummariesMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/tagsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/tenantsMappers.ts delete mode 100644 sdk/consumption/arm-consumption/src/models/usageDetailsMappers.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/credits.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/eventsOperations.ts delete mode 100644 sdk/consumption/arm-consumption/src/operations/forecasts.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/lotsOperations.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts create mode 100644 sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts delete mode 100644 sdk/consumption/arm-consumption/src/operations/tenants.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/aggregatedCost.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/balances.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/credits.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/eventsOperations.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/index.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/marketplaces.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/operations.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/tags.ts create mode 100644 sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts create mode 100644 sdk/consumption/arm-consumption/test/sampleTest.ts create mode 100644 sdk/consumption/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 06d340c98009..bbc2a054a0c5 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -15,6 +15,7 @@ specifiers: '@rush-temp/arm-authorization': file:./projects/arm-authorization.tgz '@rush-temp/arm-cdn': file:./projects/arm-cdn.tgz '@rush-temp/arm-compute': file:./projects/arm-compute.tgz + '@rush-temp/arm-consumption': file:./projects/arm-consumption.tgz '@rush-temp/arm-containerregistry': file:./projects/arm-containerregistry.tgz '@rush-temp/arm-containerservice': file:./projects/arm-containerservice.tgz '@rush-temp/arm-databricks': file:./projects/arm-databricks.tgz @@ -168,6 +169,7 @@ dependencies: '@rush-temp/arm-authorization': file:projects/arm-authorization.tgz '@rush-temp/arm-cdn': file:projects/arm-cdn.tgz '@rush-temp/arm-compute': file:projects/arm-compute.tgz + '@rush-temp/arm-consumption': file:projects/arm-consumption.tgz '@rush-temp/arm-containerregistry': file:projects/arm-containerregistry.tgz '@rush-temp/arm-containerservice': file:projects/arm-containerservice.tgz '@rush-temp/arm-databricks': file:projects/arm-databricks.tgz @@ -1579,7 +1581,6 @@ packages: /@opentelemetry/node/0.22.0_@opentelemetry+api@1.0.3: resolution: {integrity: sha512-+HhGbDruQ7cwejVOIYyxRa28uosnG8W95NiQZ6qE8PXXPsDSyGeftAPbtYpGit0H2f5hrVcMlwmWHeAo9xkSLA==} engines: {node: '>=8.0.0'} - deprecated: Package renamed to @opentelemetry/sdk-trace-node peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: @@ -8722,6 +8723,30 @@ packages: - supports-color dev: false + file:projects/arm-consumption.tgz: + resolution: {integrity: sha512-RaHr5iariWc5Xz58Evx/JQZWH+KXT+v7rE2MVTDCjz353IW62T82d+AI6efpTg3MzqELWUUtYGR84Z+3eIufzA==, tarball: file:projects/arm-consumption.tgz} + name: '@rush-temp/arm-consumption' + version: 0.0.0 + dependencies: + '@azure/identity': 2.0.0-beta.6 + '@microsoft/api-extractor': 7.18.19 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.3 + transitivePeerDependencies: + - debug + - supports-color + dev: false + file:projects/arm-containerregistry.tgz: resolution: {integrity: sha512-Ll1nwuw78ynR/8a9E3Lct85LuUs7K7/aSfqw8QGLHIx2V0J4sWbVz2+WKyY7JZOXruRBUTyAzzkbgiS5z+4HwA==, tarball: file:projects/arm-containerregistry.tgz} name: '@rush-temp/arm-containerregistry' @@ -12585,7 +12610,7 @@ packages: dev: false file:projects/schema-registry-avro.tgz: - resolution: {integrity: sha512-iRbvRW1AI8qOZY+dkzisvXFgybYssX9NgChAuqaGV8dltHQaY46PCBwNYepCjB1GbFfVqz4bl4CKtvZ6zhogXQ==, tarball: file:projects/schema-registry-avro.tgz} + resolution: {integrity: sha512-es1wTz4ESP2fxE8Wky3jiVQdorQHXzokj57HKP5pNkP4WnDy+0p20f6dQZAgH1abgNsYYha8yK+vK/i2txJ+AQ==, tarball: file:projects/schema-registry-avro.tgz} name: '@rush-temp/schema-registry-avro' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index 46a7e5b47f8b..820dfc46c378 100644 --- a/rush.json +++ b/rush.json @@ -1075,6 +1075,11 @@ "packageName": "@azure/arm-cdn", "projectFolder": "sdk/cdn/arm-cdn", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-consumption", + "projectFolder": "sdk/consumption/arm-consumption", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/CHANGELOG.md b/sdk/consumption/arm-consumption/CHANGELOG.md new file mode 100644 index 000000000000..bc4ba0178b8c --- /dev/null +++ b/sdk/consumption/arm-consumption/CHANGELOG.md @@ -0,0 +1,14 @@ +## 9.0.0-beta.1 (2021-11-16) + +This is the first preview for the new version of the `@azure/arm-consumption` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services. + +While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/). + +Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies. + +**Noteworthy changes and features** +- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice. +- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead. +- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page. +- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`. +- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6. diff --git a/sdk/consumption/arm-consumption/LICENSE.txt b/sdk/consumption/arm-consumption/LICENSE similarity index 99% rename from sdk/consumption/arm-consumption/LICENSE.txt rename to sdk/consumption/arm-consumption/LICENSE index 2d3163745319..ccb63b166732 100644 --- a/sdk/consumption/arm-consumption/LICENSE.txt +++ b/sdk/consumption/arm-consumption/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/README.md b/sdk/consumption/arm-consumption/README.md index f89dec55ae63..28c2ebe0ee72 100644 --- a/sdk/consumption/arm-consumption/README.md +++ b/sdk/consumption/arm-consumption/README.md @@ -1,118 +1,94 @@ -## Azure ConsumptionManagementClient SDK for JavaScript +# Azure ConsumptionManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for ConsumptionManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ConsumptionManagement client. + +Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-consumption) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-consumption) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-consumption` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-consumption` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure ConsumptionManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-consumption @azure/identity +npm install @azure/arm-consumption ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `ConsumptionManagementClient` -### How to use +To create a client object to access the Azure ConsumptionManagement API, you will need the `endpoint` of your Azure ConsumptionManagement resource and a `credential`. The Azure ConsumptionManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ConsumptionManagement resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list usageDetails as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure ConsumptionManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { ConsumptionManagementClient } = require("@azure/arm-consumption"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new ConsumptionManagementClient(creds, subscriptionId); -const expand = "testexpand"; -const filter = "testfilter"; -const skiptoken = "testskiptoken"; -const top = 1; -const apply = "testapply"; -client.usageDetails.list(expand, filter, skiptoken, top, apply).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ConsumptionManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list usageDetails as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-consumption sample - - - - - - - +## Key concepts + +### ConsumptionManagementClient + +`ConsumptionManagementClient` is the primary interface for developers using the Azure ConsumptionManagement client library. Explore the methods on this client object to understand the different features of the Azure ConsumptionManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fconsumption%2Farm-consumption%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/consumption/arm-consumption/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/consumption/arm-consumption/_meta.json b/sdk/consumption/arm-consumption/_meta.json new file mode 100644 index 000000000000..f609791c1a66 --- /dev/null +++ b/sdk/consumption/arm-consumption/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "1e65d778939ea2f0859a81bde55740169a9b8dbb", + "readme": "specification/consumption/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/consumption/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.14", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-beta.14" +} \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/api-extractor.json b/sdk/consumption/arm-consumption/api-extractor.json new file mode 100644 index 000000000000..64cf6e492117 --- /dev/null +++ b/sdk/consumption/arm-consumption/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-consumption.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/consumption/arm-consumption/package.json b/sdk/consumption/arm-consumption/package.json index b1ebe75e9646..e9b32f95233f 100644 --- a/sdk/consumption/arm-consumption/package.json +++ b/sdk/consumption/arm-consumption/package.json @@ -1,58 +1,88 @@ { "name": "@azure/arm-consumption", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "ConsumptionManagementClient Library with typescript type definitions for node.js and browser.", - "version": "7.1.0", + "description": "A generated SDK for ConsumptionManagementClient.", + "version": "9.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-consumption.js", - "module": "./esm/consumptionManagementClient.js", - "types": "./esm/consumptionManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-consumption.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "@azure/identity": "2.0.0-beta.6", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-consumption.js.map'\" -o ./dist/arm-consumption.min.js ./dist/arm-consumption.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "echo skipped", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/consumption/arm-consumption/review/arm-consumption.api.md b/sdk/consumption/arm-consumption/review/arm-consumption.api.md new file mode 100644 index 000000000000..c8c1e970bcc2 --- /dev/null +++ b/sdk/consumption/arm-consumption/review/arm-consumption.api.md @@ -0,0 +1,1611 @@ +## API Report File for "@azure/arm-consumption" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; + +// @public +export interface AggregatedCost { + getByManagementGroup(managementGroupId: string, options?: AggregatedCostGetByManagementGroupOptionalParams): Promise; + getForBillingPeriodByManagementGroup(managementGroupId: string, billingPeriodName: string, options?: AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams): Promise; +} + +// @public +export interface AggregatedCostGetByManagementGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type AggregatedCostGetByManagementGroupResponse = ManagementGroupAggregatedCostResult; + +// @public +export interface AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AggregatedCostGetForBillingPeriodByManagementGroupResponse = ManagementGroupAggregatedCostResult; + +// @public +export interface Amount { + readonly currency?: string; + readonly value?: number; +} + +// @public +export type AmountWithExchangeRate = Amount & { + readonly exchangeRate?: number; + readonly exchangeRateMonth?: number; +}; + +// @public +export type Balance = 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?: BillingFrequency; + readonly priceHidden?: boolean; + readonly newPurchasesDetails?: BalancePropertiesNewPurchasesDetailsItem[]; + readonly adjustmentDetails?: BalancePropertiesAdjustmentDetailsItem[]; +}; + +// @public (undocumented) +export interface BalancePropertiesAdjustmentDetailsItem { + readonly name?: string; + readonly value?: number; +} + +// @public (undocumented) +export interface BalancePropertiesNewPurchasesDetailsItem { + readonly name?: string; + readonly value?: number; +} + +// @public +export interface Balances { + getByBillingAccount(billingAccountId: string, options?: BalancesGetByBillingAccountOptionalParams): Promise; + getForBillingPeriodByBillingAccount(billingAccountId: string, billingPeriodName: string, options?: BalancesGetForBillingPeriodByBillingAccountOptionalParams): Promise; +} + +// @public +export interface BalancesGetByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BalancesGetByBillingAccountResponse = Balance; + +// @public +export interface BalancesGetForBillingPeriodByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BalancesGetForBillingPeriodByBillingAccountResponse = Balance; + +// @public +export type BillingFrequency = string; + +// @public +export type Budget = ProxyResource & { + category?: CategoryType; + amount?: number; + timeGrain?: TimeGrainType; + timePeriod?: BudgetTimePeriod; + filter?: BudgetFilter; + readonly currentSpend?: CurrentSpend; + notifications?: { + [propertyName: string]: Notification_2; + }; + readonly forecastSpend?: ForecastSpend; +}; + +// @public +export interface BudgetComparisonExpression { + name: string; + operator: BudgetOperatorType; + values: string[]; +} + +// @public +export interface BudgetFilter { + and?: BudgetFilterProperties[]; + dimensions?: BudgetComparisonExpression; + not?: BudgetFilterProperties; + tags?: BudgetComparisonExpression; +} + +// @public +export interface BudgetFilterProperties { + dimensions?: BudgetComparisonExpression; + tags?: BudgetComparisonExpression; +} + +// @public +export type BudgetOperatorType = string; + +// @public +export interface Budgets { + createOrUpdate(scope: string, budgetName: string, parameters: Budget, options?: BudgetsCreateOrUpdateOptionalParams): Promise; + delete(scope: string, budgetName: string, options?: BudgetsDeleteOptionalParams): Promise; + get(scope: string, budgetName: string, options?: BudgetsGetOptionalParams): Promise; + list(scope: string, options?: BudgetsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BudgetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BudgetsCreateOrUpdateResponse = Budget; + +// @public +export interface BudgetsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface BudgetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BudgetsGetResponse = Budget; + +// @public +export interface BudgetsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BudgetsListNextResponse = BudgetsListResult; + +// @public +export interface BudgetsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BudgetsListResponse = BudgetsListResult; + +// @public +export interface BudgetsListResult { + readonly nextLink?: string; + readonly value?: Budget[]; +} + +// @public +export interface BudgetTimePeriod { + endDate?: Date; + startDate: Date; +} + +// @public +export type CategoryType = string; + +// @public +export interface Charges { + list(scope: string, options?: ChargesListOptionalParams): Promise; +} + +// @public +export interface ChargesListOptionalParams extends coreClient.OperationOptions { + apply?: string; + endDate?: string; + filter?: string; + startDate?: string; +} + +// @public +export type ChargesListResponse = ChargesListResult; + +// @public +export interface ChargesListResult { + readonly value?: ChargeSummaryUnion[]; +} + +// @public +export type ChargeSummary = ProxyResource & { + kind: ChargeSummaryKind; +}; + +// @public +export type ChargeSummaryKind = string; + +// @public (undocumented) +export type ChargeSummaryUnion = ChargeSummary | LegacyChargeSummary | ModernChargeSummary; + +// @public (undocumented) +export class ConsumptionManagementClient extends ConsumptionManagementClientContext { + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConsumptionManagementClientOptionalParams); + // (undocumented) + aggregatedCost: AggregatedCost; + // (undocumented) + balances: Balances; + // (undocumented) + budgets: Budgets; + // (undocumented) + charges: Charges; + // (undocumented) + credits: Credits; + // (undocumented) + eventsOperations: EventsOperations; + // (undocumented) + lotsOperations: LotsOperations; + // (undocumented) + marketplaces: Marketplaces; + // (undocumented) + operations: Operations; + // (undocumented) + priceSheet: PriceSheet; + // (undocumented) + reservationRecommendationDetails: ReservationRecommendationDetails; + // (undocumented) + reservationRecommendations: ReservationRecommendations; + // (undocumented) + reservationsDetails: ReservationsDetails; + // (undocumented) + reservationsSummaries: ReservationsSummaries; + // (undocumented) + reservationTransactions: ReservationTransactions; + // (undocumented) + tags: Tags; + // (undocumented) + usageDetails: UsageDetails; +} + +// @public (undocumented) +export class ConsumptionManagementClientContext extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConsumptionManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface ConsumptionManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface CreditBalanceSummary { + readonly currentBalance?: Amount; + readonly estimatedBalance?: Amount; + readonly estimatedBalanceInBillingCurrency?: AmountWithExchangeRate; +} + +// @public +export interface Credits { + get(billingAccountId: string, billingProfileId: string, options?: CreditsGetOptionalParams): Promise; +} + +// @public +export interface CreditsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CreditsGetResponse = CreditSummary; + +// @public +export type CreditSummary = Resource & { + readonly balanceSummary?: CreditBalanceSummary; + readonly pendingCreditAdjustments?: Amount; + readonly expiredCredit?: Amount; + readonly pendingEligibleCharges?: Amount; + readonly creditCurrency?: string; + readonly billingCurrency?: string; + readonly reseller?: Reseller; + readonly eTag?: string; +}; + +// @public +export type CultureCode = string; + +// @public +export interface CurrentSpend { + readonly amount?: number; + readonly unit?: string; +} + +// @public +export type Datagrain = string; + +// @public +export interface DownloadProperties { + readonly downloadUrl?: string; + readonly validTill?: string; +} + +// @public +export interface ErrorDetails { + readonly code?: string; + readonly message?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetails; +} + +// @public +export interface Events { + readonly nextLink?: string; + readonly value?: EventSummary[]; +} + +// @public +export interface EventsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type EventsListByBillingAccountNextResponse = Events; + +// @public +export interface EventsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type EventsListByBillingAccountResponse = Events; + +// @public +export interface EventsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventsListByBillingProfileNextResponse = Events; + +// @public +export interface EventsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventsListByBillingProfileResponse = Events; + +// @public +export interface EventsOperations { + listByBillingAccount(billingAccountId: string, options?: EventsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountId: string, billingProfileId: string, startDate: string, endDate: string, options?: EventsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type EventSummary = ProxyResource & { + readonly transactionDate?: Date; + readonly description?: string; + readonly newCredit?: Amount; + readonly adjustments?: Amount; + readonly creditExpired?: Amount; + readonly charges?: Amount; + readonly closedBalance?: Amount; + eventType?: EventType; + readonly invoiceNumber?: string; + readonly billingProfileId?: string; + readonly billingProfileDisplayName?: string; + readonly lotId?: string; + readonly lotSource?: string; + readonly canceledCredit?: Amount; + readonly creditCurrency?: string; + readonly billingCurrency?: string; + readonly reseller?: Reseller; + readonly creditExpiredInBillingCurrency?: AmountWithExchangeRate; + readonly newCreditInBillingCurrency?: AmountWithExchangeRate; + readonly adjustmentsInBillingCurrency?: AmountWithExchangeRate; + readonly chargesInBillingCurrency?: AmountWithExchangeRate; + readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; + readonly eTagPropertiesETag?: string; +}; + +// @public +export type EventType = string; + +// @public +export interface ForecastSpend { + readonly amount?: number; + readonly unit?: string; +} + +// @public +export interface HighCasedErrorDetails { + readonly code?: string; + readonly message?: string; +} + +// @public +export interface HighCasedErrorResponse { + error?: HighCasedErrorDetails; +} + +// @public +export enum KnownBillingFrequency { + // (undocumented) + Month = "Month", + // (undocumented) + Quarter = "Quarter", + // (undocumented) + Year = "Year" +} + +// @public +export enum KnownBudgetOperatorType { + // (undocumented) + In = "In" +} + +// @public +export enum KnownCategoryType { + // (undocumented) + Cost = "Cost" +} + +// @public +export enum KnownChargeSummaryKind { + // (undocumented) + Legacy = "legacy", + // (undocumented) + Modern = "modern" +} + +// @public +export enum KnownCultureCode { + // (undocumented) + CsCz = "cs-cz", + // (undocumented) + DaDk = "da-dk", + // (undocumented) + DeDe = "de-de", + // (undocumented) + EnGb = "en-gb", + // (undocumented) + EnUs = "en-us", + // (undocumented) + EsEs = "es-es", + // (undocumented) + FrFr = "fr-fr", + // (undocumented) + HuHu = "hu-hu", + // (undocumented) + ItIt = "it-it", + // (undocumented) + JaJp = "ja-jp", + // (undocumented) + KoKr = "ko-kr", + // (undocumented) + NbNo = "nb-no", + // (undocumented) + NlNl = "nl-nl", + // (undocumented) + PlPl = "pl-pl", + // (undocumented) + PtBr = "pt-br", + // (undocumented) + PtPt = "pt-pt", + // (undocumented) + RuRu = "ru-ru", + // (undocumented) + SvSe = "sv-se", + // (undocumented) + TrTr = "tr-tr", + // (undocumented) + ZhCn = "zh-cn", + // (undocumented) + ZhTw = "zh-tw" +} + +// @public +export enum KnownDatagrain { + DailyGrain = "daily", + MonthlyGrain = "monthly" +} + +// @public +export enum KnownEventType { + // (undocumented) + NewCredit = "NewCredit", + // (undocumented) + PendingAdjustments = "PendingAdjustments", + // (undocumented) + PendingCharges = "PendingCharges", + // (undocumented) + PendingExpiredCredit = "PendingExpiredCredit", + // (undocumented) + PendingNewCredit = "PendingNewCredit", + // (undocumented) + SettledCharges = "SettledCharges", + // (undocumented) + UnKnown = "UnKnown" +} + +// @public +export enum KnownLookBackPeriod { + Last07Days = "Last7Days", + Last30Days = "Last30Days", + Last60Days = "Last60Days" +} + +// @public +export enum KnownLotSource { + // (undocumented) + ConsumptionCommitment = "ConsumptionCommitment", + // (undocumented) + PromotionalCredit = "PromotionalCredit", + // (undocumented) + PurchasedCredit = "PurchasedCredit" +} + +// @public +export enum KnownMetrictype { + ActualCostMetricType = "actualcost", + AmortizedCostMetricType = "amortizedcost", + UsageMetricType = "usage" +} + +// @public +export enum KnownOperatorType { + // (undocumented) + EqualTo = "EqualTo", + // (undocumented) + GreaterThan = "GreaterThan", + // (undocumented) + GreaterThanOrEqualTo = "GreaterThanOrEqualTo" +} + +// @public +export enum KnownPricingModelType { + // (undocumented) + OnDemand = "On Demand", + // (undocumented) + Reservation = "Reservation", + // (undocumented) + Spot = "Spot" +} + +// @public +export enum KnownReservationRecommendationKind { + // (undocumented) + Legacy = "legacy", + // (undocumented) + Modern = "modern" +} + +// @public +export enum KnownScope { + // (undocumented) + Shared = "Shared", + // (undocumented) + Single = "Single" +} + +// @public +export enum KnownStatus { + // (undocumented) + Active = "Active", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Complete = "Complete", + // (undocumented) + Expired = "Expired", + // (undocumented) + Inactive = "Inactive", + // (undocumented) + None = "None" +} + +// @public +export enum KnownTerm { + P1Y = "P1Y", + P3Y = "P3Y" +} + +// @public +export enum KnownThresholdType { + // (undocumented) + Actual = "Actual", + // (undocumented) + Forecasted = "Forecasted" +} + +// @public +export enum KnownTimeGrainType { + // (undocumented) + Annually = "Annually", + // (undocumented) + BillingAnnual = "BillingAnnual", + // (undocumented) + BillingMonth = "BillingMonth", + // (undocumented) + BillingQuarter = "BillingQuarter", + // (undocumented) + Monthly = "Monthly", + // (undocumented) + Quarterly = "Quarterly" +} + +// @public +export enum KnownUsageDetailsKind { + // (undocumented) + Legacy = "legacy", + // (undocumented) + Modern = "modern" +} + +// @public +export type LegacyChargeSummary = ChargeSummary & { + readonly billingPeriodId?: string; + readonly usageStart?: string; + readonly usageEnd?: string; + readonly azureCharges?: number; + readonly chargesBilledSeparately?: number; + readonly marketplaceCharges?: number; + readonly currency?: string; +}; + +// @public +export type LegacyReservationRecommendation = ReservationRecommendation & { + readonly lookBackPeriod?: string; + readonly instanceFlexibilityRatio?: number; + readonly instanceFlexibilityGroup?: string; + readonly normalizedSize?: string; + readonly recommendedQuantityNormalized?: number; + readonly meterId?: string; + readonly resourceType?: string; + readonly term?: string; + readonly costWithNoReservedInstances?: number; + readonly recommendedQuantity?: number; + readonly totalCostWithReservedInstances?: number; + readonly netSavings?: number; + readonly firstUsageDate?: Date; + readonly scope?: string; + readonly skuProperties?: SkuProperty[]; +}; + +// @public +export type LegacyReservationTransaction = ReservationTransaction & {}; + +// @public +export type LegacyUsageDetail = UsageDetail & { + readonly billingAccountId?: string; + readonly billingAccountName?: string; + readonly billingPeriodStartDate?: Date; + readonly billingPeriodEndDate?: Date; + readonly billingProfileId?: string; + readonly billingProfileName?: string; + readonly accountOwnerId?: string; + readonly accountName?: string; + readonly subscriptionId?: string; + readonly subscriptionName?: string; + readonly date?: Date; + readonly product?: string; + readonly partNumber?: string; + readonly meterId?: string; + readonly meterDetails?: MeterDetailsResponse; + readonly quantity?: number; + readonly effectivePrice?: number; + readonly cost?: number; + readonly unitPrice?: number; + readonly billingCurrency?: string; + readonly resourceLocation?: string; + readonly consumedService?: string; + readonly resourceId?: string; + readonly resourceName?: string; + readonly serviceInfo1?: string; + readonly serviceInfo2?: string; + readonly additionalInfo?: string; + readonly invoiceSection?: string; + readonly costCenter?: string; + readonly resourceGroup?: string; + readonly reservationId?: string; + readonly reservationName?: string; + readonly productOrderId?: string; + readonly productOrderName?: string; + readonly offerId?: string; + readonly isAzureCreditEligible?: boolean; + readonly term?: string; + readonly publisherName?: string; + readonly publisherType?: string; + readonly planName?: string; + readonly chargeType?: string; + readonly frequency?: string; + readonly payGPrice?: number; + readonly pricingModel?: PricingModelType; +}; + +// @public +export type LookBackPeriod = string; + +// @public +export interface Lots { + readonly nextLink?: string; + readonly value?: LotSummary[]; +} + +// @public +export interface LotsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LotsListByBillingAccountNextResponse = Lots; + +// @public +export interface LotsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LotsListByBillingAccountResponse = Lots; + +// @public +export interface LotsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LotsListByBillingProfileNextResponse = Lots; + +// @public +export interface LotsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LotsListByBillingProfileResponse = Lots; + +// @public +export interface LotsOperations { + listByBillingAccount(billingAccountId: string, options?: LotsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountId: string, billingProfileId: string, options?: LotsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type LotSource = string; + +// @public +export type LotSummary = ProxyResource & { + readonly originalAmount?: Amount; + readonly closedBalance?: Amount; + readonly source?: LotSource; + readonly startDate?: Date; + readonly expirationDate?: Date; + readonly poNumber?: string; + readonly purchasedDate?: Date; + readonly status?: Status; + readonly creditCurrency?: string; + readonly billingCurrency?: string; + readonly originalAmountInBillingCurrency?: AmountWithExchangeRate; + readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; + readonly reseller?: Reseller; + readonly eTagPropertiesETag?: string; +}; + +// @public +export type ManagementGroupAggregatedCostResult = Resource & { + 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[]; +}; + +// @public +export type Marketplace = Resource & { + readonly billingPeriodId?: string; + readonly usageStart?: Date; + readonly usageEnd?: Date; + readonly resourceRate?: number; + readonly offerName?: string; + readonly resourceGroup?: string; + readonly additionalInfo?: string; + readonly orderNumber?: string; + readonly instanceName?: string; + readonly instanceId?: string; + 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; +}; + +// @public +export interface Marketplaces { + list(scope: string, options?: MarketplacesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MarketplacesListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skiptoken?: string; + top?: number; +} + +// @public +export type MarketplacesListNextResponse = MarketplacesListResult; + +// @public +export interface MarketplacesListOptionalParams extends coreClient.OperationOptions { + filter?: string; + skiptoken?: string; + top?: number; +} + +// @public +export type MarketplacesListResponse = MarketplacesListResult; + +// @public +export interface MarketplacesListResult { + readonly nextLink?: string; + readonly value?: Marketplace[]; +} + +// @public +export interface MeterDetails { + readonly meterCategory?: string; + readonly meterLocation?: string; + readonly meterName?: string; + readonly meterSubCategory?: string; + readonly pretaxStandardRate?: number; + readonly serviceName?: string; + readonly serviceTier?: string; + readonly totalIncludedQuantity?: number; + readonly unit?: string; +} + +// @public +export interface MeterDetailsResponse { + readonly meterCategory?: string; + readonly meterName?: string; + readonly meterSubCategory?: string; + readonly serviceFamily?: string; + readonly unitOfMeasure?: string; +} + +// @public +export type Metrictype = string; + +// @public +export type ModernChargeSummary = ChargeSummary & { + readonly billingPeriodId?: string; + readonly usageStart?: string; + readonly usageEnd?: string; + readonly azureCharges?: Amount; + readonly chargesBilledSeparately?: Amount; + readonly marketplaceCharges?: Amount; + readonly billingAccountId?: string; + readonly billingProfileId?: string; + readonly invoiceSectionId?: string; + readonly customerId?: string; + readonly isInvoiced?: boolean; +}; + +// @public +export type ModernReservationRecommendation = ReservationRecommendation & { + readonly locationPropertiesLocation?: string; + readonly lookBackPeriod?: number; + readonly instanceFlexibilityRatio?: number; + readonly instanceFlexibilityGroup?: string; + readonly normalizedSize?: string; + readonly recommendedQuantityNormalized?: number; + readonly meterId?: string; + readonly term?: string; + readonly costWithNoReservedInstances?: Amount; + readonly recommendedQuantity?: number; + readonly totalCostWithReservedInstances?: Amount; + readonly netSavings?: Amount; + readonly firstUsageDate?: Date; + readonly scope?: string; + readonly skuProperties?: SkuProperty[]; + readonly skuName?: string; +}; + +// @public +export type ModernReservationTransaction = ReservationTransactionResource & { + readonly amount?: number; + readonly armSkuName?: string; + readonly billingFrequency?: string; + readonly billingProfileId?: string; + readonly billingProfileName?: string; + readonly currency?: string; + readonly description?: string; + readonly eventDate?: Date; + readonly eventType?: string; + readonly invoice?: string; + readonly invoiceId?: string; + readonly invoiceSectionId?: string; + readonly invoiceSectionName?: string; + readonly purchasingSubscriptionGuid?: string; + readonly purchasingSubscriptionName?: string; + readonly quantity?: number; + readonly region?: string; + readonly reservationOrderId?: string; + readonly reservationOrderName?: string; + readonly term?: string; +}; + +// @public +export interface ModernReservationTransactionsListResult { + readonly nextLink?: string; + readonly value?: ModernReservationTransaction[]; +} + +// @public +export type ModernUsageDetail = UsageDetail & { + readonly billingAccountId?: string; + readonly effectivePrice?: number; + readonly pricingModel?: PricingModelType; + readonly billingAccountName?: string; + readonly billingPeriodStartDate?: Date; + readonly billingPeriodEndDate?: Date; + readonly billingProfileId?: string; + readonly billingProfileName?: string; + readonly subscriptionGuid?: string; + readonly subscriptionName?: string; + readonly date?: Date; + readonly product?: string; + readonly meterId?: string; + readonly meterName?: string; + readonly meterRegion?: string; + readonly meterCategory?: string; + readonly meterSubCategory?: string; + readonly serviceFamily?: string; + readonly quantity?: number; + readonly unitOfMeasure?: string; + readonly instanceName?: string; + readonly costInUSD?: number; + readonly unitPrice?: number; + readonly billingCurrencyCode?: string; + readonly resourceLocation?: string; + readonly consumedService?: string; + readonly serviceInfo1?: string; + readonly serviceInfo2?: string; + readonly additionalInfo?: string; + readonly invoiceSectionId?: string; + readonly invoiceSectionName?: string; + readonly costCenter?: string; + readonly resourceGroup?: string; + readonly reservationId?: string; + readonly reservationName?: string; + readonly productOrderId?: string; + readonly productOrderName?: string; + readonly isAzureCreditEligible?: boolean; + readonly term?: string; + readonly publisherName?: string; + readonly publisherType?: string; + readonly chargeType?: string; + readonly frequency?: string; + readonly costInBillingCurrency?: number; + readonly costInPricingCurrency?: number; + readonly exchangeRate?: string; + readonly exchangeRateDate?: Date; + readonly invoiceId?: string; + readonly previousInvoiceId?: string; + readonly pricingCurrencyCode?: string; + readonly productIdentifier?: string; + readonly resourceLocationNormalized?: string; + readonly servicePeriodStartDate?: Date; + readonly servicePeriodEndDate?: Date; + readonly customerTenantId?: string; + readonly customerName?: string; + readonly partnerTenantId?: string; + readonly partnerName?: string; + readonly resellerMpnId?: string; + readonly resellerName?: string; + readonly publisherId?: string; + readonly marketPrice?: number; + readonly exchangeRatePricingToBilling?: number; + readonly paygCostInBillingCurrency?: number; + readonly paygCostInUSD?: number; + readonly partnerEarnedCreditRate?: number; + readonly partnerEarnedCreditApplied?: string; + readonly payGPrice?: number; + readonly benefitId?: string; + readonly benefitName?: string; + readonly provider?: string; + readonly costAllocationRuleName?: string; +}; + +// @public +interface Notification_2 { + contactEmails: string[]; + contactGroups?: string[]; + contactRoles?: string[]; + enabled: boolean; + locale?: CultureCode; + operator: OperatorType; + threshold: number; + thresholdType?: ThresholdType; +} +export { Notification_2 as Notification } + +// @public +export interface Operation { + display?: OperationDisplay; + readonly id?: string; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type OperatorType = string; + +// @public +export interface PriceSheet { + get(options?: PriceSheetGetOptionalParams): Promise; + getByBillingPeriod(billingPeriodName: string, options?: PriceSheetGetByBillingPeriodOptionalParams): Promise; +} + +// @public +export interface PriceSheetGetByBillingPeriodOptionalParams extends coreClient.OperationOptions { + expand?: string; + skiptoken?: string; + top?: number; +} + +// @public +export type PriceSheetGetByBillingPeriodResponse = PriceSheetResult; + +// @public +export interface PriceSheetGetOptionalParams extends coreClient.OperationOptions { + expand?: string; + skiptoken?: string; + top?: number; +} + +// @public +export type PriceSheetGetResponse = PriceSheetResult; + +// @public +export interface PriceSheetProperties { + readonly billingPeriodId?: string; + readonly currencyCode?: string; + readonly includedQuantity?: number; + readonly meterDetails?: MeterDetails; + readonly meterId?: string; + readonly offerId?: string; + readonly partNumber?: string; + readonly unitOfMeasure?: string; + readonly unitPrice?: number; +} + +// @public +export type PriceSheetResult = Resource & { + readonly pricesheets?: PriceSheetProperties[]; + readonly nextLink?: string; + readonly download?: MeterDetails; +}; + +// @public +export type PricingModelType = string; + +// @public +export interface ProxyResource { + eTag?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface Reseller { + readonly resellerDescription?: string; + readonly resellerId?: string; +} + +// @public +export type ReservationDetail = Resource & { + readonly reservationOrderId?: string; + readonly instanceFlexibilityRatio?: string; + readonly instanceFlexibilityGroup?: string; + readonly reservationId?: string; + readonly skuName?: string; + readonly reservedHours?: number; + readonly usageDate?: Date; + readonly usedHours?: number; + readonly instanceId?: string; + readonly totalReservedQuantity?: number; + readonly kind?: string; +}; + +// @public +export interface ReservationDetailsListResult { + readonly nextLink?: string; + readonly value?: ReservationDetail[]; +} + +// @public +export type ReservationRecommendation = Resource & ResourceAttributes & { + kind: ReservationRecommendationKind; +}; + +// @public +export interface ReservationRecommendationDetails { + get(scope: string, region: string, term: Term, lookBackPeriod: LookBackPeriod, product: string, options?: ReservationRecommendationDetailsGetOptionalParams): Promise; +} + +// @public +export interface ReservationRecommendationDetailsCalculatedSavingsProperties { + readonly onDemandCost?: number; + readonly overageCost?: number; + readonly quantity?: number; + readonly reservationCost?: number; + reservedUnitCount?: number; + readonly savings?: number; + readonly totalReservationCost?: number; +} + +// @public +export interface ReservationRecommendationDetailsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationRecommendationDetailsGetResponse = ReservationRecommendationDetailsModel; + +// @public +export type ReservationRecommendationDetailsModel = Resource & { + location?: string; + sku?: string; + readonly currency?: string; + readonly resource?: ReservationRecommendationDetailsResourceProperties; + readonly resourceGroup?: string; + readonly savings?: ReservationRecommendationDetailsSavingsProperties; + readonly scope?: string; + readonly usage?: ReservationRecommendationDetailsUsageProperties; +}; + +// @public +export interface ReservationRecommendationDetailsResourceProperties { + readonly appliedScopes?: string[]; + readonly onDemandRate?: number; + readonly product?: string; + readonly region?: string; + readonly reservationRate?: number; + readonly resourceType?: string; +} + +// @public +export interface ReservationRecommendationDetailsSavingsProperties { + calculatedSavings?: ReservationRecommendationDetailsCalculatedSavingsProperties[]; + readonly lookBackPeriod?: number; + readonly recommendedQuantity?: number; + readonly reservationOrderTerm?: string; + readonly savingsType?: string; + readonly unitOfMeasure?: string; +} + +// @public +export interface ReservationRecommendationDetailsUsageProperties { + readonly firstConsumptionDate?: string; + readonly lastConsumptionDate?: string; + readonly lookBackUnitType?: string; + readonly usageData?: number[]; + readonly usageGrain?: string; +} + +// @public +export type ReservationRecommendationKind = string; + +// @public +export interface ReservationRecommendations { + list(scope: string, options?: ReservationRecommendationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationRecommendationsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationRecommendationsListNextResponse = ReservationRecommendationsListResult; + +// @public +export interface ReservationRecommendationsListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationRecommendationsListResponse = ReservationRecommendationsListResult; + +// @public +export interface ReservationRecommendationsListResult { + readonly nextLink?: string; + readonly previousLink?: string; + readonly value?: ReservationRecommendationUnion[]; +} + +// @public (undocumented) +export type ReservationRecommendationUnion = ReservationRecommendation | LegacyReservationRecommendation | ModernReservationRecommendation; + +// @public +export interface ReservationsDetails { + list(scope: string, options?: ReservationsDetailsListOptionalParams): PagedAsyncIterableIterator; + listByReservationOrder(reservationOrderId: string, filter: string, options?: ReservationsDetailsListByReservationOrderOptionalParams): PagedAsyncIterableIterator; + listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, filter: string, options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationsDetailsListByReservationOrderAndReservationNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationsDetailsListByReservationOrderAndReservationNextResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListByReservationOrderAndReservationOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationsDetailsListByReservationOrderAndReservationResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListByReservationOrderNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationsDetailsListByReservationOrderNextResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListByReservationOrderOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationsDetailsListByReservationOrderResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListNextOptionalParams extends coreClient.OperationOptions { + endDate?: string; + filter?: string; + reservationId?: string; + reservationOrderId?: string; + startDate?: string; +} + +// @public +export type ReservationsDetailsListNextResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsDetailsListOptionalParams extends coreClient.OperationOptions { + endDate?: string; + filter?: string; + reservationId?: string; + reservationOrderId?: string; + startDate?: string; +} + +// @public +export type ReservationsDetailsListResponse = ReservationDetailsListResult; + +// @public +export interface ReservationsSummaries { + list(scope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams): PagedAsyncIterableIterator; + listByReservationOrder(reservationOrderId: string, grain: Datagrain, options?: ReservationsSummariesListByReservationOrderOptionalParams): PagedAsyncIterableIterator; + listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, grain: Datagrain, options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationsSummariesListByReservationOrderAndReservationNextResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListByReservationOrderAndReservationOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationsSummariesListByReservationOrderAndReservationResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListByReservationOrderNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationsSummariesListByReservationOrderNextResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListByReservationOrderOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationsSummariesListByReservationOrderResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListNextOptionalParams extends coreClient.OperationOptions { + endDate?: string; + filter?: string; + reservationId?: string; + reservationOrderId?: string; + startDate?: string; +} + +// @public +export type ReservationsSummariesListNextResponse = ReservationSummariesListResult; + +// @public +export interface ReservationsSummariesListOptionalParams extends coreClient.OperationOptions { + endDate?: string; + filter?: string; + reservationId?: string; + reservationOrderId?: string; + startDate?: string; +} + +// @public +export type ReservationsSummariesListResponse = ReservationSummariesListResult; + +// @public +export interface ReservationSummariesListResult { + readonly nextLink?: string; + readonly value?: ReservationSummary[]; +} + +// @public +export type ReservationSummary = 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; + readonly kind?: string; + readonly purchasedQuantity?: number; + readonly remainingQuantity?: number; + readonly totalReservedQuantity?: number; + readonly usedQuantity?: number; + readonly utilizedPercentage?: number; +}; + +// @public +export type ReservationTransaction = ReservationTransactionResource & { + readonly eventDate?: Date; + readonly reservationOrderId?: string; + readonly description?: string; + readonly eventType?: string; + readonly quantity?: number; + readonly amount?: number; + readonly currency?: string; + readonly reservationOrderName?: string; + readonly purchasingEnrollment?: string; + readonly purchasingSubscriptionGuid?: string; + readonly purchasingSubscriptionName?: string; + readonly armSkuName?: string; + readonly term?: string; + readonly region?: string; + readonly accountName?: string; + readonly accountOwnerEmail?: string; + readonly departmentName?: string; + readonly costCenter?: string; + readonly currentEnrollment?: string; + readonly billingFrequency?: string; + readonly billingMonth?: number; + readonly monetaryCommitment?: number; + readonly overage?: number; +}; + +// @public +export interface ReservationTransactionResource { + readonly id?: string; + readonly name?: string; + readonly tags?: string[]; + readonly type?: string; +} + +// @public +export interface ReservationTransactions { + list(billingAccountId: string, options?: ReservationTransactionsListOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountId: string, billingProfileId: string, options?: ReservationTransactionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationTransactionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationTransactionsListByBillingProfileNextResponse = ModernReservationTransactionsListResult; + +// @public +export interface ReservationTransactionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationTransactionsListByBillingProfileResponse = ModernReservationTransactionsListResult; + +// @public +export interface ReservationTransactionsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationTransactionsListNextResponse = ReservationTransactionsListResult; + +// @public +export interface ReservationTransactionsListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ReservationTransactionsListResponse = ReservationTransactionsListResult; + +// @public +export interface ReservationTransactionsListResult { + readonly nextLink?: string; + readonly value?: ReservationTransaction[]; +} + +// @public +export interface Resource { + readonly etag?: string; + readonly id?: string; + readonly name?: string; + readonly tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ResourceAttributes { + readonly location?: string; + readonly sku?: string; +} + +// @public +export type Scope = string; + +// @public +export interface SkuProperty { + readonly name?: string; + readonly value?: string; +} + +// @public +export type Status = string; + +// @public +export interface Tag { + key?: string; + value?: string[]; +} + +// @public +export interface Tags { + get(scope: string, options?: TagsGetOptionalParams): Promise; +} + +// @public +export interface TagsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsGetResponse = TagsResult; + +// @public +export type TagsResult = ProxyResource & { + tags?: Tag[]; + readonly nextLink?: string; + readonly previousLink?: string; +}; + +// @public +export type Term = string; + +// @public +export type ThresholdType = string; + +// @public +export type TimeGrainType = string; + +// @public +export type UsageDetail = Resource & { + kind: UsageDetailsKind; +}; + +// @public +export interface UsageDetails { + list(scope: string, options?: UsageDetailsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type UsageDetailsKind = string; + +// @public +export interface UsageDetailsListNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + metric?: Metrictype; + skiptoken?: string; + top?: number; +} + +// @public +export type UsageDetailsListNextResponse = UsageDetailsListResult; + +// @public +export interface UsageDetailsListOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + metric?: Metrictype; + skiptoken?: string; + top?: number; +} + +// @public +export type UsageDetailsListResponse = UsageDetailsListResult; + +// @public +export interface UsageDetailsListResult { + readonly nextLink?: string; + readonly value?: UsageDetailUnion[]; +} + +// @public (undocumented) +export type UsageDetailUnion = UsageDetail | LegacyUsageDetail | ModernUsageDetail; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/consumption/arm-consumption/rollup.config.js b/sdk/consumption/arm-consumption/rollup.config.js index 9cdb9c96cbb5..9be1955eb7f1 100644 --- a/sdk/consumption/arm-consumption/rollup.config.js +++ b/sdk/consumption/arm-consumption/rollup.config.js @@ -1,31 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -/** - * @type {rollup.RollupFileOptions} - */ -const config = { - input: "./esm/consumptionManagementClient.js", - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-consumption.js", - format: "umd", - name: "Azure.ArmConsumption", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" - }, - banner: `/* +/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()] + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts index d9b9c1705ca0..10eb7bfa3ec8 100644 --- a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts +++ b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts @@ -3,74 +3,100 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; +import * as coreAuth from "@azure/core-auth"; +import { + UsageDetailsImpl, + MarketplacesImpl, + BudgetsImpl, + TagsImpl, + ChargesImpl, + BalancesImpl, + ReservationsSummariesImpl, + ReservationsDetailsImpl, + ReservationRecommendationsImpl, + ReservationRecommendationDetailsImpl, + ReservationTransactionsImpl, + PriceSheetImpl, + OperationsImpl, + AggregatedCostImpl, + EventsOperationsImpl, + LotsOperationsImpl, + CreditsImpl +} from "./operations"; +import { + UsageDetails, + Marketplaces, + Budgets, + Tags, + Charges, + Balances, + ReservationsSummaries, + ReservationsDetails, + ReservationRecommendations, + ReservationRecommendationDetails, + ReservationTransactions, + PriceSheet, + Operations, + AggregatedCost, + EventsOperations, + LotsOperations, + Credits +} from "./operationsInterfaces"; import { ConsumptionManagementClientContext } from "./consumptionManagementClientContext"; +import { ConsumptionManagementClientOptionalParams } from "./models"; -class ConsumptionManagementClient extends ConsumptionManagementClientContext { - // 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; - tenants: operations.Tenants; - +export class ConsumptionManagementClient extends ConsumptionManagementClientContext { /** * Initializes a new instance of the ConsumptionManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Azure Subscription ID. - * @param [options] The parameter options + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: Models.ConsumptionManagementClientOptions + options?: ConsumptionManagementClientOptionalParams ) { super(credentials, subscriptionId, options); - 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.tenants = new operations.Tenants(this); + this.usageDetails = new UsageDetailsImpl(this); + this.marketplaces = new MarketplacesImpl(this); + this.budgets = new BudgetsImpl(this); + this.tags = new TagsImpl(this); + this.charges = new ChargesImpl(this); + this.balances = new BalancesImpl(this); + this.reservationsSummaries = new ReservationsSummariesImpl(this); + this.reservationsDetails = new ReservationsDetailsImpl(this); + this.reservationRecommendations = new ReservationRecommendationsImpl(this); + this.reservationRecommendationDetails = new ReservationRecommendationDetailsImpl( + this + ); + this.reservationTransactions = new ReservationTransactionsImpl(this); + this.priceSheet = new PriceSheetImpl(this); + this.operations = new OperationsImpl(this); + this.aggregatedCost = new AggregatedCostImpl(this); + this.eventsOperations = new EventsOperationsImpl(this); + this.lotsOperations = new LotsOperationsImpl(this); + this.credits = new CreditsImpl(this); } -} -// Operation Specifications - -export { - ConsumptionManagementClient, - ConsumptionManagementClientContext, - Models as ConsumptionManagementModels, - Mappers as ConsumptionManagementMappers -}; -export * from "./operations"; + usageDetails: UsageDetails; + marketplaces: Marketplaces; + budgets: Budgets; + tags: Tags; + charges: Charges; + balances: Balances; + reservationsSummaries: ReservationsSummaries; + reservationsDetails: ReservationsDetails; + reservationRecommendations: ReservationRecommendations; + reservationRecommendationDetails: ReservationRecommendationDetails; + reservationTransactions: ReservationTransactions; + priceSheet: PriceSheet; + operations: Operations; + aggregatedCost: AggregatedCost; + eventsOperations: EventsOperations; + lotsOperations: LotsOperations; + credits: Credits; +} diff --git a/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts b/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts index 072c5c28af97..2bdc0c9c9dc3 100644 --- a/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts +++ b/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts @@ -3,72 +3,68 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { ConsumptionManagementClientOptionalParams } from "./models"; -const packageName = "@azure/arm-consumption"; -const packageVersion = "7.1.0"; - -export class ConsumptionManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - apiVersion?: string; +export class ConsumptionManagementClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; subscriptionId: string; /** - * Initializes a new instance of the ConsumptionManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * Initializes a new instance of the ConsumptionManagementClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Azure Subscription ID. - * @param [options] The parameter options + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: Models.ConsumptionManagementClientOptions + options?: ConsumptionManagementClientOptionalParams ) { - if (credentials == undefined) { - throw new Error("'credentials' cannot be null."); + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); } - if (subscriptionId == undefined) { - throw new Error("'subscriptionId' cannot be null."); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); } + // Initializing default values for options if (!options) { options = {}; } - if (!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } + const defaults: ConsumptionManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; - super(credentials, options); + const packageDetails = `azsdk-js-arm-consumption/9.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; - this.apiVersion = "2018-10-01"; - this.acceptLanguage = "en-US"; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments this.subscriptionId = subscriptionId; - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if ( - options.longRunningOperationRetryTimeout !== null && - options.longRunningOperationRetryTimeout !== undefined - ) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-10-01"; } } diff --git a/sdk/consumption/arm-consumption/src/index.ts b/sdk/consumption/arm-consumption/src/index.ts new file mode 100644 index 000000000000..85be07789c30 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { ConsumptionManagementClient } from "./consumptionManagementClient"; +export { ConsumptionManagementClientContext } from "./consumptionManagementClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts b/sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts deleted file mode 100644 index 70a8fb00f854..000000000000 --- a/sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/balancesMappers.ts b/sdk/consumption/arm-consumption/src/models/balancesMappers.ts deleted file mode 100644 index 70a8fb00f854..000000000000 --- a/sdk/consumption/arm-consumption/src/models/balancesMappers.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/budgetsMappers.ts b/sdk/consumption/arm-consumption/src/models/budgetsMappers.ts deleted file mode 100644 index fb151b3d3890..000000000000 --- a/sdk/consumption/arm-consumption/src/models/budgetsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetsListResult, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/chargesMappers.ts b/sdk/consumption/arm-consumption/src/models/chargesMappers.ts deleted file mode 100644 index fc3a7b3f6d3b..000000000000 --- a/sdk/consumption/arm-consumption/src/models/chargesMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargesListResult, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/forecastsMappers.ts b/sdk/consumption/arm-consumption/src/models/forecastsMappers.ts deleted file mode 100644 index 6ad088786be4..000000000000 --- a/sdk/consumption/arm-consumption/src/models/forecastsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ForecastsListResult, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/index.ts b/sdk/consumption/arm-consumption/src/models/index.ts index 452029932107..3a01d3d767f3 100644 --- a/sdk/consumption/arm-consumption/src/models/index.ts +++ b/sdk/consumption/arm-consumption/src/models/index.ts @@ -6,4129 +6,3522 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +export type UsageDetailUnion = + | UsageDetail + | LegacyUsageDetail + | ModernUsageDetail; +export type ReservationRecommendationUnion = + | ReservationRecommendation + | LegacyReservationRecommendation + | ModernReservationRecommendation; +export type ChargeSummaryUnion = + | ChargeSummary + | LegacyChargeSummary + | ModernChargeSummary; -/** - * The properties of the meter detail. - */ -export interface MeterDetails { - /** - * The name of the meter, within the given meter category - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterName?: string; - /** - * The category of the meter, for example, 'Cloud services', 'Networking', etc.. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterCategory?: string; - /** - * The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterSubCategory?: string; - /** - * The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly unit?: string; - /** - * The location in which the Azure service is available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterLocation?: string; - /** - * The total included quantity associated with the offer. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalIncludedQuantity?: number; - /** - * The pretax listing price. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly pretaxStandardRate?: number; +/** Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing period. */ +export interface UsageDetailsListResult { /** - * The name of the service. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of usage details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly serviceName?: string; + readonly value?: UsageDetailUnion[]; /** - * The service tier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly serviceTier?: string; + readonly nextLink?: string; } -/** - * The Resource model definition. - */ -export interface Resource extends BaseResource { +/** The Resource model definition. */ +export interface Resource { /** - * Resource Id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The full qualified ARM ID of an event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * Resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ID that uniquely identifies an event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** + * The etag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; /** * Resource tags. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tags?: { [propertyName: string]: string }; } /** - * An usage detail resource. + * Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + * + * Some Error responses: + * + * * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + * + * * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. */ -export interface UsageDetail extends Resource { +export interface ErrorResponse { + /** The details of the error. */ + error?: ErrorDetails; +} + +/** The details of the error. */ +export interface ErrorDetails { /** - * The id of the billing period resource that the usage belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodId?: string; + readonly code?: string; /** - * The id of the invoice resource that the usage belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceId?: string; + readonly message?: string; +} + +/** Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing period. */ +export interface MarketplacesListResult { /** - * The start of the date time range covered by the usage detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of marketplaces. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageStart?: Date; + readonly value?: Marketplace[]; /** - * The end of the date time range covered by the usage detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageEnd?: Date; + readonly nextLink?: string; +} + +/** Result of listing budgets. It contains a list of available budgets in the scope provided. */ +export interface BudgetsListResult { /** - * The name of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of budgets. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceName?: string; + readonly value?: Budget[]; /** - * The uri of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceId?: string; + readonly nextLink?: string; +} + +/** The Resource model definition. */ +export interface ProxyResource { /** - * The location of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceLocation?: string; + readonly id?: string; /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly name?: string; /** - * The quantity of usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageQuantity?: number; + 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; +} + +/** The start and end date for a budget. */ +export interface BudgetTimePeriod { + /** The start date for the budget. */ + startDate: Date; + /** The end date for the budget. If not provided, we default this to 10 years from the start date. */ + endDate?: Date; +} + +/** May be used to filter budgets by resource group, resource, or meter. */ +export interface BudgetFilter { + /** The logical "AND" expression. Must have at least 2 items. */ + and?: BudgetFilterProperties[]; + /** The logical "NOT" expression. */ + not?: BudgetFilterProperties; + /** Has comparison expression for a dimension */ + dimensions?: BudgetComparisonExpression; + /** Has comparison expression for a tag */ + tags?: BudgetComparisonExpression; +} + +/** The Dimensions or Tags to filter a budget by. */ +export interface BudgetFilterProperties { + /** Has comparison expression for a dimension */ + dimensions?: BudgetComparisonExpression; + /** Has comparison expression for a tag */ + tags?: BudgetComparisonExpression; +} + +/** The comparison expression to be used in the budgets. */ +export interface BudgetComparisonExpression { + /** The name of the column to use in comparison. */ + name: string; + /** The operator to use for comparison. */ + operator: BudgetOperatorType; + /** Array of values to use for comparison */ + values: string[]; +} + +/** The current amount of cost which is being tracked for a budget. */ +export interface CurrentSpend { /** - * The billable usage quantity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The total amount of cost which is being tracked by the budget. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billableQuantity?: number; + readonly amount?: number; /** - * The amount of cost before tax. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unit of measure for the budget amount. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly pretaxCost?: number; + readonly unit?: string; +} + +/** The notification associated with a budget. */ +export interface Notification { + /** The notification is enabled or not. */ + enabled: boolean; + /** The comparison operator. */ + operator: OperatorType; + /** 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. */ + threshold: number; + /** Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified. */ + contactEmails: string[]; + /** Contact roles to send the budget notification to when the threshold is exceeded. */ + contactRoles?: string[]; + /** Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes. */ + contactGroups?: string[]; + /** The type of threshold */ + thresholdType?: ThresholdType; + /** Language in which the recipient will receive the notification */ + locale?: CultureCode; +} + +/** The forecasted cost which is being tracked for a budget. */ +export interface ForecastSpend { /** - * The estimated usage is subject to change. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the budget contains a forecast alert type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isEstimated?: boolean; + readonly amount?: number; /** - * The meter id (GUID). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unit of measure for the budget amount. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterId?: string; + readonly unit?: string; +} + +/** The tag resource. */ +export interface Tag { + /** Tag key. */ + key?: string; + /** Tag values. */ + value?: string[]; +} + +/** Result of listing charge summary. */ +export interface ChargesListResult { /** - * The details about the meter. By default this is not populated, unless it's specified in - * $expand. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of charge summary + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterDetails?: MeterDetails; + readonly value?: ChargeSummaryUnion[]; +} + +export interface BalancePropertiesNewPurchasesDetailsItem { /** - * Subscription guid. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the name of new purchase. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionGuid?: string; + readonly name?: string; /** - * Subscription name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the value of new purchase. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionName?: string; + readonly value?: number; +} + +export interface BalancePropertiesAdjustmentDetailsItem { /** - * Account name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the name of new adjustment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountName?: string; + readonly name?: string; /** - * Department name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the value of new adjustment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly departmentName?: string; + readonly value?: number; +} + +/** Result of listing reservation summaries. */ +export interface ReservationSummariesListResult { /** - * Product name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation summaries. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly product?: string; + readonly value?: ReservationSummary[]; /** - * Consumed service name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly consumedService?: string; + readonly nextLink?: string; +} + +/** Result of listing reservation details. */ +export interface ReservationDetailsListResult { /** - * The cost center of this department if it is a department and a costcenter exists - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly costCenter?: string; + readonly value?: ReservationDetail[]; /** - * Part Number - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly partNumber?: string; + readonly nextLink?: string; +} + +/** Result of listing reservation recommendations. */ +export interface ReservationRecommendationsListResult { /** - * Resource Guid - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation recommendations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceGuid?: string; + readonly value?: ReservationRecommendationUnion[]; /** - * Offer Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offerId?: string; + readonly nextLink?: string; /** - * Charges billed separately - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the previous page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly chargesBilledSeparately?: boolean; + readonly previousLink?: string; +} + +/** The Resource model definition. */ +export interface ResourceAttributes { /** - * Resource Location - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource location + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly location?: string; /** - * Additional details of this usage item. By default this is not populated, unless it's specified - * in $expand. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource sku + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalProperties?: string; + readonly sku?: string; } -/** - * An marketplace resource. - */ -export interface Marketplace extends Resource { - /** - * The id of the billing period resource that the usage belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly billingPeriodId?: string; +/** Details of the resource. */ +export interface ReservationRecommendationDetailsResourceProperties { /** - * The start of the date time range covered by the usage detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of subscriptions for which the reservation is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageStart?: Date; + readonly appliedScopes?: string[]; /** - * The end of the date time range covered by the usage detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * On demand rate of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageEnd?: Date; + readonly onDemandRate?: number; /** - * The marketplace resource rate. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Azure product ex: Standard_E8s_v3 etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceRate?: number; + readonly product?: string; /** - * The type of offer. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Azure resource region ex:EastUS, WestUS etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offerName?: string; + readonly region?: string; /** - * The name of resource group. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Reservation rate of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceGroup?: string; + readonly reservationRate?: number; /** - * The order number. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The azure resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly orderNumber?: string; + readonly resourceType?: string; +} + +/** Details of the estimated savings. */ +export interface ReservationRecommendationDetailsSavingsProperties { + /** List of calculated savings. */ + calculatedSavings?: ReservationRecommendationDetailsCalculatedSavingsProperties[]; /** - * The name of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Number of days of usage to look back used for computing the recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceName?: string; + readonly lookBackPeriod?: number; /** - * The uri of the resource instance that the usage is about. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Number of recommended units of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceId?: string; + readonly recommendedQuantity?: number; /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Term period of the reservation, ex: P1Y or P3Y. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly reservationOrderTerm?: string; /** - * The quantity of usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Type of savings, ex: instance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly consumedQuantity?: number; + readonly savingsType?: string; /** - * The unit of measure. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Measurement unit ex: hour etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly unitOfMeasure?: string; +} + +/** Details of estimated savings. */ +export interface ReservationRecommendationDetailsCalculatedSavingsProperties { /** - * The amount of cost before tax. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly pretaxCost?: number; - /** - * The estimated usage is subject to change. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly isEstimated?: boolean; - /** - * The meter id (GUID). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The cost without reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterId?: string; + readonly onDemandCost?: number; /** - * Subscription guid. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The difference between total reservation cost and reservation cost. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionGuid?: string; + readonly overageCost?: number; /** - * Subscription name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The quantity for calculated savings. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionName?: string; + readonly quantity?: number; /** - * Account name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The exact cost of the estimated usage using reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountName?: string; + readonly reservationCost?: number; /** - * Department name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The cost of the suggested quantity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly departmentName?: string; + readonly totalReservationCost?: number; + /** The number of reserved units used to calculate savings. Always 1 for virtual machines. */ + reservedUnitCount?: number; /** - * Consumed service name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The amount saved by purchasing the recommended quantity of reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly consumedService?: string; + readonly savings?: number; +} + +/** Details about historical usage data that has been used for computing the recommendation. */ +export interface ReservationRecommendationDetailsUsageProperties { /** - * The cost center of this department if it is a department and a costcenter exists - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The first usage date used for looking back for computing the recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly costCenter?: string; + readonly firstConsumptionDate?: string; /** - * Additional details of this usage item. By default this is not populated, unless it's specified - * in $expand. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The last usage date used for looking back for computing the recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalProperties?: string; + readonly lastConsumptionDate?: string; /** - * The name of publisher. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * What the usage data values represent ex: virtual machine instance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly publisherName?: string; + readonly lookBackUnitType?: string; /** - * The name of plan. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and the lastConsumptionDate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly planName?: string; + readonly usageData?: number[]; /** - * Flag indicating whether this is a recurring charge or not. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The grain of the values represented in the usage data ex: hourly. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isRecurringCharge?: boolean; + readonly usageGrain?: string; } /** - * An tenant detail resource. + * Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + * + * Some Error responses: + * + * * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + * + * * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. */ -export interface Tenant extends Resource { +export interface HighCasedErrorResponse { + /** The details of the error. */ + error?: HighCasedErrorDetails; +} + +/** The details of the error. */ +export interface HighCasedErrorDetails { /** - * The Billing Profile name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileName?: string; + readonly code?: string; /** - * The Billing AccountId. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingAccountId?: string; - /** - * The TenantId. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tenantId?: string; - /** - * The Billing Account Name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly billingAccountName?: string; + readonly message?: string; } -/** - * A Tenant properties Resource - */ -export interface TenantListResult { +/** Result of listing reservation recommendations. */ +export interface ReservationTransactionsListResult { /** - * The list of tenant details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation recommendations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Tenant[]; + readonly value?: ReservationTransaction[]; /** * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nextLink?: string; } -/** - * An interface representing BalancePropertiesNewPurchasesDetailsItem. - */ -export interface BalancePropertiesNewPurchasesDetailsItem { +/** The Resource model definition. */ +export interface ReservationTransactionResource { /** - * the name of new purchase. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly id?: string; /** - * the value of new purchase. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: number; -} - -/** - * An interface representing BalancePropertiesAdjustmentDetailsItem. - */ -export interface BalancePropertiesAdjustmentDetailsItem { + readonly name?: string; /** - * the name of new adjustment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly type?: string; /** - * the value of new adjustment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource tags. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: number; + readonly tags?: string[]; } -/** - * A balance resource. - */ -export interface Balance extends Resource { - /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly currency?: string; - /** - * The beginning balance for the billing period. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly beginningBalance?: number; - /** - * The ending balance for the billing period (for open periods this will be updated daily). - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly endingBalance?: number; - /** - * Total new purchase amount. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly newPurchases?: number; +/** Result of listing reservation recommendations. */ +export interface ModernReservationTransactionsListResult { /** - * Total adjustment amount. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of reservation recommendations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly adjustments?: number; + readonly value?: ModernReservationTransaction[]; /** - * Total Commitment usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly utilized?: number; + readonly nextLink?: string; +} + +/** The properties of the price sheet. */ +export interface PriceSheetProperties { /** - * Overage for Azure services. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The id of the billing period resource that the usage belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly serviceOverage?: number; + readonly billingPeriodId?: string; /** - * Charges Billed separately. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The meter id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly chargesBilledSeparately?: number; + readonly meterId?: string; /** - * serviceOverage + chargesBilledSeparately. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The details about the meter. By default this is not populated, unless it's specified in $expand. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalOverage?: number; + readonly meterDetails?: MeterDetails; /** - * Azure service commitment + total Overage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unit of measure + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalUsage?: number; + readonly unitOfMeasure?: string; /** - * Total charges for Azure Marketplace. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Included quality for an offer + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azureMarketplaceServiceCharges?: number; + readonly includedQuantity?: number; /** - * The billing frequency. Possible values include: 'Month', 'Quarter', 'Year' + * Part Number + * NOTE: This property will not be serialized. It can only be populated by the server. */ - billingFrequency?: BillingFrequency; + readonly partNumber?: string; /** - * Price is hidden or not. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unit Price + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly priceHidden?: boolean; + readonly unitPrice?: number; /** - * List of new purchases. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Currency Code + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly newPurchasesDetails?: BalancePropertiesNewPurchasesDetailsItem[]; + readonly currencyCode?: string; /** - * List of Adjustments (Promo credit, SIE credit etc.). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Offer Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly adjustmentDetails?: BalancePropertiesAdjustmentDetailsItem[]; + readonly offerId?: string; } -/** - * reservation summary resource. - */ -export interface ReservationSummary extends Resource { +/** The properties of the meter detail. */ +export interface MeterDetails { /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the meter, within the given meter category + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservationOrderId?: string; + readonly meterName?: string; /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The category of the meter, for example, 'Cloud services', 'Networking', etc.. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservationId?: string; + readonly meterCategory?: string; /** - * This is the ARM Sku name. It can be used to join with the serviceType field in additional info - * in usage records. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuName?: string; + readonly meterSubCategory?: string; /** - * 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 - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservedHours?: number; + readonly unit?: string; /** - * Data corresponding to the utilization record. If the grain of data is monthly, it will be - * first day of month. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The location in which the Azure service is available. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageDate?: Date; + readonly meterLocation?: string; /** - * Total used hours by the reservation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The total included quantity associated with the offer. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usedHours?: number; + readonly totalIncludedQuantity?: number; /** - * 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 - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The pretax listing price. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly minUtilizationPercentage?: number; + readonly pretaxStandardRate?: number; /** - * This is average utilization for the entire time range. (day or month depending on the grain) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the service. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly avgUtilizationPercentage?: number; + readonly serviceName?: string; /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The service tier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly maxUtilizationPercentage?: number; + readonly serviceTier?: string; } -/** - * reservation detail resource. - */ -export interface ReservationDetail extends Resource { +/** 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 { /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of consumption operations supported by the Microsoft.Consumption resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservationOrderId?: string; + readonly value?: Operation[]; /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * URL to get the next set of operation list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservationId?: string; + readonly nextLink?: string; +} + +/** A Consumption REST API operation. */ +export interface Operation { /** - * This is the ARM Sku name. It can be used to join with the serviceType field in additional info - * in usage records. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Operation Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuName?: string; + readonly id?: string; /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Operation name: {provider}/{resource}/{operation}. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservedHours?: number; + readonly name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; +} + +/** The object that represents the operation. */ +export interface OperationDisplay { /** - * The date on which consumption occurred. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Service provider: Microsoft.Consumption. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageDate?: Date; + readonly provider?: string; /** - * This is the total hours used by the instance. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource on which the operation is performed: UsageDetail, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usedHours?: number; + readonly resource?: string; /** - * This identifier is the name of the resource or the fully qualified Resource ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Operation type: Read, write, delete, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly instanceId?: string; + readonly operation?: string; /** - * This is the total count of instances that are reserved for the reservationId. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Description of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalReservedQuantity?: number; + readonly description?: string; } -/** - * Reservation recommendation resource. - */ -export interface ReservationRecommendation { +/** Result of listing event summary. */ +export interface Events { /** - * Resource Id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of event summary. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly value?: EventSummary[]; /** - * Resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly nextLink?: string; +} + +/** The amount plus currency . */ +export interface Amount { /** - * Resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Amount currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly currency?: string; /** - * Resource tags. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Amount. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly tags?: { [propertyName: string]: string }; + readonly value?: number; +} + +/** The reseller properties. */ +export interface Reseller { /** - * Resource location - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The reseller property ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly location?: string; + readonly resellerId?: string; /** - * Resource sku - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The reseller property description. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sku?: string; + readonly resellerDescription?: string; +} + +/** Result of listing lot summary. */ +export interface Lots { /** - * The number of days of usage to look back for recommendation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of lot summary. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lookBackPeriod?: string; + readonly value?: LotSummary[]; /** - * The meter id (GUID) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterId?: string; + readonly nextLink?: string; +} + +/** Summary of credit balances. */ +export interface CreditBalanceSummary { /** - * RI recommendations in one or three year terms. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Estimated balance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly term?: string; + readonly estimatedBalance?: Amount; /** - * The total amount of cost without reserved instances. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current balance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly costWithNoReservedInstances?: number; + readonly currentBalance?: Amount; /** - * Recommended quality for reserved instances. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Estimated balance in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly recommendedQuantity?: number; + readonly estimatedBalanceInBillingCurrency?: AmountWithExchangeRate; +} + +/** The properties of the meter detail. */ +export interface MeterDetailsResponse { /** - * The total amount of cost with reserved instances. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the meter, within the given meter category + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalCostWithReservedInstances?: number; + readonly meterName?: string; /** - * Total estimated savings with reserved instances. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The category of the meter, for example, 'Cloud services', 'Networking', etc.. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly netSavings?: number; + readonly meterCategory?: string; /** - * The usage date for looking back. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly firstUsageDate?: Date; + readonly meterSubCategory?: string; /** - * Shared or single recommendation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scope?: string; -} - -/** - * The tag resource. - */ -export interface Tag { + readonly unitOfMeasure?: string; /** - * Tag key. + * The service family. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - key?: string; + readonly serviceFamily?: string; } -/** - * The Resource model definition. - */ -export interface ProxyResource extends BaseResource { - /** - * Resource Id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; +/** The Sku property */ +export interface SkuProperty { /** - * Resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of sku property. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * Resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - 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; -} - -/** - * A resource listing all tags. - */ -export interface TagsResult extends ProxyResource { - /** - * A list of Tag. + * The value of sku property. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: Tag[]; + readonly value?: string; } -/** - * The start and end date for a budget. - */ -export interface BudgetTimePeriod { +/** The properties of the price sheet download. */ +export interface DownloadProperties { /** - * The start date for the budget. + * The link (url) to download the pricesheet. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - startDate: Date; + readonly downloadUrl?: string; /** - * The end date for the budget. If not provided, we default this to 10 years from the start date. + * Download link validity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - endDate?: Date; + readonly validTill?: string; } -/** - * May be used to filter budgets by resource group, resource, or meter. - */ -export interface Filters { +/** An usage detail resource. */ +export type UsageDetail = Resource & { + /** Specifies the kind of usage details. */ + kind: UsageDetailsKind; +}; + +/** A marketplace resource. */ +export type Marketplace = Resource & { /** - * The list of filters on resource groups, allowed at subscription level only. + * The id of the billing period resource that the usage belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceGroups?: string[]; + readonly billingPeriodId?: string; /** - * The list of filters on resources. + * The start of the date time range covered by the usage detail. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resources?: string[]; + readonly usageStart?: Date; /** - * The list of filters on meters (GUID), mandatory for budgets of usage category. + * The end of the date time range covered by the usage detail. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - meters?: string[]; + readonly usageEnd?: Date; /** - * The dictionary of filters on tags. + * The marketplace resource rate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string[] }; -} - -/** - * The current amount of cost which is being tracked for a budget. - */ -export interface CurrentSpend { + readonly resourceRate?: number; /** - * The total amount of cost which is being tracked by the budget. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of offer. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly amount?: number; + readonly offerName?: string; /** - * The unit of measure for the budget amount. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of resource group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unit?: string; -} - -/** - * The notification associated with a budget. - */ -export interface Notification { + readonly resourceGroup?: string; /** - * The notification is enabled or not. + * Additional information. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enabled: boolean; + readonly additionalInfo?: string; /** - * The comparison operator. Possible values include: 'EqualTo', 'GreaterThan', - * 'GreaterThanOrEqualTo' + * The order number. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operator: OperatorType; + readonly orderNumber?: string; /** - * 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. + * The name of the resource instance that the usage is about. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - threshold: number; + readonly instanceName?: string; /** - * Email addresses to send the budget notification to when the threshold is exceeded. + * The uri of the resource instance that the usage is about. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactEmails: string[]; + readonly instanceId?: string; /** - * Contact roles to send the budget notification to when the threshold is exceeded. + * The ISO currency in which the meter is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactRoles?: string[]; + readonly currency?: string; /** - * Action groups to send the budget notification to when the threshold is exceeded. + * The quantity of usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactGroups?: string[]; -} - -/** - * A budget resource. - */ -export interface Budget extends ProxyResource { + readonly consumedQuantity?: number; /** - * The category of the budget, whether the budget tracks cost or usage. Possible values include: - * 'Cost', 'Usage' + * The unit of measure. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - category: CategoryType; + readonly unitOfMeasure?: string; /** - * The total amount of cost to track with the budget + * The amount of cost before tax. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - amount: number; + readonly pretaxCost?: number; /** - * The time covered by a budget. Tracking of the amount will be reset based on the time grain. - * Possible values include: 'Monthly', 'Quarterly', 'Annually' + * The estimated usage is subject to change. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timeGrain: TimeGrainType; + readonly isEstimated?: boolean; /** - * 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 - * period. There are no restrictions on the end date. + * The meter id (GUID). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timePeriod: BudgetTimePeriod; + readonly meterId?: string; /** - * May be used to filter budgets by resource group, resource, or meter. + * Subscription guid. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filters?: Filters; + readonly subscriptionGuid?: string; /** - * The current amount of cost which is being tracked for a budget. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Subscription name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currentSpend?: CurrentSpend; + readonly subscriptionName?: string; /** - * Dictionary of notifications associated with the budget. Budget can have up to five - * notifications. + * Account name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - notifications?: { [propertyName: string]: Notification }; -} - -/** - * The properties of the price sheet. - */ -export interface PriceSheetProperties { + readonly accountName?: string; /** - * The id of the billing period resource that the usage belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Department name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodId?: string; + readonly departmentName?: string; /** - * The meter id (GUID) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Consumed service name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterId?: string; + readonly consumedService?: string; /** - * The details about the meter. By default this is not populated, unless it's specified in - * $expand. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The cost center of this department if it is a department and a costcenter exists + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterDetails?: MeterDetails; + readonly costCenter?: string; /** - * Unit of measure - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unitOfMeasure?: string; + readonly additionalProperties?: string; /** - * Included quality for an offer - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of publisher. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly includedQuantity?: number; + readonly publisherName?: string; /** - * Part Number - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of plan. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly partNumber?: string; + readonly planName?: string; /** - * Unit Price - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Flag indicating whether this is a recurring charge or not. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unitPrice?: number; + readonly isRecurringCharge?: boolean; +}; + +/** A balance resource. */ +export type Balance = Resource & { /** - * Currency Code - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ISO currency in which the meter is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currencyCode?: string; + readonly currency?: string; /** - * Offer Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The beginning balance for the billing period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offerId?: string; -} - -/** - * An pricesheet resource. - */ -export interface PriceSheetResult extends Resource { + readonly beginningBalance?: number; /** - * Price sheet - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ending balance for the billing period (for open periods this will be updated daily). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly pricesheets?: PriceSheetProperties[]; + readonly endingBalance?: number; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Total new purchase amount. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * An interface representing ForecastPropertiesConfidenceLevelsItem. - */ -export interface ForecastPropertiesConfidenceLevelsItem { + readonly newPurchases?: number; + /** + * Total adjustment amount. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly adjustments?: number; /** - * The percentage level of the confidence - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Total Commitment usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly percentage?: number; + readonly utilized?: number; /** - * The boundary of the percentage, values could be 'Upper' or 'Lower'. Possible values include: - * 'Upper', 'Lower' + * Overage for Azure services. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - bound?: Bound; + readonly serviceOverage?: number; /** - * The amount of forecast within the percentage level - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Charges Billed separately. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: number; -} - -/** - * A forecast resource. - */ -export interface Forecast extends Resource { + readonly chargesBilledSeparately?: number; /** - * The usage date of the forecast. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * serviceOverage + chargesBilledSeparately. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageDate?: string; + readonly totalOverage?: number; /** - * The granularity of forecast. Possible values include: 'Daily', 'Monthly', 'Yearly' + * Azure service commitment + total Overage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - grain?: Grain; + readonly totalUsage?: number; /** - * The amount of charge - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Total charges for Azure Marketplace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly charge?: number; + readonly azureMarketplaceServiceCharges?: number; + /** The billing frequency. */ + billingFrequency?: BillingFrequency; /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Price is hidden or not. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly priceHidden?: boolean; /** - * The type of the charge. Could be actual or forecast. Possible values include: 'Actual', - * 'Forecast' + * List of new purchases. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - chargeType?: ChargeType; + readonly newPurchasesDetails?: BalancePropertiesNewPurchasesDetailsItem[]; /** - * The details about the forecast confidence levels. This is populated only when chargeType is - * Forecast. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of Adjustments (Promo credit, SIE credit etc.). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly confidenceLevels?: ForecastPropertiesConfidenceLevelsItem[]; -} + readonly adjustmentDetails?: BalancePropertiesAdjustmentDetailsItem[]; +}; -/** - * A management group aggregated cost resource. - */ -export interface ManagementGroupAggregatedCostResult extends Resource { +/** reservation summary resource. */ +export type ReservationSummary = Resource & { /** - * The id of the billing period resource that the aggregated cost belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodId?: string; + readonly reservationOrderId?: string; /** - * The start of the date time range covered by aggregated cost. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageStart?: Date; + readonly reservationId?: string; /** - * The end of the date time range covered by the aggregated cost. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageEnd?: Date; + readonly skuName?: string; /** - * Azure Charges. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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 + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azureCharges?: number; + readonly reservedHours?: number; /** - * Marketplace Charges. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly marketplaceCharges?: number; + readonly usageDate?: Date; /** - * Charges Billed Separately. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Total used hours by the reservation + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly chargesBilledSeparately?: number; + readonly usedHours?: number; /** - * The ISO currency in which the meter is charged, for example, USD. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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 + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly minUtilizationPercentage?: number; /** - * Children of a management group + * This is average utilization for the entire time range. (day or month depending on the grain) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - children?: ManagementGroupAggregatedCostResult[]; + readonly avgUtilizationPercentage?: number; /** - * List of subscription Guids included in the calculation of aggregated cost + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - includedSubscriptions?: string[]; + readonly maxUtilizationPercentage?: number; /** - * List of subscription Guids excluded from the calculation of aggregated cost + * The reservation kind. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - excludedSubscriptions?: string[]; -} - -/** - * A charge summary resource. - */ -export interface ChargeSummary extends Resource { + readonly kind?: string; /** - * The id of the billing period resource that the charge belongs to. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the purchased quantity for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodId?: string; + readonly purchasedQuantity?: number; /** - * Usage start date. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the remaining quantity for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageStart?: string; + readonly remainingQuantity?: number; /** - * Usage end date. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the total count of instances that are reserved for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly usageEnd?: string; + readonly totalReservedQuantity?: number; /** - * Azure Charges. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the used quantity for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azureCharges?: number; + readonly usedQuantity?: number; /** - * Charges Billed separately. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the utilized percentage for the reservation Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly chargesBilledSeparately?: number; + readonly utilizedPercentage?: number; +}; + +/** reservation detail resource. */ +export type ReservationDetail = Resource & { /** - * Marketplace Charges. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly marketplaceCharges?: number; + readonly reservationOrderId?: string; /** - * Currency Code - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The instance Flexibility Ratio. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; -} - -/** - * Result of listing charge summary. - */ -export interface ChargesListResult { + readonly instanceFlexibilityRatio?: string; /** - * The list of charge summary - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The instance Flexibility Group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: ChargeSummary[]; -} - -/** - * The details of the error. - */ -export interface ErrorDetails { + readonly instanceFlexibilityGroup?: string; /** - * Error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly reservationId?: string; /** - * Error message indicating why the operation failed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; -} - -/** - * Error response indicates that the service is not able to process the incoming request. The - * reason is provided in the error message. - */ -export interface ErrorResponse { + readonly skuName?: string; /** - * The details of the error. + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - error?: ErrorDetails; -} - -/** - * The object that represents the operation. - */ -export interface OperationDisplay { + readonly reservedHours?: number; /** - * Service provider: Microsoft.Consumption. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The date on which consumption occurred. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provider?: string; + readonly usageDate?: Date; /** - * Resource on which the operation is performed: UsageDetail, etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the total hours used by the instance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resource?: string; + readonly usedHours?: number; /** - * Operation type: Read, write, delete, etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This identifier is the name of the resource or the fully qualified Resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; -} - -/** - * A Consumption REST API operation. - */ -export interface Operation { + readonly instanceId?: string; /** - * Operation name: {provider}/{resource}/{operation}. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the total count of instances that are reserved for the reservationId. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly totalReservedQuantity?: number; /** - * The object that represents the operation. + * The reservation kind. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; -} + readonly kind?: string; +}; -/** - * The Resource model definition. - */ -export interface ResourceAttributes { +/** A reservation recommendation resource. */ +export type ReservationRecommendation = Resource & + ResourceAttributes & { + /** Specifies the kind of reservation recommendation. */ + kind: ReservationRecommendationKind; + }; + +/** Reservation recommendation details. */ +export type ReservationRecommendationDetailsModel = Resource & { + /** Resource Location. */ + location?: string; + /** Resource sku */ + sku?: string; /** - * Resource location - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * An ISO 4217 currency code identifier for the costs and savings + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly location?: string; + readonly currency?: string; /** - * Resource sku - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource specific properties. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sku?: string; -} - -/** - * Additional parameters for a set of operations. - */ -export interface QueryOptions { + readonly resource?: ReservationRecommendationDetailsResourceProperties; /** - * OData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) + * Resource Group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - apply?: string; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListOptionalParams extends msRest.RequestOptionsBase { + readonly resourceGroup?: string; /** - * 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. + * Savings information for the recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly savings?: ReservationRecommendationDetailsSavingsProperties; /** - * 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 (:). + * Scope of the reservation, ex: Single or Shared. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly scope?: string; /** - * 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. + * Historical usage details used to calculate the estimated savings. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly usage?: ReservationRecommendationDetailsUsageProperties; +}; + +/** An pricesheet resource. */ +export type PriceSheetResult = Resource & { /** - * May be used to limit the number of results to the most recent N usageDetails. + * Price sheet + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly pricesheets?: PriceSheetProperties[]; /** - * Additional parameters for the operation + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} + readonly nextLink?: string; + /** + * Pricesheet download details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly download?: MeterDetails; +}; -/** - * Optional Parameters. - */ -export interface UsageDetailsListByBillingPeriodOptionalParams extends msRest.RequestOptionsBase { +/** A management group aggregated cost resource. */ +export type ManagementGroupAggregatedCostResult = Resource & { /** - * 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. + * The id of the billing period resource that the aggregated cost belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly billingPeriodId?: string; /** - * 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 (:). + * The start of the date time range covered by aggregated cost. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly usageStart?: Date; /** - * 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. + * The end of the date time range covered by the aggregated cost. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly usageEnd?: Date; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Azure Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly azureCharges?: number; /** - * Additional parameters for the operation + * Marketplace Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByBillingAccountOptionalParams extends msRest.RequestOptionsBase { + readonly marketplaceCharges?: number; /** - * 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. + * Charges Billed Separately. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly chargesBilledSeparately?: number; /** - * 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 (:). + * The ISO currency in which the meter is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly currency?: string; + /** Children of a management group */ + children?: ManagementGroupAggregatedCostResult[]; + /** List of subscription Guids included in the calculation of aggregated cost */ + includedSubscriptions?: string[]; + /** List of subscription Guids excluded from the calculation of aggregated cost */ + excludedSubscriptions?: string[]; +}; + +/** A credit summary resource. */ +export type CreditSummary = Resource & { /** - * 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. + * Summary of balances associated with this credit summary. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly balanceSummary?: CreditBalanceSummary; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Pending credit adjustments. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly pendingCreditAdjustments?: Amount; /** - * Additional parameters for the operation + * Expired credit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByBillingAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly expiredCredit?: Amount; /** - * 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. + * Pending eligible charges. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly pendingEligibleCharges?: Amount; /** - * 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 (:). + * The credit currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly creditCurrency?: string; /** - * 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. + * The billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly billingCurrency?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Credit's reseller. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly reseller?: Reseller; /** - * Additional parameters for the operation + * The eTag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} + readonly eTag?: string; +}; -/** - * Optional Parameters. - */ -export interface UsageDetailsListByDepartmentOptionalParams extends msRest.RequestOptionsBase { +/** A budget resource. */ +export type Budget = ProxyResource & { + /** The category of the budget, whether the budget tracks cost or usage. */ + category?: CategoryType; + /** The total amount of cost to track with the budget */ + amount?: number; + /** The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers */ + timeGrain?: TimeGrainType; + /** 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 twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date. */ + timePeriod?: BudgetTimePeriod; + /** May be used to filter budgets by user-specified dimensions and/or tags. */ + filter?: BudgetFilter; /** - * 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. + * The current amount of cost which is being tracked for a budget. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly currentSpend?: CurrentSpend; + /** Dictionary of notifications associated with the budget. Budget can have up to five notifications. */ + notifications?: { [propertyName: string]: Notification }; /** - * 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 (:). + * The forecasted cost which is being tracked for a budget. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly forecastSpend?: ForecastSpend; +}; + +/** A resource listing all tags. */ +export type TagsResult = ProxyResource & { + /** A list of Tag. */ + tags?: Tag[]; /** - * 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. + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly nextLink?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The link (url) to the previous page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly previousLink?: string; +}; + +/** A charge summary resource. */ +export type ChargeSummary = ProxyResource & { + /** Specifies the kind of charge summary. */ + kind: ChargeSummaryKind; +}; + +/** An event summary resource. */ +export type EventSummary = ProxyResource & { /** - * Additional parameters for the operation + * The date of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByDepartmentOptionalParams - extends msRest.RequestOptionsBase { + readonly transactionDate?: Date; /** - * 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. + * The description of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly description?: string; /** - * 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 (:). + * The amount of new credit or commitment for NewCredit or SettleCharges event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly newCredit?: Amount; /** - * 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. + * The amount of balance adjustment. The property is not available for ConsumptionCommitment lots. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly adjustments?: Amount; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The amount of expired credit or commitment for NewCredit or SettleCharges event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly creditExpired?: Amount; /** - * Additional parameters for the operation + * The amount of charges for events of type SettleCharges and PendingEligibleCharges. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly charges?: Amount; /** - * 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. + * The balance after the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly closedBalance?: Amount; + /** Identifies the type of the event. */ + eventType?: EventType; /** - * 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 (:). + * The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly invoiceNumber?: string; /** - * 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. + * The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing account of type MicrosoftCustomerAgreement. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly billingProfileId?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The display name of the billing profile for which the event happened. The property is only available for billing account of type MicrosoftCustomerAgreement. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly billingProfileDisplayName?: string; /** - * Additional parameters for the operation + * The ID that uniquely identifies the lot for which the event happened. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly lotId?: string; /** - * 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. + * Identifies the source of the lot for which the event happened. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly lotSource?: string; /** - * 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 (:). + * Amount of canceled credit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly canceledCredit?: Amount; /** - * 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. + * The credit currency of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly creditCurrency?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The billing currency of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly billingCurrency?: string; /** - * Additional parameters for the operation + * The reseller of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByManagementGroupOptionalParams extends msRest.RequestOptionsBase { + readonly reseller?: Reseller; /** - * 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. + * The amount of expired credit or commitment for NewCredit or SettleCharges event in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly creditExpiredInBillingCurrency?: AmountWithExchangeRate; /** - * 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 (:). + * The amount of new credit or commitment for NewCredit or SettleCharges event in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly newCreditInBillingCurrency?: AmountWithExchangeRate; /** - * 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. + * The amount of balance adjustment in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly adjustmentsInBillingCurrency?: AmountWithExchangeRate; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The amount of charges for events of type SettleCharges and PendingEligibleCharges in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly chargesInBillingCurrency?: AmountWithExchangeRate; /** - * Additional parameters for the operation + * The balance in billing currency after the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} + readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; + /** + * The eTag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eTagPropertiesETag?: string; +}; -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByManagementGroupOptionalParams - extends msRest.RequestOptionsBase { +/** A lot summary resource. */ +export type LotSummary = ProxyResource & { /** - * 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. + * The original amount of a lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly originalAmount?: Amount; /** - * 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 (:). + * The balance as of the last invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly closedBalance?: Amount; /** - * 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. + * The source of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly source?: LotSource; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The date when the lot became effective. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly startDate?: Date; /** - * Additional parameters for the operation + * The expiration date of a lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryOptions?: QueryOptions; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListNextOptionalParams extends msRest.RequestOptionsBase { + readonly expirationDate?: Date; /** - * 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. + * The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly poNumber?: string; /** - * 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 (:). + * The date when the lot was added. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly purchasedDate?: Date; /** - * 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. + * The status of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly status?: Status; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The currency of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByBillingPeriodNextOptionalParams - extends msRest.RequestOptionsBase { + readonly creditCurrency?: string; /** - * 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. + * The billing currency of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly billingCurrency?: string; /** - * 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 (:). + * The original amount of a lot in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly originalAmountInBillingCurrency?: AmountWithExchangeRate; /** - * 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. + * The balance as of the last invoice in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The reseller of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByBillingAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly reseller?: Reseller; /** - * 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. + * The eTag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly eTagPropertiesETag?: string; +}; + +/** Reservation transaction resource. */ +export type ReservationTransaction = ReservationTransactionResource & { /** - * 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 (:). + * The date of the transaction + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly eventDate?: Date; /** - * 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. + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly reservationOrderId?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The description of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByBillingAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly description?: string; /** - * 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. + * The type of the transaction (Purchase, Cancel, etc.) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly eventType?: string; /** - * 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 (:). + * The quantity of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly quantity?: number; /** - * 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. + * The charge of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly amount?: number; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The ISO currency in which the transaction is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByDepartmentNextOptionalParams extends msRest.RequestOptionsBase { + readonly currency?: string; /** - * 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. + * The name of the reservation order. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly reservationOrderName?: string; /** - * 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 (:). + * The purchasing enrollment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly purchasingEnrollment?: string; /** - * 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. + * The subscription guid that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly purchasingSubscriptionGuid?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The subscription name that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByDepartmentNextOptionalParams - extends msRest.RequestOptionsBase { + readonly purchasingSubscriptionName?: string; /** - * 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. + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly armSkuName?: string; /** - * 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 (:). + * This is the term of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly term?: string; /** - * 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. + * The region of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly region?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The name of the account that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListByEnrollmentAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly accountName?: string; /** - * 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. + * The email of the account owner that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly accountOwnerEmail?: string; /** - * 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 (:). + * The department name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly departmentName?: string; /** - * 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. + * The cost center of this department if it is a department and a cost center is provided. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly costCenter?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The current enrollment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByEnrollmentAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly currentEnrollment?: string; /** - * 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. + * The billing frequency, which can be either one-time or recurring. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly billingFrequency?: string; /** - * 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 (:). + * The billing month(yyyyMMdd), on which the event initiated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingMonth?: number; /** - * 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. + * The monetary commitment amount at the enrollment scope. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly monetaryCommitment?: number; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The overage amount at the enrollment scope. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} + readonly overage?: number; +}; -/** - * Optional Parameters. - */ -export interface UsageDetailsListByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { +/** Modern Reservation transaction resource. */ +export type ModernReservationTransaction = ReservationTransactionResource & { /** - * 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. + * The charge of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly amount?: number; /** - * 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 (:). + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly armSkuName?: string; /** - * 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. + * The billing frequency, which can be either one-time or recurring. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly billingFrequency?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Billing profile Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface UsageDetailsListForBillingPeriodByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { + readonly billingProfileId?: string; /** - * 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. + * Billing profile name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly billingProfileName?: string; /** - * 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 (:). + * The ISO currency in which the transaction is charged, for example, USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly currency?: string; /** - * 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. + * The description of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly description?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The date of the transaction + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListOptionalParams extends msRest.RequestOptionsBase { + readonly eventDate?: Date; /** - * 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'. + * The type of the transaction (Purchase, Cancel, etc.) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly eventType?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Invoice Number + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly invoice?: string; /** - * 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. + * Invoice Id as on the invoice where the specific transaction appears. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByBillingPeriodOptionalParams extends msRest.RequestOptionsBase { + readonly invoiceId?: string; /** - * 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'. + * Invoice Section Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly invoiceSectionId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Invoice Section Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly invoiceSectionName?: string; /** - * 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. + * The subscription guid that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByBillingAccountOptionalParams extends msRest.RequestOptionsBase { + readonly purchasingSubscriptionGuid?: string; /** - * 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'. + * The subscription name that makes the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly purchasingSubscriptionName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The quantity of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly quantity?: number; /** - * 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. + * The region of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByBillingAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly region?: string; /** - * 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'. + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly reservationOrderId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The name of the reservation order. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly reservationOrderName?: string; /** - * 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. + * This is the term of the transaction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} + readonly term?: string; +}; -/** - * Optional Parameters. - */ -export interface MarketplacesListByDepartmentOptionalParams extends msRest.RequestOptionsBase { +/** The amount with exchange rate. */ +export type AmountWithExchangeRate = Amount & { /** - * 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'. + * The exchange rate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly exchangeRate?: number; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The exchange rate month. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly exchangeRateMonth?: number; +}; + +/** Legacy usage detail. */ +export type LegacyUsageDetail = UsageDetail & { /** - * 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. + * Billing Account identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByDepartmentOptionalParams - extends msRest.RequestOptionsBase { + readonly billingAccountId?: string; /** - * 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'. + * Billing Account Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingAccountName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The billing period start date. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly billingPeriodStartDate?: Date; /** - * 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. + * The billing period end date. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly billingPeriodEndDate?: Date; /** - * 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'. + * Billing Profile identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingProfileId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Billing Profile Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly billingProfileName?: string; /** - * 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. + * Account Owner Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly accountOwnerId?: string; /** - * 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'. + * Account Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly accountName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Subscription guid. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly subscriptionId?: string; /** - * 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. + * Subscription name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByManagementGroupOptionalParams extends msRest.RequestOptionsBase { + readonly subscriptionName?: string; /** - * 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'. + * Date for the usage record. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly date?: Date; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Product name for the consumed service or purchase. Not available for Marketplace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly product?: string; /** - * 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. + * Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByManagementGroupOptionalParams - extends msRest.RequestOptionsBase { + readonly partNumber?: string; /** - * 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'. + * The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly meterId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The details about the meter. By default this is not populated, unless it's specified in $expand. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly meterDetails?: MeterDetailsResponse; /** - * 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. + * The usage quantity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListNextOptionalParams extends msRest.RequestOptionsBase { + readonly quantity?: number; /** - * 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'. + * Effective Price that's charged for the usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly effectivePrice?: number; /** - * May be used to limit the number of results to the most recent N marketplaces. + * The amount of cost before tax. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly cost?: number; /** - * 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. + * Unit Price is the price applicable to you. (your EA or other contract price). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByBillingPeriodNextOptionalParams - extends msRest.RequestOptionsBase { + readonly unitPrice?: number; /** - * 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'. + * Billing Currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingCurrency?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Resource Location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly resourceLocation?: string; /** - * 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. + * Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByBillingAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly consumedService?: string; /** - * 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'. + * Unique identifier of the Azure Resource Manager usage detail resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly resourceId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Resource Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly resourceName?: string; /** - * 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. + * Service-specific metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByBillingAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly serviceInfo1?: string; /** - * 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'. + * Legacy field with optional service-specific metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly serviceInfo2?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly additionalInfo?: string; /** - * 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. + * Invoice Section Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByDepartmentNextOptionalParams extends msRest.RequestOptionsBase { + readonly invoiceSection?: string; /** - * 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'. + * The cost center of this department if it is a department and a cost center is provided. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly costCenter?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Resource Group Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly resourceGroup?: string; /** - * 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. + * ARM resource id of the reservation. Only applies to records relevant to reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByDepartmentNextOptionalParams - extends msRest.RequestOptionsBase { + readonly reservationId?: string; /** - * 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'. + * User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only applies to records relevant to reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly reservationName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Product Order Id. For reservations this is the Reservation Order ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly productOrderId?: string; /** - * 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. + * Product Order Name. For reservations this is the SKU that was purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByEnrollmentAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly productOrderName?: string; /** - * 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'. + * Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly offerId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Is Azure Credit Eligible. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly isAzureCreditEligible?: boolean; /** - * 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. + * Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByEnrollmentAccountNextOptionalParams - extends msRest.RequestOptionsBase { + readonly term?: string; /** - * 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'. + * Publisher Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly publisherName?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Publisher Type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly publisherType?: string; /** - * 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. + * Plan Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface MarketplacesListByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { + readonly planName?: string; /** - * 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'. + * Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly chargeType?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is used. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly frequency?: string; /** - * 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. + * Retail price for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} + readonly payGPrice?: number; + /** + * Identifier that indicates how the meter is priced. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pricingModel?: PricingModelType; +}; -/** - * Optional Parameters. - */ -export interface MarketplacesListForBillingPeriodByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { +/** Modern usage detail. */ +export type ModernUsageDetail = UsageDetail & { /** - * 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'. + * Billing Account identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly billingAccountId?: string; /** - * May be used to limit the number of results to the most recent N marketplaces. + * Effective Price that's charged for the usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly effectivePrice?: number; /** - * 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. + * Identifier that indicates how the meter is priced + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationsSummariesListByReservationOrderOptionalParams - extends msRest.RequestOptionsBase { + readonly pricingModel?: PricingModelType; /** - * Required only for daily grain. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge' + * Name of the Billing Account. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationsSummariesListByReservationOrderAndReservationOptionalParams - extends msRest.RequestOptionsBase { + readonly billingAccountName?: string; /** - * Required only for daily grain. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge' + * Billing Period Start Date as in the invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationsSummariesListByReservationOrderNextOptionalParams - extends msRest.RequestOptionsBase { + readonly billingPeriodStartDate?: Date; /** - * Required only for daily grain. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge' + * Billing Period End Date as in the invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams - extends msRest.RequestOptionsBase { + readonly billingPeriodEndDate?: Date; /** - * Required only for daily grain. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge' + * Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationRecommendationsListOptionalParams extends msRest.RequestOptionsBase { + readonly billingProfileId?: string; /** - * May be used to filter reservationRecommendations by properties/scope and - * properties/lookBackPeriod. + * Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ReservationRecommendationsListNextOptionalParams - extends msRest.RequestOptionsBase { + readonly billingProfileName?: string; /** - * May be used to filter reservationRecommendations by properties/scope and - * properties/lookBackPeriod. + * Unique Microsoft generated identifier for the Azure Subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface PriceSheetGetOptionalParams extends msRest.RequestOptionsBase { + readonly subscriptionGuid?: string; /** - * May be used to expand the properties/meterDetails within a price sheet. By default, these - * fields are not included when returning price sheet. + * Name of the Azure Subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly subscriptionName?: string; /** - * 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. + * Date for the usage record. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly date?: Date; /** - * May be used to limit the number of results to the top N results. + * Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface PriceSheetGetByBillingPeriodOptionalParams extends msRest.RequestOptionsBase { + readonly product?: string; /** - * May be used to expand the properties/meterDetails within a price sheet. By default, these - * fields are not included when returning price sheet. + * The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; + readonly meterId?: string; /** - * 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. + * Identifies the name of the meter against which consumption is measured. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skiptoken?: string; + readonly meterName?: string; /** - * May be used to limit the number of results to the top N results. + * Identifies the location of the datacenter for certain services that are priced based on datacenter location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface ForecastsListOptionalParams extends msRest.RequestOptionsBase { + readonly meterRegion?: string; /** - * 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'. + * Identifies the top-level service for the usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface AggregatedCostGetByManagementGroupOptionalParams - extends msRest.RequestOptionsBase { + readonly meterCategory?: string; /** - * 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 (:). + * Defines the type or sub-category of Azure service that can affect the rate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ChargesListByEnrollmentAccountOptionalParams extends msRest.RequestOptionsBase { + readonly meterSubCategory?: string; /** - * 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 (:). + * List the service family for the product purchased or charged (Example: Storage ; Compute). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ChargesListForBillingPeriodByEnrollmentAccountOptionalParams - extends msRest.RequestOptionsBase { + readonly serviceFamily?: string; /** - * 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 (:). + * Measure the quantity purchased or consumed.The amount of the meter used during the billing period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ChargesListByDepartmentOptionalParams extends msRest.RequestOptionsBase { + readonly quantity?: number; /** - * 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 (:). + * Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface ChargesListForBillingPeriodByDepartmentOptionalParams - extends msRest.RequestOptionsBase { + readonly unitOfMeasure?: string; /** - * 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 (:). + * Instance Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * An interface representing ConsumptionManagementClientOptions. - */ -export interface ConsumptionManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} - -/** - * @interface - * Result of listing usage details. It contains a list of available usage details in reverse - * chronological order by billing period. - * @extends Array - */ -export interface UsageDetailsListResult extends Array { + readonly instanceName?: string; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Estimated extendedCost or blended cost before tax in USD. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing marketplaces. It contains a list of available marketplaces in reverse - * chronological order by billing period. - * @extends Array - */ -export interface MarketplacesListResult extends Array { + readonly costInUSD?: number; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unit Price is the price applicable to you. (your EA or other contract price). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing reservation summaries. - * @extends Array - */ -export interface ReservationSummariesListResult extends Array { + readonly unitPrice?: number; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The currency defining the billed cost. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing reservation details. - * @extends Array - */ -export interface ReservationDetailsListResult extends Array { + readonly billingCurrencyCode?: string; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Name of the resource location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing reservation recommendations. - * @extends Array - */ -export interface ReservationRecommendationsListResult extends Array { + readonly resourceLocation?: string; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing budgets. It contains a list of available budgets in the scope provided. - * @extends Array - */ -export interface BudgetsListResult extends Array { + readonly consumedService?: string; /** - * The link (url) to the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Service-specific metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * @interface - * Result of listing forecasts. It contains a list of available forecasts. - * @extends Array - */ -export interface ForecastsListResult extends Array {} - -/** - * @interface - * Result of listing consumption operations. It contains a list of operations and a URL link to get - * the next set of results. - * @extends Array - */ -export interface OperationListResult extends Array { + readonly serviceInfo1?: string; /** - * URL to get the next set of operation list results if there are any. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Legacy field with optional service-specific metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** - * Defines values for BillingFrequency. - * Possible values include: 'Month', 'Quarter', 'Year' - * @readonly - * @enum {string} - */ -export type BillingFrequency = "Month" | "Quarter" | "Year"; - -/** - * Defines values for CategoryType. - * Possible values include: 'Cost', 'Usage' - * @readonly - * @enum {string} - */ -export type CategoryType = "Cost" | "Usage"; - -/** - * Defines values for TimeGrainType. - * Possible values include: 'Monthly', 'Quarterly', 'Annually' - * @readonly - * @enum {string} - */ -export type TimeGrainType = "Monthly" | "Quarterly" | "Annually"; - -/** - * Defines values for OperatorType. - * Possible values include: 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo' - * @readonly - * @enum {string} - */ -export type OperatorType = "EqualTo" | "GreaterThan" | "GreaterThanOrEqualTo"; - -/** - * Defines values for Grain. - * Possible values include: 'Daily', 'Monthly', 'Yearly' - * @readonly - * @enum {string} - */ -export type Grain = "Daily" | "Monthly" | "Yearly"; - -/** - * Defines values for ChargeType. - * Possible values include: 'Actual', 'Forecast' - * @readonly - * @enum {string} - */ -export type ChargeType = "Actual" | "Forecast"; - -/** - * Defines values for Bound. - * Possible values include: 'Upper', 'Lower' - * @readonly - * @enum {string} - */ -export type Bound = "Upper" | "Lower"; - -/** - * Defines values for Datagrain. - * Possible values include: 'DailyGrain', 'MonthlyGrain' - * @readonly - * @enum {string} - */ -export type Datagrain = "daily" | "monthly"; - -/** - * Contains response data for the list operation. - */ -export type UsageDetailsListResponse = UsageDetailsListResult & { + readonly serviceInfo2?: string; /** - * The underlying HTTP response. + * Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByBillingPeriod operation. - */ -export type UsageDetailsListByBillingPeriodResponse = UsageDetailsListResult & { + readonly additionalInfo?: string; /** - * The underlying HTTP response. + * Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by partners. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByBillingAccount operation. - */ -export type UsageDetailsListByBillingAccountResponse = UsageDetailsListResult & { + readonly invoiceSectionId?: string; /** - * The underlying HTTP response. + * Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by partners. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByBillingAccount operation. - */ -export type UsageDetailsListForBillingPeriodByBillingAccountResponse = UsageDetailsListResult & { + readonly invoiceSectionName?: string; /** - * The underlying HTTP response. + * The cost center of this department if it is a department and a cost center is provided. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByDepartment operation. - */ -export type UsageDetailsListByDepartmentResponse = UsageDetailsListResult & { + readonly costCenter?: string; /** - * The underlying HTTP response. + * Name of the Azure resource group used for cohesive lifecycle management of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByDepartment operation. - */ -export type UsageDetailsListForBillingPeriodByDepartmentResponse = UsageDetailsListResult & { + readonly resourceGroup?: string; /** - * The underlying HTTP response. + * ARM resource id of the reservation. Only applies to records relevant to reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByEnrollmentAccount operation. - */ -export type UsageDetailsListByEnrollmentAccountResponse = UsageDetailsListResult & { + readonly reservationId?: string; /** - * The underlying HTTP response. + * User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only applies to records relevant to reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByEnrollmentAccount operation. - */ -export type UsageDetailsListForBillingPeriodByEnrollmentAccountResponse = UsageDetailsListResult & { + readonly reservationName?: string; /** - * The underlying HTTP response. + * The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations this is the Reservation Order ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByManagementGroup operation. - */ -export type UsageDetailsListByManagementGroupResponse = UsageDetailsListResult & { + readonly productOrderId?: string; /** - * The underlying HTTP response. + * Product Order Name. For reservations this is the SKU that was purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByManagementGroup operation. - */ -export type UsageDetailsListForBillingPeriodByManagementGroupResponse = UsageDetailsListResult & { + readonly productOrderName?: string; /** - * The underlying HTTP response. + * Determines if the cost is eligible to be paid for using Azure credits. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type UsageDetailsListNextResponse = UsageDetailsListResult & { + readonly isAzureCreditEligible?: boolean; /** - * The underlying HTTP response. + * Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; This is not applicable for Azure consumption. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByBillingPeriodNext operation. - */ -export type UsageDetailsListByBillingPeriodNextResponse = UsageDetailsListResult & { + readonly term?: string; /** - * The underlying HTTP response. + * Name of the publisher of the service including Microsoft or Third Party publishers. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByBillingAccountNext operation. - */ -export type UsageDetailsListByBillingAccountNextResponse = UsageDetailsListResult & { + readonly publisherName?: string; /** - * The underlying HTTP response. + * Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByBillingAccountNext operation. - */ -export type UsageDetailsListForBillingPeriodByBillingAccountNextResponse = UsageDetailsListResult & { + readonly publisherType?: string; /** - * The underlying HTTP response. + * Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByDepartmentNext operation. - */ -export type UsageDetailsListByDepartmentNextResponse = UsageDetailsListResult & { + readonly chargeType?: string; /** - * The underlying HTTP response. + * Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is used. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByDepartmentNext operation. - */ -export type UsageDetailsListForBillingPeriodByDepartmentNextResponse = UsageDetailsListResult & { + readonly frequency?: string; /** - * The underlying HTTP response. + * ExtendedCost or blended cost before tax in billed currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByEnrollmentAccountNext operation. - */ -export type UsageDetailsListByEnrollmentAccountNextResponse = UsageDetailsListResult & { + readonly costInBillingCurrency?: number; /** - * The underlying HTTP response. + * ExtendedCost or blended cost before tax in pricing currency to correlate with prices. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByEnrollmentAccountNext operation. - */ -export type UsageDetailsListForBillingPeriodByEnrollmentAccountNextResponse = UsageDetailsListResult & { + readonly costInPricingCurrency?: number; /** - * The underlying HTTP response. + * Exchange rate used in conversion from pricing currency to billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listByManagementGroupNext operation. - */ -export type UsageDetailsListByManagementGroupNextResponse = UsageDetailsListResult & { + readonly exchangeRate?: string; /** - * The underlying HTTP response. + * Date on which exchange rate used in conversion from pricing currency to billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByManagementGroupNext operation. - */ -export type UsageDetailsListForBillingPeriodByManagementGroupNextResponse = UsageDetailsListResult & { + readonly exchangeRateDate?: Date; /** - * The underlying HTTP response. + * Invoice ID as on the invoice where the specific transaction appears. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageDetailsListResult; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type MarketplacesListResponse = MarketplacesListResult & { + readonly invoiceId?: string; /** - * The underlying HTTP response. + * Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByBillingPeriod operation. - */ -export type MarketplacesListByBillingPeriodResponse = MarketplacesListResult & { + readonly previousInvoiceId?: string; /** - * The underlying HTTP response. + * Pricing Billing Currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByBillingAccount operation. - */ -export type MarketplacesListByBillingAccountResponse = MarketplacesListResult & { + readonly pricingCurrencyCode?: string; /** - * The underlying HTTP response. + * Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId and SkuId in partner center. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByBillingAccount operation. - */ -export type MarketplacesListForBillingPeriodByBillingAccountResponse = MarketplacesListResult & { + readonly productIdentifier?: string; /** - * The underlying HTTP response. + * Resource Location Normalized. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByDepartment operation. - */ -export type MarketplacesListByDepartmentResponse = MarketplacesListResult & { + readonly resourceLocationNormalized?: string; /** - * The underlying HTTP response. + * Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined for the rating period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByDepartment operation. - */ -export type MarketplacesListForBillingPeriodByDepartmentResponse = MarketplacesListResult & { + readonly servicePeriodStartDate?: Date; /** - * The underlying HTTP response. + * End date for the period when the service usage was rated for charges. The prices for Azure services are determined based on the rating period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByEnrollmentAccount operation. - */ -export type MarketplacesListByEnrollmentAccountResponse = MarketplacesListResult & { + readonly servicePeriodEndDate?: Date; /** - * The underlying HTTP response. + * Identifier of the customer's AAD tenant. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByEnrollmentAccount operation. - */ -export type MarketplacesListForBillingPeriodByEnrollmentAccountResponse = MarketplacesListResult & { + readonly customerTenantId?: string; /** - * The underlying HTTP response. + * Name of the customer's AAD tenant. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByManagementGroup operation. - */ -export type MarketplacesListByManagementGroupResponse = MarketplacesListResult & { + readonly customerName?: string; /** - * The underlying HTTP response. + * Identifier for the partner's AAD tenant. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByManagementGroup operation. - */ -export type MarketplacesListForBillingPeriodByManagementGroupResponse = MarketplacesListResult & { + readonly partnerTenantId?: string; /** - * The underlying HTTP response. + * Name of the partner' AAD tenant. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type MarketplacesListNextResponse = MarketplacesListResult & { + readonly partnerName?: string; /** - * The underlying HTTP response. + * MPNId for the reseller associated with the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByBillingPeriodNext operation. - */ -export type MarketplacesListByBillingPeriodNextResponse = MarketplacesListResult & { + readonly resellerMpnId?: string; /** - * The underlying HTTP response. + * Reseller Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByBillingAccountNext operation. - */ -export type MarketplacesListByBillingAccountNextResponse = MarketplacesListResult & { + readonly resellerName?: string; /** - * The underlying HTTP response. + * Publisher Id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByBillingAccountNext operation. - */ -export type MarketplacesListForBillingPeriodByBillingAccountNextResponse = MarketplacesListResult & { + readonly publisherId?: string; /** - * The underlying HTTP response. + * Market Price that's charged for the usage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByDepartmentNext operation. - */ -export type MarketplacesListByDepartmentNextResponse = MarketplacesListResult & { + readonly marketPrice?: number; /** - * The underlying HTTP response. + * Exchange Rate from pricing currency to billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByDepartmentNext operation. - */ -export type MarketplacesListForBillingPeriodByDepartmentNextResponse = MarketplacesListResult & { + readonly exchangeRatePricingToBilling?: number; /** - * The underlying HTTP response. + * The amount of PayG cost before tax in billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByEnrollmentAccountNext operation. - */ -export type MarketplacesListByEnrollmentAccountNextResponse = MarketplacesListResult & { + readonly paygCostInBillingCurrency?: number; /** - * The underlying HTTP response. + * The amount of PayG cost before tax in US Dollar currency. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByEnrollmentAccountNext operation. - */ -export type MarketplacesListForBillingPeriodByEnrollmentAccountNextResponse = MarketplacesListResult & { + readonly paygCostInUSD?: number; /** - * The underlying HTTP response. + * Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listByManagementGroupNext operation. - */ -export type MarketplacesListByManagementGroupNextResponse = MarketplacesListResult & { + readonly partnerEarnedCreditRate?: number; /** - * The underlying HTTP response. + * Flag to indicate if partner earned credit has been applied or not. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the listForBillingPeriodByManagementGroupNext operation. - */ -export type MarketplacesListForBillingPeriodByManagementGroupNextResponse = MarketplacesListResult & { + readonly partnerEarnedCreditApplied?: string; /** - * The underlying HTTP response. + * Retail price for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MarketplacesListResult; - }; -}; - -/** - * Contains response data for the getByBillingAccount operation. - */ -export type BalancesGetByBillingAccountResponse = Balance & { + readonly payGPrice?: number; /** - * The underlying HTTP response. + * Unique identifier for the applicable benefit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Balance; - }; -}; - -/** - * Contains response data for the getForBillingPeriodByBillingAccount operation. - */ -export type BalancesGetForBillingPeriodByBillingAccountResponse = Balance & { + readonly benefitId?: string; /** - * The underlying HTTP response. + * Name of the applicable benefit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Balance; - }; -}; - -/** - * Contains response data for the listByReservationOrder operation. - */ -export type ReservationsSummariesListByReservationOrderResponse = ReservationSummariesListResult & { + readonly benefitName?: string; /** - * The underlying HTTP response. + * Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationSummariesListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderAndReservation operation. - */ -export type ReservationsSummariesListByReservationOrderAndReservationResponse = ReservationSummariesListResult & { + readonly provider?: string; /** - * The underlying HTTP response. + * Name for Cost Allocation Rule. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationSummariesListResult; - }; + readonly costAllocationRuleName?: string; }; -/** - * Contains response data for the listByReservationOrderNext operation. - */ -export type ReservationsSummariesListByReservationOrderNextResponse = ReservationSummariesListResult & { +/** Legacy reservation recommendation. */ +export type LegacyReservationRecommendation = ReservationRecommendation & { /** - * The underlying HTTP response. + * The number of days of usage to look back for recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationSummariesListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderAndReservationNext operation. - */ -export type ReservationsSummariesListByReservationOrderAndReservationNextResponse = ReservationSummariesListResult & { + readonly lookBackPeriod?: string; /** - * The underlying HTTP response. + * The instance Flexibility Ratio. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationSummariesListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrder operation. - */ -export type ReservationsDetailsListByReservationOrderResponse = ReservationDetailsListResult & { + readonly instanceFlexibilityRatio?: number; /** - * The underlying HTTP response. + * The instance Flexibility Group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationDetailsListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderAndReservation operation. - */ -export type ReservationsDetailsListByReservationOrderAndReservationResponse = ReservationDetailsListResult & { + readonly instanceFlexibilityGroup?: string; /** - * The underlying HTTP response. + * The normalized Size. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationDetailsListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderNext operation. - */ -export type ReservationsDetailsListByReservationOrderNextResponse = ReservationDetailsListResult & { + readonly normalizedSize?: string; /** - * The underlying HTTP response. + * The recommended Quantity Normalized. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationDetailsListResult; - }; -}; - -/** - * Contains response data for the listByReservationOrderAndReservationNext operation. - */ -export type ReservationsDetailsListByReservationOrderAndReservationNextResponse = ReservationDetailsListResult & { + readonly recommendedQuantityNormalized?: number; /** - * The underlying HTTP response. + * The meter id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationDetailsListResult; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type ReservationRecommendationsListResponse = ReservationRecommendationsListResult & { + readonly meterId?: string; /** - * The underlying HTTP response. + * The azure resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationRecommendationsListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type ReservationRecommendationsListNextResponse = ReservationRecommendationsListResult & { + readonly resourceType?: string; /** - * The underlying HTTP response. + * RI recommendations in one or three year terms. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReservationRecommendationsListResult; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type BudgetsListResponse = BudgetsListResult & { + readonly term?: string; /** - * The underlying HTTP response. + * The total amount of cost without reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BudgetsListResult; - }; -}; - -/** - * Contains response data for the listByResourceGroupName operation. - */ -export type BudgetsListByResourceGroupNameResponse = BudgetsListResult & { + readonly costWithNoReservedInstances?: number; /** - * The underlying HTTP response. + * Recommended quality for reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BudgetsListResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type BudgetsGetResponse = Budget & { + readonly recommendedQuantity?: number; /** - * The underlying HTTP response. + * The total amount of cost with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Budget; - }; -}; - -/** - * Contains response data for the createOrUpdate operation. - */ -export type BudgetsCreateOrUpdateResponse = Budget & { + readonly totalCostWithReservedInstances?: number; /** - * The underlying HTTP response. + * Total estimated savings with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Budget; - }; -}; - -/** - * Contains response data for the getByResourceGroupName operation. - */ -export type BudgetsGetByResourceGroupNameResponse = Budget & { + readonly netSavings?: number; /** - * The underlying HTTP response. + * The usage date for looking back. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Budget; - }; -}; - -/** - * Contains response data for the createOrUpdateByResourceGroupName operation. - */ -export type BudgetsCreateOrUpdateByResourceGroupNameResponse = Budget & { + readonly firstUsageDate?: Date; /** - * The underlying HTTP response. + * Shared or single recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Budget; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type BudgetsListNextResponse = BudgetsListResult & { + readonly scope?: string; /** - * The underlying HTTP response. + * List of sku properties + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BudgetsListResult; - }; + readonly skuProperties?: SkuProperty[]; }; -/** - * Contains response data for the listByResourceGroupNameNext operation. - */ -export type BudgetsListByResourceGroupNameNextResponse = BudgetsListResult & { +/** Modern reservation recommendation. */ +export type ModernReservationRecommendation = ReservationRecommendation & { /** - * The underlying HTTP response. + * Resource Location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BudgetsListResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type PriceSheetGetResponse = PriceSheetResult & { + readonly locationPropertiesLocation?: string; /** - * The underlying HTTP response. + * The number of days of usage to look back for recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PriceSheetResult; - }; -}; - -/** - * Contains response data for the getByBillingPeriod operation. - */ -export type PriceSheetGetByBillingPeriodResponse = PriceSheetResult & { + readonly lookBackPeriod?: number; /** - * The underlying HTTP response. + * The instance Flexibility Ratio. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PriceSheetResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type TagsGetResponse = TagsResult & { + readonly instanceFlexibilityRatio?: number; /** - * The underlying HTTP response. + * The instance Flexibility Group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: TagsResult; - }; + readonly instanceFlexibilityGroup?: string; + /** + * The normalized Size. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly normalizedSize?: string; + /** + * The recommended Quantity Normalized. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedQuantityNormalized?: number; + /** + * The meter id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly meterId?: string; + /** + * RI recommendations in one or three year terms. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly term?: string; + /** + * The total amount of cost without reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly costWithNoReservedInstances?: Amount; + /** + * Recommended quality for reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedQuantity?: number; + /** + * The total amount of cost with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalCostWithReservedInstances?: Amount; + /** + * Total estimated savings with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly netSavings?: Amount; + /** + * The usage date for looking back. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly firstUsageDate?: Date; + /** + * Shared or single recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scope?: string; + /** + * List of sku properties + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuProperties?: SkuProperty[]; + /** + * This is the ARM Sku name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuName?: string; }; -/** - * Contains response data for the list operation. - */ -export type ForecastsListResponse = ForecastsListResult & { +/** Legacy charge summary. */ +export type LegacyChargeSummary = ChargeSummary & { /** - * The underlying HTTP response. + * The id of the billing period resource that the charge belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ForecastsListResult; - }; + readonly billingPeriodId?: string; + /** + * Usage start date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usageStart?: string; + /** + * Usage end date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usageEnd?: string; + /** + * Azure Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureCharges?: number; + /** + * Charges Billed separately. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly chargesBilledSeparately?: number; + /** + * Marketplace Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly marketplaceCharges?: number; + /** + * Currency Code + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currency?: string; }; -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { +/** Modern charge summary. */ +export type ModernChargeSummary = ChargeSummary & { /** - * The underlying HTTP response. + * The id of the billing period resource that the charge belongs to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; + readonly billingPeriodId?: string; + /** + * Usage start date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usageStart?: string; + /** + * Usage end date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usageEnd?: string; + /** + * Azure Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureCharges?: Amount; + /** + * Charges Billed separately. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly chargesBilledSeparately?: Amount; + /** + * Marketplace Charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly marketplaceCharges?: Amount; + /** + * Billing Account Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingAccountId?: string; + /** + * Billing Profile Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileId?: string; + /** + * Invoice Section Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionId?: string; + /** + * Customer Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerId?: string; + /** + * Is charge Invoiced + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isInvoiced?: boolean; }; +/** Legacy Reservation transaction resource. */ +export type LegacyReservationTransaction = ReservationTransaction & {}; + +/** Known values of {@link Metrictype} that the service accepts. */ +export enum KnownMetrictype { + /** Actual cost data. */ + ActualCostMetricType = "actualcost", + /** Amortized cost data. */ + AmortizedCostMetricType = "amortizedcost", + /** Usage data. */ + UsageMetricType = "usage" +} + /** - * Contains response data for the listNext operation. + * Defines values for Metrictype. \ + * {@link KnownMetrictype} can be used interchangeably with Metrictype, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **actualcost**: Actual cost data. \ + * **amortizedcost**: Amortized cost data. \ + * **usage**: Usage data. */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type Metrictype = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Known values of {@link UsageDetailsKind} that the service accepts. */ +export enum KnownUsageDetailsKind { + Legacy = "legacy", + Modern = "modern" +} /** - * Contains response data for the getByManagementGroup operation. + * Defines values for UsageDetailsKind. \ + * {@link KnownUsageDetailsKind} can be used interchangeably with UsageDetailsKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **legacy** \ + * **modern** */ -export type AggregatedCostGetByManagementGroupResponse = ManagementGroupAggregatedCostResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type UsageDetailsKind = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagementGroupAggregatedCostResult; - }; -}; +/** Known values of {@link CategoryType} that the service accepts. */ +export enum KnownCategoryType { + Cost = "Cost" +} /** - * Contains response data for the getForBillingPeriodByManagementGroup operation. + * Defines values for CategoryType. \ + * {@link KnownCategoryType} can be used interchangeably with CategoryType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Cost** */ -export type AggregatedCostGetForBillingPeriodByManagementGroupResponse = ManagementGroupAggregatedCostResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type CategoryType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagementGroupAggregatedCostResult; - }; -}; +/** Known values of {@link TimeGrainType} that the service accepts. */ +export enum KnownTimeGrainType { + Monthly = "Monthly", + Quarterly = "Quarterly", + Annually = "Annually", + BillingMonth = "BillingMonth", + BillingQuarter = "BillingQuarter", + BillingAnnual = "BillingAnnual" +} /** - * Contains response data for the listByEnrollmentAccount operation. + * Defines values for TimeGrainType. \ + * {@link KnownTimeGrainType} can be used interchangeably with TimeGrainType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Monthly** \ + * **Quarterly** \ + * **Annually** \ + * **BillingMonth** \ + * **BillingQuarter** \ + * **BillingAnnual** */ -export type ChargesListByEnrollmentAccountResponse = ChargesListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type TimeGrainType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChargesListResult; - }; -}; +/** Known values of {@link BudgetOperatorType} that the service accepts. */ +export enum KnownBudgetOperatorType { + In = "In" +} + +/** + * Defines values for BudgetOperatorType. \ + * {@link KnownBudgetOperatorType} can be used interchangeably with BudgetOperatorType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **In** + */ +export type BudgetOperatorType = string; + +/** Known values of {@link OperatorType} that the service accepts. */ +export enum KnownOperatorType { + EqualTo = "EqualTo", + GreaterThan = "GreaterThan", + GreaterThanOrEqualTo = "GreaterThanOrEqualTo" +} + +/** + * Defines values for OperatorType. \ + * {@link KnownOperatorType} can be used interchangeably with OperatorType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EqualTo** \ + * **GreaterThan** \ + * **GreaterThanOrEqualTo** + */ +export type OperatorType = string; + +/** Known values of {@link ThresholdType} that the service accepts. */ +export enum KnownThresholdType { + Actual = "Actual", + Forecasted = "Forecasted" +} + +/** + * Defines values for ThresholdType. \ + * {@link KnownThresholdType} can be used interchangeably with ThresholdType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Actual** \ + * **Forecasted** + */ +export type ThresholdType = string; + +/** Known values of {@link CultureCode} that the service accepts. */ +export enum KnownCultureCode { + EnUs = "en-us", + JaJp = "ja-jp", + ZhCn = "zh-cn", + DeDe = "de-de", + EsEs = "es-es", + FrFr = "fr-fr", + ItIt = "it-it", + KoKr = "ko-kr", + PtBr = "pt-br", + RuRu = "ru-ru", + ZhTw = "zh-tw", + CsCz = "cs-cz", + PlPl = "pl-pl", + TrTr = "tr-tr", + DaDk = "da-dk", + EnGb = "en-gb", + HuHu = "hu-hu", + NbNo = "nb-no", + NlNl = "nl-nl", + PtPt = "pt-pt", + SvSe = "sv-se" +} + +/** + * Defines values for CultureCode. \ + * {@link KnownCultureCode} can be used interchangeably with CultureCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **en-us** \ + * **ja-jp** \ + * **zh-cn** \ + * **de-de** \ + * **es-es** \ + * **fr-fr** \ + * **it-it** \ + * **ko-kr** \ + * **pt-br** \ + * **ru-ru** \ + * **zh-tw** \ + * **cs-cz** \ + * **pl-pl** \ + * **tr-tr** \ + * **da-dk** \ + * **en-gb** \ + * **hu-hu** \ + * **nb-no** \ + * **nl-nl** \ + * **pt-pt** \ + * **sv-se** + */ +export type CultureCode = string; + +/** Known values of {@link ChargeSummaryKind} that the service accepts. */ +export enum KnownChargeSummaryKind { + Legacy = "legacy", + Modern = "modern" +} + +/** + * Defines values for ChargeSummaryKind. \ + * {@link KnownChargeSummaryKind} can be used interchangeably with ChargeSummaryKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **legacy** \ + * **modern** + */ +export type ChargeSummaryKind = string; + +/** Known values of {@link BillingFrequency} that the service accepts. */ +export enum KnownBillingFrequency { + Month = "Month", + Quarter = "Quarter", + Year = "Year" +} + +/** + * Defines values for BillingFrequency. \ + * {@link KnownBillingFrequency} can be used interchangeably with BillingFrequency, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Month** \ + * **Quarter** \ + * **Year** + */ +export type BillingFrequency = string; + +/** Known values of {@link Datagrain} that the service accepts. */ +export enum KnownDatagrain { + /** Daily grain of data */ + DailyGrain = "daily", + /** Monthly grain of data */ + MonthlyGrain = "monthly" +} + +/** + * Defines values for Datagrain. \ + * {@link KnownDatagrain} can be used interchangeably with Datagrain, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **daily**: Daily grain of data \ + * **monthly**: Monthly grain of data + */ +export type Datagrain = string; + +/** Known values of {@link ReservationRecommendationKind} that the service accepts. */ +export enum KnownReservationRecommendationKind { + Legacy = "legacy", + Modern = "modern" +} + +/** + * Defines values for ReservationRecommendationKind. \ + * {@link KnownReservationRecommendationKind} can be used interchangeably with ReservationRecommendationKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **legacy** \ + * **modern** + */ +export type ReservationRecommendationKind = string; + +/** Known values of {@link Term} that the service accepts. */ +export enum KnownTerm { + /** 1 year reservation term */ + P1Y = "P1Y", + /** 3 year reservation term */ + P3Y = "P3Y" +} + +/** + * Defines values for Term. \ + * {@link KnownTerm} can be used interchangeably with Term, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **P1Y**: 1 year reservation term \ + * **P3Y**: 3 year reservation term + */ +export type Term = string; + +/** Known values of {@link LookBackPeriod} that the service accepts. */ +export enum KnownLookBackPeriod { + /** Use 7 days of data for recommendations */ + Last07Days = "Last7Days", + /** Use 30 days of data for recommendations */ + Last30Days = "Last30Days", + /** Use 60 days of data for recommendations */ + Last60Days = "Last60Days" +} /** - * Contains response data for the listForBillingPeriodByEnrollmentAccount operation. + * Defines values for LookBackPeriod. \ + * {@link KnownLookBackPeriod} can be used interchangeably with LookBackPeriod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Last7Days**: Use 7 days of data for recommendations \ + * **Last30Days**: Use 30 days of data for recommendations \ + * **Last60Days**: Use 60 days of data for recommendations */ -export type ChargesListForBillingPeriodByEnrollmentAccountResponse = ChargeSummary & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type LookBackPeriod = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChargeSummary; - }; -}; +/** Known values of {@link EventType} that the service accepts. */ +export enum KnownEventType { + SettledCharges = "SettledCharges", + PendingCharges = "PendingCharges", + PendingAdjustments = "PendingAdjustments", + PendingNewCredit = "PendingNewCredit", + PendingExpiredCredit = "PendingExpiredCredit", + UnKnown = "UnKnown", + NewCredit = "NewCredit" +} /** - * Contains response data for the listByDepartment operation. + * Defines values for EventType. \ + * {@link KnownEventType} can be used interchangeably with EventType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SettledCharges** \ + * **PendingCharges** \ + * **PendingAdjustments** \ + * **PendingNewCredit** \ + * **PendingExpiredCredit** \ + * **UnKnown** \ + * **NewCredit** */ -export type ChargesListByDepartmentResponse = ChargesListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type EventType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChargesListResult; - }; -}; +/** Known values of {@link LotSource} that the service accepts. */ +export enum KnownLotSource { + PurchasedCredit = "PurchasedCredit", + PromotionalCredit = "PromotionalCredit", + ConsumptionCommitment = "ConsumptionCommitment" +} /** - * Contains response data for the listForBillingPeriodByDepartment operation. + * Defines values for LotSource. \ + * {@link KnownLotSource} can be used interchangeably with LotSource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PurchasedCredit** \ + * **PromotionalCredit** \ + * **ConsumptionCommitment** */ -export type ChargesListForBillingPeriodByDepartmentResponse = ChargeSummary & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type LotSource = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChargeSummary; - }; -}; +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + None = "None", + Active = "Active", + Inactive = "Inactive", + Expired = "Expired", + Complete = "Complete", + Canceled = "Canceled" +} + +/** + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Active** \ + * **Inactive** \ + * **Expired** \ + * **Complete** \ + * **Canceled** + */ +export type Status = string; + +/** Known values of {@link PricingModelType} that the service accepts. */ +export enum KnownPricingModelType { + OnDemand = "On Demand", + Reservation = "Reservation", + Spot = "Spot" +} /** - * Contains response data for the get operation. + * Defines values for PricingModelType. \ + * {@link KnownPricingModelType} can be used interchangeably with PricingModelType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **On Demand** \ + * **Reservation** \ + * **Spot** */ -export type TenantsGetResponse = TenantListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type PricingModelType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TenantListResult; - }; -}; +/** Known values of {@link Scope} that the service accepts. */ +export enum KnownScope { + Single = "Single", + Shared = "Shared" +} + +/** + * Defines values for Scope. \ + * {@link KnownScope} can be used interchangeably with Scope, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Single** \ + * **Shared** + */ +export type Scope = string; + +/** Optional parameters. */ +export interface UsageDetailsListOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. */ + expand?: string; + /** May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType 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 (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type */ + filter?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the most recent N usageDetails. */ + top?: number; + /** Allows to select different type of cost/usage records. */ + metric?: Metrictype; +} + +/** Contains response data for the list operation. */ +export type UsageDetailsListResponse = UsageDetailsListResult; + +/** Optional parameters. */ +export interface UsageDetailsListNextOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. */ + expand?: string; + /** May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType 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 (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type */ + filter?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the most recent N usageDetails. */ + top?: number; + /** Allows to select different type of cost/usage records. */ + metric?: Metrictype; +} + +/** Contains response data for the listNext operation. */ +export type UsageDetailsListNextResponse = UsageDetailsListResult; + +/** Optional parameters. */ +export interface MarketplacesListOptionalParams + extends coreClient.OperationOptions { + /** 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'. */ + filter?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the most recent N marketplaces. */ + top?: number; +} + +/** Contains response data for the list operation. */ +export type MarketplacesListResponse = MarketplacesListResult; + +/** Optional parameters. */ +export interface MarketplacesListNextOptionalParams + extends coreClient.OperationOptions { + /** 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'. */ + filter?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the most recent N marketplaces. */ + top?: number; +} + +/** Contains response data for the listNext operation. */ +export type MarketplacesListNextResponse = MarketplacesListResult; + +/** Optional parameters. */ +export interface BudgetsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type BudgetsListResponse = BudgetsListResult; + +/** Optional parameters. */ +export interface BudgetsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BudgetsGetResponse = Budget; + +/** Optional parameters. */ +export interface BudgetsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type BudgetsCreateOrUpdateResponse = Budget; + +/** Optional parameters. */ +export interface BudgetsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface BudgetsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type BudgetsListNextResponse = BudgetsListResult; + +/** Optional parameters. */ +export interface TagsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TagsGetResponse = TagsResult; + +/** Optional parameters. */ +export interface ChargesListOptionalParams extends coreClient.OperationOptions { + /** 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 (:). */ + filter?: string; + /** Start date */ + startDate?: string; + /** End date */ + endDate?: string; + /** May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. */ + apply?: string; +} + +/** Contains response data for the list operation. */ +export type ChargesListResponse = ChargesListResult; + +/** Optional parameters. */ +export interface BalancesGetByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingAccount operation. */ +export type BalancesGetByBillingAccountResponse = Balance; + +/** Optional parameters. */ +export interface BalancesGetForBillingPeriodByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getForBillingPeriodByBillingAccount operation. */ +export type BalancesGetForBillingPeriodByBillingAccountResponse = Balance; + +/** Optional parameters. */ +export interface ReservationsSummariesListByReservationOrderOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByReservationOrder operation. */ +export type ReservationsSummariesListByReservationOrderResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListByReservationOrderAndReservationOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByReservationOrderAndReservation operation. */ +export type ReservationsSummariesListByReservationOrderAndReservationResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile */ + filter?: string; + /** Start date. Only applicable when querying with billing profile */ + startDate?: string; + /** End date. Only applicable when querying with billing profile */ + endDate?: string; + /** Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation */ + reservationId?: string; + /** Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order */ + reservationOrderId?: string; +} + +/** Contains response data for the list operation. */ +export type ReservationsSummariesListResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListByReservationOrderNextOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByReservationOrderNext operation. */ +export type ReservationsSummariesListByReservationOrderNextResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByReservationOrderAndReservationNext operation. */ +export type ReservationsSummariesListByReservationOrderAndReservationNextResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsSummariesListNextOptionalParams + extends coreClient.OperationOptions { + /** Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile */ + filter?: string; + /** Start date. Only applicable when querying with billing profile */ + startDate?: string; + /** End date. Only applicable when querying with billing profile */ + endDate?: string; + /** Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation */ + reservationId?: string; + /** Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order */ + reservationOrderId?: string; +} + +/** Contains response data for the listNext operation. */ +export type ReservationsSummariesListNextResponse = ReservationSummariesListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListByReservationOrderOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByReservationOrder operation. */ +export type ReservationsDetailsListByReservationOrderResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListByReservationOrderAndReservationOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByReservationOrderAndReservation operation. */ +export type ReservationsDetailsListByReservationOrderAndReservationResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile */ + filter?: string; + /** Start date. Only applicable when querying with billing profile */ + startDate?: string; + /** End date. Only applicable when querying with billing profile */ + endDate?: string; + /** Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation */ + reservationId?: string; + /** Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order */ + reservationOrderId?: string; +} + +/** Contains response data for the list operation. */ +export type ReservationsDetailsListResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListByReservationOrderNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByReservationOrderNext operation. */ +export type ReservationsDetailsListByReservationOrderNextResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListByReservationOrderAndReservationNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByReservationOrderAndReservationNext operation. */ +export type ReservationsDetailsListByReservationOrderAndReservationNextResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationsDetailsListNextOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile */ + filter?: string; + /** Start date. Only applicable when querying with billing profile */ + startDate?: string; + /** End date. Only applicable when querying with billing profile */ + endDate?: string; + /** Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation */ + reservationId?: string; + /** Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order */ + reservationOrderId?: string; +} + +/** Contains response data for the listNext operation. */ +export type ReservationsDetailsListNextResponse = ReservationDetailsListResult; + +/** Optional parameters. */ +export interface ReservationRecommendationsListOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type ReservationRecommendationsListResponse = ReservationRecommendationsListResult; + +/** Optional parameters. */ +export interface ReservationRecommendationsListNextOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. */ + filter?: string; +} + +/** Contains response data for the listNext operation. */ +export type ReservationRecommendationsListNextResponse = ReservationRecommendationsListResult; + +/** Optional parameters. */ +export interface ReservationRecommendationDetailsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ReservationRecommendationDetailsGetResponse = ReservationRecommendationDetailsModel; + +/** Optional parameters. */ +export interface ReservationTransactionsListOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type ReservationTransactionsListResponse = ReservationTransactionsListResult; + +/** Optional parameters. */ +export interface ReservationTransactionsListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByBillingProfile operation. */ +export type ReservationTransactionsListByBillingProfileResponse = ModernReservationTransactionsListResult; + +/** Optional parameters. */ +export interface ReservationTransactionsListNextOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listNext operation. */ +export type ReservationTransactionsListNextResponse = ReservationTransactionsListResult; + +/** Optional parameters. */ +export interface ReservationTransactionsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions { + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + filter?: string; +} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type ReservationTransactionsListByBillingProfileNextResponse = ModernReservationTransactionsListResult; + +/** Optional parameters. */ +export interface PriceSheetGetOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. */ + expand?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the top N results. */ + top?: number; +} + +/** Contains response data for the get operation. */ +export type PriceSheetGetResponse = PriceSheetResult; + +/** Optional parameters. */ +export interface PriceSheetGetByBillingPeriodOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. */ + expand?: string; + /** 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. */ + skiptoken?: string; + /** May be used to limit the number of results to the top N results. */ + top?: number; +} + +/** Contains response data for the getByBillingPeriod operation. */ +export type PriceSheetGetByBillingPeriodResponse = PriceSheetResult; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface AggregatedCostGetByManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** 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 (:). */ + filter?: string; +} + +/** Contains response data for the getByManagementGroup operation. */ +export type AggregatedCostGetByManagementGroupResponse = ManagementGroupAggregatedCostResult; + +/** Optional parameters. */ +export interface AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getForBillingPeriodByManagementGroup operation. */ +export type AggregatedCostGetForBillingPeriodByManagementGroupResponse = ManagementGroupAggregatedCostResult; + +/** Optional parameters. */ +export interface EventsListByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfile operation. */ +export type EventsListByBillingProfileResponse = Events; + +/** Optional parameters. */ +export interface EventsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the events by lotId, lotSource etc. 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 (:). */ + filter?: string; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type EventsListByBillingAccountResponse = Events; + +/** Optional parameters. */ +export interface EventsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type EventsListByBillingProfileNextResponse = Events; + +/** Optional parameters. */ +export interface EventsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the events by lotId, lotSource etc. 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 (:). */ + filter?: string; +} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type EventsListByBillingAccountNextResponse = Events; + +/** Optional parameters. */ +export interface LotsListByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfile operation. */ +export type LotsListByBillingProfileResponse = Lots; + +/** Optional parameters. */ +export interface LotsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the lots by Status, Source etc. 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 (:). */ + filter?: string; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type LotsListByBillingAccountResponse = Lots; + +/** Optional parameters. */ +export interface LotsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type LotsListByBillingProfileNextResponse = Lots; + +/** Optional parameters. */ +export interface LotsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the lots by Status, Source etc. 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 (:). */ + filter?: string; +} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type LotsListByBillingAccountNextResponse = Lots; + +/** Optional parameters. */ +export interface CreditsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CreditsGetResponse = CreditSummary; + +/** Optional parameters. */ +export interface ConsumptionManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/consumption/arm-consumption/src/models/mappers.ts b/sdk/consumption/arm-consumption/src/models/mappers.ts index 517f8a782f58..206c50f3893a 100644 --- a/sdk/consumption/arm-consumption/src/models/mappers.ts +++ b/sdk/consumption/arm-consumption/src/models/mappers.ts @@ -6,321 +6,3040 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const MeterDetails: msRest.CompositeMapper = { - serializedName: "MeterDetails", +export const UsageDetailsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MeterDetails", + className: "UsageDetailsListResult", modelProperties: { - meterName: { + value: { + serializedName: "value", readOnly: true, - serializedName: "meterName", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UsageDetail" + } + } } }, - meterCategory: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "meterCategory", type: { name: "String" } - }, - meterSubCategory: { + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "meterSubCategory", type: { name: "String" } }, - unit: { + name: { + serializedName: "name", readOnly: true, - serializedName: "unit", type: { name: "String" } }, - meterLocation: { + type: { + serializedName: "type", readOnly: true, - serializedName: "meterLocation", type: { name: "String" } }, - totalIncludedQuantity: { - readOnly: true, - serializedName: "totalIncludedQuantity", - type: { - name: "Number" - } - }, - pretaxStandardRate: { - readOnly: true, - serializedName: "pretaxStandardRate", - type: { - name: "Number" - } - }, - serviceName: { + etag: { + serializedName: "etag", readOnly: true, - serializedName: "serviceName", type: { name: "String" } }, - serviceTier: { + tags: { + serializedName: "tags", readOnly: true, - serializedName: "serviceTier", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ErrorResponse", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorDetails" } - }, - name: { + } + } + } +}; + +export const ErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetails", + modelProperties: { + code: { + serializedName: "code", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + message: { + serializedName: "message", readOnly: true, - serializedName: "type", type: { name: "String" } - }, - tags: { - readOnly: true, - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const UsageDetail: msRest.CompositeMapper = { - serializedName: "UsageDetail", +export const MarketplacesListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UsageDetail", + className: "MarketplacesListResult", modelProperties: { - ...Resource.type.modelProperties, - billingPeriodId: { + value: { + serializedName: "value", readOnly: true, - serializedName: "properties.billingPeriodId", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Marketplace" + } + } } }, - invoiceId: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "properties.invoiceId", type: { name: "String" } - }, - usageStart: { + } + } + } +}; + +export const BudgetsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetsListResult", + modelProperties: { + value: { + serializedName: "value", readOnly: true, - serializedName: "properties.usageStart", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Budget" + } + } } }, - usageEnd: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "properties.usageEnd", type: { - name: "DateTime" + name: "String" } - }, - instanceName: { + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "properties.instanceName", type: { name: "String" } }, - instanceId: { + name: { + serializedName: "name", readOnly: true, - serializedName: "properties.instanceId", type: { name: "String" } }, - instanceLocation: { + type: { + serializedName: "type", readOnly: true, - serializedName: "properties.instanceLocation", type: { name: "String" } }, - currency: { - readOnly: true, - serializedName: "properties.currency", + eTag: { + serializedName: "eTag", type: { name: "String" } - }, - usageQuantity: { - readOnly: true, - serializedName: "properties.usageQuantity", + } + } + } +}; + +export const BudgetTimePeriod: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetTimePeriod", + modelProperties: { + startDate: { + serializedName: "startDate", + required: true, type: { - name: "Number" + name: "DateTime" } }, - billableQuantity: { - readOnly: true, - serializedName: "properties.billableQuantity", + endDate: { + serializedName: "endDate", type: { - name: "Number" + name: "DateTime" } - }, - pretaxCost: { - readOnly: true, - serializedName: "properties.pretaxCost", + } + } + } +}; + +export const BudgetFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetFilter", + modelProperties: { + and: { + serializedName: "and", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BudgetFilterProperties" + } + } } }, - isEstimated: { - readOnly: true, - serializedName: "properties.isEstimated", + not: { + serializedName: "not", type: { - name: "Boolean" + name: "Composite", + className: "BudgetFilterProperties" } }, - meterId: { - readOnly: true, - serializedName: "properties.meterId", + dimensions: { + serializedName: "dimensions", type: { - name: "Uuid" + name: "Composite", + className: "BudgetComparisonExpression" } }, - meterDetails: { - readOnly: true, - serializedName: "properties.meterDetails", + tags: { + serializedName: "tags", type: { name: "Composite", - className: "MeterDetails" + className: "BudgetComparisonExpression" } - }, - subscriptionGuid: { - readOnly: true, - serializedName: "properties.subscriptionGuid", + } + } + } +}; + +export const BudgetFilterProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetFilterProperties", + modelProperties: { + dimensions: { + serializedName: "dimensions", type: { - name: "Uuid" + name: "Composite", + className: "BudgetComparisonExpression" } }, - subscriptionName: { - readOnly: true, - serializedName: "properties.subscriptionName", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Composite", + className: "BudgetComparisonExpression" } - }, - accountName: { - readOnly: true, - serializedName: "properties.accountName", + } + } + } +}; + +export const BudgetComparisonExpression: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BudgetComparisonExpression", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + operator: { + serializedName: "operator", + required: true, + type: { + name: "String" + } + }, + values: { + serializedName: "values", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CurrentSpend: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CurrentSpend", + modelProperties: { + amount: { + serializedName: "amount", + readOnly: true, + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Notification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Notification", + modelProperties: { + enabled: { + serializedName: "enabled", + required: true, + type: { + name: "Boolean" + } + }, + operator: { + serializedName: "operator", + required: true, + type: { + name: "String" + } + }, + threshold: { + serializedName: "threshold", + required: true, + type: { + name: "Number" + } + }, + contactEmails: { + constraints: { + MaxItems: 50 + }, + serializedName: "contactEmails", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + contactRoles: { + serializedName: "contactRoles", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + contactGroups: { + constraints: { + MaxItems: 50 + }, + serializedName: "contactGroups", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + thresholdType: { + defaultValue: "Actual", + serializedName: "thresholdType", + type: { + name: "String" + } + }, + locale: { + serializedName: "locale", + type: { + name: "String" + } + } + } + } +}; + +export const ForecastSpend: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ForecastSpend", + modelProperties: { + amount: { + serializedName: "amount", + readOnly: true, + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Tag: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Tag", + modelProperties: { + key: { + serializedName: "key", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ChargesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChargesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ChargeSummary" + } + } + } + } + } + } +}; + +export const BalancePropertiesNewPurchasesDetailsItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BalancePropertiesNewPurchasesDetailsItem", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const BalancePropertiesAdjustmentDetailsItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BalancePropertiesAdjustmentDetailsItem", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ReservationSummariesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationSummariesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationSummary" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationDetailsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationDetailsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationDetail" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationRecommendation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + }, + previousLink: { + serializedName: "previousLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResourceAttributes: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceAttributes", + modelProperties: { + location: { + serializedName: "location", + readOnly: true, + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationDetailsResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsResourceProperties", + modelProperties: { + appliedScopes: { + serializedName: "appliedScopes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + onDemandRate: { + serializedName: "onDemandRate", + readOnly: true, + type: { + name: "Number" + } + }, + product: { + serializedName: "product", + readOnly: true, + type: { + name: "String" + } + }, + region: { + serializedName: "region", + readOnly: true, + type: { + name: "String" + } + }, + reservationRate: { + serializedName: "reservationRate", + readOnly: true, + type: { + name: "Number" + } + }, + resourceType: { + serializedName: "resourceType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationDetailsSavingsProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsSavingsProperties", + modelProperties: { + calculatedSavings: { + serializedName: "calculatedSavings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: + "ReservationRecommendationDetailsCalculatedSavingsProperties" + } + } + } + }, + lookBackPeriod: { + serializedName: "lookBackPeriod", + readOnly: true, + type: { + name: "Number" + } + }, + recommendedQuantity: { + serializedName: "recommendedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + reservationOrderTerm: { + serializedName: "reservationOrderTerm", + readOnly: true, + type: { + name: "String" + } + }, + savingsType: { + serializedName: "savingsType", + readOnly: true, + type: { + name: "String" + } + }, + unitOfMeasure: { + serializedName: "unitOfMeasure", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationDetailsCalculatedSavingsProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsCalculatedSavingsProperties", + modelProperties: { + onDemandCost: { + serializedName: "onDemandCost", + readOnly: true, + type: { + name: "Number" + } + }, + overageCost: { + serializedName: "overageCost", + readOnly: true, + type: { + name: "Number" + } + }, + quantity: { + serializedName: "quantity", + readOnly: true, + type: { + name: "Number" + } + }, + reservationCost: { + serializedName: "reservationCost", + readOnly: true, + type: { + name: "Number" + } + }, + totalReservationCost: { + serializedName: "totalReservationCost", + readOnly: true, + type: { + name: "Number" + } + }, + reservedUnitCount: { + serializedName: "reservedUnitCount", + type: { + name: "Number" + } + }, + savings: { + serializedName: "savings", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ReservationRecommendationDetailsUsageProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsUsageProperties", + modelProperties: { + firstConsumptionDate: { + serializedName: "firstConsumptionDate", + readOnly: true, + type: { + name: "String" + } + }, + lastConsumptionDate: { + serializedName: "lastConsumptionDate", + readOnly: true, + type: { + name: "String" + } + }, + lookBackUnitType: { + serializedName: "lookBackUnitType", + readOnly: true, + type: { + name: "String" + } + }, + usageData: { + serializedName: "usageData", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + }, + usageGrain: { + serializedName: "usageGrain", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const HighCasedErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HighCasedErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "HighCasedErrorDetails" + } + } + } + } +}; + +export const HighCasedErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HighCasedErrorDetails", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationTransactionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationTransactionsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationTransaction" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationTransactionResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationTransactionResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ModernReservationTransactionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModernReservationTransactionsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ModernReservationTransaction" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PriceSheetProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PriceSheetProperties", + modelProperties: { + billingPeriodId: { + serializedName: "billingPeriodId", + readOnly: true, + type: { + name: "String" + } + }, + meterId: { + serializedName: "meterId", + readOnly: true, + type: { + name: "Uuid" + } + }, + meterDetails: { + serializedName: "meterDetails", + type: { + name: "Composite", + className: "MeterDetails" + } + }, + unitOfMeasure: { + serializedName: "unitOfMeasure", + readOnly: true, + type: { + name: "String" + } + }, + includedQuantity: { + serializedName: "includedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + partNumber: { + serializedName: "partNumber", + readOnly: true, + type: { + name: "String" + } + }, + unitPrice: { + serializedName: "unitPrice", + readOnly: true, + type: { + name: "Number" + } + }, + currencyCode: { + serializedName: "currencyCode", + readOnly: true, + type: { + name: "String" + } + }, + offerId: { + serializedName: "offerId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MeterDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MeterDetails", + modelProperties: { + meterName: { + serializedName: "meterName", + readOnly: true, + type: { + name: "String" + } + }, + meterCategory: { + serializedName: "meterCategory", + readOnly: true, + type: { + name: "String" + } + }, + meterSubCategory: { + serializedName: "meterSubCategory", + readOnly: true, + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String" + } + }, + meterLocation: { + serializedName: "meterLocation", + readOnly: true, + type: { + name: "String" + } + }, + totalIncludedQuantity: { + serializedName: "totalIncludedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + pretaxStandardRate: { + serializedName: "pretaxStandardRate", + readOnly: true, + type: { + name: "Number" + } + }, + serviceName: { + serializedName: "serviceName", + readOnly: true, + type: { + name: "String" + } + }, + serviceTier: { + serializedName: "serviceTier", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Events: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Events", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventSummary" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Amount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Amount", + modelProperties: { + currency: { + serializedName: "currency", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const Reseller: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Reseller", + modelProperties: { + resellerId: { + serializedName: "resellerId", + readOnly: true, + type: { + name: "String" + } + }, + resellerDescription: { + serializedName: "resellerDescription", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Lots: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Lots", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LotSummary" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CreditBalanceSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreditBalanceSummary", + modelProperties: { + estimatedBalance: { + serializedName: "estimatedBalance", + type: { + name: "Composite", + className: "Amount" + } + }, + currentBalance: { + serializedName: "currentBalance", + type: { + name: "Composite", + className: "Amount" + } + }, + estimatedBalanceInBillingCurrency: { + serializedName: "estimatedBalanceInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + } + } + } +}; + +export const MeterDetailsResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MeterDetailsResponse", + modelProperties: { + meterName: { + serializedName: "meterName", + readOnly: true, + type: { + name: "String" + } + }, + meterCategory: { + serializedName: "meterCategory", + readOnly: true, + type: { + name: "String" + } + }, + meterSubCategory: { + serializedName: "meterSubCategory", + readOnly: true, + type: { + name: "String" + } + }, + unitOfMeasure: { + serializedName: "unitOfMeasure", + readOnly: true, + type: { + name: "String" + } + }, + serviceFamily: { + serializedName: "serviceFamily", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SkuProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuProperty", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DownloadProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DownloadProperties", + modelProperties: { + downloadUrl: { + serializedName: "downloadUrl", + readOnly: true, + type: { + name: "String" + } + }, + validTill: { + serializedName: "validTill", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const UsageDetail: coreClient.CompositeMapper = { + serializedName: "UsageDetail", + type: { + name: "Composite", + className: "UsageDetail", + uberParent: "Resource", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...Resource.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Marketplace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Marketplace", + modelProperties: { + ...Resource.type.modelProperties, + billingPeriodId: { + serializedName: "properties.billingPeriodId", + readOnly: true, + type: { + name: "String" + } + }, + usageStart: { + serializedName: "properties.usageStart", + readOnly: true, + type: { + name: "DateTime" + } + }, + usageEnd: { + serializedName: "properties.usageEnd", + readOnly: true, + type: { + name: "DateTime" + } + }, + resourceRate: { + serializedName: "properties.resourceRate", + readOnly: true, + type: { + name: "Number" + } + }, + offerName: { + serializedName: "properties.offerName", + readOnly: true, + type: { + name: "String" + } + }, + resourceGroup: { + serializedName: "properties.resourceGroup", + readOnly: true, + type: { + name: "String" + } + }, + additionalInfo: { + serializedName: "properties.additionalInfo", + readOnly: true, + type: { + name: "String" + } + }, + orderNumber: { + serializedName: "properties.orderNumber", + readOnly: true, + type: { + name: "String" + } + }, + instanceName: { + serializedName: "properties.instanceName", + readOnly: true, + type: { + name: "String" + } + }, + instanceId: { + serializedName: "properties.instanceId", + readOnly: true, + type: { + name: "String" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + consumedQuantity: { + serializedName: "properties.consumedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + unitOfMeasure: { + serializedName: "properties.unitOfMeasure", + readOnly: true, + type: { + name: "String" + } + }, + pretaxCost: { + serializedName: "properties.pretaxCost", + readOnly: true, + type: { + name: "Number" + } + }, + isEstimated: { + serializedName: "properties.isEstimated", + readOnly: true, + type: { + name: "Boolean" + } + }, + meterId: { + serializedName: "properties.meterId", + readOnly: true, + type: { + name: "Uuid" + } + }, + subscriptionGuid: { + serializedName: "properties.subscriptionGuid", + readOnly: true, + type: { + name: "Uuid" + } + }, + subscriptionName: { + serializedName: "properties.subscriptionName", + readOnly: true, + type: { + name: "String" + } + }, + accountName: { + serializedName: "properties.accountName", + readOnly: true, + type: { + name: "String" + } + }, + departmentName: { + serializedName: "properties.departmentName", + readOnly: true, + type: { + name: "String" + } + }, + consumedService: { + serializedName: "properties.consumedService", + readOnly: true, + type: { + name: "String" + } + }, + costCenter: { + serializedName: "properties.costCenter", + readOnly: true, + type: { + name: "String" + } + }, + additionalProperties: { + serializedName: "properties.additionalProperties", + readOnly: true, + type: { + name: "String" + } + }, + publisherName: { + serializedName: "properties.publisherName", + readOnly: true, + type: { + name: "String" + } + }, + planName: { + serializedName: "properties.planName", + readOnly: true, + type: { + name: "String" + } + }, + isRecurringCharge: { + serializedName: "properties.isRecurringCharge", + readOnly: true, + type: { + name: "Boolean" + } + } + } + } +}; + +export const Balance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Balance", + modelProperties: { + ...Resource.type.modelProperties, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + beginningBalance: { + serializedName: "properties.beginningBalance", + readOnly: true, + type: { + name: "Number" + } + }, + endingBalance: { + serializedName: "properties.endingBalance", + readOnly: true, + type: { + name: "Number" + } + }, + newPurchases: { + serializedName: "properties.newPurchases", + readOnly: true, + type: { + name: "Number" + } + }, + adjustments: { + serializedName: "properties.adjustments", + readOnly: true, + type: { + name: "Number" + } + }, + utilized: { + serializedName: "properties.utilized", + readOnly: true, + type: { + name: "Number" + } + }, + serviceOverage: { + serializedName: "properties.serviceOverage", + readOnly: true, + type: { + name: "Number" + } + }, + chargesBilledSeparately: { + serializedName: "properties.chargesBilledSeparately", + readOnly: true, + type: { + name: "Number" + } + }, + totalOverage: { + serializedName: "properties.totalOverage", + readOnly: true, + type: { + name: "Number" + } + }, + totalUsage: { + serializedName: "properties.totalUsage", + readOnly: true, + type: { + name: "Number" + } + }, + azureMarketplaceServiceCharges: { + serializedName: "properties.azureMarketplaceServiceCharges", + readOnly: true, + type: { + name: "Number" + } + }, + billingFrequency: { + serializedName: "properties.billingFrequency", + type: { + name: "String" + } + }, + priceHidden: { + serializedName: "properties.priceHidden", + readOnly: true, + type: { + name: "Boolean" + } + }, + newPurchasesDetails: { + serializedName: "properties.newPurchasesDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BalancePropertiesNewPurchasesDetailsItem" + } + } + } + }, + adjustmentDetails: { + serializedName: "properties.adjustmentDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BalancePropertiesAdjustmentDetailsItem" + } + } + } + } + } + } +}; + +export const ReservationSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationSummary", + modelProperties: { + ...Resource.type.modelProperties, + reservationOrderId: { + serializedName: "properties.reservationOrderId", + readOnly: true, + type: { + name: "String" + } + }, + reservationId: { + serializedName: "properties.reservationId", + readOnly: true, + type: { + name: "String" + } + }, + skuName: { + serializedName: "properties.skuName", + readOnly: true, + type: { + name: "String" + } + }, + reservedHours: { + serializedName: "properties.reservedHours", + readOnly: true, + type: { + name: "Number" + } + }, + usageDate: { + serializedName: "properties.usageDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + usedHours: { + serializedName: "properties.usedHours", + readOnly: true, + type: { + name: "Number" + } + }, + minUtilizationPercentage: { + serializedName: "properties.minUtilizationPercentage", + readOnly: true, + type: { + name: "Number" + } + }, + avgUtilizationPercentage: { + serializedName: "properties.avgUtilizationPercentage", + readOnly: true, + type: { + name: "Number" + } + }, + maxUtilizationPercentage: { + serializedName: "properties.maxUtilizationPercentage", + readOnly: true, + type: { + name: "Number" + } + }, + kind: { + serializedName: "properties.kind", + readOnly: true, + type: { + name: "String" + } + }, + purchasedQuantity: { + serializedName: "properties.purchasedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + remainingQuantity: { + serializedName: "properties.remainingQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + totalReservedQuantity: { + serializedName: "properties.totalReservedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + usedQuantity: { + serializedName: "properties.usedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + utilizedPercentage: { + serializedName: "properties.utilizedPercentage", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ReservationDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationDetail", + modelProperties: { + ...Resource.type.modelProperties, + reservationOrderId: { + serializedName: "properties.reservationOrderId", + readOnly: true, + type: { + name: "String" + } + }, + instanceFlexibilityRatio: { + serializedName: "properties.instanceFlexibilityRatio", + readOnly: true, + type: { + name: "String" + } + }, + instanceFlexibilityGroup: { + serializedName: "properties.instanceFlexibilityGroup", + readOnly: true, + type: { + name: "String" + } + }, + reservationId: { + serializedName: "properties.reservationId", + readOnly: true, + type: { + name: "String" + } + }, + skuName: { + serializedName: "properties.skuName", + readOnly: true, + type: { + name: "String" + } + }, + reservedHours: { + serializedName: "properties.reservedHours", + readOnly: true, + type: { + name: "Number" + } + }, + usageDate: { + serializedName: "properties.usageDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + usedHours: { + serializedName: "properties.usedHours", + readOnly: true, + type: { + name: "Number" + } + }, + instanceId: { + serializedName: "properties.instanceId", + readOnly: true, + type: { + name: "String" + } + }, + totalReservedQuantity: { + serializedName: "properties.totalReservedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + kind: { + serializedName: "properties.kind", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendation: coreClient.CompositeMapper = { + serializedName: "ReservationRecommendation", + type: { + name: "Composite", + className: "ReservationRecommendation", + uberParent: "Resource", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...Resource.type.modelProperties, + ...ResourceAttributes.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationRecommendationDetailsModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationRecommendationDetailsModel", + modelProperties: { + ...Resource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "String" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "ReservationRecommendationDetailsResourceProperties" + } + }, + resourceGroup: { + serializedName: "properties.resourceGroup", + readOnly: true, + type: { + name: "String" + } + }, + savings: { + serializedName: "properties.savings", + type: { + name: "Composite", + className: "ReservationRecommendationDetailsSavingsProperties" + } + }, + scope: { + serializedName: "properties.scope", + readOnly: true, + type: { + name: "String" + } + }, + usage: { + serializedName: "properties.usage", + type: { + name: "Composite", + className: "ReservationRecommendationDetailsUsageProperties" + } + } + } + } +}; + +export const PriceSheetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PriceSheetResult", + modelProperties: { + ...Resource.type.modelProperties, + pricesheets: { + serializedName: "properties.pricesheets", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PriceSheetProperties" + } + } + } + }, + nextLink: { + serializedName: "properties.nextLink", + readOnly: true, + type: { + name: "String" + } + }, + download: { + serializedName: "properties.download", + type: { + name: "Composite", + className: "MeterDetails" + } + } + } + } +}; + +export const ManagementGroupAggregatedCostResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagementGroupAggregatedCostResult", + modelProperties: { + ...Resource.type.modelProperties, + billingPeriodId: { + serializedName: "properties.billingPeriodId", + readOnly: true, + type: { + name: "String" + } + }, + usageStart: { + serializedName: "properties.usageStart", + readOnly: true, + type: { + name: "DateTime" + } + }, + usageEnd: { + serializedName: "properties.usageEnd", + readOnly: true, + type: { + name: "DateTime" + } + }, + azureCharges: { + serializedName: "properties.azureCharges", + readOnly: true, + type: { + name: "Number" + } + }, + marketplaceCharges: { + serializedName: "properties.marketplaceCharges", + readOnly: true, + type: { + name: "Number" + } + }, + chargesBilledSeparately: { + serializedName: "properties.chargesBilledSeparately", + readOnly: true, + type: { + name: "Number" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + children: { + serializedName: "properties.children", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagementGroupAggregatedCostResult" + } + } + } + }, + includedSubscriptions: { + serializedName: "properties.includedSubscriptions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + excludedSubscriptions: { + serializedName: "properties.excludedSubscriptions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CreditSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreditSummary", + modelProperties: { + ...Resource.type.modelProperties, + balanceSummary: { + serializedName: "properties.balanceSummary", + type: { + name: "Composite", + className: "CreditBalanceSummary" + } + }, + pendingCreditAdjustments: { + serializedName: "properties.pendingCreditAdjustments", + type: { + name: "Composite", + className: "Amount" + } + }, + expiredCredit: { + serializedName: "properties.expiredCredit", + type: { + name: "Composite", + className: "Amount" + } + }, + pendingEligibleCharges: { + serializedName: "properties.pendingEligibleCharges", + type: { + name: "Composite", + className: "Amount" + } + }, + creditCurrency: { + serializedName: "properties.creditCurrency", + readOnly: true, + type: { + name: "String" + } + }, + billingCurrency: { + serializedName: "properties.billingCurrency", + readOnly: true, + type: { + name: "String" + } + }, + reseller: { + serializedName: "properties.reseller", + type: { + name: "Composite", + className: "Reseller" + } + }, + eTag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Budget: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Budget", + modelProperties: { + ...ProxyResource.type.modelProperties, + category: { + serializedName: "properties.category", + type: { + name: "String" + } + }, + amount: { + serializedName: "properties.amount", + type: { + name: "Number" + } + }, + timeGrain: { + serializedName: "properties.timeGrain", + type: { + name: "String" + } + }, + timePeriod: { + serializedName: "properties.timePeriod", + type: { + name: "Composite", + className: "BudgetTimePeriod" + } + }, + filter: { + serializedName: "properties.filter", + type: { + name: "Composite", + className: "BudgetFilter" + } + }, + currentSpend: { + serializedName: "properties.currentSpend", + type: { + name: "Composite", + className: "CurrentSpend" + } + }, + notifications: { + serializedName: "properties.notifications", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "Notification" } } + } + }, + forecastSpend: { + serializedName: "properties.forecastSpend", + type: { + name: "Composite", + className: "ForecastSpend" + } + } + } + } +}; + +export const TagsResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsResult", + modelProperties: { + ...ProxyResource.type.modelProperties, + tags: { + serializedName: "properties.tags", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Tag" + } + } + } + }, + nextLink: { + serializedName: "properties.nextLink", + readOnly: true, + type: { + name: "String" + } + }, + previousLink: { + serializedName: "properties.previousLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ChargeSummary: coreClient.CompositeMapper = { + serializedName: "ChargeSummary", + type: { + name: "Composite", + className: "ChargeSummary", + uberParent: "ProxyResource", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...ProxyResource.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const EventSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventSummary", + modelProperties: { + ...ProxyResource.type.modelProperties, + transactionDate: { + serializedName: "properties.transactionDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + newCredit: { + serializedName: "properties.newCredit", + type: { + name: "Composite", + className: "Amount" + } + }, + adjustments: { + serializedName: "properties.adjustments", + type: { + name: "Composite", + className: "Amount" + } + }, + creditExpired: { + serializedName: "properties.creditExpired", + type: { + name: "Composite", + className: "Amount" + } + }, + charges: { + serializedName: "properties.charges", + type: { + name: "Composite", + className: "Amount" + } + }, + closedBalance: { + serializedName: "properties.closedBalance", + type: { + name: "Composite", + className: "Amount" + } + }, + eventType: { + serializedName: "properties.eventType", + type: { + name: "String" + } + }, + invoiceNumber: { + serializedName: "properties.invoiceNumber", + readOnly: true, + type: { + name: "String" + } + }, + billingProfileId: { + serializedName: "properties.billingProfileId", + readOnly: true, + type: { + name: "String" + } + }, + billingProfileDisplayName: { + serializedName: "properties.billingProfileDisplayName", + readOnly: true, + type: { + name: "String" + } + }, + lotId: { + serializedName: "properties.lotId", + readOnly: true, + type: { + name: "String" + } + }, + lotSource: { + serializedName: "properties.lotSource", + readOnly: true, + type: { + name: "String" + } + }, + canceledCredit: { + serializedName: "properties.canceledCredit", + type: { + name: "Composite", + className: "Amount" + } + }, + creditCurrency: { + serializedName: "properties.creditCurrency", + readOnly: true, + type: { + name: "String" + } + }, + billingCurrency: { + serializedName: "properties.billingCurrency", + readOnly: true, + type: { + name: "String" + } + }, + reseller: { + serializedName: "properties.reseller", + type: { + name: "Composite", + className: "Reseller" + } + }, + creditExpiredInBillingCurrency: { + serializedName: "properties.creditExpiredInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + newCreditInBillingCurrency: { + serializedName: "properties.newCreditInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + adjustmentsInBillingCurrency: { + serializedName: "properties.adjustmentsInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + chargesInBillingCurrency: { + serializedName: "properties.chargesInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + closedBalanceInBillingCurrency: { + serializedName: "properties.closedBalanceInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + eTagPropertiesETag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const LotSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LotSummary", + modelProperties: { + ...ProxyResource.type.modelProperties, + originalAmount: { + serializedName: "properties.originalAmount", + type: { + name: "Composite", + className: "Amount" + } + }, + closedBalance: { + serializedName: "properties.closedBalance", + type: { + name: "Composite", + className: "Amount" + } + }, + source: { + serializedName: "properties.source", + readOnly: true, + type: { + name: "String" + } + }, + startDate: { + serializedName: "properties.startDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + expirationDate: { + serializedName: "properties.expirationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + poNumber: { + serializedName: "properties.poNumber", + readOnly: true, + type: { + name: "String" + } + }, + purchasedDate: { + serializedName: "properties.purchasedDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + }, + creditCurrency: { + serializedName: "properties.creditCurrency", + readOnly: true, + type: { + name: "String" + } + }, + billingCurrency: { + serializedName: "properties.billingCurrency", + readOnly: true, + type: { + name: "String" + } + }, + originalAmountInBillingCurrency: { + serializedName: "properties.originalAmountInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + closedBalanceInBillingCurrency: { + serializedName: "properties.closedBalanceInBillingCurrency", + type: { + name: "Composite", + className: "AmountWithExchangeRate" + } + }, + reseller: { + serializedName: "properties.reseller", + type: { + name: "Composite", + className: "Reseller" + } + }, + eTagPropertiesETag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ReservationTransaction: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationTransaction", + modelProperties: { + ...ReservationTransactionResource.type.modelProperties, + eventDate: { + serializedName: "properties.eventDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + reservationOrderId: { + serializedName: "properties.reservationOrderId", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + eventType: { + serializedName: "properties.eventType", + readOnly: true, + type: { + name: "String" + } + }, + quantity: { + serializedName: "properties.quantity", + readOnly: true, + type: { + name: "Number" + } + }, + amount: { + serializedName: "properties.amount", + readOnly: true, + type: { + name: "Number" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + reservationOrderName: { + serializedName: "properties.reservationOrderName", + readOnly: true, + type: { + name: "String" + } + }, + purchasingEnrollment: { + serializedName: "properties.purchasingEnrollment", + readOnly: true, + type: { + name: "String" + } + }, + purchasingSubscriptionGuid: { + serializedName: "properties.purchasingSubscriptionGuid", + readOnly: true, + type: { + name: "Uuid" + } + }, + purchasingSubscriptionName: { + serializedName: "properties.purchasingSubscriptionName", + readOnly: true, + type: { + name: "String" + } + }, + armSkuName: { + serializedName: "properties.armSkuName", + readOnly: true, + type: { + name: "String" + } + }, + term: { + serializedName: "properties.term", + readOnly: true, + type: { + name: "String" + } + }, + region: { + serializedName: "properties.region", + readOnly: true, + type: { + name: "String" + } + }, + accountName: { + serializedName: "properties.accountName", + readOnly: true, + type: { + name: "String" + } + }, + accountOwnerEmail: { + serializedName: "properties.accountOwnerEmail", + readOnly: true, + type: { + name: "String" + } + }, + departmentName: { + serializedName: "properties.departmentName", + readOnly: true, + type: { + name: "String" + } + }, + costCenter: { + serializedName: "properties.costCenter", + readOnly: true, + type: { + name: "String" + } + }, + currentEnrollment: { + serializedName: "properties.currentEnrollment", + readOnly: true, + type: { + name: "String" + } + }, + billingFrequency: { + serializedName: "properties.billingFrequency", + readOnly: true, + type: { + name: "String" + } + }, + billingMonth: { + serializedName: "properties.billingMonth", + readOnly: true, + type: { + name: "Number" + } + }, + monetaryCommitment: { + serializedName: "properties.monetaryCommitment", + readOnly: true, + type: { + name: "Number" + } + }, + overage: { + serializedName: "properties.overage", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ModernReservationTransaction: coreClient.CompositeMapper = { + serializedName: "Modern", + type: { + name: "Composite", + className: "ModernReservationTransaction", + modelProperties: { + ...ReservationTransactionResource.type.modelProperties, + amount: { + serializedName: "properties.amount", + readOnly: true, + type: { + name: "Number" + } + }, + armSkuName: { + serializedName: "properties.armSkuName", + readOnly: true, + type: { + name: "String" + } + }, + billingFrequency: { + serializedName: "properties.billingFrequency", + readOnly: true, + type: { + name: "String" + } + }, + billingProfileId: { + serializedName: "properties.billingProfileId", + readOnly: true, + type: { + name: "String" + } + }, + billingProfileName: { + serializedName: "properties.billingProfileName", + readOnly: true, + type: { + name: "String" + } + }, + currency: { + serializedName: "properties.currency", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + eventDate: { + serializedName: "properties.eventDate", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - departmentName: { + eventType: { + serializedName: "properties.eventType", readOnly: true, - serializedName: "properties.departmentName", type: { name: "String" } }, - product: { + invoice: { + serializedName: "properties.invoice", readOnly: true, - serializedName: "properties.product", type: { name: "String" } }, - consumedService: { + invoiceId: { + serializedName: "properties.invoiceId", readOnly: true, - serializedName: "properties.consumedService", type: { name: "String" } }, - costCenter: { + invoiceSectionId: { + serializedName: "properties.invoiceSectionId", readOnly: true, - serializedName: "properties.costCenter", type: { name: "String" } }, - partNumber: { + invoiceSectionName: { + serializedName: "properties.invoiceSectionName", readOnly: true, - serializedName: "properties.partNumber", type: { name: "String" } }, - resourceGuid: { + purchasingSubscriptionGuid: { + serializedName: "properties.purchasingSubscriptionGuid", + readOnly: true, + type: { + name: "Uuid" + } + }, + purchasingSubscriptionName: { + serializedName: "properties.purchasingSubscriptionName", readOnly: true, - serializedName: "properties.resourceGuid", type: { name: "String" } }, - offerId: { + quantity: { + serializedName: "properties.quantity", + readOnly: true, + type: { + name: "Number" + } + }, + region: { + serializedName: "properties.region", readOnly: true, - serializedName: "properties.offerId", type: { name: "String" } }, - chargesBilledSeparately: { + reservationOrderId: { + serializedName: "properties.reservationOrderId", readOnly: true, - serializedName: "properties.chargesBilledSeparately", type: { - name: "Boolean" + name: "String" } }, - location: { + reservationOrderName: { + serializedName: "properties.reservationOrderName", readOnly: true, - serializedName: "properties.location", type: { name: "String" } }, - additionalProperties: { + term: { + serializedName: "properties.term", readOnly: true, - serializedName: "properties.additionalProperties", type: { name: "String" } @@ -329,1128 +3048,860 @@ export const UsageDetail: msRest.CompositeMapper = { } }; -export const Marketplace: msRest.CompositeMapper = { - serializedName: "Marketplace", +export const AmountWithExchangeRate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Marketplace", + className: "AmountWithExchangeRate", modelProperties: { - ...Resource.type.modelProperties, - billingPeriodId: { + ...Amount.type.modelProperties, + exchangeRate: { + serializedName: "exchangeRate", readOnly: true, - serializedName: "properties.billingPeriodId", type: { - name: "String" + name: "Number" } }, - usageStart: { + exchangeRateMonth: { + serializedName: "exchangeRateMonth", readOnly: true, - serializedName: "properties.usageStart", type: { - name: "DateTime" + name: "Number" } - }, - usageEnd: { + } + } + } +}; + +export const LegacyUsageDetail: coreClient.CompositeMapper = { + serializedName: "legacy", + type: { + name: "Composite", + className: "LegacyUsageDetail", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, + modelProperties: { + ...UsageDetail.type.modelProperties, + billingAccountId: { + serializedName: "properties.billingAccountId", readOnly: true, - serializedName: "properties.usageEnd", type: { - name: "DateTime" + name: "String" } }, - resourceRate: { + billingAccountName: { + serializedName: "properties.billingAccountName", readOnly: true, - serializedName: "properties.resourceRate", type: { - name: "Number" + name: "String" } }, - offerName: { + billingPeriodStartDate: { + serializedName: "properties.billingPeriodStartDate", readOnly: true, - serializedName: "properties.offerName", type: { - name: "String" + name: "DateTime" } }, - resourceGroup: { + billingPeriodEndDate: { + serializedName: "properties.billingPeriodEndDate", readOnly: true, - serializedName: "properties.resourceGroup", type: { - name: "String" + name: "DateTime" } }, - orderNumber: { + billingProfileId: { + serializedName: "properties.billingProfileId", readOnly: true, - serializedName: "properties.orderNumber", type: { name: "String" } }, - instanceName: { + billingProfileName: { + serializedName: "properties.billingProfileName", readOnly: true, - serializedName: "properties.instanceName", type: { name: "String" } }, - instanceId: { + accountOwnerId: { + serializedName: "properties.accountOwnerId", readOnly: true, - serializedName: "properties.instanceId", type: { name: "String" } }, - currency: { + accountName: { + serializedName: "properties.accountName", readOnly: true, - serializedName: "properties.currency", type: { name: "String" } }, - consumedQuantity: { + subscriptionId: { + serializedName: "properties.subscriptionId", readOnly: true, - serializedName: "properties.consumedQuantity", type: { - name: "Number" + name: "String" } }, - unitOfMeasure: { + subscriptionName: { + serializedName: "properties.subscriptionName", readOnly: true, - serializedName: "properties.unitOfMeasure", type: { name: "String" } }, - pretaxCost: { + date: { + serializedName: "properties.date", readOnly: true, - serializedName: "properties.pretaxCost", type: { - name: "Number" + name: "DateTime" } }, - isEstimated: { + product: { + serializedName: "properties.product", readOnly: true, - serializedName: "properties.isEstimated", type: { - name: "Boolean" + name: "String" } }, - meterId: { + partNumber: { + serializedName: "properties.partNumber", readOnly: true, - serializedName: "properties.meterId", type: { - name: "Uuid" + name: "String" } }, - subscriptionGuid: { + meterId: { + serializedName: "properties.meterId", readOnly: true, - serializedName: "properties.subscriptionGuid", type: { name: "Uuid" } }, - subscriptionName: { - readOnly: true, - serializedName: "properties.subscriptionName", + meterDetails: { + serializedName: "properties.meterDetails", type: { - name: "String" + name: "Composite", + className: "MeterDetailsResponse" } }, - accountName: { + quantity: { + serializedName: "properties.quantity", readOnly: true, - serializedName: "properties.accountName", type: { - name: "String" + name: "Number" } }, - departmentName: { + effectivePrice: { + serializedName: "properties.effectivePrice", readOnly: true, - serializedName: "properties.departmentName", type: { - name: "String" + name: "Number" } }, - consumedService: { + cost: { + serializedName: "properties.cost", readOnly: true, - serializedName: "properties.consumedService", type: { - name: "String" + name: "Number" } }, - costCenter: { + unitPrice: { + serializedName: "properties.unitPrice", readOnly: true, - serializedName: "properties.costCenter", type: { - name: "String" + name: "Number" } }, - additionalProperties: { + billingCurrency: { + serializedName: "properties.billingCurrency", readOnly: true, - serializedName: "properties.additionalProperties", type: { name: "String" } }, - publisherName: { + resourceLocation: { + serializedName: "properties.resourceLocation", readOnly: true, - serializedName: "properties.publisherName", type: { name: "String" } }, - planName: { + consumedService: { + serializedName: "properties.consumedService", readOnly: true, - serializedName: "properties.planName", type: { name: "String" } }, - isRecurringCharge: { - readOnly: true, - serializedName: "properties.isRecurringCharge", - type: { - name: "Boolean" - } - } - } - } -}; - -export const Tenant: msRest.CompositeMapper = { - serializedName: "Tenant", - type: { - name: "Composite", - className: "Tenant", - modelProperties: { - ...Resource.type.modelProperties, - billingProfileName: { + resourceId: { + serializedName: "properties.resourceId", readOnly: true, - serializedName: "properties.billingProfileName", type: { name: "String" } }, - billingAccountId: { + resourceName: { + serializedName: "properties.resourceName", readOnly: true, - serializedName: "properties.billingAccountId", type: { name: "String" } }, - tenantId: { + serviceInfo1: { + serializedName: "properties.serviceInfo1", readOnly: true, - serializedName: "properties.tenantId", type: { name: "String" } }, - billingAccountName: { + serviceInfo2: { + serializedName: "properties.serviceInfo2", readOnly: true, - serializedName: "properties.billingAccountName", type: { name: "String" } - } - } - } -}; - -export const TenantListResult: msRest.CompositeMapper = { - serializedName: "TenantListResult", - type: { - name: "Composite", - className: "TenantListResult", - modelProperties: { - value: { - readOnly: true, - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Tenant" - } - } - } }, - nextLink: { + additionalInfo: { + serializedName: "properties.additionalInfo", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const BalancePropertiesNewPurchasesDetailsItem: msRest.CompositeMapper = { - serializedName: "BalanceProperties_newPurchasesDetailsItem", - type: { - name: "Composite", - className: "BalancePropertiesNewPurchasesDetailsItem", - modelProperties: { - name: { + }, + invoiceSection: { + serializedName: "properties.invoiceSection", readOnly: true, - serializedName: "name", type: { name: "String" } }, - value: { - readOnly: true, - serializedName: "value", - type: { - name: "Number" - } - } - } - } -}; - -export const BalancePropertiesAdjustmentDetailsItem: msRest.CompositeMapper = { - serializedName: "BalanceProperties_adjustmentDetailsItem", - type: { - name: "Composite", - className: "BalancePropertiesAdjustmentDetailsItem", - modelProperties: { - name: { + costCenter: { + serializedName: "properties.costCenter", readOnly: true, - serializedName: "name", type: { name: "String" } }, - value: { - readOnly: true, - serializedName: "value", - type: { - name: "Number" - } - } - } - } -}; - -export const Balance: msRest.CompositeMapper = { - serializedName: "Balance", - type: { - name: "Composite", - className: "Balance", - modelProperties: { - ...Resource.type.modelProperties, - currency: { + resourceGroup: { + serializedName: "properties.resourceGroup", readOnly: true, - serializedName: "properties.currency", type: { name: "String" } }, - beginningBalance: { + reservationId: { + serializedName: "properties.reservationId", readOnly: true, - serializedName: "properties.beginningBalance", type: { - name: "Number" + name: "String" } }, - endingBalance: { + reservationName: { + serializedName: "properties.reservationName", readOnly: true, - serializedName: "properties.endingBalance", type: { - name: "Number" + name: "String" } }, - newPurchases: { + productOrderId: { + serializedName: "properties.productOrderId", readOnly: true, - serializedName: "properties.newPurchases", type: { - name: "Number" + name: "String" } }, - adjustments: { + productOrderName: { + serializedName: "properties.productOrderName", readOnly: true, - serializedName: "properties.adjustments", type: { - name: "Number" + name: "String" } }, - utilized: { + offerId: { + serializedName: "properties.offerId", readOnly: true, - serializedName: "properties.utilized", type: { - name: "Number" + name: "String" } }, - serviceOverage: { + isAzureCreditEligible: { + serializedName: "properties.isAzureCreditEligible", readOnly: true, - serializedName: "properties.serviceOverage", type: { - name: "Number" + name: "Boolean" } }, - chargesBilledSeparately: { + term: { + serializedName: "properties.term", readOnly: true, - serializedName: "properties.chargesBilledSeparately", type: { - name: "Number" + name: "String" } }, - totalOverage: { + publisherName: { + serializedName: "properties.publisherName", readOnly: true, - serializedName: "properties.totalOverage", type: { - name: "Number" + name: "String" } }, - totalUsage: { + publisherType: { + serializedName: "properties.publisherType", readOnly: true, - serializedName: "properties.totalUsage", type: { - name: "Number" + name: "String" } }, - azureMarketplaceServiceCharges: { + planName: { + serializedName: "properties.planName", readOnly: true, - serializedName: "properties.azureMarketplaceServiceCharges", type: { - name: "Number" + name: "String" } }, - billingFrequency: { - serializedName: "properties.billingFrequency", + chargeType: { + serializedName: "properties.chargeType", + readOnly: true, type: { name: "String" } }, - priceHidden: { + frequency: { + serializedName: "properties.frequency", readOnly: true, - serializedName: "properties.priceHidden", type: { - name: "Boolean" + name: "String" } }, - newPurchasesDetails: { + payGPrice: { + serializedName: "properties.payGPrice", readOnly: true, - serializedName: "properties.newPurchasesDetails", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BalancePropertiesNewPurchasesDetailsItem" - } - } + name: "Number" } }, - adjustmentDetails: { + pricingModel: { + serializedName: "properties.pricingModel", readOnly: true, - serializedName: "properties.adjustmentDetails", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BalancePropertiesAdjustmentDetailsItem" - } - } + name: "String" } } } } }; -export const ReservationSummary: msRest.CompositeMapper = { - serializedName: "ReservationSummary", +export const ModernUsageDetail: coreClient.CompositeMapper = { + serializedName: "modern", type: { name: "Composite", - className: "ReservationSummary", + className: "ModernUsageDetail", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - ...Resource.type.modelProperties, - reservationOrderId: { + ...UsageDetail.type.modelProperties, + billingAccountId: { + serializedName: "properties.billingAccountId", readOnly: true, - serializedName: "properties.reservationOrderId", type: { name: "String" } }, - reservationId: { + effectivePrice: { + serializedName: "properties.effectivePrice", readOnly: true, - serializedName: "properties.reservationId", type: { - name: "String" + name: "Number" } }, - skuName: { + pricingModel: { + serializedName: "properties.pricingModel", readOnly: true, - serializedName: "properties.skuName", type: { name: "String" } }, - reservedHours: { + billingAccountName: { + serializedName: "properties.billingAccountName", readOnly: true, - serializedName: "properties.reservedHours", type: { - name: "Number" + name: "String" } }, - usageDate: { + billingPeriodStartDate: { + serializedName: "properties.billingPeriodStartDate", readOnly: true, - serializedName: "properties.usageDate", type: { name: "DateTime" } }, - usedHours: { + billingPeriodEndDate: { + serializedName: "properties.billingPeriodEndDate", readOnly: true, - serializedName: "properties.usedHours", type: { - name: "Number" + name: "DateTime" } }, - minUtilizationPercentage: { + billingProfileId: { + serializedName: "properties.billingProfileId", readOnly: true, - serializedName: "properties.minUtilizationPercentage", type: { - name: "Number" + name: "String" } }, - avgUtilizationPercentage: { + billingProfileName: { + serializedName: "properties.billingProfileName", readOnly: true, - serializedName: "properties.avgUtilizationPercentage", type: { - name: "Number" + name: "String" } }, - maxUtilizationPercentage: { + subscriptionGuid: { + serializedName: "properties.subscriptionGuid", readOnly: true, - serializedName: "properties.maxUtilizationPercentage", type: { - name: "Number" + name: "String" } - } - } - } -}; - -export const ReservationDetail: msRest.CompositeMapper = { - serializedName: "ReservationDetail", - type: { - name: "Composite", - className: "ReservationDetail", - modelProperties: { - ...Resource.type.modelProperties, - reservationOrderId: { + }, + subscriptionName: { + serializedName: "properties.subscriptionName", readOnly: true, - serializedName: "properties.reservationOrderId", type: { name: "String" } }, - reservationId: { + date: { + serializedName: "properties.date", readOnly: true, - serializedName: "properties.reservationId", type: { - name: "String" + name: "DateTime" } }, - skuName: { + product: { + serializedName: "properties.product", readOnly: true, - serializedName: "properties.skuName", type: { name: "String" } }, - reservedHours: { + meterId: { + serializedName: "properties.meterId", readOnly: true, - serializedName: "properties.reservedHours", type: { - name: "Number" + name: "Uuid" } }, - usageDate: { + meterName: { + serializedName: "properties.meterName", readOnly: true, - serializedName: "properties.usageDate", type: { - name: "DateTime" + name: "String" } }, - usedHours: { + meterRegion: { + serializedName: "properties.meterRegion", readOnly: true, - serializedName: "properties.usedHours", type: { - name: "Number" + name: "String" } }, - instanceId: { + meterCategory: { + serializedName: "properties.meterCategory", readOnly: true, - serializedName: "properties.instanceId", type: { name: "String" } }, - totalReservedQuantity: { + meterSubCategory: { + serializedName: "properties.meterSubCategory", readOnly: true, - serializedName: "properties.totalReservedQuantity", type: { - name: "Number" + name: "String" } - } - } - } -}; - -export const ReservationRecommendation: msRest.CompositeMapper = { - serializedName: "ReservationRecommendation", - type: { - name: "Composite", - className: "ReservationRecommendation", - modelProperties: { - id: { + }, + serviceFamily: { + serializedName: "properties.serviceFamily", readOnly: true, - serializedName: "id", type: { name: "String" } }, - name: { + quantity: { + serializedName: "properties.quantity", + readOnly: true, + type: { + name: "Number" + } + }, + unitOfMeasure: { + serializedName: "properties.unitOfMeasure", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + instanceName: { + serializedName: "properties.instanceName", readOnly: true, - serializedName: "type", type: { name: "String" } }, - tags: { + costInUSD: { + serializedName: "properties.costInUSD", readOnly: true, - serializedName: "tags", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Number" } }, - location: { + unitPrice: { + serializedName: "properties.unitPrice", readOnly: true, - serializedName: "location", type: { - name: "String" + name: "Number" } }, - sku: { + billingCurrencyCode: { + serializedName: "properties.billingCurrencyCode", readOnly: true, - serializedName: "sku", type: { name: "String" } }, - lookBackPeriod: { + resourceLocation: { + serializedName: "properties.resourceLocation", readOnly: true, - serializedName: "properties.lookBackPeriod", type: { name: "String" } }, - meterId: { + consumedService: { + serializedName: "properties.consumedService", readOnly: true, - serializedName: "properties.meterId", type: { - name: "Uuid" + name: "String" } }, - term: { + serviceInfo1: { + serializedName: "properties.serviceInfo1", readOnly: true, - serializedName: "properties.term", type: { name: "String" } }, - costWithNoReservedInstances: { + serviceInfo2: { + serializedName: "properties.serviceInfo2", readOnly: true, - serializedName: "properties.costWithNoReservedInstances", type: { - name: "Number" + name: "String" } }, - recommendedQuantity: { + additionalInfo: { + serializedName: "properties.additionalInfo", readOnly: true, - serializedName: "properties.recommendedQuantity", type: { - name: "Number" + name: "String" } }, - totalCostWithReservedInstances: { + invoiceSectionId: { + serializedName: "properties.invoiceSectionId", readOnly: true, - serializedName: "properties.totalCostWithReservedInstances", type: { - name: "Number" + name: "String" } }, - netSavings: { + invoiceSectionName: { + serializedName: "properties.invoiceSectionName", readOnly: true, - serializedName: "properties.netSavings", type: { - name: "Number" + name: "String" } }, - firstUsageDate: { + costCenter: { + serializedName: "properties.costCenter", readOnly: true, - serializedName: "properties.firstUsageDate", type: { - name: "DateTime" + name: "String" } }, - scope: { + resourceGroup: { + serializedName: "properties.resourceGroup", readOnly: true, - serializedName: "properties.scope", type: { name: "String" } - } - } - } -}; - -export const Tag: msRest.CompositeMapper = { - serializedName: "Tag", - type: { - name: "Composite", - className: "Tag", - modelProperties: { - key: { - serializedName: "key", + }, + reservationId: { + serializedName: "properties.reservationId", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - id: { + }, + reservationName: { + serializedName: "properties.reservationName", readOnly: true, - serializedName: "id", type: { name: "String" } }, - name: { + productOrderId: { + serializedName: "properties.productOrderId", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + productOrderName: { + serializedName: "properties.productOrderName", readOnly: true, - serializedName: "type", type: { name: "String" } }, - eTag: { - serializedName: "eTag", + isAzureCreditEligible: { + serializedName: "properties.isAzureCreditEligible", + readOnly: true, + type: { + name: "Boolean" + } + }, + term: { + serializedName: "properties.term", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const TagsResult: msRest.CompositeMapper = { - serializedName: "TagsResult", - type: { - name: "Composite", - className: "TagsResult", - modelProperties: { - ...ProxyResource.type.modelProperties, - tags: { - serializedName: "properties.tags", + }, + publisherName: { + serializedName: "properties.publisherName", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Tag" - } - } + name: "String" } - } - } - } -}; - -export const BudgetTimePeriod: msRest.CompositeMapper = { - serializedName: "BudgetTimePeriod", - type: { - name: "Composite", - className: "BudgetTimePeriod", - modelProperties: { - startDate: { - required: true, - serializedName: "startDate", + }, + publisherType: { + serializedName: "properties.publisherType", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - endDate: { - serializedName: "endDate", + chargeType: { + serializedName: "properties.chargeType", + readOnly: true, type: { - name: "DateTime" + name: "String" } - } - } - } -}; - -export const Filters: msRest.CompositeMapper = { - serializedName: "Filters", - type: { - name: "Composite", - className: "Filters", - modelProperties: { - resourceGroups: { - serializedName: "resourceGroups", - constraints: { - MaxItems: 10, - MinItems: 0 - }, + }, + frequency: { + serializedName: "properties.frequency", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - resources: { - serializedName: "resources", - constraints: { - MaxItems: 10, - MinItems: 0 - }, + costInBillingCurrency: { + serializedName: "properties.costInBillingCurrency", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Number" } }, - meters: { - serializedName: "meters", - constraints: { - MaxItems: 10, - MinItems: 0 - }, + costInPricingCurrency: { + serializedName: "properties.costInPricingCurrency", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Uuid" - } - } + name: "Number" } }, - tags: { - serializedName: "tags", + exchangeRate: { + serializedName: "properties.exchangeRate", + readOnly: true, type: { - name: "Dictionary", - value: { - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } + name: "String" } - } - } - } -}; - -export const CurrentSpend: msRest.CompositeMapper = { - serializedName: "CurrentSpend", - type: { - name: "Composite", - className: "CurrentSpend", - modelProperties: { - amount: { + }, + exchangeRateDate: { + serializedName: "properties.exchangeRateDate", readOnly: true, - serializedName: "amount", type: { - name: "Number" + name: "DateTime" } }, - unit: { + invoiceId: { + serializedName: "properties.invoiceId", readOnly: true, - serializedName: "unit", type: { name: "String" } - } - } - } -}; - -export const Notification: msRest.CompositeMapper = { - serializedName: "Notification", - type: { - name: "Composite", - className: "Notification", - modelProperties: { - enabled: { - required: true, - serializedName: "enabled", + }, + previousInvoiceId: { + serializedName: "properties.previousInvoiceId", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - operator: { - required: true, - serializedName: "operator", + pricingCurrencyCode: { + serializedName: "properties.pricingCurrencyCode", + readOnly: true, type: { name: "String" } }, - threshold: { - required: true, - serializedName: "threshold", + productIdentifier: { + serializedName: "properties.productIdentifier", + readOnly: true, type: { - name: "Number" + name: "String" } }, - contactEmails: { - required: true, - serializedName: "contactEmails", - constraints: { - MaxItems: 50, - MinItems: 1 - }, + resourceLocationNormalized: { + serializedName: "properties.resourceLocationNormalized", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - contactRoles: { - serializedName: "contactRoles", + servicePeriodStartDate: { + serializedName: "properties.servicePeriodStartDate", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTime" } }, - contactGroups: { - serializedName: "contactGroups", - constraints: { - MaxItems: 50, - MinItems: 0 - }, + servicePeriodEndDate: { + serializedName: "properties.servicePeriodEndDate", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTime" } - } - } - } -}; - -export const Budget: msRest.CompositeMapper = { - serializedName: "Budget", - type: { - name: "Composite", - className: "Budget", - modelProperties: { - ...ProxyResource.type.modelProperties, - category: { - required: true, - serializedName: "properties.category", + }, + customerTenantId: { + serializedName: "properties.customerTenantId", + readOnly: true, type: { name: "String" } }, - amount: { - required: true, - serializedName: "properties.amount", + customerName: { + serializedName: "properties.customerName", + readOnly: true, type: { - name: "Number" + name: "String" } }, - timeGrain: { - required: true, - serializedName: "properties.timeGrain", + partnerTenantId: { + serializedName: "properties.partnerTenantId", + readOnly: true, type: { name: "String" } }, - timePeriod: { - required: true, - serializedName: "properties.timePeriod", + partnerName: { + serializedName: "properties.partnerName", + readOnly: true, type: { - name: "Composite", - className: "BudgetTimePeriod" + name: "String" } }, - filters: { - serializedName: "properties.filters", + resellerMpnId: { + serializedName: "properties.resellerMpnId", + readOnly: true, type: { - name: "Composite", - className: "Filters" + name: "String" } }, - currentSpend: { + resellerName: { + serializedName: "properties.resellerName", readOnly: true, - serializedName: "properties.currentSpend", type: { - name: "Composite", - className: "CurrentSpend" + name: "String" } }, - notifications: { - serializedName: "properties.notifications", + publisherId: { + serializedName: "properties.publisherId", + readOnly: true, type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "Notification" - } - } + name: "String" } - } - } - } -}; - -export const PriceSheetProperties: msRest.CompositeMapper = { - serializedName: "PriceSheetProperties", - type: { - name: "Composite", - className: "PriceSheetProperties", - modelProperties: { - billingPeriodId: { + }, + marketPrice: { + serializedName: "properties.marketPrice", readOnly: true, - serializedName: "billingPeriodId", type: { - name: "String" + name: "Number" } }, - meterId: { + exchangeRatePricingToBilling: { + serializedName: "properties.exchangeRatePricingToBilling", readOnly: true, - serializedName: "meterId", type: { - name: "Uuid" + name: "Number" } }, - meterDetails: { + paygCostInBillingCurrency: { + serializedName: "properties.paygCostInBillingCurrency", readOnly: true, - serializedName: "meterDetails", type: { - name: "Composite", - className: "MeterDetails" + name: "Number" } }, - unitOfMeasure: { + paygCostInUSD: { + serializedName: "properties.paygCostInUSD", readOnly: true, - serializedName: "unitOfMeasure", type: { - name: "String" + name: "Number" } }, - includedQuantity: { + partnerEarnedCreditRate: { + serializedName: "properties.partnerEarnedCreditRate", readOnly: true, - serializedName: "includedQuantity", type: { name: "Number" } }, - partNumber: { + partnerEarnedCreditApplied: { + serializedName: "properties.partnerEarnedCreditApplied", readOnly: true, - serializedName: "partNumber", type: { name: "String" } }, - unitPrice: { + payGPrice: { + serializedName: "properties.payGPrice", readOnly: true, - serializedName: "unitPrice", type: { name: "Number" } }, - currencyCode: { + benefitId: { + serializedName: "properties.benefitId", readOnly: true, - serializedName: "currencyCode", type: { name: "String" } }, - offerId: { + benefitName: { + serializedName: "properties.benefitName", readOnly: true, - serializedName: "offerId", type: { name: "String" } - } - } - } -}; - -export const PriceSheetResult: msRest.CompositeMapper = { - serializedName: "PriceSheetResult", - type: { - name: "Composite", - className: "PriceSheetResult", - modelProperties: { - ...Resource.type.modelProperties, - pricesheets: { + }, + provider: { + serializedName: "properties.provider", readOnly: true, - serializedName: "properties.pricesheets", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PriceSheetProperties" - } - } + name: "String" } }, - nextLink: { + costAllocationRuleName: { + serializedName: "properties.costAllocationRuleName", readOnly: true, - serializedName: "properties.nextLink", type: { name: "String" } @@ -1459,179 +3910,122 @@ export const PriceSheetResult: msRest.CompositeMapper = { } }; -export const ForecastPropertiesConfidenceLevelsItem: msRest.CompositeMapper = { - serializedName: "ForecastProperties_confidenceLevelsItem", +export const LegacyReservationRecommendation: coreClient.CompositeMapper = { + serializedName: "legacy", type: { name: "Composite", - className: "ForecastPropertiesConfidenceLevelsItem", + className: "LegacyReservationRecommendation", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - percentage: { + ...ReservationRecommendation.type.modelProperties, + lookBackPeriod: { + serializedName: "properties.lookBackPeriod", readOnly: true, - serializedName: "percentage", - type: { - name: "Number" - } - }, - bound: { - serializedName: "bound", type: { name: "String" } }, - value: { + instanceFlexibilityRatio: { + serializedName: "properties.instanceFlexibilityRatio", readOnly: true, - serializedName: "value", type: { name: "Number" } - } - } - } -}; - -export const Forecast: msRest.CompositeMapper = { - serializedName: "Forecast", - type: { - name: "Composite", - className: "Forecast", - modelProperties: { - ...Resource.type.modelProperties, - usageDate: { + }, + instanceFlexibilityGroup: { + serializedName: "properties.instanceFlexibilityGroup", readOnly: true, - serializedName: "properties.usageDate", type: { name: "String" } }, - grain: { - serializedName: "properties.grain", + normalizedSize: { + serializedName: "properties.normalizedSize", + readOnly: true, type: { name: "String" } }, - charge: { + recommendedQuantityNormalized: { + serializedName: "properties.recommendedQuantityNormalized", readOnly: true, - serializedName: "properties.charge", type: { name: "Number" } }, - currency: { + meterId: { + serializedName: "properties.meterId", readOnly: true, - serializedName: "properties.currency", type: { - name: "String" + name: "Uuid" } }, - chargeType: { - serializedName: "properties.chargeType", + resourceType: { + serializedName: "properties.resourceType", + readOnly: true, type: { name: "String" } }, - confidenceLevels: { - readOnly: true, - serializedName: "properties.confidenceLevels", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ForecastPropertiesConfidenceLevelsItem" - } - } - } - } - } - } -}; - -export const ManagementGroupAggregatedCostResult: msRest.CompositeMapper = { - serializedName: "ManagementGroupAggregatedCostResult", - type: { - name: "Composite", - className: "ManagementGroupAggregatedCostResult", - modelProperties: { - ...Resource.type.modelProperties, - billingPeriodId: { + term: { + serializedName: "properties.term", readOnly: true, - serializedName: "properties.billingPeriodId", type: { name: "String" } }, - usageStart: { + costWithNoReservedInstances: { + serializedName: "properties.costWithNoReservedInstances", readOnly: true, - serializedName: "properties.usageStart", type: { - name: "DateTime" + name: "Number" } }, - usageEnd: { + recommendedQuantity: { + serializedName: "properties.recommendedQuantity", readOnly: true, - serializedName: "properties.usageEnd", type: { - name: "DateTime" + name: "Number" } }, - azureCharges: { + totalCostWithReservedInstances: { + serializedName: "properties.totalCostWithReservedInstances", readOnly: true, - serializedName: "properties.azureCharges", type: { name: "Number" } }, - marketplaceCharges: { + netSavings: { + serializedName: "properties.netSavings", readOnly: true, - serializedName: "properties.marketplaceCharges", type: { name: "Number" } }, - chargesBilledSeparately: { + firstUsageDate: { + serializedName: "properties.firstUsageDate", readOnly: true, - serializedName: "properties.chargesBilledSeparately", type: { - name: "Number" + name: "DateTime" } }, - currency: { + scope: { + serializedName: "properties.scope", readOnly: true, - serializedName: "properties.currency", type: { name: "String" } }, - children: { - serializedName: "properties.children", + skuProperties: { + serializedName: "properties.skuProperties", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ManagementGroupAggregatedCostResult" - } - } - } - }, - includedSubscriptions: { - serializedName: "properties.includedSubscriptions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - excludedSubscriptions: { - serializedName: "properties.excludedSubscriptions", - type: { - name: "Sequence", - element: { - type: { - name: "String" + className: "SkuProperty" } } } @@ -1640,275 +4034,191 @@ export const ManagementGroupAggregatedCostResult: msRest.CompositeMapper = { } }; -export const ChargeSummary: msRest.CompositeMapper = { - serializedName: "ChargeSummary", +export const ModernReservationRecommendation: coreClient.CompositeMapper = { + serializedName: "modern", type: { name: "Composite", - className: "ChargeSummary", + className: "ModernReservationRecommendation", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - ...Resource.type.modelProperties, - billingPeriodId: { + ...ReservationRecommendation.type.modelProperties, + locationPropertiesLocation: { + serializedName: "properties.location", readOnly: true, - serializedName: "properties.billingPeriodId", type: { name: "String" } }, - usageStart: { + lookBackPeriod: { + serializedName: "properties.lookBackPeriod", readOnly: true, - serializedName: "properties.usageStart", type: { - name: "String" + name: "Number" } }, - usageEnd: { + instanceFlexibilityRatio: { + serializedName: "properties.instanceFlexibilityRatio", readOnly: true, - serializedName: "properties.usageEnd", type: { - name: "String" + name: "Number" } }, - azureCharges: { + instanceFlexibilityGroup: { + serializedName: "properties.instanceFlexibilityGroup", readOnly: true, - serializedName: "properties.azureCharges", type: { - name: "Number" + name: "String" } }, - chargesBilledSeparately: { + normalizedSize: { + serializedName: "properties.normalizedSize", readOnly: true, - serializedName: "properties.chargesBilledSeparately", type: { - name: "Number" + name: "String" } }, - marketplaceCharges: { + recommendedQuantityNormalized: { + serializedName: "properties.recommendedQuantityNormalized", readOnly: true, - serializedName: "properties.marketplaceCharges", type: { name: "Number" } }, - currency: { + meterId: { + serializedName: "properties.meterId", readOnly: true, - serializedName: "properties.currency", type: { - name: "String" + name: "Uuid" } - } - } - } -}; - -export const ChargesListResult: msRest.CompositeMapper = { - serializedName: "ChargesListResult", - type: { - name: "Composite", - className: "ChargesListResult", - modelProperties: { - value: { + }, + term: { + serializedName: "properties.term", readOnly: true, - serializedName: "value", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ChargeSummary" - } - } + name: "String" } - } - } - } -}; - -export const ErrorDetails: msRest.CompositeMapper = { - serializedName: "ErrorDetails", - type: { - name: "Composite", - className: "ErrorDetails", - modelProperties: { - code: { - readOnly: true, - serializedName: "code", + }, + costWithNoReservedInstances: { + serializedName: "properties.costWithNoReservedInstances", type: { - name: "String" + name: "Composite", + className: "Amount" } }, - message: { + recommendedQuantity: { + serializedName: "properties.recommendedQuantity", readOnly: true, - serializedName: "message", type: { - name: "String" + name: "Number" } - } - } - } -}; - -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", + }, + totalCostWithReservedInstances: { + serializedName: "properties.totalCostWithReservedInstances", type: { - name: "Composite", - className: "ErrorDetails" - } - } - } - } -}; - -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", + name: "Composite", + className: "Amount" + } + }, + netSavings: { + serializedName: "properties.netSavings", type: { - name: "String" + name: "Composite", + className: "Amount" } }, - resource: { + firstUsageDate: { + serializedName: "properties.firstUsageDate", readOnly: true, - serializedName: "resource", type: { - name: "String" + name: "DateTime" } }, - operation: { + scope: { + serializedName: "properties.scope", readOnly: true, - serializedName: "operation", type: { name: "String" } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { + }, + skuProperties: { + serializedName: "properties.skuProperties", readOnly: true, - serializedName: "name", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuProperty" + } + } } }, - display: { - serializedName: "display", + skuName: { + serializedName: "properties.skuName", + readOnly: true, type: { - name: "Composite", - className: "OperationDisplay" + name: "String" } } } } }; -export const ResourceAttributes: msRest.CompositeMapper = { - serializedName: "ResourceAttributes", +export const LegacyChargeSummary: coreClient.CompositeMapper = { + serializedName: "legacy", type: { name: "Composite", - className: "ResourceAttributes", + className: "LegacyChargeSummary", + uberParent: "ProxyResource", + polymorphicDiscriminator: ProxyResource.type.polymorphicDiscriminator, modelProperties: { - location: { + ...ChargeSummary.type.modelProperties, + billingPeriodId: { + serializedName: "properties.billingPeriodId", readOnly: true, - serializedName: "location", type: { name: "String" } }, - sku: { + usageStart: { + serializedName: "properties.usageStart", readOnly: true, - serializedName: "sku", type: { name: "String" } - } - } - } -}; - -export const QueryOptions: msRest.CompositeMapper = { - type: { - name: "Composite", - className: "QueryOptions", - modelProperties: { - apply: { + }, + usageEnd: { + serializedName: "properties.usageEnd", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const UsageDetailsListResult: msRest.CompositeMapper = { - serializedName: "UsageDetailsListResult", - type: { - name: "Composite", - className: "UsageDetailsListResult", - modelProperties: { - value: { + }, + azureCharges: { + serializedName: "properties.azureCharges", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UsageDetail" - } - } + name: "Number" } }, - nextLink: { + chargesBilledSeparately: { + serializedName: "properties.chargesBilledSeparately", readOnly: true, - serializedName: "nextLink", type: { - name: "String" + name: "Number" } - } - } - } -}; - -export const MarketplacesListResult: msRest.CompositeMapper = { - serializedName: "MarketplacesListResult", - type: { - name: "Composite", - className: "MarketplacesListResult", - modelProperties: { - value: { + }, + marketplaceCharges: { + serializedName: "properties.marketplaceCharges", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Marketplace" - } - } + name: "Number" } }, - nextLink: { + currency: { + serializedName: "properties.currency", readOnly: true, - serializedName: "nextLink", type: { name: "String" } @@ -1917,175 +4227,112 @@ export const MarketplacesListResult: msRest.CompositeMapper = { } }; -export const ReservationSummariesListResult: msRest.CompositeMapper = { - serializedName: "ReservationSummariesListResult", +export const ModernChargeSummary: coreClient.CompositeMapper = { + serializedName: "modern", type: { name: "Composite", - className: "ReservationSummariesListResult", + className: "ModernChargeSummary", + uberParent: "ProxyResource", + polymorphicDiscriminator: ProxyResource.type.polymorphicDiscriminator, modelProperties: { - value: { + ...ChargeSummary.type.modelProperties, + billingPeriodId: { + serializedName: "properties.billingPeriodId", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReservationSummary" - } - } + name: "String" } }, - nextLink: { + usageStart: { + serializedName: "properties.usageStart", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const ReservationDetailsListResult: msRest.CompositeMapper = { - serializedName: "ReservationDetailsListResult", - type: { - name: "Composite", - className: "ReservationDetailsListResult", - modelProperties: { - value: { + }, + usageEnd: { + serializedName: "properties.usageEnd", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReservationDetail" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + azureCharges: { + serializedName: "properties.azureCharges", type: { - name: "String" + name: "Composite", + className: "Amount" } - } - } - } -}; - -export const ReservationRecommendationsListResult: msRest.CompositeMapper = { - serializedName: "ReservationRecommendationsListResult", - type: { - name: "Composite", - className: "ReservationRecommendationsListResult", - modelProperties: { - value: { + }, + chargesBilledSeparately: { + serializedName: "properties.chargesBilledSeparately", + type: { + name: "Composite", + className: "Amount" + } + }, + marketplaceCharges: { + serializedName: "properties.marketplaceCharges", + type: { + name: "Composite", + className: "Amount" + } + }, + billingAccountId: { + serializedName: "properties.billingAccountId", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReservationRecommendation" - } - } + name: "String" } }, - nextLink: { + billingProfileId: { + serializedName: "properties.billingProfileId", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const BudgetsListResult: msRest.CompositeMapper = { - serializedName: "BudgetsListResult", - type: { - name: "Composite", - className: "BudgetsListResult", - modelProperties: { - value: { + }, + invoiceSectionId: { + serializedName: "properties.invoiceSectionId", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Budget" - } - } + name: "String" } }, - nextLink: { + customerId: { + serializedName: "properties.customerId", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const ForecastsListResult: msRest.CompositeMapper = { - serializedName: "ForecastsListResult", - type: { - name: "Composite", - className: "ForecastsListResult", - modelProperties: { - value: { + }, + isInvoiced: { + serializedName: "properties.isInvoiced", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Forecast" - } - } + name: "Boolean" } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const LegacyReservationTransaction: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "LegacyReservationTransaction", modelProperties: { - value: { - readOnly: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } - } + ...ReservationTransaction.type.modelProperties } } }; + +export let discriminators = { + "Resource.UsageDetail": UsageDetail, + "Resource.ReservationRecommendation": ReservationRecommendation, + "ProxyResource.ChargeSummary": ChargeSummary, + "Resource.legacy": LegacyReservationRecommendation, + "Resource.modern": ModernReservationRecommendation, + "ProxyResource.legacy": LegacyChargeSummary, + "ProxyResource.modern": ModernChargeSummary +}; diff --git a/sdk/consumption/arm-consumption/src/models/marketplacesMappers.ts b/sdk/consumption/arm-consumption/src/models/marketplacesMappers.ts deleted file mode 100644 index 2236243f41ac..000000000000 --- a/sdk/consumption/arm-consumption/src/models/marketplacesMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MarketplacesListResult, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/operationsMappers.ts b/sdk/consumption/arm-consumption/src/models/operationsMappers.ts deleted file mode 100644 index 1503eabc4389..000000000000 --- a/sdk/consumption/arm-consumption/src/models/operationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - ErrorResponse, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/parameters.ts b/sdk/consumption/arm-consumption/src/models/parameters.ts index c1813e59d7a5..d3cccb1067c2 100644 --- a/sdk/consumption/arm-consumption/src/models/parameters.ts +++ b/sdk/consumption/arm-consumption/src/models/parameters.ts @@ -3,219 +3,369 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { Budget as BudgetMapper } from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: "en-US", + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const scope: OperationURLParameter = { + parameterPath: "scope", mapper: { + serializedName: "scope", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; + +export const skiptoken: OperationQueryParameter = { + parameterPath: ["options", "skiptoken"], + mapper: { + serializedName: "$skiptoken", + type: { + name: "String" + } + } +}; + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], + mapper: { + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 1 + }, + serializedName: "$top", + type: { + name: "Number" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-10-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const apply: msRest.OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "apply"], + +export const metric: OperationQueryParameter = { + parameterPath: ["options", "metric"], mapper: { - serializedName: "$apply", + serializedName: "metric", type: { name: "String" } } }; -export const billingAccountId: msRest.OperationURLParameter = { - parameterPath: "billingAccountId", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const budgetName: OperationURLParameter = { + parameterPath: "budgetName", + mapper: { + serializedName: "budgetName", required: true, - serializedName: "billingAccountId", type: { name: "String" } } }; -export const billingPeriodName: msRest.OperationURLParameter = { - parameterPath: "billingPeriodName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: BudgetMapper +}; + +export const startDate: OperationQueryParameter = { + parameterPath: ["options", "startDate"], mapper: { + serializedName: "startDate", + type: { + name: "String" + } + } +}; + +export const endDate: OperationQueryParameter = { + parameterPath: ["options", "endDate"], + mapper: { + serializedName: "endDate", + type: { + name: "String" + } + } +}; + +export const apply: OperationQueryParameter = { + parameterPath: ["options", "apply"], + mapper: { + serializedName: "$apply", + type: { + name: "String" + } + } +}; + +export const billingAccountId: OperationURLParameter = { + parameterPath: "billingAccountId", + mapper: { + serializedName: "billingAccountId", required: true, - serializedName: "billingPeriodName", type: { name: "String" } } }; -export const billingProfileId: msRest.OperationURLParameter = { - parameterPath: "billingProfileId", + +export const billingPeriodName: OperationURLParameter = { + parameterPath: "billingPeriodName", mapper: { + serializedName: "billingPeriodName", required: true, - serializedName: "billingProfileId", type: { name: "String" } } }; -export const budgetName: msRest.OperationURLParameter = { - parameterPath: "budgetName", + +export const reservationOrderId: OperationURLParameter = { + parameterPath: "reservationOrderId", mapper: { + serializedName: "reservationOrderId", required: true, - serializedName: "budgetName", type: { name: "String" } } }; -export const departmentId: msRest.OperationURLParameter = { - parameterPath: "departmentId", + +export const grain: OperationQueryParameter = { + parameterPath: "grain", mapper: { + serializedName: "grain", required: true, - serializedName: "departmentId", type: { name: "String" } } }; -export const enrollmentAccountId: msRest.OperationURLParameter = { - parameterPath: "enrollmentAccountId", + +export const reservationId: OperationURLParameter = { + parameterPath: "reservationId", mapper: { + serializedName: "reservationId", required: true, - serializedName: "enrollmentAccountId", type: { name: "String" } } }; -export const expand: msRest.OperationQueryParameter = { - parameterPath: ["options", "expand"], + +export const reservationId1: OperationQueryParameter = { + parameterPath: ["options", "reservationId"], mapper: { - serializedName: "$expand", + serializedName: "reservationId", type: { name: "String" } } }; -export const filter0: msRest.OperationQueryParameter = { - parameterPath: ["options", "filter"], + +export const reservationOrderId1: OperationQueryParameter = { + parameterPath: ["options", "reservationOrderId"], mapper: { - serializedName: "$filter", + serializedName: "reservationOrderId", type: { name: "String" } } }; -export const filter1: msRest.OperationQueryParameter = { + +export const filter1: OperationQueryParameter = { parameterPath: "filter", mapper: { - required: true, serializedName: "$filter", + required: true, type: { name: "String" } } }; -export const grain: msRest.OperationQueryParameter = { - parameterPath: "grain", + +export const region: OperationQueryParameter = { + parameterPath: "region", mapper: { + serializedName: "region", required: true, - serializedName: "grain", type: { name: "String" } } }; -export const managementGroupId: msRest.OperationURLParameter = { - parameterPath: "managementGroupId", + +export const term: OperationQueryParameter = { + parameterPath: "term", mapper: { + serializedName: "term", required: true, - serializedName: "managementGroupId", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const lookBackPeriod: OperationQueryParameter = { + parameterPath: "lookBackPeriod", mapper: { + serializedName: "lookBackPeriod", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const reservationId: msRest.OperationURLParameter = { - parameterPath: "reservationId", + +export const product: OperationQueryParameter = { + parameterPath: "product", mapper: { + serializedName: "product", required: true, - serializedName: "reservationId", type: { name: "String" } } }; -export const reservationOrderId: msRest.OperationURLParameter = { - parameterPath: "reservationOrderId", + +export const billingProfileId: OperationURLParameter = { + parameterPath: "billingProfileId", mapper: { + serializedName: "billingProfileId", required: true, - serializedName: "reservationOrderId", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const skiptoken: msRest.OperationQueryParameter = { - parameterPath: ["options", "skiptoken"], + +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", mapper: { - serializedName: "$skiptoken", + serializedName: "managementGroupId", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const startDate1: OperationQueryParameter = { + parameterPath: "startDate", mapper: { + serializedName: "startDate", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: ["options", "top"], + +export const endDate1: OperationQueryParameter = { + parameterPath: "endDate", mapper: { - serializedName: "$top", - constraints: { - InclusiveMaximum: 1000, - InclusiveMinimum: 1 - }, + serializedName: "endDate", + required: true, type: { - name: "Number" + name: "String" } } }; diff --git a/sdk/consumption/arm-consumption/src/models/priceSheetMappers.ts b/sdk/consumption/arm-consumption/src/models/priceSheetMappers.ts deleted file mode 100644 index 70a8fb00f854..000000000000 --- a/sdk/consumption/arm-consumption/src/models/priceSheetMappers.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/reservationRecommendationsMappers.ts b/sdk/consumption/arm-consumption/src/models/reservationRecommendationsMappers.ts deleted file mode 100644 index 6f98170189c0..000000000000 --- a/sdk/consumption/arm-consumption/src/models/reservationRecommendationsMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - ErrorResponse, - ReservationRecommendation, - ReservationRecommendationsListResult -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/reservationsDetailsMappers.ts b/sdk/consumption/arm-consumption/src/models/reservationsDetailsMappers.ts deleted file mode 100644 index 563c5ea25813..000000000000 --- a/sdk/consumption/arm-consumption/src/models/reservationsDetailsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationDetailsListResult, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/reservationsSummariesMappers.ts b/sdk/consumption/arm-consumption/src/models/reservationsSummariesMappers.ts deleted file mode 100644 index dd4d32b87905..000000000000 --- a/sdk/consumption/arm-consumption/src/models/reservationsSummariesMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummariesListResult, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/tagsMappers.ts b/sdk/consumption/arm-consumption/src/models/tagsMappers.ts deleted file mode 100644 index 70a8fb00f854..000000000000 --- a/sdk/consumption/arm-consumption/src/models/tagsMappers.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/tenantsMappers.ts b/sdk/consumption/arm-consumption/src/models/tenantsMappers.ts deleted file mode 100644 index f8edf5d24d07..000000000000 --- a/sdk/consumption/arm-consumption/src/models/tenantsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - TenantListResult, - UsageDetail -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/models/usageDetailsMappers.ts b/sdk/consumption/arm-consumption/src/models/usageDetailsMappers.ts deleted file mode 100644 index 02f1b9ed4f4e..000000000000 --- a/sdk/consumption/arm-consumption/src/models/usageDetailsMappers.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Balance, - BalancePropertiesAdjustmentDetailsItem, - BalancePropertiesNewPurchasesDetailsItem, - BaseResource, - Budget, - BudgetTimePeriod, - ChargeSummary, - CurrentSpend, - ErrorDetails, - ErrorResponse, - Filters, - Forecast, - ForecastPropertiesConfidenceLevelsItem, - ManagementGroupAggregatedCostResult, - Marketplace, - MeterDetails, - Notification, - PriceSheetProperties, - PriceSheetResult, - ProxyResource, - ReservationDetail, - ReservationSummary, - Resource, - Tag, - TagsResult, - Tenant, - UsageDetail, - UsageDetailsListResult -} from "../models/mappers"; diff --git a/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts b/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts index a3a6ccdbbba0..3c7e7b24ad40 100644 --- a/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts +++ b/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts @@ -3,72 +3,47 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/aggregatedCostMappers"; +import { AggregatedCost } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + AggregatedCostGetByManagementGroupOptionalParams, + AggregatedCostGetByManagementGroupResponse, + AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams, + AggregatedCostGetForBillingPeriodByManagementGroupResponse +} from "../models"; -/** Class representing a AggregatedCost. */ -export class AggregatedCost { +/** Class containing AggregatedCost operations. */ +export class AggregatedCostImpl implements AggregatedCost { private readonly client: ConsumptionManagementClientContext; /** - * Create a AggregatedCost. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AggregatedCost class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Provides the aggregate cost of a management group and all child management groups by current - * billing period. + * Provides the aggregate cost of a management group and all child management groups by current billing + * period. * @param managementGroupId Azure Management Group ID. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ getByManagementGroup( managementGroupId: string, - options?: Models.AggregatedCostGetByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param callback The callback - */ - getByManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param options The optional parameters - * @param callback The callback - */ - getByManagementGroup( - managementGroupId: string, - options: Models.AggregatedCostGetByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - getByManagementGroup( - managementGroupId: string, - options?: - | Models.AggregatedCostGetByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: AggregatedCostGetByManagementGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - managementGroupId, - options - }, - getByManagementGroupOperationSpec, - callback - ) as Promise; + { managementGroupId, options }, + getByManagementGroupOperationSpec + ); } /** @@ -76,65 +51,26 @@ export class AggregatedCost { * billing period * @param managementGroupId Azure Management Group ID. * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - getForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param callback The callback + * @param options The options parameters. */ getForBillingPeriodByManagementGroup( managementGroupId: string, billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - getForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - managementGroupId, - billingPeriodName, - options - }, - getForBillingPeriodByManagementGroupOperationSpec, - callback - ) as Promise; + { managementGroupId, billingPeriodName, options }, + getForBillingPeriodByManagementGroupOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getByManagementGroupOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost", - urlParameters: [Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ManagementGroupAggregatedCostResult @@ -143,16 +79,15 @@ const getByManagementGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.managementGroupId], + headerParameters: [Parameters.accept], serializer }; - -const getForBillingPeriodByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getForBillingPeriodByManagementGroupOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedcost", - urlParameters: [Parameters.managementGroupId, Parameters.billingPeriodName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ManagementGroupAggregatedCostResult @@ -161,5 +96,12 @@ const getForBillingPeriodByManagementGroupOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingPeriodName, + Parameters.managementGroupId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/balances.ts b/sdk/consumption/arm-consumption/src/operations/balances.ts index 43c18bd38cbf..f14871fbfe93 100644 --- a/sdk/consumption/arm-consumption/src/operations/balances.ts +++ b/sdk/consumption/arm-consumption/src/operations/balances.ts @@ -3,70 +3,47 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/balancesMappers"; +import { Balances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + BalancesGetByBillingAccountOptionalParams, + BalancesGetByBillingAccountResponse, + BalancesGetForBillingPeriodByBillingAccountOptionalParams, + BalancesGetForBillingPeriodByBillingAccountResponse +} from "../models"; -/** Class representing a Balances. */ -export class Balances { +/** Class containing Balances operations. */ +export class BalancesImpl implements Balances { private readonly client: ConsumptionManagementClientContext; /** - * Create a Balances. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Balances class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Gets the balances for a scope by billingAccountId. Balances are available via this API only for - * May 1, 2014 or later. + * Gets the balances for a scope by billingAccountId. Balances are available via this API only for May + * 1, 2014 or later. * @param billingAccountId BillingAccount ID - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ getByBillingAccount( billingAccountId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param callback The callback - */ - getByBillingAccount( - billingAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param options The optional parameters - * @param callback The callback - */ - getByBillingAccount( - billingAccountId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getByBillingAccount( - billingAccountId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: BalancesGetByBillingAccountOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingAccountId, - options - }, - getByBillingAccountOperationSpec, - callback - ) as Promise; + { billingAccountId, options }, + getByBillingAccountOperationSpec + ); } /** @@ -74,63 +51,26 @@ export class Balances { * this API only for May 1, 2014 or later. * @param billingAccountId BillingAccount ID * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - getForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - getForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ getForBillingPeriodByBillingAccount( billingAccountId: string, billingPeriodName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: BalancesGetForBillingPeriodByBillingAccountOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingAccountId, - billingPeriodName, - options - }, - getForBillingPeriodByBillingAccountOperationSpec, - callback - ) as Promise; + { billingAccountId, billingPeriodName, options }, + getForBillingPeriodByBillingAccountOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getByBillingAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances", - urlParameters: [Parameters.billingAccountId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Balance @@ -139,16 +79,15 @@ const getByBillingAccountOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountId], + headerParameters: [Parameters.accept], serializer }; - -const getForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getForBillingPeriodByBillingAccountOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances", - urlParameters: [Parameters.billingAccountId, Parameters.billingPeriodName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Balance @@ -157,5 +96,12 @@ const getForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingPeriodName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/budgets.ts b/sdk/consumption/arm-consumption/src/operations/budgets.ts index 2104fe889d95..14d5d108ec9d 100644 --- a/sdk/consumption/arm-consumption/src/operations/budgets.ts +++ b/sdk/consumption/arm-consumption/src/operations/budgets.ts @@ -3,505 +3,252 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/budgetsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Budgets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + Budget, + BudgetsListNextOptionalParams, + BudgetsListOptionalParams, + BudgetsListResponse, + BudgetsGetOptionalParams, + BudgetsGetResponse, + BudgetsCreateOrUpdateOptionalParams, + BudgetsCreateOrUpdateResponse, + BudgetsDeleteOptionalParams, + BudgetsListNextResponse +} from "../models"; -/** Class representing a Budgets. */ -export class Budgets { +/// +/** Class containing Budgets operations. */ +export class BudgetsImpl implements Budgets { private readonly client: ConsumptionManagementClientContext; /** - * Create a Budgets. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Budgets class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Lists all budgets for a subscription. - * @param [options] The optional parameters - * @returns Promise + * Lists all budgets for the defined scope. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options + public list( + scope: string, + options?: BudgetsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); }, - listOperationSpec, - callback - ) as Promise; - } - - /** - * Lists all budgets for a resource group under a subscription. - * @param resourceGroupName Azure Resource Group Name. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupName( - resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param callback The callback - */ - listByResourceGroupName( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroupName( - resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroupName( - resourceGroupName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options + [Symbol.asyncIterator]() { + return this; }, - listByResourceGroupNameOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(scope, options); + } + }; } - /** - * Gets the budget for a subscription by budget name. - * @param budgetName Budget Name. - * @param [options] The optional parameters - * @returns Promise - */ - get(budgetName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param budgetName Budget Name. - * @param callback The callback - */ - get(budgetName: string, callback: msRest.ServiceCallback): void; - /** - * @param budgetName Budget Name. - * @param options The optional parameters - * @param callback The callback - */ - get( - budgetName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - budgetName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - budgetName, - options - }, - getOperationSpec, - callback - ) as Promise; + private async *listPagingPage( + scope: string, + options?: BudgetsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * 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 budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate( - budgetName: string, - parameters: Models.Budget, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param callback The callback - */ - createOrUpdate( - budgetName: string, - parameters: Models.Budget, - callback: msRest.ServiceCallback - ): void; - /** - * @param budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate( - budgetName: string, - parameters: Models.Budget, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdate( - budgetName: string, - parameters: Models.Budget, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - budgetName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback - ) as Promise; + private async *listPagingAll( + scope: string, + options?: BudgetsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } } /** - * The operation to delete a budget. - * @param budgetName Budget Name. - * @param [options] The optional parameters - * @returns Promise + * Lists all budgets for the defined scope. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param options The options parameters. */ - deleteMethod( - budgetName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param budgetName Budget Name. - * @param callback The callback - */ - deleteMethod(budgetName: string, callback: msRest.ServiceCallback): void; - /** - * @param budgetName Budget Name. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod( - budgetName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteMethod( - budgetName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _list( + scope: string, + options?: BudgetsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - budgetName, - options - }, - deleteMethodOperationSpec, - callback + { scope, options }, + listOperationSpec ); } /** - * Gets the budget for a resource group under a subscription by budget name. - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param [options] The optional parameters - * @returns Promise - */ - getByResourceGroupName( - resourceGroupName: string, - budgetName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName Azure Resource Group Name. + * Gets the budget for the scope by budget name. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. * @param budgetName Budget Name. - * @param callback The callback + * @param options The options parameters. */ - getByResourceGroupName( - resourceGroupName: string, - budgetName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param options The optional parameters - * @param callback The callback - */ - getByResourceGroupName( - resourceGroupName: string, - budgetName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getByResourceGroupName( - resourceGroupName: string, + get( + scope: string, budgetName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: BudgetsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - budgetName, - options - }, - getByResourceGroupNameOperationSpec, - callback - ) as Promise; + { scope, budgetName, options }, + getOperationSpec + ); } /** - * 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 resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateByResourceGroupName( - resourceGroupName: string, - budgetName: string, - parameters: Models.Budget, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName Azure Resource Group Name. + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form + * of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior + * to your put operation. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. - * @param callback The callback + * @param options The options parameters. */ - createOrUpdateByResourceGroupName( - resourceGroupName: string, - budgetName: string, - parameters: Models.Budget, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param parameters Parameters supplied to the Create Budget operation. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdateByResourceGroupName( - resourceGroupName: string, - budgetName: string, - parameters: Models.Budget, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdateByResourceGroupName( - resourceGroupName: string, + createOrUpdate( + scope: string, budgetName: string, - parameters: Models.Budget, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + parameters: Budget, + options?: BudgetsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - budgetName, - parameters, - options - }, - createOrUpdateByResourceGroupNameOperationSpec, - callback - ) as Promise; + { scope, budgetName, parameters, options }, + createOrUpdateOperationSpec + ); } /** * The operation to delete a budget. - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteByResourceGroupName( - resourceGroupName: string, - budgetName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName Azure Resource Group Name. - * @param budgetName Budget Name. - * @param callback The callback - */ - deleteByResourceGroupName( - resourceGroupName: string, - budgetName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName Azure Resource Group Name. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. * @param budgetName Budget Name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteByResourceGroupName( - resourceGroupName: string, - budgetName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteByResourceGroupName( - resourceGroupName: string, + delete( + scope: string, budgetName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: BudgetsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - budgetName, - options - }, - deleteByResourceGroupNameOperationSpec, - callback + { scope, budgetName, options }, + deleteOperationSpec ); } /** - * Lists all budgets for a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListNext + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + scope: string, + nextLink: string, + options?: BudgetsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; - } - - /** - * Lists all budgets for a resource group under a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNameNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNameNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroupNameNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroupNameNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNameNextOperationSpec, - callback - ) as Promise; + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.BudgetsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByResourceGroupNameOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/budgets", httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.BudgetsListResult @@ -510,75 +257,14 @@ const listByResourceGroupNameOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.Budget - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Budget, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.Budget - }, - 201: { - bodyMapper: Mappers.Budget - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.budgetName], queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const getByResourceGroupNameOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.Budget @@ -587,23 +273,14 @@ const getByResourceGroupNameOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.budgetName], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateByResourceGroupNameOperationSpec: msRest.OperationSpec = { +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Budget, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.Budget @@ -615,50 +292,30 @@ const createOrUpdateByResourceGroupNameOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.budgetName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const deleteByResourceGroupNameOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.budgetName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.BudgetsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope, Parameters.budgetName], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNameNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BudgetsListResult @@ -667,5 +324,8 @@ const listByResourceGroupNameNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/charges.ts b/sdk/consumption/arm-consumption/src/operations/charges.ts index 0b4be641297d..84cf290ccf3e 100644 --- a/sdk/consumption/arm-consumption/src/operations/charges.ts +++ b/sdk/consumption/arm-consumption/src/operations/charges.ts @@ -3,306 +3,64 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/chargesMappers"; +import { Charges } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ChargesListOptionalParams, ChargesListResponse } from "../models"; -/** Class representing a Charges. */ -export class Charges { +/** Class containing Charges operations. */ +export class ChargesImpl implements Charges { private readonly client: ConsumptionManagementClientContext; /** - * Create a Charges. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Charges class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Lists the charges by enrollmentAccountId. - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param [options] The optional parameters - * @returns Promise + * Lists the charges based for the defined scope. + * @param scope The scope associated with charges operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period + * to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to + * specify billing period at department scope use + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. */ - listByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - options?: Models.ChargesListByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param callback The callback - */ - listByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - options: Models.ChargesListByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - options?: - | Models.ChargesListByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list( + scope: string, + options?: ChargesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingAccountId, - enrollmentAccountId, - options - }, - listByEnrollmentAccountOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the charges based on enrollmentAccountId by billing period. - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - billingPeriodName: string, - options?: Models.ChargesListForBillingPeriodByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - billingPeriodName: string, - options: Models.ChargesListForBillingPeriodByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccount( - billingAccountId: string, - enrollmentAccountId: string, - billingPeriodName: string, - options?: - | Models.ChargesListForBillingPeriodByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - enrollmentAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByEnrollmentAccountOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the charges by departmentId. - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartment( - billingAccountId: string, - departmentId: string, - options?: Models.ChargesListByDepartmentOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param callback The callback - */ - listByDepartment( - billingAccountId: string, - departmentId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param options The optional parameters - * @param callback The callback - */ - listByDepartment( - billingAccountId: string, - departmentId: string, - options: Models.ChargesListByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartment( - billingAccountId: string, - departmentId: string, - options?: - | Models.ChargesListByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - departmentId, - options - }, - listByDepartmentOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the charges based on departmentId by billing period. - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartment( - billingAccountId: string, - departmentId: string, - billingPeriodName: string, - options?: Models.ChargesListForBillingPeriodByDepartmentOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByDepartment( - billingAccountId: string, - departmentId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartment( - billingAccountId: string, - departmentId: string, - billingPeriodName: string, - options: Models.ChargesListForBillingPeriodByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartment( - billingAccountId: string, - departmentId: string, - billingPeriodName: string, - options?: - | Models.ChargesListForBillingPeriodByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - departmentId, - billingPeriodName, - options - }, - listForBillingPeriodByDepartmentOperationSpec, - callback - ) as Promise; + { scope, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/charges", - urlParameters: [Parameters.billingAccountId, Parameters.enrollmentAccountId], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ChargesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listForBillingPeriodByEnrollmentAccountOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/charges", httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/charges", - urlParameters: [ - Parameters.billingAccountId, - Parameters.enrollmentAccountId, - Parameters.billingPeriodName - ], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ChargeSummary - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Consumption/charges", - urlParameters: [Parameters.billingAccountId, Parameters.departmentId], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ChargesListResult @@ -311,27 +69,14 @@ const listByDepartmentOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listForBillingPeriodByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/charges", - urlParameters: [ - Parameters.billingAccountId, - Parameters.departmentId, - Parameters.billingPeriodName + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.apply ], - queryParameters: [Parameters.apiVersion, Parameters.filter0], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ChargeSummary - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/credits.ts b/sdk/consumption/arm-consumption/src/operations/credits.ts new file mode 100644 index 000000000000..ba7de30ac696 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/credits.ts @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Credits } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { CreditsGetOptionalParams, CreditsGetResponse } from "../models"; + +/** Class containing Credits operations. */ +export class CreditsImpl implements Credits { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class Credits class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * The credit summary by billingAccountId and billingProfileId. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + get( + billingAccountId: string, + billingProfileId: string, + options?: CreditsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CreditSummary + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts b/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts new file mode 100644 index 000000000000..27b8dfbcc29c --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts @@ -0,0 +1,358 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { EventsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + EventSummary, + EventsListByBillingProfileNextOptionalParams, + EventsListByBillingProfileOptionalParams, + EventsListByBillingAccountNextOptionalParams, + EventsListByBillingAccountOptionalParams, + EventsListByBillingProfileResponse, + EventsListByBillingAccountResponse, + EventsListByBillingProfileNextResponse, + EventsListByBillingAccountNextResponse +} from "../models"; + +/// +/** Class containing EventsOperations operations. */ +export class EventsOperationsImpl implements EventsOperations { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class EventsOperations class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param startDate Start date + * @param endDate End date + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountId, + billingProfileId, + startDate, + endDate, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + startDate, + endDate, + options + ); + } + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingProfile( + billingAccountId, + billingProfileId, + startDate, + endDate, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountId, + billingProfileId, + startDate, + endDate, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + startDate, + endDate, + options + )) { + yield* page; + } + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll(billingAccountId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingAccountPagingPage(billingAccountId, options); + } + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingAccount(billingAccountId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountId, + options + )) { + yield* page; + } + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param startDate Start date + * @param endDate End date + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, startDate, endDate, options }, + listByBillingProfileOperationSpec + ); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, options }, + listByBillingAccountOperationSpec + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param startDate Start date + * @param endDate End date + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + nextLink: string, + options?: EventsListByBillingProfileNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountId, + billingProfileId, + startDate, + endDate, + nextLink, + options + }, + listByBillingProfileNextOperationSpec + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountId BillingAccount ID + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountId: string, + nextLink: string, + options?: EventsListByBillingAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, nextLink, options }, + listByBillingAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.startDate1, + Parameters.endDate1 + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/events", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountId], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.startDate1, + Parameters.endDate1 + ], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/forecasts.ts b/sdk/consumption/arm-consumption/src/operations/forecasts.ts deleted file mode 100644 index 4b122284fcfc..000000000000 --- a/sdk/consumption/arm-consumption/src/operations/forecasts.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/forecastsMappers"; -import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; - -/** Class representing a Forecasts. */ -export class Forecasts { - private readonly client: ConsumptionManagementClientContext; - - /** - * Create a Forecasts. - * @param {ConsumptionManagementClientContext} client Reference to the service client. - */ - constructor(client: ConsumptionManagementClientContext) { - this.client = client; - } - - /** - * Lists the forecast charges by subscriptionId. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.ForecastsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.ForecastsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.ForecastsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ForecastsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/consumption/arm-consumption/src/operations/index.ts b/sdk/consumption/arm-consumption/src/operations/index.ts index cb46c500811d..b751ef901317 100644 --- a/sdk/consumption/arm-consumption/src/operations/index.ts +++ b/sdk/consumption/arm-consumption/src/operations/index.ts @@ -3,21 +3,23 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./usageDetails"; export * from "./marketplaces"; +export * from "./budgets"; +export * from "./tags"; +export * from "./charges"; export * from "./balances"; export * from "./reservationsSummaries"; export * from "./reservationsDetails"; export * from "./reservationRecommendations"; -export * from "./budgets"; +export * from "./reservationRecommendationDetails"; +export * from "./reservationTransactions"; export * from "./priceSheet"; -export * from "./tags"; -export * from "./forecasts"; export * from "./operations"; export * from "./aggregatedCost"; -export * from "./charges"; -export * from "./tenants"; +export * from "./eventsOperations"; +export * from "./lotsOperations"; +export * from "./credits"; diff --git a/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts new file mode 100644 index 000000000000..29761c54ad5b --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts @@ -0,0 +1,321 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { LotsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + LotSummary, + LotsListByBillingProfileNextOptionalParams, + LotsListByBillingProfileOptionalParams, + LotsListByBillingAccountNextOptionalParams, + LotsListByBillingAccountOptionalParams, + LotsListByBillingProfileResponse, + LotsListByBillingAccountResponse, + LotsListByBillingProfileNextResponse, + LotsListByBillingAccountNextResponse +} from "../models"; + +/// +/** Class containing LotsOperations operations. */ +export class LotsOperationsImpl implements LotsOperations { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class LotsOperations class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountId, + billingProfileId, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + options + ); + } + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingProfile( + billingAccountId, + billingProfileId, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountId, + billingProfileId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + options + )) { + yield* page; + } + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll(billingAccountId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingAccountPagingPage(billingAccountId, options); + } + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingAccount(billingAccountId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountId, + options + )) { + yield* page; + } + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, options }, + listByBillingProfileOperationSpec + ); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, options }, + listByBillingAccountOperationSpec + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountId: string, + billingProfileId: string, + nextLink: string, + options?: LotsListByBillingProfileNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, nextLink, options }, + listByBillingProfileNextOperationSpec + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountId BillingAccount ID + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountId: string, + nextLink: string, + options?: LotsListByBillingAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, nextLink, options }, + listByBillingAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountId], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/marketplaces.ts b/sdk/consumption/arm-consumption/src/operations/marketplaces.ts index 14050e0d2d8c..91d834f18a26 100644 --- a/sdk/consumption/arm-consumption/src/operations/marketplaces.ts +++ b/sdk/consumption/arm-consumption/src/operations/marketplaces.ts @@ -3,1005 +3,152 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/marketplacesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Marketplaces } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; - -/** Class representing a Marketplaces. */ -export class Marketplaces { +import { + Marketplace, + MarketplacesListNextOptionalParams, + MarketplacesListOptionalParams, + MarketplacesListResponse, + MarketplacesListNextResponse +} from "../models"; + +/// +/** Class containing Marketplaces operations. */ +export class MarketplacesImpl implements Marketplaces { private readonly client: ConsumptionManagementClientContext; /** - * Create a Marketplaces. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Marketplaces class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * 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 [options] The optional parameters - * @returns Promise - */ - list(options?: Models.MarketplacesListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.MarketplacesListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.MarketplacesListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the marketplaces for a scope by billing period and subscriptionId. Marketplaces are - * available via this API only for May 1, 2014 or later. - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingPeriod( - billingPeriodName: string, - options?: Models.MarketplacesListByBillingPeriodOptionalParams - ): Promise; - /** - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listByBillingPeriod( - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingPeriod( - billingPeriodName: string, - options: Models.MarketplacesListByBillingPeriodOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingPeriod( - billingPeriodName: string, - options?: - | Models.MarketplacesListByBillingPeriodOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingPeriodName, - options - }, - listByBillingPeriodOperationSpec, - callback - ) as 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 billingAccountId BillingAccount ID - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingAccount( - billingAccountId: string, - options?: Models.MarketplacesListByBillingAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param callback The callback - */ - listByBillingAccount( - billingAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByBillingAccount( - billingAccountId: string, - options: Models.MarketplacesListByBillingAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingAccount( - billingAccountId: string, - options?: - | Models.MarketplacesListByBillingAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - options - }, - listByBillingAccountOperationSpec, - callback - ) as 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 billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: Models.MarketplacesListForBillingPeriodByBillingAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options: Models.MarketplacesListForBillingPeriodByBillingAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: - | Models.MarketplacesListForBillingPeriodByBillingAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByBillingAccountOperationSpec, - callback - ) as 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 departmentId Department ID - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartment( - departmentId: string, - options?: Models.MarketplacesListByDepartmentOptionalParams - ): Promise; - /** - * @param departmentId Department ID - * @param callback The callback - */ - listByDepartment( - departmentId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param departmentId Department ID - * @param options The optional parameters - * @param callback The callback - */ - listByDepartment( - departmentId: string, - options: Models.MarketplacesListByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartment( - departmentId: string, - options?: - | Models.MarketplacesListByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - departmentId, - options - }, - listByDepartmentOperationSpec, - callback - ) as 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 departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options?: Models.MarketplacesListForBillingPeriodByDepartmentOptionalParams - ): Promise; - /** - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options: Models.MarketplacesListForBillingPeriodByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options?: - | Models.MarketplacesListForBillingPeriodByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - departmentId, - billingPeriodName, - options - }, - listForBillingPeriodByDepartmentOperationSpec, - callback - ) as 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 enrollmentAccountId EnrollmentAccount ID - * @param [options] The optional parameters - * @returns Promise - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - options?: Models.MarketplacesListByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param callback The callback - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - options: Models.MarketplacesListByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccount( - enrollmentAccountId: string, - options?: - | Models.MarketplacesListByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - enrollmentAccountId, - options - }, - listByEnrollmentAccountOperationSpec, - callback - ) as 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 enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options?: Models.MarketplacesListForBillingPeriodByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options: Models.MarketplacesListForBillingPeriodByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options?: - | Models.MarketplacesListForBillingPeriodByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - enrollmentAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByEnrollmentAccountOperationSpec, - callback - ) as 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 managementGroupId Azure Management Group ID. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagementGroup( - managementGroupId: string, - options?: Models.MarketplacesListByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param callback The callback - */ - listByManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param options The optional parameters - * @param callback The callback - */ - listByManagementGroup( - managementGroupId: string, - options: Models.MarketplacesListByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroup( - managementGroupId: string, - options?: - | Models.MarketplacesListByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - options - }, - listByManagementGroupOperationSpec, - callback - ) as 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 managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: Models.MarketplacesListForBillingPeriodByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options: Models.MarketplacesListForBillingPeriodByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: - | Models.MarketplacesListForBillingPeriodByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - billingPeriodName, - options - }, - listForBillingPeriodByManagementGroupOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: Models.MarketplacesListNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext( - nextPageLink: string, - options: Models.MarketplacesListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.MarketplacesListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; - } - - /** - * Lists the marketplaces for a scope by billing period and subscriptionId. Marketplaces are - * available via this API only for May 1, 2014 or later. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingPeriodNext( - nextPageLink: string, - options?: Models.MarketplacesListByBillingPeriodNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByBillingPeriodNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingPeriodNext( - nextPageLink: string, - options: Models.MarketplacesListByBillingPeriodNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingPeriodNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByBillingPeriodNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByBillingPeriodNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingAccountNext( - nextPageLink: string, - options?: Models.MarketplacesListByBillingAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByBillingAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingAccountNext( - nextPageLink: string, - options: Models.MarketplacesListByBillingAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingAccountNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByBillingAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByBillingAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options?: Models.MarketplacesListForBillingPeriodByBillingAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options: Models.MarketplacesListForBillingPeriodByBillingAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options?: - | Models.MarketplacesListForBillingPeriodByBillingAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByBillingAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartmentNext( - nextPageLink: string, - options?: Models.MarketplacesListByDepartmentNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDepartmentNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByDepartmentNext( - nextPageLink: string, - options: Models.MarketplacesListByDepartmentNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartmentNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByDepartmentNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDepartmentNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options?: Models.MarketplacesListForBillingPeriodByDepartmentNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options: Models.MarketplacesListForBillingPeriodByDepartmentNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options?: - | Models.MarketplacesListForBillingPeriodByDepartmentNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByDepartmentNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByEnrollmentAccountNext( - nextPageLink: string, - options?: Models.MarketplacesListByEnrollmentAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByEnrollmentAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccountNext( - nextPageLink: string, - options: Models.MarketplacesListByEnrollmentAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccountNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByEnrollmentAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByEnrollmentAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options?: Models.MarketplacesListForBillingPeriodByEnrollmentAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options: Models.MarketplacesListForBillingPeriodByEnrollmentAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options?: - | Models.MarketplacesListForBillingPeriodByEnrollmentAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByEnrollmentAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagementGroupNext( - nextPageLink: string, - options?: Models.MarketplacesListByManagementGroupNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByManagementGroupNext( - nextPageLink: string, - options: Models.MarketplacesListByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroupNext( - nextPageLink: string, - options?: - | Models.MarketplacesListByManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagementGroupNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options?: Models.MarketplacesListForBillingPeriodByManagementGroupNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options: Models.MarketplacesListForBillingPeriodByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options?: - | Models.MarketplacesListForBillingPeriodByManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByManagementGroupNextOperationSpec, - callback - ) as Promise; + * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API + * only for May 1, 2014 or later. + * @param scope The scope associated with marketplace operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and ManagementGroup, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + * @param options The options parameters. + */ + public list( + scope: string, + options?: MarketplacesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scope, options); + } + }; + } + + private async *listPagingPage( + scope: string, + options?: MarketplacesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + options?: MarketplacesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } + } + + /** + * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API + * only for May 1, 2014 or later. + * @param scope The scope associated with marketplace operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and ManagementGroup, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + * @param options The options parameters. + */ + private _list( + scope: string, + options?: MarketplacesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param scope The scope associated with marketplace operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and ManagementGroup, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scope: string, + nextLink: string, + options?: MarketplacesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.subscriptionId], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingPeriodOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/marketplaces", httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.subscriptionId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.MarketplacesListResult @@ -1010,44 +157,19 @@ const listByBillingPeriodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByBillingAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.billingAccountId], queryParameters: [ - Parameters.filter0, - Parameters.top, + Parameters.filter, Parameters.skiptoken, + Parameters.top, Parameters.apiVersion ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const listForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = { +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.billingAccountId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.MarketplacesListResult @@ -1056,373 +178,13 @@ const listForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.departmentId], queryParameters: [ - Parameters.filter0, - Parameters.top, + Parameters.filter, Parameters.skiptoken, + Parameters.top, Parameters.apiVersion ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.departmentId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.enrollmentAccountId], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.enrollmentAccountId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.managementGroupId], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces", - urlParameters: [Parameters.managementGroupId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByBillingPeriodNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByBillingAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByBillingAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByDepartmentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByDepartmentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByEnrollmentAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByEnrollmentAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByManagementGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.filter0, - Parameters.top, - Parameters.skiptoken, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.MarketplacesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/operations.ts b/sdk/consumption/arm-consumption/src/operations/operations.ts index ba8bbd16333f..e06f354b8e36 100644 --- a/sdk/consumption/arm-consumption/src/operations/operations.ts +++ b/sdk/consumption/arm-consumption/src/operations/operations.ts @@ -3,23 +3,31 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { private readonly client: ConsumptionManagementClientContext; /** - * Create a Operations. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; @@ -27,86 +35,77 @@ export class Operations { /** * Lists all of the available consumption REST API operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists all of the available consumption REST API operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Consumption/operations", httpMethod: "GET", - path: "providers/Microsoft.Consumption/operations", - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -115,16 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -133,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/priceSheet.ts b/sdk/consumption/arm-consumption/src/operations/priceSheet.ts index 6486e0e32bdf..7f1f87b93f3a 100644 --- a/sdk/consumption/arm-consumption/src/operations/priceSheet.ts +++ b/sdk/consumption/arm-consumption/src/operations/priceSheet.ts @@ -3,115 +3,65 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/priceSheetMappers"; +import { PriceSheet } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + PriceSheetGetOptionalParams, + PriceSheetGetResponse, + PriceSheetGetByBillingPeriodOptionalParams, + PriceSheetGetByBillingPeriodResponse +} from "../models"; -/** Class representing a PriceSheet. */ -export class PriceSheet { +/** Class containing PriceSheet operations. */ +export class PriceSheetImpl implements PriceSheet { private readonly client: ConsumptionManagementClientContext; /** - * Create a PriceSheet. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PriceSheet class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only - * for May 1, 2014 or later. - * @param [options] The optional parameters - * @returns Promise + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 + * or later. + * @param options The options parameters. */ - get(options?: Models.PriceSheetGetOptionalParams): Promise; - /** - * @param callback The callback - */ - get(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - get( - options: Models.PriceSheetGetOptionalParams, - callback: msRest.ServiceCallback - ): void; - get( - options?: Models.PriceSheetGetOptionalParams | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - getOperationSpec, - callback - ) as Promise; + get(options?: PriceSheetGetOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, getOperationSpec); } /** - * 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 billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - getByBillingPeriod( - billingPeriodName: string, - options?: Models.PriceSheetGetByBillingPeriodOptionalParams - ): 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. * @param billingPeriodName Billing Period Name. - * @param callback The callback + * @param options The options parameters. */ getByBillingPeriod( billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - getByBillingPeriod( - billingPeriodName: string, - options: Models.PriceSheetGetByBillingPeriodOptionalParams, - callback: msRest.ServiceCallback - ): void; - getByBillingPeriod( - billingPeriodName: string, - options?: - | Models.PriceSheetGetByBillingPeriodOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: PriceSheetGetByBillingPeriodOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingPeriodName, - options - }, - getByBillingPeriodOperationSpec, - callback - ) as Promise; + { billingPeriodName, options }, + getByBillingPeriodOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.expand, Parameters.skiptoken, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.PriceSheetResult @@ -120,16 +70,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.expand, + Parameters.skiptoken, + Parameters.top, + Parameters.apiVersion + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getByBillingPeriodOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getByBillingPeriodOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default", - urlParameters: [Parameters.subscriptionId, Parameters.billingPeriodName], - queryParameters: [Parameters.expand, Parameters.skiptoken, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PriceSheetResult @@ -138,5 +92,17 @@ const getByBillingPeriodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.expand, + Parameters.skiptoken, + Parameters.top, + Parameters.apiVersion + ], + urlParameters: [ + Parameters.$host, + Parameters.billingPeriodName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts b/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts new file mode 100644 index 000000000000..b8aaa6b5a949 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { ReservationRecommendationDetails } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + Term, + LookBackPeriod, + ReservationRecommendationDetailsGetOptionalParams, + ReservationRecommendationDetailsGetResponse +} from "../models"; + +/** Class containing ReservationRecommendationDetails operations. */ +export class ReservationRecommendationDetailsImpl + implements ReservationRecommendationDetails { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class ReservationRecommendationDetails class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * Details of a reservation recommendation for what-if analysis of reserved instances. + * @param scope The scope associated with reservation recommendation details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param region Used to select the region the recommendation should be generated for. + * @param term Specify length of reservation recommendation term. + * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. + * @param product Filter the products for which reservation recommendation results are generated. + * Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + * @param options The options parameters. + */ + get( + scope: string, + region: string, + term: Term, + lookBackPeriod: LookBackPeriod, + product: string, + options?: ReservationRecommendationDetailsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, region, term, lookBackPeriod, product, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationRecommendationDetailsModel + }, + 204: {}, + default: { + bodyMapper: Mappers.HighCasedErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.region, + Parameters.term, + Parameters.lookBackPeriod, + Parameters.product + ], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts b/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts index 0251b1883aff..c4592c3fe5bb 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts @@ -3,23 +3,32 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/reservationRecommendationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ReservationRecommendations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + ReservationRecommendationUnion, + ReservationRecommendationsListNextOptionalParams, + ReservationRecommendationsListOptionalParams, + ReservationRecommendationsListResponse, + ReservationRecommendationsListNextResponse +} from "../models"; -/** Class representing a ReservationRecommendations. */ -export class ReservationRecommendations { +/// +/** Class containing ReservationRecommendations operations. */ +export class ReservationRecommendationsImpl + implements ReservationRecommendations { private readonly client: ConsumptionManagementClientContext; /** - * Create a ReservationRecommendations. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ReservationRecommendations class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; @@ -27,118 +36,131 @@ export class ReservationRecommendations { /** * List of recommendations for purchasing reserved instances. - * @param [options] The optional parameters - * @returns Promise + * @param scope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param options The options parameters. */ - list( - options?: Models.ReservationRecommendationsListOptionalParams - ): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.ReservationRecommendationsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.ReservationRecommendationsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options + public list( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(scope, options); + } + }; + } + + private async *listPagingPage( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } } /** * List of recommendations for purchasing reserved instances. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * @param scope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options?: Models.ReservationRecommendationsListNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + private _list( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param scope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: Models.ReservationRecommendationsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.ReservationRecommendationsListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + scope: string, + nextLink: string, + options?: ReservationRecommendationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/reservationRecommendations", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/reservationRecommendations", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ReservationRecommendationsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationRecommendationsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts b/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts new file mode 100644 index 000000000000..33b2fec8e592 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts @@ -0,0 +1,311 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ReservationTransactions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + ReservationTransaction, + ReservationTransactionsListNextOptionalParams, + ReservationTransactionsListOptionalParams, + ModernReservationTransaction, + ReservationTransactionsListByBillingProfileNextOptionalParams, + ReservationTransactionsListByBillingProfileOptionalParams, + ReservationTransactionsListResponse, + ReservationTransactionsListByBillingProfileResponse, + ReservationTransactionsListNextResponse, + ReservationTransactionsListByBillingProfileNextResponse +} from "../models"; + +/// +/** Class containing ReservationTransactions operations. */ +export class ReservationTransactionsImpl implements ReservationTransactions { + private readonly client: ConsumptionManagementClientContext; + + /** + * Initialize a new instance of the class ReservationTransactions class. + * @param client Reference to the service client + */ + constructor(client: ConsumptionManagementClientContext) { + this.client = client; + } + + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + public list( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(billingAccountId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(billingAccountId, options); + } + }; + } + + private async *listPagingPage( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(billingAccountId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + billingAccountId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(billingAccountId, options)) { + yield* page; + } + } + + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountId, + billingProfileId, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + options + ); + } + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBillingProfile( + billingAccountId, + billingProfileId, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountId, + billingProfileId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountId, + billingProfileId, + options + )) { + yield* page; + } + } + + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + private _list( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, options }, + listOperationSpec + ); + } + + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, options }, + listByBillingProfileOperationSpec + ); + } + + /** + * ListNext + * @param billingAccountId BillingAccount ID + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + billingAccountId: string, + nextLink: string, + options?: ReservationTransactionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountId: string, + billingProfileId: string, + nextLink: string, + options?: ReservationTransactionsListByBillingProfileNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, billingProfileId, nextLink, options }, + listByBillingProfileNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationTransactionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountId], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/reservationTransactions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModernReservationTransactionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationTransactionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModernReservationTransactionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId, + Parameters.billingProfileId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts b/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts index 3f3eb2a7bb59..ed32d2487a8f 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts @@ -3,23 +3,39 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/reservationsDetailsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ReservationsDetails } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + ReservationDetail, + ReservationsDetailsListByReservationOrderNextOptionalParams, + ReservationsDetailsListByReservationOrderOptionalParams, + ReservationsDetailsListByReservationOrderAndReservationNextOptionalParams, + ReservationsDetailsListByReservationOrderAndReservationOptionalParams, + ReservationsDetailsListNextOptionalParams, + ReservationsDetailsListOptionalParams, + ReservationsDetailsListByReservationOrderResponse, + ReservationsDetailsListByReservationOrderAndReservationResponse, + ReservationsDetailsListResponse, + ReservationsDetailsListByReservationOrderNextResponse, + ReservationsDetailsListByReservationOrderAndReservationNextResponse, + ReservationsDetailsListNextResponse +} from "../models"; -/** Class representing a ReservationsDetails. */ -export class ReservationsDetails { +/// +/** Class containing ReservationsDetails operations. */ +export class ReservationsDetailsImpl implements ReservationsDetails { private readonly client: ConsumptionManagementClientContext; /** - * Create a ReservationsDetails. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ReservationsDetails class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; @@ -28,245 +44,336 @@ export class ReservationsDetails { /** * Lists the reservations details for provided date range. * @param reservationOrderId Order Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param [options] The optional parameters - * @returns Promise + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. */ - listByReservationOrder( + public listByReservationOrder( reservationOrderId: string, filter: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param reservationOrderId Order Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param callback The callback - */ - listByReservationOrder( - reservationOrderId: string, - filter: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param reservationOrderId Order Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param options The optional parameters - * @param callback The callback - */ - listByReservationOrder( - reservationOrderId: string, - filter: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByReservationOrder( + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderPagingAll( + reservationOrderId, + filter, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByReservationOrderPagingPage( + reservationOrderId, + filter, + options + ); + } + }; + } + + private async *listByReservationOrderPagingPage( reservationOrderId: string, filter: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): AsyncIterableIterator { + let result = await this._listByReservationOrder( + reservationOrderId, + filter, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByReservationOrderNext( reservationOrderId, filter, + continuationToken, options - }, - listByReservationOrderOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Lists the reservations details for provided date range. - * @param reservationOrderId Order Id of the reservation - * @param reservationId Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param [options] The optional parameters - * @returns Promise - */ - listByReservationOrderAndReservation( - reservationOrderId: string, - reservationId: string, - filter: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param reservationOrderId Order Id of the reservation - * @param reservationId Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param callback The callback - */ - listByReservationOrderAndReservation( + private async *listByReservationOrderPagingAll( reservationOrderId: string, - reservationId: string, filter: string, - callback: msRest.ServiceCallback - ): void; + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderPagingPage( + reservationOrderId, + filter, + options + )) { + yield* page; + } + } + /** + * Lists the reservations details for provided date range. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param options The optional parameters - * @param callback The callback + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. */ - listByReservationOrderAndReservation( + public listByReservationOrderAndReservation( reservationOrderId: string, reservationId: string, filter: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderAndReservation( + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderAndReservationPagingAll( + reservationOrderId, + reservationId, + filter, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByReservationOrderAndReservationPagingPage( + reservationOrderId, + reservationId, + filter, + options + ); + } + }; + } + + private async *listByReservationOrderAndReservationPagingPage( reservationOrderId: string, reservationId: string, filter: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): AsyncIterableIterator { + let result = await this._listByReservationOrderAndReservation( + reservationOrderId, + reservationId, + filter, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByReservationOrderAndReservationNext( reservationOrderId, reservationId, filter, + continuationToken, options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByReservationOrderAndReservationPagingAll( + reservationOrderId: string, + reservationId: string, + filter: string, + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderAndReservationPagingPage( + reservationOrderId, + reservationId, + filter, + options + )) { + yield* page; + } + } + + /** + * Lists the reservations details for the defined scope and provided date range. + * @param scope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param options The options parameters. + */ + public list( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); }, - listByReservationOrderAndReservationOperationSpec, - callback - ) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scope, options); + } + }; + } + + private async *listPagingPage( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } } /** * Lists the reservations details for provided date range. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param [options] The optional parameters - * @returns Promise + * @param reservationOrderId Order Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, + private _listByReservationOrder( + reservationOrderId: string, filter: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, filter, options }, + listByReservationOrderOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param callback The callback + * Lists the reservations details for provided date range. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, + private _listByReservationOrderAndReservation( + reservationOrderId: string, + reservationId: string, filter: string, - callback: msRest.ServiceCallback - ): void; + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, filter, options }, + listByReservationOrderAndReservationOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param options The optional parameters - * @param callback The callback + * Lists the reservations details for the defined scope and provided date range. + * @param scope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, - filter: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderNext( - nextPageLink: string, - filter: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _list( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - filter, - options - }, - listByReservationOrderNextOperationSpec, - callback - ) as Promise; + { scope, options }, + listOperationSpec + ); } /** - * Lists the reservations details for provided date range. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param [options] The optional parameters - * @returns Promise + * ListByReservationOrderNext + * @param reservationOrderId Order Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param nextLink The nextLink from the previous successful call to the ListByReservationOrder method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, + private _listByReservationOrderNext( + reservationOrderId: string, filter: string, - options?: msRest.RequestOptionsBase - ): Promise; + nextLink: string, + options?: ReservationsDetailsListByReservationOrderNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, filter, nextLink, options }, + listByReservationOrderNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param callback The callback + * ListByReservationOrderAndReservationNext + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param nextLink The nextLink from the previous successful call to the + * ListByReservationOrderAndReservation method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, + private _listByReservationOrderAndReservationNext( + reservationOrderId: string, + reservationId: string, filter: string, - callback: msRest.ServiceCallback - ): void; + nextLink: string, + options?: ReservationsDetailsListByReservationOrderAndReservationNextOptionalParams + ): Promise< + ReservationsDetailsListByReservationOrderAndReservationNextResponse + > { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, filter, nextLink, options }, + listByReservationOrderAndReservationNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param filter Filter reservation details by date range. The properties/UsageDate for start date - * and end date. The filter supports 'le' and 'ge' - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param scope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, - filter: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderAndReservationNext( - nextPageLink: string, - filter: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + scope: string, + nextLink: string, + options?: ReservationsDetailsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - filter, - options - }, - listByReservationOrderAndReservationNextOperationSpec, - callback - ) as Promise; + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByReservationOrderOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByReservationOrderOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails", - urlParameters: [Parameters.reservationOrderId], - queryParameters: [Parameters.filter1, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationDetailsListResult @@ -275,16 +382,15 @@ const listByReservationOrderOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.filter1], + urlParameters: [Parameters.$host, Parameters.reservationOrderId], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderAndReservationOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listByReservationOrderAndReservationOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails", - urlParameters: [Parameters.reservationOrderId, Parameters.reservationId], - queryParameters: [Parameters.filter1, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationDetailsListResult @@ -293,16 +399,41 @@ const listByReservationOrderAndReservationOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.filter1], + urlParameters: [ + Parameters.$host, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderNextOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/reservationDetails", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ReservationDetailsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.reservationId1, + Parameters.reservationOrderId1 + ], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const listByReservationOrderNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter1, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationDetailsListResult @@ -311,16 +442,39 @@ const listByReservationOrderNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.filter1], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.reservationOrderId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderAndReservationNextOperationSpec: msRest.OperationSpec = { +const listByReservationOrderAndReservationNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ReservationDetailsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter1], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter1, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationDetailsListResult @@ -329,5 +483,15 @@ const listByReservationOrderAndReservationNextOperationSpec: msRest.OperationSpe bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.reservationId1, + Parameters.reservationOrderId1 + ], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts b/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts index 884abf8b1256..c4a5b4a96256 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts @@ -3,23 +3,40 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/reservationsSummariesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ReservationsSummaries } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { + ReservationSummary, + Datagrain, + ReservationsSummariesListByReservationOrderNextOptionalParams, + ReservationsSummariesListByReservationOrderOptionalParams, + ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams, + ReservationsSummariesListByReservationOrderAndReservationOptionalParams, + ReservationsSummariesListNextOptionalParams, + ReservationsSummariesListOptionalParams, + ReservationsSummariesListByReservationOrderResponse, + ReservationsSummariesListByReservationOrderAndReservationResponse, + ReservationsSummariesListResponse, + ReservationsSummariesListByReservationOrderNextResponse, + ReservationsSummariesListByReservationOrderAndReservationNextResponse, + ReservationsSummariesListNextResponse +} from "../models"; -/** Class representing a ReservationsSummaries. */ -export class ReservationsSummaries { +/// +/** Class containing ReservationsSummaries operations. */ +export class ReservationsSummariesImpl implements ReservationsSummaries { private readonly client: ConsumptionManagementClientContext; /** - * Create a ReservationsSummaries. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ReservationsSummaries class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; @@ -28,233 +45,340 @@ export class ReservationsSummaries { /** * Lists the reservations summaries for daily or monthly grain. * @param reservationOrderId Order Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param [options] The optional parameters - * @returns Promise + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrder( + public listByReservationOrder( reservationOrderId: string, - grain: Models.Datagrain, - options?: Models.ReservationsSummariesListByReservationOrderOptionalParams - ): Promise; - /** - * @param reservationOrderId Order Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param callback The callback - */ - listByReservationOrder( - reservationOrderId: string, - grain: Models.Datagrain, - callback: msRest.ServiceCallback - ): void; - /** - * @param reservationOrderId Order Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param options The optional parameters - * @param callback The callback - */ - listByReservationOrder( - reservationOrderId: string, - grain: Models.Datagrain, - options: Models.ReservationsSummariesListByReservationOrderOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByReservationOrder( + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderPagingAll( + reservationOrderId, + grain, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByReservationOrderPagingPage( + reservationOrderId, + grain, + options + ); + } + }; + } + + private async *listByReservationOrderPagingPage( reservationOrderId: string, - grain: Models.Datagrain, - options?: - | Models.ReservationsSummariesListByReservationOrderOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): AsyncIterableIterator { + let result = await this._listByReservationOrder( + reservationOrderId, + grain, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByReservationOrderNext( reservationOrderId, grain, + continuationToken, options - }, - listByReservationOrderOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Lists the reservations summaries for daily or monthly grain. - * @param reservationOrderId Order Id of the reservation - * @param reservationId Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param [options] The optional parameters - * @returns Promise - */ - listByReservationOrderAndReservation( + private async *listByReservationOrderPagingAll( reservationOrderId: string, - reservationId: string, - grain: Models.Datagrain, - options?: Models.ReservationsSummariesListByReservationOrderAndReservationOptionalParams - ): Promise; - /** - * @param reservationOrderId Order Id of the reservation - * @param reservationId Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param callback The callback - */ - listByReservationOrderAndReservation( - reservationOrderId: string, - reservationId: string, - grain: Models.Datagrain, - callback: msRest.ServiceCallback - ): void; + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderPagingPage( + reservationOrderId, + grain, + options + )) { + yield* page; + } + } + /** + * Lists the reservations summaries for daily or monthly grain. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param options The optional parameters - * @param callback The callback + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrderAndReservation( + public listByReservationOrderAndReservation( reservationOrderId: string, reservationId: string, - grain: Models.Datagrain, - options: Models.ReservationsSummariesListByReservationOrderAndReservationOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderAndReservation( + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderAndReservationPagingAll( + reservationOrderId, + reservationId, + grain, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByReservationOrderAndReservationPagingPage( + reservationOrderId, + reservationId, + grain, + options + ); + } + }; + } + + private async *listByReservationOrderAndReservationPagingPage( reservationOrderId: string, reservationId: string, - grain: Models.Datagrain, - options?: - | Models.ReservationsSummariesListByReservationOrderAndReservationOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): AsyncIterableIterator { + let result = await this._listByReservationOrderAndReservation( + reservationOrderId, + reservationId, + grain, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByReservationOrderAndReservationNext( reservationOrderId, reservationId, grain, + continuationToken, options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByReservationOrderAndReservationPagingAll( + reservationOrderId: string, + reservationId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderAndReservationPagingPage( + reservationOrderId, + reservationId, + grain, + options + )) { + yield* page; + } + } + + /** + * Lists the reservations summaries for the defined scope daily or monthly grain. + * @param scope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param grain Can be daily or monthly + * @param options The options parameters. + */ + public list( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, grain, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listByReservationOrderAndReservationOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(scope, grain, options); + } + }; + } + + private async *listPagingPage( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, grain, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, grain, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, grain, options)) { + yield* page; + } } /** * Lists the reservations summaries for daily or monthly grain. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param [options] The optional parameters - * @returns Promise + * @param reservationOrderId Order Id of the reservation + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, - grain: Models.Datagrain, - options?: Models.ReservationsSummariesListByReservationOrderNextOptionalParams - ): Promise; + private _listByReservationOrder( + reservationOrderId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, grain, options }, + listByReservationOrderOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param callback The callback + * Lists the reservations summaries for daily or monthly grain. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, - grain: Models.Datagrain, - callback: msRest.ServiceCallback - ): void; + private _listByReservationOrderAndReservation( + reservationOrderId: string, + reservationId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): Promise< + ReservationsSummariesListByReservationOrderAndReservationResponse + > { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, grain, options }, + listByReservationOrderAndReservationOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param options The optional parameters - * @param callback The callback + * Lists the reservations summaries for the defined scope daily or monthly grain. + * @param scope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param grain Can be daily or monthly + * @param options The options parameters. */ - listByReservationOrderNext( - nextPageLink: string, - grain: Models.Datagrain, - options: Models.ReservationsSummariesListByReservationOrderNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderNext( - nextPageLink: string, - grain: Models.Datagrain, - options?: - | Models.ReservationsSummariesListByReservationOrderNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _list( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - grain, - options - }, - listByReservationOrderNextOperationSpec, - callback - ) as Promise; + { scope, grain, options }, + listOperationSpec + ); } /** - * Lists the reservations summaries for daily or monthly grain. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param [options] The optional parameters - * @returns Promise + * ListByReservationOrderNext + * @param reservationOrderId Order Id of the reservation + * @param grain Can be daily or monthly + * @param nextLink The nextLink from the previous successful call to the ListByReservationOrder method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, - grain: Models.Datagrain, - options?: Models.ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams - ): Promise; + private _listByReservationOrderNext( + reservationOrderId: string, + grain: Datagrain, + nextLink: string, + options?: ReservationsSummariesListByReservationOrderNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, grain, nextLink, options }, + listByReservationOrderNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param callback The callback + * ListByReservationOrderAndReservationNext + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param grain Can be daily or monthly + * @param nextLink The nextLink from the previous successful call to the + * ListByReservationOrderAndReservation method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, - grain: Models.Datagrain, - callback: msRest.ServiceCallback - ): void; + private _listByReservationOrderAndReservationNext( + reservationOrderId: string, + reservationId: string, + grain: Datagrain, + nextLink: string, + options?: ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams + ): Promise< + ReservationsSummariesListByReservationOrderAndReservationNextResponse + > { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, grain, nextLink, options }, + listByReservationOrderAndReservationNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param grain Can be daily or monthly. Possible values include: 'DailyGrain', 'MonthlyGrain' - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param scope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param grain Can be daily or monthly + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listByReservationOrderAndReservationNext( - nextPageLink: string, - grain: Models.Datagrain, - options: Models.ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByReservationOrderAndReservationNext( - nextPageLink: string, - grain: Models.Datagrain, - options?: - | Models.ReservationsSummariesListByReservationOrderAndReservationNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + scope: string, + grain: Datagrain, + nextLink: string, + options?: ReservationsSummariesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - grain, - options - }, - listByReservationOrderAndReservationNextOperationSpec, - callback - ) as Promise; + { scope, grain, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByReservationOrderOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByReservationOrderOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries", - urlParameters: [Parameters.reservationOrderId], - queryParameters: [Parameters.grain, Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationSummariesListResult @@ -263,16 +387,15 @@ const listByReservationOrderOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion, Parameters.grain], + urlParameters: [Parameters.$host, Parameters.reservationOrderId], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderAndReservationOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listByReservationOrderAndReservationOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries", - urlParameters: [Parameters.reservationOrderId, Parameters.reservationId], - queryParameters: [Parameters.grain, Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationSummariesListResult @@ -281,16 +404,42 @@ const listByReservationOrderAndReservationOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion, Parameters.grain], + urlParameters: [ + Parameters.$host, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderNextOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/reservationSummaries", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ReservationSummariesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.grain, + Parameters.reservationId1, + Parameters.reservationOrderId1 + ], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const listByReservationOrderNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.grain, Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationSummariesListResult @@ -299,16 +448,39 @@ const listByReservationOrderNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.filter, Parameters.apiVersion, Parameters.grain], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.reservationOrderId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByReservationOrderAndReservationNextOperationSpec: msRest.OperationSpec = { +const listByReservationOrderAndReservationNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ReservationSummariesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion, Parameters.grain], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.grain, Parameters.filter0, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationSummariesListResult @@ -317,5 +489,16 @@ const listByReservationOrderAndReservationNextOperationSpec: msRest.OperationSpe bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.startDate, + Parameters.endDate, + Parameters.grain, + Parameters.reservationId1, + Parameters.reservationOrderId1 + ], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/tags.ts b/sdk/consumption/arm-consumption/src/operations/tags.ts index 67a71e3fcd11..2e3b656eae7f 100644 --- a/sdk/consumption/arm-consumption/src/operations/tags.ts +++ b/sdk/consumption/arm-consumption/src/operations/tags.ts @@ -3,85 +3,68 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/tagsMappers"; +import { Tags } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { TagsGetOptionalParams, TagsGetResponse } from "../models"; -/** Class representing a Tags. */ -export class Tags { +/** Class containing Tags operations. */ +export class TagsImpl implements Tags { private readonly client: ConsumptionManagementClientContext; /** - * Create a Tags. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Tags class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * Get all available tag keys for a billing account. - * @param billingAccountId BillingAccount ID - * @param [options] The optional parameters - * @returns Promise + * Get all available tag keys for the defined scope + * @param scope The scope associated with tags operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope.. + * @param options The options parameters. */ get( - billingAccountId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param callback The callback - */ - get(billingAccountId: string, callback: msRest.ServiceCallback): void; - /** - * @param billingAccountId BillingAccount ID - * @param options The optional parameters - * @param callback The callback - */ - get( - billingAccountId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - billingAccountId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + scope: string, + options?: TagsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - billingAccountId, - options - }, - getOperationSpec, - callback - ) as Promise; + { scope, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/tags", httpMethod: "GET", - path: - "providers/Microsoft.CostManagement/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/tags", - urlParameters: [Parameters.billingAccountId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.TagsResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/tenants.ts b/sdk/consumption/arm-consumption/src/operations/tenants.ts deleted file mode 100644 index d05a1527540a..000000000000 --- a/sdk/consumption/arm-consumption/src/operations/tenants.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/tenantsMappers"; -import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; - -/** Class representing a Tenants. */ -export class Tenants { - private readonly client: ConsumptionManagementClientContext; - - /** - * Create a Tenants. - * @param {ConsumptionManagementClientContext} client Reference to the service client. - */ - constructor(client: ConsumptionManagementClientContext) { - this.client = client; - } - - /** - * Gets a Tenant Properties. - * @param billingAccountId Billing Account Id. - * @param billingProfileId Billing Profile Id. - * @param [options] The optional parameters - * @returns Promise - */ - get( - billingAccountId: string, - billingProfileId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param billingAccountId Billing Account Id. - * @param billingProfileId Billing Profile Id. - * @param callback The callback - */ - get( - billingAccountId: string, - billingProfileId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId Billing Account Id. - * @param billingProfileId Billing Profile Id. - * @param options The optional parameters - * @param callback The callback - */ - get( - billingAccountId: string, - billingProfileId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - billingAccountId: string, - billingProfileId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - billingProfileId, - options - }, - getOperationSpec, - callback - ) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/tenants", - urlParameters: [Parameters.billingAccountId, Parameters.billingProfileId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.TenantListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts index 68cb3a7d6122..8f1ebaf6a65c 100644 --- a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts @@ -3,1011 +3,176 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/usageDetailsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { UsageDetails } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; - -/** Class representing a UsageDetails. */ -export class UsageDetails { +import { + UsageDetailUnion, + UsageDetailsListNextOptionalParams, + UsageDetailsListOptionalParams, + UsageDetailsListResponse, + UsageDetailsListNextResponse +} from "../models"; + +/// +/** Class containing UsageDetails operations. */ +export class UsageDetailsImpl implements UsageDetails { private readonly client: ConsumptionManagementClientContext; /** - * Create a UsageDetails. - * @param {ConsumptionManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class UsageDetails class. + * @param client Reference to the service client */ constructor(client: ConsumptionManagementClientContext) { this.client = client; } /** - * 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 [options] The optional parameters - * @returns Promise - */ - list(options?: Models.UsageDetailsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.UsageDetailsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.UsageDetailsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as 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 billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingPeriod( - billingPeriodName: string, - options?: Models.UsageDetailsListByBillingPeriodOptionalParams - ): Promise; - /** - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listByBillingPeriod( - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingPeriod( - billingPeriodName: string, - options: Models.UsageDetailsListByBillingPeriodOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingPeriod( - billingPeriodName: string, - options?: - | Models.UsageDetailsListByBillingPeriodOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingPeriodName, - options - }, - listByBillingPeriodOperationSpec, - callback - ) as 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 billingAccountId BillingAccount ID - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingAccount( - billingAccountId: string, - options?: Models.UsageDetailsListByBillingAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param callback The callback - */ - listByBillingAccount( - billingAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByBillingAccount( - billingAccountId: string, - options: Models.UsageDetailsListByBillingAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingAccount( - billingAccountId: string, - options?: - | Models.UsageDetailsListByBillingAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - options - }, - listByBillingAccountOperationSpec, - callback - ) as 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 billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: Models.UsageDetailsListForBillingPeriodByBillingAccountOptionalParams - ): Promise; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param billingAccountId BillingAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options: Models.UsageDetailsListForBillingPeriodByBillingAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByBillingAccount( - billingAccountId: string, - billingPeriodName: string, - options?: - | Models.UsageDetailsListForBillingPeriodByBillingAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByBillingAccountOperationSpec, - callback - ) as 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 departmentId Department ID - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartment( - departmentId: string, - options?: Models.UsageDetailsListByDepartmentOptionalParams - ): Promise; - /** - * @param departmentId Department ID - * @param callback The callback - */ - listByDepartment( - departmentId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param departmentId Department ID - * @param options The optional parameters - * @param callback The callback - */ - listByDepartment( - departmentId: string, - options: Models.UsageDetailsListByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartment( - departmentId: string, - options?: - | Models.UsageDetailsListByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - departmentId, - options - }, - listByDepartmentOperationSpec, - callback - ) as 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 departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options?: Models.UsageDetailsListForBillingPeriodByDepartmentOptionalParams - ): Promise; - /** - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param departmentId Department ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options: Models.UsageDetailsListForBillingPeriodByDepartmentOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartment( - departmentId: string, - billingPeriodName: string, - options?: - | Models.UsageDetailsListForBillingPeriodByDepartmentOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - departmentId, - billingPeriodName, - options - }, - listForBillingPeriodByDepartmentOperationSpec, - callback - ) as 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 enrollmentAccountId EnrollmentAccount ID - * @param [options] The optional parameters - * @returns Promise - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - options?: Models.UsageDetailsListByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param callback The callback - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccount( - enrollmentAccountId: string, - options: Models.UsageDetailsListByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccount( - enrollmentAccountId: string, - options?: - | Models.UsageDetailsListByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - enrollmentAccountId, - options - }, - listByEnrollmentAccountOperationSpec, - callback - ) as 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 enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options?: Models.UsageDetailsListForBillingPeriodByEnrollmentAccountOptionalParams - ): Promise; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param enrollmentAccountId EnrollmentAccount ID - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options: Models.UsageDetailsListForBillingPeriodByEnrollmentAccountOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccount( - enrollmentAccountId: string, - billingPeriodName: string, - options?: - | Models.UsageDetailsListForBillingPeriodByEnrollmentAccountOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - enrollmentAccountId, - billingPeriodName, - options - }, - listForBillingPeriodByEnrollmentAccountOperationSpec, - callback - ) as 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 managementGroupId Azure Management Group ID. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagementGroup( - managementGroupId: string, - options?: Models.UsageDetailsListByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param callback The callback - */ - listByManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param options The optional parameters - * @param callback The callback - */ - listByManagementGroup( - managementGroupId: string, - options: Models.UsageDetailsListByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroup( - managementGroupId: string, - options?: - | Models.UsageDetailsListByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - options - }, - listByManagementGroupOperationSpec, - callback - ) as 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 managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: Models.UsageDetailsListForBillingPeriodByManagementGroupOptionalParams - ): Promise; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param callback The callback - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param managementGroupId Azure Management Group ID. - * @param billingPeriodName Billing Period Name. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options: Models.UsageDetailsListForBillingPeriodByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByManagementGroup( - managementGroupId: string, - billingPeriodName: string, - options?: - | Models.UsageDetailsListForBillingPeriodByManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - billingPeriodName, - options - }, - listForBillingPeriodByManagementGroupOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: Models.UsageDetailsListNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext( - nextPageLink: string, - options: Models.UsageDetailsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingPeriodNext( - nextPageLink: string, - options?: Models.UsageDetailsListByBillingPeriodNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByBillingPeriodNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingPeriodNext( - nextPageLink: string, - options: Models.UsageDetailsListByBillingPeriodNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingPeriodNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByBillingPeriodNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByBillingPeriodNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByBillingAccountNext( - nextPageLink: string, - options?: Models.UsageDetailsListByBillingAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByBillingAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByBillingAccountNext( - nextPageLink: string, - options: Models.UsageDetailsListByBillingAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByBillingAccountNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByBillingAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByBillingAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options?: Models.UsageDetailsListForBillingPeriodByBillingAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options: Models.UsageDetailsListForBillingPeriodByBillingAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByBillingAccountNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListForBillingPeriodByBillingAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByBillingAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDepartmentNext( - nextPageLink: string, - options?: Models.UsageDetailsListByDepartmentNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDepartmentNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByDepartmentNext( - nextPageLink: string, - options: Models.UsageDetailsListByDepartmentNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByDepartmentNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByDepartmentNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDepartmentNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options?: Models.UsageDetailsListForBillingPeriodByDepartmentNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options: Models.UsageDetailsListForBillingPeriodByDepartmentNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByDepartmentNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListForBillingPeriodByDepartmentNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByDepartmentNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByEnrollmentAccountNext( - nextPageLink: string, - options?: Models.UsageDetailsListByEnrollmentAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByEnrollmentAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByEnrollmentAccountNext( - nextPageLink: string, - options: Models.UsageDetailsListByEnrollmentAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByEnrollmentAccountNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByEnrollmentAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByEnrollmentAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options?: Models.UsageDetailsListForBillingPeriodByEnrollmentAccountNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options: Models.UsageDetailsListForBillingPeriodByEnrollmentAccountNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByEnrollmentAccountNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListForBillingPeriodByEnrollmentAccountNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByEnrollmentAccountNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagementGroupNext( - nextPageLink: string, - options?: Models.UsageDetailsListByManagementGroupNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByManagementGroupNext( - nextPageLink: string, - options: Models.UsageDetailsListByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroupNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListByManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagementGroupNextOperationSpec, - callback - ) as 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options?: Models.UsageDetailsListForBillingPeriodByManagementGroupNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options: Models.UsageDetailsListForBillingPeriodByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForBillingPeriodByManagementGroupNext( - nextPageLink: string, - options?: - | Models.UsageDetailsListForBillingPeriodByManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForBillingPeriodByManagementGroupNextOperationSpec, - callback - ) as Promise; + * Lists the usage details for the defined scope. Usage details are available via this API only for May + * 1, 2014 or later. + * @param scope The scope associated with usage details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and management group, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. + */ + public list( + scope: string, + options?: UsageDetailsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scope, options); + } + }; + } + + private async *listPagingPage( + scope: string, + options?: UsageDetailsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scope: string, + options?: UsageDetailsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(scope, options)) { + yield* page; + } + } + + /** + * Lists the usage details for the defined scope. Usage details are available via this API only for May + * 1, 2014 or later. + * @param scope The scope associated with usage details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and management group, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. + */ + private _list( + scope: string, + options?: UsageDetailsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param scope The scope associated with usage details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and management group, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scope: string, + nextLink: string, + options?: UsageDetailsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.subscriptionId], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingPeriodOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Consumption/usageDetails", httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.subscriptionId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.UsageDetailsListResult @@ -1016,48 +181,21 @@ const listByBillingPeriodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByBillingAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.billingAccountId], queryParameters: [ Parameters.expand, - Parameters.filter0, + Parameters.filter, Parameters.skiptoken, Parameters.top, Parameters.apiVersion, - Parameters.apply + Parameters.metric ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const listForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = { +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - path: - "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.billingAccountId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.UsageDetailsListResult @@ -1066,395 +204,15 @@ const listForBillingPeriodByBillingAccountOperationSpec: msRest.OperationSpec = bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.departmentId], queryParameters: [ Parameters.expand, - Parameters.filter0, + Parameters.filter, Parameters.skiptoken, Parameters.top, Parameters.apiVersion, - Parameters.apply + Parameters.metric ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByDepartmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.departmentId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.enrollmentAccountId], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByEnrollmentAccountOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.enrollmentAccountId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.managementGroupId], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByManagementGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", - urlParameters: [Parameters.managementGroupId, Parameters.billingPeriodName], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion, - Parameters.apply - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByBillingPeriodNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByBillingAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByBillingAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByDepartmentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByDepartmentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByEnrollmentAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByEnrollmentAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listForBillingPeriodByManagementGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [ - Parameters.expand, - Parameters.filter0, - Parameters.skiptoken, - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.UsageDetailsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/aggregatedCost.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/aggregatedCost.ts new file mode 100644 index 000000000000..5cd517b364c0 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/aggregatedCost.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + AggregatedCostGetByManagementGroupOptionalParams, + AggregatedCostGetByManagementGroupResponse, + AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams, + AggregatedCostGetForBillingPeriodByManagementGroupResponse +} from "../models"; + +/** Interface representing a AggregatedCost. */ +export interface AggregatedCost { + /** + * Provides the aggregate cost of a management group and all child management groups by current billing + * period. + * @param managementGroupId Azure Management Group ID. + * @param options The options parameters. + */ + getByManagementGroup( + managementGroupId: string, + options?: AggregatedCostGetByManagementGroupOptionalParams + ): Promise; + /** + * Provides the aggregate cost of a management group and all child management groups by specified + * billing period + * @param managementGroupId Azure Management Group ID. + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + getForBillingPeriodByManagementGroup( + managementGroupId: string, + billingPeriodName: string, + options?: AggregatedCostGetForBillingPeriodByManagementGroupOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/balances.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/balances.ts new file mode 100644 index 000000000000..b6d7cf515aeb --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/balances.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + BalancesGetByBillingAccountOptionalParams, + BalancesGetByBillingAccountResponse, + BalancesGetForBillingPeriodByBillingAccountOptionalParams, + BalancesGetForBillingPeriodByBillingAccountResponse +} from "../models"; + +/** Interface representing a Balances. */ +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 billingAccountId BillingAccount ID + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountId: string, + options?: BalancesGetByBillingAccountOptionalParams + ): 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 billingAccountId BillingAccount ID + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + getForBillingPeriodByBillingAccount( + billingAccountId: string, + billingPeriodName: string, + options?: BalancesGetForBillingPeriodByBillingAccountOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts new file mode 100644 index 000000000000..ef12d70ae33e --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Budget, + BudgetsListOptionalParams, + BudgetsGetOptionalParams, + BudgetsGetResponse, + BudgetsCreateOrUpdateOptionalParams, + BudgetsCreateOrUpdateResponse, + BudgetsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Budgets. */ +export interface Budgets { + /** + * Lists all budgets for the defined scope. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param options The options parameters. + */ + list( + scope: string, + options?: BudgetsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the budget for the scope by budget name. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param budgetName Budget Name. + * @param options The options parameters. + */ + get( + scope: string, + budgetName: string, + options?: BudgetsGetOptionalParams + ): Promise; + /** + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form + * of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior + * to your put operation. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param budgetName Budget Name. + * @param parameters Parameters supplied to the Create Budget operation. + * @param options The options parameters. + */ + createOrUpdate( + scope: string, + budgetName: string, + parameters: Budget, + options?: BudgetsCreateOrUpdateOptionalParams + ): Promise; + /** + * The operation to delete a budget. + * @param scope The scope associated with budget operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + * for Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope. + * @param budgetName Budget Name. + * @param options The options parameters. + */ + delete( + scope: string, + budgetName: string, + options?: BudgetsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts new file mode 100644 index 000000000000..074f8c6d24ee --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { ChargesListOptionalParams, ChargesListResponse } from "../models"; + +/** Interface representing a Charges. */ +export interface Charges { + /** + * Lists the charges based for the defined scope. + * @param scope The scope associated with charges operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period + * to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to + * specify billing period at department scope use + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. + */ + list( + scope: string, + options?: ChargesListOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/credits.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/credits.ts new file mode 100644 index 000000000000..4a074f54853d --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/credits.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { CreditsGetOptionalParams, CreditsGetResponse } from "../models"; + +/** Interface representing a Credits. */ +export interface Credits { + /** + * The credit summary by billingAccountId and billingProfileId. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + get( + billingAccountId: string, + billingProfileId: string, + options?: CreditsGetOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/eventsOperations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/eventsOperations.ts new file mode 100644 index 000000000000..82b66c5d5513 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/eventsOperations.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + EventSummary, + EventsListByBillingProfileOptionalParams, + EventsListByBillingAccountOptionalParams +} from "../models"; + +/// +/** Interface representing a EventsOperations. */ +export interface EventsOperations { + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param startDate Start date + * @param endDate End date + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + startDate: string, + endDate: string, + options?: EventsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + * billing account or a billing profile for a given start and end date. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountId: string, + options?: EventsListByBillingAccountOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/index.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..b751ef901317 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/index.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./usageDetails"; +export * from "./marketplaces"; +export * from "./budgets"; +export * from "./tags"; +export * from "./charges"; +export * from "./balances"; +export * from "./reservationsSummaries"; +export * from "./reservationsDetails"; +export * from "./reservationRecommendations"; +export * from "./reservationRecommendationDetails"; +export * from "./reservationTransactions"; +export * from "./priceSheet"; +export * from "./operations"; +export * from "./aggregatedCost"; +export * from "./eventsOperations"; +export * from "./lotsOperations"; +export * from "./credits"; diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts new file mode 100644 index 000000000000..cee7524cb172 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + LotSummary, + LotsListByBillingProfileOptionalParams, + LotsListByBillingAccountOptionalParams +} from "../models"; + +/// +/** Interface representing a LotsOperations. */ +export interface LotsOperations { + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: LotsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + * billing profile. Microsoft Azure consumption commitments are only supported for the billing account + * scope. + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountId: string, + options?: LotsListByBillingAccountOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/marketplaces.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/marketplaces.ts new file mode 100644 index 000000000000..5998f4baed58 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/marketplaces.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Marketplace, MarketplacesListOptionalParams } from "../models"; + +/// +/** Interface representing a Marketplaces. */ +export interface Marketplaces { + /** + * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API + * only for May 1, 2014 or later. + * @param scope The scope associated with marketplace operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and ManagementGroup, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + * @param options The options parameters. + */ + list( + scope: string, + options?: MarketplacesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/operations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..f057fff6bf38 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available consumption REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts new file mode 100644 index 000000000000..b9ce965b0936 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + PriceSheetGetOptionalParams, + PriceSheetGetResponse, + PriceSheetGetByBillingPeriodOptionalParams, + PriceSheetGetByBillingPeriodResponse +} from "../models"; + +/** Interface representing a PriceSheet. */ +export interface PriceSheet { + /** + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 + * or later. + * @param options The options parameters. + */ + get(options?: PriceSheetGetOptionalParams): 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. + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + getByBillingPeriod( + billingPeriodName: string, + options?: PriceSheetGetByBillingPeriodOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts new file mode 100644 index 000000000000..563830545ff9 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Term, + LookBackPeriod, + ReservationRecommendationDetailsGetOptionalParams, + ReservationRecommendationDetailsGetResponse +} from "../models"; + +/** Interface representing a ReservationRecommendationDetails. */ +export interface ReservationRecommendationDetails { + /** + * Details of a reservation recommendation for what-if analysis of reserved instances. + * @param scope The scope associated with reservation recommendation details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param region Used to select the region the recommendation should be generated for. + * @param term Specify length of reservation recommendation term. + * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. + * @param product Filter the products for which reservation recommendation results are generated. + * Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + * @param options The options parameters. + */ + get( + scope: string, + region: string, + term: Term, + lookBackPeriod: LookBackPeriod, + product: string, + options?: ReservationRecommendationDetailsGetOptionalParams + ): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts new file mode 100644 index 000000000000..e4df3b2a4d35 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationRecommendationUnion, + ReservationRecommendationsListOptionalParams +} from "../models"; + +/// +/** Interface representing a ReservationRecommendations. */ +export interface ReservationRecommendations { + /** + * List of recommendations for purchasing reserved instances. + * @param scope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param options The options parameters. + */ + list( + scope: string, + options?: ReservationRecommendationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts new file mode 100644 index 000000000000..bc3dd77c5727 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationTransaction, + ReservationTransactionsListOptionalParams, + ModernReservationTransaction, + ReservationTransactionsListByBillingProfileOptionalParams +} from "../models"; + +/// +/** Interface representing a ReservationTransactions. */ +export interface ReservationTransactions { + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param options The options parameters. + */ + list( + billingAccountId: string, + options?: ReservationTransactionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of transactions for reserved instances on billing account scope + * @param billingAccountId BillingAccount ID + * @param billingProfileId Azure Billing Profile ID. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountId: string, + billingProfileId: string, + options?: ReservationTransactionsListByBillingProfileOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts new file mode 100644 index 000000000000..771aedbfc513 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationDetail, + ReservationsDetailsListByReservationOrderOptionalParams, + ReservationsDetailsListByReservationOrderAndReservationOptionalParams, + ReservationsDetailsListOptionalParams +} from "../models"; + +/// +/** Interface representing a ReservationsDetails. */ +export interface ReservationsDetails { + /** + * Lists the reservations details for provided date range. + * @param reservationOrderId Order Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. + */ + listByReservationOrder( + reservationOrderId: string, + filter: string, + options?: ReservationsDetailsListByReservationOrderOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the reservations details for provided date range. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param filter Filter reservation details by date range. The properties/UsageDate for start date and + * end date. The filter supports 'le' and 'ge' + * @param options The options parameters. + */ + listByReservationOrderAndReservation( + reservationOrderId: string, + reservationId: string, + filter: string, + options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the reservations details for the defined scope and provided date range. + * @param scope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param options The options parameters. + */ + list( + scope: string, + options?: ReservationsDetailsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts new file mode 100644 index 000000000000..935d9eeaef13 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationSummary, + Datagrain, + ReservationsSummariesListByReservationOrderOptionalParams, + ReservationsSummariesListByReservationOrderAndReservationOptionalParams, + ReservationsSummariesListOptionalParams +} from "../models"; + +/// +/** Interface representing a ReservationsSummaries. */ +export interface ReservationsSummaries { + /** + * Lists the reservations summaries for daily or monthly grain. + * @param reservationOrderId Order Id of the reservation + * @param grain Can be daily or monthly + * @param options The options parameters. + */ + listByReservationOrder( + reservationOrderId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the reservations summaries for daily or monthly grain. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation + * @param grain Can be daily or monthly + * @param options The options parameters. + */ + listByReservationOrderAndReservation( + reservationOrderId: string, + reservationId: string, + grain: Datagrain, + options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the reservations summaries for the defined scope daily or monthly grain. + * @param scope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). + * @param grain Can be daily or monthly + * @param options The options parameters. + */ + list( + scope: string, + grain: Datagrain, + options?: ReservationsSummariesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/tags.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/tags.ts new file mode 100644 index 000000000000..55499202f7c2 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/tags.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { TagsGetOptionalParams, TagsGetResponse } from "../models"; + +/** Interface representing a Tags. */ +export interface Tags { + /** + * Get all available tag keys for the defined scope + * @param scope The scope associated with tags operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope.. + * @param options The options parameters. + */ + get(scope: string, options?: TagsGetOptionalParams): Promise; +} diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts new file mode 100644 index 000000000000..b705a0dfe826 --- /dev/null +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { UsageDetailUnion, UsageDetailsListOptionalParams } from "../models"; + +/// +/** Interface representing a UsageDetails. */ +export interface UsageDetails { + /** + * Lists the usage details for the defined scope. Usage details are available via this API only for May + * 1, 2014 or later. + * @param scope The scope associated with usage details operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope + * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + * scope. For subscription, billing account, department, enrollment account and management group, you + * can also add billing period to the scope using + * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + * period at department scope use + * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * Also, Modern Commerce Account scopes are + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * for invoiceSection scope, and + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * partners. + * @param options The options parameters. + */ + list( + scope: string, + options?: UsageDetailsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/consumption/arm-consumption/test/sampleTest.ts b/sdk/consumption/arm-consumption/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/consumption/arm-consumption/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/consumption/arm-consumption/tsconfig.json b/sdk/consumption/arm-consumption/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/consumption/arm-consumption/tsconfig.json +++ b/sdk/consumption/arm-consumption/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/consumption/ci.yml b/sdk/consumption/ci.yml new file mode 100644 index 000000000000..d1bb7092132f --- /dev/null +++ b/sdk/consumption/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/consumption/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/consumption/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: consumption + Artifacts: + - name: azure-arm-consumption + safeName: azurearmconsumption + \ No newline at end of file From 069012ae060aa7606b190f55653eb8fe07b23fe4 Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 09:57:12 +0800 Subject: [PATCH 05/14] update --- sdk/consumption/arm-consumption/package.json | 4 +- .../my_test/recording_budgets_create_test.js | 149 ++++++++++++++ .../my_test/recording_budgets_delete_test.js | 145 ++++++++++++++ .../my_test/recording_budgets_get_test.js | 151 ++++++++++++++ .../arm-consumption/test/sampleTest.ts | 186 +++++++++++++++++- 5 files changed, 632 insertions(+), 3 deletions(-) create mode 100644 sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js create mode 100644 sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js create mode 100644 sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js diff --git a/sdk/consumption/arm-consumption/package.json b/sdk/consumption/arm-consumption/package.json index e9b32f95233f..17c20f497f0d 100644 --- a/sdk/consumption/arm-consumption/package.json +++ b/sdk/consumption/arm-consumption/package.json @@ -31,7 +31,9 @@ "@azure/identity": "2.0.0-beta.6", "@azure-tools/test-recorder": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/arm-compute": "^17.0.0-beta.2", + "@azure/arm-network": "^26.0.0-beta.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption", "repository": { diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js new file mode 100644 index 000000000000..acbe43d24f0b --- /dev/null +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js @@ -0,0 +1,149 @@ +let nock = require('nock'); + +module.exports.hash = "ec7f3fdb02d11a27248023d0744d991d"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'a43d7a26-6767-4075-a181-1561d964f601', + 'x-ms-ests-server', + '2.1.12197.4 - SEASLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AqrS1p57lx1Cpe5Te6Imj98; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrCU85jVtLoh5jgtu0cnOZtInaYUYwJwXeoByd3ewzqr5zOtPm9TfejF4pHU0UO1Sn6aHmQ9TXO4AUVpjVjE-fb6pySlOu5Y74jqeeg-yHv6DQMa6pWRRH0E5uxygdID4aT-EWGXvGBj_P6cF2Beb-0Ud2ybCt-LL8Vl1zkc93hX8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:51 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '393dbe28-747b-4c3b-8eaf-5ec8c13a9100', + 'x-ms-ests-server', + '2.1.12231.7 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Ap27LJzMrxxHh_lVvdTPCtA; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrWvGkLNRSamtmNu5-fZD_KXOdXyIiL6Tnx5Jp8rC87oEy2VGXorPTYpOjDS8v2UYZygJt02YyW0EIUwU44CiyYy5jSep3yr6HVexcVpdk7Q-PFz53nZ6h1_SeML6RiMLaijNHUAd_JfFFGAZGabqvpm9kNwHtnHc7McjgvqZlriogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:52 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d6071789-5899-4162-981b-b45c61869723&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0a57fd69-e42d-472b-b036-82d53b0e4c00', + 'x-ms-ests-server', + '2.1.12231.7 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AnsFvHbzMHBFqYjKfNQ76XYWPr5BAQAAADAGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:52 GMT', + 'Content-Length', + '1351' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .put('//subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy', {"properties":{"category":"Cost","amount":100,"timeGrain":"Monthly","timePeriod":{"startDate":"2021-11-01T00:00:00.000Z","endDate":"2021-12-01T00:00:00.000Z"},"filter":{"and":[{"dimensions":{"name":"ResourceId","operator":"In","values":["/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Compute/virtualMachines/myvmxxx"]}},{"tags":{"name":"category","operator":"In","values":["Dev","Prod"]}}]},"notifications":{"Actual_GreaterThan_80_Percent":{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["johndoe@contoso.com","janesmith@contoso.com"],"contactRoles":["Contributor","Reader"],"thresholdType":"Actual"}}}}) + .query(true) + .reply(201, {"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy","name":"mybudgetxxxy","type":"Microsoft.Consumption/budgets","eTag":"\"1d7da8cd02cd48e\"","properties":{"timePeriod":{"startDate":"2021-11-01T00:00:00Z","endDate":"2021-12-01T00:00:00Z"},"timeGrain":"Monthly","amount":100,"currentSpend":null,"category":"Cost","notifications":{"actual_GreaterThan_80_Percent":{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["johndoe@contoso.com","janesmith@contoso.com"],"contactRoles":["Contributor","Reader"],"contactGroups":[],"thresholdType":"Actual"}},"filter":{"and":[{"dimensions":{"name":"ResourceId","operator":"In","values":["/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Compute/virtualMachines/myvmxxx"]}},{"tags":{"name":"category","operator":"In","values":["Dev","Prod"]}}]}}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '939', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy?api-version=2021-10-01', + 'session-id', + 'b6495e91-9956-43de-a874-3d6d4b5fb578', + 'x-ms-request-id', + '0eb04407-fb89-466e-916a-f376f0e6e554', + 'x-ms-correlation-request-id', + '022d8521-b182-4995-81a0-f2d3394b792b', + 'x-ms-client-request-id', + '55a92640-e8b1-401f-b233-2b58264334ab', + 'X-Powered-By', + 'ASP.NET', + 'x-ms-ratelimit-remaining-subscription-writes', + '1199', + 'x-ms-routing-request-id', + 'KOREASOUTH:20211116T015355Z:022d8521-b182-4995-81a0-f2d3394b792b', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Tue, 16 Nov 2021 01:53:55 GMT' +]); diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js new file mode 100644 index 000000000000..a9040faff6ba --- /dev/null +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js @@ -0,0 +1,145 @@ +let nock = require('nock'); + +module.exports.hash = "4053cc82ff8e78dde36e4517d1f796ca"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ebd3f0de-f7f3-44e0-b835-492825801c00', + 'x-ms-ests-server', + '2.1.12197.4 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=Am4H-ci2Mf1Pt908IOds2Uc; expires=Thu, 16-Dec-2021 01:53:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrjEfLOwIkPp4qlFgxK2BAG6HpE0KwJuEn1HAQ1h62xhmZViuA0kO8qdEbYDbA3n9sIblOEjItNhoPoxqBLDtqcJV7nwMaNU8l2Qw2Mdk5OfxR-WLTcEpJy1PTR9mK2LstLeIDE98Gy2ifq_7g_TEq_nRjmmpIvtY9U_KDjaaYrkYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'f309842f-710c-41a5-8a1b-c2d3f45d5701', + 'x-ms-ests-server', + '2.1.12231.7 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=Ar9eD24GauJMjchhBnmxj-g; expires=Thu, 16-Dec-2021 01:53:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrJhqa4SaqrrPj7UMYEgyTZfkU4YMS3E0DnT-g8JXrOWcbPzZpOJ_fazMypNEuAwlYR4XvrQ23HOWMCyaDx2n3s4WjqU-OuXkxx85uV-QoHVqylP26y39uRyqIqp6qWIaK7G3dq-608n8CZpK-AKrpVcclXRporVfqDVqIrmgDHZogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=46b65d1b-aa64-4d7b-b713-60c3fb901b67&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '78c372be-d672-497b-96fc-4161d1d2f300', + 'x-ms-ests-server', + '2.1.12231.7 - SEASLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AiyhANRBpIpNi-uYvt-UUq0WPr5BAQAAADQGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Content-Length', + '1351' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .delete('//subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy') + .query(true) + .reply(200, "", [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Expires', + '-1', + 'session-id', + 'fc2344ed-e04b-4dba-94c6-629c7961dfd5', + 'x-ms-request-id', + '4575d984-26e9-4480-aab0-a0f84b210d96', + 'x-ms-correlation-request-id', + '4d6dfd02-6873-4860-bfb1-aaf97e6719da', + 'x-ms-client-request-id', + '6b48a22b-2d57-4902-908c-80b9ed4a6b39', + 'X-Powered-By', + 'ASP.NET', + 'x-ms-ratelimit-remaining-subscription-deletes', + '14999', + 'x-ms-routing-request-id', + 'KOREASOUTH:20211116T015358Z:4d6dfd02-6873-4860-bfb1-aaf97e6719da', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Tue, 16 Nov 2021 01:53:58 GMT', + 'Content-Length', + '0' +]); diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js new file mode 100644 index 000000000000..093165c58667 --- /dev/null +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js @@ -0,0 +1,151 @@ +let nock = require('nock'); + +module.exports.hash = "f0352c1810a8bbe7f6b6e0a2b912db95"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'd8a4ace5-c4d3-4353-b6ea-bd8986839200', + 'x-ms-ests-server', + '2.1.12231.7 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AocZvaGf5zBPlXgBt-ctz54; expires=Thu, 16-Dec-2021 01:53:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrdgrLRL1XUS4d7pL4YVT2cg74PAq2xyHlE8og4jUVU3FmKVFECCpJQxqEe19qqt0-pzr0d8g9d8KBNJkKEQ9PECqFXeqAqgdVPpYhwqJU2ADJSRexuo72NrFUq-P2FV0TecM0svpLm9Q0t0x355ywJIoPLuKgyrOm9UV5q3YD178gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ac566b03-181e-4262-af31-1e928eac4400', + 'x-ms-ests-server', + '2.1.12231.7 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AgEssqnNKSBEg4uOEEvKfTY; expires=Thu, 16-Dec-2021 01:53:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrN-etrqYjMIgF4CBAvYrWjOBR438XdA3Nx0tg3VQloy91W779NkZ1C6zenICThVlcAcf_1S6_VNdxOXRCWojiDZL2zaqDgixhyBaGR9pHhFwLrd5Cx6CjWQSwU2aUkXd-TGyAraUJbyR-dHVggg1Rp14YSKYlqefaocN9fukLdzAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=c825f9a4-573c-47ef-a57b-559fab9c4fff&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '96145cac-462e-4752-9529-a63d3649be00', + 'x-ms-ests-server', + '2.1.12231.7 - SEASLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=Aunwf9emLg1ImlWmmny3U8QWPr5BAQAAADMGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Content-Length', + '1351' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('//subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e4f08ea7ac1d0ef4ed6b38bbcc50bf2dbbb77efae3f1a7db4cc163961d2f9b4bd5ee1d38d90a859fe26bba066bfef47bbb307b3ec603adbd99bcef60ff2dff723fa92105ae5755be4cd478f7ef1476db1c85fe67551d1b87ff1474d9bd5edd3ac45277b3b7bbbdbbbbbdb3bbb6f76761ef1ff7e8a5ecf97b3a0c15ed8e097109204f2f33a2b96d4e68b6ad9ce4ba09e2daaf5b2fde8d1eecece7867f4d1745dd7f9b27dbd2278e8d97ccd5fae9705fdfad157af9f02de94babba8ea6bfae4a46a5a82b5acdae2bca0cf69d83c8a6cdaaeb3f2f7ffbccea96dfd669e2d7fff839ddf9fc635a53ed0205f669332a79eda7a9d8f3e0205b2b6aa09a4f70e416ee7348ff3aaa496078cca940640d04f1759515257dffbe8a7abf97256e5bf27bea039184fab05bdf7d3d9326f16453b0f3effbe7dff555582dedfa3112cdbba98acd1f9e8a3577946ace1b513eea186f491c5e58dccfa310ff2a35f4224392f4ac21903cb40beeffde28f6644f46563e8a1dcf34a79f26c467d79633ec3502fb3722d38ddfd5967f7c56adde6772f8b1a23f8229bce0b2217bd74b920c6fee8fb3424e2c4ec82b0b1b8d3eccaac6fc2fc697e497fbfac897b0908fdef97","fc3fcbe70aa8c2030000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding,Accept-Encoding', + 'session-id', + '4f16022a-135f-43c2-ba11-41f5fd070cf0', + 'x-ms-request-id', + '92bedf6a-e9a1-402c-b42c-e4eaaa276e74', + 'x-ms-correlation-request-id', + 'e60481a5-3b6f-458e-81b5-a74061b8c059', + 'x-ms-client-request-id', + '74ef2d87-4890-492b-b54f-8cf903043865', + 'X-Powered-By', + 'ASP.NET', + 'x-ms-ratelimit-remaining-subscription-reads', + '11999', + 'x-ms-routing-request-id', + 'KOREASOUTH:20211116T015356Z:e60481a5-3b6f-458e-81b5-a74061b8c059', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Tue, 16 Nov 2021 01:53:56 GMT' +]); diff --git a/sdk/consumption/arm-consumption/test/sampleTest.ts b/sdk/consumption/arm-consumption/test/sampleTest.ts index 7ed89b043e1b..6bf25b160209 100644 --- a/sdk/consumption/arm-consumption/test/sampleTest.ts +++ b/sdk/consumption/arm-consumption/test/sampleTest.ts @@ -13,6 +13,10 @@ import { Recorder } from "@azure-tools/test-recorder"; import * as assert from "assert"; +import { ClientSecretCredential } from "@azure/identity"; +import { ConsumptionManagementClient } from "../src/consumptionManagementClient"; +import { ComputeManagementClient,VirtualMachine } from "@azure/arm-compute"; +import { NetworkManagementClient,NetworkInterface,VirtualNetwork } from "@azure/arm-network"; const recorderEnvSetup: RecorderEnvironmentSetup = { replaceableVariables: { @@ -33,16 +37,194 @@ const recorderEnvSetup: RecorderEnvironmentSetup = { describe("My test", () => { let recorder: Recorder; + let subscriptionId: string; + let client: ConsumptionManagementClient; + let compute_client: ComputeManagementClient; + let network_client: NetworkManagementClient; + let location: string; + let resourceGroup: string; + let subnet_name: string; + let interface_name: string; + let budgetName: string; + let vmName: string; + let network_name: string; + let scope: string; beforeEach(async function() { recorder = record(this, recorderEnvSetup); + subscriptionId = env.SUBSCRIPTION_ID; + // This is an example of how the environment variables are used + const credential = new ClientSecretCredential( + env.AZURE_TENANT_ID, + env.AZURE_CLIENT_ID, + env.AZURE_CLIENT_SECRET + ); + client = new ConsumptionManagementClient(credential, subscriptionId); + compute_client = new ComputeManagementClient(credential,subscriptionId); + network_client = new NetworkManagementClient(credential,subscriptionId); + location = "eastus"; + resourceGroup = "myjstest"; + subnet_name = "subnetxxx"; + interface_name = "myinterfacexxx"; + interface_name = "myinterfacexxx"; + budgetName = "mybudgetxxxy"; + vmName = "myvmxxx"; + network_name = "mynetworkxxy"; + scope = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroup; }); afterEach(async function() { await recorder.stop(); }); - it("sample test", async function() { - console.log("Hi, I'm a test!"); + //network_client.virtualNetworks.createOrUpdate + async function createVirtualNetwork() { + const parameter: VirtualNetwork = { + location: location, + addressSpace: { + addressPrefixes: ["10.0.0.0/16"], + }, + }; + const virtualNetworks_create_info = await network_client.virtualNetworks.beginCreateOrUpdateAndWait(resourceGroup,network_name,parameter); + console.log(virtualNetworks_create_info); + + // + const subnet__create_info = await network_client.subnets.beginCreateOrUpdateAndWait(resourceGroup,network_name,subnet_name,{addressPrefix: "10.0.0.0/24"}); + } + + //network_client.networkInterfaces.createOrUpdate + async function createNetworkInterface(group_name: any,location: any,nic_name: any) { + const parameter: NetworkInterface = { + location: location, + ipConfigurations: [ + { + name: "MyIpConfig", + subnet: { + id: "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/virtualNetworks/" +network_name +"/subnets/" +subnet_name, + } + } + ] + } + const nic_info = await network_client.networkInterfaces.beginCreateOrUpdateAndWait(group_name,nic_name,parameter); + } + + //virtualMachines.createOrUpdate + async function virtualMachines_createOrUpdate() { + await createVirtualNetwork(); + await createNetworkInterface(resourceGroup, location, interface_name); + const parameter: VirtualMachine = { + location: location, + hardwareProfile: { + vmSize: "Standard_D2_v2", + }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + }, + name: "myVMosdisk", + createOption: "FromImage", + }, + dataDisks: [ + { + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + }, + { + diskSizeGB: 1023, + createOption: "Empty", + lun: 1, + }, + ], + }, + osProfile: { + adminUsername: "testuser", + computerName: "myVM", + adminPassword: "Aa!1()-xyz", + windowsConfiguration: { + enableAutomaticUpdates: true, // need automatic update for reimage + }, + }, + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/networkInterfaces/" +interface_name, + primary: true, + }, + ], + }, + }; + const res = await compute_client.virtualMachines.beginCreateOrUpdateAndWait(resourceGroup,vmName,parameter); + console.log(res); + } + + it("budgets create test", async function() { + const res = await client.budgets.createOrUpdate(scope,budgetName,{ + category: "Cost", + amount: 100, + timeGrain: "Monthly", + timePeriod: { + startDate: new Date("2021-11-01T00:00:00Z"), + endDate: new Date("2021-11-31T00:00:00Z") + }, + filter: { + and: [ + { + dimensions: { + name: "ResourceId", + operator: "In", + values: [ + "/subscriptions/"+subscriptionId+"/resourceGroups/"+resourceGroup+"/providers/Microsoft.Compute/virtualMachines/"+vmName + ] + } + }, + { + tags: { + name: "category", + operator: "In", + values: [ + "Dev", + "Prod" + ] + } + } + ] + }, + notifications: { + Actual_GreaterThan_80_Percent: { + enabled: true, + operator: "GreaterThan", + threshold: 80, + contactEmails: [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + contactRoles: [ + "Contributor", + "Reader" + ], + thresholdType: "Actual" + } + } + }); + assert.equal(res.name,budgetName); + }); + + it("budgets get test", async function() { + const res = await client.budgets.get(scope,budgetName); + assert.equal(res.name,budgetName); + }); + + it("budgets delete test", async function() { + const res = await client.budgets.delete(scope,budgetName); }); }); From 0cfea441749e0581f64084231991486e04f44e91 Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 09:58:25 +0800 Subject: [PATCH 06/14] update --- sdk/consumption/arm-consumption/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/consumption/arm-consumption/package.json b/sdk/consumption/arm-consumption/package.json index 17c20f497f0d..47c88cac6930 100644 --- a/sdk/consumption/arm-consumption/package.json +++ b/sdk/consumption/arm-consumption/package.json @@ -28,7 +28,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", - "@azure/identity": "2.0.0-beta.6", + "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^1.0.0", "mocha": "^7.1.1", "cross-env": "^7.0.2", From 8423f9ebb7c692ed117e113998edb7abcddb24f4 Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 10:20:03 +0800 Subject: [PATCH 07/14] update ci.yml --- sdk/consumption/arm-consumption/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/consumption/arm-consumption/package.json b/sdk/consumption/arm-consumption/package.json index 47c88cac6930..99ca17c97f5f 100644 --- a/sdk/consumption/arm-consumption/package.json +++ b/sdk/consumption/arm-consumption/package.json @@ -32,6 +32,7 @@ "@azure-tools/test-recorder": "^1.0.0", "mocha": "^7.1.1", "cross-env": "^7.0.2", + "@types/node": "^12.20.37", "@azure/arm-compute": "^17.0.0-beta.2", "@azure/arm-network": "^26.0.0-beta.2" }, From 3938c20238b51d68a4897000c79e38ffcb09309d Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 10:27:26 +0800 Subject: [PATCH 08/14] update --- common/config/rush/pnpm-lock.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index bbc2a054a0c5..a72dc61cfff7 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -8724,7 +8724,7 @@ packages: dev: false file:projects/arm-consumption.tgz: - resolution: {integrity: sha512-RaHr5iariWc5Xz58Evx/JQZWH+KXT+v7rE2MVTDCjz353IW62T82d+AI6efpTg3MzqELWUUtYGR84Z+3eIufzA==, tarball: file:projects/arm-consumption.tgz} + resolution: {integrity: sha512-YjK7stiTBlBiXxebltf5xHVnVMNtKmlibXE6YDGJffw8UiSM5K7dreHxtFYdSg+d0DVwjHPr+xefXEwQBoCHEA==, tarball: file:projects/arm-consumption.tgz} name: '@rush-temp/arm-consumption' version: 0.0.0 dependencies: @@ -8734,6 +8734,7 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@1.32.1 '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + '@types/node': 12.20.37 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -8742,9 +8743,6 @@ packages: tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.3 - transitivePeerDependencies: - - debug - - supports-color dev: false file:projects/arm-containerregistry.tgz: From 2f2e80a2f77f292e436f00bbb860d224adcfba8e Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 11:03:51 +0800 Subject: [PATCH 09/14] update --- eng/common/scripts/Verify-Links.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/scripts/Verify-Links.ps1 b/eng/common/scripts/Verify-Links.ps1 index 275d4bbde5bd..b1e3d5862955 100644 --- a/eng/common/scripts/Verify-Links.ps1 +++ b/eng/common/scripts/Verify-Links.ps1 @@ -244,10 +244,10 @@ function CheckLink ([System.Uri]$linkUri, $allowRetry=$true) if ($statusCode -in $errorStatusCodes) { if ($originalLinkUri -ne $linkUri) { - LogError "[$statusCode] broken link $originalLinkUri (resolved to $linkUri)" + LogWarning "[$statusCode] broken link $originalLinkUri (resolved to $linkUri)" } else { - LogError "[$statusCode] broken link $linkUri" + LogWarning "[$statusCode] broken link $linkUri" } $linkValid = $false @@ -433,7 +433,7 @@ while ($pageUrisToCheck.Count -ne 0) $checkedPages[$pageUri] = $true; $linkUris = GetLinks $pageUri - Write-Host "Checking $($linkUris.Count) links found on page $pageUri"; + Write-Host "Found $($linkUris.Count) links on page $pageUri"; $badLinksPerPage = @(); foreach ($linkUri in $linkUris) { $isLinkValid = CheckLink $linkUri @@ -470,7 +470,7 @@ foreach ($pageLink in $badLinks.Keys) { $linksChecked = $checkedLinks.Count - $cachedLinksCount if ($badLinks.Count -gt 0) { - Write-Host "Checked $linksChecked links with $($badLinks.Count) broken link(s) found." + LogError "Checked $linksChecked links with $($badLinks.Count) page(s) broken." } else { Write-Host "Checked $linksChecked links. No broken links found." From 42f84b2414808edc0abeac0ef2c7bcc21b023af3 Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 11:05:29 +0800 Subject: [PATCH 10/14] update --- eng/common/scripts/Verify-Links.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/eng/common/scripts/Verify-Links.ps1 b/eng/common/scripts/Verify-Links.ps1 index b1e3d5862955..3808d1f8bb5e 100644 --- a/eng/common/scripts/Verify-Links.ps1 +++ b/eng/common/scripts/Verify-Links.ps1 @@ -423,9 +423,6 @@ foreach ($url in $urls) { $pageUrisToCheck.Enqueue($uri); } -if ($devOpsLogging) { - Write-Host "##[group]Link checking details" -} while ($pageUrisToCheck.Count -ne 0) { $pageUri = $pageUrisToCheck.Dequeue(); @@ -453,9 +450,6 @@ while ($pageUrisToCheck.Count -ne 0) $badLinks[$pageUri] = $badLinksPerPage } } -if ($devOpsLogging) { - Write-Host "##[endgroup]" -} if ($badLinks.Count -gt 0) { Write-Host "Summary of broken links:" From c5427e87c37863ea4ef7e38485c7ddf8ce018b77 Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 11:17:14 +0800 Subject: [PATCH 11/14] update --- eng/common/scripts/Verify-Links.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eng/common/scripts/Verify-Links.ps1 b/eng/common/scripts/Verify-Links.ps1 index 3808d1f8bb5e..c4ebc328a83d 100644 --- a/eng/common/scripts/Verify-Links.ps1 +++ b/eng/common/scripts/Verify-Links.ps1 @@ -423,6 +423,10 @@ foreach ($url in $urls) { $pageUrisToCheck.Enqueue($uri); } +if ($devOpsLogging) { + Write-Host "##[group]Link checking details" +} + while ($pageUrisToCheck.Count -ne 0) { $pageUri = $pageUrisToCheck.Dequeue(); @@ -451,6 +455,10 @@ while ($pageUrisToCheck.Count -ne 0) } } +if ($devOpsLogging) { + Write-Host "##[endgroup]" +} + if ($badLinks.Count -gt 0) { Write-Host "Summary of broken links:" } From 920e91ba227b05bfa5b190c607b94b52f99e331e Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 11:42:32 +0800 Subject: [PATCH 12/14] update --- .../my_test/recording_budgets_create_test.js | 46 ++--- .../my_test/recording_budgets_delete_test.js | 44 ++--- .../my_test/recording_budgets_get_test.js | 46 ++--- .../node/my_test/recording_sample_test.js | 5 - .../arm-consumption/test/sampleTest.ts | 178 +++++++++--------- 5 files changed, 157 insertions(+), 162 deletions(-) delete mode 100644 sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js index acbe43d24f0b..598632acd2be 100644 --- a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js @@ -23,19 +23,19 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'a43d7a26-6767-4075-a181-1561d964f601', + '6905b3c7-eca5-4ac5-814d-6b2c5eb00100', 'x-ms-ests-server', - '2.1.12197.4 - SEASLR2 ProdSlices', + '2.1.12249.11 - SEASLR1 ProdSlices', 'Set-Cookie', - 'fpc=AqrS1p57lx1Cpe5Te6Imj98; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Au4pTUwehPxIot56gwt0IBY; expires=Thu, 16-Dec-2021 03:38:23 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrCU85jVtLoh5jgtu0cnOZtInaYUYwJwXeoByd3ewzqr5zOtPm9TfejF4pHU0UO1Sn6aHmQ9TXO4AUVpjVjE-fb6pySlOu5Y74jqeeg-yHv6DQMa6pWRRH0E5uxygdID4aT-EWGXvGBj_P6cF2Beb-0Ud2ybCt-LL8Vl1zkc93hX8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrOGEfP2B9jB4BUjNKpSdsxJAsCk8TTTdRvM6Q6rsglZacgBJIn0eYVQYRTGnPBytsSZbsmttxVLx1NgVXwNN_d0eAfO6f7BdP1sKqNf9henm6qBagWWjrblNmLIWXAh-aFPYV4Pv1SbWXVu_FKCstQ6wHkevcjuFl5j78XylcMcsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:51 GMT', + 'Tue, 16 Nov 2021 03:38:22 GMT', 'Content-Length', '980' ]); @@ -58,25 +58,25 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '393dbe28-747b-4c3b-8eaf-5ec8c13a9100', + 'e4a5a4cd-f48a-4f01-ba0e-f5d77d930100', 'x-ms-ests-server', - '2.1.12231.7 - SEASLR1 ProdSlices', + '2.1.12249.11 - SEASLR1 ProdSlices', 'Set-Cookie', - 'fpc=Ap27LJzMrxxHh_lVvdTPCtA; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AogYi2TG8wdKiL_LmspQHic; expires=Thu, 16-Dec-2021 03:38:23 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrWvGkLNRSamtmNu5-fZD_KXOdXyIiL6Tnx5Jp8rC87oEy2VGXorPTYpOjDS8v2UYZygJt02YyW0EIUwU44CiyYy5jSep3yr6HVexcVpdk7Q-PFz53nZ6h1_SeML6RiMLaijNHUAd_JfFFGAZGabqvpm9kNwHtnHc7McjgvqZlriogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrrBeeg5yFjos2vi8stDMd_Rx9d5KMZLmsJ_yfv-wMCm7Ar34EDrmf3kwnaXy0M053RxBPkjiSZsBMvlqJi0IlYz0XpSu6VECRwbYhmAfpauhfbcZHAd1b-Y93YeoeDuK-cS54CBgPLuDQXLIpB854cQ-JN8ZI6mCDYMQAjOIZ6aEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:52 GMT', + 'Tue, 16 Nov 2021 03:38:22 GMT', 'Content-Length', '1753' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d6071789-5899-4162-981b-b45c61869723&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=bf53fcd5-48e5-429d-98c4-8da50dbc754e&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', @@ -93,27 +93,27 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '0a57fd69-e42d-472b-b036-82d53b0e4c00', + '5367927a-fcb7-4e69-827c-c1a95afc0100', 'x-ms-ests-server', - '2.1.12231.7 - KRSLR1 ProdSlices', + '2.1.12249.11 - KRSLR1 ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=AnsFvHbzMHBFqYjKfNQ76XYWPr5BAQAAADAGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AtdBJgjrMa5EvtVJiM0I1xMWPr5BAQAAAK8eJdkOAAAA; expires=Thu, 16-Dec-2021 03:38:23 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:52 GMT', + 'Tue, 16 Nov 2021 03:38:22 GMT', 'Content-Length', - '1351' + '1374' ]); nock('https://management.azure.com:443', {"encodedQueryParams":true}) .put('//subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy', {"properties":{"category":"Cost","amount":100,"timeGrain":"Monthly","timePeriod":{"startDate":"2021-11-01T00:00:00.000Z","endDate":"2021-12-01T00:00:00.000Z"},"filter":{"and":[{"dimensions":{"name":"ResourceId","operator":"In","values":["/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Compute/virtualMachines/myvmxxx"]}},{"tags":{"name":"category","operator":"In","values":["Dev","Prod"]}}]},"notifications":{"Actual_GreaterThan_80_Percent":{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["johndoe@contoso.com","janesmith@contoso.com"],"contactRoles":["Contributor","Reader"],"thresholdType":"Actual"}}}}) .query(true) - .reply(201, {"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy","name":"mybudgetxxxy","type":"Microsoft.Consumption/budgets","eTag":"\"1d7da8cd02cd48e\"","properties":{"timePeriod":{"startDate":"2021-11-01T00:00:00Z","endDate":"2021-12-01T00:00:00Z"},"timeGrain":"Monthly","amount":100,"currentSpend":null,"category":"Cost","notifications":{"actual_GreaterThan_80_Percent":{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["johndoe@contoso.com","janesmith@contoso.com"],"contactRoles":["Contributor","Reader"],"contactGroups":[],"thresholdType":"Actual"}},"filter":{"and":[{"dimensions":{"name":"ResourceId","operator":"In","values":["/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Compute/virtualMachines/myvmxxx"]}},{"tags":{"name":"category","operator":"In","values":["Dev","Prod"]}}]}}}, [ + .reply(201, {"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy","name":"mybudgetxxxy","type":"Microsoft.Consumption/budgets","eTag":"\"1d7da9b69bf50b5\"","properties":{"timePeriod":{"startDate":"2021-11-01T00:00:00Z","endDate":"2021-12-01T00:00:00Z"},"timeGrain":"Monthly","amount":100,"currentSpend":null,"category":"Cost","notifications":{"actual_GreaterThan_80_Percent":{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["johndoe@contoso.com","janesmith@contoso.com"],"contactRoles":["Contributor","Reader"],"contactGroups":[],"thresholdType":"Actual"}},"filter":{"and":[{"dimensions":{"name":"ResourceId","operator":"In","values":["/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Compute/virtualMachines/myvmxxx"]}},{"tags":{"name":"category","operator":"In","values":["Dev","Prod"]}}]}}}, [ 'Cache-Control', 'no-cache', 'Pragma', @@ -127,23 +127,23 @@ nock('https://management.azure.com:443', {"encodedQueryParams":true}) 'Location', 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy?api-version=2021-10-01', 'session-id', - 'b6495e91-9956-43de-a874-3d6d4b5fb578', + '0c4ef433-5e58-469a-9bba-bd5b4b195e43', 'x-ms-request-id', - '0eb04407-fb89-466e-916a-f376f0e6e554', + 'e4155400-8544-4fe2-b5df-866b45551d3f', 'x-ms-correlation-request-id', - '022d8521-b182-4995-81a0-f2d3394b792b', + 'e8480ae1-e758-4d27-9bd0-ad67388e04cd', 'x-ms-client-request-id', - '55a92640-e8b1-401f-b233-2b58264334ab', + '11b79294-e122-4479-8db5-5b780a9fe8ff', 'X-Powered-By', 'ASP.NET', 'x-ms-ratelimit-remaining-subscription-writes', '1199', 'x-ms-routing-request-id', - 'KOREASOUTH:20211116T015355Z:022d8521-b182-4995-81a0-f2d3394b792b', + 'SOUTHEASTASIA:20211116T033826Z:e8480ae1-e758-4d27-9bd0-ad67388e04cd', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains', 'X-Content-Type-Options', 'nosniff', 'Date', - 'Tue, 16 Nov 2021 01:53:55 GMT' + 'Tue, 16 Nov 2021 03:38:25 GMT' ]); diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js index a9040faff6ba..d76560b03f0a 100644 --- a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js @@ -23,19 +23,19 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'ebd3f0de-f7f3-44e0-b835-492825801c00', + '5367927a-fcb7-4e69-827c-c1a975fc0100', 'x-ms-ests-server', - '2.1.12197.4 - KRSLR2 ProdSlices', + '2.1.12249.11 - KRSLR1 ProdSlices', 'Set-Cookie', - 'fpc=Am4H-ci2Mf1Pt908IOds2Uc; expires=Thu, 16-Dec-2021 01:53:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Aorg_S2qAPNLtG2n8EwSOj0; expires=Thu, 16-Dec-2021 03:38:27 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrjEfLOwIkPp4qlFgxK2BAG6HpE0KwJuEn1HAQ1h62xhmZViuA0kO8qdEbYDbA3n9sIblOEjItNhoPoxqBLDtqcJV7nwMaNU8l2Qw2Mdk5OfxR-WLTcEpJy1PTR9mK2LstLeIDE98Gy2ifq_7g_TEq_nRjmmpIvtY9U_KDjaaYrkYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrAB4ybLhrtZRd-CT3Ch5Tb0c4howG8NlsLadI8ji3mL_iffGw4Uw4nEQVNws5tlY1Wlp_5zuDUjRM_hyP-07YlOtvTTdT5o_6o70XbPb863uckDmU7oq5x3K2mS-Jd3dX0rIjLIqFGXn0SE-wIsEy4dBhXGoZdX5bLaL8H5NPim0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Tue, 16 Nov 2021 03:38:26 GMT', 'Content-Length', '980' ]); @@ -58,25 +58,25 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'f309842f-710c-41a5-8a1b-c2d3f45d5701', + '7ce809f4-9ab5-4e09-82b4-eeddb85f0100', 'x-ms-ests-server', - '2.1.12231.7 - KRSLR2 ProdSlices', + '2.1.12249.11 - KRSLR2 ProdSlices', 'Set-Cookie', - 'fpc=Ar9eD24GauJMjchhBnmxj-g; expires=Thu, 16-Dec-2021 01:53:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Ak_nL1S68kRDs5ABSUSG_j8; expires=Thu, 16-Dec-2021 03:38:27 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrJhqa4SaqrrPj7UMYEgyTZfkU4YMS3E0DnT-g8JXrOWcbPzZpOJ_fazMypNEuAwlYR4XvrQ23HOWMCyaDx2n3s4WjqU-OuXkxx85uV-QoHVqylP26y39uRyqIqp6qWIaK7G3dq-608n8CZpK-AKrpVcclXRporVfqDVqIrmgDHZogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrHCz0gqW-2kaoGpn0IK0HZXYkocKo0fA8USeYqjqPxsCwl5no45nMX1JH1A06yzlWYzO4po8r-lrIWdiIEQo8wum9g9AcS7qYrOreDjJcIyLvg4u7QyusEmp3IdSOYHM6d5-ja3j7tQl6g08_ne7VQdl48de-DflwnLpPXmwHoa0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Tue, 16 Nov 2021 03:38:26 GMT', 'Content-Length', '1753' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=46b65d1b-aa64-4d7b-b713-60c3fb901b67&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=8da93fee-f3d1-45e6-9049-de93a0fb9a24&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', @@ -93,21 +93,21 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '78c372be-d672-497b-96fc-4161d1d2f300', + '7ce809f4-9ab5-4e09-82b4-eeddbb5f0100', 'x-ms-ests-server', - '2.1.12231.7 - SEASLR2 ProdSlices', + '2.1.12249.11 - KRSLR2 ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=AiyhANRBpIpNi-uYvt-UUq0WPr5BAQAAADQGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AvDsEOPjepRIixlVtyIhypUWPr5BAQAAALMeJdkOAAAA; expires=Thu, 16-Dec-2021 03:38:27 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Tue, 16 Nov 2021 03:38:26 GMT', 'Content-Length', - '1351' + '1374' ]); nock('https://management.azure.com:443', {"encodedQueryParams":true}) @@ -121,25 +121,25 @@ nock('https://management.azure.com:443', {"encodedQueryParams":true}) 'Expires', '-1', 'session-id', - 'fc2344ed-e04b-4dba-94c6-629c7961dfd5', + '204f71f0-e455-446a-9d05-8fee54c8560f', 'x-ms-request-id', - '4575d984-26e9-4480-aab0-a0f84b210d96', + '3aea6caf-20d5-4de1-b568-2f17e31f2959', 'x-ms-correlation-request-id', - '4d6dfd02-6873-4860-bfb1-aaf97e6719da', + '4bf54625-ac6a-4109-8ce5-e6d037dfbc93', 'x-ms-client-request-id', - '6b48a22b-2d57-4902-908c-80b9ed4a6b39', + '028dd08d-03cb-415f-a656-7e96029eaeb9', 'X-Powered-By', 'ASP.NET', 'x-ms-ratelimit-remaining-subscription-deletes', '14999', 'x-ms-routing-request-id', - 'KOREASOUTH:20211116T015358Z:4d6dfd02-6873-4860-bfb1-aaf97e6719da', + 'SOUTHEASTASIA:20211116T033828Z:4bf54625-ac6a-4109-8ce5-e6d037dfbc93', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains', 'X-Content-Type-Options', 'nosniff', 'Date', - 'Tue, 16 Nov 2021 01:53:58 GMT', + 'Tue, 16 Nov 2021 03:38:28 GMT', 'Content-Length', '0' ]); diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js index 093165c58667..7e43dde3c753 100644 --- a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js @@ -23,19 +23,19 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'd8a4ace5-c4d3-4353-b6ea-bd8986839200', + '5367927a-fcb7-4e69-827c-c1a96efc0100', 'x-ms-ests-server', - '2.1.12231.7 - KRSLR1 ProdSlices', + '2.1.12249.11 - KRSLR1 ProdSlices', 'Set-Cookie', - 'fpc=AocZvaGf5zBPlXgBt-ctz54; expires=Thu, 16-Dec-2021 01:53:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=An6mImVcfStIhbCp9WgDEJA; expires=Thu, 16-Dec-2021 03:38:26 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrdgrLRL1XUS4d7pL4YVT2cg74PAq2xyHlE8og4jUVU3FmKVFECCpJQxqEe19qqt0-pzr0d8g9d8KBNJkKEQ9PECqFXeqAqgdVPpYhwqJU2ADJSRexuo72NrFUq-P2FV0TecM0svpLm9Q0t0x355ywJIoPLuKgyrOm9UV5q3YD178gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevreEsHsFuEgYabd6zHaT49OefRzy_3pDRulZbG-kBtuWxaf546pL2F17rQ8xked9YqyED4CFftbpB1IMNi0dXHu0Bnrtf20sQnivu4x9FhtHl7U3puzzT5Nawp-reZRd7EV2KG62urLkxyBvOEs7OUrE89tdgktax3omexq8iXFt4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Tue, 16 Nov 2021 03:38:25 GMT', 'Content-Length', '980' ]); @@ -58,25 +58,25 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'ac566b03-181e-4262-af31-1e928eac4400', + '43e96e34-bb4a-458f-9d99-3fc99b800100', 'x-ms-ests-server', - '2.1.12231.7 - KRSLR2 ProdSlices', + '2.1.12249.11 - KRSLR2 ProdSlices', 'Set-Cookie', - 'fpc=AgEssqnNKSBEg4uOEEvKfTY; expires=Thu, 16-Dec-2021 01:53:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AhrMrTlBtGpIvzAh4_ZBHkg; expires=Thu, 16-Dec-2021 03:38:26 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrN-etrqYjMIgF4CBAvYrWjOBR438XdA3Nx0tg3VQloy91W779NkZ1C6zenICThVlcAcf_1S6_VNdxOXRCWojiDZL2zaqDgixhyBaGR9pHhFwLrd5Cx6CjWQSwU2aUkXd-TGyAraUJbyR-dHVggg1Rp14YSKYlqefaocN9fukLdzAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrZUNYJLbY7GmwtMe7jFk9dEsDzhfrY6UxeGjHuZCkuK2OCulWZ5H6XgURqLHT9goxiMx_LJwAEZwktM3lkY2N9OU3zjSziQ2PY1a-ECQNEys7zjxvTKDMMtOW48Zopea-xHfxVA4Pxd2v5ETC83Zal9FapV4dtppNcqUAKtqOWbMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Tue, 16 Nov 2021 03:38:25 GMT', 'Content-Length', '1753' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=c825f9a4-573c-47ef-a57b-559fab9c4fff&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=e2584893-6efa-4a36-b251-c54d0661269c&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', @@ -93,27 +93,27 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '96145cac-462e-4752-9529-a63d3649be00', + '31f6a6c5-b64f-4e07-9038-9717cb820100', 'x-ms-ests-server', - '2.1.12231.7 - SEASLR2 ProdSlices', + '2.1.12249.11 - SEASLR2 ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=Aunwf9emLg1ImlWmmny3U8QWPr5BAQAAADMGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Arp1ogwMF3hKjO6UegC61KYWPr5BAQAAALIeJdkOAAAA; expires=Thu, 16-Dec-2021 03:38:26 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Tue, 16 Nov 2021 03:38:25 GMT', 'Content-Length', - '1351' + '1374' ]); nock('https://management.azure.com:443', {"encodedQueryParams":true}) .get('//subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy') .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e4f08ea7ac1d0ef4ed6b38bbcc50bf2dbbb77efae3f1a7db4cc163961d2f9b4bd5ee1d38d90a859fe26bba066bfef47bbb307b3ec603adbd99bcef60ff2dff723fa92105ae5755be4cd478f7ef1476db1c85fe67551d1b87ff1474d9bd5edd3ac45277b3b7bbbdbbbbbdb3bbb6f76761ef1ff7e8a5ecf97b3a0c15ed8e097109204f2f33a2b96d4e68b6ad9ce4ba09e2daaf5b2fde8d1eecece7867f4d1745dd7f9b27dbd2278e8d97ccd5fae9705fdfad157af9f02de94babba8ea6bfae4a46a5a82b5acdae2bca0cf69d83c8a6cdaaeb3f2f7ffbccea96dfd669e2d7fff839ddf9fc635a53ed0205f669332a79eda7a9d8f3e0205b2b6aa09a4f70e416ee7348ff3aaa496078cca940640d04f1759515257dffbe8a7abf97256e5bf27bea039184fab05bdf7d3d9326f16453b0f3effbe7dff555582dedfa3112cdbba98acd1f9e8a3577946ace1b513eea186f491c5e58dccfa310ff2a35f4224392f4ac21903cb40beeffde28f6644f46563e8a1dcf34a79f26c467d79633ec3502fb3722d38ddfd5967f7c56adde6772f8b1a23f8229bce0b2217bd74b920c6fee8fb3424e2c4ec82b0b1b8d3eccaac6fc2fc697e497fbfac897b0908fdef97","fc3fcbe70aa8c2030000"], [ + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e4f08ea7ac1d0ef4ed6b38bbcc50bf2dbbb77efae3f1a7db4cc163961d2f9b4bd5ee1d38d90a859fe26bba066bfef47bbb307b3ece1e4d38793f3fb3b93fbbfef47f42521b4caebb6c89b8f1efde28fda6291bfcceba2a271ffe28f9a36abdba7598b4ef676f676b77777b77776dfecec3ce2fffd14bd9e2f674183bdb0c12f212409e4e775562ca9cd17d5b29d97403d5b54eb65fbd1a3dd9d9df1cee8a3e9baaef365fb7a45f0d0b3f99abf5c2f0bfaf5a3af5e3f05bc29757751d5d7f4c949d5b4046b59b5c579419fd3b07914d9b45d67e5efff799d53dbfacd3c5bfefe073bbf3f8d6b4a7da041becc26654e3db5f53a1f7d040a646d551348ef1d82dcce691ee755492d0f1895290d80a09f2eb2a2a4aebef7d14f57f3e5acca7f4f7c4173309e560b7aefa7b365de2c8a761e7cfe7dfbfeabaa04bdbf472358b6753159a3f3d147aff28c58c36b27dc430de9238bcb1b99f5631ee447bf8448725e9484330696817cdffbc51fcd88e8cbc6d043b9e795f2e4d98cfaf2c67c86a15e66e55a70bafbb3ceee8bd5bacdef5e163546f045369d17442e7ae972418cfdd1f76948c489d905616371a7d99559df84f9d3fc92fe7e5913f71210fadf","2ff97f00ddf702ffc2030000"], [ 'Cache-Control', 'no-cache', 'Pragma', @@ -129,23 +129,23 @@ nock('https://management.azure.com:443', {"encodedQueryParams":true}) 'Vary', 'Accept-Encoding,Accept-Encoding', 'session-id', - '4f16022a-135f-43c2-ba11-41f5fd070cf0', + '69f24cdc-9e41-40f9-956f-3a576b1c7df0', 'x-ms-request-id', - '92bedf6a-e9a1-402c-b42c-e4eaaa276e74', + 'd2246f3a-061d-47e4-a012-60ae5d43aa6c', 'x-ms-correlation-request-id', - 'e60481a5-3b6f-458e-81b5-a74061b8c059', + '141dead1-a1f4-48c7-a031-3d9ef54b5fed', 'x-ms-client-request-id', - '74ef2d87-4890-492b-b54f-8cf903043865', + '6187902f-168e-4daa-9ee6-56bf29c8af2b', 'X-Powered-By', 'ASP.NET', 'x-ms-ratelimit-remaining-subscription-reads', '11999', 'x-ms-routing-request-id', - 'KOREASOUTH:20211116T015356Z:e60481a5-3b6f-458e-81b5-a74061b8c059', + 'SOUTHEASTASIA:20211116T033827Z:141dead1-a1f4-48c7-a031-3d9ef54b5fed', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains', 'X-Content-Type-Options', 'nosniff', 'Date', - 'Tue, 16 Nov 2021 01:53:56 GMT' + 'Tue, 16 Nov 2021 03:38:26 GMT' ]); diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js deleted file mode 100644 index 0f6ecb857acf..000000000000 --- a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/consumption/arm-consumption/test/sampleTest.ts b/sdk/consumption/arm-consumption/test/sampleTest.ts index 6bf25b160209..f7b67cabafc3 100644 --- a/sdk/consumption/arm-consumption/test/sampleTest.ts +++ b/sdk/consumption/arm-consumption/test/sampleTest.ts @@ -15,7 +15,7 @@ import { import * as assert from "assert"; import { ClientSecretCredential } from "@azure/identity"; import { ConsumptionManagementClient } from "../src/consumptionManagementClient"; -import { ComputeManagementClient,VirtualMachine } from "@azure/arm-compute"; +// import { ComputeManagementClient,VirtualMachine } from "@azure/arm-compute"; import { NetworkManagementClient,NetworkInterface,VirtualNetwork } from "@azure/arm-network"; const recorderEnvSetup: RecorderEnvironmentSetup = { @@ -39,7 +39,7 @@ describe("My test", () => { let recorder: Recorder; let subscriptionId: string; let client: ConsumptionManagementClient; - let compute_client: ComputeManagementClient; + // let compute_client: ComputeManagementClient; let network_client: NetworkManagementClient; let location: string; let resourceGroup: string; @@ -60,7 +60,7 @@ describe("My test", () => { env.AZURE_CLIENT_SECRET ); client = new ConsumptionManagementClient(credential, subscriptionId); - compute_client = new ComputeManagementClient(credential,subscriptionId); + // compute_client = new ComputeManagementClient(credential,subscriptionId); network_client = new NetworkManagementClient(credential,subscriptionId); location = "eastus"; resourceGroup = "myjstest"; @@ -77,95 +77,95 @@ describe("My test", () => { await recorder.stop(); }); - //network_client.virtualNetworks.createOrUpdate - async function createVirtualNetwork() { - const parameter: VirtualNetwork = { - location: location, - addressSpace: { - addressPrefixes: ["10.0.0.0/16"], - }, - }; - const virtualNetworks_create_info = await network_client.virtualNetworks.beginCreateOrUpdateAndWait(resourceGroup,network_name,parameter); - console.log(virtualNetworks_create_info); + // //network_client.virtualNetworks.createOrUpdate + // async function createVirtualNetwork() { + // const parameter: VirtualNetwork = { + // location: location, + // addressSpace: { + // addressPrefixes: ["10.0.0.0/16"], + // }, + // }; + // const virtualNetworks_create_info = await network_client.virtualNetworks.beginCreateOrUpdateAndWait(resourceGroup,network_name,parameter); + // console.log(virtualNetworks_create_info); - // - const subnet__create_info = await network_client.subnets.beginCreateOrUpdateAndWait(resourceGroup,network_name,subnet_name,{addressPrefix: "10.0.0.0/24"}); - } + // // + // const subnet__create_info = await network_client.subnets.beginCreateOrUpdateAndWait(resourceGroup,network_name,subnet_name,{addressPrefix: "10.0.0.0/24"}); + // } - //network_client.networkInterfaces.createOrUpdate - async function createNetworkInterface(group_name: any,location: any,nic_name: any) { - const parameter: NetworkInterface = { - location: location, - ipConfigurations: [ - { - name: "MyIpConfig", - subnet: { - id: "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/virtualNetworks/" +network_name +"/subnets/" +subnet_name, - } - } - ] - } - const nic_info = await network_client.networkInterfaces.beginCreateOrUpdateAndWait(group_name,nic_name,parameter); - } + // //network_client.networkInterfaces.createOrUpdate + // async function createNetworkInterface(group_name: any,location: any,nic_name: any) { + // const parameter: NetworkInterface = { + // location: location, + // ipConfigurations: [ + // { + // name: "MyIpConfig", + // subnet: { + // id: "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/virtualNetworks/" +network_name +"/subnets/" +subnet_name, + // } + // } + // ] + // } + // const nic_info = await network_client.networkInterfaces.beginCreateOrUpdateAndWait(group_name,nic_name,parameter); + // } - //virtualMachines.createOrUpdate - async function virtualMachines_createOrUpdate() { - await createVirtualNetwork(); - await createNetworkInterface(resourceGroup, location, interface_name); - const parameter: VirtualMachine = { - location: location, - hardwareProfile: { - vmSize: "Standard_D2_v2", - }, - storageProfile: { - imageReference: { - sku: "2016-Datacenter", - publisher: "MicrosoftWindowsServer", - version: "latest", - offer: "WindowsServer", - }, - osDisk: { - caching: "ReadWrite", - managedDisk: { - storageAccountType: "Standard_LRS", - }, - name: "myVMosdisk", - createOption: "FromImage", - }, - dataDisks: [ - { - diskSizeGB: 1023, - createOption: "Empty", - lun: 0, - }, - { - diskSizeGB: 1023, - createOption: "Empty", - lun: 1, - }, - ], - }, - osProfile: { - adminUsername: "testuser", - computerName: "myVM", - adminPassword: "Aa!1()-xyz", - windowsConfiguration: { - enableAutomaticUpdates: true, // need automatic update for reimage - }, - }, - networkProfile: { - networkInterfaces: [ - { - id: - "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/networkInterfaces/" +interface_name, - primary: true, - }, - ], - }, - }; - const res = await compute_client.virtualMachines.beginCreateOrUpdateAndWait(resourceGroup,vmName,parameter); - console.log(res); - } + // //virtualMachines.createOrUpdate + // async function virtualMachines_createOrUpdate() { + // await createVirtualNetwork(); + // await createNetworkInterface(resourceGroup, location, interface_name); + // const parameter: VirtualMachine = { + // location: location, + // hardwareProfile: { + // vmSize: "Standard_D2_v2", + // }, + // storageProfile: { + // imageReference: { + // sku: "2016-Datacenter", + // publisher: "MicrosoftWindowsServer", + // version: "latest", + // offer: "WindowsServer", + // }, + // osDisk: { + // caching: "ReadWrite", + // managedDisk: { + // storageAccountType: "Standard_LRS", + // }, + // name: "myVMosdisk", + // createOption: "FromImage", + // }, + // dataDisks: [ + // { + // diskSizeGB: 1023, + // createOption: "Empty", + // lun: 0, + // }, + // { + // diskSizeGB: 1023, + // createOption: "Empty", + // lun: 1, + // }, + // ], + // }, + // osProfile: { + // adminUsername: "testuser", + // computerName: "myVM", + // adminPassword: "Aa!1()-xyz", + // windowsConfiguration: { + // enableAutomaticUpdates: true, // need automatic update for reimage + // }, + // }, + // networkProfile: { + // networkInterfaces: [ + // { + // id: + // "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/networkInterfaces/" +interface_name, + // primary: true, + // }, + // ], + // }, + // }; + // const res = await compute_client.virtualMachines.beginCreateOrUpdateAndWait(resourceGroup,vmName,parameter); + // console.log(res); + // } it("budgets create test", async function() { const res = await client.budgets.createOrUpdate(scope,budgetName,{ From b9ddb942192bd2cc68cf0178c70cf6ce99f599d6 Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 12:02:11 +0800 Subject: [PATCH 13/14] update --- eng/common/scripts/Verify-Links.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Verify-Links.ps1 b/eng/common/scripts/Verify-Links.ps1 index c4ebc328a83d..b39538cb75b9 100644 --- a/eng/common/scripts/Verify-Links.ps1 +++ b/eng/common/scripts/Verify-Links.ps1 @@ -244,10 +244,10 @@ function CheckLink ([System.Uri]$linkUri, $allowRetry=$true) if ($statusCode -in $errorStatusCodes) { if ($originalLinkUri -ne $linkUri) { - LogWarning "[$statusCode] broken link $originalLinkUri (resolved to $linkUri)" + LogError "[$statusCode] broken link $originalLinkUri (resolved to $linkUri)" } else { - LogWarning "[$statusCode] broken link $linkUri" + LogError "[$statusCode] broken link $linkUri" } $linkValid = $false From f22784dd75cb0a22079bd2dd44ec14ff137fb9f7 Mon Sep 17 00:00:00 2001 From: colawwj Date: Tue, 16 Nov 2021 13:51:19 +0800 Subject: [PATCH 14/14] back 3938 --- eng/common/scripts/Verify-Links.ps1 | 10 +- .../my_test/recording_budgets_create_test.js | 46 ++--- .../my_test/recording_budgets_delete_test.js | 44 ++--- .../my_test/recording_budgets_get_test.js | 46 ++--- .../node/my_test/recording_sample_test.js | 5 - .../arm-consumption/test/sampleTest.ts | 178 +++++++++--------- 6 files changed, 163 insertions(+), 166 deletions(-) delete mode 100644 sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js diff --git a/eng/common/scripts/Verify-Links.ps1 b/eng/common/scripts/Verify-Links.ps1 index 275d4bbde5bd..c4ebc328a83d 100644 --- a/eng/common/scripts/Verify-Links.ps1 +++ b/eng/common/scripts/Verify-Links.ps1 @@ -244,10 +244,10 @@ function CheckLink ([System.Uri]$linkUri, $allowRetry=$true) if ($statusCode -in $errorStatusCodes) { if ($originalLinkUri -ne $linkUri) { - LogError "[$statusCode] broken link $originalLinkUri (resolved to $linkUri)" + LogWarning "[$statusCode] broken link $originalLinkUri (resolved to $linkUri)" } else { - LogError "[$statusCode] broken link $linkUri" + LogWarning "[$statusCode] broken link $linkUri" } $linkValid = $false @@ -426,6 +426,7 @@ foreach ($url in $urls) { if ($devOpsLogging) { Write-Host "##[group]Link checking details" } + while ($pageUrisToCheck.Count -ne 0) { $pageUri = $pageUrisToCheck.Dequeue(); @@ -433,7 +434,7 @@ while ($pageUrisToCheck.Count -ne 0) $checkedPages[$pageUri] = $true; $linkUris = GetLinks $pageUri - Write-Host "Checking $($linkUris.Count) links found on page $pageUri"; + Write-Host "Found $($linkUris.Count) links on page $pageUri"; $badLinksPerPage = @(); foreach ($linkUri in $linkUris) { $isLinkValid = CheckLink $linkUri @@ -453,6 +454,7 @@ while ($pageUrisToCheck.Count -ne 0) $badLinks[$pageUri] = $badLinksPerPage } } + if ($devOpsLogging) { Write-Host "##[endgroup]" } @@ -470,7 +472,7 @@ foreach ($pageLink in $badLinks.Keys) { $linksChecked = $checkedLinks.Count - $cachedLinksCount if ($badLinks.Count -gt 0) { - Write-Host "Checked $linksChecked links with $($badLinks.Count) broken link(s) found." + LogError "Checked $linksChecked links with $($badLinks.Count) page(s) broken." } else { Write-Host "Checked $linksChecked links. No broken links found." diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js index acbe43d24f0b..598632acd2be 100644 --- a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_create_test.js @@ -23,19 +23,19 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'a43d7a26-6767-4075-a181-1561d964f601', + '6905b3c7-eca5-4ac5-814d-6b2c5eb00100', 'x-ms-ests-server', - '2.1.12197.4 - SEASLR2 ProdSlices', + '2.1.12249.11 - SEASLR1 ProdSlices', 'Set-Cookie', - 'fpc=AqrS1p57lx1Cpe5Te6Imj98; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Au4pTUwehPxIot56gwt0IBY; expires=Thu, 16-Dec-2021 03:38:23 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrCU85jVtLoh5jgtu0cnOZtInaYUYwJwXeoByd3ewzqr5zOtPm9TfejF4pHU0UO1Sn6aHmQ9TXO4AUVpjVjE-fb6pySlOu5Y74jqeeg-yHv6DQMa6pWRRH0E5uxygdID4aT-EWGXvGBj_P6cF2Beb-0Ud2ybCt-LL8Vl1zkc93hX8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrOGEfP2B9jB4BUjNKpSdsxJAsCk8TTTdRvM6Q6rsglZacgBJIn0eYVQYRTGnPBytsSZbsmttxVLx1NgVXwNN_d0eAfO6f7BdP1sKqNf9henm6qBagWWjrblNmLIWXAh-aFPYV4Pv1SbWXVu_FKCstQ6wHkevcjuFl5j78XylcMcsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:51 GMT', + 'Tue, 16 Nov 2021 03:38:22 GMT', 'Content-Length', '980' ]); @@ -58,25 +58,25 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '393dbe28-747b-4c3b-8eaf-5ec8c13a9100', + 'e4a5a4cd-f48a-4f01-ba0e-f5d77d930100', 'x-ms-ests-server', - '2.1.12231.7 - SEASLR1 ProdSlices', + '2.1.12249.11 - SEASLR1 ProdSlices', 'Set-Cookie', - 'fpc=Ap27LJzMrxxHh_lVvdTPCtA; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AogYi2TG8wdKiL_LmspQHic; expires=Thu, 16-Dec-2021 03:38:23 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrWvGkLNRSamtmNu5-fZD_KXOdXyIiL6Tnx5Jp8rC87oEy2VGXorPTYpOjDS8v2UYZygJt02YyW0EIUwU44CiyYy5jSep3yr6HVexcVpdk7Q-PFz53nZ6h1_SeML6RiMLaijNHUAd_JfFFGAZGabqvpm9kNwHtnHc7McjgvqZlriogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrrBeeg5yFjos2vi8stDMd_Rx9d5KMZLmsJ_yfv-wMCm7Ar34EDrmf3kwnaXy0M053RxBPkjiSZsBMvlqJi0IlYz0XpSu6VECRwbYhmAfpauhfbcZHAd1b-Y93YeoeDuK-cS54CBgPLuDQXLIpB854cQ-JN8ZI6mCDYMQAjOIZ6aEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:52 GMT', + 'Tue, 16 Nov 2021 03:38:22 GMT', 'Content-Length', '1753' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d6071789-5899-4162-981b-b45c61869723&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=bf53fcd5-48e5-429d-98c4-8da50dbc754e&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', @@ -93,27 +93,27 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '0a57fd69-e42d-472b-b036-82d53b0e4c00', + '5367927a-fcb7-4e69-827c-c1a95afc0100', 'x-ms-ests-server', - '2.1.12231.7 - KRSLR1 ProdSlices', + '2.1.12249.11 - KRSLR1 ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=AnsFvHbzMHBFqYjKfNQ76XYWPr5BAQAAADAGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AtdBJgjrMa5EvtVJiM0I1xMWPr5BAQAAAK8eJdkOAAAA; expires=Thu, 16-Dec-2021 03:38:23 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:52 GMT', + 'Tue, 16 Nov 2021 03:38:22 GMT', 'Content-Length', - '1351' + '1374' ]); nock('https://management.azure.com:443', {"encodedQueryParams":true}) .put('//subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy', {"properties":{"category":"Cost","amount":100,"timeGrain":"Monthly","timePeriod":{"startDate":"2021-11-01T00:00:00.000Z","endDate":"2021-12-01T00:00:00.000Z"},"filter":{"and":[{"dimensions":{"name":"ResourceId","operator":"In","values":["/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Compute/virtualMachines/myvmxxx"]}},{"tags":{"name":"category","operator":"In","values":["Dev","Prod"]}}]},"notifications":{"Actual_GreaterThan_80_Percent":{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["johndoe@contoso.com","janesmith@contoso.com"],"contactRoles":["Contributor","Reader"],"thresholdType":"Actual"}}}}) .query(true) - .reply(201, {"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy","name":"mybudgetxxxy","type":"Microsoft.Consumption/budgets","eTag":"\"1d7da8cd02cd48e\"","properties":{"timePeriod":{"startDate":"2021-11-01T00:00:00Z","endDate":"2021-12-01T00:00:00Z"},"timeGrain":"Monthly","amount":100,"currentSpend":null,"category":"Cost","notifications":{"actual_GreaterThan_80_Percent":{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["johndoe@contoso.com","janesmith@contoso.com"],"contactRoles":["Contributor","Reader"],"contactGroups":[],"thresholdType":"Actual"}},"filter":{"and":[{"dimensions":{"name":"ResourceId","operator":"In","values":["/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Compute/virtualMachines/myvmxxx"]}},{"tags":{"name":"category","operator":"In","values":["Dev","Prod"]}}]}}}, [ + .reply(201, {"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy","name":"mybudgetxxxy","type":"Microsoft.Consumption/budgets","eTag":"\"1d7da9b69bf50b5\"","properties":{"timePeriod":{"startDate":"2021-11-01T00:00:00Z","endDate":"2021-12-01T00:00:00Z"},"timeGrain":"Monthly","amount":100,"currentSpend":null,"category":"Cost","notifications":{"actual_GreaterThan_80_Percent":{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["johndoe@contoso.com","janesmith@contoso.com"],"contactRoles":["Contributor","Reader"],"contactGroups":[],"thresholdType":"Actual"}},"filter":{"and":[{"dimensions":{"name":"ResourceId","operator":"In","values":["/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Compute/virtualMachines/myvmxxx"]}},{"tags":{"name":"category","operator":"In","values":["Dev","Prod"]}}]}}}, [ 'Cache-Control', 'no-cache', 'Pragma', @@ -127,23 +127,23 @@ nock('https://management.azure.com:443', {"encodedQueryParams":true}) 'Location', 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy?api-version=2021-10-01', 'session-id', - 'b6495e91-9956-43de-a874-3d6d4b5fb578', + '0c4ef433-5e58-469a-9bba-bd5b4b195e43', 'x-ms-request-id', - '0eb04407-fb89-466e-916a-f376f0e6e554', + 'e4155400-8544-4fe2-b5df-866b45551d3f', 'x-ms-correlation-request-id', - '022d8521-b182-4995-81a0-f2d3394b792b', + 'e8480ae1-e758-4d27-9bd0-ad67388e04cd', 'x-ms-client-request-id', - '55a92640-e8b1-401f-b233-2b58264334ab', + '11b79294-e122-4479-8db5-5b780a9fe8ff', 'X-Powered-By', 'ASP.NET', 'x-ms-ratelimit-remaining-subscription-writes', '1199', 'x-ms-routing-request-id', - 'KOREASOUTH:20211116T015355Z:022d8521-b182-4995-81a0-f2d3394b792b', + 'SOUTHEASTASIA:20211116T033826Z:e8480ae1-e758-4d27-9bd0-ad67388e04cd', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains', 'X-Content-Type-Options', 'nosniff', 'Date', - 'Tue, 16 Nov 2021 01:53:55 GMT' + 'Tue, 16 Nov 2021 03:38:25 GMT' ]); diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js index a9040faff6ba..d76560b03f0a 100644 --- a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_delete_test.js @@ -23,19 +23,19 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'ebd3f0de-f7f3-44e0-b835-492825801c00', + '5367927a-fcb7-4e69-827c-c1a975fc0100', 'x-ms-ests-server', - '2.1.12197.4 - KRSLR2 ProdSlices', + '2.1.12249.11 - KRSLR1 ProdSlices', 'Set-Cookie', - 'fpc=Am4H-ci2Mf1Pt908IOds2Uc; expires=Thu, 16-Dec-2021 01:53:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Aorg_S2qAPNLtG2n8EwSOj0; expires=Thu, 16-Dec-2021 03:38:27 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrjEfLOwIkPp4qlFgxK2BAG6HpE0KwJuEn1HAQ1h62xhmZViuA0kO8qdEbYDbA3n9sIblOEjItNhoPoxqBLDtqcJV7nwMaNU8l2Qw2Mdk5OfxR-WLTcEpJy1PTR9mK2LstLeIDE98Gy2ifq_7g_TEq_nRjmmpIvtY9U_KDjaaYrkYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrAB4ybLhrtZRd-CT3Ch5Tb0c4howG8NlsLadI8ji3mL_iffGw4Uw4nEQVNws5tlY1Wlp_5zuDUjRM_hyP-07YlOtvTTdT5o_6o70XbPb863uckDmU7oq5x3K2mS-Jd3dX0rIjLIqFGXn0SE-wIsEy4dBhXGoZdX5bLaL8H5NPim0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Tue, 16 Nov 2021 03:38:26 GMT', 'Content-Length', '980' ]); @@ -58,25 +58,25 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'f309842f-710c-41a5-8a1b-c2d3f45d5701', + '7ce809f4-9ab5-4e09-82b4-eeddb85f0100', 'x-ms-ests-server', - '2.1.12231.7 - KRSLR2 ProdSlices', + '2.1.12249.11 - KRSLR2 ProdSlices', 'Set-Cookie', - 'fpc=Ar9eD24GauJMjchhBnmxj-g; expires=Thu, 16-Dec-2021 01:53:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Ak_nL1S68kRDs5ABSUSG_j8; expires=Thu, 16-Dec-2021 03:38:27 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrJhqa4SaqrrPj7UMYEgyTZfkU4YMS3E0DnT-g8JXrOWcbPzZpOJ_fazMypNEuAwlYR4XvrQ23HOWMCyaDx2n3s4WjqU-OuXkxx85uV-QoHVqylP26y39uRyqIqp6qWIaK7G3dq-608n8CZpK-AKrpVcclXRporVfqDVqIrmgDHZogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrHCz0gqW-2kaoGpn0IK0HZXYkocKo0fA8USeYqjqPxsCwl5no45nMX1JH1A06yzlWYzO4po8r-lrIWdiIEQo8wum9g9AcS7qYrOreDjJcIyLvg4u7QyusEmp3IdSOYHM6d5-ja3j7tQl6g08_ne7VQdl48de-DflwnLpPXmwHoa0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Tue, 16 Nov 2021 03:38:26 GMT', 'Content-Length', '1753' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=46b65d1b-aa64-4d7b-b713-60c3fb901b67&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=8da93fee-f3d1-45e6-9049-de93a0fb9a24&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', @@ -93,21 +93,21 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '78c372be-d672-497b-96fc-4161d1d2f300', + '7ce809f4-9ab5-4e09-82b4-eeddbb5f0100', 'x-ms-ests-server', - '2.1.12231.7 - SEASLR2 ProdSlices', + '2.1.12249.11 - KRSLR2 ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=AiyhANRBpIpNi-uYvt-UUq0WPr5BAQAAADQGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AvDsEOPjepRIixlVtyIhypUWPr5BAQAAALMeJdkOAAAA; expires=Thu, 16-Dec-2021 03:38:27 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:56 GMT', + 'Tue, 16 Nov 2021 03:38:26 GMT', 'Content-Length', - '1351' + '1374' ]); nock('https://management.azure.com:443', {"encodedQueryParams":true}) @@ -121,25 +121,25 @@ nock('https://management.azure.com:443', {"encodedQueryParams":true}) 'Expires', '-1', 'session-id', - 'fc2344ed-e04b-4dba-94c6-629c7961dfd5', + '204f71f0-e455-446a-9d05-8fee54c8560f', 'x-ms-request-id', - '4575d984-26e9-4480-aab0-a0f84b210d96', + '3aea6caf-20d5-4de1-b568-2f17e31f2959', 'x-ms-correlation-request-id', - '4d6dfd02-6873-4860-bfb1-aaf97e6719da', + '4bf54625-ac6a-4109-8ce5-e6d037dfbc93', 'x-ms-client-request-id', - '6b48a22b-2d57-4902-908c-80b9ed4a6b39', + '028dd08d-03cb-415f-a656-7e96029eaeb9', 'X-Powered-By', 'ASP.NET', 'x-ms-ratelimit-remaining-subscription-deletes', '14999', 'x-ms-routing-request-id', - 'KOREASOUTH:20211116T015358Z:4d6dfd02-6873-4860-bfb1-aaf97e6719da', + 'SOUTHEASTASIA:20211116T033828Z:4bf54625-ac6a-4109-8ce5-e6d037dfbc93', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains', 'X-Content-Type-Options', 'nosniff', 'Date', - 'Tue, 16 Nov 2021 01:53:58 GMT', + 'Tue, 16 Nov 2021 03:38:28 GMT', 'Content-Length', '0' ]); diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js index 093165c58667..7e43dde3c753 100644 --- a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js +++ b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_budgets_get_test.js @@ -23,19 +23,19 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'd8a4ace5-c4d3-4353-b6ea-bd8986839200', + '5367927a-fcb7-4e69-827c-c1a96efc0100', 'x-ms-ests-server', - '2.1.12231.7 - KRSLR1 ProdSlices', + '2.1.12249.11 - KRSLR1 ProdSlices', 'Set-Cookie', - 'fpc=AocZvaGf5zBPlXgBt-ctz54; expires=Thu, 16-Dec-2021 01:53:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=An6mImVcfStIhbCp9WgDEJA; expires=Thu, 16-Dec-2021 03:38:26 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrdgrLRL1XUS4d7pL4YVT2cg74PAq2xyHlE8og4jUVU3FmKVFECCpJQxqEe19qqt0-pzr0d8g9d8KBNJkKEQ9PECqFXeqAqgdVPpYhwqJU2ADJSRexuo72NrFUq-P2FV0TecM0svpLm9Q0t0x355ywJIoPLuKgyrOm9UV5q3YD178gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevreEsHsFuEgYabd6zHaT49OefRzy_3pDRulZbG-kBtuWxaf546pL2F17rQ8xked9YqyED4CFftbpB1IMNi0dXHu0Bnrtf20sQnivu4x9FhtHl7U3puzzT5Nawp-reZRd7EV2KG62urLkxyBvOEs7OUrE89tdgktax3omexq8iXFt4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Tue, 16 Nov 2021 03:38:25 GMT', 'Content-Length', '980' ]); @@ -58,25 +58,25 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'ac566b03-181e-4262-af31-1e928eac4400', + '43e96e34-bb4a-458f-9d99-3fc99b800100', 'x-ms-ests-server', - '2.1.12231.7 - KRSLR2 ProdSlices', + '2.1.12249.11 - KRSLR2 ProdSlices', 'Set-Cookie', - 'fpc=AgEssqnNKSBEg4uOEEvKfTY; expires=Thu, 16-Dec-2021 01:53:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AhrMrTlBtGpIvzAh4_ZBHkg; expires=Thu, 16-Dec-2021 03:38:26 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrN-etrqYjMIgF4CBAvYrWjOBR438XdA3Nx0tg3VQloy91W779NkZ1C6zenICThVlcAcf_1S6_VNdxOXRCWojiDZL2zaqDgixhyBaGR9pHhFwLrd5Cx6CjWQSwU2aUkXd-TGyAraUJbyR-dHVggg1Rp14YSKYlqefaocN9fukLdzAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrZUNYJLbY7GmwtMe7jFk9dEsDzhfrY6UxeGjHuZCkuK2OCulWZ5H6XgURqLHT9goxiMx_LJwAEZwktM3lkY2N9OU3zjSziQ2PY1a-ECQNEys7zjxvTKDMMtOW48Zopea-xHfxVA4Pxd2v5ETC83Zal9FapV4dtppNcqUAKtqOWbMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Tue, 16 Nov 2021 03:38:25 GMT', 'Content-Length', '1753' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=c825f9a4-573c-47ef-a57b-559fab9c4fff&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=e2584893-6efa-4a36-b251-c54d0661269c&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', @@ -93,27 +93,27 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '96145cac-462e-4752-9529-a63d3649be00', + '31f6a6c5-b64f-4e07-9038-9717cb820100', 'x-ms-ests-server', - '2.1.12231.7 - SEASLR2 ProdSlices', + '2.1.12249.11 - SEASLR2 ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=Aunwf9emLg1ImlWmmny3U8QWPr5BAQAAADMGJdkOAAAA; expires=Thu, 16-Dec-2021 01:53:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Arp1ogwMF3hKjO6UegC61KYWPr5BAQAAALIeJdkOAAAA; expires=Thu, 16-Dec-2021 03:38:26 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Tue, 16 Nov 2021 01:53:55 GMT', + 'Tue, 16 Nov 2021 03:38:25 GMT', 'Content-Length', - '1351' + '1374' ]); nock('https://management.azure.com:443', {"encodedQueryParams":true}) .get('//subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Consumption/budgets/mybudgetxxxy') .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e4f08ea7ac1d0ef4ed6b38bbcc50bf2dbbb77efae3f1a7db4cc163961d2f9b4bd5ee1d38d90a859fe26bba066bfef47bbb307b3ec603adbd99bcef60ff2dff723fa92105ae5755be4cd478f7ef1476db1c85fe67551d1b87ff1474d9bd5edd3ac45277b3b7bbbdbbbbbdb3bbb6f76761ef1ff7e8a5ecf97b3a0c15ed8e097109204f2f33a2b96d4e68b6ad9ce4ba09e2daaf5b2fde8d1eecece7867f4d1745dd7f9b27dbd2278e8d97ccd5fae9705fdfad157af9f02de94babba8ea6bfae4a46a5a82b5acdae2bca0cf69d83c8a6cdaaeb3f2f7ffbccea96dfd669e2d7fff839ddf9fc635a53ed0205f669332a79eda7a9d8f3e0205b2b6aa09a4f70e416ee7348ff3aaa496078cca940640d04f1759515257dffbe8a7abf97256e5bf27bea039184fab05bdf7d3d9326f16453b0f3effbe7dff555582dedfa3112cdbba98acd1f9e8a3577946ace1b513eea186f491c5e58dccfa310ff2a35f4224392f4ac21903cb40beeffde28f6644f46563e8a1dcf34a79f26c467d79633ec3502fb3722d38ddfd5967f7c56adde6772f8b1a23f8229bce0b2217bd74b920c6fee8fb3424e2c4ec82b0b1b8d3eccaac6fc2fc697e497fbfac897b0908fdef97","fc3fcbe70aa8c2030000"], [ + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e4f08ea7ac1d0ef4ed6b38bbcc50bf2dbbb77efae3f1a7db4cc163961d2f9b4bd5ee1d38d90a859fe26bba066bfef47bbb307b3ece1e4d38793f3fb3b93fbbfef47f42521b4caebb6c89b8f1efde28fda6291bfcceba2a271ffe28f9a36abdba7598b4ef676f676b77777b77776dfecec3ce2fffd14bd9e2f674183bdb0c12f212409e4e775562ca9cd17d5b29d97403d5b54eb65fbd1a3dd9d9df1cee8a3e9baaef365fb7a45f0d0b3f99abf5c2f0bfaf5a3af5e3f05bc29757751d5d7f4c949d5b4046b59b5c579419fd3b07914d9b45d67e5efff799d53dbfacd3c5bfefe073bbf3f8d6b4a7da041becc26654e3db5f53a1f7d040a646d551348ef1d82dcce691ee755492d0f1895290d80a09f2eb2a2a4aebef7d14f57f3e5acca7f4f7c4173309e560b7aefa7b365de2c8a761e7cfe7dfbfeabaa04bdbf472358b6753159a3f3d147aff28c58c36b27dc430de9238bcb1b99f5631ee447bf8448725e9484330696817cdffbc51fcd88e8cbc6d043b9e795f2e4d98cfaf2c67c86a15e66e55a70bafbb3ceee8bd5bacdef5e163546f045369d17442e7ae972418cfdd1f76948c489d905616371a7d99559df84f9d3fc92fe7e5913f71210fadf","2ff97f00ddf702ffc2030000"], [ 'Cache-Control', 'no-cache', 'Pragma', @@ -129,23 +129,23 @@ nock('https://management.azure.com:443', {"encodedQueryParams":true}) 'Vary', 'Accept-Encoding,Accept-Encoding', 'session-id', - '4f16022a-135f-43c2-ba11-41f5fd070cf0', + '69f24cdc-9e41-40f9-956f-3a576b1c7df0', 'x-ms-request-id', - '92bedf6a-e9a1-402c-b42c-e4eaaa276e74', + 'd2246f3a-061d-47e4-a012-60ae5d43aa6c', 'x-ms-correlation-request-id', - 'e60481a5-3b6f-458e-81b5-a74061b8c059', + '141dead1-a1f4-48c7-a031-3d9ef54b5fed', 'x-ms-client-request-id', - '74ef2d87-4890-492b-b54f-8cf903043865', + '6187902f-168e-4daa-9ee6-56bf29c8af2b', 'X-Powered-By', 'ASP.NET', 'x-ms-ratelimit-remaining-subscription-reads', '11999', 'x-ms-routing-request-id', - 'KOREASOUTH:20211116T015356Z:e60481a5-3b6f-458e-81b5-a74061b8c059', + 'SOUTHEASTASIA:20211116T033827Z:141dead1-a1f4-48c7-a031-3d9ef54b5fed', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains', 'X-Content-Type-Options', 'nosniff', 'Date', - 'Tue, 16 Nov 2021 01:53:56 GMT' + 'Tue, 16 Nov 2021 03:38:26 GMT' ]); diff --git a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js b/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js deleted file mode 100644 index 0f6ecb857acf..000000000000 --- a/sdk/consumption/arm-consumption/recordings/node/my_test/recording_sample_test.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/consumption/arm-consumption/test/sampleTest.ts b/sdk/consumption/arm-consumption/test/sampleTest.ts index 6bf25b160209..f7b67cabafc3 100644 --- a/sdk/consumption/arm-consumption/test/sampleTest.ts +++ b/sdk/consumption/arm-consumption/test/sampleTest.ts @@ -15,7 +15,7 @@ import { import * as assert from "assert"; import { ClientSecretCredential } from "@azure/identity"; import { ConsumptionManagementClient } from "../src/consumptionManagementClient"; -import { ComputeManagementClient,VirtualMachine } from "@azure/arm-compute"; +// import { ComputeManagementClient,VirtualMachine } from "@azure/arm-compute"; import { NetworkManagementClient,NetworkInterface,VirtualNetwork } from "@azure/arm-network"; const recorderEnvSetup: RecorderEnvironmentSetup = { @@ -39,7 +39,7 @@ describe("My test", () => { let recorder: Recorder; let subscriptionId: string; let client: ConsumptionManagementClient; - let compute_client: ComputeManagementClient; + // let compute_client: ComputeManagementClient; let network_client: NetworkManagementClient; let location: string; let resourceGroup: string; @@ -60,7 +60,7 @@ describe("My test", () => { env.AZURE_CLIENT_SECRET ); client = new ConsumptionManagementClient(credential, subscriptionId); - compute_client = new ComputeManagementClient(credential,subscriptionId); + // compute_client = new ComputeManagementClient(credential,subscriptionId); network_client = new NetworkManagementClient(credential,subscriptionId); location = "eastus"; resourceGroup = "myjstest"; @@ -77,95 +77,95 @@ describe("My test", () => { await recorder.stop(); }); - //network_client.virtualNetworks.createOrUpdate - async function createVirtualNetwork() { - const parameter: VirtualNetwork = { - location: location, - addressSpace: { - addressPrefixes: ["10.0.0.0/16"], - }, - }; - const virtualNetworks_create_info = await network_client.virtualNetworks.beginCreateOrUpdateAndWait(resourceGroup,network_name,parameter); - console.log(virtualNetworks_create_info); + // //network_client.virtualNetworks.createOrUpdate + // async function createVirtualNetwork() { + // const parameter: VirtualNetwork = { + // location: location, + // addressSpace: { + // addressPrefixes: ["10.0.0.0/16"], + // }, + // }; + // const virtualNetworks_create_info = await network_client.virtualNetworks.beginCreateOrUpdateAndWait(resourceGroup,network_name,parameter); + // console.log(virtualNetworks_create_info); - // - const subnet__create_info = await network_client.subnets.beginCreateOrUpdateAndWait(resourceGroup,network_name,subnet_name,{addressPrefix: "10.0.0.0/24"}); - } + // // + // const subnet__create_info = await network_client.subnets.beginCreateOrUpdateAndWait(resourceGroup,network_name,subnet_name,{addressPrefix: "10.0.0.0/24"}); + // } - //network_client.networkInterfaces.createOrUpdate - async function createNetworkInterface(group_name: any,location: any,nic_name: any) { - const parameter: NetworkInterface = { - location: location, - ipConfigurations: [ - { - name: "MyIpConfig", - subnet: { - id: "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/virtualNetworks/" +network_name +"/subnets/" +subnet_name, - } - } - ] - } - const nic_info = await network_client.networkInterfaces.beginCreateOrUpdateAndWait(group_name,nic_name,parameter); - } + // //network_client.networkInterfaces.createOrUpdate + // async function createNetworkInterface(group_name: any,location: any,nic_name: any) { + // const parameter: NetworkInterface = { + // location: location, + // ipConfigurations: [ + // { + // name: "MyIpConfig", + // subnet: { + // id: "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/virtualNetworks/" +network_name +"/subnets/" +subnet_name, + // } + // } + // ] + // } + // const nic_info = await network_client.networkInterfaces.beginCreateOrUpdateAndWait(group_name,nic_name,parameter); + // } - //virtualMachines.createOrUpdate - async function virtualMachines_createOrUpdate() { - await createVirtualNetwork(); - await createNetworkInterface(resourceGroup, location, interface_name); - const parameter: VirtualMachine = { - location: location, - hardwareProfile: { - vmSize: "Standard_D2_v2", - }, - storageProfile: { - imageReference: { - sku: "2016-Datacenter", - publisher: "MicrosoftWindowsServer", - version: "latest", - offer: "WindowsServer", - }, - osDisk: { - caching: "ReadWrite", - managedDisk: { - storageAccountType: "Standard_LRS", - }, - name: "myVMosdisk", - createOption: "FromImage", - }, - dataDisks: [ - { - diskSizeGB: 1023, - createOption: "Empty", - lun: 0, - }, - { - diskSizeGB: 1023, - createOption: "Empty", - lun: 1, - }, - ], - }, - osProfile: { - adminUsername: "testuser", - computerName: "myVM", - adminPassword: "Aa!1()-xyz", - windowsConfiguration: { - enableAutomaticUpdates: true, // need automatic update for reimage - }, - }, - networkProfile: { - networkInterfaces: [ - { - id: - "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/networkInterfaces/" +interface_name, - primary: true, - }, - ], - }, - }; - const res = await compute_client.virtualMachines.beginCreateOrUpdateAndWait(resourceGroup,vmName,parameter); - console.log(res); - } + // //virtualMachines.createOrUpdate + // async function virtualMachines_createOrUpdate() { + // await createVirtualNetwork(); + // await createNetworkInterface(resourceGroup, location, interface_name); + // const parameter: VirtualMachine = { + // location: location, + // hardwareProfile: { + // vmSize: "Standard_D2_v2", + // }, + // storageProfile: { + // imageReference: { + // sku: "2016-Datacenter", + // publisher: "MicrosoftWindowsServer", + // version: "latest", + // offer: "WindowsServer", + // }, + // osDisk: { + // caching: "ReadWrite", + // managedDisk: { + // storageAccountType: "Standard_LRS", + // }, + // name: "myVMosdisk", + // createOption: "FromImage", + // }, + // dataDisks: [ + // { + // diskSizeGB: 1023, + // createOption: "Empty", + // lun: 0, + // }, + // { + // diskSizeGB: 1023, + // createOption: "Empty", + // lun: 1, + // }, + // ], + // }, + // osProfile: { + // adminUsername: "testuser", + // computerName: "myVM", + // adminPassword: "Aa!1()-xyz", + // windowsConfiguration: { + // enableAutomaticUpdates: true, // need automatic update for reimage + // }, + // }, + // networkProfile: { + // networkInterfaces: [ + // { + // id: + // "/subscriptions/" +subscriptionId +"/resourceGroups/" +resourceGroup +"/providers/Microsoft.Network/networkInterfaces/" +interface_name, + // primary: true, + // }, + // ], + // }, + // }; + // const res = await compute_client.virtualMachines.beginCreateOrUpdateAndWait(resourceGroup,vmName,parameter); + // console.log(res); + // } it("budgets create test", async function() { const res = await client.budgets.createOrUpdate(scope,budgetName,{