From 39f31e3a75f9347e8d83aaf3e5d40b78c0adeb1f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 14 Nov 2023 05:56:21 +0000 Subject: [PATCH] CodeGen from PR 3689 in openapi-env-test/azure-rest-api-specs Merge 60736f8697b8c792b57e05ee3b9329816e7d82cc into 41e238f9fd4ba837de65fca653a971f577529b12 --- common/config/rush/pnpm-lock.yaml | 79 ++++++++++++------- sdk/locks/arm-locks/CHANGELOG.md | 23 +++--- sdk/locks/arm-locks/LICENSE | 2 +- sdk/locks/arm-locks/_meta.json | 10 +-- sdk/locks/arm-locks/package.json | 29 +++---- sdk/locks/arm-locks/review/arm-locks.api.md | 7 +- .../arm-locks/src/managementLockClient.ts | 22 +++++- sdk/locks/arm-locks/src/models/index.ts | 20 +---- .../src/operations/authorizationOperations.ts | 1 - .../src/operations/managementLocks.ts | 4 - sdk/locks/arm-locks/src/pagingHelper.ts | 8 +- sdk/locks/arm-locks/test/sampleTest.ts | 43 ++++++++++ sdk/locks/arm-locks/tsconfig.json | 10 +-- 13 files changed, 154 insertions(+), 104 deletions(-) create mode 100644 sdk/locks/arm-locks/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 99321d0907bc..097f3b10fde7 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1,7 +1,7 @@ lockfileVersion: '6.0' settings: - autoInstallPeers: true + autoInstallPeers: false excludeLinksFromLockfile: false dependencies: @@ -4495,7 +4495,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20231030 + typescript: 5.4.0-dev.20231113 dev: false /eastasianwidth@0.2.0: @@ -9261,8 +9261,8 @@ packages: hasBin: true dev: false - /typescript@5.3.0-dev.20231030: - resolution: {integrity: sha512-azWrF0lAiu8cBHNr6yq3RDkU/DtQScvT48ea3Ngq6oXJ/GPO0n96wCFSRQA5UbZlVVf3fAAqsUfvOdohRbrPVg==} + /typescript@5.4.0-dev.20231113: + resolution: {integrity: sha512-5K165L/tImARYZDKwwT2ER9qKt0n56E8jxldXfAVpq8qNqX5o2SvpoPrzCi+eddkHJHl1gPf26xiE+7R6//1Gg==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -11244,19 +11244,22 @@ packages: dev: false file:projects/arm-changes.tgz: - resolution: {integrity: sha512-U+53YLqBl3DmErXW9glVzD+hP6pA58tpTcHqN13AL6aru5tQawBPW/utqB/usJIKGcBkZVVkVScxSU+YBSVNow==, tarball: file:projects/arm-changes.tgz} + resolution: {integrity: sha512-IoZQZqVTX4O5LvlxANEL8hINywPKDllOOg5qn8ml5LJpsWEZKoxqwJN/LbkmXw/UGKCXh53ZHqQHPd7BANAbsA==, tarball: file:projects/arm-changes.tgz} name: '@rush-temp/arm-changes' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -12672,19 +12675,22 @@ packages: dev: false file:projects/arm-features.tgz: - resolution: {integrity: sha512-73VI4IzvKvfyxA73Z92X5QZfVjbR7AB7d/4hHd2HnfimfCbRZYE0ymm+YzERPQ+gvCSqcrnpCXqha9JMgfUT1Q==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-NXeHywRnaUSRdFF+vpIsYDGej8NH5P8SBY85GotGH3aDvuiISFLiw2tma4wDAcTu9Kk6ZnlJcyBYxpJvbwD1PQ==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -13266,19 +13272,22 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-QnQUc0vJ/Saqt/0YmlnG1jxOfGFn4+leDjpLVE0Gnh9MKnLESwDO29wVpI4O+85u6rOgVX26vjgl/uJYaY9VYw==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-yWyTzzPDk4jWoCvycP6C+q/ZR0dtUKpFqjV0t235Z2tJFFmTCQw/qECNh7af8LbLwxDDkYM2OyKwV4fpzI1Gxw==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -13340,19 +13349,22 @@ packages: dev: false file:projects/arm-locks.tgz: - resolution: {integrity: sha512-94xTc2vXU8VXC0dNd7kFQuGTQGuKxmkC8/v834Ls2TVSOM8IlFPzYwzDBOksNSXMo5+GHOUuNZlV7MXAZwvSNg==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-Qta5O/juj+vMo5M9P2IGAAg4Q2zMOG98sfxgoHW29m5lDrvNHyfRWYzB3FZGa/q9zy4mKL7/VP/14LqqDefJUA==, tarball: file:projects/arm-locks.tgz} name: '@rush-temp/arm-locks' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -13484,20 +13496,22 @@ packages: dev: false file:projects/arm-managedapplications.tgz: - resolution: {integrity: sha512-TXwaskNL9KGRS7hlbbePM6Cz9U+GBcfbaGIWQX/sJL26IdYy7iw3CjjQfiXb7y8bQy/37OvbcbIErPz6MNI7eA==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-P2fGjmfU1HujB69+c2B/H8FfUN0CRk9Ppkzb3gHI2/z8vsPXTMuVwlVsb3V++AR58PHaHBh90wTQHdcDvb1CZQ==, tarball: file:projects/arm-managedapplications.tgz} name: '@rush-temp/arm-managedapplications' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -14319,20 +14333,22 @@ packages: dev: false file:projects/arm-policy.tgz: - resolution: {integrity: sha512-/dhmPL/hUyUFBeA/k+1Ex91Deni5MOfUdESJsLZf9oiDhsQ0V+pUve/VPCCTPsEykUDOe1gsV5MeifYikk+1Sg==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-X+uRjHvIL7SbVz1nr9vDhJjnGWBUuAKuDj9F3NFvbik8+pLYBIVXLIXNc87r8S80RjWm06MM2oYRBhZZDMW7sw==, tarball: file:projects/arm-policy.tgz} name: '@rush-temp/arm-policy' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -14939,20 +14955,22 @@ packages: dev: false file:projects/arm-resources-subscriptions.tgz: - resolution: {integrity: sha512-YHy6SVysSN0aGFDukP9Qs6+gPgHGP7TTMm/XukH5QfSb1zC5qfXL+jzHCHHfIsooTiJcRk9aYHHFxpoBqhnZ8w==, tarball: file:projects/arm-resources-subscriptions.tgz} + resolution: {integrity: sha512-To/H5lb6H5b+iXA05h8vVVAFV2172cUpMjDGA9JFKu8epZPhXH0TBze5A17cfZT+dx1rk7dCIoXy+cC4zYqehg==, tarball: file:projects/arm-resources-subscriptions.tgz} name: '@rush-temp/arm-resources-subscriptions' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -14964,20 +14982,22 @@ packages: dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-ws2q0Vy1XQtuQ49TTUZflbpF8KzNPc4ZmsXkPSSt74DGobaMJeW9dSrU3TwjtxDJ5hiKVYpe4SXVujDYmckHvg==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-7SxmLyKRl2wuoM1ask677P5Om+oxLQx5FW+eMma80uJH/5U8+Pu6xX4nTXaTYZQlRWxFseJOXIA47nLTU80qjA==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -15801,19 +15821,22 @@ packages: dev: false file:projects/arm-templatespecs.tgz: - resolution: {integrity: sha512-AQ1/4GfE52L7URXCOgJogRx8mmaYdddU22c04o+OcyeVVe5kZCBoHrazzv3HYucih9qubMB/BScsBXWC+VyYQQ==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-nb1TNYl2Nd+mcLDQbqXgxuOST9N3yzh+8wIBN9mKn1n9pijzoT67koIX4dj6mSB5cjx/WciWy3uhwAyugLntRA==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -20375,7 +20398,7 @@ packages: dev: false file:projects/storage-blob-changefeed.tgz: - resolution: {integrity: sha512-2LtIcl6t12irIaBaBSP/ytxkJA5VSRJ2RUg08UJEi/NVLHhjpx+NQQn/a/ebeAwpa2DefdSkfHRhgh7zn8Qzzg==, tarball: file:projects/storage-blob-changefeed.tgz} + resolution: {integrity: sha512-nBVNUHVbjsSyKfoA2uJNvG+jlJEW9Oq12K9Oha1C6GVY1rZhEpcWrkob0RJe/sCDdrMo0MBUnvL7+PkUsvhR8w==, tarball: file:projects/storage-blob-changefeed.tgz} name: '@rush-temp/storage-blob-changefeed' version: 0.0.0 dependencies: diff --git a/sdk/locks/arm-locks/CHANGELOG.md b/sdk/locks/arm-locks/CHANGELOG.md index 835304c0dafe..8e507282a6f8 100644 --- a/sdk/locks/arm-locks/CHANGELOG.md +++ b/sdk/locks/arm-locks/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History + +## 3.0.0 (2023-11-14) + +**Breaking Changes** -## 2.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Class ManagementLockClient has a new signature + - Interface ManagementLocksListAtResourceGroupLevelNextOptionalParams no longer has parameter filter + - Interface ManagementLocksListAtResourceLevelNextOptionalParams no longer has parameter filter + - Interface ManagementLocksListAtSubscriptionLevelNextOptionalParams no longer has parameter filter + - Interface ManagementLocksListByScopeNextOptionalParams no longer has parameter filter + + ## 2.1.0 (2022-11-22) **Features** @@ -31,4 +32,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/locks/arm-locks/LICENSE b/sdk/locks/arm-locks/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/locks/arm-locks/LICENSE +++ b/sdk/locks/arm-locks/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/locks/arm-locks/_meta.json b/sdk/locks/arm-locks/_meta.json index c7ad3e56f301..3f6c4ed12d09 100644 --- a/sdk/locks/arm-locks/_meta.json +++ b/sdk/locks/arm-locks/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", + "commit": "5c6dd74a84214a512f2eba2339e688d93c0b5b3d", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.11", + "repository_url": "https://github.com/openapi-env-test/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", + "use": "@autorest/typescript@^6.0.11" } \ No newline at end of file diff --git a/sdk/locks/arm-locks/package.json b/sdk/locks/arm-locks/package.json index dda9192707e5..34ceabe4c786 100644 --- a/sdk/locks/arm-locks/package.json +++ b/sdk/locks/arm-locks/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ManagementLockClient.", - "version": "2.1.1", + "version": "3.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@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", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -27,22 +27,24 @@ "types": "./types/arm-locks.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "typescript": "~5.2.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", "ts-node": "^10.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/locks/arm-locks", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -75,7 +77,7 @@ "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -103,12 +105,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-locks?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/locks/arm-locks" +} \ No newline at end of file diff --git a/sdk/locks/arm-locks/review/arm-locks.api.md b/sdk/locks/arm-locks/review/arm-locks.api.md index f0af237b239b..6e803bc7ceaf 100644 --- a/sdk/locks/arm-locks/review/arm-locks.api.md +++ b/sdk/locks/arm-locks/review/arm-locks.api.md @@ -76,6 +76,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLockClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: ManagementLockClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -83,7 +84,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { // (undocumented) managementLocks: ManagementLocks; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public @@ -209,7 +210,6 @@ export type ManagementLocksGetByScopeResponse = ManagementLockObject; // @public export interface ManagementLocksListAtResourceGroupLevelNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -225,7 +225,6 @@ export type ManagementLocksListAtResourceGroupLevelResponse = ManagementLockList // @public export interface ManagementLocksListAtResourceLevelNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -241,7 +240,6 @@ export type ManagementLocksListAtResourceLevelResponse = ManagementLockListResul // @public export interface ManagementLocksListAtSubscriptionLevelNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -257,7 +255,6 @@ export type ManagementLocksListAtSubscriptionLevelResponse = ManagementLockListR // @public export interface ManagementLocksListByScopeNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public diff --git a/sdk/locks/arm-locks/src/managementLockClient.ts b/sdk/locks/arm-locks/src/managementLockClient.ts index 1f0594596368..bff6a2e8deec 100644 --- a/sdk/locks/arm-locks/src/managementLockClient.ts +++ b/sdk/locks/arm-locks/src/managementLockClient.ts @@ -24,7 +24,7 @@ import { ManagementLockClientOptionalParams } from "./models"; export class ManagementLockClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the ManagementLockClient class. @@ -36,12 +36,26 @@ export class ManagementLockClient extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLockClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: ManagementLockClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: ManagementLockClientOptionalParams | string, + options?: ManagementLockClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -53,7 +67,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-locks/2.1.1`; + const packageDetails = `azsdk-js-arm-locks/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/locks/arm-locks/src/models/index.ts b/sdk/locks/arm-locks/src/models/index.ts index c95cb1af614b..2fe913e5c840 100644 --- a/sdk/locks/arm-locks/src/models/index.ts +++ b/sdk/locks/arm-locks/src/models/index.ts @@ -316,40 +316,28 @@ export type ManagementLocksListByScopeResponse = ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtResourceGroupLevelNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtResourceGroupLevelNext operation. */ export type ManagementLocksListAtResourceGroupLevelNextResponse = ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtResourceLevelNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtResourceLevelNext operation. */ export type ManagementLocksListAtResourceLevelNextResponse = ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtSubscriptionLevelNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtSubscriptionLevelNext operation. */ export type ManagementLocksListAtSubscriptionLevelNextResponse = ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListByScopeNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByScopeNext operation. */ export type ManagementLocksListByScopeNextResponse = ManagementLockListResult; diff --git a/sdk/locks/arm-locks/src/operations/authorizationOperations.ts b/sdk/locks/arm-locks/src/operations/authorizationOperations.ts index 7a5256074de5..af610d81c4c6 100644 --- a/sdk/locks/arm-locks/src/operations/authorizationOperations.ts +++ b/sdk/locks/arm-locks/src/operations/authorizationOperations.ts @@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/locks/arm-locks/src/operations/managementLocks.ts b/sdk/locks/arm-locks/src/operations/managementLocks.ts index 3669b5d87ac0..f62451bc6636 100644 --- a/sdk/locks/arm-locks/src/operations/managementLocks.ts +++ b/sdk/locks/arm-locks/src/operations/managementLocks.ts @@ -1179,7 +1179,6 @@ const listAtResourceGroupLevelNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -1200,7 +1199,6 @@ const listAtResourceLevelNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -1225,7 +1223,6 @@ const listAtSubscriptionLevelNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -1245,7 +1242,6 @@ const listByScopeNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], serializer diff --git a/sdk/locks/arm-locks/src/pagingHelper.ts b/sdk/locks/arm-locks/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/locks/arm-locks/src/pagingHelper.ts +++ b/sdk/locks/arm-locks/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/locks/arm-locks/test/sampleTest.ts b/sdk/locks/arm-locks/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/locks/arm-locks/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/locks/arm-locks/tsconfig.json b/sdk/locks/arm-locks/tsconfig.json index 6b255a60b747..8292b80f5b3f 100644 --- a/sdk/locks/arm-locks/tsconfig.json +++ b/sdk/locks/arm-locks/tsconfig.json @@ -15,19 +15,13 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-locks": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"