From e71be00165fe697e54935974e4b7363334d7ad30 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 14 Nov 2023 05:56:34 +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 ++-- .../arm-resources-subscriptions/CHANGELOG.md | 29 +- .../arm-resources-subscriptions/_meta.json | 10 +- .../arm-resources-subscriptions/package.json | 24 +- .../review/arm-resources-subscriptions.api.md | 75 +--- .../src/models/index.ts | 264 +++---------- .../src/models/mappers.ts | 347 +++++------------- .../src/models/parameters.ts | 42 +-- .../src/operations/index.ts | 1 - .../src/operations/operations.ts | 149 -------- .../src/operationsInterfaces/index.ts | 1 - .../src/operationsInterfaces/operations.ts | 22 -- .../src/subscriptionClient.ts | 10 +- .../test/sampleTest.ts | 43 +++ .../arm-resources-subscriptions/tsconfig.json | 15 +- 15 files changed, 303 insertions(+), 808 deletions(-) delete mode 100644 sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts delete mode 100644 sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts create mode 100644 sdk/resources-subscriptions/arm-resources-subscriptions/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/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md b/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md index 679a52903b60..e63d22fe3df2 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md @@ -1,15 +1,20 @@ # Release History - -## 2.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 3.0.0 (2023-11-14) + +**Breaking Changes** + + - Removed operation group Operations + - Interface Location_2 no longer has parameter availabilityZoneMappings + - Interface LocationMetadata no longer has parameter geography + - Interface Operation no longer has parameter actionType + - Interface Operation no longer has parameter isDataAction + - Interface Operation no longer has parameter origin + - Class SubscriptionClient no longer has parameter operations + - Removed Enum KnownActionType + - Removed Enum KnownOrigin + + ## 2.1.0 (2023-05-24) **Features** @@ -66,4 +71,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/resources-subscriptions/arm-resources-subscriptions/_meta.json b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json index 0c611e34e91d..3f6c4ed12d09 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json @@ -1,8 +1,8 @@ { - "commit": "2b5927fd07bfb51809a06ca35b6142f63ba77bab", + "commit": "5c6dd74a84214a512f2eba2339e688d93c0b5b3d", "readme": "specification/resources/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.2 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.2" + "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/resources-subscriptions/arm-resources-subscriptions/package.json b/sdk/resources-subscriptions/arm-resources-subscriptions/package.json index b2e2a9d5cb68..8f786266d95f 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/package.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SubscriptionClient.", - "version": "2.1.1", + "version": "3.0.0", "engines": { "node": ">=18.0.0" }, @@ -11,7 +11,7 @@ "@azure/core-paging": "^1.2.0", "@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": [ @@ -30,17 +30,19 @@ "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" }, "repository": { @@ -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,13 +105,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources-subscriptions/arm-resources-subscriptions", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resources-subscriptions?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources-subscriptions/arm-resources-subscriptions" +} \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md b/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md index 91495e35f763..4ab3953e7d27 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md @@ -8,15 +8,6 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -// @public -export type ActionType = string; - -// @public -export interface AvailabilityZoneMappings { - readonly logicalZone?: string; - readonly physicalZone?: string; -} - // @public export interface AvailabilityZonePeers { readonly availabilityZone?: string; @@ -88,18 +79,6 @@ export interface ErrorResponseAutoGenerated { // @public export function getContinuationToken(page: unknown): string | undefined; -// @public -export enum KnownActionType { - Internal = "Internal" -} - -// @public -export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" -} - // @public export enum KnownRegionCategory { Extended = "Extended", @@ -121,7 +100,6 @@ export enum KnownResourceNameStatus { // @public interface Location_2 { - availabilityZoneMappings?: AvailabilityZoneMappings[]; readonly displayName?: string; readonly id?: string; metadata?: LocationMetadata; @@ -139,7 +117,6 @@ export interface LocationListResult { // @public export interface LocationMetadata { - readonly geography?: string; readonly geographyGroup?: string; readonly homeLocation?: string; readonly latitude?: string; @@ -160,32 +137,12 @@ export interface ManagedByTenant { // @public export interface Operation { - readonly actionType?: ActionType; display?: OperationDisplay; - readonly isDataAction?: boolean; - readonly name?: string; - readonly origin?: Origin; -} - -// @public -export interface OperationAutoGenerated { - readonly actionType?: ActionType; - display?: OperationDisplayAutoGenerated; - readonly isDataAction?: boolean; name?: string; - readonly origin?: Origin; } // @public export interface OperationDisplay { - readonly description?: string; - readonly operation?: string; - readonly provider?: string; - readonly resource?: string; -} - -// @public -export interface OperationDisplayAutoGenerated { description?: string; operation?: string; provider?: string; @@ -194,38 +151,10 @@ export interface OperationDisplayAutoGenerated { // @public export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; -} - -// @public -export interface OperationListResultAutoGenerated { nextLink?: string; - value?: OperationAutoGenerated[]; -} - -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListNextResponse = OperationListResult; - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { + value?: Operation[]; } -// @public -export type OperationsListResponse = OperationListResult; - -// @public -export type Origin = string; - // @public export interface PairedRegion { readonly id?: string; @@ -281,8 +210,6 @@ export class SubscriptionClient extends coreClient.ServiceClient { apiVersion: string; checkResourceName(options?: CheckResourceNameOptionalParams): Promise; // (undocumented) - operations: Operations; - // (undocumented) subscriptions: Subscriptions; // (undocumented) tenants: Tenants; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts index 6db2ed8937c1..7e8f483f8400 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts @@ -8,119 +8,6 @@ import * as coreClient from "@azure/core-client"; -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface OperationListResult { - /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Operation[]; - /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface Operation { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplay; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionType?: ActionType; -} - -/** Localized display information for this particular operation. */ -export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; -} - -/** An error response for a resource management request. */ -export interface CloudError { - /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ - error?: ErrorResponse; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ -export interface ErrorResponse { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorResponse[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - /** Location list operation response. */ export interface LocationListResult { /** An array of locations. */ @@ -130,7 +17,7 @@ export interface LocationListResult { /** Location information. */ export interface Location { /** - * The fully qualified ID of the location. For example, /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74/locations/westus. + * The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; @@ -161,8 +48,6 @@ export interface Location { readonly regionalDisplayName?: string; /** Metadata of the location, such as lat/long, paired region, and others. */ metadata?: LocationMetadata; - /** The availability zone mappings for this region. */ - availabilityZoneMappings?: AvailabilityZoneMappings[]; } /** Location metadata information */ @@ -177,11 +62,6 @@ export interface LocationMetadata { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly regionCategory?: RegionCategory; - /** - * The geography of the location. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly geography?: string; /** * The geography group of the location. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -219,7 +99,7 @@ export interface PairedRegion { */ readonly name?: string; /** - * The fully qualified ID of the location. For example, /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74/locations/westus. + * The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; @@ -230,24 +110,59 @@ export interface PairedRegion { readonly subscriptionId?: string; } -/** Availability zone mappings for the region */ -export interface AvailabilityZoneMappings { +/** An error response for a resource management request. */ +export interface CloudError { + /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ + error?: ErrorResponse; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ +export interface ErrorResponse { /** - * The logical zone id for the availability zone + * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly logicalZone?: string; + readonly code?: string; /** - * The fully qualified physical zone id of availability zone to which logical zone id is mapped to + * The error message. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly physicalZone?: string; + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorResponse[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; } /** Subscription information. */ export interface Subscription { /** - * The fully qualified ID for the subscription. For example, /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74 + * The fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; @@ -328,12 +243,12 @@ export interface TenantListResult { /** Tenant Id information. */ export interface TenantIdDescription { /** - * The fully qualified ID of the tenant. For example, /tenants/8d65815f-a5b6-402f-9298-045155da7d74 + * The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The tenant ID. For example, 8d65815f-a5b6-402f-9298-045155da7d74 + * The tenant ID. For example, 00000000-0000-0000-0000-000000000000. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; @@ -478,31 +393,16 @@ export interface CheckResourceNameResult { status?: ResourceNameStatus; } -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface OperationAutoGenerated { +/** Microsoft.Resources operation */ +export interface Operation { /** Operation name: {provider}/{resource}/{operation} */ name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplayAutoGenerated; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionType?: ActionType; + /** The object that represents the operation. */ + display?: OperationDisplay; } -/** Localized display information for this particular operation. */ -export interface OperationDisplayAutoGenerated { +/** The object that represents the operation. */ +export interface OperationDisplay { /** Service provider: Microsoft.Resources */ provider?: string; /** Resource on which the operation is performed: Profile, endpoint, etc. */ @@ -513,50 +413,14 @@ export interface OperationDisplayAutoGenerated { description?: string; } -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface OperationListResultAutoGenerated { - /** List of operations supported by the resource provider */ - value?: OperationAutoGenerated[]; - /** URL to get the next set of operation list results (if there are any). */ +/** Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { + /** List of Microsoft.Resources operations. */ + value?: Operation[]; + /** URL to get the next set of operation list results if there are any. */ nextLink?: string; } -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system" -} - -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal" -} - -/** - * Defines values for ActionType. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal** - */ -export type ActionType = string; - /** Known values of {@link RegionType} that the service accepts. */ export enum KnownRegionType { /** Physical */ @@ -627,20 +491,6 @@ export type SpendingLimit = "On" | "Off" | "CurrentPeriodOff"; /** Defines values for TenantCategory. */ export type TenantCategory = "Home" | "ProjectedBy" | "ManagedBy"; -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; - /** Optional parameters. */ export interface SubscriptionsListLocationsOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts index 5f6ca4b369ab..f4eb5f5464c8 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts @@ -8,212 +8,6 @@ import * as coreClient from "@azure/core-client"; -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - }, - origin: { - serializedName: "origin", - readOnly: true, - type: { - name: "String" - } - }, - actionType: { - serializedName: "actionType", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - readOnly: true, - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - readOnly: true, - type: { - name: "String" - } - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const CloudError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudError", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorResponse" - } - } - } - } -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorResponse" - } - } - } - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - export const LocationListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -289,18 +83,6 @@ export const Location: coreClient.CompositeMapper = { name: "Composite", className: "LocationMetadata" } - }, - availabilityZoneMappings: { - serializedName: "availabilityZoneMappings", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AvailabilityZoneMappings" - } - } - } } } } @@ -325,13 +107,6 @@ export const LocationMetadata: coreClient.CompositeMapper = { name: "String" } }, - geography: { - serializedName: "geography", - readOnly: true, - type: { - name: "String" - } - }, geographyGroup: { serializedName: "geographyGroup", readOnly: true, @@ -413,24 +188,97 @@ export const PairedRegion: coreClient.CompositeMapper = { } }; -export const AvailabilityZoneMappings: coreClient.CompositeMapper = { +export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailabilityZoneMappings", + className: "CloudError", modelProperties: { - logicalZone: { - serializedName: "logicalZone", + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + serializedName: "code", readOnly: true, type: { name: "String" } }, - physicalZone: { - serializedName: "physicalZone", + message: { + serializedName: "message", readOnly: true, type: { name: "String" } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } @@ -934,10 +782,10 @@ export const CheckResourceNameResult: coreClient.CompositeMapper = { } }; -export const OperationAutoGenerated: coreClient.CompositeMapper = { +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationAutoGenerated", + className: "Operation", modelProperties: { name: { serializedName: "name", @@ -945,42 +793,21 @@ export const OperationAutoGenerated: coreClient.CompositeMapper = { name: "String" } }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean" - } - }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplayAutoGenerated" - } - }, - origin: { - serializedName: "origin", - readOnly: true, - type: { - name: "String" - } - }, - actionType: { - serializedName: "actionType", - readOnly: true, - type: { - name: "String" + className: "OperationDisplay" } } } } }; -export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplayAutoGenerated", + className: "OperationDisplay", modelProperties: { provider: { serializedName: "provider", @@ -1010,10 +837,10 @@ export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { } }; -export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResultAutoGenerated", + className: "OperationListResult", modelProperties: { value: { serializedName: "value", @@ -1022,7 +849,7 @@ export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "OperationAutoGenerated" + className: "Operation" } } } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts index 2d2011c70e74..a9dc67106cd5 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts @@ -40,35 +40,23 @@ export const $host: OperationURLParameter = { skipEncoding: true }; -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2022-12-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - serializedName: "nextLink", + serializedName: "subscriptionId", required: true, type: { name: "String" } - }, - skipEncoding: true + } }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "subscriptionId", - required: true, + defaultValue: "2021-01-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } @@ -102,6 +90,18 @@ export const parameters: OperationParameter = { mapper: CheckZonePeersRequestMapper }; +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + export const resourceNameDefinition: OperationParameter = { parameterPath: ["options", "resourceNameDefinition"], mapper: ResourceNameMapper diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/index.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/index.ts index f80a9ad0321f..6c722ac4853c 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/index.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/index.ts @@ -6,6 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations"; export * from "./subscriptions"; export * from "./tenants"; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts deleted file mode 100644 index 3808ae14959a..000000000000 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Operations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { SubscriptionClient } from "../subscriptionClient"; -import { - Operation, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse -} from "../models"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: SubscriptionClient; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: SubscriptionClient) { - this.client = client; - } - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * @param options The options parameters. - */ - public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - } - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: OperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * @param options The options parameters. - */ - private _list( - options?: OperationsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/index.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/index.ts index f80a9ad0321f..6c722ac4853c 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/index.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/index.ts @@ -6,6 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations"; export * from "./subscriptions"; export * from "./tenants"; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts deleted file mode 100644 index ac34435954c0..000000000000 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operation, OperationsListOptionalParams } from "../models"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * Lists all of the available Microsoft.Resources REST API operations. - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts index 406ae23d19bf..064d3f0876a9 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts @@ -14,8 +14,8 @@ import { SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { OperationsImpl, SubscriptionsImpl, TenantsImpl } from "./operations"; -import { Operations, Subscriptions, Tenants } from "./operationsInterfaces"; +import { SubscriptionsImpl, TenantsImpl } from "./operations"; +import { Subscriptions, Tenants } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; import { @@ -50,7 +50,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resources-subscriptions/2.1.1`; + const packageDetails = `azsdk-js-arm-resources-subscriptions/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -101,8 +101,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-12-01"; - this.operations = new OperationsImpl(this); + this.apiVersion = options.apiVersion || "2021-01-01"; this.subscriptions = new SubscriptionsImpl(this); this.tenants = new TenantsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); @@ -150,7 +149,6 @@ export class SubscriptionClient extends coreClient.ServiceClient { ); } - operations: Operations; subscriptions: Subscriptions; tenants: Tenants; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/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/resources-subscriptions/arm-resources-subscriptions/tsconfig.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json index 32cefcc4d696..615e06592f2b 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json @@ -15,17 +15,18 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resources-subscriptions": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts" ], "exclude": [ "node_modules"