From 59ebf489d31355bdcd12d57e4a9bd90d628d71e7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 22 Apr 2022 02:52:55 +0000 Subject: [PATCH] CodeGen from PR 18771 in Azure/azure-rest-api-specs Enable azure-powershell CI for all management RPs (#18771) * Enable azure-powershell for all manage RPs * Change integrationRepository to Azure/azure-powershell-pr * Change azure-powershell in api-spec repo * Change azure-powershell in api-spec repo * Remove azure-powershell from some deprecated RPs Co-authored-by: v-yuzhichen@microsoft.com --- common/config/rush/pnpm-lock.yaml | 23 +++--- sdk/appplatform/arm-appplatform/CHANGELOG.md | 16 +--- sdk/appplatform/arm-appplatform/README.md | 11 --- sdk/appplatform/arm-appplatform/_meta.json | 12 +-- sdk/appplatform/arm-appplatform/package.json | 34 +++----- .../review/arm-appplatform.api.md | 18 +++++ .../arm-appplatform/rollup.config.js | 78 +++++++++++++++++-- .../src/appPlatformManagementClient.ts | 3 +- .../arm-appplatform/src/models/index.ts | 28 +++++++ .../arm-appplatform/src/models/mappers.ts | 10 ++- .../src/operations/apiPortalCustomDomains.ts | 8 +- .../src/operations/apiPortals.ts | 8 +- .../arm-appplatform/src/operations/apps.ts | 16 +--- .../src/operations/bindings.ts | 12 +-- .../src/operations/buildServiceAgentPool.ts | 4 +- .../src/operations/buildServiceBuilder.ts | 8 +- .../src/operations/buildpackBinding.ts | 8 +- .../src/operations/certificates.ts | 8 +- .../src/operations/configServers.ts | 12 +-- .../src/operations/configurationServices.ts | 12 +-- .../src/operations/customDomains.ts | 12 +-- .../src/operations/deployments.ts | 36 +++------ .../src/operations/gatewayCustomDomains.ts | 8 +- .../src/operations/gatewayRouteConfigs.ts | 8 +- .../src/operations/gateways.ts | 8 +- .../src/operations/monitoringSettings.ts | 8 +- .../src/operations/serviceRegistries.ts | 8 +- .../src/operations/services.ts | 20 ++--- .../src/operations/storages.ts | 8 +- .../arm-appplatform/test/sampleTest.ts | 48 ++++++++++++ sdk/appplatform/arm-appplatform/tsconfig.json | 10 +-- 31 files changed, 257 insertions(+), 246 deletions(-) create mode 100644 sdk/appplatform/arm-appplatform/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d37dbec8470c..4eb49c66844d 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9428,28 +9428,27 @@ packages: dev: false file:projects/arm-appplatform.tgz: - resolution: {integrity: sha512-MI7C9GAkZXS08rIGLrX+12QjpoF9cAplz69EKSM/q7INmg38ihKwszvCfvnBVLlNebtOsvAXoFzVobVQGJ5vZw==, tarball: file:projects/arm-appplatform.tgz} + resolution: {integrity: sha512-K4blAoqkAzgJhE3KLrPNtqIYeM3m7Q3blc8s+8+wN/2/W8dAAOAS1E+BMQO+Ar3qdLDWn7WjAXa4EJWUOr8M3A==, tarball: file:projects/arm-appplatform.tgz} name: '@rush-temp/arm-appplatform' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -15021,7 +15020,7 @@ packages: dev: false file:projects/dtdl-parser.tgz: - resolution: {integrity: sha512-/Dpf2haY7btQZGQuvHBOvp+FV73jJdRtvEb9Iq2FlChhxnlxi3rnU+c5d3RiTER/V7CN2eTqZTmGqU81I5hofA==, tarball: file:projects/dtdl-parser.tgz} + resolution: {integrity: sha512-4fU57xg4ogr10JRjNfFZSQHD/efBKZZGYEsX6yLNQLr7d+v8DeUkBR6wL01Eu2X4BVVSWkhB+Hg+cgnbhlxQfg==, tarball: file:projects/dtdl-parser.tgz} name: '@rush-temp/dtdl-parser' version: 0.0.0 dependencies: @@ -15468,7 +15467,7 @@ packages: dev: false file:projects/iot-device-update.tgz: - resolution: {integrity: sha512-eYZc1OhjpW+iMs7ckvpoPSXLSq0Z4otKFuEFl8wcsvlTyeqq/bjRElOHVmNwl4dtRw1fNy4DGQUdoH5aXsT17w==, tarball: file:projects/iot-device-update.tgz} + resolution: {integrity: sha512-qEzFrCUOGxmgQ19d6cFJDtwdEhlb6Dn9yYLO5yrMg8KYyH6hLQa5JaxVbgvfK6ZFneTaYVaLnEMiZzmzXMgZVg==, tarball: file:projects/iot-device-update.tgz} name: '@rush-temp/iot-device-update' version: 0.0.0 dependencies: @@ -15989,7 +15988,7 @@ packages: dev: false file:projects/opentelemetry-instrumentation-azure-sdk.tgz: - resolution: {integrity: sha512-Fe2F+/VXo+2tFHmXPDJLFMmhQOYnX5wSqu+TG6Msek9ViI1x/cL8DhW3LcMwUvw5ohysFX8QsTfd9OPKO1msaQ==, tarball: file:projects/opentelemetry-instrumentation-azure-sdk.tgz} + resolution: {integrity: sha512-rWiPsZxSnuYGdFux77mxyZBjJ1I9LgMWvb+x04sDyizzAp4495+V81pN9O+9btqu1hr72zKv/hNseMEpUEf31A==, tarball: file:projects/opentelemetry-instrumentation-azure-sdk.tgz} name: '@rush-temp/opentelemetry-instrumentation-azure-sdk' version: 0.0.0 dependencies: diff --git a/sdk/appplatform/arm-appplatform/CHANGELOG.md b/sdk/appplatform/arm-appplatform/CHANGELOG.md index 5387575e44b2..cde4e9cb5ff8 100644 --- a/sdk/appplatform/arm-appplatform/CHANGELOG.md +++ b/sdk/appplatform/arm-appplatform/CHANGELOG.md @@ -1,18 +1,8 @@ # Release History + +## 2.0.0-beta.6 (2022-04-22) -## 2.0.0-beta.6 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 2.0.0-beta.5 (2022-04-07) - -The package of @azure/arm-appplatform is using our next generation design principles since version 2.0.0-beta.5, which contains breaking changes. +The package of @azure/arm-appplatform is using our next generation design principles since version 2.0.0-beta.6, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/appplatform/arm-appplatform/README.md b/sdk/appplatform/arm-appplatform/README.md index 1822e3bdf93a..8e517c9526cd 100644 --- a/sdk/appplatform/arm-appplatform/README.md +++ b/sdk/appplatform/arm-appplatform/README.md @@ -16,8 +16,6 @@ REST API for Azure Spring Cloud - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. - ### Prerequisites - An [Azure subscription][azure_sub]. @@ -51,17 +49,8 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new AppPlatformManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AppPlatformManagementClient(credential, subscriptionId); ``` diff --git a/sdk/appplatform/arm-appplatform/_meta.json b/sdk/appplatform/arm-appplatform/_meta.json index ae4aced6aba3..fbd790c78826 100644 --- a/sdk/appplatform/arm-appplatform/_meta.json +++ b/sdk/appplatform/arm-appplatform/_meta.json @@ -1,8 +1,8 @@ { - "commit": "54ee1a9eb50c13e0790627749f986c886ad4f4db", - "readme": "specification\\appplatform\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\attestation\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true", + "commit": "4716fb039c67e1bee1d5448af9ce57e4942832fe", + "readme": "specification/appplatform/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --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/appplatform/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.1", - "use": "@autorest/typescript@6.0.0-alpha.18.20220329.1" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/package.json b/sdk/appplatform/arm-appplatform/package.json index a3b6f5256296..23f8a83c1af5 100644 --- a/sdk/appplatform/arm-appplatform/package.json +++ b/sdk/appplatform/arm-appplatform/package.json @@ -28,14 +28,14 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-appplatform.d.ts", "devDependencies": { - "@microsoft/api-extractor": "7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-multi-entry": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.1.3", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.66.1", - "rollup-plugin-sourcemaps": "^0.6.3", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", @@ -98,21 +98,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/appPlatformManagementClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-appplatform?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md b/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md index 5fb9cc6cf2a3..00facaf239d0 100644 --- a/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md +++ b/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md @@ -2169,6 +2169,12 @@ export enum KnownSkuScaleType { None = "None" } +// @public +export enum KnownStorageType { + // (undocumented) + StorageAccount = "StorageAccount" +} + // @public export enum KnownSupportedRuntimePlatform { // (undocumented) @@ -2205,6 +2211,12 @@ export enum KnownTrafficDirection { Outbound = "Outbound" } +// @public +export enum KnownType { + // (undocumented) + AzureFileVolume = "AzureFileVolume" +} + // @public export type KPackBuildStageProvisioningState = string; @@ -2865,6 +2877,9 @@ export interface StoragesListOptionalParams extends coreClient.OperationOptions // @public export type StoragesListResponse = StorageResourceCollection; +// @public +export type StorageType = string; + // @public export type SupportedBuildpackResource = ProxyResource & { properties?: SupportedBuildpackResourceProperties; @@ -2955,6 +2970,9 @@ export interface TriggeredBuildResult { id?: string; } +// @public +export type Type = string; + // @public export type UploadedUserSourceInfo = UserSourceInfo & { type: "UploadedUserSourceInfo" | "Jar" | "Source" | "NetCoreZip"; diff --git a/sdk/appplatform/arm-appplatform/rollup.config.js b/sdk/appplatform/arm-appplatform/rollup.config.js index 3f89d7309da5..9be1955eb7f1 100644 --- a/sdk/appplatform/arm-appplatform/rollup.config.js +++ b/sdk/appplatform/arm-appplatform/rollup.config.js @@ -14,14 +14,62 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + // #region Warning Handler /** - * A function that can determine whether a rollup warning should be ignored. If + * A function that can determine whether a rollupwarning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEval(warning) { +function ignoreNiseSinonEvalWarnings(warning) { return ( warning.code === "EVAL" && warning.id && @@ -30,14 +78,17 @@ function ignoreNiseSinonEval(warning) { ); } -function ignoreChaiCircularDependency(warning) { +function ignoreChaiCircularDependencyWarnings(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; /** * Construct a warning handler for the shared rollup configuration @@ -71,7 +122,22 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs(), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -107,7 +173,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve()] + plugins: [sourcemaps(), nodeResolve(), cjs()] }; const config = [baseConfig]; diff --git a/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts b/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts index a8a86c2c5be9..1ffc6ef5f005 100644 --- a/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts +++ b/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts @@ -108,8 +108,7 @@ export class AppPlatformManagementClient extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix }, - baseUri: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + baseUri: options.endpoint || "https://management.azure.com" }; super(optionsWithDefaults); // Parameter assignments diff --git a/sdk/appplatform/arm-appplatform/src/models/index.ts b/sdk/appplatform/arm-appplatform/src/models/index.ts index 448f414ea767..bb8b969d2ff0 100644 --- a/sdk/appplatform/arm-appplatform/src/models/index.ts +++ b/sdk/appplatform/arm-appplatform/src/models/index.ts @@ -2422,6 +2422,20 @@ export enum KnownAppResourceProvisioningState { */ export type AppResourceProvisioningState = string; +/** Known values of {@link Type} that the service accepts. */ +export enum KnownType { + AzureFileVolume = "AzureFileVolume" +} + +/** + * Defines values for Type. \ + * {@link KnownType} can be used interchangeably with Type, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AzureFileVolume** + */ +export type Type = string; + /** Known values of {@link ManagedIdentityType} that the service accepts. */ export enum KnownManagedIdentityType { None = "None", @@ -2442,6 +2456,20 @@ export enum KnownManagedIdentityType { */ export type ManagedIdentityType = string; +/** Known values of {@link StorageType} that the service accepts. */ +export enum KnownStorageType { + StorageAccount = "StorageAccount" +} + +/** + * Defines values for StorageType. \ + * {@link KnownStorageType} can be used interchangeably with StorageType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **StorageAccount** + */ +export type StorageType = string; + /** Known values of {@link DeploymentResourceProvisioningState} that the service accepts. */ export enum KnownDeploymentResourceProvisioningState { Creating = "Creating", diff --git a/sdk/appplatform/arm-appplatform/src/models/mappers.ts b/sdk/appplatform/arm-appplatform/src/models/mappers.ts index 9d094157b76d..1783f8ee025a 100644 --- a/sdk/appplatform/arm-appplatform/src/models/mappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/mappers.ts @@ -2083,9 +2083,8 @@ export const CustomPersistentDiskProperties: coreClient.CompositeMapper = { }, modelProperties: { type: { - defaultValue: "AzureFileVolume", - isConstant: true, serializedName: "type", + required: true, type: { name: "String" } @@ -2353,9 +2352,8 @@ export const StorageProperties: coreClient.CompositeMapper = { }, modelProperties: { storageType: { - defaultValue: "StorageAccount", - isConstant: true, serializedName: "storageType", + required: true, type: { name: "String" } @@ -3601,6 +3599,7 @@ export const GatewayProperties: coreClient.CompositeMapper = { } }, public: { + defaultValue: false, serializedName: "public", type: { name: "Boolean" @@ -3614,6 +3613,7 @@ export const GatewayProperties: coreClient.CompositeMapper = { } }, httpsOnly: { + defaultValue: false, serializedName: "httpsOnly", type: { name: "Boolean" @@ -4137,6 +4137,7 @@ export const ApiPortalProperties: coreClient.CompositeMapper = { } }, public: { + defaultValue: false, serializedName: "public", type: { name: "Boolean" @@ -4150,6 +4151,7 @@ export const ApiPortalProperties: coreClient.CompositeMapper = { } }, httpsOnly: { + defaultValue: false, serializedName: "httpsOnly", type: { name: "Boolean" diff --git a/sdk/appplatform/arm-appplatform/src/operations/apiPortalCustomDomains.ts b/sdk/appplatform/arm-appplatform/src/operations/apiPortalCustomDomains.ts index 85dc28a1f5bc..27f8edeb7b64 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/apiPortalCustomDomains.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/apiPortalCustomDomains.ts @@ -217,13 +217,11 @@ export class ApiPortalCustomDomainsImpl implements ApiPortalCustomDomains { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -315,13 +313,11 @@ export class ApiPortalCustomDomainsImpl implements ApiPortalCustomDomains { { resourceGroupName, serviceName, apiPortalName, domainName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/apiPortals.ts b/sdk/appplatform/arm-appplatform/src/operations/apiPortals.ts index 8f744ad36c86..e4eeee457872 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/apiPortals.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/apiPortals.ts @@ -194,13 +194,11 @@ export class ApiPortalsImpl implements ApiPortals { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -287,13 +285,11 @@ export class ApiPortalsImpl implements ApiPortals { { resourceGroupName, serviceName, apiPortalName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/apps.ts b/sdk/appplatform/arm-appplatform/src/operations/apps.ts index 3724990f101d..55a2d0342519 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/apps.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/apps.ts @@ -195,13 +195,11 @@ export class AppsImpl implements Apps { { resourceGroupName, serviceName, appName, appResource, options }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -288,13 +286,11 @@ export class AppsImpl implements Apps { { resourceGroupName, serviceName, appName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -382,13 +378,11 @@ export class AppsImpl implements Apps { { resourceGroupName, serviceName, appName, appResource, options }, updateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -526,13 +520,11 @@ export class AppsImpl implements Apps { }, setActiveDeploymentsOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/bindings.ts b/sdk/appplatform/arm-appplatform/src/operations/bindings.ts index 0e1aad3255a0..0716f2a2d329 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/bindings.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/bindings.ts @@ -219,13 +219,11 @@ export class BindingsImpl implements Bindings { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -317,13 +315,11 @@ export class BindingsImpl implements Bindings { { resourceGroupName, serviceName, appName, bindingName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -426,13 +422,11 @@ export class BindingsImpl implements Bindings { }, updateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/buildServiceAgentPool.ts b/sdk/appplatform/arm-appplatform/src/operations/buildServiceAgentPool.ts index e3a6613fd829..0fe72331a7d4 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/buildServiceAgentPool.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/buildServiceAgentPool.ts @@ -242,13 +242,11 @@ export class BuildServiceAgentPoolImpl implements BuildServiceAgentPool { }, updatePutOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/buildServiceBuilder.ts b/sdk/appplatform/arm-appplatform/src/operations/buildServiceBuilder.ts index 7f661eb99d97..76475039c564 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/buildServiceBuilder.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/buildServiceBuilder.ts @@ -223,13 +223,11 @@ export class BuildServiceBuilderImpl implements BuildServiceBuilder { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -327,13 +325,11 @@ export class BuildServiceBuilderImpl implements BuildServiceBuilder { }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/buildpackBinding.ts b/sdk/appplatform/arm-appplatform/src/operations/buildpackBinding.ts index 3971606d4f2d..d4bab48e6fd6 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/buildpackBinding.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/buildpackBinding.ts @@ -238,13 +238,11 @@ export class BuildpackBindingImpl implements BuildpackBinding { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -348,13 +346,11 @@ export class BuildpackBindingImpl implements BuildpackBinding { }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/certificates.ts b/sdk/appplatform/arm-appplatform/src/operations/certificates.ts index e6b23ad59406..c44ab124f2f0 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/certificates.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/certificates.ts @@ -191,13 +191,11 @@ export class CertificatesImpl implements Certificates { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -284,13 +282,11 @@ export class CertificatesImpl implements Certificates { { resourceGroupName, serviceName, certificateName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/configServers.ts b/sdk/appplatform/arm-appplatform/src/operations/configServers.ts index 8a854f018855..a6aa57482876 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/configServers.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/configServers.ts @@ -119,13 +119,11 @@ export class ConfigServersImpl implements ConfigServers { { resourceGroupName, serviceName, configServerResource, options }, updatePutOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -214,13 +212,11 @@ export class ConfigServersImpl implements ConfigServers { { resourceGroupName, serviceName, configServerResource, options }, updatePatchOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -309,13 +305,11 @@ export class ConfigServersImpl implements ConfigServers { { resourceGroupName, serviceName, configServerSettings, options }, validateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "location" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/configurationServices.ts b/sdk/appplatform/arm-appplatform/src/operations/configurationServices.ts index 34929d63ab28..66190d549a02 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/configurationServices.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/configurationServices.ts @@ -195,13 +195,11 @@ export class ConfigurationServicesImpl implements ConfigurationServices { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -289,13 +287,11 @@ export class ConfigurationServicesImpl implements ConfigurationServices { { resourceGroupName, serviceName, configurationServiceName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -410,13 +406,11 @@ export class ConfigurationServicesImpl implements ConfigurationServices { }, validateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "location" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/customDomains.ts b/sdk/appplatform/arm-appplatform/src/operations/customDomains.ts index bd9b10f5a902..23bbcf33e083 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/customDomains.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/customDomains.ts @@ -219,13 +219,11 @@ export class CustomDomainsImpl implements CustomDomains { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -317,13 +315,11 @@ export class CustomDomainsImpl implements CustomDomains { { resourceGroupName, serviceName, appName, domainName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -426,13 +422,11 @@ export class CustomDomainsImpl implements CustomDomains { }, updateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/deployments.ts b/sdk/appplatform/arm-appplatform/src/operations/deployments.ts index f694189427d0..19544655ed53 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/deployments.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/deployments.ts @@ -304,13 +304,11 @@ export class DeploymentsImpl implements Deployments { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -402,13 +400,11 @@ export class DeploymentsImpl implements Deployments { { resourceGroupName, serviceName, appName, deploymentName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -511,13 +507,11 @@ export class DeploymentsImpl implements Deployments { }, updateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -647,13 +641,11 @@ export class DeploymentsImpl implements Deployments { { resourceGroupName, serviceName, appName, deploymentName, options }, startOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -742,13 +734,11 @@ export class DeploymentsImpl implements Deployments { { resourceGroupName, serviceName, appName, deploymentName, options }, stopOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -837,13 +827,11 @@ export class DeploymentsImpl implements Deployments { { resourceGroupName, serviceName, appName, deploymentName, options }, restartOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -963,13 +951,11 @@ export class DeploymentsImpl implements Deployments { }, generateHeapDumpOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -1070,13 +1056,11 @@ export class DeploymentsImpl implements Deployments { }, generateThreadDumpOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -1177,13 +1161,11 @@ export class DeploymentsImpl implements Deployments { }, startJFROperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/gatewayCustomDomains.ts b/sdk/appplatform/arm-appplatform/src/operations/gatewayCustomDomains.ts index cdae01b6f122..caae600abbfe 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/gatewayCustomDomains.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/gatewayCustomDomains.ts @@ -218,13 +218,11 @@ export class GatewayCustomDomainsImpl implements GatewayCustomDomains { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -317,13 +315,11 @@ export class GatewayCustomDomainsImpl implements GatewayCustomDomains { { resourceGroupName, serviceName, gatewayName, domainName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/gatewayRouteConfigs.ts b/sdk/appplatform/arm-appplatform/src/operations/gatewayRouteConfigs.ts index 9b9e53cf5e52..4ac023476244 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/gatewayRouteConfigs.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/gatewayRouteConfigs.ts @@ -219,13 +219,11 @@ export class GatewayRouteConfigsImpl implements GatewayRouteConfigs { }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -319,13 +317,11 @@ export class GatewayRouteConfigsImpl implements GatewayRouteConfigs { { resourceGroupName, serviceName, gatewayName, routeConfigName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/gateways.ts b/sdk/appplatform/arm-appplatform/src/operations/gateways.ts index 2057d727f2c7..7f042a23a434 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/gateways.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/gateways.ts @@ -188,13 +188,11 @@ export class GatewaysImpl implements Gateways { { resourceGroupName, serviceName, gatewayName, gatewayResource, options }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -281,13 +279,11 @@ export class GatewaysImpl implements Gateways { { resourceGroupName, serviceName, gatewayName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/monitoringSettings.ts b/sdk/appplatform/arm-appplatform/src/operations/monitoringSettings.ts index f4790f02aa83..99bc52d0d97c 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/monitoringSettings.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/monitoringSettings.ts @@ -116,13 +116,11 @@ export class MonitoringSettingsImpl implements MonitoringSettings { { resourceGroupName, serviceName, monitoringSettingResource, options }, updatePutOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -211,13 +209,11 @@ export class MonitoringSettingsImpl implements MonitoringSettings { { resourceGroupName, serviceName, monitoringSettingResource, options }, updatePatchOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/serviceRegistries.ts b/sdk/appplatform/arm-appplatform/src/operations/serviceRegistries.ts index 9d8d85d1f7da..b9dec83fcb40 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/serviceRegistries.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/serviceRegistries.ts @@ -183,13 +183,11 @@ export class ServiceRegistriesImpl implements ServiceRegistries { { resourceGroupName, serviceName, serviceRegistryName, options }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -273,13 +271,11 @@ export class ServiceRegistriesImpl implements ServiceRegistries { { resourceGroupName, serviceName, serviceRegistryName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/services.ts b/sdk/appplatform/arm-appplatform/src/operations/services.ts index 89c7e63e47c5..049378a0994c 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/services.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/services.ts @@ -233,13 +233,11 @@ export class ServicesImpl implements Services { { resourceGroupName, serviceName, resource, options }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -321,13 +319,11 @@ export class ServicesImpl implements Services { { resourceGroupName, serviceName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -413,13 +409,11 @@ export class ServicesImpl implements Services { { resourceGroupName, serviceName, resource, options }, updateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -575,13 +569,11 @@ export class ServicesImpl implements Services { { resourceGroupName, serviceName, options }, stopOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -660,13 +652,11 @@ export class ServicesImpl implements Services { { resourceGroupName, serviceName, options }, startOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/src/operations/storages.ts b/sdk/appplatform/arm-appplatform/src/operations/storages.ts index d2bcac9057a5..ca2d00172ec6 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/storages.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/storages.ts @@ -185,13 +185,11 @@ export class StoragesImpl implements Storages { { resourceGroupName, serviceName, storageName, storageResource, options }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** @@ -278,13 +276,11 @@ export class StoragesImpl implements Storages { { resourceGroupName, serviceName, storageName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); - await poller.poll(); - return poller; } /** diff --git a/sdk/appplatform/arm-appplatform/test/sampleTest.ts b/sdk/appplatform/arm-appplatform/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/appplatform/arm-appplatform/tsconfig.json b/sdk/appplatform/arm-appplatform/tsconfig.json index 04fa881dd845..3e6ae96443f3 100644 --- a/sdk/appplatform/arm-appplatform/tsconfig.json +++ b/sdk/appplatform/arm-appplatform/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-appplatform": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"