diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 6cf0e93679e3..9357cd2eddeb 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -49,6 +49,7 @@ specifiers: '@rush-temp/arm-policy': file:./projects/arm-policy.tgz '@rush-temp/arm-portal': file:./projects/arm-portal.tgz '@rush-temp/arm-postgresql': file:./projects/arm-postgresql.tgz + '@rush-temp/arm-powerbidedicated': file:./projects/arm-powerbidedicated.tgz '@rush-temp/arm-purview': file:./projects/arm-purview.tgz '@rush-temp/arm-quota': file:./projects/arm-quota.tgz '@rush-temp/arm-recoveryservices': file:./projects/arm-recoveryservices.tgz @@ -218,6 +219,7 @@ dependencies: '@rush-temp/arm-policy': file:projects/arm-policy.tgz '@rush-temp/arm-portal': file:projects/arm-portal.tgz '@rush-temp/arm-postgresql': file:projects/arm-postgresql.tgz + '@rush-temp/arm-powerbidedicated': file:projects/arm-powerbidedicated.tgz '@rush-temp/arm-purview': file:projects/arm-purview.tgz '@rush-temp/arm-quota': file:projects/arm-quota.tgz '@rush-temp/arm-recoveryservices': file:projects/arm-recoveryservices.tgz @@ -8648,7 +8650,7 @@ packages: dev: false file:projects/app-configuration.tgz: - resolution: {integrity: sha512-HBZl2EancfACeRLK2hWk+nCAgXrptXnS9hX5E5SLleYzlPHovsJRBWf3bv0NopaHCgFPdRcAw5xwKa1C2tPz2g==, tarball: file:projects/app-configuration.tgz} + resolution: {integrity: sha512-h9nLQwnEqw1OjRBrG2YmgFUD/wOCQe+fC+/45l/Kpeh2QBkLKXeJslgi5fme0YsUC0wmSsZqYaQZtn9mOCLjlw==, tarball: file:projects/app-configuration.tgz} name: '@rush-temp/app-configuration' version: 0.0.0 dependencies: @@ -9122,7 +9124,7 @@ packages: dev: false file:projects/arm-eventhub.tgz: - resolution: {integrity: sha512-u7elK+VQEh/PpmETDYomvdkwVxKVjIPOb6dELGwpNB2cuTV0/nkZUEKeWux+36A8Lhwo5Lyc/XAkKWWlLixwWw==, tarball: file:projects/arm-eventhub.tgz} + resolution: {integrity: sha512-cWryEMqcziFmqSkDI9ZMhEhjBmX3UEdauByCW1fFHAJ9XGHISFxr8jpJ1hKOj+c6mbp5JBD0UIU2MyceWk/OMg==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' version: 0.0.0 dependencies: @@ -9541,6 +9543,27 @@ packages: uglify-js: 3.14.3 dev: false + file:projects/arm-powerbidedicated.tgz: + resolution: {integrity: sha512-5arfrJEg+xM0rtGFdpnGV4aYpGwIg5qF/79G5rgVtR+XqFI2BHg2S93aOD4j75IE6tWxqwL4U7aI/MjAiRDoww==, tarball: file:projects/arm-powerbidedicated.tgz} + name: '@rush-temp/arm-powerbidedicated' + version: 0.0.0 + dependencies: + '@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 + rimraf: 3.0.2 + 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 + dev: false + file:projects/arm-purview.tgz: resolution: {integrity: sha512-3yTP1x0NsuoF22Z+MwjuLYQlboJwRDH24Dr7HapItun5Mkbjj4efeEuMJLg7lRT32YVtkIGE5OEQOXEXIMXgRA==, tarball: file:projects/arm-purview.tgz} name: '@rush-temp/arm-purview' diff --git a/rush.json b/rush.json index a7e20ebf1c9d..de0ad012c1f0 100644 --- a/rush.json +++ b/rush.json @@ -1155,6 +1155,11 @@ "packageName": "@azure/arm-loadtestservice", "projectFolder": "sdk/loadtestservice/arm-loadtestservice", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-powerbidedicated", + "projectFolder": "sdk/powerbidedicated/arm-powerbidedicated", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/powerbidedicated/arm-powerbidedicated/CHANGELOG.md b/sdk/powerbidedicated/arm-powerbidedicated/CHANGELOG.md new file mode 100644 index 000000000000..17e99b26e8a8 --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 3.0.0 (2021-12-10) + +The package of @azure/arm-powerbidedicated is using our next generation design principles since version 3.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/powerbidedicated/arm-powerbidedicated/LICENSE.txt b/sdk/powerbidedicated/arm-powerbidedicated/LICENSE similarity index 96% rename from sdk/powerbidedicated/arm-powerbidedicated/LICENSE.txt rename to sdk/powerbidedicated/arm-powerbidedicated/LICENSE index ea8fb1516028..ccb63b166732 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/LICENSE.txt +++ b/sdk/powerbidedicated/arm-powerbidedicated/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -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/powerbidedicated/arm-powerbidedicated/README.md b/sdk/powerbidedicated/arm-powerbidedicated/README.md index 20dd8055d53e..f55ef810a15f 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/README.md +++ b/sdk/powerbidedicated/arm-powerbidedicated/README.md @@ -1,103 +1,98 @@ -## Azure PowerBIDedicatedManagementClient SDK for JavaScript +# Azure Service client library for JavaScript -This package contains an isomorphic SDK for PowerBIDedicatedManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/powerbidedicated/arm-powerbidedicated) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-powerbidedicated) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-powerbidedicated) | +[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 + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-powerbidedicated` package -### How to Install +Install the Azure Service client library for JavaScript with `npm`: ```bash npm install @azure/arm-powerbidedicated ``` -### How to use +### Create and authenticate a `PowerBIDedicated` -#### nodejs - Authentication, client creation and getDetails capacities as an example written in TypeScript. +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +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). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { PowerBIDedicatedManagementClient, PowerBIDedicatedManagementModels, PowerBIDedicatedManagementMappers } from "@azure/arm-powerbidedicated"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new PowerBIDedicatedManagementClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const dedicatedCapacityName = "testdedicatedCapacityName"; - client.capacities.getDetails(resourceGroupName, dedicatedCapacityName).then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +You will also need to **register a new AAD application and grant access to Azure Service** 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`. + +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 { PowerBIDedicated } = require("@azure/arm-powerbidedicated"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new PowerBIDedicated(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and getDetails capacities as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-powerbidedicated sample - - - - - - - - +### PowerBIDedicated + +`PowerBIDedicated` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service 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%2Fpowerbidedicated%2Farm-powerbidedicated%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/powerbidedicated/arm-powerbidedicated/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/powerbidedicated/arm-powerbidedicated/_meta.json b/sdk/powerbidedicated/arm-powerbidedicated/_meta.json new file mode 100644 index 000000000000..1a3e76d79cc6 --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "52f9379c7709eb53f15b875b7de9b1abfa17f298", + "readme": "specification/powerbidedicated/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=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/powerbidedicated/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" +} \ No newline at end of file diff --git a/sdk/powerbidedicated/arm-powerbidedicated/api-extractor.json b/sdk/powerbidedicated/arm-powerbidedicated/api-extractor.json new file mode 100644 index 000000000000..c6889abb2333 --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/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-powerbidedicated.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/powerbidedicated/arm-powerbidedicated/package.json b/sdk/powerbidedicated/arm-powerbidedicated/package.json index e9e3e8b3365b..327789d30cb4 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/package.json +++ b/sdk/powerbidedicated/arm-powerbidedicated/package.json @@ -1,57 +1,91 @@ { "name": "@azure/arm-powerbidedicated", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "PowerBIDedicatedManagementClient Library with typescript type definitions for node.js and browser.", - "version": "2.0.0", + "description": "A generated SDK for PowerBIDedicated.", + "version": "3.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.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-powerbidedicated.js", - "module": "./esm/powerBIDedicatedManagementClient.js", - "types": "./esm/powerBIDedicatedManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-powerbidedicated.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "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", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@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/powerbidedicated/arm-powerbidedicated", "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-powerbidedicated.js.map'\" -o ./dist/arm-powerbidedicated.min.js ./dist/arm-powerbidedicated.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": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "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 --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/powerbidedicated/arm-powerbidedicated/review/arm-powerbidedicated.api.md b/sdk/powerbidedicated/arm-powerbidedicated/review/arm-powerbidedicated.api.md new file mode 100644 index 000000000000..929780c13e6b --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/review/arm-powerbidedicated.api.md @@ -0,0 +1,491 @@ +## API Report File for "@azure/arm-powerbidedicated" + +> 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'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type AutoScaleVCore = Resource & { + sku: AutoScaleVCoreSku; + capacityLimit?: number; + capacityObjectId?: string; + readonly provisioningState?: VCoreProvisioningState; +}; + +// @public +export interface AutoScaleVCoreListResult { + value: AutoScaleVCore[]; +} + +// @public +export interface AutoScaleVCoreMutableProperties { + capacityLimit?: number; +} + +// @public +export type AutoScaleVCoreProperties = AutoScaleVCoreMutableProperties & { + capacityObjectId?: string; + readonly provisioningState?: VCoreProvisioningState; +}; + +// @public +export interface AutoScaleVCores { + create(resourceGroupName: string, vcoreName: string, vCoreParameters: AutoScaleVCore, options?: AutoScaleVCoresCreateOptionalParams): Promise; + delete(resourceGroupName: string, vcoreName: string, options?: AutoScaleVCoresDeleteOptionalParams): Promise; + get(resourceGroupName: string, vcoreName: string, options?: AutoScaleVCoresGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: AutoScaleVCoresListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: AutoScaleVCoresListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, vcoreName: string, vCoreUpdateParameters: AutoScaleVCoreUpdateParameters, options?: AutoScaleVCoresUpdateOptionalParams): Promise; +} + +// @public +export interface AutoScaleVCoresCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoScaleVCoresCreateResponse = AutoScaleVCore; + +// @public +export interface AutoScaleVCoresDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AutoScaleVCoresGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoScaleVCoresGetResponse = AutoScaleVCore; + +// @public +export interface AutoScaleVCoreSku { + capacity?: number; + name: string; + tier?: VCoreSkuTier; +} + +// @public +export interface AutoScaleVCoresListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoScaleVCoresListByResourceGroupResponse = AutoScaleVCoreListResult; + +// @public +export interface AutoScaleVCoresListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoScaleVCoresListBySubscriptionResponse = AutoScaleVCoreListResult; + +// @public +export interface AutoScaleVCoresUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoScaleVCoresUpdateResponse = AutoScaleVCore; + +// @public +export interface AutoScaleVCoreUpdateParameters { + capacityLimit?: number; + sku?: AutoScaleVCoreSku; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Capacities { + beginCreate(resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: DedicatedCapacity, options?: CapacitiesCreateOptionalParams): Promise, CapacitiesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: DedicatedCapacity, options?: CapacitiesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesDeleteOptionalParams): Promise; + beginResume(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesResumeOptionalParams): Promise, void>>; + beginResumeAndWait(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesResumeOptionalParams): Promise; + beginSuspend(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesSuspendOptionalParams): Promise, void>>; + beginSuspendAndWait(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesSuspendOptionalParams): Promise; + beginUpdate(resourceGroupName: string, dedicatedCapacityName: string, capacityUpdateParameters: DedicatedCapacityUpdateParameters, options?: CapacitiesUpdateOptionalParams): Promise, CapacitiesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, dedicatedCapacityName: string, capacityUpdateParameters: DedicatedCapacityUpdateParameters, options?: CapacitiesUpdateOptionalParams): Promise; + checkNameAvailability(location: string, capacityParameters: CheckCapacityNameAvailabilityParameters, options?: CapacitiesCheckNameAvailabilityOptionalParams): Promise; + getDetails(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesGetDetailsOptionalParams): Promise; + list(options?: CapacitiesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: CapacitiesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listSkus(options?: CapacitiesListSkusOptionalParams): Promise; + listSkusForCapacity(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesListSkusForCapacityOptionalParams): Promise; +} + +// @public +export interface CapacitiesCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapacitiesCheckNameAvailabilityResponse = CheckCapacityNameAvailabilityResult; + +// @public +export interface CapacitiesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CapacitiesCreateResponse = DedicatedCapacity; + +// @public +export interface CapacitiesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CapacitiesGetDetailsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapacitiesGetDetailsResponse = DedicatedCapacity; + +// @public +export interface CapacitiesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapacitiesListByResourceGroupResponse = DedicatedCapacities; + +// @public +export interface CapacitiesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapacitiesListResponse = DedicatedCapacities; + +// @public +export interface CapacitiesListSkusForCapacityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapacitiesListSkusForCapacityResponse = SkuEnumerationForExistingResourceResult; + +// @public +export interface CapacitiesListSkusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapacitiesListSkusResponse = SkuEnumerationForNewResourceResult; + +// @public +export interface CapacitiesResumeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CapacitiesSuspendOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CapacitiesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CapacitiesUpdateResponse = DedicatedCapacity; + +// @public +export type CapacityProvisioningState = string; + +// @public +export interface CapacitySku { + name: string; + tier?: CapacitySkuTier; +} + +// @public +export type CapacitySkuTier = string; + +// @public +export interface CheckCapacityNameAvailabilityParameters { + name?: string; + type?: string; +} + +// @public +export interface CheckCapacityNameAvailabilityResult { + message?: string; + nameAvailable?: boolean; + reason?: string; +} + +// @public +export interface DedicatedCapacities { + value: DedicatedCapacity[]; +} + +// @public +export type DedicatedCapacity = Resource & { + sku: CapacitySku; + administration?: DedicatedCapacityAdministrators; + mode?: Mode; + readonly state?: State; + readonly provisioningState?: CapacityProvisioningState; +}; + +// @public +export interface DedicatedCapacityAdministrators { + members?: string[]; +} + +// @public +export interface DedicatedCapacityMutableProperties { + administration?: DedicatedCapacityAdministrators; + mode?: Mode; +} + +// @public +export type DedicatedCapacityProperties = DedicatedCapacityMutableProperties & { + readonly state?: State; + readonly provisioningState?: CapacityProvisioningState; +}; + +// @public +export interface DedicatedCapacityUpdateParameters { + administration?: DedicatedCapacityAdministrators; + mode?: Mode; + sku?: CapacitySku; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ErrorResponse { + error?: ErrorResponseError; +} + +// @public +export interface ErrorResponseError { + code?: string; + message?: string; +} + +// @public +export type IdentityType = string; + +// @public +export enum KnownCapacityProvisioningState { + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Paused = "Paused", + // (undocumented) + Pausing = "Pausing", + // (undocumented) + Preparing = "Preparing", + // (undocumented) + Provisioning = "Provisioning", + // (undocumented) + Resuming = "Resuming", + // (undocumented) + Scaling = "Scaling", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Suspended = "Suspended", + // (undocumented) + Suspending = "Suspending", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownCapacitySkuTier { + // (undocumented) + AutoPremiumHost = "AutoPremiumHost", + // (undocumented) + PbieAzure = "PBIE_Azure", + // (undocumented) + Premium = "Premium" +} + +// @public +export enum KnownIdentityType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownMode { + // (undocumented) + Gen1 = "Gen1", + // (undocumented) + Gen2 = "Gen2" +} + +// @public +export enum KnownState { + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Paused = "Paused", + // (undocumented) + Pausing = "Pausing", + // (undocumented) + Preparing = "Preparing", + // (undocumented) + Provisioning = "Provisioning", + // (undocumented) + Resuming = "Resuming", + // (undocumented) + Scaling = "Scaling", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Suspended = "Suspended", + // (undocumented) + Suspending = "Suspending", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownVCoreProvisioningState { + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownVCoreSkuTier { + // (undocumented) + AutoScale = "AutoScale" +} + +// @public +export type Mode = string; + +// @public +export interface Operation { + display?: OperationDisplay; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + 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 (undocumented) +export class PowerBIDedicated extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PowerBIDedicatedOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + autoScaleVCores: AutoScaleVCores; + // (undocumented) + capacities: Capacities; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface PowerBIDedicatedOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface Resource { + readonly id?: string; + location: string; + readonly name?: string; + systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface SkuDetailsForExistingResource { + sku?: CapacitySku; +} + +// @public +export interface SkuEnumerationForExistingResourceResult { + value?: SkuDetailsForExistingResource[]; +} + +// @public +export interface SkuEnumerationForNewResourceResult { + value?: CapacitySku[]; +} + +// @public +export type State = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: IdentityType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: IdentityType; +} + +// @public +export type VCoreProvisioningState = string; + +// @public +export type VCoreSkuTier = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js b/sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js index 0d8f15137d00..9be1955eb7f1 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js +++ b/sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * 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 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 /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/powerBIDedicatedManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-powerbidedicated.js", - format: "umd", - name: "Azure.ArmPowerbidedicated", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +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/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + 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/powerbidedicated/arm-powerbidedicated/src/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/index.ts new file mode 100644 index 000000000000..55469f706ff5 --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/index.ts @@ -0,0 +1,12 @@ +/* + * 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 { PowerBIDedicated } from "./powerBIDedicated"; +export * from "./operationsInterfaces"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/lroImpl.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/lroImpl.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 { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/capacitiesMappers.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/capacitiesMappers.ts deleted file mode 100644 index ef2cac8815a4..000000000000 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/capacitiesMappers.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CheckCapacityNameAvailabilityParameters, - CheckCapacityNameAvailabilityResult, - CloudError, - DedicatedCapacities, - DedicatedCapacity, - DedicatedCapacityAdministrators, - DedicatedCapacityUpdateParameters, - Resource, - ResourceSku, - SkuDetailsForExistingResource, - SkuEnumerationForExistingResourceResult, - SkuEnumerationForNewResourceResult -} from "../models/mappers"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts index 3aa64f0a6c40..3393c60b36fe 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts @@ -1,522 +1,587 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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 { 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 }; - -/** - * The object that represents the operation. - */ -export interface OperationDisplay { - /** - * Service provider: Microsoft.PowerBIDedicated. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provider?: string; - /** - * Resource on which the operation is performed: capacity, etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resource?: string; - /** - * Operation type: create, update, delete, etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operation?: string; +/** Represents the SKU name and Azure pricing tier for PowerBI Dedicated capacity resource. */ +export interface CapacitySku { + /** Name of the SKU level. */ + name: string; + /** The name of the Azure pricing tier to which the SKU applies. */ + tier?: CapacitySkuTier; } -/** - * Capacities REST API operation. - */ -export interface Operation { - /** - * Operation name: {provider}/{resource}/{operation}. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The object that represents the operation. - */ - display?: OperationDisplay; +/** An object that represents a set of mutable Dedicated capacity resource properties. */ +export interface DedicatedCapacityMutableProperties { + /** A collection of Dedicated capacity administrators */ + administration?: DedicatedCapacityAdministrators; + /** Specifies the generation of the Power BI Embedded capacity. If no value is specified, the default value 'Gen2' is used. [Learn More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2) */ + mode?: Mode; } -/** - * Represents the SKU name and Azure pricing tier for PowerBI Dedicated resource. - */ -export interface ResourceSku { - /** - * Name of the SKU level. - */ - name: string; - /** - * The name of the Azure pricing tier to which the SKU applies. Possible values include: - * 'PBIE_Azure' - */ - tier?: SkuTier; +/** An array of administrator user identities */ +export interface DedicatedCapacityAdministrators { + /** An array of administrator user identities. */ + members?: string[]; } -/** - * Represents an instance of an PowerBI Dedicated resource. - */ -export interface Resource extends BaseResource { +/** Represents an instance of an PowerBI Dedicated resource. */ +export interface Resource { /** * An identifier that represents the PowerBI Dedicated resource. - * **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 id?: string; /** * The name of the PowerBI Dedicated resource. - * **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 name?: string; /** * The type of the PowerBI Dedicated resource. - * **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; - /** - * Location of the PowerBI Dedicated resource. - */ + /** Location of the PowerBI Dedicated resource. */ location: string; - /** - * The SKU of the PowerBI Dedicated resource. - */ - sku: ResourceSku; - /** - * Key-value pairs of additional resource provisioning properties. - */ + /** Key-value pairs of additional resource provisioning properties. */ tags?: { [propertyName: string]: string }; + /** Metadata pertaining to creation and last modification of the resource. */ + systemData?: SystemData; } -/** - * Represents an instance of a Dedicated Capacity resource. - */ -export interface DedicatedCapacity extends Resource { - /** - * A collection of Dedicated capacity administrators - */ - administration?: DedicatedCapacityAdministrators; - /** - * The current state of PowerBI Dedicated resource. The state is to indicate more states outside - * of resource provisioning. Possible values include: 'Deleting', 'Succeeded', 'Failed', - * 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', - * 'Preparing', 'Scaling' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly state?: State; - /** - * The current deployment state of PowerBI Dedicated resource. The provisioningState is to - * indicate states for resource provisioning. Possible values include: 'Deleting', 'Succeeded', - * 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', - * 'Resuming', 'Preparing', 'Scaling' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: ProvisioningState; +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** An identifier for the identity that created the resource */ + createdBy?: string; + /** The type of identity that created the resource */ + createdByType?: IdentityType; + /** The timestamp of resource creation (UTC) */ + createdAt?: Date; + /** An identifier for the identity that last modified the resource */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource */ + lastModifiedByType?: IdentityType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } -/** - * An array of administrator user identities - */ -export interface DedicatedCapacityAdministrators { - /** - * An array of administrator user identities. - */ - members?: string[]; +/** Describes the format of Error response. */ +export interface ErrorResponse { + /** The error object */ + error?: ErrorResponseError; } -/** - * Provision request specification - */ +/** The error object */ +export interface ErrorResponseError { + /** Error code */ + code?: string; + /** Error message indicating why the operation failed. */ + message?: string; +} + +/** Provision request specification */ export interface DedicatedCapacityUpdateParameters { - /** - * The SKU of the Dedicated capacity resource. - */ - sku?: ResourceSku; - /** - * Key-value pairs of additional provisioning properties. - */ + /** The SKU of the Dedicated capacity resource. */ + sku?: CapacitySku; + /** Key-value pairs of additional provisioning properties. */ tags?: { [propertyName: string]: string }; - /** - * A collection of Dedicated capacity administrators - */ + /** A collection of Dedicated capacity administrators */ administration?: DedicatedCapacityAdministrators; + /** Specifies the generation of the Power BI Embedded capacity. If no value is specified, the default value 'Gen2' is used. [Learn More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2) */ + mode?: Mode; } -/** - * An object that represents enumerating SKUs for new resources - */ +/** An array of Dedicated capacities resources. */ +export interface DedicatedCapacities { + /** An array of Dedicated capacities resources. */ + value: DedicatedCapacity[]; +} + +/** An object that represents enumerating SKUs for new resources */ export interface SkuEnumerationForNewResourceResult { - /** - * The collection of available SKUs for new resources - */ - value?: ResourceSku[]; + /** The collection of available SKUs for new resources */ + value?: CapacitySku[]; } -/** - * An object that represents SKU details for existing resources - */ +/** An object that represents enumerating SKUs for existing resources */ +export interface SkuEnumerationForExistingResourceResult { + /** The collection of available SKUs for existing resources */ + value?: SkuDetailsForExistingResource[]; +} + +/** An object that represents SKU details for existing resources */ export interface SkuDetailsForExistingResource { + /** The SKU in SKU details for existing resources. */ + sku?: CapacitySku; +} + +/** Result listing capacities. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of capacities supported by the Microsoft.PowerBIDedicated resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; /** - * The SKU in SKU details for existing resources. + * 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. */ - sku?: ResourceSku; + readonly nextLink?: string; } -/** - * An object that represents enumerating SKUs for existing resources - */ -export interface SkuEnumerationForExistingResourceResult { +/** Capacities REST API operation. */ +export interface Operation { /** - * The collection of available SKUs for existing resources + * Operation name: {provider}/{resource}/{operation}. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value?: SkuDetailsForExistingResource[]; + readonly name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; } -/** - * Describes the format of Error response. - */ -export interface ErrorResponse { +/** The object that represents the operation. */ +export interface OperationDisplay { + /** + * Service provider: Microsoft.PowerBIDedicated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; /** - * Error code + * Resource on which the operation is performed: capacity, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - code?: string; + readonly resource?: string; /** - * Error message indicating why the operation failed. + * Operation type: create, update, delete, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - message?: string; + readonly operation?: string; } -/** - * Details of capacity name request body. - */ +/** Details of capacity name request body. */ export interface CheckCapacityNameAvailabilityParameters { - /** - * Name for checking availability. - */ + /** Name for checking availability. */ name?: string; - /** - * The resource type of PowerBI dedicated. Default value: - * 'Microsoft.PowerBIDedicated/capacities'. - */ + /** The resource type of PowerBI dedicated. */ type?: string; } -/** - * The checking result of capacity name availability. - */ +/** The checking result of capacity name availability. */ export interface CheckCapacityNameAvailabilityResult { - /** - * Indicator of availability of the capacity name. - */ + /** Indicator of availability of the capacity name. */ nameAvailable?: boolean; - /** - * The reason of unavailability. - */ + /** The reason of unavailability. */ reason?: string; - /** - * The detailed message of the request unavailability. - */ + /** The detailed message of the request unavailability. */ message?: string; } -/** - * An interface representing PowerBIDedicatedManagementClientOptions. - */ -export interface PowerBIDedicatedManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; +/** Represents the SKU name and Azure pricing tier for auto scale v-core resource. */ +export interface AutoScaleVCoreSku { + /** Name of the SKU level. */ + name: string; + /** The name of the Azure pricing tier to which the SKU applies. */ + tier?: VCoreSkuTier; + /** The capacity of an auto scale v-core resource. */ + capacity?: number; } -/** - * @interface - * An array of Dedicated capacities resources. - * @extends Array - */ -export interface DedicatedCapacities extends Array { +/** An object that represents a set of mutable auto scale v-core resource properties. */ +export interface AutoScaleVCoreMutableProperties { + /** The maximum capacity of an auto scale v-core resource. */ + capacityLimit?: number; } -/** - * @interface - * Result listing capacities. It contains a list of operations and a URL link to get the next set - * of results. - * @extends Array - */ -export interface OperationListResult extends Array { - /** - * 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 nextLink?: string; +/** Update request specification */ +export interface AutoScaleVCoreUpdateParameters { + /** The SKU of the auto scale v-core resource. */ + sku?: AutoScaleVCoreSku; + /** Key-value pairs of additional provisioning properties. */ + tags?: { [propertyName: string]: string }; + /** The maximum capacity of an auto scale v-core resource. */ + capacityLimit?: number; } -/** - * Defines values for SkuTier. - * Possible values include: 'PBIE_Azure' - * @readonly - * @enum {string} - */ -export type SkuTier = 'PBIE_Azure'; - -/** - * Defines values for State. - * Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', - * 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' - * @readonly - * @enum {string} - */ -export type State = 'Deleting' | 'Succeeded' | 'Failed' | 'Paused' | 'Suspended' | 'Provisioning' | 'Updating' | 'Suspending' | 'Pausing' | 'Resuming' | 'Preparing' | 'Scaling'; - -/** - * Defines values for ProvisioningState. - * Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', - * 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' - * @readonly - * @enum {string} - */ -export type ProvisioningState = 'Deleting' | 'Succeeded' | 'Failed' | 'Paused' | 'Suspended' | 'Provisioning' | 'Updating' | 'Suspending' | 'Pausing' | 'Resuming' | 'Preparing' | 'Scaling'; +/** An array of auto scale v-core resources. */ +export interface AutoScaleVCoreListResult { + /** An array of auto scale v-core resources. */ + value: AutoScaleVCore[]; +} -/** - * Contains response data for the getDetails operation. - */ -export type CapacitiesGetDetailsResponse = DedicatedCapacity & { +/** Properties of Dedicated Capacity resource. */ +export type DedicatedCapacityProperties = DedicatedCapacityMutableProperties & { /** - * The underlying HTTP response. + * The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. + * 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: DedicatedCapacity; - }; -}; - -/** - * Contains response data for the create operation. - */ -export type CapacitiesCreateResponse = DedicatedCapacity & { + readonly state?: State; /** - * The underlying HTTP response. + * The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. + * 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: DedicatedCapacity; - }; + readonly provisioningState?: CapacityProvisioningState; }; -/** - * Contains response data for the update operation. - */ -export type CapacitiesUpdateResponse = DedicatedCapacity & { +/** Represents an instance of a Dedicated Capacity resource. */ +export type DedicatedCapacity = Resource & { + /** The SKU of the PowerBI Dedicated capacity resource. */ + sku: CapacitySku; + /** A collection of Dedicated capacity administrators */ + administration?: DedicatedCapacityAdministrators; + /** Specifies the generation of the Power BI Embedded capacity. If no value is specified, the default value 'Gen2' is used. [Learn More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2) */ + mode?: Mode; /** - * The underlying HTTP response. + * The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. + * 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: DedicatedCapacity; - }; -}; - -/** - * Contains response data for the listByResourceGroup operation. - */ -export type CapacitiesListByResourceGroupResponse = DedicatedCapacities & { + readonly state?: State; /** - * The underlying HTTP response. + * The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. + * 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: DedicatedCapacities; - }; + readonly provisioningState?: CapacityProvisioningState; }; -/** - * Contains response data for the list operation. - */ -export type CapacitiesListResponse = DedicatedCapacities & { +/** Represents an instance of an auto scale v-core resource. */ +export type AutoScaleVCore = Resource & { + /** The SKU of the auto scale v-core resource. */ + sku: AutoScaleVCoreSku; + /** The maximum capacity of an auto scale v-core resource. */ + capacityLimit?: number; + /** The object ID of the capacity resource associated with the auto scale v-core resource. */ + capacityObjectId?: string; /** - * The underlying HTTP response. + * The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for resource provisioning. + * 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: DedicatedCapacities; - }; + readonly provisioningState?: VCoreProvisioningState; }; -/** - * Contains response data for the listSkus operation. - */ -export type CapacitiesListSkusResponse = SkuEnumerationForNewResourceResult & { +/** Properties of an auto scale v-core resource. */ +export type AutoScaleVCoreProperties = AutoScaleVCoreMutableProperties & { + /** The object ID of the capacity resource associated with the auto scale v-core resource. */ + capacityObjectId?: string; /** - * The underlying HTTP response. + * The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for resource provisioning. + * 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: SkuEnumerationForNewResourceResult; - }; + readonly provisioningState?: VCoreProvisioningState; }; +/** Known values of {@link CapacitySkuTier} that the service accepts. */ +export enum KnownCapacitySkuTier { + PbieAzure = "PBIE_Azure", + Premium = "Premium", + AutoPremiumHost = "AutoPremiumHost" +} + /** - * Contains response data for the listSkusForCapacity operation. - */ -export type CapacitiesListSkusForCapacityResponse = SkuEnumerationForExistingResourceResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SkuEnumerationForExistingResourceResult; - }; -}; + * Defines values for CapacitySkuTier. \ + * {@link KnownCapacitySkuTier} can be used interchangeably with CapacitySkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PBIE_Azure** \ + * **Premium** \ + * **AutoPremiumHost** + */ +export type CapacitySkuTier = string; + +/** Known values of {@link State} that the service accepts. */ +export enum KnownState { + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed", + Paused = "Paused", + Suspended = "Suspended", + Provisioning = "Provisioning", + Updating = "Updating", + Suspending = "Suspending", + Pausing = "Pausing", + Resuming = "Resuming", + Preparing = "Preparing", + Scaling = "Scaling" +} /** - * Contains response data for the checkNameAvailability operation. - */ -export type CapacitiesCheckNameAvailabilityResponse = CheckCapacityNameAvailabilityResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CheckCapacityNameAvailabilityResult; - }; -}; + * Defines values for State. \ + * {@link KnownState} can be used interchangeably with State, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Deleting** \ + * **Succeeded** \ + * **Failed** \ + * **Paused** \ + * **Suspended** \ + * **Provisioning** \ + * **Updating** \ + * **Suspending** \ + * **Pausing** \ + * **Resuming** \ + * **Preparing** \ + * **Scaling** + */ +export type State = string; + +/** Known values of {@link CapacityProvisioningState} that the service accepts. */ +export enum KnownCapacityProvisioningState { + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed", + Paused = "Paused", + Suspended = "Suspended", + Provisioning = "Provisioning", + Updating = "Updating", + Suspending = "Suspending", + Pausing = "Pausing", + Resuming = "Resuming", + Preparing = "Preparing", + Scaling = "Scaling" +} /** - * Contains response data for the beginCreate operation. - */ -export type CapacitiesBeginCreateResponse = DedicatedCapacity & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCapacity; - }; -}; + * Defines values for CapacityProvisioningState. \ + * {@link KnownCapacityProvisioningState} can be used interchangeably with CapacityProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Deleting** \ + * **Succeeded** \ + * **Failed** \ + * **Paused** \ + * **Suspended** \ + * **Provisioning** \ + * **Updating** \ + * **Suspending** \ + * **Pausing** \ + * **Resuming** \ + * **Preparing** \ + * **Scaling** + */ +export type CapacityProvisioningState = string; + +/** Known values of {@link Mode} that the service accepts. */ +export enum KnownMode { + Gen1 = "Gen1", + Gen2 = "Gen2" +} /** - * Contains response data for the beginUpdate operation. - */ -export type CapacitiesBeginUpdateResponse = DedicatedCapacity & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCapacity; - }; -}; + * Defines values for Mode. \ + * {@link KnownMode} can be used interchangeably with Mode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Gen1** \ + * **Gen2** + */ +export type Mode = string; + +/** Known values of {@link IdentityType} that the service accepts. */ +export enum KnownIdentityType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} /** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; + * Defines values for IdentityType. \ + * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type IdentityType = string; + +/** Known values of {@link VCoreSkuTier} that the service accepts. */ +export enum KnownVCoreSkuTier { + AutoScale = "AutoScale" +} /** - * Contains response data for the listNext operation. + * Defines values for VCoreSkuTier. \ + * {@link KnownVCoreSkuTier} can be used interchangeably with VCoreSkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AutoScale** */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +export type VCoreSkuTier = string; + +/** Known values of {@link VCoreProvisioningState} that the service accepts. */ +export enum KnownVCoreProvisioningState { + Succeeded = "Succeeded" +} + +/** + * Defines values for VCoreProvisioningState. \ + * {@link KnownVCoreProvisioningState} can be used interchangeably with VCoreProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** + */ +export type VCoreProvisioningState = string; + +/** Optional parameters. */ +export interface CapacitiesGetDetailsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getDetails operation. */ +export type CapacitiesGetDetailsResponse = DedicatedCapacity; + +/** Optional parameters. */ +export interface CapacitiesCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type CapacitiesCreateResponse = DedicatedCapacity; + +/** Optional parameters. */ +export interface CapacitiesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface CapacitiesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type CapacitiesUpdateResponse = DedicatedCapacity; + +/** Optional parameters. */ +export interface CapacitiesSuspendOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface CapacitiesResumeOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface CapacitiesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type CapacitiesListByResourceGroupResponse = DedicatedCapacities; + +/** Optional parameters. */ +export interface CapacitiesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type CapacitiesListResponse = DedicatedCapacities; + +/** Optional parameters. */ +export interface CapacitiesListSkusOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSkus operation. */ +export type CapacitiesListSkusResponse = SkuEnumerationForNewResourceResult; + +/** Optional parameters. */ +export interface CapacitiesListSkusForCapacityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSkusForCapacity operation. */ +export type CapacitiesListSkusForCapacityResponse = SkuEnumerationForExistingResourceResult; + +/** Optional parameters. */ +export interface CapacitiesCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type CapacitiesCheckNameAvailabilityResponse = CheckCapacityNameAvailabilityResult; + +/** 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 AutoScaleVCoresGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AutoScaleVCoresGetResponse = AutoScaleVCore; + +/** Optional parameters. */ +export interface AutoScaleVCoresCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type AutoScaleVCoresCreateResponse = AutoScaleVCore; + +/** Optional parameters. */ +export interface AutoScaleVCoresDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface AutoScaleVCoresUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type AutoScaleVCoresUpdateResponse = AutoScaleVCore; + +/** Optional parameters. */ +export interface AutoScaleVCoresListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AutoScaleVCoresListByResourceGroupResponse = AutoScaleVCoreListResult; + +/** Optional parameters. */ +export interface AutoScaleVCoresListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type AutoScaleVCoresListBySubscriptionResponse = AutoScaleVCoreListResult; + +/** Optional parameters. */ +export interface PowerBIDedicatedOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts index ca7783976708..e2471bf9e5bb 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts @@ -1,40 +1,27 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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 { 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 OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const CapacitySku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "CapacitySku", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - readOnly: true, - serializedName: "resource", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - operation: { - readOnly: true, - serializedName: "operation", + tier: { + serializedName: "tier", type: { name: "String" } @@ -43,165 +30,182 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const DedicatedCapacityMutableProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "DedicatedCapacityMutableProperties", modelProperties: { - name: { - readOnly: true, - serializedName: "name", + administration: { + serializedName: "administration", type: { - name: "String" + name: "Composite", + className: "DedicatedCapacityAdministrators" } }, - display: { - serializedName: "display", + mode: { + serializedName: "mode", type: { - name: "Composite", - className: "OperationDisplay" + name: "String" } } } } }; -export const ResourceSku: msRest.CompositeMapper = { - serializedName: "ResourceSku", +export const DedicatedCapacityAdministrators: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSku", + className: "DedicatedCapacityAdministrators", modelProperties: { - name: { - required: true, - serializedName: "name", - type: { - name: "String" - } - }, - tier: { - serializedName: "tier", + members: { + serializedName: "members", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", className: "Resource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, location: { - required: true, serializedName: "location", - type: { - name: "String" - } - }, - sku: { required: true, - serializedName: "sku", type: { - name: "Composite", - className: "ResourceSku" + name: "String" } }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" } } } } }; -export const DedicatedCapacity: msRest.CompositeMapper = { - serializedName: "DedicatedCapacity", +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCapacity", + className: "SystemData", modelProperties: { - ...Resource.type.modelProperties, - administration: { - serializedName: "properties.administration", + createdBy: { + serializedName: "createdBy", type: { - name: "Composite", - className: "DedicatedCapacityAdministrators" + name: "String" } }, - state: { - readOnly: true, - serializedName: "properties.state", + createdByType: { + serializedName: "createdByType", type: { name: "String" } }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { name: "String" } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } } } } }; -export const DedicatedCapacityAdministrators: msRest.CompositeMapper = { - serializedName: "DedicatedCapacityAdministrators", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCapacityAdministrators", + className: "ErrorResponse", modelProperties: { - members: { - serializedName: "members", + error: { + serializedName: "error", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "ErrorResponseError" } } } } }; -export const DedicatedCapacityUpdateParameters: msRest.CompositeMapper = { - serializedName: "DedicatedCapacityUpdateParameters", +export const ErrorResponseError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const DedicatedCapacityUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "DedicatedCapacityUpdateParameters", @@ -210,18 +214,14 @@ export const DedicatedCapacityUpdateParameters: msRest.CompositeMapper = { serializedName: "sku", type: { name: "Composite", - className: "ResourceSku" + className: "CapacitySku" } }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } }, administration: { @@ -230,13 +230,40 @@ export const DedicatedCapacityUpdateParameters: msRest.CompositeMapper = { name: "Composite", className: "DedicatedCapacityAdministrators" } + }, + mode: { + serializedName: "properties.mode", + type: { + name: "String" + } } } } }; -export const SkuEnumerationForNewResourceResult: msRest.CompositeMapper = { - serializedName: "SkuEnumerationForNewResourceResult", +export const DedicatedCapacities: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DedicatedCapacities", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DedicatedCapacity" + } + } + } + } + } + } +}; + +export const SkuEnumerationForNewResourceResult: coreClient.CompositeMapper = { type: { name: "Composite", className: "SkuEnumerationForNewResourceResult", @@ -248,7 +275,28 @@ export const SkuEnumerationForNewResourceResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceSku" + className: "CapacitySku" + } + } + } + } + } + } +}; + +export const SkuEnumerationForExistingResourceResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuEnumerationForExistingResourceResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuDetailsForExistingResource" } } } @@ -257,8 +305,7 @@ export const SkuEnumerationForNewResourceResult: msRest.CompositeMapper = { } }; -export const SkuDetailsForExistingResource: msRest.CompositeMapper = { - serializedName: "SkuDetailsForExistingResource", +export const SkuDetailsForExistingResource: coreClient.CompositeMapper = { type: { name: "Composite", className: "SkuDetailsForExistingResource", @@ -267,49 +314,87 @@ export const SkuDetailsForExistingResource: msRest.CompositeMapper = { serializedName: "sku", type: { name: "Composite", - className: "ResourceSku" + className: "CapacitySku" } } } } }; -export const SkuEnumerationForExistingResourceResult: msRest.CompositeMapper = { - serializedName: "SkuEnumerationForExistingResourceResult", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuEnumerationForExistingResourceResult", + className: "OperationListResult", modelProperties: { value: { serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "SkuDetailsForExistingResource" + className: "Operation" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "Operation", modelProperties: { - code: { - serializedName: "code", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - message: { - serializedName: "message", + 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" } @@ -318,26 +403,25 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; -export const CheckCapacityNameAvailabilityParameters: msRest.CompositeMapper = { - serializedName: "CheckCapacityNameAvailabilityParameters", +export const CheckCapacityNameAvailabilityParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckCapacityNameAvailabilityParameters", modelProperties: { name: { - serializedName: "name", constraints: { + Pattern: new RegExp("^[a-z][a-z0-9]*$"), MaxLength: 63, - MinLength: 3, - Pattern: /^[a-z][a-z0-9]*$/ + MinLength: 3 }, + serializedName: "name", type: { name: "String" } }, type: { + defaultValue: "Microsoft.PowerBIDedicated/capacities", serializedName: "type", - defaultValue: 'Microsoft.PowerBIDedicated/capacities', type: { name: "String" } @@ -346,8 +430,7 @@ export const CheckCapacityNameAvailabilityParameters: msRest.CompositeMapper = { } }; -export const CheckCapacityNameAvailabilityResult: msRest.CompositeMapper = { - serializedName: "CheckCapacityNameAvailabilityResult", +export const CheckCapacityNameAvailabilityResult: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckCapacityNameAvailabilityResult", @@ -374,21 +457,92 @@ export const CheckCapacityNameAvailabilityResult: msRest.CompositeMapper = { } }; -export const DedicatedCapacities: msRest.CompositeMapper = { - serializedName: "DedicatedCapacities", +export const AutoScaleVCoreSku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCapacities", + className: "AutoScaleVCoreSku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const AutoScaleVCoreMutableProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoScaleVCoreMutableProperties", + modelProperties: { + capacityLimit: { + serializedName: "capacityLimit", + type: { + name: "Number" + } + } + } + } +}; + +export const AutoScaleVCoreUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoScaleVCoreUpdateParameters", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "AutoScaleVCoreSku" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + capacityLimit: { + serializedName: "properties.capacityLimit", + type: { + name: "Number" + } + } + } + } +}; + +export const AutoScaleVCoreListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoScaleVCoreListResult", modelProperties: { value: { + serializedName: "value", required: true, - serializedName: "", type: { name: "Sequence", element: { type: { name: "Composite", - className: "DedicatedCapacity" + className: "AutoScaleVCore" } } } @@ -397,28 +551,125 @@ export const DedicatedCapacities: msRest.CompositeMapper = { } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const DedicatedCapacityProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "DedicatedCapacityProperties", modelProperties: { - value: { + ...DedicatedCapacityMutableProperties.type.modelProperties, + state: { + serializedName: "state", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" } }, - nextLink: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DedicatedCapacity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DedicatedCapacity", + modelProperties: { + ...Resource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "CapacitySku" + } + }, + administration: { + serializedName: "properties.administration", + type: { + name: "Composite", + className: "DedicatedCapacityAdministrators" + } + }, + mode: { + serializedName: "properties.mode", + type: { + name: "String" + } + }, + state: { + serializedName: "properties.state", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AutoScaleVCore: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoScaleVCore", + modelProperties: { + ...Resource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "AutoScaleVCoreSku" + } + }, + capacityLimit: { + serializedName: "properties.capacityLimit", + type: { + name: "Number" + } + }, + capacityObjectId: { + serializedName: "properties.capacityObjectId", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AutoScaleVCoreProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoScaleVCoreProperties", + modelProperties: { + ...AutoScaleVCoreMutableProperties.type.modelProperties, + capacityObjectId: { + serializedName: "capacityObjectId", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", readOnly: true, - serializedName: "nextLink", type: { name: "String" } diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/operationsMappers.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/operationsMappers.ts deleted file mode 100644 index b8de8606cf9d..000000000000 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/operationsMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorResponse, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts index aab9f450d3c9..852462fbbcfd 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts @@ -1,93 +1,175 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * 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 { + DedicatedCapacity as DedicatedCapacityMapper, + DedicatedCapacityUpdateParameters as DedicatedCapacityUpdateParametersMapper, + CheckCapacityNameAvailabilityParameters as CheckCapacityNameAvailabilityParametersMapper, + AutoScaleVCore as AutoScaleVCoreMapper, + AutoScaleVCoreUpdateParameters as AutoScaleVCoreUpdateParametersMapper +} 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 resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", required: true, - serializedName: "api-version", type: { name: "String" } } }; -export const dedicatedCapacityName: msRest.OperationURLParameter = { + +export const dedicatedCapacityName: OperationURLParameter = { parameterPath: "dedicatedCapacityName", mapper: { - required: true, - serializedName: "dedicatedCapacityName", constraints: { + Pattern: new RegExp("^[a-z][a-z0-9]*$"), MaxLength: 63, - MinLength: 3, - Pattern: /^[a-z][a-z0-9]*$/ + MinLength: 3 }, + serializedName: "dedicatedCapacityName", + required: true, type: { name: "String" } } }; -export const location: msRest.OperationURLParameter = { - parameterPath: "location", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "location", + defaultValue: "2021-01-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const capacityParameters: OperationParameter = { + parameterPath: "capacityParameters", + mapper: DedicatedCapacityMapper +}; + +export const capacityUpdateParameters: OperationParameter = { + parameterPath: "capacityUpdateParameters", + mapper: DedicatedCapacityUpdateParametersMapper +}; + +export const capacityParameters1: OperationParameter = { + parameterPath: "capacityParameters", + mapper: CheckCapacityNameAvailabilityParametersMapper +}; + +export const location: OperationURLParameter = { + parameterPath: "location", mapper: { + serializedName: "location", required: true, - serializedName: "resourceGroupName", - constraints: { - MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ - }, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const vcoreName: OperationURLParameter = { + parameterPath: "vcoreName", + mapper: { + constraints: { + Pattern: new RegExp("^[-a-zA-Z0-9_]+$"), + MaxLength: 63, + MinLength: 3 + }, + serializedName: "vcoreName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const vCoreParameters: OperationParameter = { + parameterPath: "vCoreParameters", + mapper: AutoScaleVCoreMapper +}; + +export const vCoreUpdateParameters: OperationParameter = { + parameterPath: "vCoreUpdateParameters", + mapper: AutoScaleVCoreUpdateParametersMapper +}; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/autoScaleVCores.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/autoScaleVCores.ts new file mode 100644 index 000000000000..1c4db9b3778e --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/autoScaleVCores.ts @@ -0,0 +1,365 @@ +/* + * 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 { AutoScaleVCores } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PowerBIDedicated } from "../powerBIDedicated"; +import { + AutoScaleVCore, + AutoScaleVCoresListByResourceGroupOptionalParams, + AutoScaleVCoresListBySubscriptionOptionalParams, + AutoScaleVCoresGetOptionalParams, + AutoScaleVCoresGetResponse, + AutoScaleVCoresCreateOptionalParams, + AutoScaleVCoresCreateResponse, + AutoScaleVCoresDeleteOptionalParams, + AutoScaleVCoreUpdateParameters, + AutoScaleVCoresUpdateOptionalParams, + AutoScaleVCoresUpdateResponse, + AutoScaleVCoresListByResourceGroupResponse, + AutoScaleVCoresListBySubscriptionResponse +} from "../models"; + +/// +/** Class containing AutoScaleVCores operations. */ +export class AutoScaleVCoresImpl implements AutoScaleVCores { + private readonly client: PowerBIDedicated; + + /** + * Initialize a new instance of the class AutoScaleVCores class. + * @param client Reference to the service client + */ + constructor(client: PowerBIDedicated) { + this.client = client; + } + + /** + * Gets all the auto scale v-cores for the given resource group. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all the auto scale v-cores for the given subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: AutoScaleVCoresListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: AutoScaleVCoresListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + } + + private async *listBySubscriptionPagingAll( + options?: AutoScaleVCoresListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets details about the specified auto scale v-core. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vcoreName: string, + options?: AutoScaleVCoresGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcoreName, options }, + getOperationSpec + ); + } + + /** + * Provisions the specified auto scale v-core based on the configuration specified in the request. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param vCoreParameters Contains the information used to provision the auto scale v-core. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + vcoreName: string, + vCoreParameters: AutoScaleVCore, + options?: AutoScaleVCoresCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcoreName, vCoreParameters, options }, + createOperationSpec + ); + } + + /** + * Deletes the specified auto scale v-core. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + vcoreName: string, + options?: AutoScaleVCoresDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcoreName, options }, + deleteOperationSpec + ); + } + + /** + * Updates the current state of the specified auto scale v-core. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param vCoreUpdateParameters Request object that contains the updated information for the auto scale + * v-core. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + vcoreName: string, + vCoreUpdateParameters: AutoScaleVCoreUpdateParameters, + options?: AutoScaleVCoresUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcoreName, vCoreUpdateParameters, options }, + updateOperationSpec + ); + } + + /** + * Gets all the auto scale v-cores for the given resource group. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Lists all the auto scale v-cores for the given subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: AutoScaleVCoresListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoScaleVCore + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.vcoreName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AutoScaleVCore + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.vCoreParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.vcoreName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.vcoreName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AutoScaleVCore + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.vCoreUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.vcoreName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoScaleVCoreListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/autoScaleVCores", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoScaleVCoreListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts index 6ee0c567a035..f05583a8aea3 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts @@ -1,690 +1,932 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/capacitiesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Capacities } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { PowerBIDedicatedManagementClientContext } from "../powerBIDedicatedManagementClientContext"; +import { PowerBIDedicated } from "../powerBIDedicated"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DedicatedCapacity, + CapacitiesListByResourceGroupOptionalParams, + CapacitiesListOptionalParams, + CapacitiesGetDetailsOptionalParams, + CapacitiesGetDetailsResponse, + CapacitiesCreateOptionalParams, + CapacitiesCreateResponse, + CapacitiesDeleteOptionalParams, + DedicatedCapacityUpdateParameters, + CapacitiesUpdateOptionalParams, + CapacitiesUpdateResponse, + CapacitiesSuspendOptionalParams, + CapacitiesResumeOptionalParams, + CapacitiesListByResourceGroupResponse, + CapacitiesListResponse, + CapacitiesListSkusOptionalParams, + CapacitiesListSkusResponse, + CapacitiesListSkusForCapacityOptionalParams, + CapacitiesListSkusForCapacityResponse, + CheckCapacityNameAvailabilityParameters, + CapacitiesCheckNameAvailabilityOptionalParams, + CapacitiesCheckNameAvailabilityResponse +} from "../models"; -/** Class representing a Capacities. */ -export class Capacities { - private readonly client: PowerBIDedicatedManagementClientContext; +/// +/** Class containing Capacities operations. */ +export class CapacitiesImpl implements Capacities { + private readonly client: PowerBIDedicated; /** - * Create a Capacities. - * @param {PowerBIDedicatedManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Capacities class. + * @param client Reference to the service client */ - constructor(client: PowerBIDedicatedManagementClientContext) { + constructor(client: PowerBIDedicated) { this.client = client; } /** - * Gets details about the specified dedicated capacity. + * Gets all the Dedicated capacities for the given resource group. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 - * characters, and a maximum of 63. - * @param [options] The optional parameters - * @returns Promise + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param options The options parameters. */ - getDetails(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase): Promise; + public listByResourceGroup( + resourceGroupName: string, + options?: CapacitiesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: CapacitiesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: CapacitiesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 - * characters, and a maximum of 63. - * @param callback The callback + * Lists all the Dedicated capacities for the given subscription. + * @param options The options parameters. */ - getDetails(resourceGroupName: string, dedicatedCapacityName: string, callback: msRest.ServiceCallback): void; + public list( + options?: CapacitiesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: CapacitiesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: CapacitiesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** + * Gets details about the specified dedicated capacity. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. + * capacity is part. This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 - * characters, and a maximum of 63. - * @param options The optional parameters - * @param callback The callback + * characters, and a maximum of 63. + * @param options The options parameters. */ - getDetails(resourceGroupName: string, dedicatedCapacityName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getDetails(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getDetails( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesGetDetailsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - dedicatedCapacityName, - options - }, - getDetailsOperationSpec, - callback) as Promise; + { resourceGroupName, dedicatedCapacityName, options }, + getDetailsOperationSpec + ); } /** * Provisions the specified Dedicated capacity based on the configuration specified in the request. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. + * capacity is part. This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the Dedicated capacity. It must be a minimum of 3 - * characters, and a maximum of 63. + * characters, and a maximum of 63. * @param capacityParameters Contains the information used to provision the Dedicated capacity. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: Models.DedicatedCapacity, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,dedicatedCapacityName,capacityParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginCreate( + resourceGroupName: string, + dedicatedCapacityName: string, + capacityParameters: DedicatedCapacity, + options?: CapacitiesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CapacitiesCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Deletes the specified Dedicated capacity. - * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,dedicatedCapacityName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + const lro = new LroImpl( + sendOperation, + { resourceGroupName, dedicatedCapacityName, capacityParameters, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Updates the current state of the specified Dedicated capacity. + * Provisions the specified Dedicated capacity based on the configuration specified in the request. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param capacityUpdateParameters Request object that contains the updated information for the - * capacity. - * @param [options] The optional parameters - * @returns Promise + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be a minimum of 3 + * characters, and a maximum of 63. + * @param capacityParameters Contains the information used to provision the Dedicated capacity. + * @param options The options parameters. */ - update(resourceGroupName: string, dedicatedCapacityName: string, capacityUpdateParameters: Models.DedicatedCapacityUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdate(resourceGroupName,dedicatedCapacityName,capacityUpdateParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + capacityParameters: DedicatedCapacity, + options?: CapacitiesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + dedicatedCapacityName, + capacityParameters, + options + ); + return poller.pollUntilDone(); } /** - * Suspends operation of the specified dedicated capacity instance. + * Deletes the specified Dedicated capacity. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param [options] The optional parameters - * @returns Promise + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. */ - suspend(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginSuspend(resourceGroupName,dedicatedCapacityName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDelete( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, dedicatedCapacityName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Resumes operation of the specified Dedicated capacity instance. + * Deletes the specified Dedicated capacity. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param [options] The optional parameters - * @returns Promise + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. */ - resume(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginResume(resourceGroupName,dedicatedCapacityName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDeleteAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + dedicatedCapacityName, + options + ); + return poller.pollUntilDone(); } /** - * Gets all the Dedicated capacities for the given resource group. - * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** + * Updates the current state of the specified Dedicated capacity. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param options The optional parameters - * @param callback The callback + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param capacityUpdateParameters Request object that contains the updated information for the + * capacity. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginUpdate( + resourceGroupName: string, + dedicatedCapacityName: string, + capacityUpdateParameters: DedicatedCapacityUpdateParameters, + options?: CapacitiesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CapacitiesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, + dedicatedCapacityName, + capacityUpdateParameters, options }, - listByResourceGroupOperationSpec, - callback) as Promise; + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Lists all the Dedicated capacities for the given subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * Updates the current state of the specified Dedicated capacity. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param capacityUpdateParameters Request object that contains the updated information for the + * capacity. + * @param options The options parameters. */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + async beginUpdateAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + capacityUpdateParameters: DedicatedCapacityUpdateParameters, + options?: CapacitiesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + dedicatedCapacityName, + capacityUpdateParameters, + options + ); + return poller.pollUntilDone(); } /** - * Lists eligible SKUs for PowerBI Dedicated resource provider. - * @param [options] The optional parameters - * @returns Promise - */ - listSkus(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - listSkus(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * Suspends operation of the specified dedicated capacity instance. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. */ - listSkus(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listSkus(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listSkusOperationSpec, - callback) as Promise; + async beginSuspend( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesSuspendOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, dedicatedCapacityName, options }, + suspendOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Lists eligible SKUs for a PowerBI Dedicated resource. - * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param [options] The optional parameters - * @returns Promise - */ - listSkusForCapacity(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Suspends operation of the specified dedicated capacity instance. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param callback The callback + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. */ - listSkusForCapacity(resourceGroupName: string, dedicatedCapacityName: string, callback: msRest.ServiceCallback): void; + async beginSuspendAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesSuspendOptionalParams + ): Promise { + const poller = await this.beginSuspend( + resourceGroupName, + dedicatedCapacityName, + options + ); + return poller.pollUntilDone(); + } + /** + * Resumes operation of the specified Dedicated capacity instance. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param options The optional parameters - * @param callback The callback + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. */ - listSkusForCapacity(resourceGroupName: string, dedicatedCapacityName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listSkusForCapacity(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - dedicatedCapacityName, - options - }, - listSkusForCapacityOperationSpec, - callback) as Promise; + async beginResume( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesResumeOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, dedicatedCapacityName, options }, + resumeOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Check the name availability in the target location. - * @param location The region name which the operation will lookup into. - * @param capacityParameters The name of the capacity. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(location: string, capacityParameters: Models.CheckCapacityNameAvailabilityParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param location The region name which the operation will lookup into. - * @param capacityParameters The name of the capacity. - * @param callback The callback - */ - checkNameAvailability(location: string, capacityParameters: Models.CheckCapacityNameAvailabilityParameters, callback: msRest.ServiceCallback): void; - /** - * @param location The region name which the operation will lookup into. - * @param capacityParameters The name of the capacity. - * @param options The optional parameters - * @param callback The callback + * Resumes operation of the specified Dedicated capacity instance. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. */ - checkNameAvailability(location: string, capacityParameters: Models.CheckCapacityNameAvailabilityParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(location: string, capacityParameters: Models.CheckCapacityNameAvailabilityParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - location, - capacityParameters, - options - }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + async beginResumeAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesResumeOptionalParams + ): Promise { + const poller = await this.beginResume( + resourceGroupName, + dedicatedCapacityName, + options + ); + return poller.pollUntilDone(); } /** - * Provisions the specified Dedicated capacity based on the configuration specified in the request. + * Gets all the Dedicated capacities for the given resource group. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be a minimum of 3 - * characters, and a maximum of 63. - * @param capacityParameters Contains the information used to provision the Dedicated capacity. - * @param [options] The optional parameters - * @returns Promise + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param options The options parameters. */ - beginCreate(resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: Models.DedicatedCapacity, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - dedicatedCapacityName, - capacityParameters, - options - }, - beginCreateOperationSpec, - options); + private _listByResourceGroup( + resourceGroupName: string, + options?: CapacitiesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * Deletes the specified Dedicated capacity. - * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param [options] The optional parameters - * @returns Promise + * Lists all the Dedicated capacities for the given subscription. + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - dedicatedCapacityName, - options - }, - beginDeleteMethodOperationSpec, - options); + private _list( + options?: CapacitiesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** - * Updates the current state of the specified Dedicated capacity. - * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param capacityUpdateParameters Request object that contains the updated information for the - * capacity. - * @param [options] The optional parameters - * @returns Promise + * Lists eligible SKUs for PowerBI Dedicated resource provider. + * @param options The options parameters. */ - beginUpdate(resourceGroupName: string, dedicatedCapacityName: string, capacityUpdateParameters: Models.DedicatedCapacityUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - dedicatedCapacityName, - capacityUpdateParameters, - options - }, - beginUpdateOperationSpec, - options); + listSkus( + options?: CapacitiesListSkusOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listSkusOperationSpec); } /** - * Suspends operation of the specified dedicated capacity instance. + * Lists eligible SKUs for a PowerBI Dedicated resource. * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param [options] The optional parameters - * @returns Promise + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. */ - beginSuspend(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - dedicatedCapacityName, - options - }, - beginSuspendOperationSpec, - options); + listSkusForCapacity( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesListSkusForCapacityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dedicatedCapacityName, options }, + listSkusForCapacityOperationSpec + ); } /** - * Resumes operation of the specified Dedicated capacity instance. - * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated - * capacity is part. This name must be at least 1 character in length, and no more than 90. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 - * characters in length, and no more than 63. - * @param [options] The optional parameters - * @returns Promise + * Check the name availability in the target location. + * @param location The region name which the operation will lookup into. + * @param capacityParameters The name of the capacity. + * @param options The options parameters. */ - beginResume(resourceGroupName: string, dedicatedCapacityName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - dedicatedCapacityName, - options - }, - beginResumeOperationSpec, - options); + checkNameAvailability( + location: string, + capacityParameters: CheckCapacityNameAvailabilityParameters, + options?: CapacitiesCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, capacityParameters, options }, + checkNameAvailabilityOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getDetailsOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getDetailsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.dedicatedCapacityName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.DedicatedCapacity }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, + Parameters.dedicatedCapacityName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DedicatedCapacities + bodyMapper: Mappers.DedicatedCapacity + }, + 201: { + bodyMapper: Mappers.DedicatedCapacity + }, + 202: { + bodyMapper: Mappers.DedicatedCapacity + }, + 204: { + bodyMapper: Mappers.DedicatedCapacity }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/capacities", + requestBody: Parameters.capacityParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.dedicatedCapacityName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.DedicatedCapacities - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listSkusOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/skus", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.dedicatedCapacityName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.SkuEnumerationForNewResourceResult + bodyMapper: Mappers.DedicatedCapacity + }, + 201: { + bodyMapper: Mappers.DedicatedCapacity + }, + 202: { + bodyMapper: Mappers.DedicatedCapacity + }, + 204: { + bodyMapper: Mappers.DedicatedCapacity }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listSkusForCapacityOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/skus", + requestBody: Parameters.capacityUpdateParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.dedicatedCapacityName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const suspendOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/suspend", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.SkuEnumerationForExistingResourceResult - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/locations/{location}/checkNameAvailability", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.location, + Parameters.$host, + Parameters.resourceGroupName, + Parameters.dedicatedCapacityName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "capacityParameters", - mapper: { - ...Mappers.CheckCapacityNameAvailabilityParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const resumeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/resume", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.CheckCapacityNameAvailabilityResult - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.dedicatedCapacityName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "capacityParameters", - mapper: { - ...Mappers.DedicatedCapacity, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedCapacity - }, - 201: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacities }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.dedicatedCapacityName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/capacities", + httpMethod: "GET", responses: { - 200: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.DedicatedCapacities + }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.dedicatedCapacityName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "capacityUpdateParameters", - mapper: { - ...Mappers.DedicatedCapacityUpdateParameters, - required: true - } - }, +const listSkusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/skus", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedCapacity - }, - 202: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.SkuEnumerationForNewResourceResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const beginSuspendOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/suspend", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.dedicatedCapacityName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], +const listSkusForCapacityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/skus", + httpMethod: "GET", responses: { - 200: {}, - 202: {}, + 200: { + bodyMapper: Mappers.SkuEnumerationForExistingResourceResult + }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginResumeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/resume", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.dedicatedCapacityName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/locations/{location}/checkNameAvailability", + httpMethod: "POST", responses: { - 200: {}, - 202: {}, + 200: { + bodyMapper: Mappers.CheckCapacityNameAvailabilityResult + }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.capacityParameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts index e7087b2e4304..568647b0885d 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts @@ -1,12 +1,11 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./capacities"; export * from "./operations"; +export * from "./autoScaleVCores"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts index 0276fc881dc3..390e2f80976f 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts @@ -1,95 +1,111 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * 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 { PowerBIDedicatedManagementClientContext } from "../powerBIDedicatedManagementClientContext"; +import { PowerBIDedicated } from "../powerBIDedicated"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: PowerBIDedicatedManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: PowerBIDedicated; /** - * Create a Operations. - * @param {PowerBIDedicatedManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: PowerBIDedicatedManagementClientContext) { + constructor(client: PowerBIDedicated) { this.client = client; } /** * Lists all of the available PowerBIDedicated 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 PowerBIDedicated 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.PowerBIDedicated/operations", httpMethod: "GET", - path: "providers/Microsoft.PowerBIDedicated/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -98,19 +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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -119,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/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/autoScaleVCores.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/autoScaleVCores.ts new file mode 100644 index 000000000000..008c17027b90 --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/autoScaleVCores.ts @@ -0,0 +1,101 @@ +/* + * 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 { + AutoScaleVCore, + AutoScaleVCoresListByResourceGroupOptionalParams, + AutoScaleVCoresListBySubscriptionOptionalParams, + AutoScaleVCoresGetOptionalParams, + AutoScaleVCoresGetResponse, + AutoScaleVCoresCreateOptionalParams, + AutoScaleVCoresCreateResponse, + AutoScaleVCoresDeleteOptionalParams, + AutoScaleVCoreUpdateParameters, + AutoScaleVCoresUpdateOptionalParams, + AutoScaleVCoresUpdateResponse +} from "../models"; + +/// +/** Interface representing a AutoScaleVCores. */ +export interface AutoScaleVCores { + /** + * Gets all the auto scale v-cores for the given resource group. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all the auto scale v-cores for the given subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: AutoScaleVCoresListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets details about the specified auto scale v-core. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vcoreName: string, + options?: AutoScaleVCoresGetOptionalParams + ): Promise; + /** + * Provisions the specified auto scale v-core based on the configuration specified in the request. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param vCoreParameters Contains the information used to provision the auto scale v-core. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + vcoreName: string, + vCoreParameters: AutoScaleVCore, + options?: AutoScaleVCoresCreateOptionalParams + ): Promise; + /** + * Deletes the specified auto scale v-core. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + vcoreName: string, + options?: AutoScaleVCoresDeleteOptionalParams + ): Promise; + /** + * Updates the current state of the specified auto scale v-core. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param vCoreUpdateParameters Request object that contains the updated information for the auto scale + * v-core. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + vcoreName: string, + vCoreUpdateParameters: AutoScaleVCoreUpdateParameters, + options?: AutoScaleVCoresUpdateOptionalParams + ): Promise; +} diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/capacities.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/capacities.ts new file mode 100644 index 000000000000..16da4b4a7a12 --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/capacities.ts @@ -0,0 +1,248 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DedicatedCapacity, + CapacitiesListByResourceGroupOptionalParams, + CapacitiesListOptionalParams, + CapacitiesGetDetailsOptionalParams, + CapacitiesGetDetailsResponse, + CapacitiesCreateOptionalParams, + CapacitiesCreateResponse, + CapacitiesDeleteOptionalParams, + DedicatedCapacityUpdateParameters, + CapacitiesUpdateOptionalParams, + CapacitiesUpdateResponse, + CapacitiesSuspendOptionalParams, + CapacitiesResumeOptionalParams, + CapacitiesListSkusOptionalParams, + CapacitiesListSkusResponse, + CapacitiesListSkusForCapacityOptionalParams, + CapacitiesListSkusForCapacityResponse, + CheckCapacityNameAvailabilityParameters, + CapacitiesCheckNameAvailabilityOptionalParams, + CapacitiesCheckNameAvailabilityResponse +} from "../models"; + +/// +/** Interface representing a Capacities. */ +export interface Capacities { + /** + * Gets all the Dedicated capacities for the given resource group. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: CapacitiesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all the Dedicated capacities for the given subscription. + * @param options The options parameters. + */ + list( + options?: CapacitiesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets details about the specified dedicated capacity. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 + * characters, and a maximum of 63. + * @param options The options parameters. + */ + getDetails( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesGetDetailsOptionalParams + ): Promise; + /** + * Provisions the specified Dedicated capacity based on the configuration specified in the request. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be a minimum of 3 + * characters, and a maximum of 63. + * @param capacityParameters Contains the information used to provision the Dedicated capacity. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + dedicatedCapacityName: string, + capacityParameters: DedicatedCapacity, + options?: CapacitiesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CapacitiesCreateResponse + > + >; + /** + * Provisions the specified Dedicated capacity based on the configuration specified in the request. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be a minimum of 3 + * characters, and a maximum of 63. + * @param capacityParameters Contains the information used to provision the Dedicated capacity. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + capacityParameters: DedicatedCapacity, + options?: CapacitiesCreateOptionalParams + ): Promise; + /** + * Deletes the specified Dedicated capacity. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the specified Dedicated capacity. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesDeleteOptionalParams + ): Promise; + /** + * Updates the current state of the specified Dedicated capacity. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param capacityUpdateParameters Request object that contains the updated information for the + * capacity. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + dedicatedCapacityName: string, + capacityUpdateParameters: DedicatedCapacityUpdateParameters, + options?: CapacitiesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CapacitiesUpdateResponse + > + >; + /** + * Updates the current state of the specified Dedicated capacity. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param capacityUpdateParameters Request object that contains the updated information for the + * capacity. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + capacityUpdateParameters: DedicatedCapacityUpdateParameters, + options?: CapacitiesUpdateOptionalParams + ): Promise; + /** + * Suspends operation of the specified dedicated capacity instance. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. + */ + beginSuspend( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesSuspendOptionalParams + ): Promise, void>>; + /** + * Suspends operation of the specified dedicated capacity instance. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. + */ + beginSuspendAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesSuspendOptionalParams + ): Promise; + /** + * Resumes operation of the specified Dedicated capacity instance. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. + */ + beginResume( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesResumeOptionalParams + ): Promise, void>>; + /** + * Resumes operation of the specified Dedicated capacity instance. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. + */ + beginResumeAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesResumeOptionalParams + ): Promise; + /** + * Lists eligible SKUs for PowerBI Dedicated resource provider. + * @param options The options parameters. + */ + listSkus( + options?: CapacitiesListSkusOptionalParams + ): Promise; + /** + * Lists eligible SKUs for a PowerBI Dedicated resource. + * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated + * capacity is part. This name must be at least 1 character in length, and no more than 90. + * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in + * length, and no more than 63. + * @param options The options parameters. + */ + listSkusForCapacity( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesListSkusForCapacityOptionalParams + ): Promise; + /** + * Check the name availability in the target location. + * @param location The region name which the operation will lookup into. + * @param capacityParameters The name of the capacity. + * @param options The options parameters. + */ + checkNameAvailability( + location: string, + capacityParameters: CheckCapacityNameAvailabilityParameters, + options?: CapacitiesCheckNameAvailabilityOptionalParams + ): Promise; +} diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..568647b0885d --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * 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 "./capacities"; +export * from "./operations"; +export * from "./autoScaleVCores"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/operations.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..cbe1a464632f --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/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 PowerBIDedicated REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicated.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicated.ts new file mode 100644 index 000000000000..fa48c24496ae --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicated.ts @@ -0,0 +1,88 @@ +/* + * 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 coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + CapacitiesImpl, + OperationsImpl, + AutoScaleVCoresImpl +} from "./operations"; +import { + Capacities, + Operations, + AutoScaleVCores +} from "./operationsInterfaces"; +import { PowerBIDedicatedOptionalParams } from "./models"; + +export class PowerBIDedicated extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the PowerBIDedicated class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId A unique identifier for a Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: PowerBIDedicatedOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PowerBIDedicatedOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-powerbidedicated/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + 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; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-01-01"; + this.capacities = new CapacitiesImpl(this); + this.operations = new OperationsImpl(this); + this.autoScaleVCores = new AutoScaleVCoresImpl(this); + } + + capacities: Capacities; + operations: Operations; + autoScaleVCores: AutoScaleVCores; +} diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClient.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClient.ts deleted file mode 100644 index 33c72336bac6..000000000000 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClient.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { PowerBIDedicatedManagementClientContext } from "./powerBIDedicatedManagementClientContext"; - - -class PowerBIDedicatedManagementClient extends PowerBIDedicatedManagementClientContext { - // Operation groups - capacities: operations.Capacities; - operations: operations.Operations; - - /** - * Initializes a new instance of the PowerBIDedicatedManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId A unique identifier for a Microsoft Azure subscription. The subscription - * ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PowerBIDedicatedManagementClientOptions) { - super(credentials, subscriptionId, options); - this.capacities = new operations.Capacities(this); - this.operations = new operations.Operations(this); - } -} - -// Operation Specifications - -export { - PowerBIDedicatedManagementClient, - PowerBIDedicatedManagementClientContext, - Models as PowerBIDedicatedManagementModels, - Mappers as PowerBIDedicatedManagementMappers -}; -export * from "./operations"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClientContext.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClientContext.ts deleted file mode 100644 index 8c2c324a10d1..000000000000 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClientContext.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-powerbidedicated"; -const packageVersion = "2.0.0"; - -export class PowerBIDedicatedManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the PowerBIDedicatedManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId A unique identifier for a Microsoft Azure subscription. The subscription - * ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PowerBIDedicatedManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2017-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; - 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; - } - } -} diff --git a/sdk/powerbidedicated/arm-powerbidedicated/test/sampleTest.ts b/sdk/powerbidedicated/arm-powerbidedicated/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/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/powerbidedicated/arm-powerbidedicated/tsconfig.json b/sdk/powerbidedicated/arm-powerbidedicated/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/tsconfig.json +++ b/sdk/powerbidedicated/arm-powerbidedicated/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/powerbidedicated/ci.yml b/sdk/powerbidedicated/ci.yml new file mode 100644 index 000000000000..cca15f146d26 --- /dev/null +++ b/sdk/powerbidedicated/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/powerbidedicated/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/powerbidedicated/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: powerbidedicated + Artifacts: + - name: azure-arm-powerbidedicated + safeName: azurearmpowerbidedicated + \ No newline at end of file