diff --git a/sdk/powerbidedicated/arm-powerbidedicated/CHANGELOG.md b/sdk/powerbidedicated/arm-powerbidedicated/CHANGELOG.md index 21efe3d4e689..9be385fbd476 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/CHANGELOG.md +++ b/sdk/powerbidedicated/arm-powerbidedicated/CHANGELOG.md @@ -1,15 +1,47 @@ # Release History - -## 4.0.2 (Unreleased) - + +## 5.0.0 (2025-04-28) + ### Features Added -### Breaking Changes + - Added Interface AutoScaleVCoresListByResourceGroupNextOptionalParams + - Added Interface AutoScaleVCoresListBySubscriptionNextOptionalParams + - Added Interface CapacitiesCreateHeaders + - Added Interface CapacitiesDeleteHeaders + - Added Interface CapacitiesResumeHeaders + - Added Interface CapacitiesSuspendHeaders + - Added Interface CapacitiesUpdateHeaders + - Added Interface LogSpecification + - Added Interface MetricSpecification + - Added Interface MetricSpecificationDimensionsItem + - Added Interface OperationProperties + - Added Interface ServiceSpecification + - Added Interface TrackedResource + - Added Type Alias AutoScaleVCoresListByResourceGroupNextResponse + - Added Type Alias AutoScaleVCoresListBySubscriptionNextResponse + - Added Type Alias CreatedByType + - Interface AutoScaleVCoreListResult has a new optional parameter nextLink + - Interface CapacitySku has a new optional parameter capacity + - Interface DedicatedCapacity has a new optional parameter friendlyName + - Interface DedicatedCapacity has a new optional parameter tenantId + - Interface DedicatedCapacityMutableProperties has a new optional parameter friendlyName + - Interface DedicatedCapacityMutableProperties has a new optional parameter tenantId + - Interface DedicatedCapacityUpdateParameters has a new optional parameter friendlyName + - Interface DedicatedCapacityUpdateParameters has a new optional parameter tenantId + - Interface Operation has a new optional parameter origin + - Interface Operation has a new optional parameter properties + - Interface OperationDisplay has a new optional parameter description + - Interface SkuDetailsForExistingResource has a new optional parameter resourceType + - Added Enum KnownCreatedByType -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Interface Resource no longer has parameter location + - Interface Resource no longer has parameter tags + - Type of parameter createdByType of interface SystemData is changed from IdentityType to CreatedByType + - Type of parameter lastModifiedByType of interface SystemData is changed from IdentityType to CreatedByType + - Removed Enum KnownIdentityType + ## 4.0.1 (2023-01-31) ### Features Added @@ -55,4 +87,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. 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/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/powerbidedicated/arm-powerbidedicated/LICENSE b/sdk/powerbidedicated/arm-powerbidedicated/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/LICENSE +++ b/sdk/powerbidedicated/arm-powerbidedicated/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/powerbidedicated/arm-powerbidedicated/README.md b/sdk/powerbidedicated/arm-powerbidedicated/README.md index 8adde6bcd5d3..2c028641c8ab 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/README.md +++ b/sdk/powerbidedicated/arm-powerbidedicated/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure PowerBIDedicated** 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://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -64,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { PowerBIDedicated } from "@azure/arm-powerbidedicated"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new PowerBIDedicated(credential, subscriptionId); ``` ### 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). ## Key concepts @@ -109,7 +106,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/powerbidedicated/arm-powerbidedicated/_meta.json b/sdk/powerbidedicated/arm-powerbidedicated/_meta.json index 064f0558386b..3640806fddf8 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/_meta.json +++ b/sdk/powerbidedicated/arm-powerbidedicated/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf", - "readme": "specification\\powerbidedicated\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\powerbidedicated\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", + "commit": "ab0ab49d4a4585e4a18d916dafae45e2d9baf791", + "readme": "specification/powerbidedicated/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/powerbidedicated/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.0", - "use": "@autorest/typescript@6.0.0-rc.7" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" } diff --git a/sdk/powerbidedicated/arm-powerbidedicated/api-extractor.json b/sdk/powerbidedicated/arm-powerbidedicated/api-extractor.json index 03364890a913..5fae20eb647d 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/api-extractor.json +++ b/sdk/powerbidedicated/arm-powerbidedicated/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/powerbidedicated/arm-powerbidedicated/package.json b/sdk/powerbidedicated/arm-powerbidedicated/package.json index 17297bffd9fe..b2249fdac130 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/package.json +++ b/sdk/powerbidedicated/arm-powerbidedicated/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for PowerBIDedicated.", - "version": "4.0.2", + "version": "5.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-lro": "^2.2.0", + "@azure/core-client": "^1.9.3", + "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -28,18 +28,19 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.7.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.50.1", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, @@ -60,16 +61,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", "extract-api": "dev-tool run extract-api", - "format": "echo skipped", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -90,16 +91,9 @@ ] }, "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/powerbidedicated/arm-powerbidedicated", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-powerbidedicated?view=azure-node-preview" - }, - "type": "module", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -116,8 +110,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -139,4 +131,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/powerbidedicated/arm-powerbidedicated/review/arm-powerbidedicated.api.md b/sdk/powerbidedicated/arm-powerbidedicated/review/arm-powerbidedicated.api.md index 47277c05444a..d496641b0380 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/review/arm-powerbidedicated.api.md +++ b/sdk/powerbidedicated/arm-powerbidedicated/review/arm-powerbidedicated.api.md @@ -6,12 +6,12 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public -export interface AutoScaleVCore extends Resource { +export interface AutoScaleVCore extends TrackedResource { capacityLimit?: number; capacityObjectId?: string; readonly provisioningState?: VCoreProvisioningState; @@ -20,6 +20,8 @@ export interface AutoScaleVCore extends Resource { // @public export interface AutoScaleVCoreListResult { + // (undocumented) + nextLink?: string; value: AutoScaleVCore[]; } @@ -69,6 +71,13 @@ export interface AutoScaleVCoreSku { tier?: VCoreSkuTier; } +// @public +export interface AutoScaleVCoresListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoScaleVCoresListByResourceGroupNextResponse = AutoScaleVCoreListResult; + // @public export interface AutoScaleVCoresListByResourceGroupOptionalParams extends coreClient.OperationOptions { } @@ -76,6 +85,13 @@ export interface AutoScaleVCoresListByResourceGroupOptionalParams extends coreCl // @public export type AutoScaleVCoresListByResourceGroupResponse = AutoScaleVCoreListResult; +// @public +export interface AutoScaleVCoresListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoScaleVCoresListBySubscriptionNextResponse = AutoScaleVCoreListResult; + // @public export interface AutoScaleVCoresListBySubscriptionOptionalParams extends coreClient.OperationOptions { } @@ -101,20 +117,20 @@ export interface AutoScaleVCoreUpdateParameters { // @public export interface Capacities { - beginCreate(resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: DedicatedCapacity, options?: CapacitiesCreateOptionalParams): Promise, CapacitiesCreateResponse>>; + 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>>; + 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>>; + 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>>; + 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>>; + 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; + list(options?: CapacitiesListOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: CapacitiesListByResourceGroupOptionalParams): Promise; listSkus(options?: CapacitiesListSkusOptionalParams): Promise; listSkusForCapacity(resourceGroupName: string, dedicatedCapacityName: string, options?: CapacitiesListSkusForCapacityOptionalParams): Promise; } @@ -126,6 +142,12 @@ export interface CapacitiesCheckNameAvailabilityOptionalParams extends coreClien // @public export type CapacitiesCheckNameAvailabilityResponse = CheckCapacityNameAvailabilityResult; +// @public +export interface CapacitiesCreateHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface CapacitiesCreateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -135,6 +157,12 @@ export interface CapacitiesCreateOptionalParams extends coreClient.OperationOpti // @public export type CapacitiesCreateResponse = DedicatedCapacity; +// @public +export interface CapacitiesDeleteHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface CapacitiesDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -176,18 +204,36 @@ export interface CapacitiesListSkusOptionalParams extends coreClient.OperationOp // @public export type CapacitiesListSkusResponse = SkuEnumerationForNewResourceResult; +// @public +export interface CapacitiesResumeHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface CapacitiesResumeOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export interface CapacitiesSuspendHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface CapacitiesSuspendOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export interface CapacitiesUpdateHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface CapacitiesUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -202,6 +248,7 @@ export type CapacityProvisioningState = string; // @public export interface CapacitySku { + capacity?: number; name: string; tier?: CapacitySkuTier; } @@ -222,18 +269,23 @@ export interface CheckCapacityNameAvailabilityResult { reason?: string; } +// @public +export type CreatedByType = string; + // @public export interface DedicatedCapacities { value: DedicatedCapacity[]; } // @public -export interface DedicatedCapacity extends Resource { +export interface DedicatedCapacity extends TrackedResource { administration?: DedicatedCapacityAdministrators; + readonly friendlyName?: string; mode?: Mode; readonly provisioningState?: CapacityProvisioningState; sku: CapacitySku; readonly state?: State; + readonly tenantId?: string; } // @public @@ -244,7 +296,9 @@ export interface DedicatedCapacityAdministrators { // @public export interface DedicatedCapacityMutableProperties { administration?: DedicatedCapacityAdministrators; + readonly friendlyName?: string; mode?: Mode; + readonly tenantId?: string; } // @public @@ -256,11 +310,13 @@ export interface DedicatedCapacityProperties extends DedicatedCapacityMutablePro // @public export interface DedicatedCapacityUpdateParameters { administration?: DedicatedCapacityAdministrators; + readonly friendlyName?: string; mode?: Mode; sku?: CapacitySku; tags?: { [propertyName: string]: string; }; + readonly tenantId?: string; } // @public @@ -277,9 +333,6 @@ export interface ErrorResponseError { // @public export function getContinuationToken(page: unknown): string | undefined; -// @public -export type IdentityType = string; - // @public export enum KnownCapacityProvisioningState { Deleting = "Deleting", @@ -304,7 +357,7 @@ export enum KnownCapacitySkuTier { } // @public -export enum KnownIdentityType { +export enum KnownCreatedByType { Application = "Application", Key = "Key", ManagedIdentity = "ManagedIdentity", @@ -343,6 +396,30 @@ export enum KnownVCoreSkuTier { AutoScale = "AutoScale" } +// @public +export interface LogSpecification { + readonly blobDuration?: string; + displayName?: string; + readonly name?: string; +} + +// @public +export interface MetricSpecification { + readonly aggregationType?: string; + dimensions?: MetricSpecificationDimensionsItem[]; + displayDescription?: string; + displayName?: string; + readonly metricFilterPattern?: string; + readonly name?: string; + readonly unit?: string; +} + +// @public (undocumented) +export interface MetricSpecificationDimensionsItem { + displayName?: string; + readonly name?: string; +} + // @public export type Mode = string; @@ -350,10 +427,13 @@ export type Mode = string; export interface Operation { display?: OperationDisplay; readonly name?: string; + readonly origin?: string; + properties?: OperationProperties; } // @public export interface OperationDisplay { + description?: string; readonly operation?: string; readonly provider?: string; readonly resource?: string; @@ -365,6 +445,11 @@ export interface OperationListResult { readonly value?: Operation[]; } +// @public +export interface OperationProperties { + serviceSpecification?: ServiceSpecification; +} + // @public export interface Operations { list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; @@ -411,17 +496,20 @@ export interface PowerBIDedicatedOptionalParams extends coreClient.ServiceClient // @public export interface Resource { readonly id?: string; - location: string; readonly name?: string; - systemData?: SystemData; - tags?: { - [propertyName: string]: string; - }; + readonly systemData?: SystemData; readonly type?: string; } +// @public +export interface ServiceSpecification { + logSpecifications?: LogSpecification[]; + metricSpecifications?: MetricSpecification[]; +} + // @public export interface SkuDetailsForExistingResource { + resourceType?: string; sku?: CapacitySku; } @@ -442,10 +530,18 @@ export type State = string; export interface SystemData { createdAt?: Date; createdBy?: string; - createdByType?: IdentityType; + createdByType?: CreatedByType; lastModifiedAt?: Date; lastModifiedBy?: string; - lastModifiedByType?: IdentityType; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; } // @public diff --git a/sdk/powerbidedicated/arm-powerbidedicated/sample.env b/sdk/powerbidedicated/arm-powerbidedicated/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/sample.env +++ b/sdk/powerbidedicated/arm-powerbidedicated/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/lroImpl.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/lroImpl.ts index 518d5f053b4e..1b3a95e6c540 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/lroImpl.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/lroImpl.ts @@ -6,29 +6,31 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { AbortSignalLike } from "@azure/abort-controller"; 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" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; } diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts index e0f836b81088..74ab344cdd54 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts @@ -8,161 +8,244 @@ import * as coreClient from "@azure/core-client"; -/** 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; +/** 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[]; + /** + * 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; } -/** 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; +/** 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; + /** + * Origin of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: string; + /** Additional properties to expose performance metrics to shoebox. */ + properties?: OperationProperties; } -/** An array of administrator user identities */ -export interface DedicatedCapacityAdministrators { - /** An array of administrator user identities. */ - members?: string[]; +/** 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; + /** Localized description of the operation. */ + description?: string; } -/** Represents an instance of an PowerBI Dedicated resource. */ -export interface Resource { +/** Additional properties to expose performance metrics to shoebox. */ +export interface OperationProperties { + /** Service specification for exposing performance metrics to shoebox. */ + serviceSpecification?: ServiceSpecification; +} + +/** Service specification for exposing performance metrics to shoebox. */ +export interface ServiceSpecification { + /** Metric specifications for exposing performance metrics to shoebox. */ + metricSpecifications?: MetricSpecification[]; + /** Log specifications for exposing diagnostic logs to shoebox. */ + logSpecifications?: LogSpecification[]; +} + +/** Metric specification for exposing performance metrics to shoebox. */ +export interface MetricSpecification { /** - * An identifier that represents the PowerBI Dedicated resource. + * Metric name * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly name?: string; + /** Localizable metric name */ + displayName?: string; + /** Localizable description of metric */ + displayDescription?: string; /** - * The name of the PowerBI Dedicated resource. + * Unit for the metric * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly unit?: string; /** - * The type of the PowerBI Dedicated resource. + * Aggregation type for the metric * 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: string; - /** Key-value pairs of additional resource provisioning properties. */ - tags?: { [propertyName: string]: string }; - /** Metadata pertaining to creation and last modification of the resource. */ - systemData?: SystemData; + readonly aggregationType?: string; + /** + * Pattern used to filter the metric + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metricFilterPattern?: string; + /** For describing multi dimensional metrics */ + dimensions?: MetricSpecificationDimensionsItem[]; } -/** 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; +export interface MetricSpecificationDimensionsItem { + /** + * Dimension of the metric + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** Localizable dimension of the metric */ + displayName?: string; +} + +/** Log specification for exposing diagnostic logs to shoebox. */ +export interface LogSpecification { + /** + * Name of the log + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** Localizable name of the log */ + displayName?: string; + /** + * Blob duration for the log + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly blobDuration?: string; } -/** Describes the format of Error response. */ +/** The error object */ export interface ErrorResponse { - /** The error object */ + /** The error object. */ error?: ErrorResponseError; } -/** The error object */ +/** The error object. */ export interface ErrorResponseError { - /** Error code */ + /** 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?: CapacitySku; - /** Key-value pairs of additional provisioning properties. */ - tags?: { [propertyName: string]: string }; - /** 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 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?: CapacitySku[]; +/** An array of auto scale v-core resources. */ +export interface AutoScaleVCoreListResult { + /** An array of auto scale v-core resources. */ + value: AutoScaleVCore[]; + nextLink?: string; } -/** 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 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; } -/** An object that represents SKU details for existing resources */ -export interface SkuDetailsForExistingResource { - /** The SKU in SKU details for existing resources. */ - sku?: CapacitySku; +/** 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; } -/** Result listing capacities. It contains a list of operations and a URL link to get the next set of results. */ -export interface OperationListResult { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * List of capacities supported by the Microsoft.PowerBIDedicated resource provider. + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Operation[]; + readonly id?: string; /** - * URL to get the next set of operation list results if there are any. + * The name of the resource * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** Capacities REST API operation. */ -export interface Operation { + readonly name?: string; /** - * Operation name: {provider}/{resource}/{operation}. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * 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; -} - -/** The object that represents the operation. */ -export interface OperationDisplay { + readonly type?: string; /** - * Service provider: Microsoft.PowerBIDedicated. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provider?: string; + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** An array of Dedicated capacities resources. */ +export interface DedicatedCapacities { + /** An array of Dedicated capacities resources. */ + value: DedicatedCapacity[]; +} + +/** 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; /** - * Resource on which the operation is performed: capacity, etc. + * Tenant ID for the capacity. Used for creating Pro Plus capacity. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resource?: string; + readonly tenantId?: string; /** - * Operation type: create, update, delete, etc. + * Capacity name * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; + readonly friendlyName?: string; +} + +/** An array of administrator user identities */ +export interface DedicatedCapacityAdministrators { + /** An array of administrator user identities. */ + members?: 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; + /** The capacity of the SKU. */ + capacity?: number; } /** Details of capacity name request body. */ @@ -183,20 +266,10 @@ export interface CheckCapacityNameAvailabilityResult { message?: 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; -} - -/** 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; +/** An object that represents enumerating SKUs for new resources */ +export interface SkuEnumerationForNewResourceResult { + /** The collection of available SKUs for new resources */ + value?: CapacitySku[]; } /** Update request specification */ @@ -209,15 +282,63 @@ export interface AutoScaleVCoreUpdateParameters { capacityLimit?: number; } -/** An array of auto scale v-core resources. */ -export interface AutoScaleVCoreListResult { - /** An array of auto scale v-core resources. */ - value: AutoScaleVCore[]; +/** Provision request specification */ +export interface DedicatedCapacityUpdateParameters { + /** 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 */ + 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; + /** + * Tenant ID for the capacity. Used for creating Pro Plus capacity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** + * Capacity name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly friendlyName?: string; +} + +/** 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 resource type */ + resourceType?: string; + /** The SKU in SKU details for existing resources. */ + sku?: CapacitySku; +} + +/** Properties of an auto scale v-core resource. */ +export interface AutoScaleVCoreProperties extends AutoScaleVCoreMutableProperties { + /** The object ID of the capacity resource associated with the auto scale v-core resource. */ + capacityObjectId?: string; + /** + * 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. + */ + readonly provisioningState?: VCoreProvisioningState; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; } /** Properties of Dedicated Capacity resource. */ -export interface DedicatedCapacityProperties - extends DedicatedCapacityMutableProperties { +export interface DedicatedCapacityProperties extends DedicatedCapacityMutableProperties { /** * 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. @@ -230,14 +351,39 @@ export interface DedicatedCapacityProperties readonly provisioningState?: CapacityProvisioningState; } +/** Represents an instance of an auto scale v-core resource. */ +export interface AutoScaleVCore extends TrackedResource { + /** 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 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. + */ + readonly provisioningState?: VCoreProvisioningState; +} + /** Represents an instance of a Dedicated Capacity resource. */ -export interface DedicatedCapacity extends Resource { +export interface DedicatedCapacity extends TrackedResource { /** 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; + /** + * Tenant ID for the capacity. Used for creating Pro Plus capacity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** + * Capacity name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly friendlyName?: string; /** * 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. @@ -250,53 +396,99 @@ export interface DedicatedCapacity extends Resource { readonly provisioningState?: CapacityProvisioningState; } -/** Represents an instance of an auto scale v-core resource. */ -export interface AutoScaleVCore extends 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 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. - */ - readonly provisioningState?: VCoreProvisioningState; +/** Defines headers for Capacities_create operation. */ +export interface CapacitiesCreateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; } -/** Properties of an auto scale v-core resource. */ -export interface AutoScaleVCoreProperties - extends AutoScaleVCoreMutableProperties { - /** The object ID of the capacity resource associated with the auto scale v-core resource. */ - capacityObjectId?: string; - /** - * 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. - */ - readonly provisioningState?: VCoreProvisioningState; +/** Defines headers for Capacities_update operation. */ +export interface CapacitiesUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; } -/** Known values of {@link CapacitySkuTier} that the service accepts. */ -export enum KnownCapacitySkuTier { - /** PbieAzure */ - PbieAzure = "PBIE_Azure", - /** Premium */ - Premium = "Premium", - /** AutoPremiumHost */ - AutoPremiumHost = "AutoPremiumHost" +/** Defines headers for Capacities_delete operation. */ +export interface CapacitiesDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Capacities_resume operation. */ +export interface CapacitiesResumeHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Capacities_suspend operation. */ +export interface CapacitiesSuspendHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Known values of {@link VCoreProvisioningState} that the service accepts. */ +export enum KnownVCoreProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", } /** - * Defines values for CapacitySkuTier. \ - * {@link KnownCapacitySkuTier} can be used interchangeably with CapacitySkuTier, + * 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 - * **PBIE_Azure** \ - * **Premium** \ - * **AutoPremiumHost** + * **Succeeded** */ -export type CapacitySkuTier = string; +export type VCoreProvisioningState = string; + +/** Known values of {@link VCoreSkuTier} that the service accepts. */ +export enum KnownVCoreSkuTier { + /** AutoScale */ + AutoScale = "AutoScale", +} + +/** + * 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 VCoreSkuTier = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; /** Known values of {@link State} that the service accepts. */ export enum KnownState { @@ -323,7 +515,7 @@ export enum KnownState { /** Preparing */ Preparing = "Preparing", /** Scaling */ - Scaling = "Scaling" + Scaling = "Scaling", } /** @@ -371,7 +563,7 @@ export enum KnownCapacityProvisioningState { /** Preparing */ Preparing = "Preparing", /** Scaling */ - Scaling = "Scaling" + Scaling = "Scaling", } /** @@ -399,7 +591,7 @@ export enum KnownMode { /** Gen1 */ Gen1 = "Gen1", /** Gen2 */ - Gen2 = "Gen2" + Gen2 = "Gen2", } /** @@ -412,145 +604,93 @@ export enum KnownMode { */ export type Mode = string; -/** Known values of {@link IdentityType} that the service accepts. */ -export enum KnownIdentityType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key" +/** Known values of {@link CapacitySkuTier} that the service accepts. */ +export enum KnownCapacitySkuTier { + /** PbieAzure */ + PbieAzure = "PBIE_Azure", + /** Premium */ + Premium = "Premium", + /** AutoPremiumHost */ + AutoPremiumHost = "AutoPremiumHost", } /** - * Defines values for IdentityType. \ - * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * 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 - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** + * **PBIE_Azure** \ + * **Premium** \ + * **AutoPremiumHost** */ -export type IdentityType = string; +export type CapacitySkuTier = string; -/** Known values of {@link VCoreSkuTier} that the service accepts. */ -export enum KnownVCoreSkuTier { - /** AutoScale */ - AutoScale = "AutoScale" -} +/** Optional parameters. */ +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} -/** - * 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 VCoreSkuTier = string; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; -/** Known values of {@link VCoreProvisioningState} that the service accepts. */ -export enum KnownVCoreProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded" -} +/** Optional parameters. */ +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} -/** - * 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; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; /** Optional parameters. */ -export interface CapacitiesGetDetailsOptionalParams +export interface AutoScaleVCoresListBySubscriptionOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getDetails operation. */ -export type CapacitiesGetDetailsResponse = DedicatedCapacity; +/** Contains response data for the listBySubscription operation. */ +export type AutoScaleVCoresListBySubscriptionResponse = AutoScaleVCoreListResult; /** 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; -} +export interface AutoScaleVCoresListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the create operation. */ -export type CapacitiesCreateResponse = DedicatedCapacity; +/** Contains response data for the listByResourceGroup operation. */ +export type AutoScaleVCoresListByResourceGroupResponse = AutoScaleVCoreListResult; /** 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; -} +export interface AutoScaleVCoresGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AutoScaleVCoresGetResponse = AutoScaleVCore; /** 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; -} +export interface AutoScaleVCoresCreateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the update operation. */ -export type CapacitiesUpdateResponse = DedicatedCapacity; +/** Contains response data for the create operation. */ +export type AutoScaleVCoresCreateResponse = AutoScaleVCore; /** 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; -} +export interface AutoScaleVCoresUpdateOptionalParams extends coreClient.OperationOptions {} -/** 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; -} +/** Contains response data for the update operation. */ +export type AutoScaleVCoresUpdateResponse = AutoScaleVCore; /** Optional parameters. */ -export interface CapacitiesListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type CapacitiesListByResourceGroupResponse = DedicatedCapacities; +export interface AutoScaleVCoresDeleteOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface CapacitiesListOptionalParams +export interface AutoScaleVCoresListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type CapacitiesListResponse = DedicatedCapacities; +/** Contains response data for the listBySubscriptionNext operation. */ +export type AutoScaleVCoresListBySubscriptionNextResponse = AutoScaleVCoreListResult; /** Optional parameters. */ -export interface CapacitiesListSkusOptionalParams +export interface AutoScaleVCoresListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listSkus operation. */ -export type CapacitiesListSkusResponse = SkuEnumerationForNewResourceResult; +/** Contains response data for the listByResourceGroupNext operation. */ +export type AutoScaleVCoresListByResourceGroupNextResponse = AutoScaleVCoreListResult; /** Optional parameters. */ -export interface CapacitiesListSkusForCapacityOptionalParams - extends coreClient.OperationOptions {} +export interface CapacitiesListOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listSkusForCapacity operation. */ -export type CapacitiesListSkusForCapacityResponse = SkuEnumerationForExistingResourceResult; +/** Contains response data for the list operation. */ +export type CapacitiesListResponse = DedicatedCapacities; /** Optional parameters. */ export interface CapacitiesCheckNameAvailabilityOptionalParams @@ -560,61 +700,77 @@ export interface CapacitiesCheckNameAvailabilityOptionalParams export type CapacitiesCheckNameAvailabilityResponse = CheckCapacityNameAvailabilityResult; /** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} +export interface CapacitiesListSkusOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +/** Contains response data for the listSkus operation. */ +export type CapacitiesListSkusResponse = SkuEnumerationForNewResourceResult; /** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface CapacitiesListByResourceGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; +/** Contains response data for the listByResourceGroup operation. */ +export type CapacitiesListByResourceGroupResponse = DedicatedCapacities; /** Optional parameters. */ -export interface AutoScaleVCoresGetOptionalParams - extends coreClient.OperationOptions {} +export interface CapacitiesGetDetailsOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type AutoScaleVCoresGetResponse = AutoScaleVCore; +/** Contains response data for the getDetails operation. */ +export type CapacitiesGetDetailsResponse = DedicatedCapacity; /** Optional parameters. */ -export interface AutoScaleVCoresCreateOptionalParams - extends coreClient.OperationOptions {} +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 AutoScaleVCoresCreateResponse = AutoScaleVCore; - -/** Optional parameters. */ -export interface AutoScaleVCoresDeleteOptionalParams - extends coreClient.OperationOptions {} +export type CapacitiesCreateResponse = DedicatedCapacity; /** Optional parameters. */ -export interface AutoScaleVCoresUpdateOptionalParams - extends coreClient.OperationOptions {} +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 AutoScaleVCoresUpdateResponse = AutoScaleVCore; +export type CapacitiesUpdateResponse = DedicatedCapacity; /** Optional parameters. */ -export interface AutoScaleVCoresListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} +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; +} -/** Contains response data for the listByResourceGroup operation. */ -export type AutoScaleVCoresListByResourceGroupResponse = AutoScaleVCoreListResult; +/** 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 AutoScaleVCoresListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} +export interface CapacitiesListSkusForCapacityOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listBySubscription operation. */ -export type AutoScaleVCoresListBySubscriptionResponse = AutoScaleVCoreListResult; +/** Contains response data for the listSkusForCapacity operation. */ +export type CapacitiesListSkusForCapacityResponse = SkuEnumerationForExistingResourceResult; + +/** 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 PowerBIDedicatedOptionalParams - extends coreClient.ServiceClientOptions { +export interface PowerBIDedicatedOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts index e2471bf9e5bb..a3d0c1aee016 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts @@ -8,164 +8,267 @@ import * as coreClient from "@azure/core-client"; -export const CapacitySku: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CapacitySku", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", modelProperties: { name: { serializedName: "name", - required: true, + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - tier: { - serializedName: "tier", + display: { + serializedName: "display", type: { - name: "String" - } - } - } - } + name: "Composite", + className: "OperationDisplay", + }, + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "OperationProperties", + }, + }, + }, + }, }; -export const DedicatedCapacityMutableProperties: coreClient.CompositeMapper = { +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCapacityMutableProperties", + className: "OperationDisplay", modelProperties: { - administration: { - serializedName: "administration", + provider: { + serializedName: "provider", + readOnly: true, type: { - name: "Composite", - className: "DedicatedCapacityAdministrators" - } + name: "String", + }, }, - mode: { - serializedName: "mode", + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DedicatedCapacityAdministrators: coreClient.CompositeMapper = { +export const OperationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCapacityAdministrators", + className: "OperationProperties", modelProperties: { - members: { - serializedName: "members", + serviceSpecification: { + serializedName: "serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification", + }, + }, + }, + }, +}; + +export const ServiceSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + metricSpecifications: { + serializedName: "metricSpecifications", type: { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "Composite", + className: "MetricSpecification", + }, + }, + }, + }, + logSpecifications: { + serializedName: "logSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogSpecification", + }, + }, + }, + }, + }, + }, }; -export const Resource: coreClient.CompositeMapper = { +export const MetricSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "MetricSpecification", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String", + }, + }, + unit: { + serializedName: "unit", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - location: { - serializedName: "location", - required: true, + aggregationType: { + serializedName: "aggregationType", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - tags: { - serializedName: "tags", + metricFilterPattern: { + serializedName: "metricFilterPattern", + readOnly: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - systemData: { - serializedName: "systemData", + dimensions: { + serializedName: "dimensions", type: { - name: "Composite", - className: "SystemData" - } - } - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecificationDimensionsItem", + }, + }, + }, + }, + }, + }, }; -export const SystemData: coreClient.CompositeMapper = { +export const MetricSpecificationDimensionsItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "MetricSpecificationDimensionsItem", modelProperties: { - createdBy: { - serializedName: "createdBy", + name: { + serializedName: "name", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - createdByType: { - serializedName: "createdByType", + displayName: { + serializedName: "displayName", type: { - name: "String" - } + name: "String", + }, }, - createdAt: { - serializedName: "createdAt", + }, + }, +}; + +export const LogSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogSpecification", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + displayName: { + serializedName: "displayName", type: { - name: "String" - } + name: "String", + }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + blobDuration: { + serializedName: "blobDuration", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -177,11 +280,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorResponseError" - } - } - } - } + className: "ErrorResponseError", + }, + }, + }, + }, }; export const ErrorResponseError: coreClient.CompositeMapper = { @@ -192,59 +295,23 @@ export const ErrorResponseError: coreClient.CompositeMapper = { code: { serializedName: "code", type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", type: { - name: "String" - } - } - } - } -}; - -export const DedicatedCapacityUpdateParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedCapacityUpdateParameters", - modelProperties: { - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "CapacitySku" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - administration: { - serializedName: "properties.administration", - type: { - name: "Composite", - className: "DedicatedCapacityAdministrators" - } + name: "String", + }, }, - mode: { - serializedName: "properties.mode", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const DedicatedCapacities: coreClient.CompositeMapper = { +export const AutoScaleVCoreListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCapacities", + className: "AutoScaleVCoreListResult", modelProperties: { value: { serializedName: "value", @@ -254,153 +321,250 @@ export const DedicatedCapacities: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "DedicatedCapacity" - } - } - } - } - } - } + className: "AutoScaleVCore", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, }; -export const SkuEnumerationForNewResourceResult: coreClient.CompositeMapper = { +export const AutoScaleVCoreMutableProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuEnumerationForNewResourceResult", + className: "AutoScaleVCoreMutableProperties", modelProperties: { - value: { - serializedName: "value", + capacityLimit: { + serializedName: "capacityLimit", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CapacitySku" - } - } - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const SkuEnumerationForExistingResourceResult: coreClient.CompositeMapper = { +export const AutoScaleVCoreSku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuEnumerationForExistingResourceResult", + className: "AutoScaleVCoreSku", modelProperties: { - value: { - serializedName: "value", + name: { + serializedName: "name", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuDetailsForExistingResource" - } - } - } - } - } - } + name: "String", + }, + }, + tier: { + serializedName: "tier", + type: { + name: "String", + }, + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number", + }, + }, + }, + }, }; -export const SkuDetailsForExistingResource: coreClient.CompositeMapper = { +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuDetailsForExistingResource", + className: "Resource", modelProperties: { - sku: { - serializedName: "sku", + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "CapacitySku" - } - } - } - } + className: "SystemData", + }, + }, + }, + }, }; -export const OperationListResult: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + 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 DedicatedCapacities: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DedicatedCapacities", modelProperties: { value: { serializedName: "value", - readOnly: true, + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "DedicatedCapacity", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const Operation: coreClient.CompositeMapper = { +export const DedicatedCapacityMutableProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "DedicatedCapacityMutableProperties", modelProperties: { - name: { - serializedName: "name", + administration: { + serializedName: "administration", + type: { + name: "Composite", + className: "DedicatedCapacityAdministrators", + }, + }, + mode: { + serializedName: "mode", + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - display: { - serializedName: "display", + friendlyName: { + serializedName: "friendlyName", + readOnly: true, type: { - name: "Composite", - className: "OperationDisplay" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const OperationDisplay: coreClient.CompositeMapper = { +export const DedicatedCapacityAdministrators: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "DedicatedCapacityAdministrators", modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, + members: { + serializedName: "members", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - resource: { - serializedName: "resource", - readOnly: true, + }, + }, +}; + +export const CapacitySku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapacitySku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + tier: { + serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, - operation: { - serializedName: "operation", - readOnly: true, + capacity: { + serializedName: "capacity", type: { - name: "String" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; export const CheckCapacityNameAvailabilityParameters: coreClient.CompositeMapper = { @@ -412,22 +576,22 @@ export const CheckCapacityNameAvailabilityParameters: coreClient.CompositeMapper constraints: { Pattern: new RegExp("^[a-z][a-z0-9]*$"), MaxLength: 63, - MinLength: 3 + MinLength: 3, }, serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, type: { defaultValue: "Microsoft.PowerBIDedicated/capacities", serializedName: "type", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CheckCapacityNameAvailabilityResult: coreClient.CompositeMapper = { @@ -438,117 +602,213 @@ export const CheckCapacityNameAvailabilityResult: coreClient.CompositeMapper = { nameAvailable: { serializedName: "nameAvailable", type: { - name: "Boolean" - } + name: "Boolean", + }, }, reason: { serializedName: "reason", type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const AutoScaleVCoreSku: coreClient.CompositeMapper = { +export const SkuEnumerationForNewResourceResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoScaleVCoreSku", + className: "SkuEnumerationForNewResourceResult", modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - tier: { - serializedName: "tier", + value: { + serializedName: "value", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CapacitySku", + }, + }, + }, }, - capacity: { - serializedName: "capacity", - type: { - name: "Number" - } - } - } - } + }, + }, }; -export const AutoScaleVCoreMutableProperties: coreClient.CompositeMapper = { +export const AutoScaleVCoreUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoScaleVCoreMutableProperties", + className: "AutoScaleVCoreUpdateParameters", modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "AutoScaleVCoreSku", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, capacityLimit: { - serializedName: "capacityLimit", + serializedName: "properties.capacityLimit", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const AutoScaleVCoreUpdateParameters: coreClient.CompositeMapper = { +export const DedicatedCapacityUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoScaleVCoreUpdateParameters", + className: "DedicatedCapacityUpdateParameters", modelProperties: { sku: { serializedName: "sku", type: { name: "Composite", - className: "AutoScaleVCoreSku" - } + className: "CapacitySku", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, - capacityLimit: { - serializedName: "properties.capacityLimit", + administration: { + serializedName: "properties.administration", + type: { + name: "Composite", + className: "DedicatedCapacityAdministrators", + }, + }, + mode: { + serializedName: "properties.mode", + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "properties.tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + friendlyName: { + serializedName: "properties.friendlyName", + readOnly: true, type: { - name: "Number" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const AutoScaleVCoreListResult: coreClient.CompositeMapper = { +export const SkuEnumerationForExistingResourceResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoScaleVCoreListResult", + className: "SkuEnumerationForExistingResourceResult", modelProperties: { value: { serializedName: "value", - required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "AutoScaleVCore" - } - } - } - } - } - } + className: "SkuDetailsForExistingResource", + }, + }, + }, + }, + }, + }, +}; + +export const SkuDetailsForExistingResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuDetailsForExistingResource", + modelProperties: { + resourceType: { + serializedName: "resourceType", + type: { + name: "String", + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "CapacitySku", + }, + }, + }, + }, +}; + +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, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String", + }, + }, + }, + }, }; export const DedicatedCapacityProperties: coreClient.CompositeMapper = { @@ -561,18 +821,54 @@ export const DedicatedCapacityProperties: coreClient.CompositeMapper = { serializedName: "state", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, provisioningState: { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const AutoScaleVCore: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoScaleVCore", + modelProperties: { + ...TrackedResource.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 DedicatedCapacity: coreClient.CompositeMapper = { @@ -580,100 +876,160 @@ export const DedicatedCapacity: coreClient.CompositeMapper = { name: "Composite", className: "DedicatedCapacity", modelProperties: { - ...Resource.type.modelProperties, + ...TrackedResource.type.modelProperties, sku: { serializedName: "sku", type: { name: "Composite", - className: "CapacitySku" - } + className: "CapacitySku", + }, }, administration: { serializedName: "properties.administration", type: { name: "Composite", - className: "DedicatedCapacityAdministrators" - } + className: "DedicatedCapacityAdministrators", + }, }, mode: { serializedName: "properties.mode", type: { - name: "String" - } + name: "String", + }, + }, + tenantId: { + serializedName: "properties.tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + friendlyName: { + serializedName: "properties.friendlyName", + readOnly: true, + type: { + name: "String", + }, }, state: { serializedName: "properties.state", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const AutoScaleVCore: coreClient.CompositeMapper = { +export const CapacitiesCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoScaleVCore", + className: "CapacitiesCreateHeaders", modelProperties: { - ...Resource.type.modelProperties, - sku: { - serializedName: "sku", + location: { + serializedName: "location", type: { - name: "Composite", - className: "AutoScaleVCoreSku" - } + name: "String", + }, }, - capacityLimit: { - serializedName: "properties.capacityLimit", + retryAfter: { + serializedName: "retry-after", type: { - name: "Number" - } + name: "Number", + }, }, - capacityObjectId: { - serializedName: "properties.capacityObjectId", + }, + }, +}; + +export const CapacitiesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapacitiesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + retryAfter: { + serializedName: "retry-after", type: { - name: "String" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const AutoScaleVCoreProperties: coreClient.CompositeMapper = { +export const CapacitiesDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoScaleVCoreProperties", + className: "CapacitiesDeleteHeaders", modelProperties: { - ...AutoScaleVCoreMutableProperties.type.modelProperties, - capacityObjectId: { - serializedName: "capacityObjectId", + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CapacitiesResumeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapacitiesResumeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CapacitiesSuspendHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapacitiesSuspendHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", type: { - name: "String" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts index b879f17d4d2e..2e308be1afc7 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts @@ -9,14 +9,14 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { + AutoScaleVCore as AutoScaleVCoreMapper, + AutoScaleVCoreUpdateParameters as AutoScaleVCoreUpdateParametersMapper, + CheckCapacityNameAvailabilityParameters as CheckCapacityNameAvailabilityParametersMapper, DedicatedCapacity as DedicatedCapacityMapper, DedicatedCapacityUpdateParameters as DedicatedCapacityUpdateParametersMapper, - CheckCapacityNameAvailabilityParameters as CheckCapacityNameAvailabilityParametersMapper, - AutoScaleVCore as AutoScaleVCoreMapper, - AutoScaleVCoreUpdateParameters as AutoScaleVCoreUpdateParametersMapper } from "../models/mappers.js"; export const accept: OperationParameter = { @@ -26,9 +26,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -37,65 +37,79 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 90, - MinLength: 1 + defaultValue: "2021-01-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", }, - serializedName: "resourceGroupName", + }, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, + skipEncoding: true, }; -export const dedicatedCapacityName: OperationURLParameter = { - parameterPath: "dedicatedCapacityName", +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { constraints: { - Pattern: new RegExp("^[a-z][a-z0-9]*$"), - MaxLength: 63, - MinLength: 3 + MinLength: 1, }, - serializedName: "dedicatedCapacityName", + serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - defaultValue: "2021-01-01", - isConstant: true, - serializedName: "api-version", + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const vcoreName: OperationURLParameter = { + parameterPath: "vcoreName", mapper: { - serializedName: "subscriptionId", + constraints: { + Pattern: new RegExp("^[-a-zA-Z0-9_]+$"), + MaxLength: 63, + MinLength: 3, + }, + serializedName: "vcoreName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -105,71 +119,62 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const capacityParameters: OperationParameter = { - parameterPath: "capacityParameters", - mapper: DedicatedCapacityMapper +export const vCoreParameters: OperationParameter = { + parameterPath: "vCoreParameters", + mapper: AutoScaleVCoreMapper, }; -export const capacityUpdateParameters: OperationParameter = { - parameterPath: "capacityUpdateParameters", - mapper: DedicatedCapacityUpdateParametersMapper +export const vCoreUpdateParameters: OperationParameter = { + parameterPath: "vCoreUpdateParameters", + mapper: AutoScaleVCoreUpdateParametersMapper, }; -export const capacityParameters1: OperationParameter = { +export const capacityParameters: OperationParameter = { parameterPath: "capacityParameters", - mapper: CheckCapacityNameAvailabilityParametersMapper + mapper: CheckCapacityNameAvailabilityParametersMapper, }; export const location: OperationURLParameter = { parameterPath: "location", mapper: { + constraints: { + MinLength: 1, + }, serializedName: "location", required: true, type: { - name: "String" - } - } -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true }; -export const vcoreName: OperationURLParameter = { - parameterPath: "vcoreName", +export const dedicatedCapacityName: OperationURLParameter = { + parameterPath: "dedicatedCapacityName", mapper: { constraints: { - Pattern: new RegExp("^[-a-zA-Z0-9_]+$"), + Pattern: new RegExp("^[a-z][a-z0-9]*$"), MaxLength: 63, - MinLength: 3 + MinLength: 3, }, - serializedName: "vcoreName", + serializedName: "dedicatedCapacityName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const vCoreParameters: OperationParameter = { - parameterPath: "vCoreParameters", - mapper: AutoScaleVCoreMapper +export const capacityParameters1: OperationParameter = { + parameterPath: "capacityParameters", + mapper: DedicatedCapacityMapper, }; -export const vCoreUpdateParameters: OperationParameter = { - parameterPath: "vCoreUpdateParameters", - mapper: AutoScaleVCoreUpdateParametersMapper +export const capacityUpdateParameters: OperationParameter = { + parameterPath: "capacityUpdateParameters", + mapper: DedicatedCapacityUpdateParametersMapper, }; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/autoScaleVCores.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/autoScaleVCores.ts index 3259e80558f7..e02d5c63f88a 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/autoScaleVCores.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/autoScaleVCores.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; import { AutoScaleVCores } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; @@ -14,18 +15,22 @@ import * as Parameters from "../models/parameters.js"; import { PowerBIDedicated } from "../powerBIDedicated.js"; import { AutoScaleVCore, - AutoScaleVCoresListByResourceGroupOptionalParams, - AutoScaleVCoresListByResourceGroupResponse, + AutoScaleVCoresListBySubscriptionNextOptionalParams, AutoScaleVCoresListBySubscriptionOptionalParams, AutoScaleVCoresListBySubscriptionResponse, + AutoScaleVCoresListByResourceGroupNextOptionalParams, + AutoScaleVCoresListByResourceGroupOptionalParams, + AutoScaleVCoresListByResourceGroupResponse, AutoScaleVCoresGetOptionalParams, AutoScaleVCoresGetResponse, AutoScaleVCoresCreateOptionalParams, AutoScaleVCoresCreateResponse, - AutoScaleVCoresDeleteOptionalParams, AutoScaleVCoreUpdateParameters, AutoScaleVCoresUpdateOptionalParams, - AutoScaleVCoresUpdateResponse + AutoScaleVCoresUpdateResponse, + AutoScaleVCoresDeleteOptionalParams, + AutoScaleVCoresListBySubscriptionNextResponse, + AutoScaleVCoresListByResourceGroupNextResponse, } from "../models/index.js"; /// @@ -42,16 +47,13 @@ export class AutoScaleVCoresImpl implements 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. + * Lists all the auto scale v-cores for the given subscription. * @param options The options parameters. */ - public listByResourceGroup( - resourceGroupName: string, - options?: AutoScaleVCoresListByResourceGroupOptionalParams + public listBySubscription( + options?: AutoScaleVCoresListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + const iter = this.listBySubscriptionPagingAll(options); return { next() { return iter.next(); @@ -63,45 +65,51 @@ export class AutoScaleVCoresImpl implements AutoScaleVCores { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } + return this.listBySubscriptionPagingPage(options, settings); + }, }; } - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: AutoScaleVCoresListByResourceGroupOptionalParams, - _settings?: PageSettings + private async *listBySubscriptionPagingPage( + options?: AutoScaleVCoresListBySubscriptionOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: AutoScaleVCoresListByResourceGroupResponse; - result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; + let result: AutoScaleVCoresListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } } - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: AutoScaleVCoresListByResourceGroupOptionalParams + private async *listBySubscriptionPagingAll( + options?: AutoScaleVCoresListBySubscriptionOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options - )) { + for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; } } /** - * Lists all the auto scale v-cores for the given subscription. + * Gets all the auto scale v-cores for the given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ - public listBySubscription( - options?: AutoScaleVCoresListBySubscriptionOptionalParams + public listByResourceGroup( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { next() { return iter.next(); @@ -113,32 +121,71 @@ export class AutoScaleVCoresImpl implements AutoScaleVCores { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listBySubscriptionPagingPage(options, settings); - } + return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); + }, }; } - private async *listBySubscriptionPagingPage( - options?: AutoScaleVCoresListBySubscriptionOptionalParams, - _settings?: PageSettings + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: AutoScaleVCoresListBySubscriptionResponse; - result = await this._listBySubscription(options); - yield result.value || []; + let result: AutoScaleVCoresListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } } - private async *listBySubscriptionPagingAll( - options?: AutoScaleVCoresListBySubscriptionOptionalParams + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { + 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. + */ + private _listBySubscription( + options?: AutoScaleVCoresListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); + } + + /** + * Gets all the auto scale v-cores for the given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -146,18 +193,17 @@ export class AutoScaleVCoresImpl implements AutoScaleVCores { get( resourceGroupName: string, vcoreName: string, - options?: AutoScaleVCoresGetOptionalParams + options?: AutoScaleVCoresGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, vcoreName, options }, - getOperationSpec + 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 resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -167,213 +213,239 @@ export class AutoScaleVCoresImpl implements AutoScaleVCores { resourceGroupName: string, vcoreName: string, vCoreParameters: AutoScaleVCore, - options?: AutoScaleVCoresCreateOptionalParams + options?: AutoScaleVCoresCreateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, vcoreName, vCoreParameters, options }, - createOperationSpec + 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. + * Updates the current state of the specified auto scale v-core. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. */ - delete( + update( resourceGroupName: string, vcoreName: string, - options?: AutoScaleVCoresDeleteOptionalParams - ): Promise { + vCoreUpdateParameters: AutoScaleVCoreUpdateParameters, + options?: AutoScaleVCoresUpdateOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, vcoreName, options }, - deleteOperationSpec + { resourceGroupName, vcoreName, vCoreUpdateParameters, options }, + updateOperationSpec, ); } /** - * 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. + * Deletes the specified auto scale v-core. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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( + delete( resourceGroupName: string, vcoreName: string, - vCoreUpdateParameters: AutoScaleVCoreUpdateParameters, - options?: AutoScaleVCoresUpdateOptionalParams - ): Promise { + options?: AutoScaleVCoresDeleteOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, vcoreName, vCoreUpdateParameters, options }, - updateOperationSpec + { resourceGroupName, vcoreName, options }, + deleteOperationSpec, ); } /** - * 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. + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. * @param options The options parameters. */ - private _listByResourceGroup( - resourceGroupName: string, - options?: AutoScaleVCoresListByResourceGroupOptionalParams - ): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: AutoScaleVCoresListBySubscriptionNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec + { nextLink, options }, + listBySubscriptionNextOperationSpec, ); } /** - * Lists all the auto scale v-cores for the given subscription. + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. * @param options The options parameters. */ - private _listBySubscription( - options?: AutoScaleVCoresListBySubscriptionOptionalParams - ): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: AutoScaleVCoresListByResourceGroupNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +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, +}; +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.subscriptionId, Parameters.resourceGroupName], + headerParameters: [Parameters.accept], + serializer, +}; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AutoScaleVCore + bodyMapper: Mappers.AutoScaleVCore, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.vcoreName + Parameters.resourceGroupName, + Parameters.vcoreName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.AutoScaleVCore + bodyMapper: Mappers.AutoScaleVCore, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.vCoreParameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.vcoreName + Parameters.resourceGroupName, + 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 + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.AutoScaleVCore + bodyMapper: Mappers.AutoScaleVCore, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.vCoreUpdateParameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.vcoreName + Parameters.resourceGroupName, + Parameters.vcoreName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores", - httpMethod: "GET", +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.AutoScaleVCoreListResult - }, + 200: {}, + 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.vcoreName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/autoScaleVCores", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AutoScaleVCoreListResult + bodyMapper: Mappers.AutoScaleVCoreListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoScaleVCoreListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts index 1eccbc12ec2f..8066627e1e54 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts @@ -6,40 +6,38 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { Capacities } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { PowerBIDedicated } from "../powerBIDedicated.js"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl.js"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; import { - DedicatedCapacity, - CapacitiesListByResourceGroupOptionalParams, - CapacitiesListByResourceGroupResponse, CapacitiesListOptionalParams, CapacitiesListResponse, + CheckCapacityNameAvailabilityParameters, + CapacitiesCheckNameAvailabilityOptionalParams, + CapacitiesCheckNameAvailabilityResponse, + CapacitiesListSkusOptionalParams, + CapacitiesListSkusResponse, + CapacitiesListByResourceGroupOptionalParams, + CapacitiesListByResourceGroupResponse, CapacitiesGetDetailsOptionalParams, CapacitiesGetDetailsResponse, + DedicatedCapacity, CapacitiesCreateOptionalParams, CapacitiesCreateResponse, - CapacitiesDeleteOptionalParams, DedicatedCapacityUpdateParameters, CapacitiesUpdateOptionalParams, CapacitiesUpdateResponse, - CapacitiesSuspendOptionalParams, + CapacitiesDeleteOptionalParams, CapacitiesResumeOptionalParams, - CapacitiesListSkusOptionalParams, - CapacitiesListSkusResponse, CapacitiesListSkusForCapacityOptionalParams, CapacitiesListSkusForCapacityResponse, - CheckCapacityNameAvailabilityParameters, - CapacitiesCheckNameAvailabilityOptionalParams, - CapacitiesCheckNameAvailabilityResponse + CapacitiesSuspendOptionalParams, } from "../models/index.js"; -/// /** Class containing Capacities operations. */ export class CapacitiesImpl implements Capacities { private readonly client: PowerBIDedicated; @@ -53,103 +51,56 @@ export class CapacitiesImpl implements 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. + * Lists all the Dedicated capacities for the given subscription. * @param options The options parameters. */ - public listByResourceGroup( - resourceGroupName: string, - options?: CapacitiesListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: CapacitiesListByResourceGroupOptionalParams, - _settings?: PageSettings - ): AsyncIterableIterator { - let result: CapacitiesListByResourceGroupResponse; - 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; - } + list(options?: CapacitiesListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** - * Lists all the Dedicated capacities for the given subscription. + * Check the name availability in the target location. + * @param location The name of Azure region. + * @param capacityParameters The request body * @param options The options parameters. */ - public list( - options?: CapacitiesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - } - }; + checkNameAvailability( + location: string, + capacityParameters: CheckCapacityNameAvailabilityParameters, + options?: CapacitiesCheckNameAvailabilityOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { location, capacityParameters, options }, + checkNameAvailabilityOperationSpec, + ); } - private async *listPagingPage( - options?: CapacitiesListOptionalParams, - _settings?: PageSettings - ): AsyncIterableIterator { - let result: CapacitiesListResponse; - result = await this._list(options); - yield result.value || []; + /** + * Lists eligible SKUs for PowerBI Dedicated resource provider. + * @param options The options parameters. + */ + listSkus(options?: CapacitiesListSkusOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listSkusOperationSpec); } - private async *listPagingAll( - options?: CapacitiesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } + /** + * Gets all the Dedicated capacities for the given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: CapacitiesListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); } /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -157,19 +108,18 @@ export class CapacitiesImpl implements Capacities { getDetails( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesGetDetailsOptionalParams + options?: CapacitiesGetDetailsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, dedicatedCapacityName, options }, - getDetailsOperationSpec + 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. - * @param dedicatedCapacityName The name of the Dedicated capacity. It must be a minimum of 3 + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. @@ -178,30 +128,23 @@ export class CapacitiesImpl implements Capacities { resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: DedicatedCapacity, - options?: CapacitiesCreateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - CapacitiesCreateResponse - > - > { + options?: CapacitiesCreateOptionalParams, + ): Promise, CapacitiesCreateResponse>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -210,8 +153,8 @@ export class CapacitiesImpl implements Capacities { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -219,19 +162,28 @@ export class CapacitiesImpl implements Capacities { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, dedicatedCapacityName, capacityParameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + dedicatedCapacityName, + capacityParameters, + options, + }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + CapacitiesCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -239,9 +191,8 @@ export class CapacitiesImpl implements Capacities { /** * 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 + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. @@ -250,47 +201,47 @@ export class CapacitiesImpl implements Capacities { resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: DedicatedCapacity, - options?: CapacitiesCreateOptionalParams + options?: CapacitiesCreateOptionalParams, ): Promise { const poller = await this.beginCreate( resourceGroupName, dedicatedCapacityName, capacityParameters, - options + options, ); return poller.pollUntilDone(); } /** - * 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. + * Updates the current state of the specified Dedicated capacity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 + * characters, and a maximum of 63. + * @param capacityUpdateParameters Request object that contains the updated information for the + * capacity. * @param options The options parameters. */ - async beginDelete( + async beginUpdate( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesDeleteOptionalParams - ): Promise, void>> { + capacityUpdateParameters: DedicatedCapacityUpdateParameters, + options?: CapacitiesUpdateOptionalParams, + ): Promise, CapacitiesUpdateResponse>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -299,8 +250,8 @@ export class CapacitiesImpl implements Capacities { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -308,83 +259,84 @@ export class CapacitiesImpl implements Capacities { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, dedicatedCapacityName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + dedicatedCapacityName, + capacityUpdateParameters, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + CapacitiesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * 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. + * Updates the current state of the specified Dedicated capacity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 + * characters, and a maximum of 63. + * @param capacityUpdateParameters Request object that contains the updated information for the + * capacity. * @param options The options parameters. */ - async beginDeleteAndWait( + async beginUpdateAndWait( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesDeleteOptionalParams - ): Promise { - const poller = await this.beginDelete( + capacityUpdateParameters: DedicatedCapacityUpdateParameters, + options?: CapacitiesUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( resourceGroupName, dedicatedCapacityName, - options + capacityUpdateParameters, + options, ); return poller.pollUntilDone(); } /** - * 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. + * Deletes the specified Dedicated capacity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - async beginUpdate( + async beginDelete( resourceGroupName: string, dedicatedCapacityName: string, - capacityUpdateParameters: DedicatedCapacityUpdateParameters, - options?: CapacitiesUpdateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - CapacitiesUpdateResponse - > - > { + options?: CapacitiesDeleteOptionalParams, + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -393,8 +345,8 @@ export class CapacitiesImpl implements Capacities { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -402,84 +354,68 @@ export class CapacitiesImpl implements Capacities { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { - resourceGroupName, - dedicatedCapacityName, - capacityUpdateParameters, - options - }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, dedicatedCapacityName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * 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. + * Deletes the specified Dedicated capacity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - async beginUpdateAndWait( + async beginDeleteAndWait( resourceGroupName: string, dedicatedCapacityName: string, - capacityUpdateParameters: DedicatedCapacityUpdateParameters, - options?: CapacitiesUpdateOptionalParams - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - dedicatedCapacityName, - capacityUpdateParameters, - options - ); + options?: CapacitiesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete(resourceGroupName, dedicatedCapacityName, options); return poller.pollUntilDone(); } /** - * 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. + * Resumes operation of the specified Dedicated capacity instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - async beginSuspend( + async beginResume( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesSuspendOptionalParams - ): Promise, void>> { + options?: CapacitiesResumeOptionalParams, + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -488,8 +424,8 @@ export class CapacitiesImpl implements Capacities { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -497,75 +433,86 @@ export class CapacitiesImpl implements Capacities { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, dedicatedCapacityName, options }, - suspendOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, dedicatedCapacityName, options }, + spec: resumeOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * 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. + * Resumes operation of the specified Dedicated capacity instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - async beginSuspendAndWait( + async beginResumeAndWait( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesSuspendOptionalParams + options?: CapacitiesResumeOptionalParams, ): Promise { - const poller = await this.beginSuspend( - resourceGroupName, - dedicatedCapacityName, - options - ); + const poller = await this.beginResume(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. + * Lists eligible SKUs for a PowerBI Dedicated resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - async beginResume( + listSkusForCapacity( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesListSkusForCapacityOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dedicatedCapacityName, options }, + listSkusForCapacityOperationSpec, + ); + } + + /** + * Suspends operation of the specified dedicated capacity instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + async beginSuspend( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesResumeOptionalParams - ): Promise, void>> { + options?: CapacitiesSuspendOptionalParams, + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -574,8 +521,8 @@ export class CapacitiesImpl implements Capacities { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -583,257 +530,219 @@ export class CapacitiesImpl implements Capacities { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, dedicatedCapacityName, options }, - resumeOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, dedicatedCapacityName, options }, + spec: suspendOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * 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. + * Suspends operation of the specified dedicated capacity instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - async beginResumeAndWait( + async beginSuspendAndWait( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesResumeOptionalParams + options?: CapacitiesSuspendOptionalParams, ): Promise { - const poller = await this.beginResume( - resourceGroupName, - dedicatedCapacityName, - options - ); + const poller = await this.beginSuspend(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 options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: CapacitiesListByResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec - ); - } - - /** - * Lists all the Dedicated capacities for the given subscription. - * @param options The options parameters. - */ - private _list( - options?: CapacitiesListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Lists eligible SKUs for PowerBI Dedicated resource provider. - * @param options The options parameters. - */ - listSkus( - options?: CapacitiesListSkusOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listSkusOperationSpec); - } - - /** - * 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 { - return this.client.sendOperationRequest( - { resourceGroupName, dedicatedCapacityName, options }, - listSkusForCapacityOperationSpec - ); - } - - /** - * 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 { - return this.client.sendOperationRequest( - { location, capacityParameters, options }, - checkNameAvailabilityOperationSpec - ); - } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/capacities", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DedicatedCapacities, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/locations/{location}/checkNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckCapacityNameAvailabilityResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.capacityParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listSkusOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/skus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SkuEnumerationForNewResourceResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DedicatedCapacities, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], + headerParameters: [Parameters.accept], + serializer, +}; const getDetailsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCapacityName, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, 201: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, 202: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, 204: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.capacityParameters, + requestBody: Parameters.capacityParameters1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCapacityName, - Parameters.subscriptionId ], 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: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.dedicatedCapacityName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, 201: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, 202: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, 204: { - bodyMapper: Mappers.DedicatedCapacity + bodyMapper: Mappers.DedicatedCapacity, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.capacityUpdateParameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCapacityName, - Parameters.subscriptionId ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const suspendOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/suspend", - httpMethod: "POST", +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}", + httpMethod: "DELETE", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCapacityName, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const resumeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/resume", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/resume", httpMethod: "POST", responses: { 200: {}, @@ -841,116 +750,59 @@ const resumeOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.dedicatedCapacityName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedCapacities + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.dedicatedCapacityName, ], headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/capacities", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedCapacities - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listSkusOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/skus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SkuEnumerationForNewResourceResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer + serializer, }; const listSkusForCapacityOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/skus", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/skus", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SkuEnumerationForExistingResourceResult + bodyMapper: Mappers.SkuEnumerationForExistingResourceResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCapacityName, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/locations/{location}/checkNameAvailability", +const suspendOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/suspend", httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.CheckCapacityNameAvailabilityResult - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.capacityParameters1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.resourceGroupName, + Parameters.dedicatedCapacityName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts index 2fb291c1a2ba..b7f0b717da34 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts @@ -6,6 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./capacities.js"; export * from "./operations.js"; export * from "./autoScaleVCores.js"; +export * from "./capacities.js"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts index 23942841e3e8..73681f5d8c2a 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models/index.js"; /// @@ -35,12 +35,10 @@ export class OperationsImpl implements Operations { } /** - * Lists all of the available PowerBIDedicated REST API operations. + * List the operations for the provider * @param options The options parameters. */ - public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { + public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -54,13 +52,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +79,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -89,12 +87,10 @@ export class OperationsImpl implements Operations { } /** - * Lists all of the available PowerBIDedicated REST API operations. + * List the operations for the provider * @param options The options parameters. */ - private _list( - options?: OperationsListOptionalParams - ): Promise { + private _list(options?: OperationsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,12 +101,9 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -121,29 +114,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/autoScaleVCores.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/autoScaleVCores.ts index eefd3dbec8c8..b2363c0c8649 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/autoScaleVCores.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/autoScaleVCores.ts @@ -9,42 +9,40 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { AutoScaleVCore, - AutoScaleVCoresListByResourceGroupOptionalParams, AutoScaleVCoresListBySubscriptionOptionalParams, + AutoScaleVCoresListByResourceGroupOptionalParams, AutoScaleVCoresGetOptionalParams, AutoScaleVCoresGetResponse, AutoScaleVCoresCreateOptionalParams, AutoScaleVCoresCreateResponse, - AutoScaleVCoresDeleteOptionalParams, AutoScaleVCoreUpdateParameters, AutoScaleVCoresUpdateOptionalParams, - AutoScaleVCoresUpdateResponse + AutoScaleVCoresUpdateResponse, + AutoScaleVCoresDeleteOptionalParams, } from "../models/index.js"; /// /** 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. + * Lists all the auto scale v-cores for the given subscription. * @param options The options parameters. */ - listByResourceGroup( - resourceGroupName: string, - options?: AutoScaleVCoresListByResourceGroupOptionalParams + listBySubscription( + options?: AutoScaleVCoresListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists all the auto scale v-cores for the given subscription. + * Gets all the auto scale v-cores for the given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ - listBySubscription( - options?: AutoScaleVCoresListBySubscriptionOptionalParams + listByResourceGroup( + resourceGroupName: string, + options?: AutoScaleVCoresListByResourceGroupOptionalParams, ): 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 resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -52,12 +50,11 @@ export interface AutoScaleVCores { get( resourceGroupName: string, vcoreName: string, - options?: AutoScaleVCoresGetOptionalParams + 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 resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -67,35 +64,33 @@ export interface AutoScaleVCores { resourceGroupName: string, vcoreName: string, vCoreParameters: AutoScaleVCore, - options?: AutoScaleVCoresCreateOptionalParams + 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. + * Updates the current state of the specified auto scale v-core. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. */ - delete( + update( resourceGroupName: string, vcoreName: string, - options?: AutoScaleVCoresDeleteOptionalParams - ): Promise; + vCoreUpdateParameters: AutoScaleVCoreUpdateParameters, + options?: AutoScaleVCoresUpdateOptionalParams, + ): 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. + * Deletes the specified auto scale v-core. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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( + delete( resourceGroupName: string, vcoreName: string, - vCoreUpdateParameters: AutoScaleVCoreUpdateParameters, - options?: AutoScaleVCoresUpdateOptionalParams - ): Promise; + options?: AutoScaleVCoresDeleteOptionalParams, + ): Promise; } diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/capacities.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/capacities.ts index b0c1d1f058c3..8a328a9f8e78 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/capacities.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/capacities.ts @@ -6,55 +6,67 @@ * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; import { - DedicatedCapacity, - CapacitiesListByResourceGroupOptionalParams, CapacitiesListOptionalParams, + CapacitiesListResponse, + CheckCapacityNameAvailabilityParameters, + CapacitiesCheckNameAvailabilityOptionalParams, + CapacitiesCheckNameAvailabilityResponse, + CapacitiesListSkusOptionalParams, + CapacitiesListSkusResponse, + CapacitiesListByResourceGroupOptionalParams, + CapacitiesListByResourceGroupResponse, CapacitiesGetDetailsOptionalParams, CapacitiesGetDetailsResponse, + DedicatedCapacity, CapacitiesCreateOptionalParams, CapacitiesCreateResponse, - CapacitiesDeleteOptionalParams, DedicatedCapacityUpdateParameters, CapacitiesUpdateOptionalParams, CapacitiesUpdateResponse, - CapacitiesSuspendOptionalParams, + CapacitiesDeleteOptionalParams, CapacitiesResumeOptionalParams, - CapacitiesListSkusOptionalParams, - CapacitiesListSkusResponse, CapacitiesListSkusForCapacityOptionalParams, CapacitiesListSkusForCapacityResponse, - CheckCapacityNameAvailabilityParameters, - CapacitiesCheckNameAvailabilityOptionalParams, - CapacitiesCheckNameAvailabilityResponse + CapacitiesSuspendOptionalParams, } from "../models/index.js"; -/// /** 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. + * Lists all the Dedicated capacities for the given subscription. * @param options The options parameters. */ - listByResourceGroup( - resourceGroupName: string, - options?: CapacitiesListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator; + list(options?: CapacitiesListOptionalParams): Promise; /** - * Lists all the Dedicated capacities for the given subscription. + * Check the name availability in the target location. + * @param location The name of Azure region. + * @param capacityParameters The request body + * @param options The options parameters. + */ + checkNameAvailability( + location: string, + capacityParameters: CheckCapacityNameAvailabilityParameters, + options?: CapacitiesCheckNameAvailabilityOptionalParams, + ): Promise; + /** + * Lists eligible SKUs for PowerBI Dedicated resource provider. * @param options The options parameters. */ - list( - options?: CapacitiesListOptionalParams - ): PagedAsyncIterableIterator; + listSkus(options?: CapacitiesListSkusOptionalParams): Promise; + /** + * Gets all the Dedicated capacities for the given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: CapacitiesListByResourceGroupOptionalParams, + ): Promise; /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -62,13 +74,12 @@ export interface Capacities { getDetails( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesGetDetailsOptionalParams + 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 + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. @@ -77,18 +88,12 @@ export interface Capacities { resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: DedicatedCapacity, - options?: CapacitiesCreateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - CapacitiesCreateResponse - > - >; + options?: CapacitiesCreateOptionalParams, + ): Promise, 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 + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. @@ -97,40 +102,13 @@ export interface Capacities { resourceGroupName: string, dedicatedCapacityName: string, capacityParameters: DedicatedCapacity, - options?: CapacitiesCreateOptionalParams + 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 + * characters, and a maximum of 63. * @param capacityUpdateParameters Request object that contains the updated information for the * capacity. * @param options The options parameters. @@ -139,19 +117,13 @@ export interface Capacities { resourceGroupName: string, dedicatedCapacityName: string, capacityUpdateParameters: DedicatedCapacityUpdateParameters, - options?: CapacitiesUpdateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - CapacitiesUpdateResponse - > - >; + options?: CapacitiesUpdateOptionalParams, + ): Promise, 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 + * characters, and a maximum of 63. * @param capacityUpdateParameters Request object that contains the updated information for the * capacity. * @param options The options parameters. @@ -160,89 +132,90 @@ export interface Capacities { resourceGroupName: string, dedicatedCapacityName: string, capacityUpdateParameters: DedicatedCapacityUpdateParameters, - options?: CapacitiesUpdateOptionalParams + 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. + * Deletes the specified Dedicated capacity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - beginSuspend( + beginDelete( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesSuspendOptionalParams - ): Promise, void>>; + options?: CapacitiesDeleteOptionalParams, + ): 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. + * Deletes the specified Dedicated capacity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - beginSuspendAndWait( + beginDeleteAndWait( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesSuspendOptionalParams + options?: CapacitiesDeleteOptionalParams, ): 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ beginResume( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesResumeOptionalParams - ): Promise, void>>; + 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ beginResumeAndWait( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesResumeOptionalParams + 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ listSkusForCapacity( resourceGroupName: string, dedicatedCapacityName: string, - options?: CapacitiesListSkusForCapacityOptionalParams + 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. + * Suspends operation of the specified dedicated capacity instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. */ - checkNameAvailability( - location: string, - capacityParameters: CheckCapacityNameAvailabilityParameters, - options?: CapacitiesCheckNameAvailabilityOptionalParams - ): Promise; + beginSuspend( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesSuspendOptionalParams, + ): Promise, void>>; + /** + * Suspends operation of the specified dedicated capacity instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + beginSuspendAndWait( + resourceGroupName: string, + dedicatedCapacityName: string, + options?: CapacitiesSuspendOptionalParams, + ): Promise; } diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/index.ts index 2fb291c1a2ba..b7f0b717da34 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/index.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/index.ts @@ -6,6 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./capacities.js"; export * from "./operations.js"; export * from "./autoScaleVCores.js"; +export * from "./capacities.js"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/operations.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/operations.ts index 802dbdac6bb1..a3957b6a87d0 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/operations.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operationsInterfaces/operations.ts @@ -13,10 +13,8 @@ import { Operation, OperationsListOptionalParams } from "../models/index.js"; /** Interface representing a Operations. */ export interface Operations { /** - * Lists all of the available PowerBIDedicated REST API operations. + * List the operations for the provider * @param options The options parameters. */ - list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/pagingHelper.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/pagingHelper.ts index 269a2b9814b5..e362819bdfc4 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/pagingHelper.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/pagingHelper.ts @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicated.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicated.ts index 0ee5efb43b53..5f5573d7ebb6 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicated.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicated.ts @@ -8,22 +8,10 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest -} from "@azure/core-rest-pipeline"; +import { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { - CapacitiesImpl, - OperationsImpl, - AutoScaleVCoresImpl -} from "./operations/index.js"; -import { - Capacities, - Operations, - AutoScaleVCores -} from "./operationsInterfaces/index.js"; +import { OperationsImpl, AutoScaleVCoresImpl, CapacitiesImpl } from "./operations/index.js"; +import { Operations, AutoScaleVCores, Capacities } from "./operationsInterfaces/index.js"; import { PowerBIDedicatedOptionalParams } from "./models/index.js"; export class PowerBIDedicated extends coreClient.ServiceClient { @@ -34,14 +22,13 @@ export class PowerBIDedicated extends coreClient.ServiceClient { /** * 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 subscriptionId The ID of the target subscription. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: PowerBIDedicatedOptionalParams + options?: PowerBIDedicatedOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -56,10 +43,10 @@ export class PowerBIDedicated extends coreClient.ServiceClient { } const defaults: PowerBIDedicatedOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-powerbidedicated/4.0.2`; + const packageDetails = `azsdk-js-arm-powerbidedicated/5.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -69,20 +56,19 @@ export class PowerBIDedicated extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -92,19 +78,17 @@ export class PowerBIDedicated extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -113,9 +97,9 @@ export class PowerBIDedicated extends coreClient.ServiceClient { // 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); + this.capacities = new CapacitiesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -126,10 +110,7 @@ export class PowerBIDedicated extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -142,12 +123,12 @@ export class PowerBIDedicated extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } - capacities: Capacities; operations: Operations; autoScaleVCores: AutoScaleVCores; + capacities: Capacities; } diff --git a/sdk/powerbidedicated/arm-powerbidedicated/test/sampleTest.spec.ts b/sdk/powerbidedicated/arm-powerbidedicated/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/powerbidedicated/arm-powerbidedicated/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * 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 { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + 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", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/powerbidedicated/arm-powerbidedicated/test/snippets.spec.ts b/sdk/powerbidedicated/arm-powerbidedicated/test/snippets.spec.ts index b8110d450ee7..7dc2d92cf9a3 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/test/snippets.spec.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { PowerBIDedicated } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/powerbidedicated/arm-powerbidedicated/tsconfig.json b/sdk/powerbidedicated/arm-powerbidedicated/tsconfig.json index 19ceb382b521..59ea83c046bf 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/tsconfig.json +++ b/sdk/powerbidedicated/arm-powerbidedicated/tsconfig.json @@ -3,11 +3,8 @@ { "path": "./tsconfig.src.json" }, - { - "path": "./tsconfig.samples.json" - }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/powerbidedicated/arm-powerbidedicated/vitest.browser.config.ts b/sdk/powerbidedicated/arm-powerbidedicated/vitest.browser.config.ts index 10e70dbfa8ee..182729ab5ce9 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/vitest.browser.config.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/powerbidedicated/arm-powerbidedicated/vitest.config.ts b/sdk/powerbidedicated/arm-powerbidedicated/vitest.config.ts index 86a71911ccc2..40e031385dd8 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/vitest.config.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/powerbidedicated/arm-powerbidedicated/vitest.esm.config.ts b/sdk/powerbidedicated/arm-powerbidedicated/vitest.esm.config.ts index 5e9735e9b144..a70127279fc9 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/vitest.esm.config.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +);