From 6fb5ca92c56e7233c5256f29e05171e88e79ea92 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 1 Aug 2023 00:24:21 +0000 Subject: [PATCH] CodeGen from PR 24981 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.LabServices to add version stable/2023-06-07 (#24981) * Adds base for updating Microsoft.LabServices from version stable/2022-08-01 to version 2023-06-07 * Updates readme * Updates API version in new specs and examples * added v2023-06-07 spec * reset clouderror change * update version date * updated times * fix times in examples * update inviteuser example * reinclude x-mx-identifiers * Update for Swagger PrettierCheck --- common/config/rush/pnpm-lock.yaml | 70 +++++------ sdk/labservices/arm-labservices/CHANGELOG.md | 26 ++-- sdk/labservices/arm-labservices/_meta.json | 10 +- sdk/labservices/arm-labservices/package.json | 22 ++-- .../review/arm-labservices.api.md | 59 +++++---- .../arm-labservices/src/labServicesClient.ts | 4 +- .../arm-labservices/src/lroImpl.ts | 54 ++++---- .../arm-labservices/src/models/index.ts | 57 +++++++++ .../arm-labservices/src/models/mappers.ts | 96 +++++++++++++++ .../arm-labservices/src/models/parameters.ts | 2 +- .../src/operations/labPlans.ts | 98 ++++++++------- .../arm-labservices/src/operations/labs.ts | 116 ++++++++++-------- .../src/operations/schedules.ts | 28 +++-- .../arm-labservices/src/operations/users.ts | 96 ++++++++------- .../src/operations/virtualMachines.ts | 108 ++++++++-------- .../src/operationsInterfaces/labPlans.ts | 14 +-- .../src/operationsInterfaces/labs.ts | 14 +-- .../src/operationsInterfaces/schedules.ts | 4 +- .../src/operationsInterfaces/users.ts | 12 +- .../operationsInterfaces/virtualMachines.ts | 12 +- sdk/labservices/arm-labservices/tsconfig.json | 10 +- 21 files changed, 560 insertions(+), 352 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 80db0d33996f..196a8dd9e194 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2844,7 +2844,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/chai-as-promised/7.1.5: @@ -2866,7 +2866,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/cookie/0.4.1: @@ -2876,7 +2876,7 @@ packages: /@types/cors/2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/debug/4.1.8: @@ -2888,7 +2888,7 @@ packages: /@types/decompress/4.2.4: resolution: {integrity: sha512-/C8kTMRTNiNuWGl5nEyKbPiMv6HA+0RbEXzFhFBEzASM6+oa4tJro9b8nj7eRlOFfuLdzUU+DS/GPDlvvzMOhA==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/eslint/8.4.10: @@ -2909,7 +2909,7 @@ packages: /@types/express-serve-static-core/4.17.35: resolution: {integrity: sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -2927,13 +2927,13 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/http-errors/2.0.1: @@ -2950,7 +2950,7 @@ packages: /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/json-schema/7.0.12: @@ -2964,13 +2964,13 @@ packages: /@types/jsonwebtoken/9.0.2: resolution: {integrity: sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/jws/3.2.5: resolution: {integrity: sha512-xGTxZH34xOryaTN8CMsvhh9lfNqFuHiMoRvsLYWQdBJHqiECyfInXVl2eK8Jz2emxZWMIn5RBlmr3oDVPeWujw==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/linkify-it/3.0.2: @@ -3029,20 +3029,20 @@ packages: /@types/mysql/2.15.19: resolution: {integrity: sha512-wSRg2QZv14CWcZXkgdvHbbV2ACufNy5EgI8mBBxnJIptchv7DBy/h53VMa2jDhyo0C9MO4iowE6z9vF8Ja1DkQ==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/node-fetch/2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 form-data: 3.0.1 dev: false /@types/node-fetch/2.6.4: resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 form-data: 3.0.1 dev: false @@ -3075,7 +3075,7 @@ packages: /@types/pg/8.6.1: resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 pg-protocol: 1.6.0 pg-types: 2.2.0 dev: false @@ -3103,7 +3103,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/resolve/1.20.2: @@ -3126,7 +3126,7 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/serve-static/1.15.2: @@ -3134,7 +3134,7 @@ packages: dependencies: '@types/http-errors': 2.0.1 '@types/mime': 3.0.1 - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/shimmer/1.0.2: @@ -3154,13 +3154,13 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/through/0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/tough-cookie/4.0.2: @@ -3174,7 +3174,7 @@ packages: /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/underscore/1.11.6: @@ -3192,19 +3192,19 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/ws/8.5.5: resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/xml2js/0.4.11: resolution: {integrity: sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==} dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false /@types/yargs-parser/21.0.0: @@ -3221,7 +3221,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 14.18.54 + '@types/node': 16.18.39 dev: false optional: true @@ -4498,7 +4498,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -4677,7 +4677,7 @@ packages: cosmiconfig: 7.1.0 debug: 4.3.4 deps-regex: 0.1.4 - ignore: 5.1.9 + ignore: 5.2.4 is-core-module: 2.12.1 js-yaml: 3.14.1 json5: 2.2.3 @@ -4880,7 +4880,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.13 - '@types/node': 14.18.54 + '@types/node': 16.18.39 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -5050,7 +5050,7 @@ packages: dependencies: debug: 3.2.7 is-core-module: 2.12.1 - resolve: 1.22.3 + resolve: 1.22.2 dev: false /eslint-module-utils/2.8.0_eslint@8.46.0: @@ -5869,7 +5869,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -6194,7 +6194,7 @@ packages: /ignore-walk/3.0.4: resolution: {integrity: sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==} dependencies: - minimatch: 3.0.8 + minimatch: 3.1.2 dev: false /ignore/5.1.9: @@ -6287,7 +6287,7 @@ packages: cli-cursor: 3.1.0 cli-width: 3.0.0 external-editor: 3.1.0 - figures: 3.0.0 + figures: 3.2.0 lodash: 4.17.21 mute-stream: 0.0.8 run-async: 2.4.1 @@ -8762,7 +8762,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 14.18.54 + '@types/node': 16.18.39 long: 5.2.3 dev: false @@ -14493,7 +14493,7 @@ packages: dev: false file:projects/arm-labservices.tgz: - resolution: {integrity: sha512-KfuS3vHCCeUdyNXJ0l/54dpDEoGJuO81cso1xHKDOqp6Ge6UsIjoDHXQURLelfRfwGasQyUxGgLWdPlwuE3m3w==, tarball: file:projects/arm-labservices.tgz} + resolution: {integrity: sha512-9n1wrw0qauBITMmg99bBejfNdWxcJ+jr5fjH+h/aJP+SJZkzOTtvEm8XaskhSXkTZSTyu7rIqd2AQMTPvoYnWw==, tarball: file:projects/arm-labservices.tgz} name: '@rush-temp/arm-labservices' version: 0.0.0 dependencies: @@ -14507,8 +14507,8 @@ packages: '@types/node': 14.18.54 chai: 4.3.7 cross-env: 7.0.3 - dotenv: 8.6.0 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 diff --git a/sdk/labservices/arm-labservices/CHANGELOG.md b/sdk/labservices/arm-labservices/CHANGELOG.md index 9b73183aeb9e..3bcfb6713052 100644 --- a/sdk/labservices/arm-labservices/CHANGELOG.md +++ b/sdk/labservices/arm-labservices/CHANGELOG.md @@ -1,15 +1,21 @@ # Release History + +## 3.2.0 (2023-08-01) + +**Features** -## 3.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface ResourceOperationError + - Interface Lab has a new optional parameter resourceOperationError + - Interface LabPlan has a new optional parameter resourceOperationError + - Interface LabPlanProperties has a new optional parameter resourceOperationError + - Interface LabProperties has a new optional parameter resourceOperationError + - Interface Schedule has a new optional parameter resourceOperationError + - Interface ScheduleProperties has a new optional parameter resourceOperationError + - Interface User has a new optional parameter resourceOperationError + - Interface UserProperties has a new optional parameter resourceOperationError + - Interface VirtualMachine has a new optional parameter resourceOperationError + + ## 3.1.0 (2023-01-17) **Features** diff --git a/sdk/labservices/arm-labservices/_meta.json b/sdk/labservices/arm-labservices/_meta.json index f7e0dd9b0087..e029ef6ae676 100644 --- a/sdk/labservices/arm-labservices/_meta.json +++ b/sdk/labservices/arm-labservices/_meta.json @@ -1,8 +1,8 @@ { - "commit": "4c2cdccf6ca3281dd50ed8788ce1de2e0d480973", - "readme": "specification\\labservices\\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\\labservices\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", + "commit": "fd22a81da80e6afd50bbc02ed4b6a40400082202", + "readme": "specification/labservices/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/labservices/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.7" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/labservices/arm-labservices/package.json b/sdk/labservices/arm-labservices/package.json index 82717735e351..d0bd15923a5f 100644 --- a/sdk/labservices/arm-labservices/package.json +++ b/sdk/labservices/arm-labservices/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for LabServicesClient.", - "version": "3.1.1", + "version": "3.2.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,13 +33,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^8.2.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/labservices/arm-labservices", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-labservices?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/labservices/arm-labservices" +} \ No newline at end of file diff --git a/sdk/labservices/arm-labservices/review/arm-labservices.api.md b/sdk/labservices/arm-labservices/review/arm-labservices.api.md index ca85622696d1..47a3f4523ac1 100644 --- a/sdk/labservices/arm-labservices/review/arm-labservices.api.md +++ b/sdk/labservices/arm-labservices/review/arm-labservices.api.md @@ -6,9 +6,9 @@ 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 type ActionType = string; @@ -249,6 +249,7 @@ export interface Lab extends TrackedResource { labPlanId?: string; networkProfile?: LabNetworkProfile; readonly provisioningState?: ProvisioningState; + readonly resourceOperationError?: ResourceOperationError; rosterProfile?: RosterProfile; securityProfile?: SecurityProfile; readonly state?: LabState; @@ -273,6 +274,7 @@ export interface LabPlan extends TrackedResource { identity?: Identity; linkedLmsInstance?: string; readonly provisioningState?: ProvisioningState; + readonly resourceOperationError?: ResourceOperationError; sharedGalleryId?: string; supportInfo?: SupportInfo; readonly systemData?: SystemData; @@ -286,17 +288,18 @@ export interface LabPlanNetworkProfile { // @public export interface LabPlanProperties extends LabPlanUpdateProperties { readonly provisioningState?: ProvisioningState; + readonly resourceOperationError?: ResourceOperationError; } // @public export interface LabPlans { - beginCreateOrUpdate(resourceGroupName: string, labPlanName: string, body: LabPlan, options?: LabPlansCreateOrUpdateOptionalParams): Promise, LabPlansCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, labPlanName: string, body: LabPlan, options?: LabPlansCreateOrUpdateOptionalParams): Promise, LabPlansCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, labPlanName: string, body: LabPlan, options?: LabPlansCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, labPlanName: string, options?: LabPlansDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, labPlanName: string, options?: LabPlansDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, labPlanName: string, options?: LabPlansDeleteOptionalParams): Promise; - beginSaveImage(resourceGroupName: string, labPlanName: string, body: SaveImageBody, options?: LabPlansSaveImageOptionalParams): Promise, void>>; + beginSaveImage(resourceGroupName: string, labPlanName: string, body: SaveImageBody, options?: LabPlansSaveImageOptionalParams): Promise, void>>; beginSaveImageAndWait(resourceGroupName: string, labPlanName: string, body: SaveImageBody, options?: LabPlansSaveImageOptionalParams): Promise; - beginUpdate(resourceGroupName: string, labPlanName: string, body: LabPlanUpdate, options?: LabPlansUpdateOptionalParams): Promise, LabPlansUpdateResponse>>; + beginUpdate(resourceGroupName: string, labPlanName: string, body: LabPlanUpdate, options?: LabPlansUpdateOptionalParams): Promise, LabPlansUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, labPlanName: string, body: LabPlanUpdate, options?: LabPlansUpdateOptionalParams): Promise; get(resourceGroupName: string, labPlanName: string, options?: LabPlansGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: LabPlansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; @@ -396,20 +399,21 @@ export interface LabPlanUpdateProperties { export interface LabProperties extends LabUpdateProperties { networkProfile?: LabNetworkProfile; readonly provisioningState?: ProvisioningState; + readonly resourceOperationError?: ResourceOperationError; readonly state?: LabState; } // @public export interface Labs { - beginCreateOrUpdate(resourceGroupName: string, labName: string, body: Lab, options?: LabsCreateOrUpdateOptionalParams): Promise, LabsCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, labName: string, body: Lab, options?: LabsCreateOrUpdateOptionalParams): Promise, LabsCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, labName: string, body: Lab, options?: LabsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, labName: string, options?: LabsDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, labName: string, options?: LabsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, labName: string, options?: LabsDeleteOptionalParams): Promise; - beginPublish(resourceGroupName: string, labName: string, options?: LabsPublishOptionalParams): Promise, void>>; + beginPublish(resourceGroupName: string, labName: string, options?: LabsPublishOptionalParams): Promise, void>>; beginPublishAndWait(resourceGroupName: string, labName: string, options?: LabsPublishOptionalParams): Promise; - beginSyncGroup(resourceGroupName: string, labName: string, options?: LabsSyncGroupOptionalParams): Promise, void>>; + beginSyncGroup(resourceGroupName: string, labName: string, options?: LabsSyncGroupOptionalParams): Promise, void>>; beginSyncGroupAndWait(resourceGroupName: string, labName: string, options?: LabsSyncGroupOptionalParams): Promise; - beginUpdate(resourceGroupName: string, labName: string, body: LabUpdate, options?: LabsUpdateOptionalParams): Promise, LabsUpdateResponse>>; + beginUpdate(resourceGroupName: string, labName: string, body: LabUpdate, options?: LabsUpdateOptionalParams): Promise, LabsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, labName: string, body: LabUpdate, options?: LabsUpdateOptionalParams): Promise; get(resourceGroupName: string, labName: string, options?: LabsGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: LabsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; @@ -757,6 +761,14 @@ export interface Resource { readonly type?: string; } +// @public +export interface ResourceOperationError { + action?: string; + code?: string; + message?: string; + timestamp?: Date; +} + // @public export type RestrictionReasonCode = string; @@ -786,6 +798,7 @@ export interface Schedule extends ProxyResource { notes?: string; readonly provisioningState?: ProvisioningState; recurrencePattern?: RecurrencePattern; + readonly resourceOperationError?: ResourceOperationError; startAt?: Date; stopAt?: Date; readonly systemData?: SystemData; @@ -795,11 +808,12 @@ export interface Schedule extends ProxyResource { // @public export interface ScheduleProperties extends ScheduleUpdateProperties { readonly provisioningState?: ProvisioningState; + readonly resourceOperationError?: ResourceOperationError; } // @public export interface Schedules { - beginDelete(resourceGroupName: string, labName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, labName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, labName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams): Promise; createOrUpdate(resourceGroupName: string, labName: string, scheduleName: string, body: Schedule, options?: SchedulesCreateOrUpdateOptionalParams): Promise; get(resourceGroupName: string, labName: string, scheduleName: string, options?: SchedulesGetOptionalParams): Promise; @@ -987,6 +1001,7 @@ export interface User extends ProxyResource { readonly invitationState?: InvitationState; readonly provisioningState?: ProvisioningState; readonly registrationState?: RegistrationState; + readonly resourceOperationError?: ResourceOperationError; readonly systemData?: SystemData; readonly totalUsage?: string; } @@ -999,18 +1014,19 @@ export interface UserProperties extends UserUpdateProperties { readonly invitationState?: InvitationState; readonly provisioningState?: ProvisioningState; readonly registrationState?: RegistrationState; + readonly resourceOperationError?: ResourceOperationError; readonly totalUsage?: string; } // @public export interface Users { - beginCreateOrUpdate(resourceGroupName: string, labName: string, userName: string, body: User, options?: UsersCreateOrUpdateOptionalParams): Promise, UsersCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, labName: string, userName: string, body: User, options?: UsersCreateOrUpdateOptionalParams): Promise, UsersCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, labName: string, userName: string, body: User, options?: UsersCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, labName: string, userName: string, options?: UsersDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, labName: string, userName: string, options?: UsersDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, labName: string, userName: string, options?: UsersDeleteOptionalParams): Promise; - beginInvite(resourceGroupName: string, labName: string, userName: string, body: InviteBody, options?: UsersInviteOptionalParams): Promise, void>>; + beginInvite(resourceGroupName: string, labName: string, userName: string, body: InviteBody, options?: UsersInviteOptionalParams): Promise, void>>; beginInviteAndWait(resourceGroupName: string, labName: string, userName: string, body: InviteBody, options?: UsersInviteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, labName: string, userName: string, body: UserUpdate, options?: UsersUpdateOptionalParams): Promise, UsersUpdateResponse>>; + beginUpdate(resourceGroupName: string, labName: string, userName: string, body: UserUpdate, options?: UsersUpdateOptionalParams): Promise, UsersUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, labName: string, userName: string, body: UserUpdate, options?: UsersUpdateOptionalParams): Promise; get(resourceGroupName: string, labName: string, userName: string, options?: UsersGetOptionalParams): Promise; listByLab(resourceGroupName: string, labName: string, options?: UsersListByLabOptionalParams): PagedAsyncIterableIterator; @@ -1083,6 +1099,7 @@ export interface VirtualMachine extends ProxyResource { readonly claimedByUserId?: string; readonly connectionProfile?: VirtualMachineConnectionProfile; readonly provisioningState?: ProvisioningState; + readonly resourceOperationError?: ResourceOperationError; readonly state?: VirtualMachineState; readonly systemData?: SystemData; readonly vmType?: VirtualMachineType; @@ -1119,15 +1136,15 @@ export interface VirtualMachineProfile { // @public export interface VirtualMachines { - beginRedeploy(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesRedeployOptionalParams): Promise, void>>; + beginRedeploy(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesRedeployOptionalParams): Promise, void>>; beginRedeployAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesRedeployOptionalParams): Promise; - beginReimage(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams): Promise, void>>; + beginReimage(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams): Promise, void>>; beginReimageAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams): Promise; - beginResetPassword(resourceGroupName: string, labName: string, virtualMachineName: string, body: ResetPasswordBody, options?: VirtualMachinesResetPasswordOptionalParams): Promise, void>>; + beginResetPassword(resourceGroupName: string, labName: string, virtualMachineName: string, body: ResetPasswordBody, options?: VirtualMachinesResetPasswordOptionalParams): Promise, void>>; beginResetPasswordAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, body: ResetPasswordBody, options?: VirtualMachinesResetPasswordOptionalParams): Promise; - beginStart(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise, void>>; + beginStart(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise, void>>; beginStartAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise; - beginStop(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise, void>>; + beginStop(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise, void>>; beginStopAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise; get(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesGetOptionalParams): Promise; listByLab(resourceGroupName: string, labName: string, options?: VirtualMachinesListByLabOptionalParams): PagedAsyncIterableIterator; diff --git a/sdk/labservices/arm-labservices/src/labServicesClient.ts b/sdk/labservices/arm-labservices/src/labServicesClient.ts index b9a02073229d..f0e0b3c29e9e 100644 --- a/sdk/labservices/arm-labservices/src/labServicesClient.ts +++ b/sdk/labservices/arm-labservices/src/labServicesClient.ts @@ -72,7 +72,7 @@ export class LabServicesClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-labservices/3.1.1`; + const packageDetails = `azsdk-js-arm-labservices/3.2.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -125,7 +125,7 @@ export class LabServicesClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-08-01"; + this.apiVersion = options.apiVersion || "2023-06-07"; this.images = new ImagesImpl(this); this.labPlans = new LabPlansImpl(this); this.operations = new OperationsImpl(this); diff --git a/sdk/labservices/arm-labservices/src/lroImpl.ts b/sdk/labservices/arm-labservices/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/labservices/arm-labservices/src/lroImpl.ts +++ b/sdk/labservices/arm-labservices/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +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/labservices/arm-labservices/src/models/index.ts b/sdk/labservices/arm-labservices/src/models/index.ts index 6ab622c8e803..2f3410f32bb3 100644 --- a/sdk/labservices/arm-labservices/src/models/index.ts +++ b/sdk/labservices/arm-labservices/src/models/index.ts @@ -132,6 +132,18 @@ export interface PagedLabPlans { readonly nextLink?: string; } +/** Error details of the latest operation failure on this resource */ +export interface ResourceOperationError { + /** The datetime of when the error occured */ + timestamp?: Date; + /** The code that corresponds to the type of operation failure */ + code?: string; + /** The operation failure message */ + message?: string; + /** The operation action that failed */ + action?: string; +} + /** Lab plan resource properties for updates */ export interface LabPlanUpdateProperties { /** The default lab connection profile. This can be changed on a lab resource and only provides a default profile. */ @@ -872,6 +884,11 @@ export interface LabPlanProperties extends LabPlanUpdateProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Error details of last operation done on lab plan. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; } /** Contains lab configuration and default settings. This variant is used for PATCH. */ @@ -928,6 +945,11 @@ export interface LabProperties extends LabUpdateProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly state?: LabState; + /** + * Error details of last operation done on lab. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; } /** Schedule resource properties */ @@ -937,6 +959,11 @@ export interface ScheduleProperties extends ScheduleUpdateProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Error details of last operation done on schedule. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; } /** User resource properties */ @@ -946,6 +973,11 @@ export interface UserProperties extends UserUpdateProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Error details of last operation done on lab plan. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; /** * Display name of the user, for example user's full name. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1080,6 +1112,11 @@ export interface Schedule extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Error details of last operation done on schedule. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; } /** User of a lab that can register for and use virtual machines within the lab. */ @@ -1096,6 +1133,11 @@ export interface User extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Error details of last operation done on lab plan. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; /** * Display name of the user, for example user's full name. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1142,6 +1184,11 @@ export interface VirtualMachine extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly state?: VirtualMachineState; + /** + * Error details of last operation done on lab plan. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; /** * Profile for information about connecting to the virtual machine. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1187,6 +1234,11 @@ export interface LabPlan extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Error details of last operation done on lab plan. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; } /** The lab resource. */ @@ -1224,6 +1276,11 @@ export interface Lab extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly state?: LabState; + /** + * Error details of last operation done on lab. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperationError?: ResourceOperationError; } /** Known values of {@link CreatedByType} that the service accepts. */ diff --git a/sdk/labservices/arm-labservices/src/models/mappers.ts b/sdk/labservices/arm-labservices/src/models/mappers.ts index 20dbbce585d6..f6d9aae7dd4a 100644 --- a/sdk/labservices/arm-labservices/src/models/mappers.ts +++ b/sdk/labservices/arm-labservices/src/models/mappers.ts @@ -269,6 +269,39 @@ export const PagedLabPlans: coreClient.CompositeMapper = { } }; +export const ResourceOperationError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceOperationError", + modelProperties: { + timestamp: { + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + action: { + serializedName: "action", + type: { + name: "String" + } + } + } + } +}; + export const LabPlanUpdateProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2048,6 +2081,13 @@ export const LabPlanProperties: coreClient.CompositeMapper = { "Locked" ] } + }, + resourceOperationError: { + serializedName: "resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } } } } @@ -2241,6 +2281,13 @@ export const LabProperties: coreClient.CompositeMapper = { "Published" ] } + }, + resourceOperationError: { + serializedName: "resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } } } } @@ -2266,6 +2313,13 @@ export const ScheduleProperties: coreClient.CompositeMapper = { "Locked" ] } + }, + resourceOperationError: { + serializedName: "resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } } } } @@ -2292,6 +2346,13 @@ export const UserProperties: coreClient.CompositeMapper = { ] } }, + resourceOperationError: { + serializedName: "resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } + }, displayName: { serializedName: "displayName", readOnly: true, @@ -2556,6 +2617,13 @@ export const Schedule: coreClient.CompositeMapper = { "Locked" ] } + }, + resourceOperationError: { + serializedName: "properties.resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } } } } @@ -2595,6 +2663,13 @@ export const User: coreClient.CompositeMapper = { ] } }, + resourceOperationError: { + serializedName: "properties.resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } + }, displayName: { serializedName: "properties.displayName", readOnly: true, @@ -2691,6 +2766,13 @@ export const VirtualMachine: coreClient.CompositeMapper = { ] } }, + resourceOperationError: { + serializedName: "properties.resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } + }, connectionProfile: { serializedName: "properties.connectionProfile", type: { @@ -2810,6 +2892,13 @@ export const LabPlan: coreClient.CompositeMapper = { "Locked" ] } + }, + resourceOperationError: { + serializedName: "properties.resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } } } } @@ -2924,6 +3013,13 @@ export const Lab: coreClient.CompositeMapper = { "Published" ] } + }, + resourceOperationError: { + serializedName: "properties.resourceOperationError", + type: { + name: "Composite", + className: "ResourceOperationError" + } } } } diff --git a/sdk/labservices/arm-labservices/src/models/parameters.ts b/sdk/labservices/arm-labservices/src/models/parameters.ts index 781e218af1f7..446a8739329e 100644 --- a/sdk/labservices/arm-labservices/src/models/parameters.ts +++ b/sdk/labservices/arm-labservices/src/models/parameters.ts @@ -54,7 +54,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-08-01", + defaultValue: "2023-06-07", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/labservices/arm-labservices/src/operations/labPlans.ts b/sdk/labservices/arm-labservices/src/operations/labPlans.ts index 3aaa6a224c95..c98d7d805916 100644 --- a/sdk/labservices/arm-labservices/src/operations/labPlans.ts +++ b/sdk/labservices/arm-labservices/src/operations/labPlans.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { LabServicesClient } from "../labServicesClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { LabPlan, LabPlansListBySubscriptionNextOptionalParams, @@ -233,8 +237,8 @@ export class LabPlansImpl implements LabPlans { body: LabPlan, options?: LabPlansCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LabPlansCreateOrUpdateResponse > > { @@ -244,7 +248,7 @@ export class LabPlansImpl implements LabPlans { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -277,15 +281,18 @@ export class LabPlansImpl implements LabPlans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labPlanName, body, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labPlanName, body, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + LabPlansCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "original-uri" + resourceLocationConfig: "original-uri" }); await poller.poll(); return poller; @@ -328,8 +335,8 @@ export class LabPlansImpl implements LabPlans { body: LabPlanUpdate, options?: LabPlansUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LabPlansUpdateResponse > > { @@ -339,7 +346,7 @@ export class LabPlansImpl implements LabPlans { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -372,15 +379,18 @@ export class LabPlansImpl implements LabPlans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labPlanName, body, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labPlanName, body, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + LabPlansUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -421,14 +431,14 @@ export class LabPlansImpl implements LabPlans { resourceGroupName: string, labPlanName: string, options?: LabPlansDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -461,15 +471,15 @@ export class LabPlansImpl implements LabPlans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labPlanName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labPlanName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -509,14 +519,14 @@ export class LabPlansImpl implements LabPlans { labPlanName: string, body: SaveImageBody, options?: LabPlansSaveImageOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -549,15 +559,15 @@ export class LabPlansImpl implements LabPlans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labPlanName, body, options }, - saveImageOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labPlanName, body, options }, + spec: saveImageOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/labservices/arm-labservices/src/operations/labs.ts b/sdk/labservices/arm-labservices/src/operations/labs.ts index 53eabfd570c0..32ea44687c2e 100644 --- a/sdk/labservices/arm-labservices/src/operations/labs.ts +++ b/sdk/labservices/arm-labservices/src/operations/labs.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { LabServicesClient } from "../labServicesClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Lab, LabsListBySubscriptionNextOptionalParams, @@ -233,8 +237,8 @@ export class LabsImpl implements Labs { body: Lab, options?: LabsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LabsCreateOrUpdateResponse > > { @@ -244,7 +248,7 @@ export class LabsImpl implements Labs { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -277,15 +281,18 @@ export class LabsImpl implements Labs { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, body, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, body, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + LabsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "original-uri" + resourceLocationConfig: "original-uri" }); await poller.poll(); return poller; @@ -328,7 +335,7 @@ export class LabsImpl implements Labs { body: LabUpdate, options?: LabsUpdateOptionalParams ): Promise< - PollerLike, LabsUpdateResponse> + SimplePollerLike, LabsUpdateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -336,7 +343,7 @@ export class LabsImpl implements Labs { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -369,15 +376,18 @@ export class LabsImpl implements Labs { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, body, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, body, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + LabsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -417,14 +427,14 @@ export class LabsImpl implements Labs { resourceGroupName: string, labName: string, options?: LabsDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -457,15 +467,15 @@ export class LabsImpl implements Labs { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -498,14 +508,14 @@ export class LabsImpl implements Labs { resourceGroupName: string, labName: string, options?: LabsPublishOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -538,15 +548,15 @@ export class LabsImpl implements Labs { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, options }, - publishOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, options }, + spec: publishOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -579,14 +589,14 @@ export class LabsImpl implements Labs { resourceGroupName: string, labName: string, options?: LabsSyncGroupOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -619,15 +629,15 @@ export class LabsImpl implements Labs { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, options }, - syncGroupOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, options }, + spec: syncGroupOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/labservices/arm-labservices/src/operations/schedules.ts b/sdk/labservices/arm-labservices/src/operations/schedules.ts index eaa8244e18a1..6c967ed31ca9 100644 --- a/sdk/labservices/arm-labservices/src/operations/schedules.ts +++ b/sdk/labservices/arm-labservices/src/operations/schedules.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { LabServicesClient } from "../labServicesClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Schedule, SchedulesListByLabNextOptionalParams, @@ -220,14 +224,14 @@ export class SchedulesImpl implements Schedules { labName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -260,15 +264,15 @@ export class SchedulesImpl implements Schedules { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, scheduleName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, scheduleName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/labservices/arm-labservices/src/operations/users.ts b/sdk/labservices/arm-labservices/src/operations/users.ts index 52da12a79361..a093cde8bceb 100644 --- a/sdk/labservices/arm-labservices/src/operations/users.ts +++ b/sdk/labservices/arm-labservices/src/operations/users.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { LabServicesClient } from "../labServicesClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { User, UsersListByLabNextOptionalParams, @@ -179,8 +183,8 @@ export class UsersImpl implements Users { body: User, options?: UsersCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, UsersCreateOrUpdateResponse > > { @@ -190,7 +194,7 @@ export class UsersImpl implements Users { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -223,15 +227,18 @@ export class UsersImpl implements Users { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, userName, body, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, userName, body, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + UsersCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "original-uri" + resourceLocationConfig: "original-uri" }); await poller.poll(); return poller; @@ -281,7 +288,7 @@ export class UsersImpl implements Users { body: UserUpdate, options?: UsersUpdateOptionalParams ): Promise< - PollerLike, UsersUpdateResponse> + SimplePollerLike, UsersUpdateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -289,7 +296,7 @@ export class UsersImpl implements Users { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -322,15 +329,18 @@ export class UsersImpl implements Users { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, userName, body, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, userName, body, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + UsersUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -377,14 +387,14 @@ export class UsersImpl implements Users { labName: string, userName: string, options?: UsersDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -417,15 +427,15 @@ export class UsersImpl implements Users { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, userName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, userName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -471,14 +481,14 @@ export class UsersImpl implements Users { userName: string, body: InviteBody, options?: UsersInviteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -511,15 +521,15 @@ export class UsersImpl implements Users { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, userName, body, options }, - inviteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, userName, body, options }, + spec: inviteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/labservices/arm-labservices/src/operations/virtualMachines.ts b/sdk/labservices/arm-labservices/src/operations/virtualMachines.ts index 6c1025d52be7..28d2cc2ab973 100644 --- a/sdk/labservices/arm-labservices/src/operations/virtualMachines.ts +++ b/sdk/labservices/arm-labservices/src/operations/virtualMachines.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { LabServicesClient } from "../labServicesClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { VirtualMachine, VirtualMachinesListByLabNextOptionalParams, @@ -174,14 +178,14 @@ export class VirtualMachinesImpl implements VirtualMachines { labName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -214,15 +218,15 @@ export class VirtualMachinesImpl implements VirtualMachines { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, virtualMachineName, options }, - startOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, virtualMachineName, options }, + spec: startOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -266,14 +270,14 @@ export class VirtualMachinesImpl implements VirtualMachines { labName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -306,15 +310,15 @@ export class VirtualMachinesImpl implements VirtualMachines { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, virtualMachineName, options }, - stopOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, virtualMachineName, options }, + spec: stopOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -359,14 +363,14 @@ export class VirtualMachinesImpl implements VirtualMachines { labName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -399,15 +403,15 @@ export class VirtualMachinesImpl implements VirtualMachines { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, virtualMachineName, options }, - reimageOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, virtualMachineName, options }, + spec: reimageOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -453,14 +457,14 @@ export class VirtualMachinesImpl implements VirtualMachines { labName: string, virtualMachineName: string, options?: VirtualMachinesRedeployOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -493,15 +497,15 @@ export class VirtualMachinesImpl implements VirtualMachines { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, virtualMachineName, options }, - redeployOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, virtualMachineName, options }, + spec: redeployOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -548,14 +552,14 @@ export class VirtualMachinesImpl implements VirtualMachines { virtualMachineName: string, body: ResetPasswordBody, options?: VirtualMachinesResetPasswordOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -588,15 +592,15 @@ export class VirtualMachinesImpl implements VirtualMachines { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, labName, virtualMachineName, body, options }, - resetPasswordOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, labName, virtualMachineName, body, options }, + spec: resetPasswordOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/labPlans.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/labPlans.ts index a65c8d59d97d..1a4704426bdb 100644 --- a/sdk/labservices/arm-labservices/src/operationsInterfaces/labPlans.ts +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/labPlans.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { LabPlan, LabPlansListBySubscriptionOptionalParams, @@ -69,8 +69,8 @@ export interface LabPlans { body: LabPlan, options?: LabPlansCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LabPlansCreateOrUpdateResponse > >; @@ -102,8 +102,8 @@ export interface LabPlans { body: LabPlanUpdate, options?: LabPlansUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LabPlansUpdateResponse > >; @@ -133,7 +133,7 @@ export interface LabPlans { resourceGroupName: string, labPlanName: string, options?: LabPlansDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a * lab plan, nor does it delete shared images added to a gallery via the lab plan permission container. @@ -160,7 +160,7 @@ export interface LabPlans { labPlanName: string, body: SaveImageBody, options?: LabPlansSaveImageOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Saves an image from a lab VM to the attached shared image gallery. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/labs.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/labs.ts index 960acf7f92a5..17193bd41a63 100644 --- a/sdk/labservices/arm-labservices/src/operationsInterfaces/labs.ts +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/labs.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Lab, LabsListBySubscriptionOptionalParams, @@ -69,8 +69,8 @@ export interface Labs { body: Lab, options?: LabsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LabsCreateOrUpdateResponse > >; @@ -102,7 +102,7 @@ export interface Labs { body: LabUpdate, options?: LabsUpdateOptionalParams ): Promise< - PollerLike, LabsUpdateResponse> + SimplePollerLike, LabsUpdateResponse> >; /** * Operation to update a lab resource. @@ -129,7 +129,7 @@ export interface Labs { resourceGroupName: string, labName: string, options?: LabsDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Operation to delete a lab resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -153,7 +153,7 @@ export interface Labs { resourceGroupName: string, labName: string, options?: LabsPublishOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -177,7 +177,7 @@ export interface Labs { resourceGroupName: string, labName: string, options?: LabsSyncGroupOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Action used to manually kick off an AAD group sync job. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/schedules.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/schedules.ts index 7cc77a3b155f..a763d168507d 100644 --- a/sdk/labservices/arm-labservices/src/operationsInterfaces/schedules.ts +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/schedules.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Schedule, SchedulesListByLabOptionalParams, @@ -99,7 +99,7 @@ export interface Schedules { labName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Operation to delete a schedule resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/users.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/users.ts index 6af91c7813ca..4f5f39fd3017 100644 --- a/sdk/labservices/arm-labservices/src/operationsInterfaces/users.ts +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/users.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { User, UsersListByLabOptionalParams, @@ -70,8 +70,8 @@ export interface Users { body: User, options?: UsersCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, UsersCreateOrUpdateResponse > >; @@ -109,7 +109,7 @@ export interface Users { body: UserUpdate, options?: UsersUpdateOptionalParams ): Promise< - PollerLike, UsersUpdateResponse> + SimplePollerLike, UsersUpdateResponse> >; /** * Operation to update a lab user. @@ -142,7 +142,7 @@ export interface Users { labName: string, userName: string, options?: UsersDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Operation to delete a user resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -174,7 +174,7 @@ export interface Users { userName: string, body: InviteBody, options?: UsersInviteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Operation to invite a user to a lab. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/virtualMachines.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/virtualMachines.ts index 6bd5a9787786..951474dff9ef 100644 --- a/sdk/labservices/arm-labservices/src/operationsInterfaces/virtualMachines.ts +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/virtualMachines.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { VirtualMachine, VirtualMachinesListByLabOptionalParams, @@ -65,7 +65,7 @@ export interface VirtualMachines { labName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Action to start a lab virtual machine. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -95,7 +95,7 @@ export interface VirtualMachines { labName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Action to stop a lab virtual machine. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -126,7 +126,7 @@ export interface VirtualMachines { labName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest * published snapshot of the reference environment of the lab. @@ -158,7 +158,7 @@ export interface VirtualMachines { labName: string, virtualMachineName: string, options?: VirtualMachinesRedeployOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting * connectivity. @@ -191,7 +191,7 @@ export interface VirtualMachines { virtualMachineName: string, body: ResetPasswordBody, options?: VirtualMachinesResetPasswordOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Resets a lab virtual machine password. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/labservices/arm-labservices/tsconfig.json b/sdk/labservices/arm-labservices/tsconfig.json index 638c174ad39b..3e6ae96443f3 100644 --- a/sdk/labservices/arm-labservices/tsconfig.json +++ b/sdk/labservices/arm-labservices/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-labservices": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"