diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 24a2fa3fb65e..9a44afcc237a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13276,7 +13276,7 @@ packages: dev: false file:projects/arm-changes.tgz: - resolution: {integrity: sha512-xAHnPXuiOMEaEA93S1o2AI4rbXcVhQWypOyC/AaWd/3XsE+lQ5P+eeI4xrhiEln0iDx5fvBo/Ta/SAk0vFCT6Q==, tarball: file:projects/arm-changes.tgz} + resolution: {integrity: sha512-3hSTYC8nJ2C/avdyE81n6TIMk7vxWIBLBMH1ugzDdQidjTQ/88CGM7tKgkOTqs/zd/YWRAZb0LIjnq3kXD1fVA==, tarball: file:projects/arm-changes.tgz} name: '@rush-temp/arm-changes' version: 0.0.0 dependencies: @@ -13286,9 +13286,11 @@ packages: '@types/mocha': 10.0.10 '@types/node': 18.19.67 chai: 4.5.0 - mocha: 11.0.2 + dotenv: 16.4.7 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -14027,7 +14029,7 @@ packages: dev: false file:projects/arm-databoundaries.tgz: - resolution: {integrity: sha512-wLUftGbWKL+TPyHmCr3+R57RJnDnmMiq39F/5jj9LT6+nkZC5dQqzi/6xQMjel0eO5Hb/gpJPrS0Bh4cVIzodw==, tarball: file:projects/arm-databoundaries.tgz} + resolution: {integrity: sha512-PHBYljfQWTdrph/9//F4MuysABXbLDz7xMfUkwhEgfve0KvGvKzAK1sQOMa9l1rbFMtwS/4YwppgE6WOxbo/gg==, tarball: file:projects/arm-databoundaries.tgz} name: '@rush-temp/arm-databoundaries' version: 0.0.0 dependencies: @@ -14040,12 +14042,12 @@ packages: chai: 4.5.0 dotenv: 16.4.7 mkdirp: 3.0.1 - mocha: 11.0.2 + mocha: 10.8.2 rimraf: 5.0.10 - ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.5.4) + ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 tsx: 4.19.2 - typescript: 5.5.4 + typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -14946,7 +14948,7 @@ packages: dev: false file:projects/arm-features.tgz: - resolution: {integrity: sha512-soUDcRTTSIxaFoxhHY+Br3eQbDoC32FoD0tRWcp4iEtMPx8xg1SR0WzTrUQjBrcA6T0hcUD/xifLdRI/f6PGrg==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-KnlzSaPbNVySEVau5Sguzbgpec3BZS5HYZ7SPnkFttn65TrqaWAkTZA00wZtrx+cMY8SDEOPg2g5aHxDx4hgeg==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' version: 0.0.0 dependencies: @@ -14956,9 +14958,11 @@ packages: '@types/mocha': 10.0.10 '@types/node': 18.19.67 chai: 4.5.0 - mocha: 11.0.2 + dotenv: 16.4.7 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -15686,7 +15690,7 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-yy09FGeGBBKCMifaMklQr1ATSTBohwxDvzgkQTBHYN6d8gwL8xNoqs/XMoe7MgWmqCsM4HI144RdiV5fOd2Z8g==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-91kpyJpDt688iXdc998jCUgttsSXFwIjFcHjnpHo8EhPp80QubCC/gZMs0uckt/ToTZc6EUAGJkGAQ7UV7XwTA==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: @@ -15696,9 +15700,11 @@ packages: '@types/mocha': 10.0.10 '@types/node': 18.19.67 chai: 4.5.0 - mocha: 11.0.2 + dotenv: 16.4.7 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -15752,7 +15758,7 @@ packages: dev: false file:projects/arm-locks.tgz: - resolution: {integrity: sha512-GMn+Vj8HH/zCkhGM4WCxx5haz4uaIIhdfZOL6d/+UKDKLLa14FczlyPmr3YGp/j8UZwoYh4kpDW89NX1lgpcHQ==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-ni9eaSkqLLMbsovNk1MI0sOkNEMU5LQBrzzmTJQ8wCKeKNkc+s1YgULrWY8FjP1dotTcK1kxF6jRKmk8cFZgew==, tarball: file:projects/arm-locks.tgz} name: '@rush-temp/arm-locks' version: 0.0.0 dependencies: @@ -15762,9 +15768,11 @@ packages: '@types/mocha': 10.0.10 '@types/node': 18.19.67 chai: 4.5.0 - mocha: 11.0.2 + dotenv: 16.4.7 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -15889,7 +15897,7 @@ packages: dev: false file:projects/arm-managedapplications.tgz: - resolution: {integrity: sha512-DZ0QO9C7MJ9Ipe6oFSaCVWZfdsrAmpgjxetJckZAG7M2TE0ybKAIhz3toZd+RMI1Dz+sU7tzF4/fRMtRiZLL+Q==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-Y97txYCZToFruGOd6Puy/6Ubmn9Rv1SbIQ8b7RdAE26VqOPgaE3gQSsobhXig1+5neyG5OHi92bl2t4K0ZZA/Q==, tarball: file:projects/arm-managedapplications.tgz} name: '@rush-temp/arm-managedapplications' version: 0.0.0 dependencies: @@ -15902,9 +15910,10 @@ packages: '@types/node': 18.19.67 chai: 4.5.0 dotenv: 16.4.7 - mocha: 11.0.2 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -16825,7 +16834,7 @@ packages: dev: false file:projects/arm-policy.tgz: - resolution: {integrity: sha512-dnzae8wqMqBt9Noeke9GV/ZjFShAipdbFxvf/B77e498QBKvVhc77W0dPEJ71gvpn6hXrtJRaKfuuUijU7kXbA==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-On3nZscNhuTtC0n6uPYcCXSfiC+ZH1GN2aw2IGYILVcasYVCdFi6WSLWXbsA+JN9QCkuL56Qh8XPAZraeRVu/Q==, tarball: file:projects/arm-policy.tgz} name: '@rush-temp/arm-policy' version: 0.0.0 dependencies: @@ -16836,9 +16845,10 @@ packages: '@types/node': 18.19.67 chai: 4.5.0 dotenv: 16.4.7 - mocha: 11.0.2 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -17442,7 +17452,7 @@ packages: dev: false file:projects/arm-resources-subscriptions.tgz: - resolution: {integrity: sha512-eOV6/AQ6x+Duu7SU0VYAgE293uri9RmSKCQW0t6+ND0bQe+0hkhyKhqpYvYcA51K1t8F0RwHpe5L+a3MX0BQug==, tarball: file:projects/arm-resources-subscriptions.tgz} + resolution: {integrity: sha512-08PIgQoQH4C555L9/SxKEztDE26J009KsxvR7g7G46UnAZI8FjbEpMasNVB+0kkF1I3Z2LuI/ufKZgdCgQgPOA==, tarball: file:projects/arm-resources-subscriptions.tgz} name: '@rush-temp/arm-resources-subscriptions' version: 0.0.0 dependencies: @@ -17453,9 +17463,10 @@ packages: '@types/node': 18.19.67 chai: 4.5.0 dotenv: 16.4.7 - mocha: 11.0.2 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -17464,7 +17475,7 @@ packages: dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-Z5o8wSKtwptEh6C9wnr2XfNKWE9TVUqbbtrUzET8J9ZbA7hIdfGehg7oA/zobUBy6BTORv+AvxcWwMb3T4otUA==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-pTlmBlhmkhj7zshzjhd5o9NqWuUYCvaZzV26t5SdrkmvRx/L+srzzXNgQFpKJ8iG8ftHpFT8c8RYFwz5ezzWLw==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: @@ -17477,9 +17488,10 @@ packages: '@types/node': 18.19.67 chai: 4.5.0 dotenv: 16.4.7 - mocha: 11.0.2 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -17488,7 +17500,7 @@ packages: dev: false file:projects/arm-resourcesdeploymentstacks.tgz: - resolution: {integrity: sha512-Z1tI4du1XM08k7N4w6B6lZfV2OUZRU/vRihoSoA8UtjwsAhrJUr/eEg7zoTqJROk/UsTV543WKudEs+E9Uybuw==, tarball: file:projects/arm-resourcesdeploymentstacks.tgz} + resolution: {integrity: sha512-x06oHvf1A5sJFyp8XDlsvLSq3q+EJEwTj4X12Swr5W78R8OTPAF+DDJOy4Jbqd1GIV8mQvD7heb+AopiMuAXaA==, tarball: file:projects/arm-resourcesdeploymentstacks.tgz} name: '@rush-temp/arm-resourcesdeploymentstacks' version: 0.0.0 dependencies: @@ -17501,7 +17513,7 @@ packages: '@types/node': 18.19.67 chai: 4.5.0 dotenv: 16.4.7 - mocha: 11.0.2 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 tsx: 4.19.2 @@ -18372,7 +18384,7 @@ packages: dev: false file:projects/arm-templatespecs.tgz: - resolution: {integrity: sha512-a9Z7C23xpdyQKGO5lC1Cq8z+jysc7Fz3aDnO/hqYfiWKKzk+SEJxyGTj/A+LKV1GF0ef+X3n/gZ/XpQBXadz1A==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-jjPkJBN0wa50T8WcgEdGscJ1ZUM5/ZwLkYQP5FBroRLMdV1HlMU6L7sTPKaaFsY9DXu8BWN2tFPK1oGvAyyGrA==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' version: 0.0.0 dependencies: @@ -18382,9 +18394,11 @@ packages: '@types/mocha': 10.0.10 '@types/node': 18.19.67 chai: 4.5.0 - mocha: 11.0.2 + dotenv: 16.4.7 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -19748,7 +19762,7 @@ packages: dev: false file:projects/core-sse.tgz: - resolution: {integrity: sha512-rxq/J1ftJ2e0MkPDv49RFsVQcu/68yCe6/h0R6+SdIkKBnhbYY12SkHzwOEOLFtemwLv+mh2SAqE6KHTYwJ8Lg==, tarball: file:projects/core-sse.tgz} + resolution: {integrity: sha512-mJ6yU1aJSHYVmT31VIT4SQSNzaMvqNi0IAWz+DHH2XZj+GTcVazXvt3x02xgQMraoXRuBuaEBiW5RfwqK99Jiw==, tarball: file:projects/core-sse.tgz} name: '@rush-temp/core-sse' version: 0.0.0 dependencies: diff --git a/sdk/changes/arm-changes/CHANGELOG.md b/sdk/changes/arm-changes/CHANGELOG.md index 60ff25a11e58..4b117f524e46 100644 --- a/sdk/changes/arm-changes/CHANGELOG.md +++ b/sdk/changes/arm-changes/CHANGELOG.md @@ -1,15 +1,13 @@ # Release History - -## 1.1.1 (Unreleased) - -### Features Added - + +## 2.0.0 (2024-12-10) + ### Breaking Changes -### Bugs Fixed - -### Other Changes - + - Interface ChangesListNextOptionalParams no longer has parameter skipToken + - Interface ChangesListNextOptionalParams no longer has parameter top + + ## 1.1.0 (2022-11-17) ### Features Added @@ -19,4 +17,4 @@ ## 1.0.0 (2022-05-09) -The package of @azure/arm-changes is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-changes is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/changes/arm-changes/LICENSE b/sdk/changes/arm-changes/LICENSE index 5d1d36e0af80..7d5934740965 100644 --- a/sdk/changes/arm-changes/LICENSE +++ b/sdk/changes/arm-changes/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2024 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/changes/arm-changes/README.md b/sdk/changes/arm-changes/README.md index ef9e1c82b8af..51e5fcf4e4d1 100644 --- a/sdk/changes/arm-changes/README.md +++ b/sdk/changes/arm-changes/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Changes** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/changes/arm-changes/_meta.json b/sdk/changes/arm-changes/_meta.json index 1bf4df740730..267db4618701 100644 --- a/sdk/changes/arm-changes/_meta.json +++ b/sdk/changes/arm-changes/_meta.json @@ -1,8 +1,8 @@ { - "commit": "20df2424a278ca19437e437a7dbf3a7857a0dd9d", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", "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", + "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.12", "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" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/changes/arm-changes/package.json b/sdk/changes/arm-changes/package.json index 0d3b54544581..c9c3b4fae6c0 100644 --- a/sdk/changes/arm-changes/package.json +++ b/sdk/changes/arm-changes/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ChangesClient.", - "version": "1.1.1", + "version": "2.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.6.1", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -26,19 +26,20 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-changes.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/changes/arm-changes", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -65,28 +66,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -99,12 +100,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-changes?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/changes/arm-changes" +} \ No newline at end of file diff --git a/sdk/changes/arm-changes/review/arm-changes.api.md b/sdk/changes/arm-changes/review/arm-changes.api.md index d28e3c8b3d3c..7f23d1894d55 100644 --- a/sdk/changes/arm-changes/review/arm-changes.api.md +++ b/sdk/changes/arm-changes/review/arm-changes.api.md @@ -85,8 +85,6 @@ export type ChangesGetResponse = ChangeResourceResult; // @public export interface ChangesListNextOptionalParams extends coreClient.OperationOptions { - skipToken?: string; - top?: number; } // @public diff --git a/sdk/changes/arm-changes/sample.env b/sdk/changes/arm-changes/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/changes/arm-changes/sample.env +++ b/sdk/changes/arm-changes/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/changes/arm-changes/src/changesClient.ts b/sdk/changes/arm-changes/src/changesClient.ts index 446f9a2b2c66..8f1fb8337fe6 100644 --- a/sdk/changes/arm-changes/src/changesClient.ts +++ b/sdk/changes/arm-changes/src/changesClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { ChangesImpl } from "./operations"; @@ -33,7 +33,7 @@ export class ChangesClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ChangesClientOptionalParams + options?: ChangesClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -48,10 +48,10 @@ export class ChangesClient extends coreClient.ServiceClient { } const defaults: ChangesClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-changes/1.1.1`; + const packageDetails = `azsdk-js-arm-changes/2.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -61,20 +61,21 @@ export class ChangesClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -84,7 +85,7 @@ export class ChangesClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -94,9 +95,9 @@ export class ChangesClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -118,7 +119,7 @@ export class ChangesClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -132,7 +133,7 @@ export class ChangesClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/changes/arm-changes/src/models/index.ts b/sdk/changes/arm-changes/src/models/index.ts index ad228aaa3b0b..ee8b8a223556 100644 --- a/sdk/changes/arm-changes/src/models/index.ts +++ b/sdk/changes/arm-changes/src/models/index.ts @@ -192,12 +192,7 @@ export type ChangesGetResponse = ChangeResourceResult; /** Optional parameters. */ export interface ChangesListNextOptionalParams - extends coreClient.OperationOptions { - /** (Optional) Set the maximum number of results per response. */ - top?: number; - /** (Optional) The page-continuation token */ - skipToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ChangesListNextResponse = ChangeResourceListResult; diff --git a/sdk/changes/arm-changes/src/models/mappers.ts b/sdk/changes/arm-changes/src/models/mappers.ts index 440d71224353..576f47c739df 100644 --- a/sdk/changes/arm-changes/src/models/mappers.ts +++ b/sdk/changes/arm-changes/src/models/mappers.ts @@ -16,8 +16,8 @@ export const ChangeResourceListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -26,13 +26,13 @@ export const ChangeResourceListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ChangeResourceResult" - } - } - } - } - } - } + className: "ChangeResourceResult", + }, + }, + }, + }, + }, + }, }; export const ChangeProperties: coreClient.CompositeMapper = { @@ -44,40 +44,40 @@ export const ChangeProperties: coreClient.CompositeMapper = { serializedName: "targetResourceId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, targetResourceType: { serializedName: "targetResourceType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, changeType: { serializedName: "changeType", readOnly: true, type: { name: "Enum", - allowedValues: ["Update", "Delete", "Create"] - } + allowedValues: ["Update", "Delete", "Create"], + }, }, changeAttributes: { serializedName: "changeAttributes", type: { name: "Composite", - className: "ChangeAttributes" - } + className: "ChangeAttributes", + }, }, changes: { serializedName: "changes", type: { name: "Dictionary", - value: { type: { name: "Composite", className: "ChangeBase" } } - } - } - } - } + value: { type: { name: "Composite", className: "ChangeBase" } }, + }, + }, + }, + }, }; export const ChangeAttributes: coreClient.CompositeMapper = { @@ -89,39 +89,39 @@ export const ChangeAttributes: coreClient.CompositeMapper = { serializedName: "correlationId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, timestamp: { serializedName: "timestamp", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, changesCount: { serializedName: "changesCount", readOnly: true, type: { - name: "Number" - } + name: "Number", + }, }, previousResourceSnapshotId: { serializedName: "previousResourceSnapshotId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, newResourceSnapshotId: { serializedName: "newResourceSnapshotId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ChangeBase: coreClient.CompositeMapper = { @@ -134,33 +134,33 @@ export const ChangeBase: coreClient.CompositeMapper = { readOnly: true, type: { name: "Enum", - allowedValues: ["Update", "Insert", "Remove"] - } + allowedValues: ["Update", "Insert", "Remove"], + }, }, changeCategory: { serializedName: "changeCategory", readOnly: true, type: { name: "Enum", - allowedValues: ["User", "System"] - } + allowedValues: ["User", "System"], + }, }, previousValue: { serializedName: "previousValue", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, newValue: { serializedName: "newValue", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -172,25 +172,25 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -202,11 +202,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -218,22 +218,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -243,10 +243,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -256,13 +256,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -274,19 +274,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const ChangeResourceResult: coreClient.CompositeMapper = { @@ -299,9 +299,9 @@ export const ChangeResourceResult: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "ChangeProperties" - } - } - } - } + className: "ChangeProperties", + }, + }, + }, + }, }; diff --git a/sdk/changes/arm-changes/src/models/parameters.ts b/sdk/changes/arm-changes/src/models/parameters.ts index 8d270640fffc..993d6cabbfeb 100644 --- a/sdk/changes/arm-changes/src/models/parameters.ts +++ b/sdk/changes/arm-changes/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; export const accept: OperationParameter = { @@ -19,9 +19,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -30,10 +30,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -42,9 +42,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -53,9 +53,9 @@ export const resourceGroupName: OperationURLParameter = { serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -64,9 +64,9 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceType: OperationURLParameter = { @@ -75,9 +75,9 @@ export const resourceType: OperationURLParameter = { serializedName: "resourceType", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceName: OperationURLParameter = { @@ -86,9 +86,9 @@ export const resourceName: OperationURLParameter = { serializedName: "resourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const apiVersion: OperationQueryParameter = { @@ -98,9 +98,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const top: OperationQueryParameter = { @@ -109,13 +109,13 @@ export const top: OperationQueryParameter = { defaultValue: 100, constraints: { InclusiveMaximum: 100, - InclusiveMinimum: 1 + InclusiveMinimum: 1, }, serializedName: "$top", type: { - name: "Number" - } - } + name: "Number", + }, + }, }; export const skipToken: OperationQueryParameter = { @@ -123,9 +123,9 @@ export const skipToken: OperationQueryParameter = { mapper: { serializedName: "$skipToken", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const changeResourceId: OperationURLParameter = { @@ -134,9 +134,9 @@ export const changeResourceId: OperationURLParameter = { serializedName: "changeResourceId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -145,8 +145,8 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; diff --git a/sdk/changes/arm-changes/src/operations/changes.ts b/sdk/changes/arm-changes/src/operations/changes.ts index 7c5e470c5ae0..d3dd32c9fbd6 100644 --- a/sdk/changes/arm-changes/src/operations/changes.ts +++ b/sdk/changes/arm-changes/src/operations/changes.ts @@ -20,7 +20,7 @@ import { ChangesListResponse, ChangesGetOptionalParams, ChangesGetResponse, - ChangesListNextResponse + ChangesListNextResponse, } from "../models"; /// @@ -49,14 +49,14 @@ export class ChangesImpl implements Changes { resourceProviderNamespace: string, resourceType: string, resourceName: string, - options?: ChangesListOptionalParams + options?: ChangesListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll( resourceGroupName, resourceProviderNamespace, resourceType, resourceName, - options + options, ); return { next() { @@ -75,9 +75,9 @@ export class ChangesImpl implements Changes { resourceType, resourceName, options, - settings + settings, ); - } + }, }; } @@ -87,7 +87,7 @@ export class ChangesImpl implements Changes { resourceType: string, resourceName: string, options?: ChangesListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ChangesListResponse; let continuationToken = settings?.continuationToken; @@ -97,7 +97,7 @@ export class ChangesImpl implements Changes { resourceProviderNamespace, resourceType, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -111,7 +111,7 @@ export class ChangesImpl implements Changes { resourceType, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -125,14 +125,14 @@ export class ChangesImpl implements Changes { resourceProviderNamespace: string, resourceType: string, resourceName: string, - options?: ChangesListOptionalParams + options?: ChangesListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, resourceProviderNamespace, resourceType, resourceName, - options + options, )) { yield* page; } @@ -151,7 +151,7 @@ export class ChangesImpl implements Changes { resourceProviderNamespace: string, resourceType: string, resourceName: string, - options?: ChangesListOptionalParams + options?: ChangesListOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -159,9 +159,9 @@ export class ChangesImpl implements Changes { resourceProviderNamespace, resourceType, resourceName, - options + options, }, - listOperationSpec + listOperationSpec, ); } @@ -180,7 +180,7 @@ export class ChangesImpl implements Changes { resourceType: string, resourceName: string, changeResourceId: string, - options?: ChangesGetOptionalParams + options?: ChangesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -189,9 +189,9 @@ export class ChangesImpl implements Changes { resourceType, resourceName, changeResourceId, - options + options, }, - getOperationSpec + getOperationSpec, ); } @@ -210,7 +210,7 @@ export class ChangesImpl implements Changes { resourceType: string, resourceName: string, nextLink: string, - options?: ChangesListNextOptionalParams + options?: ChangesListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -219,9 +219,9 @@ export class ChangesImpl implements Changes { resourceType, resourceName, nextLink, - options + options, }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -229,21 +229,20 @@ export class ChangesImpl implements Changes { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ChangeResourceListResult + bodyMapper: Mappers.ChangeResourceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [ Parameters.apiVersion, Parameters.top, - Parameters.skipToken + Parameters.skipToken, ], urlParameters: [ Parameters.$host, @@ -251,22 +250,21 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes/{changeResourceId}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes/{changeResourceId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ChangeResourceResult + bodyMapper: Mappers.ChangeResourceResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -276,27 +274,22 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.resourceType, Parameters.resourceName, - Parameters.changeResourceId + Parameters.changeResourceId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ChangeResourceListResult + bodyMapper: Mappers.ChangeResourceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.top, - Parameters.skipToken - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -304,8 +297,8 @@ const listNextOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.resourceType, Parameters.resourceName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts b/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts index b873985b4b21..d862c902ff43 100644 --- a/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts +++ b/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts @@ -11,7 +11,7 @@ import { ChangeResourceResult, ChangesListOptionalParams, ChangesGetOptionalParams, - ChangesGetResponse + ChangesGetResponse, } from "../models"; /// @@ -30,7 +30,7 @@ export interface Changes { resourceProviderNamespace: string, resourceType: string, resourceName: string, - options?: ChangesListOptionalParams + options?: ChangesListOptionalParams, ): PagedAsyncIterableIterator; /** * Obtains the specified change resource for the target resource @@ -47,6 +47,6 @@ export interface Changes { resourceType: string, resourceName: string, changeResourceId: string, - options?: ChangesGetOptionalParams + options?: ChangesGetOptionalParams, ): Promise; } diff --git a/sdk/changes/arm-changes/src/pagingHelper.ts b/sdk/changes/arm-changes/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 100644 --- a/sdk/changes/arm-changes/src/pagingHelper.ts +++ b/sdk/changes/arm-changes/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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/changes/arm-changes/test/sampleTest.ts b/sdk/changes/arm-changes/test/sampleTest.ts index 8ff7deb0acbe..d64be981b694 100644 --- a/sdk/changes/arm-changes/test/sampleTest.ts +++ b/sdk/changes/arm-changes/test/sampleTest.ts @@ -9,7 +9,7 @@ import { Recorder, RecorderStartOptions, - env + env, } from "@azure-tools/test-recorder"; import { assert } from "chai"; import { Context } from "mocha"; @@ -18,15 +18,11 @@ 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" + SUBSCRIPTION_ID: "azure_subscription_id", }; const recorderOptions: RecorderStartOptions = { envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], }; describe("My test", () => { diff --git a/sdk/changes/arm-changes/tsconfig.json b/sdk/changes/arm-changes/tsconfig.json index 017e8571316c..6850f7a0b342 100644 --- a/sdk/changes/arm-changes/tsconfig.json +++ b/sdk/changes/arm-changes/tsconfig.json @@ -15,17 +15,19 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-changes": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/databoundaries/arm-databoundaries/CHANGELOG.md b/sdk/databoundaries/arm-databoundaries/CHANGELOG.md index 3dc43897b64a..05d6440d3e4b 100644 --- a/sdk/databoundaries/arm-databoundaries/CHANGELOG.md +++ b/sdk/databoundaries/arm-databoundaries/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 1.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2024-10-25) + +## 1.0.0 (2024-12-10) ### Features Added diff --git a/sdk/databoundaries/arm-databoundaries/README.md b/sdk/databoundaries/arm-databoundaries/README.md index a6bcdb00a61f..6dae8c9f6bf1 100644 --- a/sdk/databoundaries/arm-databoundaries/README.md +++ b/sdk/databoundaries/arm-databoundaries/README.md @@ -6,7 +6,7 @@ Provides APIs for data boundary operations. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-databoundaries) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure DataboundariesManegement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -53,14 +52,15 @@ const { DataboundariesManegementClient } = require("@azure/arm-databoundaries"); 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 client = new DataboundariesManegementClient(new DefaultAzureCredential()); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new DataboundariesManegementClient(new DefaultAzureCredential(), subscriptionId); // For client-side applications running in the browser, use this code instead: // const credential = new InteractiveBrowserCredential({ // tenantId: "", // clientId: "" // }); -// const client = new DataboundariesManegementClient(credential); +// const client = new DataboundariesManegementClient(credential, subscriptionId); ``` diff --git a/sdk/databoundaries/arm-databoundaries/_meta.json b/sdk/databoundaries/arm-databoundaries/_meta.json index c6304d2b7664..267db4618701 100644 --- a/sdk/databoundaries/arm-databoundaries/_meta.json +++ b/sdk/databoundaries/arm-databoundaries/_meta.json @@ -1,8 +1,8 @@ { - "commit": "bc3aa2bbc4494553649019585c3bc8a4229a25d0", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.27 --generate-sample=true", + "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.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.15", - "use": "@autorest/typescript@6.0.27" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/databoundaries/arm-databoundaries/package.json b/sdk/databoundaries/arm-databoundaries/package.json index 7b01664c0ae0..fee6d8911cbc 100644 --- a/sdk/databoundaries/arm-databoundaries/package.json +++ b/sdk/databoundaries/arm-databoundaries/package.json @@ -3,11 +3,12 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataboundariesManegementClient.", - "version": "1.0.0-beta.2", + "version": "1.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { + "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.6.0", "@azure/core-rest-pipeline": "^1.14.0", @@ -25,16 +26,13 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-databoundaries.d.ts", "devDependencies": { - "@microsoft/api-extractor": "^7.31.1", - "mkdirp": "^3.0.1", - "typescript": "~5.5.3", - "rimraf": "^5.0.0", + "typescript": "~5.6.2", "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", "@azure/identity": "^4.2.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.1.0", - "mocha": "^11.0.2", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", "tsx": "^4.7.1", "@types/chai": "^4.2.8", @@ -67,13 +65,13 @@ "types/*" ], "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && mkdirp ./review && npm run extract-api", + "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "prepack": "npm run build", "pack": "npm pack 2>&1", "extract-api": "dev-tool run extract-api", "lint": "echo skipped", - "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "dev-tool run vendored 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", @@ -89,7 +87,8 @@ "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "integration-test:browser": "echo skipped" + "integration-test:browser": "echo skipped", + "update-snippets": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -101,13 +100,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries" +} \ No newline at end of file diff --git a/sdk/databoundaries/arm-databoundaries/review/arm-databoundaries.api.md b/sdk/databoundaries/arm-databoundaries/review/arm-databoundaries.api.md index d23a5c8294e3..1e0090389a26 100644 --- a/sdk/databoundaries/arm-databoundaries/review/arm-databoundaries.api.md +++ b/sdk/databoundaries/arm-databoundaries/review/arm-databoundaries.api.md @@ -6,6 +6,10 @@ 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 type CreatedByType = string; @@ -40,6 +44,8 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { apiVersion: string; // (undocumented) dataBoundaries: DataBoundaries; + // (undocumented) + operations: Operations; } // @public @@ -93,6 +99,14 @@ export interface ErrorResponse { error?: ErrorDetail; } +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export enum KnownActionType { + Internal = "Internal" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -113,6 +127,13 @@ export enum KnownDefaultName { Default = "default" } +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + // @public export enum KnownProvisioningState { Accepted = "Accepted", @@ -124,6 +145,51 @@ export enum KnownProvisioningState { Updating = "Updating" } +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @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 { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + // @public export type ProvisioningState = string; diff --git a/sdk/databoundaries/arm-databoundaries/sample.env b/sdk/databoundaries/arm-databoundaries/sample.env index efbc7787bd3b..508439fc7d62 100644 --- a/sdk/databoundaries/arm-databoundaries/sample.env +++ b/sdk/databoundaries/arm-databoundaries/sample.env @@ -1 +1 @@ -# Feel free to add your own environment variables. +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts b/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts index 2a052d25d938..5547eb8dfb8f 100644 --- a/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts +++ b/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts @@ -14,8 +14,8 @@ import { SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { DataBoundariesImpl } from "./operations"; -import { DataBoundaries } from "./operationsInterfaces"; +import { OperationsImpl, DataBoundariesImpl } from "./operations"; +import { Operations, DataBoundaries } from "./operationsInterfaces"; import { DataboundariesManegementClientOptionalParams } from "./models"; export class DataboundariesManegementClient extends coreClient.ServiceClient { @@ -44,7 +44,7 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-databoundaries/1.0.0-beta.2`; + const packageDetails = `azsdk-js-arm-databoundaries/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -97,6 +97,7 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; this.apiVersion = options.apiVersion || "2024-08-01"; + this.operations = new OperationsImpl(this); this.dataBoundaries = new DataBoundariesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -129,5 +130,6 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { this.pipeline.addPolicy(apiVersionPolicy); } + operations: Operations; dataBoundaries: DataBoundaries; } diff --git a/sdk/databoundaries/arm-databoundaries/src/index.ts b/sdk/databoundaries/arm-databoundaries/src/index.ts index 024565c271d8..d5a06a7fd8a9 100644 --- a/sdk/databoundaries/arm-databoundaries/src/index.ts +++ b/sdk/databoundaries/arm-databoundaries/src/index.ts @@ -6,6 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +/// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { DataboundariesManegementClient } from "./databoundariesManegementClient"; export * from "./operationsInterfaces"; diff --git a/sdk/databoundaries/arm-databoundaries/src/models/index.ts b/sdk/databoundaries/arm-databoundaries/src/models/index.ts index f2a0c67411cb..3fc9c81e5dc1 100644 --- a/sdk/databoundaries/arm-databoundaries/src/models/index.ts +++ b/sdk/databoundaries/arm-databoundaries/src/models/index.ts @@ -8,55 +8,68 @@ import * as coreClient from "@azure/core-client"; -/** Data boundary properties */ -export interface DataBoundaryProperties { - /** The data boundary definition. */ - dataBoundary?: DataBoundary; +/** 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 { /** - * Denotes the state of provisioning. + * List of operations supported by the resource provider * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: ProvisioningState; + 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; } -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * 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 id?: string; + readonly name?: string; /** - * The name of the resource + * 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 name?: string; + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * 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 type?: string; + readonly origin?: Origin; /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * 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 systemData?: SystemData; + readonly actionType?: ActionType; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; +/** 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; } /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ @@ -108,6 +121,57 @@ export interface ErrorAdditionalInfo { readonly info?: Record; } +/** Data boundary properties */ +export interface DataBoundaryProperties { + /** The data boundary definition. */ + dataBoundary?: DataBoundary; + /** + * Denotes the state of provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} @@ -117,6 +181,42 @@ export interface DataBoundaryDefinition extends ProxyResource { properties?: DataBoundaryProperties; } +/** 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 DefaultName} that the service accepts. */ export enum KnownDefaultName { /** Default */ @@ -210,6 +310,20 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** 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 DataBoundariesPutOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/databoundaries/arm-databoundaries/src/models/mappers.ts b/sdk/databoundaries/arm-databoundaries/src/models/mappers.ts index 9c5363c70d88..c3737b18b0c7 100644 --- a/sdk/databoundaries/arm-databoundaries/src/models/mappers.ts +++ b/sdk/databoundaries/arm-databoundaries/src/models/mappers.ts @@ -8,19 +8,26 @@ import * as coreClient from "@azure/core-client"; -export const DataBoundaryProperties: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataBoundaryProperties", + className: "OperationListResult", modelProperties: { - dataBoundary: { - serializedName: "dataBoundary", + value: { + serializedName: "value", + readOnly: true, type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation", + }, + }, }, }, - provisioningState: { - serializedName: "provisioningState", + nextLink: { + serializedName: "nextLink", readOnly: true, type: { name: "String", @@ -30,84 +37,83 @@ export const DataBoundaryProperties: coreClient.CompositeMapper = { }, }; -export const Resource: coreClient.CompositeMapper = { +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "Operation", modelProperties: { - id: { - serializedName: "id", + name: { + serializedName: "name", readOnly: true, type: { name: "String", }, }, - name: { - serializedName: "name", + isDataAction: { + serializedName: "isDataAction", readOnly: true, type: { - name: "String", + name: "Boolean", }, }, - type: { - serializedName: "type", + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay", + }, + }, + origin: { + serializedName: "origin", readOnly: true, type: { name: "String", }, }, - systemData: { - serializedName: "systemData", + actionType: { + serializedName: "actionType", + readOnly: true, type: { - name: "Composite", - className: "SystemData", + name: "String", }, }, }, }, }; -export const SystemData: coreClient.CompositeMapper = { +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "OperationDisplay", modelProperties: { - createdBy: { - serializedName: "createdBy", + provider: { + serializedName: "provider", + readOnly: true, type: { name: "String", }, }, - createdByType: { - serializedName: "createdByType", + resource: { + serializedName: "resource", + readOnly: true, type: { name: "String", }, }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime", - }, - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + operation: { + serializedName: "operation", + readOnly: true, type: { name: "String", }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + description: { + serializedName: "description", + readOnly: true, type: { name: "String", }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime", - }, - }, }, }, }; @@ -208,6 +214,110 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { }, }; +export const DataBoundaryProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataBoundaryProperties", + modelProperties: { + dataBoundary: { + serializedName: "dataBoundary", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/databoundaries/arm-databoundaries/src/models/parameters.ts b/sdk/databoundaries/arm-databoundaries/src/models/parameters.ts index 5eb93554b395..194bf1d5f44d 100644 --- a/sdk/databoundaries/arm-databoundaries/src/models/parameters.ts +++ b/sdk/databoundaries/arm-databoundaries/src/models/parameters.ts @@ -13,23 +13,6 @@ import { } from "@azure/core-client"; import { DataBoundaryDefinition as DataBoundaryDefinitionMapper } from "../models/mappers"; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const dataBoundaryDefinition: OperationParameter = { - parameterPath: "dataBoundaryDefinition", - mapper: DataBoundaryDefinitionMapper, -}; - export const accept: OperationParameter = { parameterPath: "accept", mapper: { @@ -66,6 +49,35 @@ export const apiVersion: OperationQueryParameter = { }, }; +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const dataBoundaryDefinition: OperationParameter = { + parameterPath: "dataBoundaryDefinition", + mapper: DataBoundaryDefinitionMapper, +}; + export const defaultParam: OperationURLParameter = { parameterPath: "defaultParam", mapper: { diff --git a/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts b/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts index a47a8729cdd3..c281b9a5af63 100644 --- a/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts +++ b/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts @@ -103,7 +103,7 @@ const putOperationSpec: coreClient.OperationSpec = { requestBody: Parameters.dataBoundaryDefinition, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.defaultParam], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; diff --git a/sdk/databoundaries/arm-databoundaries/src/operations/index.ts b/sdk/databoundaries/arm-databoundaries/src/operations/index.ts index 70eb1ee0f14f..9cb82d3966d7 100644 --- a/sdk/databoundaries/arm-databoundaries/src/operations/index.ts +++ b/sdk/databoundaries/arm-databoundaries/src/operations/index.ts @@ -6,4 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./operations"; export * from "./dataBoundaries"; diff --git a/sdk/databoundaries/arm-databoundaries/src/operations/operations.ts b/sdk/databoundaries/arm-databoundaries/src/operations/operations.ts new file mode 100644 index 000000000000..1578674e22d6 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/operations/operations.ts @@ -0,0 +1,149 @@ +/* + * 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 { DataboundariesManegementClient } from "../databoundariesManegementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse, +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: DataboundariesManegementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: DataboundariesManegementClient) { + 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.ErrorResponse, + }, + }, + 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.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/index.ts b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/index.ts index 70eb1ee0f14f..9cb82d3966d7 100644 --- a/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/index.ts +++ b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/index.ts @@ -6,4 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./operations"; export * from "./dataBoundaries"; diff --git a/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/operations.ts b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..65cdf8035ab0 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * 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/databoundaries/arm-databoundaries/src/pagingHelper.ts b/sdk/databoundaries/arm-databoundaries/src/pagingHelper.ts new file mode 100644 index 000000000000..205cccc26592 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * 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 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) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined, +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/databoundaries/arm-databoundaries/test/sampleTest.ts b/sdk/databoundaries/arm-databoundaries/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/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/databoundaries/arm-databoundaries/tsconfig.json b/sdk/databoundaries/arm-databoundaries/tsconfig.json index 701c0e733749..7fb199d28afa 100644 --- a/sdk/databoundaries/arm-databoundaries/tsconfig.json +++ b/sdk/databoundaries/arm-databoundaries/tsconfig.json @@ -15,17 +15,21 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-databoundaries": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/features/arm-features/CHANGELOG.md b/sdk/features/arm-features/CHANGELOG.md index ed01550a1e65..3dd85a56e421 100644 --- a/sdk/features/arm-features/CHANGELOG.md +++ b/sdk/features/arm-features/CHANGELOG.md @@ -1,15 +1,12 @@ # Release History - -## 3.1.1 (Unreleased) - -### Features Added - + +## 4.0.0 (2024-12-10) + ### Breaking Changes -### Bugs Fixed - -### Other Changes - + - Class FeatureClient has a new signature + + ## 3.1.0 (2022-11-22) ### Features Added @@ -18,7 +15,7 @@ ## 3.0.1 (2022-04-18) -### Features Added +**features** - Bug fix @@ -30,4 +27,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/features/arm-features/LICENSE b/sdk/features/arm-features/LICENSE index 5d1d36e0af80..7d5934740965 100644 --- a/sdk/features/arm-features/LICENSE +++ b/sdk/features/arm-features/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2024 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/features/arm-features/README.md b/sdk/features/arm-features/README.md index cedaa2c4a474..5642561188d4 100644 --- a/sdk/features/arm-features/README.md +++ b/sdk/features/arm-features/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Feature** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/features/arm-features/_meta.json b/sdk/features/arm-features/_meta.json index 4b98b8203a1f..267db4618701 100644 --- a/sdk/features/arm-features/_meta.json +++ b/sdk/features/arm-features/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "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", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/features/arm-features/package.json b/sdk/features/arm-features/package.json index fbc5ff19a90f..79844bcf4f69 100644 --- a/sdk/features/arm-features/package.json +++ b/sdk/features/arm-features/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for FeatureClient.", - "version": "3.1.1", + "version": "4.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.6.1", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -26,19 +26,20 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-features.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/features/arm-features", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -65,28 +66,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -99,12 +100,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-features?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/features/arm-features" +} \ No newline at end of file diff --git a/sdk/features/arm-features/review/arm-features.api.md b/sdk/features/arm-features/review/arm-features.api.md index 89f95f572452..b011cb9640a5 100644 --- a/sdk/features/arm-features/review/arm-features.api.md +++ b/sdk/features/arm-features/review/arm-features.api.md @@ -34,6 +34,7 @@ export class FeatureClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: FeatureClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: FeatureClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -42,7 +43,7 @@ export class FeatureClient extends coreClient.ServiceClient { // (undocumented) subscriptionFeatureRegistrations: SubscriptionFeatureRegistrations; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public diff --git a/sdk/features/arm-features/sample.env b/sdk/features/arm-features/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/features/arm-features/sample.env +++ b/sdk/features/arm-features/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/features/arm-features/src/featureClient.ts b/sdk/features/arm-features/src/featureClient.ts index 895c1fb0c8ef..290786081c17 100644 --- a/sdk/features/arm-features/src/featureClient.ts +++ b/sdk/features/arm-features/src/featureClient.ts @@ -11,18 +11,18 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "./pagingHelper"; import { FeaturesImpl, - SubscriptionFeatureRegistrationsImpl + SubscriptionFeatureRegistrationsImpl, } from "./operations"; import { Features, - SubscriptionFeatureRegistrations + SubscriptionFeatureRegistrations, } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; @@ -32,14 +32,14 @@ import { ListOperationsNextOptionalParams, ListOperationsOptionalParams, ListOperationsResponse, - ListOperationsNextResponse + ListOperationsNextResponse, } from "./models"; /// export class FeatureClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the FeatureClient class. @@ -50,13 +50,27 @@ export class FeatureClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: FeatureClientOptionalParams + options?: FeatureClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: FeatureClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: FeatureClientOptionalParams | string, + options?: FeatureClientOptionalParams, ) { 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 @@ -65,10 +79,10 @@ export class FeatureClient extends coreClient.ServiceClient { } const defaults: FeatureClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-features/3.1.1`; + const packageDetails = `azsdk-js-arm-features/4.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -78,20 +92,21 @@ export class FeatureClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -101,7 +116,7 @@ export class FeatureClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -111,9 +126,9 @@ export class FeatureClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -123,9 +138,8 @@ export class FeatureClient extends coreClient.ServiceClient { this.$host = options.$host || "https://management.azure.com"; this.apiVersion = options.apiVersion || "2021-07-01"; this.features = new FeaturesImpl(this); - this.subscriptionFeatureRegistrations = new SubscriptionFeatureRegistrationsImpl( - this - ); + this.subscriptionFeatureRegistrations = + new SubscriptionFeatureRegistrationsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -138,7 +152,7 @@ export class FeatureClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -152,7 +166,7 @@ export class FeatureClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -162,7 +176,7 @@ export class FeatureClient extends coreClient.ServiceClient { * @param options The options parameters. */ public listOperations( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listOperationsPagingAll(options); return { @@ -177,13 +191,13 @@ export class FeatureClient extends coreClient.ServiceClient { throw new Error("maxPageSize is not supported by this operation."); } return this.listOperationsPagingPage(options, settings); - } + }, }; } private async *listOperationsPagingPage( options?: ListOperationsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ListOperationsResponse; let continuationToken = settings?.continuationToken; @@ -204,7 +218,7 @@ export class FeatureClient extends coreClient.ServiceClient { } private async *listOperationsPagingAll( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listOperationsPagingPage(options)) { yield* page; @@ -216,7 +230,7 @@ export class FeatureClient extends coreClient.ServiceClient { * @param options The options parameters. */ private _listOperations( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): Promise { return this.sendOperationRequest({ options }, listOperationsOperationSpec); } @@ -228,11 +242,11 @@ export class FeatureClient extends coreClient.ServiceClient { */ private _listOperationsNext( nextLink: string, - options?: ListOperationsNextOptionalParams + options?: ListOperationsNextOptionalParams, ): Promise { return this.sendOperationRequest( { nextLink, options }, - listOperationsNextOperationSpec + listOperationsNextOperationSpec, ); } @@ -247,30 +261,29 @@ const listOperationsOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/features/arm-features/src/models/index.ts b/sdk/features/arm-features/src/models/index.ts index 860adc9f14fa..ffc973d8b47d 100644 --- a/sdk/features/arm-features/src/models/index.ts +++ b/sdk/features/arm-features/src/models/index.ts @@ -216,7 +216,7 @@ export enum KnownSubscriptionFeatureRegistrationState { /** Unregistering */ Unregistering = "Unregistering", /** Unregistered */ - Unregistered = "Unregistered" + Unregistered = "Unregistered", } /** @@ -241,7 +241,7 @@ export enum KnownSubscriptionFeatureRegistrationApprovalType { /** ApprovalRequired */ ApprovalRequired = "ApprovalRequired", /** AutoApproval */ - AutoApproval = "AutoApproval" + AutoApproval = "AutoApproval", } /** @@ -323,7 +323,8 @@ export interface SubscriptionFeatureRegistrationsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type SubscriptionFeatureRegistrationsGetResponse = SubscriptionFeatureRegistration; +export type SubscriptionFeatureRegistrationsGetResponse = + SubscriptionFeatureRegistration; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams @@ -333,7 +334,8 @@ export interface SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type SubscriptionFeatureRegistrationsCreateOrUpdateResponse = SubscriptionFeatureRegistration; +export type SubscriptionFeatureRegistrationsCreateOrUpdateResponse = + SubscriptionFeatureRegistration; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsDeleteOptionalParams @@ -344,28 +346,32 @@ export interface SubscriptionFeatureRegistrationsListBySubscriptionOptionalParam extends coreClient.OperationOptions {} /** Contains response data for the listBySubscription operation. */ -export type SubscriptionFeatureRegistrationsListBySubscriptionResponse = SubscriptionFeatureRegistrationList; +export type SubscriptionFeatureRegistrationsListBySubscriptionResponse = + SubscriptionFeatureRegistrationList; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAllBySubscription operation. */ -export type SubscriptionFeatureRegistrationsListAllBySubscriptionResponse = SubscriptionFeatureRegistrationList; +export type SubscriptionFeatureRegistrationsListAllBySubscriptionResponse = + SubscriptionFeatureRegistrationList; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ -export type SubscriptionFeatureRegistrationsListBySubscriptionNextResponse = SubscriptionFeatureRegistrationList; +export type SubscriptionFeatureRegistrationsListBySubscriptionNextResponse = + SubscriptionFeatureRegistrationList; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsListAllBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAllBySubscriptionNext operation. */ -export type SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse = SubscriptionFeatureRegistrationList; +export type SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse = + SubscriptionFeatureRegistrationList; /** Optional parameters. */ export interface FeatureClientOptionalParams diff --git a/sdk/features/arm-features/src/models/mappers.ts b/sdk/features/arm-features/src/models/mappers.ts index 3c1185f9501a..d94745c23183 100644 --- a/sdk/features/arm-features/src/models/mappers.ts +++ b/sdk/features/arm-features/src/models/mappers.ts @@ -20,19 +20,19 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -43,18 +43,18 @@ export const Operation: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - } - } - } + className: "OperationDisplay", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -65,23 +65,23 @@ export const OperationDisplay: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -93,11 +93,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDefinition" - } - } - } - } + className: "ErrorDefinition", + }, + }, + }, + }, }; export const ErrorDefinition: coreClient.CompositeMapper = { @@ -109,15 +109,15 @@ export const ErrorDefinition: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -126,13 +126,13 @@ export const ErrorDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDefinition" - } - } - } - } - } - } + className: "ErrorDefinition", + }, + }, + }, + }, + }, + }, }; export const FeatureOperationsListResult: coreClient.CompositeMapper = { @@ -147,19 +147,19 @@ export const FeatureOperationsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "FeatureResult" - } - } - } + className: "FeatureResult", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const FeatureResult: coreClient.CompositeMapper = { @@ -170,30 +170,30 @@ export const FeatureResult: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "FeatureProperties" - } + className: "FeatureProperties", + }, }, id: { serializedName: "id", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const FeatureProperties: coreClient.CompositeMapper = { @@ -204,123 +204,127 @@ export const FeatureProperties: coreClient.CompositeMapper = { state: { serializedName: "state", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const SubscriptionFeatureRegistrationProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubscriptionFeatureRegistrationProperties", - modelProperties: { - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String" - } - }, - subscriptionId: { - serializedName: "subscriptionId", - readOnly: true, - type: { - name: "String" - } - }, - featureName: { - serializedName: "featureName", - readOnly: true, - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - readOnly: true, - type: { - name: "String" - } - }, - providerNamespace: { - serializedName: "providerNamespace", - readOnly: true, - type: { - name: "String" - } - }, - state: { - serializedName: "state", - type: { - name: "String" - } - }, - authorizationProfile: { - serializedName: "authorizationProfile", - type: { - name: "Composite", - className: "AuthorizationProfile" - } - }, - metadata: { - serializedName: "metadata", - type: { - name: "Dictionary", - value: { type: { name: "String" }, constraints: { MaxLength: 1000 } } - } - }, - releaseDate: { - serializedName: "releaseDate", - readOnly: true, - type: { - name: "DateTime" - } - }, - registrationDate: { - serializedName: "registrationDate", - readOnly: true, - type: { - name: "DateTime" - } - }, - documentationLink: { - constraints: { - MaxLength: 1000 +export const SubscriptionFeatureRegistrationProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SubscriptionFeatureRegistrationProperties", + modelProperties: { + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, }, - serializedName: "documentationLink", - readOnly: true, - type: { - name: "String" - } - }, - approvalType: { - serializedName: "approvalType", - readOnly: true, - type: { - name: "String" - } - }, - shouldFeatureDisplayInPortal: { - defaultValue: false, - serializedName: "shouldFeatureDisplayInPortal", - type: { - name: "Boolean" - } - }, - description: { - constraints: { - MaxLength: 1000 + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String", + }, }, - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; + featureName: { + serializedName: "featureName", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + providerNamespace: { + serializedName: "providerNamespace", + readOnly: true, + type: { + name: "String", + }, + }, + state: { + serializedName: "state", + type: { + name: "String", + }, + }, + authorizationProfile: { + serializedName: "authorizationProfile", + type: { + name: "Composite", + className: "AuthorizationProfile", + }, + }, + metadata: { + serializedName: "metadata", + type: { + name: "Dictionary", + value: { + type: { name: "String" }, + constraints: { MaxLength: 1000 }, + }, + }, + }, + releaseDate: { + serializedName: "releaseDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + registrationDate: { + serializedName: "registrationDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + documentationLink: { + constraints: { + MaxLength: 1000, + }, + serializedName: "documentationLink", + readOnly: true, + type: { + name: "String", + }, + }, + approvalType: { + serializedName: "approvalType", + readOnly: true, + type: { + name: "String", + }, + }, + shouldFeatureDisplayInPortal: { + defaultValue: false, + serializedName: "shouldFeatureDisplayInPortal", + type: { + name: "Boolean", + }, + }, + description: { + constraints: { + MaxLength: 1000, + }, + serializedName: "description", + type: { + name: "String", + }, + }, + }, + }, + }; export const AuthorizationProfile: coreClient.CompositeMapper = { type: { @@ -331,39 +335,39 @@ export const AuthorizationProfile: coreClient.CompositeMapper = { serializedName: "requestedTime", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, requester: { serializedName: "requester", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, requesterObjectId: { serializedName: "requesterObjectId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, approvedTime: { serializedName: "approvedTime", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, approver: { serializedName: "approver", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ProxyResource: coreClient.CompositeMapper = { @@ -375,25 +379,25 @@ export const ProxyResource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SubscriptionFeatureRegistrationList: coreClient.CompositeMapper = { @@ -404,8 +408,8 @@ export const SubscriptionFeatureRegistrationList: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -414,13 +418,13 @@ export const SubscriptionFeatureRegistrationList: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SubscriptionFeatureRegistration" - } - } - } - } - } - } + className: "SubscriptionFeatureRegistration", + }, + }, + }, + }, + }, + }, }; export const SubscriptionFeatureRegistration: coreClient.CompositeMapper = { @@ -433,9 +437,9 @@ export const SubscriptionFeatureRegistration: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "SubscriptionFeatureRegistrationProperties" - } - } - } - } + className: "SubscriptionFeatureRegistrationProperties", + }, + }, + }, + }, }; diff --git a/sdk/features/arm-features/src/models/parameters.ts b/sdk/features/arm-features/src/models/parameters.ts index 66885213a589..ca6e7083189a 100644 --- a/sdk/features/arm-features/src/models/parameters.ts +++ b/sdk/features/arm-features/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { SubscriptionFeatureRegistration as SubscriptionFeatureRegistrationMapper } from "../models/mappers"; @@ -20,9 +20,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -31,10 +31,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -44,9 +44,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -55,10 +55,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -67,9 +67,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -78,9 +78,9 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const featureName: OperationURLParameter = { @@ -89,9 +89,9 @@ export const featureName: OperationURLParameter = { serializedName: "featureName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const accept1: OperationParameter = { @@ -101,9 +101,9 @@ export const accept1: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const providerNamespace: OperationURLParameter = { @@ -112,9 +112,9 @@ export const providerNamespace: OperationURLParameter = { serializedName: "providerNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -124,12 +124,12 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionFeatureRegistrationType: OperationParameter = { parameterPath: ["options", "subscriptionFeatureRegistrationType"], - mapper: SubscriptionFeatureRegistrationMapper + mapper: SubscriptionFeatureRegistrationMapper, }; diff --git a/sdk/features/arm-features/src/operations/features.ts b/sdk/features/arm-features/src/operations/features.ts index 10868cc7160d..4b7c42a472c3 100644 --- a/sdk/features/arm-features/src/operations/features.ts +++ b/sdk/features/arm-features/src/operations/features.ts @@ -28,7 +28,7 @@ import { FeaturesUnregisterOptionalParams, FeaturesUnregisterResponse, FeaturesListAllNextResponse, - FeaturesListNextResponse + FeaturesListNextResponse, } from "../models"; /// @@ -49,7 +49,7 @@ export class FeaturesImpl implements Features { * @param options The options parameters. */ public listAll( - options?: FeaturesListAllOptionalParams + options?: FeaturesListAllOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAllPagingAll(options); return { @@ -64,13 +64,13 @@ export class FeaturesImpl implements Features { throw new Error("maxPageSize is not supported by this operation."); } return this.listAllPagingPage(options, settings); - } + }, }; } private async *listAllPagingPage( options?: FeaturesListAllOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: FeaturesListAllResponse; let continuationToken = settings?.continuationToken; @@ -91,7 +91,7 @@ export class FeaturesImpl implements Features { } private async *listAllPagingAll( - options?: FeaturesListAllOptionalParams + options?: FeaturesListAllOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAllPagingPage(options)) { yield* page; @@ -106,7 +106,7 @@ export class FeaturesImpl implements Features { */ public list( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceProviderNamespace, options); return { @@ -123,16 +123,16 @@ export class FeaturesImpl implements Features { return this.listPagingPage( resourceProviderNamespace, options, - settings + settings, ); - } + }, }; } private async *listPagingPage( resourceProviderNamespace: string, options?: FeaturesListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: FeaturesListResponse; let continuationToken = settings?.continuationToken; @@ -147,7 +147,7 @@ export class FeaturesImpl implements Features { result = await this._listNext( resourceProviderNamespace, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -158,11 +158,11 @@ export class FeaturesImpl implements Features { private async *listPagingAll( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceProviderNamespace, - options + options, )) { yield* page; } @@ -173,7 +173,7 @@ export class FeaturesImpl implements Features { * @param options The options parameters. */ private _listAll( - options?: FeaturesListAllOptionalParams + options?: FeaturesListAllOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listAllOperationSpec); } @@ -186,11 +186,11 @@ export class FeaturesImpl implements Features { */ private _list( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, options }, - listOperationSpec + listOperationSpec, ); } @@ -203,11 +203,11 @@ export class FeaturesImpl implements Features { get( resourceProviderNamespace: string, featureName: string, - options?: FeaturesGetOptionalParams + options?: FeaturesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, featureName, options }, - getOperationSpec + getOperationSpec, ); } @@ -220,11 +220,11 @@ export class FeaturesImpl implements Features { register( resourceProviderNamespace: string, featureName: string, - options?: FeaturesRegisterOptionalParams + options?: FeaturesRegisterOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, featureName, options }, - registerOperationSpec + registerOperationSpec, ); } @@ -237,11 +237,11 @@ export class FeaturesImpl implements Features { unregister( resourceProviderNamespace: string, featureName: string, - options?: FeaturesUnregisterOptionalParams + options?: FeaturesUnregisterOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, featureName, options }, - unregisterOperationSpec + unregisterOperationSpec, ); } @@ -252,11 +252,11 @@ export class FeaturesImpl implements Features { */ private _listAllNext( nextLink: string, - options?: FeaturesListAllNextOptionalParams + options?: FeaturesListAllNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAllNextOperationSpec + listAllNextOperationSpec, ); } @@ -269,11 +269,11 @@ export class FeaturesImpl implements Features { private _listNext( resourceProviderNamespace: string, nextLink: string, - options?: FeaturesListNextOptionalParams + options?: FeaturesListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -285,142 +285,136 @@ const listAllOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureOperationsListResult + bodyMapper: Mappers.FeatureOperationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureOperationsListResult + bodyMapper: Mappers.FeatureOperationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureResult + bodyMapper: Mappers.FeatureResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceProviderNamespace, - Parameters.featureName + Parameters.featureName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const registerOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.FeatureResult + bodyMapper: Mappers.FeatureResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceProviderNamespace, - Parameters.featureName + Parameters.featureName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const unregisterOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/unregister", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/unregister", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.FeatureResult + bodyMapper: Mappers.FeatureResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceProviderNamespace, - Parameters.featureName + Parameters.featureName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAllNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureOperationsListResult + bodyMapper: Mappers.FeatureOperationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureOperationsListResult + bodyMapper: Mappers.FeatureOperationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts b/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts index 134cc5bdc4d7..b759ac7b5f44 100644 --- a/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts +++ b/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts @@ -27,13 +27,14 @@ import { SubscriptionFeatureRegistrationsCreateOrUpdateResponse, SubscriptionFeatureRegistrationsDeleteOptionalParams, SubscriptionFeatureRegistrationsListBySubscriptionNextResponse, - SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse + SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse, } from "../models"; /// /** Class containing SubscriptionFeatureRegistrations operations. */ export class SubscriptionFeatureRegistrationsImpl - implements SubscriptionFeatureRegistrations { + implements SubscriptionFeatureRegistrations +{ private readonly client: FeatureClient; /** @@ -51,7 +52,7 @@ export class SubscriptionFeatureRegistrationsImpl */ public listBySubscription( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(providerNamespace, options); return { @@ -68,16 +69,16 @@ export class SubscriptionFeatureRegistrationsImpl return this.listBySubscriptionPagingPage( providerNamespace, options, - settings + settings, ); - } + }, }; } private async *listBySubscriptionPagingPage( providerNamespace: string, options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionFeatureRegistrationsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -92,7 +93,7 @@ export class SubscriptionFeatureRegistrationsImpl result = await this._listBySubscriptionNext( providerNamespace, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -103,11 +104,11 @@ export class SubscriptionFeatureRegistrationsImpl private async *listBySubscriptionPagingAll( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage( providerNamespace, - options + options, )) { yield* page; } @@ -118,7 +119,7 @@ export class SubscriptionFeatureRegistrationsImpl * @param options The options parameters. */ public listAllBySubscription( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAllBySubscriptionPagingAll(options); return { @@ -133,13 +134,13 @@ export class SubscriptionFeatureRegistrationsImpl throw new Error("maxPageSize is not supported by this operation."); } return this.listAllBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listAllBySubscriptionPagingPage( options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionFeatureRegistrationsListAllBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -153,7 +154,7 @@ export class SubscriptionFeatureRegistrationsImpl while (continuationToken) { result = await this._listAllBySubscriptionNext( continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -163,7 +164,7 @@ export class SubscriptionFeatureRegistrationsImpl } private async *listAllBySubscriptionPagingAll( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAllBySubscriptionPagingPage(options)) { yield* page; @@ -179,11 +180,11 @@ export class SubscriptionFeatureRegistrationsImpl get( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsGetOptionalParams + options?: SubscriptionFeatureRegistrationsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, featureName, options }, - getOperationSpec + getOperationSpec, ); } @@ -196,11 +197,11 @@ export class SubscriptionFeatureRegistrationsImpl createOrUpdate( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams + options?: SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, featureName, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -213,11 +214,11 @@ export class SubscriptionFeatureRegistrationsImpl delete( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsDeleteOptionalParams + options?: SubscriptionFeatureRegistrationsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, featureName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -228,11 +229,11 @@ export class SubscriptionFeatureRegistrationsImpl */ private _listBySubscription( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -241,11 +242,11 @@ export class SubscriptionFeatureRegistrationsImpl * @param options The options parameters. */ private _listAllBySubscription( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAllBySubscriptionOperationSpec + listAllBySubscriptionOperationSpec, ); } @@ -258,11 +259,11 @@ export class SubscriptionFeatureRegistrationsImpl private _listBySubscriptionNext( providerNamespace: string, nextLink: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionNextOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } @@ -273,13 +274,11 @@ export class SubscriptionFeatureRegistrationsImpl */ private _listAllBySubscriptionNext( nextLink: string, - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionNextOptionalParams - ): Promise< - SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse - > { + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAllBySubscriptionNextOperationSpec + listAllBySubscriptionNextOperationSpec, ); } } @@ -287,38 +286,36 @@ export class SubscriptionFeatureRegistrationsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistration + bodyMapper: Mappers.SubscriptionFeatureRegistration, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.featureName, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistration + bodyMapper: Mappers.SubscriptionFeatureRegistration, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.subscriptionFeatureRegistrationType, queryParameters: [Parameters.apiVersion], @@ -326,109 +323,104 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.featureName, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.featureName, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistrationList + bodyMapper: Mappers.SubscriptionFeatureRegistrationList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1], - serializer + serializer, }; const listAllBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/subscriptionFeatureRegistrations", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/subscriptionFeatureRegistrations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistrationList + bodyMapper: Mappers.SubscriptionFeatureRegistrationList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept1], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistrationList + bodyMapper: Mappers.SubscriptionFeatureRegistrationList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1], - serializer + serializer, }; const listAllBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistrationList + bodyMapper: Mappers.SubscriptionFeatureRegistrationList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept1], - serializer + serializer, }; diff --git a/sdk/features/arm-features/src/operationsInterfaces/features.ts b/sdk/features/arm-features/src/operationsInterfaces/features.ts index 7a3cc838021e..178c08aa76b2 100644 --- a/sdk/features/arm-features/src/operationsInterfaces/features.ts +++ b/sdk/features/arm-features/src/operationsInterfaces/features.ts @@ -16,7 +16,7 @@ import { FeaturesRegisterOptionalParams, FeaturesRegisterResponse, FeaturesUnregisterOptionalParams, - FeaturesUnregisterResponse + FeaturesUnregisterResponse, } from "../models"; /// @@ -27,7 +27,7 @@ export interface Features { * @param options The options parameters. */ listAll( - options?: FeaturesListAllOptionalParams + options?: FeaturesListAllOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all the preview features in a provider namespace that are available through AFEC for the @@ -37,7 +37,7 @@ export interface Features { */ list( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the preview feature with the specified name. @@ -48,7 +48,7 @@ export interface Features { get( resourceProviderNamespace: string, featureName: string, - options?: FeaturesGetOptionalParams + options?: FeaturesGetOptionalParams, ): Promise; /** * Registers the preview feature for the subscription. @@ -59,7 +59,7 @@ export interface Features { register( resourceProviderNamespace: string, featureName: string, - options?: FeaturesRegisterOptionalParams + options?: FeaturesRegisterOptionalParams, ): Promise; /** * Unregisters the preview feature for the subscription. @@ -70,6 +70,6 @@ export interface Features { unregister( resourceProviderNamespace: string, featureName: string, - options?: FeaturesUnregisterOptionalParams + options?: FeaturesUnregisterOptionalParams, ): Promise; } diff --git a/sdk/features/arm-features/src/operationsInterfaces/subscriptionFeatureRegistrations.ts b/sdk/features/arm-features/src/operationsInterfaces/subscriptionFeatureRegistrations.ts index ec8a9085f923..456a5e0a4b5d 100644 --- a/sdk/features/arm-features/src/operationsInterfaces/subscriptionFeatureRegistrations.ts +++ b/sdk/features/arm-features/src/operationsInterfaces/subscriptionFeatureRegistrations.ts @@ -15,7 +15,7 @@ import { SubscriptionFeatureRegistrationsGetResponse, SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams, SubscriptionFeatureRegistrationsCreateOrUpdateResponse, - SubscriptionFeatureRegistrationsDeleteOptionalParams + SubscriptionFeatureRegistrationsDeleteOptionalParams, } from "../models"; /// @@ -28,14 +28,14 @@ export interface SubscriptionFeatureRegistrations { */ listBySubscription( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Returns subscription feature registrations for given subscription. * @param options The options parameters. */ listAllBySubscription( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Returns a feature registration @@ -46,7 +46,7 @@ export interface SubscriptionFeatureRegistrations { get( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsGetOptionalParams + options?: SubscriptionFeatureRegistrationsGetOptionalParams, ): Promise; /** * Create or update a feature registration. @@ -57,7 +57,7 @@ export interface SubscriptionFeatureRegistrations { createOrUpdate( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams + options?: SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams, ): Promise; /** * Deletes a feature registration @@ -68,6 +68,6 @@ export interface SubscriptionFeatureRegistrations { delete( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsDeleteOptionalParams + options?: SubscriptionFeatureRegistrationsDeleteOptionalParams, ): Promise; } diff --git a/sdk/features/arm-features/src/pagingHelper.ts b/sdk/features/arm-features/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 100644 --- a/sdk/features/arm-features/src/pagingHelper.ts +++ b/sdk/features/arm-features/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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/features/arm-features/test/sampleTest.ts b/sdk/features/arm-features/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/features/arm-features/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/features/arm-features/tsconfig.json b/sdk/features/arm-features/tsconfig.json index 7acef300dd3d..b4ac39389770 100644 --- a/sdk/features/arm-features/tsconfig.json +++ b/sdk/features/arm-features/tsconfig.json @@ -15,17 +15,12 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-features": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/links/arm-links/CHANGELOG.md b/sdk/links/arm-links/CHANGELOG.md index e72b11f65d31..fded86d2a3f1 100644 --- a/sdk/links/arm-links/CHANGELOG.md +++ b/sdk/links/arm-links/CHANGELOG.md @@ -1,18 +1,19 @@ # Release History - -## 2.0.2 (2022-11-22) - + +## 3.0.0 (2024-12-10) + ### Features Added --  Exposes `getContinuationToken` helper function to extract continuation token - -### Bugs Fixed -  -- A series of small bug fixs relevant to authentication and apiVersion policy + - Added function getContinuationToken +### Breaking Changes + + - Class ManagementLinkClient has a new signature + - Interface ResourceLinksListAtSubscriptionNextOptionalParams no longer has parameter filter + ## 2.0.1 (2022-04-18) -### Features Added +**features** - Bug fix @@ -24,4 +25,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/links/arm-links/LICENSE b/sdk/links/arm-links/LICENSE index 5d1d36e0af80..7d5934740965 100644 --- a/sdk/links/arm-links/LICENSE +++ b/sdk/links/arm-links/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2024 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/links/arm-links/README.md b/sdk/links/arm-links/README.md index 446d2961cafd..3d5afe7f5a35 100644 --- a/sdk/links/arm-links/README.md +++ b/sdk/links/arm-links/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure ManagementLink** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/links/arm-links/_meta.json b/sdk/links/arm-links/_meta.json index 4b98b8203a1f..267db4618701 100644 --- a/sdk/links/arm-links/_meta.json +++ b/sdk/links/arm-links/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "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", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/links/arm-links/package.json b/sdk/links/arm-links/package.json index d5a32afbb347..dababb2a1621 100644 --- a/sdk/links/arm-links/package.json +++ b/sdk/links/arm-links/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ManagementLinkClient.", - "version": "2.0.2", + "version": "3.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.6.1", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -26,20 +26,20 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-links.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", - "@azure/arm-resources": "^5.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/links/arm-links", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -66,28 +66,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -99,5 +99,6 @@ } ] }, - "autoPublish": true -} + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/links/arm-links" +} \ No newline at end of file diff --git a/sdk/links/arm-links/review/arm-links.api.md b/sdk/links/arm-links/review/arm-links.api.md index 0bbbaff74a79..a021f89e39ad 100644 --- a/sdk/links/arm-links/review/arm-links.api.md +++ b/sdk/links/arm-links/review/arm-links.api.md @@ -16,6 +16,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLinkClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: ManagementLinkClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -23,7 +24,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { // (undocumented) resourceLinks: ResourceLinks; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public @@ -141,7 +142,6 @@ export type ResourceLinksListAtSourceScopeResponse = ResourceLinkResult; // @public export interface ResourceLinksListAtSubscriptionNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public diff --git a/sdk/links/arm-links/sample.env b/sdk/links/arm-links/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/links/arm-links/sample.env +++ b/sdk/links/arm-links/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/links/arm-links/src/managementLinkClient.ts b/sdk/links/arm-links/src/managementLinkClient.ts index ba642926cc86..f590a11f9014 100644 --- a/sdk/links/arm-links/src/managementLinkClient.ts +++ b/sdk/links/arm-links/src/managementLinkClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, ResourceLinksImpl } from "./operations"; @@ -21,7 +21,7 @@ import { ManagementLinkClientOptionalParams } from "./models"; export class ManagementLinkClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the ManagementLinkClient class. @@ -32,13 +32,27 @@ export class ManagementLinkClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ManagementLinkClientOptionalParams + options?: ManagementLinkClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: ManagementLinkClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: ManagementLinkClientOptionalParams | string, + options?: ManagementLinkClientOptionalParams, ) { 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 @@ -47,10 +61,10 @@ export class ManagementLinkClient extends coreClient.ServiceClient { } const defaults: ManagementLinkClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-links/2.0.2`; + const packageDetails = `azsdk-js-arm-links/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -60,20 +74,21 @@ export class ManagementLinkClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,7 +98,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +108,9 @@ export class ManagementLinkClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -118,7 +133,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -132,7 +147,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/links/arm-links/src/models/index.ts b/sdk/links/arm-links/src/models/index.ts index 1a730f96d3e2..1788384b5787 100644 --- a/sdk/links/arm-links/src/models/index.ts +++ b/sdk/links/arm-links/src/models/index.ts @@ -138,10 +138,7 @@ export type ResourceLinksListAtSourceScopeResponse = ResourceLinkResult; /** Optional parameters. */ export interface ResourceLinksListAtSubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the list resource links operation. The supported filter for list resource links is targetId. For example, $filter=targetId eq {value} */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtSubscriptionNext operation. */ export type ResourceLinksListAtSubscriptionNextResponse = ResourceLinkResult; diff --git a/sdk/links/arm-links/src/models/mappers.ts b/sdk/links/arm-links/src/models/mappers.ts index 6dc8e79de789..36b97b7c05e8 100644 --- a/sdk/links/arm-links/src/models/mappers.ts +++ b/sdk/links/arm-links/src/models/mappers.ts @@ -20,19 +20,19 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -43,18 +43,18 @@ export const Operation: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - } - } - } + className: "OperationDisplay", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -65,29 +65,29 @@ export const OperationDisplay: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceLink: coreClient.CompositeMapper = { @@ -99,33 +99,33 @@ export const ResourceLink: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "ResourceLinkProperties" - } - } - } - } + className: "ResourceLinkProperties", + }, + }, + }, + }, }; export const ResourceLinkProperties: coreClient.CompositeMapper = { @@ -137,24 +137,24 @@ export const ResourceLinkProperties: coreClient.CompositeMapper = { serializedName: "sourceId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, targetId: { serializedName: "targetId", required: true, type: { - name: "String" - } + name: "String", + }, }, notes: { serializedName: "notes", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceLinkResult: coreClient.CompositeMapper = { @@ -170,20 +170,20 @@ export const ResourceLinkResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceLink" - } - } - } + className: "ResourceLink", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceLinkFilter: coreClient.CompositeMapper = { @@ -195,9 +195,9 @@ export const ResourceLinkFilter: coreClient.CompositeMapper = { serializedName: "targetId", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/links/arm-links/src/models/parameters.ts b/sdk/links/arm-links/src/models/parameters.ts index 20df95fc66e0..44c21908922b 100644 --- a/sdk/links/arm-links/src/models/parameters.ts +++ b/sdk/links/arm-links/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { ResourceLink as ResourceLinkMapper } from "../models/mappers"; @@ -20,9 +20,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -31,10 +31,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -44,9 +44,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -55,10 +55,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const linkId: OperationURLParameter = { @@ -67,10 +67,10 @@ export const linkId: OperationURLParameter = { serializedName: "linkId", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const contentType: OperationParameter = { @@ -80,14 +80,14 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: ResourceLinkMapper + mapper: ResourceLinkMapper, }; export const filter: OperationQueryParameter = { @@ -95,9 +95,9 @@ export const filter: OperationQueryParameter = { mapper: { serializedName: "$filter", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionId: OperationURLParameter = { @@ -106,9 +106,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const scope: OperationURLParameter = { @@ -117,10 +117,10 @@ export const scope: OperationURLParameter = { serializedName: "scope", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const filter1: OperationQueryParameter = { @@ -130,7 +130,7 @@ export const filter1: OperationQueryParameter = { isConstant: true, serializedName: "$filter", type: { - name: "String" - } - } + name: "String", + }, + }, }; diff --git a/sdk/links/arm-links/src/operations/operations.ts b/sdk/links/arm-links/src/operations/operations.ts index 26969f581fd6..6598589debb1 100644 --- a/sdk/links/arm-links/src/operations/operations.ts +++ b/sdk/links/arm-links/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models"; /// @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,24 +121,23 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult - } + bodyMapper: Mappers.OperationListResult, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult - } + bodyMapper: Mappers.OperationListResult, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/links/arm-links/src/operations/resourceLinks.ts b/sdk/links/arm-links/src/operations/resourceLinks.ts index 4585f8d526f0..431fe5f9303a 100644 --- a/sdk/links/arm-links/src/operations/resourceLinks.ts +++ b/sdk/links/arm-links/src/operations/resourceLinks.ts @@ -27,7 +27,7 @@ import { ResourceLinksGetOptionalParams, ResourceLinksGetResponse, ResourceLinksListAtSubscriptionNextResponse, - ResourceLinksListAtSourceScopeNextResponse + ResourceLinksListAtSourceScopeNextResponse, } from "../models"; /// @@ -48,7 +48,7 @@ export class ResourceLinksImpl implements ResourceLinks { * @param options The options parameters. */ public listAtSubscription( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtSubscriptionPagingAll(options); return { @@ -63,13 +63,13 @@ export class ResourceLinksImpl implements ResourceLinks { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtSubscriptionPagingPage(options, settings); - } + }, }; } private async *listAtSubscriptionPagingPage( options?: ResourceLinksListAtSubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourceLinksListAtSubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -90,7 +90,7 @@ export class ResourceLinksImpl implements ResourceLinks { } private async *listAtSubscriptionPagingAll( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtSubscriptionPagingPage(options)) { yield* page; @@ -106,7 +106,7 @@ export class ResourceLinksImpl implements ResourceLinks { */ public listAtSourceScope( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtSourceScopePagingAll(scope, options); return { @@ -121,14 +121,14 @@ export class ResourceLinksImpl implements ResourceLinks { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtSourceScopePagingPage(scope, options, settings); - } + }, }; } private async *listAtSourceScopePagingPage( scope: string, options?: ResourceLinksListAtSourceScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourceLinksListAtSourceScopeResponse; let continuationToken = settings?.continuationToken; @@ -143,7 +143,7 @@ export class ResourceLinksImpl implements ResourceLinks { result = await this._listAtSourceScopeNext( scope, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -154,7 +154,7 @@ export class ResourceLinksImpl implements ResourceLinks { private async *listAtSourceScopePagingAll( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtSourceScopePagingPage(scope, options)) { yield* page; @@ -171,11 +171,11 @@ export class ResourceLinksImpl implements ResourceLinks { */ delete( linkId: string, - options?: ResourceLinksDeleteOptionalParams + options?: ResourceLinksDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { linkId, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -191,11 +191,11 @@ export class ResourceLinksImpl implements ResourceLinks { createOrUpdate( linkId: string, parameters: ResourceLink, - options?: ResourceLinksCreateOrUpdateOptionalParams + options?: ResourceLinksCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { linkId, parameters, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -207,11 +207,11 @@ export class ResourceLinksImpl implements ResourceLinks { */ get( linkId: string, - options?: ResourceLinksGetOptionalParams + options?: ResourceLinksGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { linkId, options }, - getOperationSpec + getOperationSpec, ); } @@ -220,11 +220,11 @@ export class ResourceLinksImpl implements ResourceLinks { * @param options The options parameters. */ private _listAtSubscription( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAtSubscriptionOperationSpec + listAtSubscriptionOperationSpec, ); } @@ -237,11 +237,11 @@ export class ResourceLinksImpl implements ResourceLinks { */ private _listAtSourceScope( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, options }, - listAtSourceScopeOperationSpec + listAtSourceScopeOperationSpec, ); } @@ -252,11 +252,11 @@ export class ResourceLinksImpl implements ResourceLinks { */ private _listAtSubscriptionNext( nextLink: string, - options?: ResourceLinksListAtSubscriptionNextOptionalParams + options?: ResourceLinksListAtSubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAtSubscriptionNextOperationSpec + listAtSubscriptionNextOperationSpec, ); } @@ -271,11 +271,11 @@ export class ResourceLinksImpl implements ResourceLinks { private _listAtSourceScopeNext( scope: string, nextLink: string, - options?: ResourceLinksListAtSourceScopeNextOptionalParams + options?: ResourceLinksListAtSourceScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, nextLink, options }, - listAtSourceScopeNextOperationSpec + listAtSourceScopeNextOperationSpec, ); } } @@ -288,92 +288,90 @@ const deleteOperationSpec: coreClient.OperationSpec = { responses: { 200: {}, 204: {} }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.linkId], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { path: "/{linkId}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ResourceLink + bodyMapper: Mappers.ResourceLink, }, 201: { - bodyMapper: Mappers.ResourceLink - } + bodyMapper: Mappers.ResourceLink, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.linkId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { path: "/{linkId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLink - } + bodyMapper: Mappers.ResourceLink, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.linkId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/links", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLinkResult - } + bodyMapper: Mappers.ResourceLinkResult, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSourceScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/links", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLinkResult - } + bodyMapper: Mappers.ResourceLinkResult, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLinkResult - } + bodyMapper: Mappers.ResourceLinkResult, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSourceScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLinkResult - } + bodyMapper: Mappers.ResourceLinkResult, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/links/arm-links/src/operationsInterfaces/operations.ts b/sdk/links/arm-links/src/operationsInterfaces/operations.ts index ac34435954c0..65cdf8035ab0 100644 --- a/sdk/links/arm-links/src/operationsInterfaces/operations.ts +++ b/sdk/links/arm-links/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/links/arm-links/src/operationsInterfaces/resourceLinks.ts b/sdk/links/arm-links/src/operationsInterfaces/resourceLinks.ts index cbfea5e366a8..05080a73183b 100644 --- a/sdk/links/arm-links/src/operationsInterfaces/resourceLinks.ts +++ b/sdk/links/arm-links/src/operationsInterfaces/resourceLinks.ts @@ -15,7 +15,7 @@ import { ResourceLinksCreateOrUpdateOptionalParams, ResourceLinksCreateOrUpdateResponse, ResourceLinksGetOptionalParams, - ResourceLinksGetResponse + ResourceLinksGetResponse, } from "../models"; /// @@ -26,7 +26,7 @@ export interface ResourceLinks { * @param options The options parameters. */ listAtSubscription( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a list of resource links at and below the specified source scope. @@ -37,7 +37,7 @@ export interface ResourceLinks { */ listAtSourceScope( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Deletes a resource link with the specified ID. @@ -49,7 +49,7 @@ export interface ResourceLinks { */ delete( linkId: string, - options?: ResourceLinksDeleteOptionalParams + options?: ResourceLinksDeleteOptionalParams, ): Promise; /** * Creates or updates a resource link between the specified resources. @@ -63,7 +63,7 @@ export interface ResourceLinks { createOrUpdate( linkId: string, parameters: ResourceLink, - options?: ResourceLinksCreateOrUpdateOptionalParams + options?: ResourceLinksCreateOrUpdateOptionalParams, ): Promise; /** * Gets a resource link with the specified ID. @@ -73,6 +73,6 @@ export interface ResourceLinks { */ get( linkId: string, - options?: ResourceLinksGetOptionalParams + options?: ResourceLinksGetOptionalParams, ): Promise; } diff --git a/sdk/links/arm-links/src/pagingHelper.ts b/sdk/links/arm-links/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 100644 --- a/sdk/links/arm-links/src/pagingHelper.ts +++ b/sdk/links/arm-links/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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/links/arm-links/test/sampleTest.ts b/sdk/links/arm-links/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/links/arm-links/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/links/arm-links/tsconfig.json b/sdk/links/arm-links/tsconfig.json index 433cb8777ded..4ca574fbd5fb 100644 --- a/sdk/links/arm-links/tsconfig.json +++ b/sdk/links/arm-links/tsconfig.json @@ -15,23 +15,15 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-links": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/locks/arm-locks/CHANGELOG.md b/sdk/locks/arm-locks/CHANGELOG.md index fa91121a0ecd..109ea24808ff 100644 --- a/sdk/locks/arm-locks/CHANGELOG.md +++ b/sdk/locks/arm-locks/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History - -## 2.1.1 (Unreleased) - -### Features Added - + +## 3.0.0 (2024-12-10) + ### 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 Added @@ -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/azsdk/js/mgmt/quickstart). diff --git a/sdk/locks/arm-locks/LICENSE b/sdk/locks/arm-locks/LICENSE index 5d1d36e0af80..7d5934740965 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) 2024 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/README.md b/sdk/locks/arm-locks/README.md index 5c4d6921742d..7ec506a22e64 100644 --- a/sdk/locks/arm-locks/README.md +++ b/sdk/locks/arm-locks/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure ManagementLock** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/locks/arm-locks/_meta.json b/sdk/locks/arm-locks/_meta.json index c7ad3e56f301..267db4618701 100644 --- a/sdk/locks/arm-locks/_meta.json +++ b/sdk/locks/arm-locks/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", "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", + "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.12", "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" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/locks/arm-locks/package.json b/sdk/locks/arm-locks/package.json index 9d912236ad20..27b9fa683ca1 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-auth": "^1.3.0", - "@azure/core-client": "^1.6.1", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -26,19 +26,20 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-locks.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.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" @@ -65,28 +66,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -99,12 +100,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/sample.env b/sdk/locks/arm-locks/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/locks/arm-locks/sample.env +++ b/sdk/locks/arm-locks/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/locks/arm-locks/src/managementLockClient.ts b/sdk/locks/arm-locks/src/managementLockClient.ts index 1f0594596368..7c4d1d2b4632 100644 --- a/sdk/locks/arm-locks/src/managementLockClient.ts +++ b/sdk/locks/arm-locks/src/managementLockClient.ts @@ -11,20 +11,20 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { AuthorizationOperationsImpl, ManagementLocksImpl } from "./operations"; import { AuthorizationOperations, - ManagementLocks + ManagementLocks, } from "./operationsInterfaces"; 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. @@ -35,13 +35,27 @@ export class ManagementLockClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ManagementLockClientOptionalParams + 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 @@ -50,10 +64,10 @@ export class ManagementLockClient extends coreClient.ServiceClient { } const defaults: ManagementLockClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + 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}` @@ -63,20 +77,21 @@ export class ManagementLockClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -86,7 +101,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -96,9 +111,9 @@ export class ManagementLockClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -121,7 +136,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -135,7 +150,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/locks/arm-locks/src/models/index.ts b/sdk/locks/arm-locks/src/models/index.ts index c95cb1af614b..4354ad8880fb 100644 --- a/sdk/locks/arm-locks/src/models/index.ts +++ b/sdk/locks/arm-locks/src/models/index.ts @@ -150,7 +150,7 @@ export enum KnownLockLevel { /** CanNotDelete */ CanNotDelete = "CanNotDelete", /** ReadOnly */ - ReadOnly = "ReadOnly" + ReadOnly = "ReadOnly", } /** @@ -173,7 +173,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -207,7 +207,8 @@ export interface ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtResourceGroupLevel operation. */ -export type ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse = ManagementLockObject; +export type ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksDeleteAtResourceGroupLevelOptionalParams @@ -218,7 +219,8 @@ export interface ManagementLocksGetAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAtResourceGroupLevel operation. */ -export type ManagementLocksGetAtResourceGroupLevelResponse = ManagementLockObject; +export type ManagementLocksGetAtResourceGroupLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksCreateOrUpdateByScopeOptionalParams @@ -243,7 +245,8 @@ export interface ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtResourceLevel operation. */ -export type ManagementLocksCreateOrUpdateAtResourceLevelResponse = ManagementLockObject; +export type ManagementLocksCreateOrUpdateAtResourceLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksDeleteAtResourceLevelOptionalParams @@ -261,7 +264,8 @@ export interface ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtSubscriptionLevel operation. */ -export type ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse = ManagementLockObject; +export type ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksDeleteAtSubscriptionLevelOptionalParams @@ -272,7 +276,8 @@ export interface ManagementLocksGetAtSubscriptionLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAtSubscriptionLevel operation. */ -export type ManagementLocksGetAtSubscriptionLevelResponse = ManagementLockObject; +export type ManagementLocksGetAtSubscriptionLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksListAtResourceGroupLevelOptionalParams @@ -282,7 +287,8 @@ export interface ManagementLocksListAtResourceGroupLevelOptionalParams } /** Contains response data for the listAtResourceGroupLevel operation. */ -export type ManagementLocksListAtResourceGroupLevelResponse = ManagementLockListResult; +export type ManagementLocksListAtResourceGroupLevelResponse = + ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtResourceLevelOptionalParams @@ -292,7 +298,8 @@ export interface ManagementLocksListAtResourceLevelOptionalParams } /** Contains response data for the listAtResourceLevel operation. */ -export type ManagementLocksListAtResourceLevelResponse = ManagementLockListResult; +export type ManagementLocksListAtResourceLevelResponse = + ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtSubscriptionLevelOptionalParams @@ -302,7 +309,8 @@ export interface ManagementLocksListAtSubscriptionLevelOptionalParams } /** Contains response data for the listAtSubscriptionLevel operation. */ -export type ManagementLocksListAtSubscriptionLevelResponse = ManagementLockListResult; +export type ManagementLocksListAtSubscriptionLevelResponse = + ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListByScopeOptionalParams @@ -316,40 +324,31 @@ 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; +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; +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; +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/models/mappers.ts b/sdk/locks/arm-locks/src/models/mappers.ts index f165718080fd..989b7a561236 100644 --- a/sdk/locks/arm-locks/src/models/mappers.ts +++ b/sdk/locks/arm-locks/src/models/mappers.ts @@ -20,19 +20,19 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -43,18 +43,18 @@ export const Operation: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - } - } - } + className: "OperationDisplay", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -65,23 +65,23 @@ export const OperationDisplay: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -93,11 +93,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -109,22 +109,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -134,10 +134,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -147,13 +147,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -165,19 +165,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const ManagementLockObject: coreClient.CompositeMapper = { @@ -189,42 +189,42 @@ export const ManagementLockObject: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, level: { serializedName: "properties.level", required: true, type: { - name: "String" - } + name: "String", + }, }, notes: { serializedName: "properties.notes", type: { - name: "String" - } + name: "String", + }, }, owners: { serializedName: "properties.owners", @@ -233,13 +233,13 @@ export const ManagementLockObject: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ManagementLockOwner" - } - } - } - } - } - } + className: "ManagementLockOwner", + }, + }, + }, + }, + }, + }, }; export const ManagementLockOwner: coreClient.CompositeMapper = { @@ -250,11 +250,11 @@ export const ManagementLockOwner: coreClient.CompositeMapper = { applicationId: { serializedName: "applicationId", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -265,41 +265,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const ManagementLockListResult: coreClient.CompositeMapper = { @@ -314,17 +314,17 @@ export const ManagementLockListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ManagementLockObject" - } - } - } + className: "ManagementLockObject", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/locks/arm-locks/src/models/parameters.ts b/sdk/locks/arm-locks/src/models/parameters.ts index 6df49f707d76..ad894173542d 100644 --- a/sdk/locks/arm-locks/src/models/parameters.ts +++ b/sdk/locks/arm-locks/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { ManagementLockObject as ManagementLockObjectMapper } from "../models/mappers"; @@ -20,9 +20,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -31,10 +31,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -44,9 +44,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -55,10 +55,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const contentType: OperationParameter = { @@ -68,14 +68,14 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: ManagementLockObjectMapper + mapper: ManagementLockObjectMapper, }; export const resourceGroupName: OperationURLParameter = { @@ -84,14 +84,14 @@ export const resourceGroupName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const lockName: OperationURLParameter = { @@ -100,9 +100,9 @@ export const lockName: OperationURLParameter = { serializedName: "lockName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionId: OperationURLParameter = { @@ -111,9 +111,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const scope: OperationURLParameter = { @@ -122,9 +122,9 @@ export const scope: OperationURLParameter = { serializedName: "scope", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -133,9 +133,9 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parentResourcePath: OperationURLParameter = { @@ -144,10 +144,10 @@ export const parentResourcePath: OperationURLParameter = { serializedName: "parentResourcePath", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceType: OperationURLParameter = { @@ -156,10 +156,10 @@ export const resourceType: OperationURLParameter = { serializedName: "resourceType", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceName: OperationURLParameter = { @@ -168,9 +168,9 @@ export const resourceName: OperationURLParameter = { serializedName: "resourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const filter: OperationQueryParameter = { @@ -178,7 +178,7 @@ export const filter: OperationQueryParameter = { mapper: { serializedName: "$filter", type: { - name: "String" - } - } + name: "String", + }, + }, }; diff --git a/sdk/locks/arm-locks/src/operations/authorizationOperations.ts b/sdk/locks/arm-locks/src/operations/authorizationOperations.ts index 7a5256074de5..b796f4a56d4e 100644 --- a/sdk/locks/arm-locks/src/operations/authorizationOperations.ts +++ b/sdk/locks/arm-locks/src/operations/authorizationOperations.ts @@ -18,7 +18,7 @@ import { AuthorizationOperationsListNextOptionalParams, AuthorizationOperationsListOptionalParams, AuthorizationOperationsListResponse, - AuthorizationOperationsListNextResponse + AuthorizationOperationsListNextResponse, } from "../models"; /// @@ -39,7 +39,7 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { * @param options The options parameters. */ public list( - options?: AuthorizationOperationsListOptionalParams + options?: AuthorizationOperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: AuthorizationOperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: AuthorizationOperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { } private async *listPagingAll( - options?: AuthorizationOperationsListOptionalParams + options?: AuthorizationOperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { * @param options The options parameters. */ private _list( - options?: AuthorizationOperationsListOptionalParams + options?: AuthorizationOperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { */ private _listNext( nextLink: string, - options?: AuthorizationOperationsListNextOptionalParams + options?: AuthorizationOperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,30 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/locks/arm-locks/src/operations/managementLocks.ts b/sdk/locks/arm-locks/src/operations/managementLocks.ts index 3669b5d87ac0..303e858788a5 100644 --- a/sdk/locks/arm-locks/src/operations/managementLocks.ts +++ b/sdk/locks/arm-locks/src/operations/managementLocks.ts @@ -50,7 +50,7 @@ import { ManagementLocksListAtResourceGroupLevelNextResponse, ManagementLocksListAtResourceLevelNextResponse, ManagementLocksListAtSubscriptionLevelNextResponse, - ManagementLocksListByScopeNextResponse + ManagementLocksListByScopeNextResponse, } from "../models"; /// @@ -73,11 +73,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ public listAtResourceGroupLevel( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtResourceGroupLevelPagingAll( resourceGroupName, - options + options, ); return { next() { @@ -93,16 +93,16 @@ export class ManagementLocksImpl implements ManagementLocks { return this.listAtResourceGroupLevelPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listAtResourceGroupLevelPagingPage( resourceGroupName: string, options?: ManagementLocksListAtResourceGroupLevelOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListAtResourceGroupLevelResponse; let continuationToken = settings?.continuationToken; @@ -117,7 +117,7 @@ export class ManagementLocksImpl implements ManagementLocks { result = await this._listAtResourceGroupLevelNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -128,11 +128,11 @@ export class ManagementLocksImpl implements ManagementLocks { private async *listAtResourceGroupLevelPagingAll( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtResourceGroupLevelPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -154,7 +154,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtResourceLevelPagingAll( resourceGroupName, @@ -162,7 +162,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, ); return { next() { @@ -182,9 +182,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, options, - settings + settings, ); - } + }, }; } @@ -195,7 +195,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, options?: ManagementLocksListAtResourceLevelOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListAtResourceLevelResponse; let continuationToken = settings?.continuationToken; @@ -206,7 +206,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -221,7 +221,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -236,7 +236,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtResourceLevelPagingPage( resourceGroupName, @@ -244,7 +244,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, )) { yield* page; } @@ -255,7 +255,7 @@ export class ManagementLocksImpl implements ManagementLocks { * @param options The options parameters. */ public listAtSubscriptionLevel( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtSubscriptionLevelPagingAll(options); return { @@ -270,13 +270,13 @@ export class ManagementLocksImpl implements ManagementLocks { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtSubscriptionLevelPagingPage(options, settings); - } + }, }; } private async *listAtSubscriptionLevelPagingPage( options?: ManagementLocksListAtSubscriptionLevelOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListAtSubscriptionLevelResponse; let continuationToken = settings?.continuationToken; @@ -290,7 +290,7 @@ export class ManagementLocksImpl implements ManagementLocks { while (continuationToken) { result = await this._listAtSubscriptionLevelNext( continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -300,7 +300,7 @@ export class ManagementLocksImpl implements ManagementLocks { } private async *listAtSubscriptionLevelPagingAll( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtSubscriptionLevelPagingPage(options)) { yield* page; @@ -318,7 +318,7 @@ export class ManagementLocksImpl implements ManagementLocks { */ public listByScope( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByScopePagingAll(scope, options); return { @@ -333,14 +333,14 @@ export class ManagementLocksImpl implements ManagementLocks { throw new Error("maxPageSize is not supported by this operation."); } return this.listByScopePagingPage(scope, options, settings); - } + }, }; } private async *listByScopePagingPage( scope: string, options?: ManagementLocksListByScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListByScopeResponse; let continuationToken = settings?.continuationToken; @@ -362,7 +362,7 @@ export class ManagementLocksImpl implements ManagementLocks { private async *listByScopePagingAll( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByScopePagingPage(scope, options)) { yield* page; @@ -384,11 +384,11 @@ export class ManagementLocksImpl implements ManagementLocks { resourceGroupName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, lockName, parameters, options }, - createOrUpdateAtResourceGroupLevelOperationSpec + createOrUpdateAtResourceGroupLevelOperationSpec, ); } @@ -403,11 +403,11 @@ export class ManagementLocksImpl implements ManagementLocks { deleteAtResourceGroupLevel( resourceGroupName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams + options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, lockName, options }, - deleteAtResourceGroupLevelOperationSpec + deleteAtResourceGroupLevelOperationSpec, ); } @@ -420,11 +420,11 @@ export class ManagementLocksImpl implements ManagementLocks { getAtResourceGroupLevel( resourceGroupName: string, lockName: string, - options?: ManagementLocksGetAtResourceGroupLevelOptionalParams + options?: ManagementLocksGetAtResourceGroupLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, lockName, options }, - getAtResourceGroupLevelOperationSpec + getAtResourceGroupLevelOperationSpec, ); } @@ -443,11 +443,11 @@ export class ManagementLocksImpl implements ManagementLocks { scope: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateByScopeOptionalParams + options?: ManagementLocksCreateOrUpdateByScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, lockName, parameters, options }, - createOrUpdateByScopeOperationSpec + createOrUpdateByScopeOperationSpec, ); } @@ -460,11 +460,11 @@ export class ManagementLocksImpl implements ManagementLocks { deleteByScope( scope: string, lockName: string, - options?: ManagementLocksDeleteByScopeOptionalParams + options?: ManagementLocksDeleteByScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, lockName, options }, - deleteByScopeOperationSpec + deleteByScopeOperationSpec, ); } @@ -477,11 +477,11 @@ export class ManagementLocksImpl implements ManagementLocks { getByScope( scope: string, lockName: string, - options?: ManagementLocksGetByScopeOptionalParams + options?: ManagementLocksGetByScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, lockName, options }, - getByScopeOperationSpec + getByScopeOperationSpec, ); } @@ -508,7 +508,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -519,9 +519,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceName, lockName, parameters, - options + options, }, - createOrUpdateAtResourceLevelOperationSpec + createOrUpdateAtResourceLevelOperationSpec, ); } @@ -546,7 +546,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceLevelOptionalParams + options?: ManagementLocksDeleteAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -556,9 +556,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, lockName, - options + options, }, - deleteAtResourceLevelOperationSpec + deleteAtResourceLevelOperationSpec, ); } @@ -579,7 +579,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksGetAtResourceLevelOptionalParams + options?: ManagementLocksGetAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -589,9 +589,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, lockName, - options + options, }, - getAtResourceLevelOperationSpec + getAtResourceLevelOperationSpec, ); } @@ -608,11 +608,11 @@ export class ManagementLocksImpl implements ManagementLocks { createOrUpdateAtSubscriptionLevel( lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { lockName, parameters, options }, - createOrUpdateAtSubscriptionLevelOperationSpec + createOrUpdateAtSubscriptionLevelOperationSpec, ); } @@ -625,11 +625,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ deleteAtSubscriptionLevel( lockName: string, - options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams + options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { lockName, options }, - deleteAtSubscriptionLevelOperationSpec + deleteAtSubscriptionLevelOperationSpec, ); } @@ -640,11 +640,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ getAtSubscriptionLevel( lockName: string, - options?: ManagementLocksGetAtSubscriptionLevelOptionalParams + options?: ManagementLocksGetAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { lockName, options }, - getAtSubscriptionLevelOperationSpec + getAtSubscriptionLevelOperationSpec, ); } @@ -655,11 +655,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ private _listAtResourceGroupLevel( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listAtResourceGroupLevelOperationSpec + listAtResourceGroupLevelOperationSpec, ); } @@ -679,7 +679,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -688,9 +688,9 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, }, - listAtResourceLevelOperationSpec + listAtResourceLevelOperationSpec, ); } @@ -699,11 +699,11 @@ export class ManagementLocksImpl implements ManagementLocks { * @param options The options parameters. */ private _listAtSubscriptionLevel( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAtSubscriptionLevelOperationSpec + listAtSubscriptionLevelOperationSpec, ); } @@ -718,11 +718,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ private _listByScope( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, options }, - listByScopeOperationSpec + listByScopeOperationSpec, ); } @@ -736,11 +736,11 @@ export class ManagementLocksImpl implements ManagementLocks { private _listAtResourceGroupLevelNext( resourceGroupName: string, nextLink: string, - options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams + options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listAtResourceGroupLevelNextOperationSpec + listAtResourceGroupLevelNextOperationSpec, ); } @@ -762,7 +762,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, nextLink: string, - options?: ManagementLocksListAtResourceLevelNextOptionalParams + options?: ManagementLocksListAtResourceLevelNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -772,9 +772,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, nextLink, - options + options, }, - listAtResourceLevelNextOperationSpec + listAtResourceLevelNextOperationSpec, ); } @@ -786,11 +786,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ private _listAtSubscriptionLevelNext( nextLink: string, - options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams + options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAtSubscriptionLevelNextOperationSpec + listAtSubscriptionLevelNextOperationSpec, ); } @@ -807,107 +807,105 @@ export class ManagementLocksImpl implements ManagementLocks { private _listByScopeNext( scope: string, nextLink: string, - options?: ManagementLocksListByScopeNextOptionalParams + options?: ManagementLocksListByScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, nextLink, options }, - listByScopeNextOperationSpec + listByScopeNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const createOrUpdateAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ManagementLockObject - }, - 201: { - bodyMapper: Mappers.ManagementLockObject +const createOrUpdateAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject, + }, + 201: { + bodyMapper: Mappers.ManagementLockObject, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.lockName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.lockName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; const deleteAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.lockName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.lockName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateByScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, 201: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteByScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}", @@ -916,44 +914,43 @@ const deleteByScopeOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const getByScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtResourceLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, 201: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], @@ -965,22 +962,21 @@ const createOrUpdateAtResourceLevelOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteAtResourceLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -991,22 +987,21 @@ const deleteAtResourceLevelOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtResourceLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -1017,110 +1012,106 @@ const getAtResourceLevelOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const createOrUpdateAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ManagementLockObject - }, - 201: { - bodyMapper: Mappers.ManagementLockObject +const createOrUpdateAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject, + }, + 201: { + bodyMapper: Mappers.ManagementLockObject, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.lockName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.lockName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; const deleteAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.lockName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.lockName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtResourceLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ @@ -1130,77 +1121,74 @@ const listAtResourceLevelOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Authorization/locks", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtResourceGroupLevelNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtResourceLevelNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -1209,44 +1197,42 @@ const listAtResourceLevelNextOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionLevelNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts b/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts index 9e806d13345f..3e59bef63ca8 100644 --- a/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts +++ b/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts @@ -9,7 +9,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Operation, - AuthorizationOperationsListOptionalParams + AuthorizationOperationsListOptionalParams, } from "../models"; /// @@ -20,6 +20,6 @@ export interface AuthorizationOperations { * @param options The options parameters. */ list( - options?: AuthorizationOperationsListOptionalParams + options?: AuthorizationOperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/locks/arm-locks/src/operationsInterfaces/managementLocks.ts b/sdk/locks/arm-locks/src/operationsInterfaces/managementLocks.ts index 7ffff412119f..91f5d56bacf3 100644 --- a/sdk/locks/arm-locks/src/operationsInterfaces/managementLocks.ts +++ b/sdk/locks/arm-locks/src/operationsInterfaces/managementLocks.ts @@ -32,7 +32,7 @@ import { ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse, ManagementLocksDeleteAtSubscriptionLevelOptionalParams, ManagementLocksGetAtSubscriptionLevelOptionalParams, - ManagementLocksGetAtSubscriptionLevelResponse + ManagementLocksGetAtSubscriptionLevelResponse, } from "../models"; /// @@ -45,7 +45,7 @@ export interface ManagementLocks { */ listAtResourceGroupLevel( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all the management locks for a resource or any level below resource. @@ -63,14 +63,14 @@ export interface ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all the management locks for a subscription. * @param options The options parameters. */ listAtSubscriptionLevel( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all the management locks for a scope. @@ -83,7 +83,7 @@ export interface ManagementLocks { */ listByScope( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): PagedAsyncIterableIterator; /** * When you apply a lock at a parent scope, all child resources inherit the same lock. To create @@ -100,7 +100,7 @@ export interface ManagementLocks { resourceGroupName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams, ): Promise; /** * To delete management locks, you must have access to Microsoft.Authorization/* or @@ -113,7 +113,7 @@ export interface ManagementLocks { deleteAtResourceGroupLevel( resourceGroupName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams + options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams, ): Promise; /** * Gets a management lock at the resource group level. @@ -124,7 +124,7 @@ export interface ManagementLocks { getAtResourceGroupLevel( resourceGroupName: string, lockName: string, - options?: ManagementLocksGetAtResourceGroupLevelOptionalParams + options?: ManagementLocksGetAtResourceGroupLevelOptionalParams, ): Promise; /** * Create or update a management lock by scope. @@ -141,7 +141,7 @@ export interface ManagementLocks { scope: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateByScopeOptionalParams + options?: ManagementLocksCreateOrUpdateByScopeOptionalParams, ): Promise; /** * Delete a management lock by scope. @@ -152,7 +152,7 @@ export interface ManagementLocks { deleteByScope( scope: string, lockName: string, - options?: ManagementLocksDeleteByScopeOptionalParams + options?: ManagementLocksDeleteByScopeOptionalParams, ): Promise; /** * Get a management lock by scope. @@ -163,7 +163,7 @@ export interface ManagementLocks { getByScope( scope: string, lockName: string, - options?: ManagementLocksGetByScopeOptionalParams + options?: ManagementLocksGetByScopeOptionalParams, ): Promise; /** * When you apply a lock at a parent scope, all child resources inherit the same lock. To create @@ -188,7 +188,7 @@ export interface ManagementLocks { resourceName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams, ): Promise; /** * To delete management locks, you must have access to Microsoft.Authorization/* or @@ -211,7 +211,7 @@ export interface ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceLevelOptionalParams + options?: ManagementLocksDeleteAtResourceLevelOptionalParams, ): Promise; /** * Get the management lock of a resource or any level below resource. @@ -230,7 +230,7 @@ export interface ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksGetAtResourceLevelOptionalParams + options?: ManagementLocksGetAtResourceLevelOptionalParams, ): Promise; /** * When you apply a lock at a parent scope, all child resources inherit the same lock. To create @@ -245,7 +245,7 @@ export interface ManagementLocks { createOrUpdateAtSubscriptionLevel( lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams, ): Promise; /** * To delete management locks, you must have access to Microsoft.Authorization/* or @@ -256,7 +256,7 @@ export interface ManagementLocks { */ deleteAtSubscriptionLevel( lockName: string, - options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams + options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams, ): Promise; /** * Gets a management lock at the subscription level. @@ -265,6 +265,6 @@ export interface ManagementLocks { */ getAtSubscriptionLevel( lockName: string, - options?: ManagementLocksGetAtSubscriptionLevelOptionalParams + options?: ManagementLocksGetAtSubscriptionLevelOptionalParams, ): Promise; } diff --git a/sdk/locks/arm-locks/src/pagingHelper.ts b/sdk/locks/arm-locks/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/locks/arm-locks/test/sampleTest.ts b/sdk/locks/arm-locks/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /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..4bae17dce511 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" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/managedapplications/arm-managedapplications/CHANGELOG.md b/sdk/managedapplications/arm-managedapplications/CHANGELOG.md index 9d1f1444e5c3..ca8652d8e242 100644 --- a/sdk/managedapplications/arm-managedapplications/CHANGELOG.md +++ b/sdk/managedapplications/arm-managedapplications/CHANGELOG.md @@ -1,5 +1,118 @@ # Release History +## 4.0.0 (2024-12-10) + +### Features Added + + - Added operation ApplicationDefinitions.beginCreateOrUpdate + - Added operation ApplicationDefinitions.beginCreateOrUpdateAndWait + - Added operation ApplicationDefinitions.beginCreateOrUpdateById + - Added operation ApplicationDefinitions.beginCreateOrUpdateByIdAndWait + - Added operation ApplicationDefinitions.beginDelete + - Added operation ApplicationDefinitions.beginDeleteAndWait + - Added operation ApplicationDefinitions.beginDeleteById + - Added operation ApplicationDefinitions.beginDeleteByIdAndWait + - Added operation Applications.update + - Added operation Applications.updateById + - Added Interface ApplicationProviderAuthorization + - Interface ApplicationDefinitionsCreateOrUpdateByIdOptionalParams has a new optional parameter resumeFrom + - Interface ApplicationDefinitionsCreateOrUpdateByIdOptionalParams has a new optional parameter updateIntervalInMs + - Interface ApplicationDefinitionsCreateOrUpdateOptionalParams has a new optional parameter resumeFrom + - Interface ApplicationDefinitionsCreateOrUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface ApplicationDefinitionsDeleteByIdOptionalParams has a new optional parameter resumeFrom + - Interface ApplicationDefinitionsDeleteByIdOptionalParams has a new optional parameter updateIntervalInMs + - Interface ApplicationDefinitionsDeleteOptionalParams has a new optional parameter resumeFrom + - Interface ApplicationDefinitionsDeleteOptionalParams has a new optional parameter updateIntervalInMs + - Interface ErrorResponse has a new optional parameter errorCode + - Interface ErrorResponse has a new optional parameter errorMessage + - Interface ErrorResponse has a new optional parameter httpStatus + - Interface GenericResource has a new optional parameter identity + - Enum KnownProvisioningState has a new value Created + - Enum KnownProvisioningState has a new value Creating + - Enum KnownProvisioningState has a new value Ready + +### Breaking Changes + + - Removed operation group JitRequests + - Removed operation ApplicationDefinitions.createOrUpdate + - Removed operation ApplicationDefinitions.createOrUpdateById + - Removed operation ApplicationDefinitions.delete + - Removed operation ApplicationDefinitions.deleteById + - Removed operation ApplicationDefinitions.listBySubscription + - Removed operation ApplicationDefinitions.update + - Removed operation ApplicationDefinitions.updateById + - Removed operation Applications.beginRefreshPermissions + - Removed operation Applications.beginRefreshPermissionsAndWait + - Removed operation Applications.beginUpdate + - Removed operation Applications.beginUpdateAccess + - Removed operation Applications.beginUpdateAccessAndWait + - Removed operation Applications.beginUpdateAndWait + - Removed operation Applications.beginUpdateById + - Removed operation Applications.beginUpdateByIdAndWait + - Removed operation Applications.listAllowedUpgradePlans + - Removed operation Applications.listTokens + - Interface Application no longer has parameter artifacts + - Interface Application no longer has parameter authorizations + - Interface Application no longer has parameter billingDetails + - Interface Application no longer has parameter createdBy + - Interface Application no longer has parameter customerSupport + - Interface Application no longer has parameter jitAccessPolicy + - Interface Application no longer has parameter managementMode + - Interface Application no longer has parameter publisherTenantId + - Interface Application no longer has parameter supportUrls + - Interface Application no longer has parameter updatedBy + - Interface ApplicationDefinition no longer has parameter deploymentPolicy + - Interface ApplicationDefinition no longer has parameter lockingPolicy + - Interface ApplicationDefinition no longer has parameter managementPolicy + - Interface ApplicationDefinition no longer has parameter notificationPolicy + - Interface ApplicationDefinition no longer has parameter policies + - Interface ApplicationDefinition no longer has parameter storageAccountId + - Interface ApplicationPatchable no longer has parameter artifacts + - Interface ApplicationPatchable no longer has parameter authorizations + - Interface ApplicationPatchable no longer has parameter billingDetails + - Interface ApplicationPatchable no longer has parameter createdBy + - Interface ApplicationPatchable no longer has parameter customerSupport + - Interface ApplicationPatchable no longer has parameter jitAccessPolicy + - Interface ApplicationPatchable no longer has parameter managementMode + - Interface ApplicationPatchable no longer has parameter publisherTenantId + - Interface ApplicationPatchable no longer has parameter supportUrls + - Interface ApplicationPatchable no longer has parameter updatedBy + - Interface ApplicationsUpdateByIdOptionalParams no longer has parameter resumeFrom + - Interface ApplicationsUpdateByIdOptionalParams no longer has parameter updateIntervalInMs + - Interface ApplicationsUpdateOptionalParams no longer has parameter resumeFrom + - Interface ApplicationsUpdateOptionalParams no longer has parameter updateIntervalInMs + - Interface ErrorResponse no longer has parameter error + - Interface Identity no longer has parameter userAssignedIdentities + - Interface Operation no longer has parameter actionType + - Interface Operation no longer has parameter isDataAction + - Interface Operation no longer has parameter origin + - Interface OperationDisplay no longer has parameter description + - Interface Resource no longer has parameter systemData + - Parameter managedResourceGroupId of interface Application is now required + - Parameter authorizations of interface ApplicationDefinition is now required + - Type of parameter name of interface ApplicationArtifact is changed from ApplicationArtifactName to string + - Type of parameter artifacts of interface ApplicationDefinition is changed from ApplicationDefinitionArtifact[] to ApplicationArtifact[] + - Type of parameter authorizations of interface ApplicationDefinition is changed from ApplicationAuthorization[] to ApplicationProviderAuthorization[] + - Type of parameter isEnabled of interface ApplicationDefinition is changed from boolean to string + - Type of parameter parameters of interface ApplicationsUpdateByIdOptionalParams is changed from ApplicationPatchable to Application + - Type of parameter type of interface Identity is changed from ResourceIdentityType to "SystemAssigned" + - Class ApplicationClient no longer has parameter jitRequests + - Removed Enum KnownActionType + - Removed Enum KnownApplicationArtifactName + - Removed Enum KnownApplicationDefinitionArtifactName + - Removed Enum KnownApplicationManagementMode + - Removed Enum KnownCreatedByType + - Removed Enum KnownDeploymentMode + - Removed Enum KnownJitApprovalMode + - Removed Enum KnownJitApproverType + - Removed Enum KnownJitRequestState + - Removed Enum KnownJitSchedulingType + - Removed Enum KnownOrigin + - Removed Enum KnownStatus + - Removed Enum KnownSubstatus + - Enum KnownProvisioningState no longer has value NotSpecified + + ## 3.0.0 (2023-09-06) ### Features Added @@ -195,7 +308,7 @@ ## 2.0.1 (2022-04-18) -### Features Added +**features** - Bug fix @@ -207,4 +320,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/managedapplications/arm-managedapplications/LICENSE b/sdk/managedapplications/arm-managedapplications/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/managedapplications/arm-managedapplications/LICENSE +++ b/sdk/managedapplications/arm-managedapplications/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +Copyright (c) 2024 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/managedapplications/arm-managedapplications/README.md b/sdk/managedapplications/arm-managedapplications/README.md index ea165ee437ec..4cf3e191c482 100644 --- a/sdk/managedapplications/arm-managedapplications/README.md +++ b/sdk/managedapplications/arm-managedapplications/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Application** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/managedapplications/arm-managedapplications/_meta.json b/sdk/managedapplications/arm-managedapplications/_meta.json index 91d39c38b229..267db4618701 100644 --- a/sdk/managedapplications/arm-managedapplications/_meta.json +++ b/sdk/managedapplications/arm-managedapplications/_meta.json @@ -1,8 +1,8 @@ { - "commit": "baa82396a21dcc1c79a6aeea185589749515012d", - "readme": "specification/solutions/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\solutions\\resource-manager\\readme.md --use=@autorest/typescript@6.0.8 --generate-sample=true", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", - "use": "@autorest/typescript@6.0.8" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/managedapplications/arm-managedapplications/package.json b/sdk/managedapplications/arm-managedapplications/package.json index 0b4032294c01..78be44cf827b 100644 --- a/sdk/managedapplications/arm-managedapplications/package.json +++ b/sdk/managedapplications/arm-managedapplications/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ApplicationClient.", - "version": "3.0.0", + "version": "4.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.7.0", "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.12.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -28,18 +28,19 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-managedapplications.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -67,28 +68,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -101,13 +102,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/managedapplications/arm-managedapplications", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-managedapplications?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/managedapplications/arm-managedapplications" +} \ No newline at end of file diff --git a/sdk/managedapplications/arm-managedapplications/review/arm-managedapplications.api.md b/sdk/managedapplications/arm-managedapplications/review/arm-managedapplications.api.md index 1d237eded796..5e482eb6142f 100644 --- a/sdk/managedapplications/arm-managedapplications/review/arm-managedapplications.api.md +++ b/sdk/managedapplications/arm-managedapplications/review/arm-managedapplications.api.md @@ -10,59 +10,26 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; -// @public -export type ActionType = string; - -// @public -export interface AllowedUpgradePlansResult { - value?: Plan[]; -} - // @public export interface Application extends GenericResource { applicationDefinitionId?: string; - readonly artifacts?: ApplicationArtifact[]; - readonly authorizations?: ApplicationAuthorization[]; - readonly billingDetails?: ApplicationBillingDetailsDefinition; - readonly createdBy?: ApplicationClientDetails; - readonly customerSupport?: ApplicationPackageContact; - identity?: Identity; - jitAccessPolicy?: ApplicationJitAccessPolicy; kind: string; - managedResourceGroupId?: string; - readonly managementMode?: ApplicationManagementMode; + managedResourceGroupId: string; readonly outputs?: Record; parameters?: Record; plan?: Plan; readonly provisioningState?: ProvisioningState; - readonly publisherTenantId?: string; - readonly supportUrls?: ApplicationPackageSupportUrls; - readonly updatedBy?: ApplicationClientDetails; } // @public export interface ApplicationArtifact { - name: ApplicationArtifactName; - type: ApplicationArtifactType; - uri: string; -} - -// @public -export type ApplicationArtifactName = string; - -// @public -export type ApplicationArtifactType = "NotSpecified" | "Template" | "Custom"; - -// @public -export interface ApplicationAuthorization { - principalId: string; - roleDefinitionId: string; + name?: string; + type?: ApplicationArtifactType; + uri?: string; } // @public -export interface ApplicationBillingDetailsDefinition { - resourceUsageId?: string; -} +export type ApplicationArtifactType = "Template" | "Custom"; // @public (undocumented) export class ApplicationClient extends coreClient.ServiceClient { @@ -76,20 +43,11 @@ export class ApplicationClient extends coreClient.ServiceClient { applicationDefinitions: ApplicationDefinitions; // (undocumented) applications: Applications; - // (undocumented) - jitRequests: JitRequests; listOperations(options?: ListOperationsOptionalParams): PagedAsyncIterableIterator; // (undocumented) subscriptionId?: string; } -// @public -export interface ApplicationClientDetails { - applicationId?: string; - oid?: string; - puid?: string; -} - // @public export interface ApplicationClientOptionalParams extends coreClient.ServiceClientOptions { $host?: string; @@ -99,62 +57,42 @@ export interface ApplicationClientOptionalParams extends coreClient.ServiceClien // @public export interface ApplicationDefinition extends GenericResource { - artifacts?: ApplicationDefinitionArtifact[]; - authorizations?: ApplicationAuthorization[]; + artifacts?: ApplicationArtifact[]; + authorizations: ApplicationProviderAuthorization[]; createUiDefinition?: Record; - deploymentPolicy?: ApplicationDeploymentPolicy; description?: string; displayName?: string; - isEnabled?: boolean; - lockingPolicy?: ApplicationPackageLockingPolicyDefinition; + isEnabled?: string; lockLevel: ApplicationLockLevel; mainTemplate?: Record; - managementPolicy?: ApplicationManagementPolicy; - notificationPolicy?: ApplicationNotificationPolicy; packageFileUri?: string; - policies?: ApplicationPolicy[]; - storageAccountId?: string; } -// @public -export interface ApplicationDefinitionArtifact { - name: ApplicationDefinitionArtifactName; - type: ApplicationArtifactType; - uri: string; -} - -// @public -export type ApplicationDefinitionArtifactName = string; - // @public export interface ApplicationDefinitionListResult { nextLink?: string; value?: ApplicationDefinition[]; } -// @public -export interface ApplicationDefinitionPatchable { - tags?: { - [propertyName: string]: string; - }; -} - // @public export interface ApplicationDefinitions { - createOrUpdate(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateOptionalParams): Promise; - createOrUpdateById(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams): Promise; - delete(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteOptionalParams): Promise; - deleteById(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteByIdOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateOptionalParams): Promise, ApplicationDefinitionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdateById(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams): Promise, ApplicationDefinitionsCreateOrUpdateByIdResponse>>; + beginCreateOrUpdateByIdAndWait(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams): Promise; + beginDelete(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteOptionalParams): Promise; + beginDeleteById(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteByIdOptionalParams): Promise, void>>; + beginDeleteByIdAndWait(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteByIdOptionalParams): Promise; get(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsGetOptionalParams): Promise; getById(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsGetByIdOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ApplicationDefinitionsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: ApplicationDefinitionsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinitionPatchable, options?: ApplicationDefinitionsUpdateOptionalParams): Promise; - updateById(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinitionPatchable, options?: ApplicationDefinitionsUpdateByIdOptionalParams): Promise; } // @public export interface ApplicationDefinitionsCreateOrUpdateByIdOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -162,6 +100,8 @@ export type ApplicationDefinitionsCreateOrUpdateByIdResponse = ApplicationDefini // @public export interface ApplicationDefinitionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -169,10 +109,14 @@ export type ApplicationDefinitionsCreateOrUpdateResponse = ApplicationDefinition // @public export interface ApplicationDefinitionsDeleteByIdOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public export interface ApplicationDefinitionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -203,47 +147,6 @@ export interface ApplicationDefinitionsListByResourceGroupOptionalParams extends // @public export type ApplicationDefinitionsListByResourceGroupResponse = ApplicationDefinitionListResult; -// @public -export interface ApplicationDefinitionsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationDefinitionsListBySubscriptionNextResponse = ApplicationDefinitionListResult; - -// @public -export interface ApplicationDefinitionsListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationDefinitionsListBySubscriptionResponse = ApplicationDefinitionListResult; - -// @public -export interface ApplicationDefinitionsUpdateByIdOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationDefinitionsUpdateByIdResponse = ApplicationDefinition; - -// @public -export interface ApplicationDefinitionsUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationDefinitionsUpdateResponse = ApplicationDefinition; - -// @public -export interface ApplicationDeploymentPolicy { - deploymentMode: DeploymentMode; -} - -// @public -export interface ApplicationJitAccessPolicy { - jitAccessEnabled: boolean; - jitApprovalMode?: JitApprovalMode; - jitApprovers?: JitApproverDefinition[]; - maximumJitAccessDuration?: string; -} - // @public export interface ApplicationListResult { nextLink?: string; @@ -253,70 +156,21 @@ export interface ApplicationListResult { // @public export type ApplicationLockLevel = "CanNotDelete" | "ReadOnly" | "None"; -// @public -export type ApplicationManagementMode = string; - -// @public -export interface ApplicationManagementPolicy { - mode?: ApplicationManagementMode; -} - -// @public -export interface ApplicationNotificationEndpoint { - uri: string; -} - -// @public -export interface ApplicationNotificationPolicy { - notificationEndpoints: ApplicationNotificationEndpoint[]; -} - -// @public -export interface ApplicationPackageContact { - contactName?: string; - email: string; - phone: string; -} - -// @public -export interface ApplicationPackageLockingPolicyDefinition { - allowedActions?: string[]; - allowedDataActions?: string[]; -} - -// @public -export interface ApplicationPackageSupportUrls { - governmentCloud?: string; - publicAzure?: string; -} - // @public export interface ApplicationPatchable extends GenericResource { applicationDefinitionId?: string; - readonly artifacts?: ApplicationArtifact[]; - readonly authorizations?: ApplicationAuthorization[]; - readonly billingDetails?: ApplicationBillingDetailsDefinition; - readonly createdBy?: ApplicationClientDetails; - readonly customerSupport?: ApplicationPackageContact; - identity?: Identity; - jitAccessPolicy?: ApplicationJitAccessPolicy; kind?: string; managedResourceGroupId?: string; - readonly managementMode?: ApplicationManagementMode; readonly outputs?: Record; parameters?: Record; plan?: PlanPatchable; readonly provisioningState?: ProvisioningState; - readonly publisherTenantId?: string; - readonly supportUrls?: ApplicationPackageSupportUrls; - readonly updatedBy?: ApplicationClientDetails; } // @public -export interface ApplicationPolicy { - name?: string; - parameters?: string; - policyDefinitionId?: string; +export interface ApplicationProviderAuthorization { + principalId: string; + roleDefinitionId: string; } // @public @@ -329,20 +183,12 @@ export interface Applications { beginDeleteAndWait(resourceGroupName: string, applicationName: string, options?: ApplicationsDeleteOptionalParams): Promise; beginDeleteById(applicationId: string, options?: ApplicationsDeleteByIdOptionalParams): Promise, void>>; beginDeleteByIdAndWait(applicationId: string, options?: ApplicationsDeleteByIdOptionalParams): Promise; - beginRefreshPermissions(resourceGroupName: string, applicationName: string, options?: ApplicationsRefreshPermissionsOptionalParams): Promise, void>>; - beginRefreshPermissionsAndWait(resourceGroupName: string, applicationName: string, options?: ApplicationsRefreshPermissionsOptionalParams): Promise; - beginUpdate(resourceGroupName: string, applicationName: string, options?: ApplicationsUpdateOptionalParams): Promise, ApplicationsUpdateResponse>>; - beginUpdateAccess(resourceGroupName: string, applicationName: string, parameters: UpdateAccessDefinition, options?: ApplicationsUpdateAccessOptionalParams): Promise, void>>; - beginUpdateAccessAndWait(resourceGroupName: string, applicationName: string, parameters: UpdateAccessDefinition, options?: ApplicationsUpdateAccessOptionalParams): Promise; - beginUpdateAndWait(resourceGroupName: string, applicationName: string, options?: ApplicationsUpdateOptionalParams): Promise; - beginUpdateById(applicationId: string, options?: ApplicationsUpdateByIdOptionalParams): Promise, ApplicationsUpdateByIdResponse>>; - beginUpdateByIdAndWait(applicationId: string, options?: ApplicationsUpdateByIdOptionalParams): Promise; get(resourceGroupName: string, applicationName: string, options?: ApplicationsGetOptionalParams): Promise; getById(applicationId: string, options?: ApplicationsGetByIdOptionalParams): Promise; - listAllowedUpgradePlans(resourceGroupName: string, applicationName: string, options?: ApplicationsListAllowedUpgradePlansOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ApplicationsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: ApplicationsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - listTokens(resourceGroupName: string, applicationName: string, parameters: ListTokenRequest, options?: ApplicationsListTokensOptionalParams): Promise; + update(resourceGroupName: string, applicationName: string, options?: ApplicationsUpdateOptionalParams): Promise; + updateById(applicationId: string, options?: ApplicationsUpdateByIdOptionalParams): Promise; } // @public @@ -389,13 +235,6 @@ export interface ApplicationsGetOptionalParams extends coreClient.OperationOptio // @public export type ApplicationsGetResponse = Application; -// @public -export interface ApplicationsListAllowedUpgradePlansOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationsListAllowedUpgradePlansResponse = AllowedUpgradePlansResult; - // @public export interface ApplicationsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { } @@ -424,73 +263,32 @@ export interface ApplicationsListBySubscriptionOptionalParams extends coreClient // @public export type ApplicationsListBySubscriptionResponse = ApplicationListResult; -// @public -export interface ApplicationsListTokensOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationsListTokensResponse = ManagedIdentityTokenResult; - -// @public -export interface ApplicationsRefreshPermissionsOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface ApplicationsUpdateAccessOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - // @public export interface ApplicationsUpdateByIdOptionalParams extends coreClient.OperationOptions { - parameters?: ApplicationPatchable; - resumeFrom?: string; - updateIntervalInMs?: number; + parameters?: Application; } // @public -export type ApplicationsUpdateByIdResponse = ApplicationPatchable; +export type ApplicationsUpdateByIdResponse = Application; // @public export interface ApplicationsUpdateOptionalParams extends coreClient.OperationOptions { parameters?: ApplicationPatchable; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type ApplicationsUpdateResponse = ApplicationPatchable; - -// @public -export type CreatedByType = string; - -// @public -export type DeploymentMode = string; - -// @public -export interface ErrorAdditionalInfo { - readonly info?: Record; - readonly type?: string; } // @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} +export type ApplicationsUpdateResponse = Application; // @public export interface ErrorResponse { - error?: ErrorDetail; + errorCode?: string; + errorMessage?: string; + httpStatus?: string; } // @public export interface GenericResource extends Resource { + identity?: Identity; managedBy?: string; sku?: Sku; } @@ -502,241 +300,24 @@ export function getContinuationToken(page: unknown): string | undefined; export interface Identity { readonly principalId?: string; readonly tenantId?: string; - type?: ResourceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedResourceIdentity; - }; -} - -// @public -export type JitApprovalMode = string; - -// @public -export interface JitApproverDefinition { - displayName?: string; - id: string; - type?: JitApproverType; -} - -// @public -export type JitApproverType = string; - -// @public -export interface JitAuthorizationPolicies { - principalId: string; - roleDefinitionId: string; -} - -// @public -export interface JitRequestDefinition extends Resource { - applicationResourceId?: string; - readonly createdBy?: ApplicationClientDetails; - jitAuthorizationPolicies?: JitAuthorizationPolicies[]; - readonly jitRequestState?: JitRequestState; - jitSchedulingPolicy?: JitSchedulingPolicy; - readonly provisioningState?: ProvisioningState; - readonly publisherTenantId?: string; - readonly updatedBy?: ApplicationClientDetails; -} - -// @public -export interface JitRequestDefinitionListResult { - nextLink?: string; - value?: JitRequestDefinition[]; -} - -// @public -export interface JitRequestMetadata { - originRequestId?: string; - requestorId?: string; - subjectDisplayName?: string; - tenantDisplayName?: string; -} - -// @public -export interface JitRequestPatchable { - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface JitRequests { - beginCreateOrUpdate(resourceGroupName: string, jitRequestName: string, parameters: JitRequestDefinition, options?: JitRequestsCreateOrUpdateOptionalParams): Promise, JitRequestsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, jitRequestName: string, parameters: JitRequestDefinition, options?: JitRequestsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, jitRequestName: string, options?: JitRequestsDeleteOptionalParams): Promise; - get(resourceGroupName: string, jitRequestName: string, options?: JitRequestsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: JitRequestsListByResourceGroupOptionalParams): Promise; - listBySubscription(options?: JitRequestsListBySubscriptionOptionalParams): Promise; - update(resourceGroupName: string, jitRequestName: string, parameters: JitRequestPatchable, options?: JitRequestsUpdateOptionalParams): Promise; -} - -// @public -export interface JitRequestsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type JitRequestsCreateOrUpdateResponse = JitRequestDefinition; - -// @public -export interface JitRequestsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface JitRequestsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type JitRequestsGetResponse = JitRequestDefinition; - -// @public -export interface JitRequestsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type JitRequestsListByResourceGroupResponse = JitRequestDefinitionListResult; - -// @public -export interface JitRequestsListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type JitRequestsListBySubscriptionResponse = JitRequestDefinitionListResult; - -// @public -export type JitRequestState = string; - -// @public -export interface JitRequestsUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type JitRequestsUpdateResponse = JitRequestDefinition; - -// @public -export interface JitSchedulingPolicy { - duration: string; - startTime: Date; - type: JitSchedulingType; -} - -// @public -export type JitSchedulingType = string; - -// @public -export enum KnownActionType { - Internal = "Internal" -} - -// @public -export enum KnownApplicationArtifactName { - Authorizations = "Authorizations", - CustomRoleDefinition = "CustomRoleDefinition", - NotSpecified = "NotSpecified", - ViewDefinition = "ViewDefinition" -} - -// @public -export enum KnownApplicationDefinitionArtifactName { - ApplicationResourceTemplate = "ApplicationResourceTemplate", - CreateUiDefinition = "CreateUiDefinition", - MainTemplateParameters = "MainTemplateParameters", - NotSpecified = "NotSpecified" -} - -// @public -export enum KnownApplicationManagementMode { - Managed = "Managed", - NotSpecified = "NotSpecified", - Unmanaged = "Unmanaged" -} - -// @public -export enum KnownCreatedByType { - Application = "Application", - Key = "Key", - ManagedIdentity = "ManagedIdentity", - User = "User" -} - -// @public -export enum KnownDeploymentMode { - Complete = "Complete", - Incremental = "Incremental", - NotSpecified = "NotSpecified" -} - -// @public -export enum KnownJitApprovalMode { - AutoApprove = "AutoApprove", - ManualApprove = "ManualApprove", - NotSpecified = "NotSpecified" -} - -// @public -export enum KnownJitApproverType { - Group = "group", - User = "user" -} - -// @public -export enum KnownJitRequestState { - Approved = "Approved", - Canceled = "Canceled", - Denied = "Denied", - Expired = "Expired", - Failed = "Failed", - NotSpecified = "NotSpecified", - Pending = "Pending", - Timeout = "Timeout" -} - -// @public -export enum KnownJitSchedulingType { - NotSpecified = "NotSpecified", - Once = "Once", - Recurring = "Recurring" -} - -// @public -export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" + type?: "SystemAssigned"; } // @public export enum KnownProvisioningState { Accepted = "Accepted", Canceled = "Canceled", + Created = "Created", + Creating = "Creating", Deleted = "Deleted", Deleting = "Deleting", Failed = "Failed", - NotSpecified = "NotSpecified", + Ready = "Ready", Running = "Running", Succeeded = "Succeeded", Updating = "Updating" } -// @public -export enum KnownStatus { - Elevate = "Elevate", - NotSpecified = "NotSpecified", - Remove = "Remove" -} - -// @public -export enum KnownSubstatus { - Approved = "Approved", - Denied = "Denied", - Expired = "Expired", - Failed = "Failed", - NotSpecified = "NotSpecified", - Timeout = "Timeout" -} - // @public export interface ListOperationsNextOptionalParams extends coreClient.OperationOptions { } @@ -751,54 +332,25 @@ export interface ListOperationsOptionalParams extends coreClient.OperationOption // @public export type ListOperationsResponse = OperationListResult; -// @public -export interface ListTokenRequest { - authorizationAudience?: string; - userAssignedIdentities?: string[]; -} - -// @public -export interface ManagedIdentityToken { - accessToken?: string; - authorizationAudience?: string; - expiresIn?: string; - expiresOn?: string; - notBefore?: string; - resourceId?: string; - tokenType?: string; -} - -// @public -export interface ManagedIdentityTokenResult { - value?: ManagedIdentityToken[]; -} - // @public export interface Operation { - readonly actionType?: ActionType; display?: OperationDisplay; - readonly isDataAction?: boolean; - readonly name?: string; - readonly origin?: Origin; + name?: string; } // @public export interface OperationDisplay { - readonly description?: string; - readonly operation?: string; - readonly provider?: string; - readonly resource?: string; + operation?: string; + provider?: string; + resource?: string; } // @public export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; + nextLink?: string; + value?: Operation[]; } -// @public -export type Origin = string; - // @public export interface Plan { name: string; @@ -825,16 +377,12 @@ export interface Resource { readonly id?: string; location?: string; readonly name?: string; - readonly systemData?: SystemData; tags?: { [propertyName: string]: string; }; readonly type?: string; } -// @public -export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; - // @public export interface Sku { capacity?: number; @@ -845,36 +393,6 @@ export interface Sku { tier?: string; } -// @public -export type Status = string; - -// @public -export type Substatus = string; - -// @public -export interface SystemData { - createdAt?: Date; - createdBy?: string; - createdByType?: CreatedByType; - lastModifiedAt?: Date; - lastModifiedBy?: string; - lastModifiedByType?: CreatedByType; -} - -// @public -export interface UpdateAccessDefinition { - approver?: string; - metadata: JitRequestMetadata; - status: Status; - subStatus: Substatus; -} - -// @public -export interface UserAssignedResourceIdentity { - readonly principalId?: string; - readonly tenantId?: string; -} - // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/managedapplications/arm-managedapplications/sample.env b/sdk/managedapplications/arm-managedapplications/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/managedapplications/arm-managedapplications/sample.env +++ b/sdk/managedapplications/arm-managedapplications/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts b/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts index 1f70f932a088..f19fb0c0accf 100644 --- a/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts +++ b/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts @@ -11,21 +11,13 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "./pagingHelper"; -import { - ApplicationsImpl, - ApplicationDefinitionsImpl, - JitRequestsImpl -} from "./operations"; -import { - Applications, - ApplicationDefinitions, - JitRequests -} from "./operationsInterfaces"; +import { ApplicationsImpl, ApplicationDefinitionsImpl } from "./operations"; +import { Applications, ApplicationDefinitions } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; import { @@ -34,7 +26,7 @@ import { ListOperationsNextOptionalParams, ListOperationsOptionalParams, ListOperationsResponse, - ListOperationsNextResponse + ListOperationsNextResponse, } from "./models"; /// @@ -52,16 +44,16 @@ export class ApplicationClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ApplicationClientOptionalParams + options?: ApplicationClientOptionalParams, ); constructor( credentials: coreAuth.TokenCredential, - options?: ApplicationClientOptionalParams + options?: ApplicationClientOptionalParams, ); constructor( credentials: coreAuth.TokenCredential, subscriptionIdOrOptions?: ApplicationClientOptionalParams | string, - options?: ApplicationClientOptionalParams + options?: ApplicationClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -81,10 +73,10 @@ export class ApplicationClient extends coreClient.ServiceClient { } const defaults: ApplicationClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-managedapplications/3.0.0`; + const packageDetails = `azsdk-js-arm-managedapplications/4.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -94,20 +86,21 @@ export class ApplicationClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -117,7 +110,7 @@ export class ApplicationClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -127,9 +120,9 @@ export class ApplicationClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -137,10 +130,9 @@ export class ApplicationClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-07-01"; + this.apiVersion = options.apiVersion || "2018-06-01"; this.applications = new ApplicationsImpl(this); this.applicationDefinitions = new ApplicationDefinitionsImpl(this); - this.jitRequests = new JitRequestsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -153,7 +145,7 @@ export class ApplicationClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -167,7 +159,7 @@ export class ApplicationClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -177,7 +169,7 @@ export class ApplicationClient extends coreClient.ServiceClient { * @param options The options parameters. */ public listOperations( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listOperationsPagingAll(options); return { @@ -192,13 +184,13 @@ export class ApplicationClient extends coreClient.ServiceClient { throw new Error("maxPageSize is not supported by this operation."); } return this.listOperationsPagingPage(options, settings); - } + }, }; } private async *listOperationsPagingPage( options?: ListOperationsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ListOperationsResponse; let continuationToken = settings?.continuationToken; @@ -219,7 +211,7 @@ export class ApplicationClient extends coreClient.ServiceClient { } private async *listOperationsPagingAll( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listOperationsPagingPage(options)) { yield* page; @@ -231,7 +223,7 @@ export class ApplicationClient extends coreClient.ServiceClient { * @param options The options parameters. */ private _listOperations( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): Promise { return this.sendOperationRequest({ options }, listOperationsOperationSpec); } @@ -243,17 +235,16 @@ export class ApplicationClient extends coreClient.ServiceClient { */ private _listOperationsNext( nextLink: string, - options?: ListOperationsNextOptionalParams + options?: ListOperationsNextOptionalParams, ): Promise { return this.sendOperationRequest( { nextLink, options }, - listOperationsNextOperationSpec + listOperationsNextOperationSpec, ); } applications: Applications; applicationDefinitions: ApplicationDefinitions; - jitRequests: JitRequests; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -263,29 +254,23 @@ const listOperationsOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts b/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts index 52f6eaacfb83..5f88efab981b 100644 --- a/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts +++ b/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts @@ -28,15 +28,15 @@ export function createLroSpec(inputs: { sendInitialRequest: () => sendOperationFn(args, spec), sendPollRequest: ( path: string, - options?: { abortSignal?: AbortSignalLike } + options?: { abortSignal?: AbortSignalLike }, ) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/managedapplications/arm-managedapplications/src/models/index.ts b/sdk/managedapplications/arm-managedapplications/src/models/index.ts index 0882498520ef..c0cd856834c9 100644 --- a/sdk/managedapplications/arm-managedapplications/src/models/index.ts +++ b/sdk/managedapplications/arm-managedapplications/src/models/index.ts @@ -8,191 +8,30 @@ 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. */ +/** Result of the request to list Microsoft.Solutions operations. It contains a list of operations and a 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; + /** List of Microsoft.Solutions operations. */ + value?: Operation[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; } -/** Details of a REST API operation, returned from the Resource Provider Operations API */ +/** Microsoft.Solutions operation */ 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. */ + /** Operation name: {provider}/{resource}/{operation} */ + name?: string; + /** The object that represents the 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. */ +/** The object that represents the 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; -} - -/** 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 object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * 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?: ErrorDetail[]; - /** - * 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; -} - -/** Managed application billing details definition. */ -export interface ApplicationBillingDetailsDefinition { - /** The managed application resource usage Id. */ - resourceUsageId?: string; -} - -/** Managed application Jit access policy. */ -export interface ApplicationJitAccessPolicy { - /** Whether the JIT access is enabled. */ - jitAccessEnabled: boolean; - /** JIT approval mode. */ - jitApprovalMode?: JitApprovalMode; - /** The JIT approvers */ - jitApprovers?: JitApproverDefinition[]; - /** The maximum duration JIT access is granted. This is an ISO8601 time period value. */ - maximumJitAccessDuration?: string; -} - -/** JIT approver definition. */ -export interface JitApproverDefinition { - /** The approver service principal Id. */ - id: string; - /** The approver type. */ - type?: JitApproverType; - /** The approver display name. */ - displayName?: string; -} - -/** The managed application provider authorization. */ -export interface ApplicationAuthorization { - /** The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the managed application resources. */ - principalId: string; - /** The provider's role definition identifier. This role will define all the permissions that the provider must have on the managed application's container resource group. This role definition cannot have permission to delete the resource group. */ - roleDefinitionId: string; -} - -/** The application package contact information. */ -export interface ApplicationPackageContact { - /** The contact name. */ - contactName?: string; - /** The contact email. */ - email: string; - /** The contact phone number. */ - phone: string; -} - -/** The appliance package support URLs. */ -export interface ApplicationPackageSupportUrls { - /** The public azure support URL. */ - publicAzure?: string; - /** The government cloud support URL. */ - governmentCloud?: string; -} - -/** Managed application artifact. */ -export interface ApplicationArtifact { - /** The managed application artifact name. */ - name: ApplicationArtifactName; - /** The managed application artifact blob uri. */ - uri: string; - /** The managed application artifact type. */ - type: ApplicationArtifactType; -} - -/** The application client details to track the entity creating/updating the managed app resource. */ -export interface ApplicationClientDetails { - /** The client Oid. */ - oid?: string; - /** The client Puid */ - puid?: string; - /** The client application Id. */ - applicationId?: string; + /** Service provider: Microsoft.Solutions */ + provider?: string; + /** Resource on which the operation is performed: Application, JitRequest, etc. */ + resource?: string; + /** Operation type: Read, write, delete, etc. */ + operation?: string; } /** Plan for the managed application. */ @@ -209,40 +48,6 @@ export interface Plan { version: string; } -/** Identity for the resource. */ -export interface Identity { - /** - * The principal ID of resource identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The identity type. */ - type?: ResourceIdentityType; - /** The list of user identities associated with the resource. The user identity dictionary key references will be resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedResourceIdentity; - }; -} - -/** Represents the user assigned identity that is contained within the UserAssignedIdentities dictionary on ResourceIdentity */ -export interface UserAssignedResourceIdentity { - /** - * The principal id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; -} - /** SKU for the resource. */ export interface Sku { /** The SKU name. */ @@ -259,6 +64,22 @@ export interface Sku { capacity?: number; } +/** Identity for the resource. */ +export interface Identity { + /** + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. */ + type?: "SystemAssigned"; +} + /** Resource information. */ export interface Resource { /** @@ -280,27 +101,16 @@ export interface Resource { location?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; +/** Error response indicates managed application is not able to process the incoming request. The reason is provided in the error message. */ +export interface ErrorResponse { + /** Http status code. */ + httpStatus?: string; + /** Error code. */ + errorCode?: string; + /** Error message indicating why the operation failed. */ + errorMessage?: string; } /** Plan for the managed application. */ @@ -317,62 +127,22 @@ export interface PlanPatchable { version?: string; } -/** Application definition artifact. */ -export interface ApplicationDefinitionArtifact { - /** The managed application definition artifact name. */ - name: ApplicationDefinitionArtifactName; - /** The managed application definition artifact blob uri. */ - uri: string; - /** The managed application definition artifact type. */ - type: ApplicationArtifactType; -} - -/** Managed application notification policy. */ -export interface ApplicationNotificationPolicy { - /** The managed application notification endpoint. */ - notificationEndpoints: ApplicationNotificationEndpoint[]; -} - -/** Managed application notification endpoint. */ -export interface ApplicationNotificationEndpoint { - /** The managed application notification endpoint uri. */ - uri: string; -} - -/** Managed application locking policy. */ -export interface ApplicationPackageLockingPolicyDefinition { - /** The deny assignment excluded actions. */ - allowedActions?: string[]; - /** The deny assignment excluded data actions. */ - allowedDataActions?: string[]; -} - -/** Managed application deployment policy. */ -export interface ApplicationDeploymentPolicy { - /** The managed application deployment mode. */ - deploymentMode: DeploymentMode; -} - -/** Managed application management policy. */ -export interface ApplicationManagementPolicy { - /** The managed application management mode. */ - mode?: ApplicationManagementMode; +/** The managed application provider authorization. */ +export interface ApplicationProviderAuthorization { + /** The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the managed application resources. */ + principalId: string; + /** The provider's role definition identifier. This role will define all the permissions that the provider must have on the managed application's container resource group. This role definition cannot have permission to delete the resource group. */ + roleDefinitionId: string; } -/** Managed application policy. */ -export interface ApplicationPolicy { - /** The policy name */ +/** Managed application artifact. */ +export interface ApplicationArtifact { + /** The managed application artifact name. */ name?: string; - /** The policy definition Id. */ - policyDefinitionId?: string; - /** The policy parameters. */ - parameters?: string; -} - -/** Information about an application definition request. */ -export interface ApplicationDefinitionPatchable { - /** Application definition tags */ - tags?: { [propertyName: string]: string }; + /** The managed application artifact blob uri. */ + uri?: string; + /** The managed application artifact type. */ + type?: ApplicationArtifactType; } /** List of managed application definitions. */ @@ -391,141 +161,14 @@ export interface ApplicationListResult { nextLink?: string; } -/** The JIT authorization policies. */ -export interface JitAuthorizationPolicies { - /** The the principal id that will be granted JIT access. */ - principalId: string; - /** The role definition id that will be granted to the Principal. */ - roleDefinitionId: string; -} - -/** The JIT scheduling policies. */ -export interface JitSchedulingPolicy { - /** The type of JIT schedule. */ - type: JitSchedulingType; - /** The required duration of the JIT request. */ - duration: string; - /** The start time of the request. */ - startTime: Date; -} - -/** Information about JIT request. */ -export interface JitRequestPatchable { - /** Jit request tags */ - tags?: { [propertyName: string]: string }; -} - -/** List of JIT requests. */ -export interface JitRequestDefinitionListResult { - /** The array of Jit request definition. */ - value?: JitRequestDefinition[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - -/** The array of plan. */ -export interface AllowedUpgradePlansResult { - /** The array of plans. */ - value?: Plan[]; -} - -/** Update access request definition. */ -export interface UpdateAccessDefinition { - /** The approver name. */ - approver?: string; - /** The JIT request metadata. */ - metadata: JitRequestMetadata; - /** The JIT status. */ - status: Status; - /** The JIT status. */ - subStatus: Substatus; -} - -/** The JIT request metadata. */ -export interface JitRequestMetadata { - /** The origin request id. */ - originRequestId?: string; - /** The requestor id. */ - requestorId?: string; - /** The publisher's tenant name. */ - tenantDisplayName?: string; - /** The subject display name. */ - subjectDisplayName?: string; -} - -/** List token request body. */ -export interface ListTokenRequest { - /** The authorization audience. */ - authorizationAudience?: string; - /** The user assigned identities. */ - userAssignedIdentities?: string[]; -} - -/** The array of managed identity tokens. */ -export interface ManagedIdentityTokenResult { - /** The array of managed identity tokens. */ - value?: ManagedIdentityToken[]; -} - -/** The managed identity token for the managed app resource. */ -export interface ManagedIdentityToken { - /** The requested access token. */ - accessToken?: string; - /** The number of seconds the access token will be valid. */ - expiresIn?: string; - /** The timespan when the access token expires. This is represented as the number of seconds from epoch. */ - expiresOn?: string; - /** The timespan when the access token takes effect. This is represented as the number of seconds from epoch. */ - notBefore?: string; - /** The aud (audience) the access token was request for. This is the same as what was provided in the listTokens request. */ - authorizationAudience?: string; - /** The Azure resource ID for the issued token. This is either the managed application ID or the user-assigned identity ID. */ - resourceId?: string; - /** The type of the token. */ - tokenType?: string; -} - /** Resource information. */ export interface GenericResource extends Resource { /** ID of the resource that manages this resource. */ managedBy?: string; /** The SKU of the resource. */ sku?: Sku; -} - -/** Information about JIT request definition. */ -export interface JitRequestDefinition extends Resource { - /** The parent application id. */ - applicationResourceId?: string; - /** - * The publisher tenant id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publisherTenantId?: string; - /** The JIT authorization policies. */ - jitAuthorizationPolicies?: JitAuthorizationPolicies[]; - /** The JIT request properties. */ - jitSchedulingPolicy?: JitSchedulingPolicy; - /** - * The JIT request provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * The JIT request state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly jitRequestState?: JitRequestState; - /** - * The client entity that created the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdBy?: ApplicationClientDetails; - /** - * The client entity that last updated the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly updatedBy?: ApplicationClientDetails; + /** The identity of the resource. */ + identity?: Identity; } /** Information about managed application. */ @@ -534,10 +177,8 @@ export interface Application extends GenericResource { plan?: Plan; /** The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. */ kind: string; - /** The identity of the resource. */ - identity?: Identity; /** The managed resource group Id. */ - managedResourceGroupId?: string; + managedResourceGroupId: string; /** The fully qualified path of managed application definition Id. */ applicationDefinitionId?: string; /** Name and value pairs that define the managed application parameters. It can be a JObject or a well formed JSON string. */ @@ -552,53 +193,6 @@ export interface Application extends GenericResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; - /** - * The managed application billing details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly billingDetails?: ApplicationBillingDetailsDefinition; - /** The managed application Jit access policy. */ - jitAccessPolicy?: ApplicationJitAccessPolicy; - /** - * The publisher tenant Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publisherTenantId?: string; - /** - * The read-only authorizations property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly authorizations?: ApplicationAuthorization[]; - /** - * The managed application management mode. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managementMode?: ApplicationManagementMode; - /** - * The read-only customer support property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly customerSupport?: ApplicationPackageContact; - /** - * The read-only support URLs property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly supportUrls?: ApplicationPackageSupportUrls; - /** - * The collection of managed application artifacts. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly artifacts?: ApplicationArtifact[]; - /** - * The client entity that created the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdBy?: ApplicationClientDetails; - /** - * The client entity that last updated the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly updatedBy?: ApplicationClientDetails; } /** Information about managed application. */ @@ -607,8 +201,6 @@ export interface ApplicationPatchable extends GenericResource { plan?: PlanPatchable; /** The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. */ kind?: string; - /** The identity of the resource. */ - identity?: Identity; /** The managed resource group Id. */ managedResourceGroupId?: string; /** The fully qualified path of managed application definition Id. */ @@ -625,53 +217,6 @@ export interface ApplicationPatchable extends GenericResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; - /** - * The managed application billing details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly billingDetails?: ApplicationBillingDetailsDefinition; - /** The managed application Jit access policy. */ - jitAccessPolicy?: ApplicationJitAccessPolicy; - /** - * The publisher tenant Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publisherTenantId?: string; - /** - * The read-only authorizations property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly authorizations?: ApplicationAuthorization[]; - /** - * The managed application management mode. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managementMode?: ApplicationManagementMode; - /** - * The read-only customer support property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly customerSupport?: ApplicationPackageContact; - /** - * The read-only support URLs property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly supportUrls?: ApplicationPackageSupportUrls; - /** - * The collection of managed application artifacts. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly artifacts?: ApplicationArtifact[]; - /** - * The client entity that created the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdBy?: ApplicationClientDetails; - /** - * The client entity that last updated the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly updatedBy?: ApplicationClientDetails; } /** Information about managed application definition. */ @@ -681,77 +226,33 @@ export interface ApplicationDefinition extends GenericResource { /** The managed application definition display name. */ displayName?: string; /** A value indicating whether the package is enabled or not. */ - isEnabled?: boolean; + isEnabled?: string; /** The managed application provider authorizations. */ - authorizations?: ApplicationAuthorization[]; + authorizations: ApplicationProviderAuthorization[]; /** The collection of managed application artifacts. The portal will use the files specified as artifacts to construct the user experience of creating a managed application from a managed application definition. */ - artifacts?: ApplicationDefinitionArtifact[]; + artifacts?: ApplicationArtifact[]; /** The managed application definition description. */ description?: string; /** The managed application definition package file Uri. Use this element */ packageFileUri?: string; - /** The storage account id for bring your own storage scenario. */ - storageAccountId?: string; /** The inline main template json which has resources to be provisioned. It can be a JObject or well-formed JSON string. */ mainTemplate?: Record; /** The createUiDefinition json for the backing template with Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string. */ createUiDefinition?: Record; - /** The managed application notification policy. */ - notificationPolicy?: ApplicationNotificationPolicy; - /** The managed application locking policy. */ - lockingPolicy?: ApplicationPackageLockingPolicyDefinition; - /** The managed application deployment policy. */ - deploymentPolicy?: ApplicationDeploymentPolicy; - /** The managed application management policy that determines publisher's access to the managed resource group. */ - managementPolicy?: ApplicationManagementPolicy; - /** The managed application provider policies. */ - policies?: ApplicationPolicy[]; -} - -/** 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 ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { - /** NotSpecified */ - NotSpecified = "NotSpecified", /** Accepted */ Accepted = "Accepted", /** Running */ Running = "Running", + /** Ready */ + Ready = "Ready", + /** Creating */ + Creating = "Creating", + /** Created */ + Created = "Created", /** Deleting */ Deleting = "Deleting", /** Deleted */ @@ -763,7 +264,7 @@ export enum KnownProvisioningState { /** Succeeded */ Succeeded = "Succeeded", /** Updating */ - Updating = "Updating" + Updating = "Updating", } /** @@ -771,9 +272,11 @@ export enum KnownProvisioningState { * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **NotSpecified** \ * **Accepted** \ * **Running** \ + * **Ready** \ + * **Creating** \ + * **Created** \ * **Deleting** \ * **Deleted** \ * **Canceled** \ @@ -782,277 +285,10 @@ export enum KnownProvisioningState { * **Updating** */ export type ProvisioningState = string; - -/** Known values of {@link JitApprovalMode} that the service accepts. */ -export enum KnownJitApprovalMode { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** AutoApprove */ - AutoApprove = "AutoApprove", - /** ManualApprove */ - ManualApprove = "ManualApprove" -} - -/** - * Defines values for JitApprovalMode. \ - * {@link KnownJitApprovalMode} can be used interchangeably with JitApprovalMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **AutoApprove** \ - * **ManualApprove** - */ -export type JitApprovalMode = string; - -/** Known values of {@link JitApproverType} that the service accepts. */ -export enum KnownJitApproverType { - /** User */ - User = "user", - /** Group */ - Group = "group" -} - -/** - * Defines values for JitApproverType. \ - * {@link KnownJitApproverType} can be used interchangeably with JitApproverType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **group** - */ -export type JitApproverType = string; - -/** Known values of {@link ApplicationManagementMode} that the service accepts. */ -export enum KnownApplicationManagementMode { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Unmanaged */ - Unmanaged = "Unmanaged", - /** Managed */ - Managed = "Managed" -} - -/** - * Defines values for ApplicationManagementMode. \ - * {@link KnownApplicationManagementMode} can be used interchangeably with ApplicationManagementMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Unmanaged** \ - * **Managed** - */ -export type ApplicationManagementMode = string; - -/** Known values of {@link ApplicationArtifactName} that the service accepts. */ -export enum KnownApplicationArtifactName { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** ViewDefinition */ - ViewDefinition = "ViewDefinition", - /** Authorizations */ - Authorizations = "Authorizations", - /** CustomRoleDefinition */ - CustomRoleDefinition = "CustomRoleDefinition" -} - -/** - * Defines values for ApplicationArtifactName. \ - * {@link KnownApplicationArtifactName} can be used interchangeably with ApplicationArtifactName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **ViewDefinition** \ - * **Authorizations** \ - * **CustomRoleDefinition** - */ -export type ApplicationArtifactName = string; - -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key" -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - -/** Known values of {@link ApplicationDefinitionArtifactName} that the service accepts. */ -export enum KnownApplicationDefinitionArtifactName { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** ApplicationResourceTemplate */ - ApplicationResourceTemplate = "ApplicationResourceTemplate", - /** CreateUiDefinition */ - CreateUiDefinition = "CreateUiDefinition", - /** MainTemplateParameters */ - MainTemplateParameters = "MainTemplateParameters" -} - -/** - * Defines values for ApplicationDefinitionArtifactName. \ - * {@link KnownApplicationDefinitionArtifactName} can be used interchangeably with ApplicationDefinitionArtifactName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **ApplicationResourceTemplate** \ - * **CreateUiDefinition** \ - * **MainTemplateParameters** - */ -export type ApplicationDefinitionArtifactName = string; - -/** Known values of {@link DeploymentMode} that the service accepts. */ -export enum KnownDeploymentMode { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Incremental */ - Incremental = "Incremental", - /** Complete */ - Complete = "Complete" -} - -/** - * Defines values for DeploymentMode. \ - * {@link KnownDeploymentMode} can be used interchangeably with DeploymentMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Incremental** \ - * **Complete** - */ -export type DeploymentMode = string; - -/** Known values of {@link JitSchedulingType} that the service accepts. */ -export enum KnownJitSchedulingType { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Once */ - Once = "Once", - /** Recurring */ - Recurring = "Recurring" -} - -/** - * Defines values for JitSchedulingType. \ - * {@link KnownJitSchedulingType} can be used interchangeably with JitSchedulingType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Once** \ - * **Recurring** - */ -export type JitSchedulingType = string; - -/** Known values of {@link JitRequestState} that the service accepts. */ -export enum KnownJitRequestState { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Denied */ - Denied = "Denied", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", - /** Expired */ - Expired = "Expired", - /** Timeout */ - Timeout = "Timeout" -} - -/** - * Defines values for JitRequestState. \ - * {@link KnownJitRequestState} can be used interchangeably with JitRequestState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Pending** \ - * **Approved** \ - * **Denied** \ - * **Failed** \ - * **Canceled** \ - * **Expired** \ - * **Timeout** - */ -export type JitRequestState = string; - -/** Known values of {@link Status} that the service accepts. */ -export enum KnownStatus { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Elevate */ - Elevate = "Elevate", - /** Remove */ - Remove = "Remove" -} - -/** - * Defines values for Status. \ - * {@link KnownStatus} can be used interchangeably with Status, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Elevate** \ - * **Remove** - */ -export type Status = string; - -/** Known values of {@link Substatus} that the service accepts. */ -export enum KnownSubstatus { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Approved */ - Approved = "Approved", - /** Denied */ - Denied = "Denied", - /** Failed */ - Failed = "Failed", - /** Expired */ - Expired = "Expired", - /** Timeout */ - Timeout = "Timeout" -} - -/** - * Defines values for Substatus. \ - * {@link KnownSubstatus} can be used interchangeably with Substatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Approved** \ - * **Denied** \ - * **Failed** \ - * **Expired** \ - * **Timeout** - */ -export type Substatus = string; -/** Defines values for ApplicationArtifactType. */ -export type ApplicationArtifactType = "NotSpecified" | "Template" | "Custom"; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned" - | "None"; /** Defines values for ApplicationLockLevel. */ export type ApplicationLockLevel = "CanNotDelete" | "ReadOnly" | "None"; +/** Defines values for ApplicationArtifactType. */ +export type ApplicationArtifactType = "Template" | "Custom"; /** Optional parameters. */ export interface ListOperationsOptionalParams @@ -1101,14 +337,10 @@ export interface ApplicationsUpdateOptionalParams extends coreClient.OperationOptions { /** Parameters supplied to update an existing managed application. */ parameters?: ApplicationPatchable; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; } /** Contains response data for the update operation. */ -export type ApplicationsUpdateResponse = ApplicationPatchable; +export type ApplicationsUpdateResponse = Application; /** Optional parameters. */ export interface ApplicationsListByResourceGroupOptionalParams @@ -1156,47 +388,11 @@ export type ApplicationsCreateOrUpdateByIdResponse = Application; export interface ApplicationsUpdateByIdOptionalParams extends coreClient.OperationOptions { /** Parameters supplied to update an existing managed application. */ - parameters?: ApplicationPatchable; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; + parameters?: Application; } /** Contains response data for the updateById operation. */ -export type ApplicationsUpdateByIdResponse = ApplicationPatchable; - -/** Optional parameters. */ -export interface ApplicationsRefreshPermissionsOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface ApplicationsListAllowedUpgradePlansOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAllowedUpgradePlans operation. */ -export type ApplicationsListAllowedUpgradePlansResponse = AllowedUpgradePlansResult; - -/** Optional parameters. */ -export interface ApplicationsUpdateAccessOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface ApplicationsListTokensOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listTokens operation. */ -export type ApplicationsListTokensResponse = ManagedIdentityTokenResult; +export type ApplicationsUpdateByIdResponse = Application; /** Optional parameters. */ export interface ApplicationsListByResourceGroupNextOptionalParams @@ -1221,35 +417,33 @@ export type ApplicationDefinitionsGetResponse = ApplicationDefinition; /** Optional parameters. */ export interface ApplicationDefinitionsDeleteOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Optional parameters. */ export interface ApplicationDefinitionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Contains response data for the createOrUpdate operation. */ -export type ApplicationDefinitionsCreateOrUpdateResponse = ApplicationDefinition; - -/** Optional parameters. */ -export interface ApplicationDefinitionsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type ApplicationDefinitionsUpdateResponse = ApplicationDefinition; +export type ApplicationDefinitionsCreateOrUpdateResponse = + ApplicationDefinition; /** Optional parameters. */ export interface ApplicationDefinitionsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroup operation. */ -export type ApplicationDefinitionsListByResourceGroupResponse = ApplicationDefinitionListResult; - -/** Optional parameters. */ -export interface ApplicationDefinitionsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type ApplicationDefinitionsListBySubscriptionResponse = ApplicationDefinitionListResult; +export type ApplicationDefinitionsListByResourceGroupResponse = + ApplicationDefinitionListResult; /** Optional parameters. */ export interface ApplicationDefinitionsGetByIdOptionalParams @@ -1260,45 +454,15 @@ export type ApplicationDefinitionsGetByIdResponse = ApplicationDefinition; /** Optional parameters. */ export interface ApplicationDefinitionsDeleteByIdOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Optional parameters. */ export interface ApplicationDefinitionsCreateOrUpdateByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdateById operation. */ -export type ApplicationDefinitionsCreateOrUpdateByIdResponse = ApplicationDefinition; - -/** Optional parameters. */ -export interface ApplicationDefinitionsUpdateByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the updateById operation. */ -export type ApplicationDefinitionsUpdateByIdResponse = ApplicationDefinition; - -/** Optional parameters. */ -export interface ApplicationDefinitionsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type ApplicationDefinitionsListByResourceGroupNextResponse = ApplicationDefinitionListResult; - -/** Optional parameters. */ -export interface ApplicationDefinitionsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type ApplicationDefinitionsListBySubscriptionNextResponse = ApplicationDefinitionListResult; - -/** Optional parameters. */ -export interface JitRequestsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type JitRequestsGetResponse = JitRequestDefinition; - -/** Optional parameters. */ -export interface JitRequestsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -1306,33 +470,17 @@ export interface JitRequestsCreateOrUpdateOptionalParams resumeFrom?: string; } -/** Contains response data for the createOrUpdate operation. */ -export type JitRequestsCreateOrUpdateResponse = JitRequestDefinition; - -/** Optional parameters. */ -export interface JitRequestsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type JitRequestsUpdateResponse = JitRequestDefinition; - -/** Optional parameters. */ -export interface JitRequestsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface JitRequestsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type JitRequestsListBySubscriptionResponse = JitRequestDefinitionListResult; +/** Contains response data for the createOrUpdateById operation. */ +export type ApplicationDefinitionsCreateOrUpdateByIdResponse = + ApplicationDefinition; /** Optional parameters. */ -export interface JitRequestsListByResourceGroupOptionalParams +export interface ApplicationDefinitionsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceGroup operation. */ -export type JitRequestsListByResourceGroupResponse = JitRequestDefinitionListResult; +/** Contains response data for the listByResourceGroupNext operation. */ +export type ApplicationDefinitionsListByResourceGroupNextResponse = + ApplicationDefinitionListResult; /** Optional parameters. */ export interface ApplicationClientOptionalParams diff --git a/sdk/managedapplications/arm-managedapplications/src/models/mappers.ts b/sdk/managedapplications/arm-managedapplications/src/models/mappers.ts index 1e96dd7defa8..0eab0d3cac20 100644 --- a/sdk/managedapplications/arm-managedapplications/src/models/mappers.ts +++ b/sdk/managedapplications/arm-managedapplications/src/models/mappers.ts @@ -15,26 +15,24 @@ export const OperationListResult: coreClient.CompositeMapper = { modelProperties: { value: { serializedName: "value", - readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", - readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -44,41 +42,19 @@ export const Operation: coreClient.CompositeMapper = { modelProperties: { name: { serializedName: "name", - readOnly: true, type: { - name: "String" - } - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - }, - origin: { - serializedName: "origin", - readOnly: true, - type: { - name: "String" - } + className: "OperationDisplay", + }, }, - actionType: { - serializedName: "actionType", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -88,344 +64,24 @@ export const OperationDisplay: coreClient.CompositeMapper = { modelProperties: { provider: { serializedName: "provider", - readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", - readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", - readOnly: true, - type: { - name: "String" - } - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - } -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - 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: "ErrorDetail" - } - } - } - }, - 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 ApplicationBillingDetailsDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationBillingDetailsDefinition", - modelProperties: { - resourceUsageId: { - serializedName: "resourceUsageId", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationJitAccessPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationJitAccessPolicy", - modelProperties: { - jitAccessEnabled: { - serializedName: "jitAccessEnabled", - required: true, - type: { - name: "Boolean" - } - }, - jitApprovalMode: { - serializedName: "jitApprovalMode", - type: { - name: "String" - } - }, - jitApprovers: { - serializedName: "jitApprovers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JitApproverDefinition" - } - } - } - }, - maximumJitAccessDuration: { - serializedName: "maximumJitAccessDuration", - type: { - name: "String" - } - } - } - } -}; - -export const JitApproverDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitApproverDefinition", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationAuthorization: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationAuthorization", - modelProperties: { - principalId: { - serializedName: "principalId", - required: true, type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "roleDefinitionId", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationPackageContact: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPackageContact", - modelProperties: { - contactName: { - serializedName: "contactName", - type: { - name: "String" - } - }, - email: { - serializedName: "email", - required: true, - type: { - name: "String" - } - }, - phone: { - serializedName: "phone", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationPackageSupportUrls: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPackageSupportUrls", - modelProperties: { - publicAzure: { - serializedName: "publicAzure", - type: { - name: "String" - } - }, - governmentCloud: { - serializedName: "governmentCloud", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationArtifact: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationArtifact", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - uri: { - serializedName: "uri", - required: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - required: true, - type: { - name: "Enum", - allowedValues: ["NotSpecified", "Template", "Custom"] - } - } - } - } -}; - -export const ApplicationClientDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationClientDetails", - modelProperties: { - oid: { - serializedName: "oid", - type: { - name: "String" - } - }, - puid: { - serializedName: "puid", - type: { - name: "String" - } + name: "String", + }, }, - applicationId: { - serializedName: "applicationId", - type: { - name: "String" - } - } - } - } + }, + }, }; export const Plan: coreClient.CompositeMapper = { @@ -437,108 +93,38 @@ export const Plan: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, publisher: { serializedName: "publisher", required: true, type: { - name: "String" - } + name: "String", + }, }, product: { serializedName: "product", required: true, type: { - name: "String" - } + name: "String", + }, }, promotionCode: { serializedName: "promotionCode", type: { - name: "String" - } + name: "String", + }, }, version: { serializedName: "version", required: true, type: { - name: "String" - } - } - } - } -}; - -export const Identity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Identity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String" - } - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None" - ] - } - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedResourceIdentity" - } - } - } - } - } - } -}; - -export const UserAssignedResourceIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedResourceIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String" - } + name: "String", + }, }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; export const Sku: coreClient.CompositeMapper = { @@ -550,621 +136,238 @@ export const Sku: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, tier: { serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, size: { serializedName: "size", type: { - name: "String" - } + name: "String", + }, }, family: { serializedName: "family", type: { - name: "String" - } + name: "String", + }, }, model: { serializedName: "model", type: { - name: "String" - } + name: "String", + }, }, capacity: { serializedName: "capacity", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const Resource: coreClient.CompositeMapper = { +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "Identity", modelProperties: { - id: { - serializedName: "id", + principalId: { + serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - name: { - serializedName: "name", + tenantId: { + serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { + defaultValue: "SystemAssigned", + isConstant: true, serializedName: "type", - readOnly: true, type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - } - } - } + }, + }, }; -export const SystemData: coreClient.CompositeMapper = { +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "Resource", modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String" - } - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + id: { + serializedName: "id", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } -}; - -export const PlanPatchable: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PlanPatchable", - modelProperties: { name: { serializedName: "name", + readOnly: true, type: { - name: "String" - } - }, - publisher: { - serializedName: "publisher", - type: { - name: "String" - } - }, - product: { - serializedName: "product", - type: { - name: "String" - } - }, - promotionCode: { - serializedName: "promotionCode", - type: { - name: "String" - } - }, - version: { - serializedName: "version", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationDefinitionArtifact: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationDefinitionArtifact", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - uri: { - serializedName: "uri", - required: true, - type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", - required: true, - type: { - name: "Enum", - allowedValues: ["NotSpecified", "Template", "Custom"] - } - } - } - } -}; - -export const ApplicationNotificationPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationNotificationPolicy", - modelProperties: { - notificationEndpoints: { - serializedName: "notificationEndpoints", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationNotificationEndpoint" - } - } - } - } - } - } -}; - -export const ApplicationNotificationEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationNotificationEndpoint", - modelProperties: { - uri: { - serializedName: "uri", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationPackageLockingPolicyDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPackageLockingPolicyDefinition", - modelProperties: { - allowedActions: { - serializedName: "allowedActions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - allowedDataActions: { - serializedName: "allowedDataActions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const ApplicationDeploymentPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationDeploymentPolicy", - modelProperties: { - deploymentMode: { - serializedName: "deploymentMode", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationManagementPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationManagementPolicy", - modelProperties: { - mode: { - serializedName: "mode", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPolicy", - modelProperties: { - name: { - serializedName: "name", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - policyDefinitionId: { - serializedName: "policyDefinitionId", + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - parameters: { - serializedName: "parameters", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationDefinitionPatchable: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationDefinitionPatchable", - modelProperties: { tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } -}; - -export const ApplicationDefinitionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationDefinitionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationDefinition" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Application" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const JitAuthorizationPolicies: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitAuthorizationPolicies", - modelProperties: { - principalId: { - serializedName: "principalId", - required: true, - type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "roleDefinitionId", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const JitSchedulingPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitSchedulingPolicy", - modelProperties: { - type: { - serializedName: "type", - required: true, - type: { - name: "String" - } - }, - duration: { - serializedName: "duration", - required: true, - type: { - name: "TimeSpan" - } + value: { type: { name: "String" } }, + }, }, - startTime: { - serializedName: "startTime", - required: true, - type: { - name: "DateTime" - } - } - } - } + }, + }, }; -export const JitRequestPatchable: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitRequestPatchable", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } -}; - -export const JitRequestDefinitionListResult: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JitRequestDefinitionListResult", + className: "ErrorResponse", modelProperties: { - value: { - serializedName: "value", + httpStatus: { + serializedName: "httpStatus", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JitRequestDefinition" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const AllowedUpgradePlansResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AllowedUpgradePlansResult", - modelProperties: { - value: { - serializedName: "value", + errorCode: { + serializedName: "errorCode", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Plan" - } - } - } - } - } - } + name: "String", + }, + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String", + }, + }, + }, + }, }; -export const UpdateAccessDefinition: coreClient.CompositeMapper = { +export const PlanPatchable: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UpdateAccessDefinition", + className: "PlanPatchable", modelProperties: { - approver: { - serializedName: "approver", + name: { + serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, - metadata: { - serializedName: "metadata", + publisher: { + serializedName: "publisher", type: { - name: "Composite", - className: "JitRequestMetadata" - } + name: "String", + }, }, - status: { - serializedName: "status", - required: true, + product: { + serializedName: "product", type: { - name: "String" - } + name: "String", + }, }, - subStatus: { - serializedName: "subStatus", - required: true, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String", + }, + }, + version: { + serializedName: "version", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const JitRequestMetadata: coreClient.CompositeMapper = { +export const ApplicationProviderAuthorization: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JitRequestMetadata", + className: "ApplicationProviderAuthorization", modelProperties: { - originRequestId: { - serializedName: "originRequestId", - type: { - name: "String" - } - }, - requestorId: { - serializedName: "requestorId", + principalId: { + serializedName: "principalId", + required: true, type: { - name: "String" - } + name: "String", + }, }, - tenantDisplayName: { - serializedName: "tenantDisplayName", + roleDefinitionId: { + serializedName: "roleDefinitionId", + required: true, type: { - name: "String" - } + name: "String", + }, }, - subjectDisplayName: { - serializedName: "subjectDisplayName", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const ListTokenRequest: coreClient.CompositeMapper = { +export const ApplicationArtifact: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ListTokenRequest", + className: "ApplicationArtifact", modelProperties: { - authorizationAudience: { - serializedName: "authorizationAudience", + name: { + serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + uri: { + serializedName: "uri", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["Template", "Custom"], + }, + }, + }, + }, }; -export const ManagedIdentityTokenResult: coreClient.CompositeMapper = { +export const ApplicationDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedIdentityTokenResult", + className: "ApplicationDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -1173,64 +376,46 @@ export const ManagedIdentityTokenResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ManagedIdentityToken" - } - } - } - } - } - } + className: "ApplicationDefinition", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, }; -export const ManagedIdentityToken: coreClient.CompositeMapper = { +export const ApplicationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedIdentityToken", + className: "ApplicationListResult", modelProperties: { - accessToken: { - serializedName: "accessToken", - type: { - name: "String" - } - }, - expiresIn: { - serializedName: "expiresIn", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "expiresOn", - type: { - name: "String" - } - }, - notBefore: { - serializedName: "notBefore", - type: { - name: "String" - } - }, - authorizationAudience: { - serializedName: "authorizationAudience", + value: { + serializedName: "value", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Application", + }, + }, + }, }, - resourceId: { - serializedName: "resourceId", + nextLink: { + serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, - tokenType: { - serializedName: "tokenType", - type: { - name: "String" - } - } - } - } + }, + }, }; export const GenericResource: coreClient.CompositeMapper = { @@ -1242,88 +427,25 @@ export const GenericResource: coreClient.CompositeMapper = { managedBy: { serializedName: "managedBy", type: { - name: "String" - } + name: "String", + }, }, sku: { serializedName: "sku", type: { name: "Composite", - className: "Sku" - } - } - } - } -}; - -export const JitRequestDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitRequestDefinition", - modelProperties: { - ...Resource.type.modelProperties, - applicationResourceId: { - serializedName: "properties.applicationResourceId", - type: { - name: "String" - } - }, - publisherTenantId: { - serializedName: "properties.publisherTenantId", - readOnly: true, - type: { - name: "String" - } - }, - jitAuthorizationPolicies: { - serializedName: "properties.jitAuthorizationPolicies", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JitAuthorizationPolicies" - } - } - } - }, - jitSchedulingPolicy: { - serializedName: "properties.jitSchedulingPolicy", - type: { - name: "Composite", - className: "JitSchedulingPolicy" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - jitRequestState: { - serializedName: "properties.jitRequestState", - readOnly: true, - type: { - name: "String" - } + className: "Sku", + }, }, - createdBy: { - serializedName: "properties.createdBy", + identity: { + serializedName: "identity", type: { name: "Composite", - className: "ApplicationClientDetails" - } + className: "Identity", + }, }, - updatedBy: { - serializedName: "properties.updatedBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } - } - } - } + }, + }, }; export const Application: coreClient.CompositeMapper = { @@ -1336,144 +458,56 @@ export const Application: coreClient.CompositeMapper = { serializedName: "plan", type: { name: "Composite", - className: "Plan" - } + className: "Plan", + }, }, kind: { constraints: { - Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$") + Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$"), }, serializedName: "kind", required: true, type: { - name: "String" - } - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } + name: "String", + }, }, managedResourceGroupId: { serializedName: "properties.managedResourceGroupId", + required: true, type: { - name: "String" - } + name: "String", + }, }, applicationDefinitionId: { serializedName: "properties.applicationDefinitionId", type: { - name: "String" - } + name: "String", + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, outputs: { serializedName: "properties.outputs", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } - }, - billingDetails: { - serializedName: "properties.billingDetails", - type: { - name: "Composite", - className: "ApplicationBillingDetailsDefinition" - } - }, - jitAccessPolicy: { - serializedName: "properties.jitAccessPolicy", - type: { - name: "Composite", - className: "ApplicationJitAccessPolicy" - } - }, - publisherTenantId: { - serializedName: "properties.publisherTenantId", - readOnly: true, - type: { - name: "String" - } - }, - authorizations: { - serializedName: "properties.authorizations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationAuthorization" - } - } - } - }, - managementMode: { - serializedName: "properties.managementMode", - readOnly: true, - type: { - name: "String" - } - }, - customerSupport: { - serializedName: "properties.customerSupport", - type: { - name: "Composite", - className: "ApplicationPackageContact" - } - }, - supportUrls: { - serializedName: "properties.supportUrls", - type: { - name: "Composite", - className: "ApplicationPackageSupportUrls" - } - }, - artifacts: { - serializedName: "properties.artifacts", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationArtifact" - } - } - } - }, - createdBy: { - serializedName: "properties.createdBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } + name: "String", + }, }, - updatedBy: { - serializedName: "properties.updatedBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } - } - } - } + }, + }, }; export const ApplicationPatchable: coreClient.CompositeMapper = { @@ -1486,143 +520,54 @@ export const ApplicationPatchable: coreClient.CompositeMapper = { serializedName: "plan", type: { name: "Composite", - className: "PlanPatchable" - } + className: "PlanPatchable", + }, }, kind: { constraints: { - Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$") + Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$"), }, serializedName: "kind", type: { - name: "String" - } - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } + name: "String", + }, }, managedResourceGroupId: { serializedName: "properties.managedResourceGroupId", type: { - name: "String" - } + name: "String", + }, }, applicationDefinitionId: { serializedName: "properties.applicationDefinitionId", type: { - name: "String" - } + name: "String", + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, outputs: { serializedName: "properties.outputs", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } - }, - billingDetails: { - serializedName: "properties.billingDetails", - type: { - name: "Composite", - className: "ApplicationBillingDetailsDefinition" - } - }, - jitAccessPolicy: { - serializedName: "properties.jitAccessPolicy", - type: { - name: "Composite", - className: "ApplicationJitAccessPolicy" - } - }, - publisherTenantId: { - serializedName: "properties.publisherTenantId", - readOnly: true, - type: { - name: "String" - } - }, - authorizations: { - serializedName: "properties.authorizations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationAuthorization" - } - } - } - }, - managementMode: { - serializedName: "properties.managementMode", - readOnly: true, - type: { - name: "String" - } - }, - customerSupport: { - serializedName: "properties.customerSupport", - type: { - name: "Composite", - className: "ApplicationPackageContact" - } - }, - supportUrls: { - serializedName: "properties.supportUrls", - type: { - name: "Composite", - className: "ApplicationPackageSupportUrls" - } - }, - artifacts: { - serializedName: "properties.artifacts", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationArtifact" - } - } - } - }, - createdBy: { - serializedName: "properties.createdBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } + name: "String", + }, }, - updatedBy: { - serializedName: "properties.updatedBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } - } - } - } + }, + }, }; export const ApplicationDefinition: coreClient.CompositeMapper = { @@ -1636,32 +581,33 @@ export const ApplicationDefinition: coreClient.CompositeMapper = { required: true, type: { name: "Enum", - allowedValues: ["CanNotDelete", "ReadOnly", "None"] - } + allowedValues: ["CanNotDelete", "ReadOnly", "None"], + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, isEnabled: { serializedName: "properties.isEnabled", type: { - name: "Boolean" - } + name: "String", + }, }, authorizations: { serializedName: "properties.authorizations", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ApplicationAuthorization" - } - } - } + className: "ApplicationProviderAuthorization", + }, + }, + }, }, artifacts: { serializedName: "properties.artifacts", @@ -1670,83 +616,37 @@ export const ApplicationDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ApplicationDefinitionArtifact" - } - } - } + className: "ApplicationArtifact", + }, + }, + }, }, description: { serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, packageFileUri: { serializedName: "properties.packageFileUri", type: { - name: "String" - } - }, - storageAccountId: { - serializedName: "properties.storageAccountId", - type: { - name: "String" - } + name: "String", + }, }, mainTemplate: { serializedName: "properties.mainTemplate", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, createUiDefinition: { serializedName: "properties.createUiDefinition", type: { name: "Dictionary", - value: { type: { name: "any" } } - } - }, - notificationPolicy: { - serializedName: "properties.notificationPolicy", - type: { - name: "Composite", - className: "ApplicationNotificationPolicy" - } - }, - lockingPolicy: { - serializedName: "properties.lockingPolicy", - type: { - name: "Composite", - className: "ApplicationPackageLockingPolicyDefinition" - } - }, - deploymentPolicy: { - serializedName: "properties.deploymentPolicy", - type: { - name: "Composite", - className: "ApplicationDeploymentPolicy" - } - }, - managementPolicy: { - serializedName: "properties.managementPolicy", - type: { - name: "Composite", - className: "ApplicationManagementPolicy" - } + value: { type: { name: "any" } }, + }, }, - policies: { - serializedName: "properties.policies", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationPolicy" - } - } - } - } - } - } + }, + }, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/models/parameters.ts b/sdk/managedapplications/arm-managedapplications/src/models/parameters.ts index 86f119d130c6..4f221152bf0f 100644 --- a/sdk/managedapplications/arm-managedapplications/src/models/parameters.ts +++ b/sdk/managedapplications/arm-managedapplications/src/models/parameters.ts @@ -9,17 +9,12 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { Application as ApplicationMapper, ApplicationPatchable as ApplicationPatchableMapper, - UpdateAccessDefinition as UpdateAccessDefinitionMapper, - ListTokenRequest as ListTokenRequestMapper, ApplicationDefinition as ApplicationDefinitionMapper, - ApplicationDefinitionPatchable as ApplicationDefinitionPatchableMapper, - JitRequestDefinition as JitRequestDefinitionMapper, - JitRequestPatchable as JitRequestPatchableMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -29,9 +24,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -40,22 +35,22 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-07-01", + defaultValue: "2018-06-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -64,39 +59,26 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - constraints: { - MinLength: 1 + name: "String", }, - serializedName: "subscriptionId", - required: true, - type: { - name: "String" - } - } + }, + skipEncoding: true, }; export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const applicationName: OperationURLParameter = { @@ -104,14 +86,25 @@ export const applicationName: OperationURLParameter = { mapper: { constraints: { MaxLength: 64, - MinLength: 3 + MinLength: 3, }, serializedName: "applicationName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -121,19 +114,19 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: ApplicationMapper + mapper: ApplicationMapper, }; export const parameters1: OperationParameter = { parameterPath: ["options", "parameters"], - mapper: ApplicationPatchableMapper + mapper: ApplicationPatchableMapper, }; export const applicationId: OperationURLParameter = { @@ -142,20 +135,15 @@ export const applicationId: OperationURLParameter = { serializedName: "applicationId", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: UpdateAccessDefinitionMapper -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: ListTokenRequestMapper + parameterPath: ["options", "parameters"], + mapper: ApplicationMapper, }; export const applicationDefinitionName: OperationURLParameter = { @@ -163,59 +151,17 @@ export const applicationDefinitionName: OperationURLParameter = { mapper: { constraints: { MaxLength: 64, - MinLength: 3 + MinLength: 3, }, serializedName: "applicationDefinitionName", required: true, type: { - name: "String" - } - } -}; - -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: ApplicationDefinitionMapper -}; - -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: ApplicationDefinitionPatchableMapper -}; - -export const resourceGroupName1: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 90, - MinLength: 1 + name: "String", }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String" - } - } -}; - -export const jitRequestName: OperationURLParameter = { - parameterPath: "jitRequestName", - mapper: { - serializedName: "jitRequestName", - required: true, - type: { - name: "String" - } - } -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: JitRequestDefinitionMapper + }, }; -export const parameters7: OperationParameter = { +export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: JitRequestPatchableMapper + mapper: ApplicationDefinitionMapper, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts b/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts index 079ec224a111..65449d00f205 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts @@ -13,31 +13,28 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ApplicationClient } from "../applicationClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { ApplicationDefinition, ApplicationDefinitionsListByResourceGroupNextOptionalParams, ApplicationDefinitionsListByResourceGroupOptionalParams, ApplicationDefinitionsListByResourceGroupResponse, - ApplicationDefinitionsListBySubscriptionNextOptionalParams, - ApplicationDefinitionsListBySubscriptionOptionalParams, - ApplicationDefinitionsListBySubscriptionResponse, ApplicationDefinitionsGetOptionalParams, ApplicationDefinitionsGetResponse, ApplicationDefinitionsDeleteOptionalParams, ApplicationDefinitionsCreateOrUpdateOptionalParams, ApplicationDefinitionsCreateOrUpdateResponse, - ApplicationDefinitionPatchable, - ApplicationDefinitionsUpdateOptionalParams, - ApplicationDefinitionsUpdateResponse, ApplicationDefinitionsGetByIdOptionalParams, ApplicationDefinitionsGetByIdResponse, ApplicationDefinitionsDeleteByIdOptionalParams, ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, ApplicationDefinitionsCreateOrUpdateByIdResponse, - ApplicationDefinitionsUpdateByIdOptionalParams, - ApplicationDefinitionsUpdateByIdResponse, ApplicationDefinitionsListByResourceGroupNextResponse, - ApplicationDefinitionsListBySubscriptionNextResponse } from "../models"; /// @@ -60,7 +57,7 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { */ public listByResourceGroup( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -77,16 +74,16 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ApplicationDefinitionsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ApplicationDefinitionsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -101,7 +98,7 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -112,70 +109,16 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } } - /** - * Lists all the application definitions within a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings); - } - }; - } - - private async *listBySubscriptionPagingPage( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: ApplicationDefinitionsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - /** * Gets the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -185,67 +128,192 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { get( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsGetOptionalParams + options?: ApplicationDefinitionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, applicationDefinitionName, options }, - getOperationSpec + getOperationSpec, ); } /** * Deletes the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationDefinitionName The name of the managed application definition. + * @param applicationDefinitionName The name of the managed application definition to delete. * @param options The options parameters. */ - delete( + async beginDelete( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteOptionalParams + options?: ApplicationDefinitionsDeleteOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, applicationDefinitionName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the managed application definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition to delete. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + applicationDefinitionName: string, + options?: ApplicationDefinitionsDeleteOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, options }, - deleteOperationSpec + const poller = await this.beginDelete( + resourceGroupName, + applicationDefinitionName, + options, ); + return poller.pollUntilDone(); } /** - * Creates or updates a managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param parameters Parameters supplied to the create or update an managed application definition. * @param options The options parameters. */ - createOrUpdate( + async beginCreateOrUpdate( resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, - options?: ApplicationDefinitionsCreateOrUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, parameters, options }, - createOrUpdateOperationSpec - ); + options?: ApplicationDefinitionsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApplicationDefinitionsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + applicationDefinitionName, + parameters, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + ApplicationDefinitionsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; } /** - * Updates the managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. - * @param parameters Parameters supplied to the update a managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. * @param options The options parameters. */ - update( + async beginCreateOrUpdateAndWait( resourceGroupName: string, applicationDefinitionName: string, - parameters: ApplicationDefinitionPatchable, - options?: ApplicationDefinitionsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, parameters, options }, - updateOperationSpec + parameters: ApplicationDefinition, + options?: ApplicationDefinitionsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + applicationDefinitionName, + parameters, + options, ); + return poller.pollUntilDone(); } /** @@ -255,42 +323,91 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { */ private _listByResourceGroup( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } /** - * Lists all the application definitions within a subscription. + * Gets the managed application definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. * @param options The options parameters. */ - private _listBySubscription( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams - ): Promise { + getById( + resourceGroupName: string, + applicationDefinitionName: string, + options?: ApplicationDefinitionsGetByIdOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec + { resourceGroupName, applicationDefinitionName, options }, + getByIdOperationSpec, ); } /** - * Gets the managed application definition. + * Deletes the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param options The options parameters. */ - getById( + async beginDeleteById( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, options }, - getByIdOperationSpec - ); + options?: ApplicationDefinitionsDeleteByIdOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, applicationDefinitionName, options }, + spec: deleteByIdOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; } /** @@ -299,53 +416,116 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { * @param applicationDefinitionName The name of the managed application definition. * @param options The options parameters. */ - deleteById( + async beginDeleteByIdAndWait( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteByIdOptionalParams + options?: ApplicationDefinitionsDeleteByIdOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, options }, - deleteByIdOperationSpec + const poller = await this.beginDeleteById( + resourceGroupName, + applicationDefinitionName, + options, ); + return poller.pollUntilDone(); } /** - * Creates or updates a managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param parameters Parameters supplied to the create or update a managed application definition. * @param options The options parameters. */ - createOrUpdateById( + async beginCreateOrUpdateById( resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, - options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, parameters, options }, - createOrUpdateByIdOperationSpec - ); + options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApplicationDefinitionsCreateOrUpdateByIdResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + applicationDefinitionName, + parameters, + options, + }, + spec: createOrUpdateByIdOperationSpec, + }); + const poller = await createHttpPoller< + ApplicationDefinitionsCreateOrUpdateByIdResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; } /** - * Updates the managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. - * @param parameters Parameters supplied to the update a managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. * @param options The options parameters. */ - updateById( + async beginCreateOrUpdateByIdAndWait( resourceGroupName: string, applicationDefinitionName: string, - parameters: ApplicationDefinitionPatchable, - options?: ApplicationDefinitionsUpdateByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, parameters, options }, - updateByIdOperationSpec + parameters: ApplicationDefinition, + options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateById( + resourceGroupName, + applicationDefinitionName, + parameters, + options, ); + return poller.pollUntilDone(); } /** @@ -357,26 +537,11 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: ApplicationDefinitionsListByResourceGroupNextOptionalParams + options?: ApplicationDefinitionsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: ApplicationDefinitionsListBySubscriptionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec + listByResourceGroupNextOperationSpec, ); } } @@ -384,269 +549,194 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, 404: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationDefinitionName + Parameters.subscriptionId, + Parameters.applicationDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationDefinitionName + Parameters.subscriptionId, + Parameters.applicationDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, 201: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationDefinitionName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ApplicationDefinition + 202: { + bodyMapper: Mappers.ApplicationDefinition, + }, + 204: { + bodyMapper: Mappers.ApplicationDefinition, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationDefinitionName + Parameters.subscriptionId, + Parameters.applicationDefinitionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinitionListResult + bodyMapper: Mappers.ApplicationDefinitionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceGroupName ], headerParameters: [Parameters.accept], - serializer -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/applicationDefinitions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ApplicationDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer + serializer, }; const getByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, 404: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.applicationDefinitionName, - Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.applicationDefinitionName, - Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, 201: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.applicationDefinitionName, - Parameters.resourceGroupName1 - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const updateByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ApplicationDefinition + 202: { + bodyMapper: Mappers.ApplicationDefinition, + }, + 204: { + bodyMapper: Mappers.ApplicationDefinition, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationDefinitionName + Parameters.subscriptionId, + Parameters.applicationDefinitionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinitionListResult + bodyMapper: Mappers.ApplicationDefinitionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ApplicationDefinitionListResult + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.resourceGroupName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts b/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts index 7b4ccff523fa..fc81599db921 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts @@ -16,7 +16,7 @@ import { ApplicationClient } from "../applicationClient"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -41,16 +41,8 @@ import { ApplicationsCreateOrUpdateByIdResponse, ApplicationsUpdateByIdOptionalParams, ApplicationsUpdateByIdResponse, - ApplicationsRefreshPermissionsOptionalParams, - ApplicationsListAllowedUpgradePlansOptionalParams, - ApplicationsListAllowedUpgradePlansResponse, - UpdateAccessDefinition, - ApplicationsUpdateAccessOptionalParams, - ListTokenRequest, - ApplicationsListTokensOptionalParams, - ApplicationsListTokensResponse, ApplicationsListByResourceGroupNextResponse, - ApplicationsListBySubscriptionNextResponse + ApplicationsListBySubscriptionNextResponse, } from "../models"; /// @@ -67,13 +59,13 @@ export class ApplicationsImpl implements Applications { } /** - * Lists all the applications within a resource group. + * Gets all the applications within a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ public listByResourceGroup( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -90,16 +82,16 @@ export class ApplicationsImpl implements Applications { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ApplicationsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ApplicationsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -114,7 +106,7 @@ export class ApplicationsImpl implements Applications { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -125,22 +117,22 @@ export class ApplicationsImpl implements Applications { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } } /** - * Lists all the applications within a subscription. + * Gets all the applications within a subscription. * @param options The options parameters. */ public listBySubscription( - options?: ApplicationsListBySubscriptionOptionalParams + options?: ApplicationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -155,13 +147,13 @@ export class ApplicationsImpl implements Applications { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: ApplicationsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ApplicationsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -182,7 +174,7 @@ export class ApplicationsImpl implements Applications { } private async *listBySubscriptionPagingAll( - options?: ApplicationsListBySubscriptionOptionalParams + options?: ApplicationsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -198,11 +190,11 @@ export class ApplicationsImpl implements Applications { get( resourceGroupName: string, applicationName: string, - options?: ApplicationsGetOptionalParams + options?: ApplicationsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, applicationName, options }, - getOperationSpec + getOperationSpec, ); } @@ -215,25 +207,24 @@ export class ApplicationsImpl implements Applications { async beginDelete( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -242,8 +233,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -251,20 +242,19 @@ export class ApplicationsImpl implements Applications { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, applicationName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -279,18 +269,18 @@ export class ApplicationsImpl implements Applications { async beginDeleteAndWait( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, applicationName, - options + options, ); return poller.pollUntilDone(); } /** - * Creates or updates a managed application. + * Creates a new managed application. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param parameters Parameters supplied to the create or update a managed application. @@ -300,7 +290,7 @@ export class ApplicationsImpl implements Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -309,21 +299,20 @@ export class ApplicationsImpl implements Applications { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -332,8 +321,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -341,15 +330,15 @@ export class ApplicationsImpl implements Applications { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, applicationName, parameters, options }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< ApplicationsCreateOrUpdateResponse, @@ -357,14 +346,13 @@ export class ApplicationsImpl implements Applications { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; } /** - * Creates or updates a managed application. + * Creates a new managed application. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param parameters Parameters supplied to the create or update a managed application. @@ -374,133 +362,60 @@ export class ApplicationsImpl implements Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, applicationName, parameters, - options + options, ); return poller.pollUntilDone(); } /** - * Updates an existing managed application. + * Updates an existing managed application. The only value that can be updated via PATCH currently is + * the tags. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param options The options parameters. */ - async beginUpdate( + update( resourceGroupName: string, applicationName: string, - options?: ApplicationsUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ApplicationsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, applicationName, options }, - spec: updateOperationSpec - }); - const poller = await createHttpPoller< - ApplicationsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; - } - - /** - * Updates an existing managed application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsUpdateOptionalParams + options?: ApplicationsUpdateOptionalParams, ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - applicationName, - options + return this.client.sendOperationRequest( + { resourceGroupName, applicationName, options }, + updateOperationSpec, ); - return poller.pollUntilDone(); } /** - * Lists all the applications within a resource group. + * Gets all the applications within a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ private _listByResourceGroup( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } /** - * Lists all the applications within a subscription. + * Gets all the applications within a subscription. * @param options The options parameters. */ private _listBySubscription( - options?: ApplicationsListBySubscriptionOptionalParams + options?: ApplicationsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -513,11 +428,11 @@ export class ApplicationsImpl implements Applications { */ getById( applicationId: string, - options?: ApplicationsGetByIdOptionalParams + options?: ApplicationsGetByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { applicationId, options }, - getByIdOperationSpec + getByIdOperationSpec, ); } @@ -530,25 +445,24 @@ export class ApplicationsImpl implements Applications { */ async beginDeleteById( applicationId: string, - options?: ApplicationsDeleteByIdOptionalParams + options?: ApplicationsDeleteByIdOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -557,8 +471,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -566,20 +480,19 @@ export class ApplicationsImpl implements Applications { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { applicationId, options }, - spec: deleteByIdOperationSpec + spec: deleteByIdOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -594,14 +507,14 @@ export class ApplicationsImpl implements Applications { */ async beginDeleteByIdAndWait( applicationId: string, - options?: ApplicationsDeleteByIdOptionalParams + options?: ApplicationsDeleteByIdOptionalParams, ): Promise { const poller = await this.beginDeleteById(applicationId, options); return poller.pollUntilDone(); } /** - * Creates or updates a managed application. + * Creates a new managed application. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} @@ -611,7 +524,7 @@ export class ApplicationsImpl implements Applications { async beginCreateOrUpdateById( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -620,21 +533,20 @@ export class ApplicationsImpl implements Applications { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -643,8 +555,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -652,15 +564,15 @@ export class ApplicationsImpl implements Applications { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { applicationId, parameters, options }, - spec: createOrUpdateByIdOperationSpec + spec: createOrUpdateByIdOperationSpec, }); const poller = await createHttpPoller< ApplicationsCreateOrUpdateByIdResponse, @@ -668,14 +580,13 @@ export class ApplicationsImpl implements Applications { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; } /** - * Creates or updates a managed application. + * Creates a new managed application. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} @@ -685,307 +596,31 @@ export class ApplicationsImpl implements Applications { async beginCreateOrUpdateByIdAndWait( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdateById( applicationId, parameters, - options + options, ); return poller.pollUntilDone(); } /** - * Updates an existing managed application. + * Updates an existing managed application. The only value that can be updated via PATCH currently is + * the tags. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} * @param options The options parameters. */ - async beginUpdateById( + updateById( applicationId: string, - options?: ApplicationsUpdateByIdOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ApplicationsUpdateByIdResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { applicationId, options }, - spec: updateByIdOperationSpec - }); - const poller = await createHttpPoller< - ApplicationsUpdateByIdResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; - } - - /** - * Updates an existing managed application. - * @param applicationId The fully qualified ID of the managed application, including the managed - * application name and the managed application resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} - * @param options The options parameters. - */ - async beginUpdateByIdAndWait( - applicationId: string, - options?: ApplicationsUpdateByIdOptionalParams + options?: ApplicationsUpdateByIdOptionalParams, ): Promise { - const poller = await this.beginUpdateById(applicationId, options); - return poller.pollUntilDone(); - } - - /** - * Refresh Permissions for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - async beginRefreshPermissions( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsRefreshPermissionsOptionalParams - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, applicationName, options }, - spec: refreshPermissionsOperationSpec - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Refresh Permissions for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - async beginRefreshPermissionsAndWait( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsRefreshPermissionsOptionalParams - ): Promise { - const poller = await this.beginRefreshPermissions( - resourceGroupName, - applicationName, - options - ); - return poller.pollUntilDone(); - } - - /** - * List allowed upgrade plans for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - listAllowedUpgradePlans( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsListAllowedUpgradePlansOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationName, options }, - listAllowedUpgradePlansOperationSpec - ); - } - - /** - * Update access for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - async beginUpdateAccess( - resourceGroupName: string, - applicationName: string, - parameters: UpdateAccessDefinition, - options?: ApplicationsUpdateAccessOptionalParams - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, applicationName, parameters, options }, - spec: updateAccessOperationSpec - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Update access for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - async beginUpdateAccessAndWait( - resourceGroupName: string, - applicationName: string, - parameters: UpdateAccessDefinition, - options?: ApplicationsUpdateAccessOptionalParams - ): Promise { - const poller = await this.beginUpdateAccess( - resourceGroupName, - applicationName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * List tokens for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - listTokens( - resourceGroupName: string, - applicationName: string, - parameters: ListTokenRequest, - options?: ApplicationsListTokensOptionalParams - ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, applicationName, parameters, options }, - listTokensOperationSpec + { applicationId, options }, + updateByIdOperationSpec, ); } @@ -998,11 +633,11 @@ export class ApplicationsImpl implements Applications { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: ApplicationsListByResourceGroupNextOptionalParams + options?: ApplicationsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } @@ -1013,11 +648,11 @@ export class ApplicationsImpl implements Applications { */ private _listBySubscriptionNext( nextLink: string, - options?: ApplicationsListBySubscriptionNextOptionalParams + options?: ApplicationsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } } @@ -1025,31 +660,29 @@ export class ApplicationsImpl implements Applications { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 404: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationName + Parameters.applicationName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", httpMethod: "DELETE", responses: { 200: {}, @@ -1057,139 +690,126 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationName + Parameters.applicationName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 201: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 202: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 204: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationName + Parameters.applicationName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ApplicationPatchable - }, - 201: { - bodyMapper: Mappers.ApplicationPatchable - }, - 202: { - bodyMapper: Mappers.ApplicationPatchable - }, - 204: { - bodyMapper: Mappers.ApplicationPatchable + bodyMapper: Mappers.Application, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationName + Parameters.applicationName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationListResult + bodyMapper: Mappers.ApplicationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceGroupName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/applications", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/applications", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationListResult + bodyMapper: Mappers.ApplicationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const getByIdOperationSpec: coreClient.OperationSpec = { path: "/{applicationId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 404: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.applicationId], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteByIdOperationSpec: coreClient.OperationSpec = { path: "/{applicationId}", @@ -1200,198 +820,95 @@ const deleteByIdOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.applicationId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { path: "/{applicationId}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 201: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 202: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 204: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.applicationId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateByIdOperationSpec: coreClient.OperationSpec = { path: "/{applicationId}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ApplicationPatchable - }, - 201: { - bodyMapper: Mappers.ApplicationPatchable - }, - 202: { - bodyMapper: Mappers.ApplicationPatchable + bodyMapper: Mappers.Application, }, - 204: { - bodyMapper: Mappers.ApplicationPatchable - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.applicationId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const refreshPermissionsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}/refreshPermissions", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listAllowedUpgradePlansOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}/listAllowedUpgradePlans", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.AllowedUpgradePlansResult + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const updateAccessOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}/updateAccess", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } }, requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const listTokensOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}/listTokens", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ManagedIdentityTokenResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationName - ], + urlParameters: [Parameters.$host, Parameters.applicationId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationListResult + bodyMapper: Mappers.ApplicationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, + Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceGroupName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationListResult + bodyMapper: Mappers.ApplicationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/operations/index.ts b/sdk/managedapplications/arm-managedapplications/src/operations/index.ts index 63259e0e45c4..6ca98c210b1c 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operations/index.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operations/index.ts @@ -8,4 +8,3 @@ export * from "./applications"; export * from "./applicationDefinitions"; -export * from "./jitRequests"; diff --git a/sdk/managedapplications/arm-managedapplications/src/operations/jitRequests.ts b/sdk/managedapplications/arm-managedapplications/src/operations/jitRequests.ts deleted file mode 100644 index 1005d0e2b145..000000000000 --- a/sdk/managedapplications/arm-managedapplications/src/operations/jitRequests.ts +++ /dev/null @@ -1,366 +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 { JitRequests } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ApplicationClient } from "../applicationClient"; -import { - SimplePollerLike, - OperationState, - createHttpPoller -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - JitRequestsGetOptionalParams, - JitRequestsGetResponse, - JitRequestDefinition, - JitRequestsCreateOrUpdateOptionalParams, - JitRequestsCreateOrUpdateResponse, - JitRequestPatchable, - JitRequestsUpdateOptionalParams, - JitRequestsUpdateResponse, - JitRequestsDeleteOptionalParams, - JitRequestsListBySubscriptionOptionalParams, - JitRequestsListBySubscriptionResponse, - JitRequestsListByResourceGroupOptionalParams, - JitRequestsListByResourceGroupResponse -} from "../models"; - -/** Class containing JitRequests operations. */ -export class JitRequestsImpl implements JitRequests { - private readonly client: ApplicationClient; - - /** - * Initialize a new instance of the class JitRequests class. - * @param client Reference to the service client - */ - constructor(client: ApplicationClient) { - this.client = client; - } - - /** - * Gets the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - jitRequestName: string, - options?: JitRequestsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, jitRequestName, options }, - getOperationSpec - ); - } - - /** - * Creates or updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestDefinition, - options?: JitRequestsCreateOrUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - JitRequestsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, jitRequestName, parameters, options }, - spec: createOrUpdateOperationSpec - }); - const poller = await createHttpPoller< - JitRequestsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestDefinition, - options?: JitRequestsCreateOrUpdateOptionalParams - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - jitRequestName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * Updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestPatchable, - options?: JitRequestsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, jitRequestName, parameters, options }, - updateOperationSpec - ); - } - - /** - * Deletes the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - jitRequestName: string, - options?: JitRequestsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, jitRequestName, options }, - deleteOperationSpec - ); - } - - /** - * Lists all JIT requests within the subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: JitRequestsListBySubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec - ); - } - - /** - * Lists all JIT requests within the resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: JitRequestsListByResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinition - }, - 404: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.jitRequestName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinition - }, - 201: { - bodyMapper: Mappers.JitRequestDefinition - }, - 202: { - bodyMapper: Mappers.JitRequestDefinition - }, - 204: { - bodyMapper: Mappers.JitRequestDefinition - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.jitRequestName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinition - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.jitRequestName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.jitRequestName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/jitRequests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applicationDefinitions.ts b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applicationDefinitions.ts index f170bdb34088..c02623e9b660 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applicationDefinitions.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applicationDefinitions.ts @@ -7,25 +7,20 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { ApplicationDefinition, ApplicationDefinitionsListByResourceGroupOptionalParams, - ApplicationDefinitionsListBySubscriptionOptionalParams, ApplicationDefinitionsGetOptionalParams, ApplicationDefinitionsGetResponse, ApplicationDefinitionsDeleteOptionalParams, ApplicationDefinitionsCreateOrUpdateOptionalParams, ApplicationDefinitionsCreateOrUpdateResponse, - ApplicationDefinitionPatchable, - ApplicationDefinitionsUpdateOptionalParams, - ApplicationDefinitionsUpdateResponse, ApplicationDefinitionsGetByIdOptionalParams, ApplicationDefinitionsGetByIdResponse, ApplicationDefinitionsDeleteByIdOptionalParams, ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, ApplicationDefinitionsCreateOrUpdateByIdResponse, - ApplicationDefinitionsUpdateByIdOptionalParams, - ApplicationDefinitionsUpdateByIdResponse } from "../models"; /// @@ -38,14 +33,7 @@ export interface ApplicationDefinitions { */ listByResourceGroup( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Lists all the application definitions within a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the managed application definition. @@ -56,45 +44,61 @@ export interface ApplicationDefinitions { get( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsGetOptionalParams + options?: ApplicationDefinitionsGetOptionalParams, ): Promise; /** * Deletes the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationDefinitionName The name of the managed application definition. + * @param applicationDefinitionName The name of the managed application definition to delete. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + applicationDefinitionName: string, + options?: ApplicationDefinitionsDeleteOptionalParams, + ): Promise, void>>; + /** + * Deletes the managed application definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition to delete. * @param options The options parameters. */ - delete( + beginDeleteAndWait( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteOptionalParams + options?: ApplicationDefinitionsDeleteOptionalParams, ): Promise; /** - * Creates or updates a managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param parameters Parameters supplied to the create or update an managed application definition. * @param options The options parameters. */ - createOrUpdate( + beginCreateOrUpdate( resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, - options?: ApplicationDefinitionsCreateOrUpdateOptionalParams - ): Promise; + options?: ApplicationDefinitionsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApplicationDefinitionsCreateOrUpdateResponse + > + >; /** - * Updates the managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. - * @param parameters Parameters supplied to the update a managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. * @param options The options parameters. */ - update( + beginCreateOrUpdateAndWait( resourceGroupName: string, applicationDefinitionName: string, - parameters: ApplicationDefinitionPatchable, - options?: ApplicationDefinitionsUpdateOptionalParams - ): Promise; + parameters: ApplicationDefinition, + options?: ApplicationDefinitionsCreateOrUpdateOptionalParams, + ): Promise; /** * Gets the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -104,7 +108,7 @@ export interface ApplicationDefinitions { getById( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsGetByIdOptionalParams + options?: ApplicationDefinitionsGetByIdOptionalParams, ): Promise; /** * Deletes the managed application definition. @@ -112,35 +116,51 @@ export interface ApplicationDefinitions { * @param applicationDefinitionName The name of the managed application definition. * @param options The options parameters. */ - deleteById( + beginDeleteById( + resourceGroupName: string, + applicationDefinitionName: string, + options?: ApplicationDefinitionsDeleteByIdOptionalParams, + ): Promise, void>>; + /** + * Deletes the managed application definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param options The options parameters. + */ + beginDeleteByIdAndWait( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteByIdOptionalParams + options?: ApplicationDefinitionsDeleteByIdOptionalParams, ): Promise; /** - * Creates or updates a managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param parameters Parameters supplied to the create or update a managed application definition. * @param options The options parameters. */ - createOrUpdateById( + beginCreateOrUpdateById( resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, - options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams - ): Promise; + options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApplicationDefinitionsCreateOrUpdateByIdResponse + > + >; /** - * Updates the managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. - * @param parameters Parameters supplied to the update a managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. * @param options The options parameters. */ - updateById( + beginCreateOrUpdateByIdAndWait( resourceGroupName: string, applicationDefinitionName: string, - parameters: ApplicationDefinitionPatchable, - options?: ApplicationDefinitionsUpdateByIdOptionalParams - ): Promise; + parameters: ApplicationDefinition, + options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, + ): Promise; } diff --git a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applications.ts b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applications.ts index 7a1527981881..1bb8d4321782 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applications.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applications.ts @@ -26,34 +26,26 @@ import { ApplicationsCreateOrUpdateByIdResponse, ApplicationsUpdateByIdOptionalParams, ApplicationsUpdateByIdResponse, - ApplicationsRefreshPermissionsOptionalParams, - ApplicationsListAllowedUpgradePlansOptionalParams, - ApplicationsListAllowedUpgradePlansResponse, - UpdateAccessDefinition, - ApplicationsUpdateAccessOptionalParams, - ListTokenRequest, - ApplicationsListTokensOptionalParams, - ApplicationsListTokensResponse } from "../models"; /// /** Interface representing a Applications. */ export interface Applications { /** - * Lists all the applications within a resource group. + * Gets all the applications within a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ listByResourceGroup( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists all the applications within a subscription. + * Gets all the applications within a subscription. * @param options The options parameters. */ listBySubscription( - options?: ApplicationsListBySubscriptionOptionalParams + options?: ApplicationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the managed application. @@ -64,7 +56,7 @@ export interface Applications { get( resourceGroupName: string, applicationName: string, - options?: ApplicationsGetOptionalParams + options?: ApplicationsGetOptionalParams, ): Promise; /** * Deletes the managed application. @@ -75,7 +67,7 @@ export interface Applications { beginDelete( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise, void>>; /** * Deletes the managed application. @@ -86,10 +78,10 @@ export interface Applications { beginDeleteAndWait( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise; /** - * Creates or updates a managed application. + * Creates a new managed application. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param parameters Parameters supplied to the create or update a managed application. @@ -99,7 +91,7 @@ export interface Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -107,7 +99,7 @@ export interface Applications { > >; /** - * Creates or updates a managed application. + * Creates a new managed application. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param parameters Parameters supplied to the create or update a managed application. @@ -117,34 +109,19 @@ export interface Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise; /** - * Updates an existing managed application. + * Updates an existing managed application. The only value that can be updated via PATCH currently is + * the tags. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param options The options parameters. */ - beginUpdate( + update( resourceGroupName: string, applicationName: string, - options?: ApplicationsUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ApplicationsUpdateResponse - > - >; - /** - * Updates an existing managed application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsUpdateOptionalParams + options?: ApplicationsUpdateOptionalParams, ): Promise; /** * Gets the managed application. @@ -155,7 +132,7 @@ export interface Applications { */ getById( applicationId: string, - options?: ApplicationsGetByIdOptionalParams + options?: ApplicationsGetByIdOptionalParams, ): Promise; /** * Deletes the managed application. @@ -166,7 +143,7 @@ export interface Applications { */ beginDeleteById( applicationId: string, - options?: ApplicationsDeleteByIdOptionalParams + options?: ApplicationsDeleteByIdOptionalParams, ): Promise, void>>; /** * Deletes the managed application. @@ -177,10 +154,10 @@ export interface Applications { */ beginDeleteByIdAndWait( applicationId: string, - options?: ApplicationsDeleteByIdOptionalParams + options?: ApplicationsDeleteByIdOptionalParams, ): Promise; /** - * Creates or updates a managed application. + * Creates a new managed application. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} @@ -190,7 +167,7 @@ export interface Applications { beginCreateOrUpdateById( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -198,7 +175,7 @@ export interface Applications { > >; /** - * Creates or updates a managed application. + * Creates a new managed application. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} @@ -208,105 +185,18 @@ export interface Applications { beginCreateOrUpdateByIdAndWait( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise; /** - * Updates an existing managed application. - * @param applicationId The fully qualified ID of the managed application, including the managed - * application name and the managed application resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} - * @param options The options parameters. - */ - beginUpdateById( - applicationId: string, - options?: ApplicationsUpdateByIdOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ApplicationsUpdateByIdResponse - > - >; - /** - * Updates an existing managed application. + * Updates an existing managed application. The only value that can be updated via PATCH currently is + * the tags. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} * @param options The options parameters. */ - beginUpdateByIdAndWait( + updateById( applicationId: string, - options?: ApplicationsUpdateByIdOptionalParams + options?: ApplicationsUpdateByIdOptionalParams, ): Promise; - /** - * Refresh Permissions for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - beginRefreshPermissions( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsRefreshPermissionsOptionalParams - ): Promise, void>>; - /** - * Refresh Permissions for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - beginRefreshPermissionsAndWait( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsRefreshPermissionsOptionalParams - ): Promise; - /** - * List allowed upgrade plans for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - listAllowedUpgradePlans( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsListAllowedUpgradePlansOptionalParams - ): Promise; - /** - * Update access for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - beginUpdateAccess( - resourceGroupName: string, - applicationName: string, - parameters: UpdateAccessDefinition, - options?: ApplicationsUpdateAccessOptionalParams - ): Promise, void>>; - /** - * Update access for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - beginUpdateAccessAndWait( - resourceGroupName: string, - applicationName: string, - parameters: UpdateAccessDefinition, - options?: ApplicationsUpdateAccessOptionalParams - ): Promise; - /** - * List tokens for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - listTokens( - resourceGroupName: string, - applicationName: string, - parameters: ListTokenRequest, - options?: ApplicationsListTokensOptionalParams - ): Promise; } diff --git a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/index.ts b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/index.ts index 63259e0e45c4..6ca98c210b1c 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/index.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/index.ts @@ -8,4 +8,3 @@ export * from "./applications"; export * from "./applicationDefinitions"; -export * from "./jitRequests"; diff --git a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/jitRequests.ts b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/jitRequests.ts deleted file mode 100644 index 980b0f074b76..000000000000 --- a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/jitRequests.ts +++ /dev/null @@ -1,110 +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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - JitRequestsGetOptionalParams, - JitRequestsGetResponse, - JitRequestDefinition, - JitRequestsCreateOrUpdateOptionalParams, - JitRequestsCreateOrUpdateResponse, - JitRequestPatchable, - JitRequestsUpdateOptionalParams, - JitRequestsUpdateResponse, - JitRequestsDeleteOptionalParams, - JitRequestsListBySubscriptionOptionalParams, - JitRequestsListBySubscriptionResponse, - JitRequestsListByResourceGroupOptionalParams, - JitRequestsListByResourceGroupResponse -} from "../models"; - -/** Interface representing a JitRequests. */ -export interface JitRequests { - /** - * Gets the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - jitRequestName: string, - options?: JitRequestsGetOptionalParams - ): Promise; - /** - * Creates or updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestDefinition, - options?: JitRequestsCreateOrUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - JitRequestsCreateOrUpdateResponse - > - >; - /** - * Creates or updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestDefinition, - options?: JitRequestsCreateOrUpdateOptionalParams - ): Promise; - /** - * Updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestPatchable, - options?: JitRequestsUpdateOptionalParams - ): Promise; - /** - * Deletes the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - jitRequestName: string, - options?: JitRequestsDeleteOptionalParams - ): Promise; - /** - * Lists all JIT requests within the subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: JitRequestsListBySubscriptionOptionalParams - ): Promise; - /** - * Lists all JIT requests within the resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: JitRequestsListByResourceGroupOptionalParams - ): Promise; -} diff --git a/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts b/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts +++ b/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/managedapplications/arm-managedapplications/test/sampleTest.ts b/sdk/managedapplications/arm-managedapplications/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/managedapplications/arm-managedapplications/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/managedapplications/arm-managedapplications/tsconfig.json b/sdk/managedapplications/arm-managedapplications/tsconfig.json index 8c28d0f9be7e..532c30c06f72 100644 --- a/sdk/managedapplications/arm-managedapplications/tsconfig.json +++ b/sdk/managedapplications/arm-managedapplications/tsconfig.json @@ -15,17 +15,16 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-managedapplications": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/policy/arm-policy/CHANGELOG.md b/sdk/policy/arm-policy/CHANGELOG.md index 3a6f70113127..bf2ef835a0c3 100644 --- a/sdk/policy/arm-policy/CHANGELOG.md +++ b/sdk/policy/arm-policy/CHANGELOG.md @@ -1,15 +1,126 @@ # Release History - -## 5.1.1 (Unreleased) - + +## 6.0.0 (2024-12-10) + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation group PolicyDefinitionVersions + - Added operation group PolicySetDefinitionVersions + - Added Interface Override + - Added Interface PolicyDefinitionVersion + - Added Interface PolicyDefinitionVersionListResult + - Added Interface PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsCreateOrUpdateOptionalParams + - Added Interface PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsDeleteOptionalParams + - Added Interface PolicyDefinitionVersionsGetAtManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsGetBuiltInOptionalParams + - Added Interface PolicyDefinitionVersionsGetOptionalParams + - Added Interface PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsListAllBuiltinsOptionalParams + - Added Interface PolicyDefinitionVersionsListAllOptionalParams + - Added Interface PolicyDefinitionVersionsListBuiltInNextOptionalParams + - Added Interface PolicyDefinitionVersionsListBuiltInOptionalParams + - Added Interface PolicyDefinitionVersionsListByManagementGroupNextOptionalParams + - Added Interface PolicyDefinitionVersionsListByManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsListNextOptionalParams + - Added Interface PolicyDefinitionVersionsListOptionalParams + - Added Interface PolicySetDefinitionVersion + - Added Interface PolicySetDefinitionVersionListResult + - Added Interface PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsCreateOrUpdateOptionalParams + - Added Interface PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsDeleteOptionalParams + - Added Interface PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsGetBuiltInOptionalParams + - Added Interface PolicySetDefinitionVersionsGetOptionalParams + - Added Interface PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsListAllBuiltinsOptionalParams + - Added Interface PolicySetDefinitionVersionsListAllOptionalParams + - Added Interface PolicySetDefinitionVersionsListBuiltInNextOptionalParams + - Added Interface PolicySetDefinitionVersionsListBuiltInOptionalParams + - Added Interface PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams + - Added Interface PolicySetDefinitionVersionsListByManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsListNextOptionalParams + - Added Interface PolicySetDefinitionVersionsListOptionalParams + - Added Interface ResourceSelector + - Added Interface Selector + - Added Type Alias AssignmentType + - Added Type Alias OverrideKind + - Added Type Alias PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse + - Added Type Alias PolicyDefinitionVersionsCreateOrUpdateResponse + - Added Type Alias PolicyDefinitionVersionsGetAtManagementGroupResponse + - Added Type Alias PolicyDefinitionVersionsGetBuiltInResponse + - Added Type Alias PolicyDefinitionVersionsGetResponse + - Added Type Alias PolicyDefinitionVersionsListAllAtManagementGroupResponse + - Added Type Alias PolicyDefinitionVersionsListAllBuiltinsResponse + - Added Type Alias PolicyDefinitionVersionsListAllResponse + - Added Type Alias PolicyDefinitionVersionsListBuiltInNextResponse + - Added Type Alias PolicyDefinitionVersionsListBuiltInResponse + - Added Type Alias PolicyDefinitionVersionsListByManagementGroupNextResponse + - Added Type Alias PolicyDefinitionVersionsListByManagementGroupResponse + - Added Type Alias PolicyDefinitionVersionsListNextResponse + - Added Type Alias PolicyDefinitionVersionsListResponse + - Added Type Alias PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse + - Added Type Alias PolicySetDefinitionVersionsCreateOrUpdateResponse + - Added Type Alias PolicySetDefinitionVersionsGetAtManagementGroupResponse + - Added Type Alias PolicySetDefinitionVersionsGetBuiltInResponse + - Added Type Alias PolicySetDefinitionVersionsGetResponse + - Added Type Alias PolicySetDefinitionVersionsListAllAtManagementGroupResponse + - Added Type Alias PolicySetDefinitionVersionsListAllBuiltinsResponse + - Added Type Alias PolicySetDefinitionVersionsListAllResponse + - Added Type Alias PolicySetDefinitionVersionsListBuiltInNextResponse + - Added Type Alias PolicySetDefinitionVersionsListBuiltInResponse + - Added Type Alias PolicySetDefinitionVersionsListByManagementGroupNextResponse + - Added Type Alias PolicySetDefinitionVersionsListByManagementGroupResponse + - Added Type Alias PolicySetDefinitionVersionsListNextResponse + - Added Type Alias PolicySetDefinitionVersionsListResponse + - Added Type Alias SelectorKind + - Interface ParameterDefinitionsValue has a new optional parameter schema + - Interface PolicyAssignment has a new optional parameter assignmentType + - Interface PolicyAssignment has a new optional parameter definitionVersion + - Interface PolicyAssignment has a new optional parameter effectiveDefinitionVersion + - Interface PolicyAssignment has a new optional parameter instanceId + - Interface PolicyAssignment has a new optional parameter latestDefinitionVersion + - Interface PolicyAssignment has a new optional parameter overrides + - Interface PolicyAssignment has a new optional parameter resourceSelectors + - Interface PolicyAssignmentsGetOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentsListForManagementGroupOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentsListForResourceGroupOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentsListForResourceOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentsListOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentUpdate has a new optional parameter overrides + - Interface PolicyAssignmentUpdate has a new optional parameter resourceSelectors + - Interface PolicyClientOptionalParams has a new optional parameter apiVersion + - Interface PolicyDefinition has a new optional parameter version + - Interface PolicyDefinition has a new optional parameter versions + - Interface PolicyDefinitionReference has a new optional parameter definitionVersion + - Interface PolicyDefinitionReference has a new optional parameter effectiveDefinitionVersion + - Interface PolicyDefinitionReference has a new optional parameter latestDefinitionVersion + - Interface PolicySetDefinition has a new optional parameter version + - Interface PolicySetDefinition has a new optional parameter versions + - Interface PolicySetDefinitionsGetAtManagementGroupOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsGetBuiltInOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsGetOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsListBuiltInOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsListByManagementGroupOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsListOptionalParams has a new optional parameter expand + - Added Enum KnownAssignmentType + - Added Enum KnownOverrideKind + - Added Enum KnownSelectorKind + - Enum KnownEnforcementMode has a new value Enroll -### Other Changes +### Breaking Changes + - Removed operation group DataPolicyManifests + - Removed operation group PolicyExemptions + - Class PolicyClient no longer has parameter dataPolicyManifests + - Class PolicyClient no longer has parameter policyExemptions + - Removed Enum KnownAliasPathAttributes + - Removed Enum KnownAliasPathTokenType + - Removed Enum KnownExemptionCategory + + ## 5.1.0 (2023-05-18) ### Features Added @@ -52,13 +163,13 @@ ## 5.0.2 (2022-07-04) -### Features Added +**features** - Bug fix ## 5.0.1 (2022-04-18) -### Features Added +**features** - Bug fix @@ -70,4 +181,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/policy/arm-policy/LICENSE b/sdk/policy/arm-policy/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/policy/arm-policy/LICENSE +++ b/sdk/policy/arm-policy/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +Copyright (c) 2024 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/policy/arm-policy/README.md b/sdk/policy/arm-policy/README.md index 09f248c27622..e61e0bbc1e1b 100644 --- a/sdk/policy/arm-policy/README.md +++ b/sdk/policy/arm-policy/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Policy** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/policy/arm-policy/_meta.json b/sdk/policy/arm-policy/_meta.json index 6878746ca206..267db4618701 100644 --- a/sdk/policy/arm-policy/_meta.json +++ b/sdk/policy/arm-policy/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "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", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.2" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/policy/arm-policy/package.json b/sdk/policy/arm-policy/package.json index 21ff20fff93a..70b6aa3c02ec 100644 --- a/sdk/policy/arm-policy/package.json +++ b/sdk/policy/arm-policy/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for PolicyClient.", - "version": "5.1.1", + "version": "6.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.7.0", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -26,19 +26,19 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-policy.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", - "@azure/arm-managementgroups": "^2.0.1", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -66,28 +66,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -100,13 +100,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-policy?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy" +} \ No newline at end of file diff --git a/sdk/policy/arm-policy/review/arm-policy.api.md b/sdk/policy/arm-policy/review/arm-policy.api.md index 906abdb54c43..d722604b92a2 100644 --- a/sdk/policy/arm-policy/review/arm-policy.api.md +++ b/sdk/policy/arm-policy/review/arm-policy.api.md @@ -9,47 +9,7 @@ import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; // @public -export interface Alias { - readonly defaultMetadata?: AliasPathMetadata; - defaultPath?: string; - defaultPattern?: AliasPattern; - name?: string; - paths?: AliasPath[]; - type?: AliasType; -} - -// @public -export interface AliasPath { - apiVersions?: string[]; - readonly metadata?: AliasPathMetadata; - path?: string; - pattern?: AliasPattern; -} - -// @public -export type AliasPathAttributes = string; - -// @public (undocumented) -export interface AliasPathMetadata { - readonly attributes?: AliasPathAttributes; - readonly type?: AliasPathTokenType; -} - -// @public -export type AliasPathTokenType = string; - -// @public -export interface AliasPattern { - phrase?: string; - type?: AliasPatternType; - variable?: string; -} - -// @public -export type AliasPatternType = "NotSpecified" | "Extract"; - -// @public -export type AliasType = "NotSpecified" | "PlainText" | "Mask"; +export type AssignmentType = string; // @public export interface CloudError { @@ -59,69 +19,6 @@ export interface CloudError { // @public export type CreatedByType = string; -// @public -export interface DataEffect { - detailsSchema?: any; - name?: string; -} - -// @public -export interface DataManifestCustomResourceFunctionDefinition { - allowCustomProperties?: boolean; - defaultProperties?: string[]; - fullyQualifiedResourceType?: string; - name?: string; -} - -// @public -export interface DataPolicyManifest { - custom?: DataManifestCustomResourceFunctionDefinition[]; - effects?: DataEffect[]; - fieldValues?: string[]; - readonly id?: string; - isBuiltInOnly?: boolean; - readonly name?: string; - namespaces?: string[]; - policyMode?: string; - resourceTypeAliases?: ResourceTypeAliases[]; - standard?: string[]; - readonly type?: string; -} - -// @public -export interface DataPolicyManifestListResult { - nextLink?: string; - value?: DataPolicyManifest[]; -} - -// @public -export interface DataPolicyManifests { - getByPolicyMode(policyMode: string, options?: DataPolicyManifestsGetByPolicyModeOptionalParams): Promise; - list(options?: DataPolicyManifestsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DataPolicyManifestsGetByPolicyModeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataPolicyManifestsGetByPolicyModeResponse = DataPolicyManifest; - -// @public -export interface DataPolicyManifestsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataPolicyManifestsListNextResponse = DataPolicyManifestListResult; - -// @public -export interface DataPolicyManifestsListOptionalParams extends coreClient.OperationOptions { - filter?: string; -} - -// @public -export type DataPolicyManifestsListResponse = DataPolicyManifestListResult; - // @public export type EnforcementMode = string; @@ -140,9 +37,6 @@ export interface ErrorResponse { readonly target?: string; } -// @public -export type ExemptionCategory = string; - // @public export function getContinuationToken(page: unknown): string | undefined; @@ -157,21 +51,11 @@ export interface Identity { } // @public -export enum KnownAliasPathAttributes { - Modifiable = "Modifiable", - None = "None" -} - -// @public -export enum KnownAliasPathTokenType { - Any = "Any", - Array = "Array", - Boolean = "Boolean", - Integer = "Integer", +export enum KnownAssignmentType { + Custom = "Custom", NotSpecified = "NotSpecified", - Number = "Number", - Object = "Object", - String = "String" + System = "System", + SystemHidden = "SystemHidden" } // @public @@ -185,13 +69,14 @@ export enum KnownCreatedByType { // @public export enum KnownEnforcementMode { Default = "Default", - DoNotEnforce = "DoNotEnforce" + DoNotEnforce = "DoNotEnforce", + Enroll = "Enroll" } // @public -export enum KnownExemptionCategory { - Mitigated = "Mitigated", - Waiver = "Waiver" +export enum KnownOverrideKind { + DefinitionVersion = "definitionVersion", + PolicyEffect = "policyEffect" } // @public @@ -213,17 +98,36 @@ export enum KnownPolicyType { Static = "Static" } +// @public +export enum KnownSelectorKind { + PolicyDefinitionReferenceId = "policyDefinitionReferenceId", + ResourceLocation = "resourceLocation", + ResourceType = "resourceType", + ResourceWithoutLocation = "resourceWithoutLocation" +} + // @public export interface NonComplianceMessage { message: string; policyDefinitionReferenceId?: string; } +// @public +export interface Override { + kind?: OverrideKind; + selectors?: Selector[]; + value?: string; +} + +// @public +export type OverrideKind = string; + // @public export interface ParameterDefinitionsValue { allowedValues?: any[]; defaultValue?: any; metadata?: ParameterDefinitionsValueMetadata; + schema?: any; type?: ParameterType; } @@ -246,20 +150,27 @@ export interface ParameterValuesValue { // @public export interface PolicyAssignment { + assignmentType?: AssignmentType; + definitionVersion?: string; description?: string; displayName?: string; + readonly effectiveDefinitionVersion?: string; enforcementMode?: EnforcementMode; readonly id?: string; identity?: Identity; + readonly instanceId?: string; + readonly latestDefinitionVersion?: string; location?: string; metadata?: any; readonly name?: string; nonComplianceMessages?: NonComplianceMessage[]; notScopes?: string[]; + overrides?: Override[]; parameters?: { [propertyName: string]: ParameterValuesValue; }; policyDefinitionId?: string; + resourceSelectors?: ResourceSelector[]; readonly scope?: string; readonly systemData?: SystemData; readonly type?: string; @@ -324,6 +235,7 @@ export type PolicyAssignmentsGetByIdResponse = PolicyAssignment; // @public export interface PolicyAssignmentsGetOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public @@ -338,6 +250,7 @@ export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignme // @public export interface PolicyAssignmentsListForManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -354,6 +267,7 @@ export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignment // @public export interface PolicyAssignmentsListForResourceGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -370,6 +284,7 @@ export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListR // @public export interface PolicyAssignmentsListForResourceOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -386,6 +301,7 @@ export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult; // @public export interface PolicyAssignmentsListOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -407,10 +323,12 @@ export interface PolicyAssignmentsUpdateOptionalParams extends coreClient.Operat // @public export type PolicyAssignmentsUpdateResponse = PolicyAssignment; -// @public (undocumented) +// @public export interface PolicyAssignmentUpdate { identity?: Identity; location?: string; + overrides?: Override[]; + resourceSelectors?: ResourceSelector[]; } // @public (undocumented) @@ -420,22 +338,25 @@ export class PolicyClient extends coreClient.ServiceClient { constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyClientOptionalParams); constructor(credentials: coreAuth.TokenCredential, options?: PolicyClientOptionalParams); // (undocumented) - dataPolicyManifests: DataPolicyManifests; + apiVersion: string; // (undocumented) policyAssignments: PolicyAssignments; // (undocumented) policyDefinitions: PolicyDefinitions; // (undocumented) - policyExemptions: PolicyExemptions; + policyDefinitionVersions: PolicyDefinitionVersions; // (undocumented) policySetDefinitions: PolicySetDefinitions; // (undocumented) + policySetDefinitionVersions: PolicySetDefinitionVersions; + // (undocumented) subscriptionId?: string; } // @public export interface PolicyClientOptionalParams extends coreClient.ServiceClientOptions { $host?: string; + apiVersion?: string; endpoint?: string; } @@ -454,6 +375,8 @@ export interface PolicyDefinition { policyType?: PolicyType; readonly systemData?: SystemData; readonly type?: string; + version?: string; + versions?: string[]; } // @public @@ -473,7 +396,10 @@ export interface PolicyDefinitionListResult { // @public export interface PolicyDefinitionReference { + definitionVersion?: string; + readonly effectiveDefinitionVersion?: string; groupNames?: string[]; + readonly latestDefinitionVersion?: string; parameters?: { [propertyName: string]: ParameterValuesValue; }; @@ -484,11 +410,11 @@ export interface PolicyDefinitionReference { // @public export interface PolicyDefinitions { createOrUpdate(policyDefinitionName: string, parameters: PolicyDefinition, options?: PolicyDefinitionsCreateOrUpdateOptionalParams): Promise; - createOrUpdateAtManagementGroup(policyDefinitionName: string, managementGroupId: string, parameters: PolicyDefinition, options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupId: string, policyDefinitionName: string, parameters: PolicyDefinition, options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; delete(policyDefinitionName: string, options?: PolicyDefinitionsDeleteOptionalParams): Promise; - deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams): Promise; + deleteAtManagementGroup(managementGroupId: string, policyDefinitionName: string, options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams): Promise; get(policyDefinitionName: string, options?: PolicyDefinitionsGetOptionalParams): Promise; - getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: PolicyDefinitionsGetAtManagementGroupOptionalParams): Promise; + getAtManagementGroup(managementGroupId: string, policyDefinitionName: string, options?: PolicyDefinitionsGetAtManagementGroupOptionalParams): Promise; getBuiltIn(policyDefinitionName: string, options?: PolicyDefinitionsGetBuiltInOptionalParams): Promise; list(options?: PolicyDefinitionsListOptionalParams): PagedAsyncIterableIterator; listBuiltIn(options?: PolicyDefinitionsListBuiltInOptionalParams): PagedAsyncIterableIterator; @@ -587,114 +513,154 @@ export interface PolicyDefinitionsListOptionalParams extends coreClient.Operatio export type PolicyDefinitionsListResponse = PolicyDefinitionListResult; // @public -export interface PolicyExemption { +export interface PolicyDefinitionVersion { description?: string; displayName?: string; - exemptionCategory: ExemptionCategory; - expiresOn?: Date; readonly id?: string; metadata?: any; + mode?: string; readonly name?: string; - policyAssignmentId: string; - policyDefinitionReferenceIds?: string[]; + parameters?: { + [propertyName: string]: ParameterDefinitionsValue; + }; + policyRule?: any; + policyType?: PolicyType; readonly systemData?: SystemData; readonly type?: string; + version?: string; } // @public -export interface PolicyExemptionListResult { - readonly nextLink?: string; - value?: PolicyExemption[]; +export interface PolicyDefinitionVersionListResult { + nextLink?: string; + value?: PolicyDefinitionVersion[]; } // @public -export interface PolicyExemptions { - createOrUpdate(scope: string, policyExemptionName: string, parameters: PolicyExemption, options?: PolicyExemptionsCreateOrUpdateOptionalParams): Promise; - delete(scope: string, policyExemptionName: string, options?: PolicyExemptionsDeleteOptionalParams): Promise; - get(scope: string, policyExemptionName: string, options?: PolicyExemptionsGetOptionalParams): Promise; - list(options?: PolicyExemptionsListOptionalParams): PagedAsyncIterableIterator; - listForManagementGroup(managementGroupId: string, options?: PolicyExemptionsListForManagementGroupOptionalParams): PagedAsyncIterableIterator; - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: PolicyExemptionsListForResourceOptionalParams): PagedAsyncIterableIterator; - listForResourceGroup(resourceGroupName: string, options?: PolicyExemptionsListForResourceGroupOptionalParams): PagedAsyncIterableIterator; +export interface PolicyDefinitionVersions { + createOrUpdate(policyDefinitionName: string, policyDefinitionVersion: string, parameters: PolicyDefinitionVersion, options?: PolicyDefinitionVersionsCreateOrUpdateOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupName: string, policyDefinitionName: string, policyDefinitionVersion: string, parameters: PolicyDefinitionVersion, options?: PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; + delete(policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsDeleteOptionalParams): Promise; + deleteAtManagementGroup(managementGroupName: string, policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams): Promise; + get(policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsGetOptionalParams): Promise; + getAtManagementGroup(managementGroupName: string, policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsGetAtManagementGroupOptionalParams): Promise; + getBuiltIn(policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsGetBuiltInOptionalParams): Promise; + list(policyDefinitionName: string, options?: PolicyDefinitionVersionsListOptionalParams): PagedAsyncIterableIterator; + listAll(options?: PolicyDefinitionVersionsListAllOptionalParams): Promise; + listAllAtManagementGroup(managementGroupName: string, options?: PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams): Promise; + listAllBuiltins(options?: PolicyDefinitionVersionsListAllBuiltinsOptionalParams): Promise; + listBuiltIn(policyDefinitionName: string, options?: PolicyDefinitionVersionsListBuiltInOptionalParams): PagedAsyncIterableIterator; + listByManagementGroup(managementGroupName: string, policyDefinitionName: string, options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams): PagedAsyncIterableIterator; } // @public -export interface PolicyExemptionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsCreateOrUpdateResponse = PolicyExemption; +export type PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse = PolicyDefinitionVersion; // @public -export interface PolicyExemptionsDeleteOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { } // @public -export interface PolicyExemptionsGetOptionalParams extends coreClient.OperationOptions { +export type PolicyDefinitionVersionsCreateOrUpdateResponse = PolicyDefinitionVersion; + +// @public +export interface PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsGetResponse = PolicyExemption; +export interface PolicyDefinitionVersionsDeleteOptionalParams extends coreClient.OperationOptions { +} // @public -export interface PolicyExemptionsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForManagementGroupNextResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsGetAtManagementGroupResponse = PolicyDefinitionVersion; // @public -export interface PolicyExemptionsListForManagementGroupOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyDefinitionVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsGetBuiltInResponse = PolicyDefinitionVersion; // @public -export interface PolicyExemptionsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsGetOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForResourceGroupNextResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsGetResponse = PolicyDefinitionVersion; // @public -export interface PolicyExemptionsListForResourceGroupOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForResourceGroupResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListAllAtManagementGroupResponse = PolicyDefinitionVersionListResult; // @public -export interface PolicyExemptionsListForResourceNextOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsListAllBuiltinsOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForResourceNextResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListAllBuiltinsResponse = PolicyDefinitionVersionListResult; // @public -export interface PolicyExemptionsListForResourceOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyDefinitionVersionsListAllOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForResourceResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListAllResponse = PolicyDefinitionVersionListResult; // @public -export interface PolicyExemptionsListNextOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsListBuiltInNextOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListNextResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListBuiltInNextResponse = PolicyDefinitionVersionListResult; // @public -export interface PolicyExemptionsListOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyDefinitionVersionsListBuiltInOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type PolicyDefinitionVersionsListBuiltInResponse = PolicyDefinitionVersionListResult; + +// @public +export interface PolicyDefinitionVersionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListByManagementGroupNextResponse = PolicyDefinitionVersionListResult; + +// @public +export interface PolicyDefinitionVersionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type PolicyDefinitionVersionsListByManagementGroupResponse = PolicyDefinitionVersionListResult; + +// @public +export interface PolicyDefinitionVersionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicyDefinitionVersionsListNextResponse = PolicyDefinitionVersionListResult; + +// @public +export interface PolicyDefinitionVersionsListOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type PolicyDefinitionVersionsListResponse = PolicyDefinitionVersionListResult; // @public export interface PolicySetDefinition { @@ -711,6 +677,8 @@ export interface PolicySetDefinition { policyType?: PolicyType; readonly systemData?: SystemData; readonly type?: string; + version?: string; + versions?: string[]; } // @public @@ -722,11 +690,11 @@ export interface PolicySetDefinitionListResult { // @public export interface PolicySetDefinitions { createOrUpdate(policySetDefinitionName: string, parameters: PolicySetDefinition, options?: PolicySetDefinitionsCreateOrUpdateOptionalParams): Promise; - createOrUpdateAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, parameters: PolicySetDefinition, options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupId: string, policySetDefinitionName: string, parameters: PolicySetDefinition, options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; delete(policySetDefinitionName: string, options?: PolicySetDefinitionsDeleteOptionalParams): Promise; - deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams): Promise; + deleteAtManagementGroup(managementGroupId: string, policySetDefinitionName: string, options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams): Promise; get(policySetDefinitionName: string, options?: PolicySetDefinitionsGetOptionalParams): Promise; - getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams): Promise; + getAtManagementGroup(managementGroupId: string, policySetDefinitionName: string, options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams): Promise; getBuiltIn(policySetDefinitionName: string, options?: PolicySetDefinitionsGetBuiltInOptionalParams): Promise; list(options?: PolicySetDefinitionsListOptionalParams): PagedAsyncIterableIterator; listBuiltIn(options?: PolicySetDefinitionsListBuiltInOptionalParams): PagedAsyncIterableIterator; @@ -757,6 +725,7 @@ export interface PolicySetDefinitionsDeleteOptionalParams extends coreClient.Ope // @public export interface PolicySetDefinitionsGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public @@ -764,6 +733,7 @@ export type PolicySetDefinitionsGetAtManagementGroupResponse = PolicySetDefiniti // @public export interface PolicySetDefinitionsGetBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public @@ -771,6 +741,7 @@ export type PolicySetDefinitionsGetBuiltInResponse = PolicySetDefinition; // @public export interface PolicySetDefinitionsGetOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public @@ -785,6 +756,7 @@ export type PolicySetDefinitionsListBuiltInNextResponse = PolicySetDefinitionLis // @public export interface PolicySetDefinitionsListBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -801,6 +773,7 @@ export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDef // @public export interface PolicySetDefinitionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -817,6 +790,7 @@ export type PolicySetDefinitionsListNextResponse = PolicySetDefinitionListResult // @public export interface PolicySetDefinitionsListOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -824,6 +798,162 @@ export interface PolicySetDefinitionsListOptionalParams extends coreClient.Opera // @public export type PolicySetDefinitionsListResponse = PolicySetDefinitionListResult; +// @public +export interface PolicySetDefinitionVersion { + description?: string; + displayName?: string; + readonly id?: string; + metadata?: any; + readonly name?: string; + parameters?: { + [propertyName: string]: ParameterDefinitionsValue; + }; + policyDefinitionGroups?: PolicyDefinitionGroup[]; + policyDefinitions?: PolicyDefinitionReference[]; + policyType?: PolicyType; + readonly systemData?: SystemData; + readonly type?: string; + version?: string; +} + +// @public +export interface PolicySetDefinitionVersionListResult { + nextLink?: string; + value?: PolicySetDefinitionVersion[]; +} + +// @public +export interface PolicySetDefinitionVersions { + createOrUpdate(policySetDefinitionName: string, policyDefinitionVersion: string, parameters: PolicySetDefinitionVersion, options?: PolicySetDefinitionVersionsCreateOrUpdateOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupName: string, policySetDefinitionName: string, policyDefinitionVersion: string, parameters: PolicySetDefinitionVersion, options?: PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; + delete(policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsDeleteOptionalParams): Promise; + deleteAtManagementGroup(managementGroupName: string, policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams): Promise; + get(policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsGetOptionalParams): Promise; + getAtManagementGroup(managementGroupName: string, policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams): Promise; + getBuiltIn(policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsGetBuiltInOptionalParams): Promise; + list(policySetDefinitionName: string, options?: PolicySetDefinitionVersionsListOptionalParams): PagedAsyncIterableIterator; + listAll(options?: PolicySetDefinitionVersionsListAllOptionalParams): Promise; + listAllAtManagementGroup(managementGroupName: string, options?: PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams): Promise; + listAllBuiltins(options?: PolicySetDefinitionVersionsListAllBuiltinsOptionalParams): Promise; + listBuiltIn(policySetDefinitionName: string, options?: PolicySetDefinitionVersionsListBuiltInOptionalParams): PagedAsyncIterableIterator; + listByManagementGroup(managementGroupName: string, policySetDefinitionName: string, options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsCreateOrUpdateResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PolicySetDefinitionVersionsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type PolicySetDefinitionVersionsGetAtManagementGroupResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type PolicySetDefinitionVersionsGetBuiltInResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsGetOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type PolicySetDefinitionVersionsGetResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListAllAtManagementGroupResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListAllBuiltinsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListAllBuiltinsResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListAllOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListAllResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListBuiltInNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListBuiltInNextResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type PolicySetDefinitionVersionsListBuiltInResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListByManagementGroupNextResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type PolicySetDefinitionVersionsListByManagementGroupResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListNextResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type PolicySetDefinitionVersionsListResponse = PolicySetDefinitionVersionListResult; + // @public export type PolicyType = string; @@ -831,11 +961,21 @@ export type PolicyType = string; export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; // @public -export interface ResourceTypeAliases { - aliases?: Alias[]; - resourceType?: string; +export interface ResourceSelector { + name?: string; + selectors?: Selector[]; +} + +// @public +export interface Selector { + in?: string[]; + kind?: SelectorKind; + notIn?: string[]; } +// @public +export type SelectorKind = string; + // @public export interface SystemData { createdAt?: Date; diff --git a/sdk/policy/arm-policy/sample.env b/sdk/policy/arm-policy/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/policy/arm-policy/sample.env +++ b/sdk/policy/arm-policy/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/policy/arm-policy/src/models/index.ts b/sdk/policy/arm-policy/src/models/index.ts index 43f12f588453..5f0f8fc5e7f3 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -8,124 +8,90 @@ import * as coreClient from "@azure/core-client"; -/** The data policy manifest. */ -export interface DataPolicyManifest { +/** The policy definition. */ +export interface PolicyDefinition { /** - * The ID of the data policy manifest. + * The ID of the policy definition. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The name of the data policy manifest (it's the same as the Policy Mode). + * The name of the policy definition. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The type of the resource (Microsoft.Authorization/dataPolicyManifests). + * The type of the resource (Microsoft.Authorization/policyDefinitions). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The list of namespaces for the data policy manifest. */ - namespaces?: string[]; - /** The policy mode of the data policy manifest. */ - policyMode?: string; - /** A value indicating whether policy mode is allowed only in built-in definitions. */ - isBuiltInOnly?: boolean; - /** An array of resource type aliases. */ - resourceTypeAliases?: ResourceTypeAliases[]; - /** The effect definition. */ - effects?: DataEffect[]; - /** The non-alias field accessor values that can be used in the policy rule. */ - fieldValues?: string[]; - /** The standard resource functions (subscription and/or resourceGroup). */ - standard?: string[]; - /** An array of data manifest custom resource definition. */ - custom?: DataManifestCustomResourceFunctionDefinition[]; -} - -/** The resource type aliases definition. */ -export interface ResourceTypeAliases { - /** The resource type name. */ - resourceType?: string; - /** The aliases for property names. */ - aliases?: Alias[]; -} - -/** The alias type. */ -export interface Alias { - /** The alias name. */ - name?: string; - /** The paths for an alias. */ - paths?: AliasPath[]; - /** The type of the alias. */ - type?: AliasType; - /** The default path for an alias. */ - defaultPath?: string; - /** The default pattern for an alias. */ - defaultPattern?: AliasPattern; - /** - * The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultMetadata?: AliasPathMetadata; -} - -/** The type of the paths for alias. */ -export interface AliasPath { - /** The path of an alias. */ - path?: string; - /** The API versions. */ - apiVersions?: string[]; - /** The pattern for an alias path. */ - pattern?: AliasPattern; /** - * The metadata of the alias path. If missing, fall back to the default metadata of the alias. + * The system metadata relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly metadata?: AliasPathMetadata; -} - -/** The type of the pattern for an alias path. */ -export interface AliasPattern { - /** The alias pattern phrase. */ - phrase?: string; - /** The alias pattern variable. */ - variable?: string; - /** The type of alias pattern */ - type?: AliasPatternType; + readonly systemData?: SystemData; + /** The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. */ + policyType?: PolicyType; + /** The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. */ + mode?: string; + /** The display name of the policy definition. */ + displayName?: string; + /** The policy definition description. */ + description?: string; + /** The policy rule. */ + policyRule?: any; + /** The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + metadata?: any; + /** The parameter definitions for parameters used in the policy rule. The keys are the parameter names. */ + parameters?: { [propertyName: string]: ParameterDefinitionsValue }; + /** The policy definition version in #.#.# format. */ + version?: string; + /** A list of available versions for this policy definition. */ + versions?: string[]; } -export interface AliasPathMetadata { - /** - * The type of the token that the alias path is referring to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: AliasPathTokenType; - /** - * The attributes of the token that the alias path is referring to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly attributes?: AliasPathAttributes; +/** The definition of a parameter that can be provided to the policy. */ +export interface ParameterDefinitionsValue { + /** The data type of the parameter. */ + type?: ParameterType; + /** The allowed values for the parameter. */ + allowedValues?: any[]; + /** The default value for the parameter if no value is provided. */ + defaultValue?: any; + /** Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/. */ + schema?: any; + /** General metadata for the parameter. */ + metadata?: ParameterDefinitionsValueMetadata; } -/** The data effect definition. */ -export interface DataEffect { - /** The data effect name. */ - name?: string; - /** The data effect details schema. */ - detailsSchema?: any; +/** General metadata for the parameter. */ +export interface ParameterDefinitionsValueMetadata { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The display name for the parameter. */ + displayName?: string; + /** The description of the parameter. */ + description?: string; + /** Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from. */ + strongType?: string; + /** Set to true to have Azure portal create role assignments on the resource ID or resource scope value of this parameter during policy assignment. This property is useful in case you wish to assign permissions outside the assignment scope. */ + assignPermissions?: boolean; } -/** The custom resource function definition. */ -export interface DataManifestCustomResourceFunctionDefinition { - /** The function name as it will appear in the policy rule. eg - 'vault'. */ - name?: string; - /** The fully qualified control plane resource type that this function represents. eg - 'Microsoft.KeyVault/vaults'. */ - fullyQualifiedResourceType?: string; - /** The top-level properties that can be selected on the function's output. eg - [ "name", "location" ] if vault().name and vault().location are supported */ - defaultProperties?: string[]; - /** A value indicating whether the custom properties within the property bag are allowed. Needs api-version to be specified in the policy rule eg - vault('2019-06-01'). */ - allowCustomProperties?: boolean; +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } /** An error response from a policy operation. */ @@ -177,155 +143,36 @@ export interface ErrorAdditionalInfo { readonly info?: any; } -/** List of data policy manifests. */ -export interface DataPolicyManifestListResult { - /** An array of data policy manifests. */ - value?: DataPolicyManifest[]; +/** List of policy definitions. */ +export interface PolicyDefinitionListResult { + /** An array of policy definitions. */ + value?: PolicyDefinition[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** The policy assignment. */ -export interface PolicyAssignment { - /** - * The ID of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The type of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The name of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** The location of the policy assignment. Only required when utilizing managed identity. */ - location?: string; - /** The managed identity associated with the policy assignment. */ - identity?: Identity; - /** - * The system metadata relating to this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** The display name of the policy assignment. */ - displayName?: string; - /** The ID of the policy definition or policy set definition being assigned. */ - policyDefinitionId?: string; - /** - * The scope for the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly scope?: string; - /** The policy's excluded scopes. */ - notScopes?: string[]; - /** The parameter values for the assigned policy rule. The keys are the parameter names. */ - parameters?: { [propertyName: string]: ParameterValuesValue }; - /** This message will be part of response in case of policy violation. */ - description?: string; - /** The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ - metadata?: any; - /** The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. */ - enforcementMode?: EnforcementMode; - /** The messages that describe why a resource is non-compliant with the policy. */ - nonComplianceMessages?: NonComplianceMessage[]; -} - -/** The value of a parameter. */ -export interface ParameterValuesValue { - /** The value of the parameter. */ - value?: any; -} - -/** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ -export interface NonComplianceMessage { - /** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ - message: string; - /** The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment. */ - policyDefinitionReferenceId?: string; -} - -/** Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity. */ -export interface Identity { - /** - * The principal ID of the resource identity. This property will only be provided for a system assigned identity - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of the resource identity. This property will only be provided for a system assigned identity - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The identity type. This is the only required field when adding a system or user assigned identity to a resource. */ - type?: ResourceIdentityType; - /** The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; -} - -export interface UserAssignedIdentitiesValue { - /** - * The principal id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -export interface PolicyAssignmentUpdate { - /** The location of the policy assignment. Only required when utilizing managed identity. */ - location?: string; - /** The managed identity associated with the policy assignment. */ - identity?: Identity; -} - -/** List of policy assignments. */ -export interface PolicyAssignmentListResult { - /** An array of policy assignments. */ - value?: PolicyAssignment[]; +/** List of policy definition versions. */ +export interface PolicyDefinitionVersionListResult { + /** An array of policy definitions versions. */ + value?: PolicyDefinitionVersion[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** The policy definition. */ -export interface PolicyDefinition { +/** The ID of the policy definition version. */ +export interface PolicyDefinitionVersion { /** - * The ID of the policy definition. + * The ID of the policy definition version. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The name of the policy definition. + * The name of the policy definition version. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The type of the resource (Microsoft.Authorization/policyDefinitions). + * The type of the resource (Microsoft.Authorization/policyDefinitions/versions). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; @@ -348,40 +195,8 @@ export interface PolicyDefinition { metadata?: any; /** The parameter definitions for parameters used in the policy rule. The keys are the parameter names. */ parameters?: { [propertyName: string]: ParameterDefinitionsValue }; -} - -/** The definition of a parameter that can be provided to the policy. */ -export interface ParameterDefinitionsValue { - /** The data type of the parameter. */ - type?: ParameterType; - /** The allowed values for the parameter. */ - allowedValues?: any[]; - /** The default value for the parameter if no value is provided. */ - defaultValue?: any; - /** General metadata for the parameter. */ - metadata?: ParameterDefinitionsValueMetadata; -} - -/** General metadata for the parameter. */ -export interface ParameterDefinitionsValueMetadata { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** The display name for the parameter. */ - displayName?: string; - /** The description of the parameter. */ - description?: string; - /** Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from. */ - strongType?: string; - /** Set to true to have Azure portal create role assignments on the resource ID or resource scope value of this parameter during policy assignment. This property is useful in case you wish to assign permissions outside the assignment scope. */ - assignPermissions?: boolean; -} - -/** List of policy definitions. */ -export interface PolicyDefinitionListResult { - /** An array of policy definitions. */ - value?: PolicyDefinition[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; + /** The policy definition version in #.#.# format. */ + version?: string; } /** The policy set definition. */ @@ -406,7 +221,7 @@ export interface PolicySetDefinition { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; - /** The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. */ + /** The type of policy set definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. */ policyType?: PolicyType; /** The display name of the policy set definition. */ displayName?: string; @@ -420,12 +235,28 @@ export interface PolicySetDefinition { policyDefinitions?: PolicyDefinitionReference[]; /** The metadata describing groups of policy definition references within the policy set definition. */ policyDefinitionGroups?: PolicyDefinitionGroup[]; + /** The policy set definition version in #.#.# format. */ + version?: string; + /** A list of available versions for this policy set definition. */ + versions?: string[]; } /** The policy definition reference. */ export interface PolicyDefinitionReference { /** The ID of the policy definition or policy set definition. */ policyDefinitionId: string; + /** The version of the policy definition to use. */ + definitionVersion?: string; + /** + * The latest version of the policy definition available. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly latestDefinitionVersion?: string; + /** + * The effective version of the policy definition in use. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly effectiveDefinitionVersion?: string; /** The parameter values for the referenced policy rule. The keys are the parameter names. */ parameters?: { [propertyName: string]: ParameterValuesValue }; /** A unique id (within the policy set definition) for this policy definition reference. */ @@ -434,6 +265,12 @@ export interface PolicyDefinitionReference { groupNames?: string[]; } +/** The value of a parameter. */ +export interface ParameterValuesValue { + /** The value of the parameter. */ + value?: any; +} + /** The policy definition group. */ export interface PolicyDefinitionGroup { /** The name of the group. */ @@ -456,150 +293,214 @@ export interface PolicySetDefinitionListResult { nextLink?: string; } -/** The policy exemption. */ -export interface PolicyExemption { - /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; +/** List of policy set definition versions. */ +export interface PolicySetDefinitionVersionListResult { + /** An array of policy set definition versions. */ + value?: PolicySetDefinitionVersion[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + +/** The policy set definition version. */ +export interface PolicySetDefinitionVersion { /** - * The ID of the policy exemption. + * The ID of the policy set definition version. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The name of the policy exemption. + * The name of the policy set definition version. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The type of the resource (Microsoft.Authorization/policyExemptions). + * The type of the resource (Microsoft.Authorization/policySetDefinitions/versions). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The ID of the policy assignment that is being exempted. */ - policyAssignmentId: string; - /** The policy definition reference ID list when the associated policy assignment is an assignment of a policy set definition. */ - policyDefinitionReferenceIds?: string[]; - /** The policy exemption category. Possible values are Waiver and Mitigated. */ - exemptionCategory: ExemptionCategory; - /** The expiration date and time (in UTC ISO 8601 format yyyy-MM-ddTHH:mm:ssZ) of the policy exemption. */ - expiresOn?: Date; - /** The display name of the policy exemption. */ + /** + * The system metadata relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. */ + policyType?: PolicyType; + /** The display name of the policy set definition. */ displayName?: string; - /** The description of the policy exemption. */ + /** The policy set definition description. */ description?: string; - /** The policy exemption metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + /** The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ metadata?: any; + /** The policy set definition parameters that can be used in policy definition references. */ + parameters?: { [propertyName: string]: ParameterDefinitionsValue }; + /** An array of policy definition references. */ + policyDefinitions?: PolicyDefinitionReference[]; + /** The metadata describing groups of policy definition references within the policy set definition. */ + policyDefinitionGroups?: PolicyDefinitionGroup[]; + /** The policy set definition version in #.#.# format. */ + version?: string; } -/** List of policy exemptions. */ -export interface PolicyExemptionListResult { - /** An array of policy exemptions. */ - value?: PolicyExemption[]; +/** The policy assignment. */ +export interface PolicyAssignment { + /** + * The ID of the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The type of the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The name of the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** The location of the policy assignment. Only required when utilizing managed identity. */ + location?: string; + /** The managed identity associated with the policy assignment. */ + identity?: Identity; + /** + * The system metadata relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The display name of the policy assignment. */ + displayName?: string; + /** The ID of the policy definition or policy set definition being assigned. */ + policyDefinitionId?: string; + /** The version of the policy definition to use. */ + definitionVersion?: string; + /** + * The latest version of the policy definition available. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly latestDefinitionVersion?: string; + /** + * The effective version of the policy definition in use. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly effectiveDefinitionVersion?: string; + /** + * The scope for the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scope?: string; + /** The policy's excluded scopes. */ + notScopes?: string[]; + /** The parameter values for the assigned policy rule. The keys are the parameter names. */ + parameters?: { [propertyName: string]: ParameterValuesValue }; + /** This message will be part of response in case of policy violation. */ + description?: string; + /** The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + metadata?: any; + /** The policy assignment enforcement mode. Possible values are Default, DoNotEnforce, and Enroll */ + enforcementMode?: EnforcementMode; + /** The messages that describe why a resource is non-compliant with the policy. */ + nonComplianceMessages?: NonComplianceMessage[]; + /** The resource selector list to filter policies by resource properties. */ + resourceSelectors?: ResourceSelector[]; + /** The policy property value override. */ + overrides?: Override[]; + /** The type of policy assignment. Possible values are NotSpecified, System, SystemHidden, and Custom. Immutable. */ + assignmentType?: AssignmentType; /** - * The URL to use for getting the next set of results. + * The instance ID of the policy assignment. This ID only and always changes when the assignment is deleted and recreated. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly instanceId?: string; } -/** Known values of {@link AliasPathTokenType} that the service accepts. */ -export enum KnownAliasPathTokenType { - /** The token type is not specified. */ - NotSpecified = "NotSpecified", - /** The token type can be anything. */ - Any = "Any", - /** The token type is string. */ - String = "String", - /** The token type is object. */ - Object = "Object", - /** The token type is array. */ - Array = "Array", - /** The token type is integer. */ - Integer = "Integer", - /** The token type is number. */ - Number = "Number", - /** The token type is boolean. */ - Boolean = "Boolean" +/** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ +export interface NonComplianceMessage { + /** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ + message: string; + /** The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment. */ + policyDefinitionReferenceId?: string; } -/** - * Defines values for AliasPathTokenType. \ - * {@link KnownAliasPathTokenType} can be used interchangeably with AliasPathTokenType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified**: The token type is not specified. \ - * **Any**: The token type can be anything. \ - * **String**: The token type is string. \ - * **Object**: The token type is object. \ - * **Array**: The token type is array. \ - * **Integer**: The token type is integer. \ - * **Number**: The token type is number. \ - * **Boolean**: The token type is boolean. - */ -export type AliasPathTokenType = string; - -/** Known values of {@link AliasPathAttributes} that the service accepts. */ -export enum KnownAliasPathAttributes { - /** The token that the alias path is referring to has no attributes. */ - None = "None", - /** The token that the alias path is referring to is modifiable by policies with 'modify' effect. */ - Modifiable = "Modifiable" +/** The resource selector to filter policies by resource properties. */ +export interface ResourceSelector { + /** The name of the resource selector. */ + name?: string; + /** The list of the selector expressions. */ + selectors?: Selector[]; } -/** - * Defines values for AliasPathAttributes. \ - * {@link KnownAliasPathAttributes} can be used interchangeably with AliasPathAttributes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None**: The token that the alias path is referring to has no attributes. \ - * **Modifiable**: The token that the alias path is referring to is modifiable by policies with 'modify' effect. - */ -export type AliasPathAttributes = string; +/** The selector expression. */ +export interface Selector { + /** The selector kind. */ + kind?: SelectorKind; + /** The list of values to filter in. */ + in?: string[]; + /** The list of values to filter out. */ + notIn?: string[]; +} -/** Known values of {@link EnforcementMode} that the service accepts. */ -export enum KnownEnforcementMode { - /** The policy effect is enforced during resource creation or update. */ - Default = "Default", - /** The policy effect is not enforced during resource creation or update. */ - DoNotEnforce = "DoNotEnforce" +/** The policy property value override. */ +export interface Override { + /** The override kind. */ + kind?: OverrideKind; + /** The value to override the policy property. */ + value?: string; + /** The list of the selector expressions. */ + selectors?: Selector[]; } -/** - * Defines values for EnforcementMode. \ - * {@link KnownEnforcementMode} can be used interchangeably with EnforcementMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Default**: The policy effect is enforced during resource creation or update. \ - * **DoNotEnforce**: The policy effect is not enforced during resource creation or update. - */ -export type EnforcementMode = string; +/** Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity. */ +export interface Identity { + /** + * The principal ID of the resource identity. This property will only be provided for a system assigned identity + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the resource identity. This property will only be provided for a system assigned identity + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. This is the only required field when adding a system or user assigned identity to a resource. */ + type?: ResourceIdentityType; + /** The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentitiesValue; + }; +} -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key" +export interface UserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; } -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; +/** The policy assignment for Patch request. */ +export interface PolicyAssignmentUpdate { + /** The location of the policy assignment. Only required when utilizing managed identity. */ + location?: string; + /** The managed identity associated with the policy assignment. */ + identity?: Identity; + /** The resource selector list to filter policies by resource properties. */ + resourceSelectors?: ResourceSelector[]; + /** The policy property value override. */ + overrides?: Override[]; +} + +/** List of policy assignments. */ +export interface PolicyAssignmentListResult { + /** An array of policy assignments. */ + value?: PolicyAssignment[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} /** Known values of {@link PolicyType} that the service accepts. */ export enum KnownPolicyType { @@ -610,7 +511,7 @@ export enum KnownPolicyType { /** Custom */ Custom = "Custom", /** Static */ - Static = "Static" + Static = "Static", } /** @@ -640,7 +541,7 @@ export enum KnownParameterType { /** Float */ Float = "Float", /** DateTime */ - DateTime = "DateTime" + DateTime = "DateTime", } /** @@ -658,285 +559,350 @@ export enum KnownParameterType { */ export type ParameterType = string; -/** Known values of {@link ExemptionCategory} that the service accepts. */ -export enum KnownExemptionCategory { - /** This category of exemptions usually means the scope is not applicable for the policy. */ - Waiver = "Waiver", - /** This category of exemptions usually means the mitigation actions have been applied to the scope. */ - Mitigated = "Mitigated" +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", } /** - * Defines values for ExemptionCategory. \ - * {@link KnownExemptionCategory} can be used interchangeably with ExemptionCategory, + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Waiver**: This category of exemptions usually means the scope is not applicable for the policy. \ - * **Mitigated**: This category of exemptions usually means the mitigation actions have been applied to the scope. + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** */ -export type ExemptionCategory = string; -/** Defines values for AliasPatternType. */ -export type AliasPatternType = "NotSpecified" | "Extract"; -/** Defines values for AliasType. */ -export type AliasType = "NotSpecified" | "PlainText" | "Mask"; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; +export type CreatedByType = string; -/** Optional parameters. */ -export interface DataPolicyManifestsGetByPolicyModeOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link EnforcementMode} that the service accepts. */ +export enum KnownEnforcementMode { + /** The policy effect is enforced during resource creation or update. */ + Default = "Default", + /** The policy effect is not enforced during resource creation or update. */ + DoNotEnforce = "DoNotEnforce", + /** The policy effect is not enforced during resource creation or update until the resource or scope of the resource is enrolled to the assignment instance. Enrollment occurs upon deployment of the policy enrollment resource. */ + Enroll = "Enroll", +} + +/** + * Defines values for EnforcementMode. \ + * {@link KnownEnforcementMode} can be used interchangeably with EnforcementMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default**: The policy effect is enforced during resource creation or update. \ + * **DoNotEnforce**: The policy effect is not enforced during resource creation or update. \ + * **Enroll**: The policy effect is not enforced during resource creation or update until the resource or scope of the resource is enrolled to the assignment instance. Enrollment occurs upon deployment of the policy enrollment resource. + */ +export type EnforcementMode = string; -/** Contains response data for the getByPolicyMode operation. */ -export type DataPolicyManifestsGetByPolicyModeResponse = DataPolicyManifest; +/** Known values of {@link SelectorKind} that the service accepts. */ +export enum KnownSelectorKind { + /** The selector kind to filter policies by the resource location. */ + ResourceLocation = "resourceLocation", + /** The selector kind to filter policies by the resource type. */ + ResourceType = "resourceType", + /** The selector kind to filter policies by the resource without location. */ + ResourceWithoutLocation = "resourceWithoutLocation", + /** The selector kind to filter policies by the policy definition reference ID. */ + PolicyDefinitionReferenceId = "policyDefinitionReferenceId", +} -/** Optional parameters. */ -export interface DataPolicyManifestsListOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value. */ - filter?: string; +/** + * Defines values for SelectorKind. \ + * {@link KnownSelectorKind} can be used interchangeably with SelectorKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **resourceLocation**: The selector kind to filter policies by the resource location. \ + * **resourceType**: The selector kind to filter policies by the resource type. \ + * **resourceWithoutLocation**: The selector kind to filter policies by the resource without location. \ + * **policyDefinitionReferenceId**: The selector kind to filter policies by the policy definition reference ID. + */ +export type SelectorKind = string; + +/** Known values of {@link OverrideKind} that the service accepts. */ +export enum KnownOverrideKind { + /** It will override the policy effect type. */ + PolicyEffect = "policyEffect", + /** It will override the definition version property value of the policy assignment. */ + DefinitionVersion = "definitionVersion", } -/** Contains response data for the list operation. */ -export type DataPolicyManifestsListResponse = DataPolicyManifestListResult; +/** + * Defines values for OverrideKind. \ + * {@link KnownOverrideKind} can be used interchangeably with OverrideKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **policyEffect**: It will override the policy effect type. \ + * **definitionVersion**: It will override the definition version property value of the policy assignment. + */ +export type OverrideKind = string; + +/** Known values of {@link AssignmentType} that the service accepts. */ +export enum KnownAssignmentType { + /** NotSpecified */ + NotSpecified = "NotSpecified", + /** System */ + System = "System", + /** SystemHidden */ + SystemHidden = "SystemHidden", + /** Custom */ + Custom = "Custom", +} + +/** + * Defines values for AssignmentType. \ + * {@link KnownAssignmentType} can be used interchangeably with AssignmentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **System** \ + * **SystemHidden** \ + * **Custom** + */ +export type AssignmentType = string; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; /** Optional parameters. */ -export interface DataPolicyManifestsListNextOptionalParams +export interface PolicyDefinitionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type DataPolicyManifestsListNextResponse = DataPolicyManifestListResult; +/** Contains response data for the createOrUpdate operation. */ +export type PolicyDefinitionsCreateOrUpdateResponse = PolicyDefinition; /** Optional parameters. */ -export interface PolicyAssignmentsDeleteOptionalParams +export interface PolicyDefinitionsDeleteOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the delete operation. */ -export type PolicyAssignmentsDeleteResponse = PolicyAssignment; - /** Optional parameters. */ -export interface PolicyAssignmentsCreateOptionalParams +export interface PolicyDefinitionsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the create operation. */ -export type PolicyAssignmentsCreateResponse = PolicyAssignment; +/** Contains response data for the get operation. */ +export type PolicyDefinitionsGetResponse = PolicyDefinition; /** Optional parameters. */ -export interface PolicyAssignmentsGetOptionalParams +export interface PolicyDefinitionsGetBuiltInOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type PolicyAssignmentsGetResponse = PolicyAssignment; +/** Contains response data for the getBuiltIn operation. */ +export type PolicyDefinitionsGetBuiltInResponse = PolicyDefinition; /** Optional parameters. */ -export interface PolicyAssignmentsUpdateOptionalParams +export interface PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the update operation. */ -export type PolicyAssignmentsUpdateResponse = PolicyAssignment; +/** Contains response data for the createOrUpdateAtManagementGroup operation. */ +export type PolicyDefinitionsCreateOrUpdateAtManagementGroupResponse = + PolicyDefinition; /** Optional parameters. */ -export interface PolicyAssignmentsListForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} +export interface PolicyDefinitionsDeleteAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForResourceGroup operation. */ -export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentListResult; +/** Optional parameters. */ +export interface PolicyDefinitionsGetAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAtManagementGroup operation. */ +export type PolicyDefinitionsGetAtManagementGroupResponse = PolicyDefinition; /** Optional parameters. */ -export interface PolicyAssignmentsListForResourceOptionalParams +export interface PolicyDefinitionsListOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } -/** Contains response data for the listForResource operation. */ -export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResult; +/** Contains response data for the list operation. */ +export type PolicyDefinitionsListResponse = PolicyDefinitionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsListForManagementGroupOptionalParams +export interface PolicyDefinitionsListBuiltInOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } -/** Contains response data for the listForManagementGroup operation. */ -export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentListResult; +/** Contains response data for the listBuiltIn operation. */ +export type PolicyDefinitionsListBuiltInResponse = PolicyDefinitionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsListOptionalParams +export interface PolicyDefinitionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } -/** Contains response data for the list operation. */ -export type PolicyAssignmentsListResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsDeleteByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the deleteById operation. */ -export type PolicyAssignmentsDeleteByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsCreateByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createById operation. */ -export type PolicyAssignmentsCreateByIdResponse = PolicyAssignment; +/** Contains response data for the listByManagementGroup operation. */ +export type PolicyDefinitionsListByManagementGroupResponse = + PolicyDefinitionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsGetByIdOptionalParams +export interface PolicyDefinitionsListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getById operation. */ -export type PolicyAssignmentsGetByIdResponse = PolicyAssignment; +/** Contains response data for the listNext operation. */ +export type PolicyDefinitionsListNextResponse = PolicyDefinitionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsUpdateByIdOptionalParams +export interface PolicyDefinitionsListBuiltInNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the updateById operation. */ -export type PolicyAssignmentsUpdateByIdResponse = PolicyAssignment; +/** Contains response data for the listBuiltInNext operation. */ +export type PolicyDefinitionsListBuiltInNextResponse = + PolicyDefinitionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsListForResourceGroupNextOptionalParams +export interface PolicyDefinitionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForResourceGroupNext operation. */ -export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignmentListResult; +/** Contains response data for the listByManagementGroupNext operation. */ +export type PolicyDefinitionsListByManagementGroupNextResponse = + PolicyDefinitionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsListForResourceNextOptionalParams +export interface PolicyDefinitionVersionsListAllBuiltinsOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForResourceNext operation. */ -export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListResult; +/** Contains response data for the listAllBuiltins operation. */ +export type PolicyDefinitionVersionsListAllBuiltinsResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsListForManagementGroupNextOptionalParams +export interface PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForManagementGroupNext operation. */ -export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignmentListResult; +/** Contains response data for the listAllAtManagementGroup operation. */ +export type PolicyDefinitionVersionsListAllAtManagementGroupResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsListNextOptionalParams +export interface PolicyDefinitionVersionsListAllOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult; +/** Contains response data for the listAll operation. */ +export type PolicyDefinitionVersionsListAllResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyDefinitionsCreateOrUpdateOptionalParams +export interface PolicyDefinitionVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdate operation. */ -export type PolicyDefinitionsCreateOrUpdateResponse = PolicyDefinition; +export type PolicyDefinitionVersionsCreateOrUpdateResponse = + PolicyDefinitionVersion; /** Optional parameters. */ -export interface PolicyDefinitionsDeleteOptionalParams +export interface PolicyDefinitionVersionsDeleteOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface PolicyDefinitionsGetOptionalParams +export interface PolicyDefinitionVersionsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type PolicyDefinitionsGetResponse = PolicyDefinition; +export type PolicyDefinitionVersionsGetResponse = PolicyDefinitionVersion; /** Optional parameters. */ -export interface PolicyDefinitionsGetBuiltInOptionalParams +export interface PolicyDefinitionVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getBuiltIn operation. */ -export type PolicyDefinitionsGetBuiltInResponse = PolicyDefinition; +export type PolicyDefinitionVersionsGetBuiltInResponse = + PolicyDefinitionVersion; /** Optional parameters. */ -export interface PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams +export interface PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtManagementGroup operation. */ -export type PolicyDefinitionsCreateOrUpdateAtManagementGroupResponse = PolicyDefinition; +export type PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse = + PolicyDefinitionVersion; /** Optional parameters. */ -export interface PolicyDefinitionsDeleteAtManagementGroupOptionalParams +export interface PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface PolicyDefinitionsGetAtManagementGroupOptionalParams +export interface PolicyDefinitionVersionsGetAtManagementGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAtManagementGroup operation. */ -export type PolicyDefinitionsGetAtManagementGroupResponse = PolicyDefinition; +export type PolicyDefinitionVersionsGetAtManagementGroupResponse = + PolicyDefinitionVersion; /** Optional parameters. */ -export interface PolicyDefinitionsListOptionalParams +export interface PolicyDefinitionVersionsListOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ - filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } /** Contains response data for the list operation. */ -export type PolicyDefinitionsListResponse = PolicyDefinitionListResult; +export type PolicyDefinitionVersionsListResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyDefinitionsListBuiltInOptionalParams +export interface PolicyDefinitionVersionsListBuiltInOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ - filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } /** Contains response data for the listBuiltIn operation. */ -export type PolicyDefinitionsListBuiltInResponse = PolicyDefinitionListResult; +export type PolicyDefinitionVersionsListBuiltInResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyDefinitionsListByManagementGroupOptionalParams +export interface PolicyDefinitionVersionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ - filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } /** Contains response data for the listByManagementGroup operation. */ -export type PolicyDefinitionsListByManagementGroupResponse = PolicyDefinitionListResult; +export type PolicyDefinitionVersionsListByManagementGroupResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyDefinitionsListNextOptionalParams +export interface PolicyDefinitionVersionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type PolicyDefinitionsListNextResponse = PolicyDefinitionListResult; +export type PolicyDefinitionVersionsListNextResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyDefinitionsListBuiltInNextOptionalParams +export interface PolicyDefinitionVersionsListBuiltInNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBuiltInNext operation. */ -export type PolicyDefinitionsListBuiltInNextResponse = PolicyDefinitionListResult; +export type PolicyDefinitionVersionsListBuiltInNextResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyDefinitionsListByManagementGroupNextOptionalParams +export interface PolicyDefinitionVersionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByManagementGroupNext operation. */ -export type PolicyDefinitionsListByManagementGroupNextResponse = PolicyDefinitionListResult; +export type PolicyDefinitionVersionsListByManagementGroupNextResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsCreateOrUpdateOptionalParams @@ -951,14 +917,20 @@ export interface PolicySetDefinitionsDeleteOptionalParams /** Optional parameters. */ export interface PolicySetDefinitionsGetOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} /** Contains response data for the get operation. */ export type PolicySetDefinitionsGetResponse = PolicySetDefinition; /** Optional parameters. */ export interface PolicySetDefinitionsGetBuiltInOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} /** Contains response data for the getBuiltIn operation. */ export type PolicySetDefinitionsGetBuiltInResponse = PolicySetDefinition; @@ -970,6 +942,8 @@ export interface PolicySetDefinitionsListOptionalParams filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; } /** Contains response data for the list operation. */ @@ -982,17 +956,21 @@ export interface PolicySetDefinitionsListBuiltInOptionalParams filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; } /** Contains response data for the listBuiltIn operation. */ -export type PolicySetDefinitionsListBuiltInResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListBuiltInResponse = + PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtManagementGroup operation. */ -export type PolicySetDefinitionsCreateOrUpdateAtManagementGroupResponse = PolicySetDefinition; +export type PolicySetDefinitionsCreateOrUpdateAtManagementGroupResponse = + PolicySetDefinition; /** Optional parameters. */ export interface PolicySetDefinitionsDeleteAtManagementGroupOptionalParams @@ -1000,10 +978,14 @@ export interface PolicySetDefinitionsDeleteAtManagementGroupOptionalParams /** Optional parameters. */ export interface PolicySetDefinitionsGetAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} /** Contains response data for the getAtManagementGroup operation. */ -export type PolicySetDefinitionsGetAtManagementGroupResponse = PolicySetDefinition; +export type PolicySetDefinitionsGetAtManagementGroupResponse = + PolicySetDefinition; /** Optional parameters. */ export interface PolicySetDefinitionsListByManagementGroupOptionalParams @@ -1012,123 +994,337 @@ export interface PolicySetDefinitionsListByManagementGroupOptionalParams filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; } /** Contains response data for the listByManagementGroup operation. */ -export type PolicySetDefinitionsListByManagementGroupResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListByManagementGroupResponse = + PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type PolicySetDefinitionsListNextResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListNextResponse = + PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsListBuiltInNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBuiltInNext operation. */ -export type PolicySetDefinitionsListBuiltInNextResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListBuiltInNextResponse = + PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByManagementGroupNext operation. */ -export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListByManagementGroupNextResponse = + PolicySetDefinitionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListAllBuiltinsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllBuiltins operation. */ +export type PolicySetDefinitionVersionsListAllBuiltinsResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllAtManagementGroup operation. */ +export type PolicySetDefinitionVersionsListAllAtManagementGroupResponse = + PolicySetDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyExemptionsDeleteOptionalParams +export interface PolicySetDefinitionVersionsListAllOptionalParams extends coreClient.OperationOptions {} +/** Contains response data for the listAll operation. */ +export type PolicySetDefinitionVersionsListAllResponse = + PolicySetDefinitionVersionListResult; + /** Optional parameters. */ -export interface PolicyExemptionsCreateOrUpdateOptionalParams +export interface PolicySetDefinitionVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdate operation. */ -export type PolicyExemptionsCreateOrUpdateResponse = PolicyExemption; +export type PolicySetDefinitionVersionsCreateOrUpdateResponse = + PolicySetDefinitionVersion; /** Optional parameters. */ -export interface PolicyExemptionsGetOptionalParams +export interface PolicySetDefinitionVersionsDeleteOptionalParams extends coreClient.OperationOptions {} +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsGetOptionalParams + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + /** Contains response data for the get operation. */ -export type PolicyExemptionsGetResponse = PolicyExemption; +export type PolicySetDefinitionVersionsGetResponse = PolicySetDefinitionVersion; /** Optional parameters. */ -export interface PolicyExemptionsListOptionalParams +export interface PolicySetDefinitionVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + +/** Contains response data for the getBuiltIn operation. */ +export type PolicySetDefinitionVersionsGetBuiltInResponse = + PolicySetDefinitionVersion; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListOptionalParams + extends coreClient.OperationOptions { + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; } /** Contains response data for the list operation. */ -export type PolicyExemptionsListResponse = PolicyExemptionListResult; +export type PolicySetDefinitionVersionsListResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListBuiltInOptionalParams + extends coreClient.OperationOptions { + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + +/** Contains response data for the listBuiltIn operation. */ +export type PolicySetDefinitionVersionsListBuiltInResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdateAtManagementGroup operation. */ +export type PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse = + PolicySetDefinitionVersion; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + +/** Contains response data for the getAtManagementGroup operation. */ +export type PolicySetDefinitionVersionsGetAtManagementGroupResponse = + PolicySetDefinitionVersion; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListByManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + +/** Contains response data for the listByManagementGroup operation. */ +export type PolicySetDefinitionVersionsListByManagementGroupResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PolicySetDefinitionVersionsListNextResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListBuiltInNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltInNext operation. */ +export type PolicySetDefinitionVersionsListBuiltInNextResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByManagementGroupNext operation. */ +export type PolicySetDefinitionVersionsListByManagementGroupNextResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the delete operation. */ +export type PolicyAssignmentsDeleteResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type PolicyAssignmentsCreateResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsGetOptionalParams + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + +/** Contains response data for the get operation. */ +export type PolicyAssignmentsGetResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type PolicyAssignmentsUpdateResponse = PolicyAssignment; /** Optional parameters. */ -export interface PolicyExemptionsListForResourceGroupOptionalParams +export interface PolicyAssignmentsListForResourceGroupOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; } /** Contains response data for the listForResourceGroup operation. */ -export type PolicyExemptionsListForResourceGroupResponse = PolicyExemptionListResult; +export type PolicyAssignmentsListForResourceGroupResponse = + PolicyAssignmentListResult; /** Optional parameters. */ -export interface PolicyExemptionsListForResourceOptionalParams +export interface PolicyAssignmentsListForResourceOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; } /** Contains response data for the listForResource operation. */ -export type PolicyExemptionsListForResourceResponse = PolicyExemptionListResult; +export type PolicyAssignmentsListForResourceResponse = + PolicyAssignmentListResult; /** Optional parameters. */ -export interface PolicyExemptionsListForManagementGroupOptionalParams +export interface PolicyAssignmentsListForManagementGroupOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; } /** Contains response data for the listForManagementGroup operation. */ -export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionListResult; +export type PolicyAssignmentsListForManagementGroupResponse = + PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + +/** Contains response data for the list operation. */ +export type PolicyAssignmentsListResponse = PolicyAssignmentListResult; /** Optional parameters. */ -export interface PolicyExemptionsListNextOptionalParams +export interface PolicyAssignmentsDeleteByIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type PolicyExemptionsListNextResponse = PolicyExemptionListResult; +/** Contains response data for the deleteById operation. */ +export type PolicyAssignmentsDeleteByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsCreateByIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createById operation. */ +export type PolicyAssignmentsCreateByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsGetByIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getById operation. */ +export type PolicyAssignmentsGetByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsUpdateByIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the updateById operation. */ +export type PolicyAssignmentsUpdateByIdResponse = PolicyAssignment; /** Optional parameters. */ -export interface PolicyExemptionsListForResourceGroupNextOptionalParams +export interface PolicyAssignmentsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listForResourceGroupNext operation. */ -export type PolicyExemptionsListForResourceGroupNextResponse = PolicyExemptionListResult; +export type PolicyAssignmentsListForResourceGroupNextResponse = + PolicyAssignmentListResult; /** Optional parameters. */ -export interface PolicyExemptionsListForResourceNextOptionalParams +export interface PolicyAssignmentsListForResourceNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listForResourceNext operation. */ -export type PolicyExemptionsListForResourceNextResponse = PolicyExemptionListResult; +export type PolicyAssignmentsListForResourceNextResponse = + PolicyAssignmentListResult; /** Optional parameters. */ -export interface PolicyExemptionsListForManagementGroupNextOptionalParams +export interface PolicyAssignmentsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listForManagementGroupNext operation. */ -export type PolicyExemptionsListForManagementGroupNextResponse = PolicyExemptionListResult; +export type PolicyAssignmentsListForManagementGroupNextResponse = + PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult; /** Optional parameters. */ export interface PolicyClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; + /** Api Version */ + apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/policy/arm-policy/src/models/mappers.ts b/sdk/policy/arm-policy/src/models/mappers.ts index 118f4863c37e..a9e2d87b4419 100644 --- a/sdk/policy/arm-policy/src/models/mappers.ts +++ b/sdk/policy/arm-policy/src/models/mappers.ts @@ -8,346 +8,228 @@ import * as coreClient from "@azure/core-client"; -export const DataPolicyManifest: coreClient.CompositeMapper = { +export const PolicyDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataPolicyManifest", + className: "PolicyDefinition", modelProperties: { id: { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - namespaces: { - serializedName: "properties.namespaces", + systemData: { + serializedName: "systemData", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "Composite", + className: "SystemData", + }, }, - policyMode: { - serializedName: "properties.policyMode", + policyType: { + serializedName: "properties.policyType", type: { - name: "String" - } + name: "String", + }, }, - isBuiltInOnly: { - serializedName: "properties.isBuiltInOnly", + mode: { + defaultValue: "Indexed", + serializedName: "properties.mode", type: { - name: "Boolean" - } + name: "String", + }, }, - resourceTypeAliases: { - serializedName: "properties.resourceTypeAliases", + displayName: { + serializedName: "properties.displayName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceTypeAliases" - } - } - } + name: "String", + }, }, - effects: { - serializedName: "properties.effects", + description: { + serializedName: "properties.description", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataEffect" - } - } - } + name: "String", + }, }, - fieldValues: { - serializedName: "properties.fieldValues", + policyRule: { + serializedName: "properties.policyRule", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "any", + }, }, - standard: { - serializedName: "properties.resourceFunctions.standard", + metadata: { + serializedName: "properties.metadata", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "any", + }, }, - custom: { - serializedName: "properties.resourceFunctions.custom", + parameters: { + serializedName: "properties.parameters", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataManifestCustomResourceFunctionDefinition" - } - } - } - } - } - } -}; - -export const ResourceTypeAliases: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceTypeAliases", - modelProperties: { - resourceType: { - serializedName: "resourceType", + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterDefinitionsValue" }, + }, + }, + }, + version: { + serializedName: "properties.version", type: { - name: "String" - } + name: "String", + }, }, - aliases: { - serializedName: "aliases", + versions: { + serializedName: "properties.versions", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Alias" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; -export const Alias: coreClient.CompositeMapper = { +export const ParameterDefinitionsValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Alias", + className: "ParameterDefinitionsValue", modelProperties: { - name: { - serializedName: "name", + type: { + serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, - paths: { - serializedName: "paths", + allowedValues: { + serializedName: "allowedValues", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "AliasPath" - } - } - } + name: "any", + }, + }, + }, }, - type: { - serializedName: "type", + defaultValue: { + serializedName: "defaultValue", type: { - name: "Enum", - allowedValues: ["NotSpecified", "PlainText", "Mask"] - } + name: "any", + }, }, - defaultPath: { - serializedName: "defaultPath", + schema: { + serializedName: "schema", type: { - name: "String" - } + name: "any", + }, }, - defaultPattern: { - serializedName: "defaultPattern", + metadata: { + serializedName: "metadata", type: { name: "Composite", - className: "AliasPattern" - } + className: "ParameterDefinitionsValueMetadata", + }, }, - defaultMetadata: { - serializedName: "defaultMetadata", - type: { - name: "Composite", - className: "AliasPathMetadata" - } - } - } - } + }, + }, }; -export const AliasPath: coreClient.CompositeMapper = { +export const ParameterDefinitionsValueMetadata: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AliasPath", + className: "ParameterDefinitionsValueMetadata", + additionalProperties: { type: { name: "Object" } }, modelProperties: { - path: { - serializedName: "path", + displayName: { + serializedName: "displayName", type: { - name: "String" - } + name: "String", + }, }, - apiVersions: { - serializedName: "apiVersions", + description: { + serializedName: "description", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "String", + }, }, - pattern: { - serializedName: "pattern", + strongType: { + serializedName: "strongType", type: { - name: "Composite", - className: "AliasPattern" - } + name: "String", + }, }, - metadata: { - serializedName: "metadata", + assignPermissions: { + serializedName: "assignPermissions", type: { - name: "Composite", - className: "AliasPathMetadata" - } - } - } - } + name: "Boolean", + }, + }, + }, + }, }; -export const AliasPattern: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AliasPattern", + className: "SystemData", modelProperties: { - phrase: { - serializedName: "phrase", + createdBy: { + serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, - variable: { - serializedName: "variable", + createdByType: { + serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["NotSpecified", "Extract"] - } - } - } - } -}; - -export const AliasPathMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AliasPathMetadata", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, + createdAt: { + serializedName: "createdAt", type: { - name: "String" - } + name: "DateTime", + }, }, - attributes: { - serializedName: "attributes", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const DataEffect: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataEffect", - modelProperties: { - name: { - serializedName: "name", + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, - detailsSchema: { - serializedName: "detailsSchema", - type: { - name: "any" - } - } - } - } -}; - -export const DataManifestCustomResourceFunctionDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataManifestCustomResourceFunctionDefinition", - modelProperties: { - name: { - serializedName: "name", + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, - fullyQualifiedResourceType: { - serializedName: "fullyQualifiedResourceType", + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { - name: "String" - } + name: "DateTime", + }, }, - defaultProperties: { - serializedName: "defaultProperties", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - allowCustomProperties: { - serializedName: "allowCustomProperties", - type: { - name: "Boolean" - } - } - } - } + }, + }, }; export const CloudError: coreClient.CompositeMapper = { @@ -359,11 +241,11 @@ export const CloudError: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -375,22 +257,22 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -400,10 +282,10 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" - } - } - } + className: "ErrorResponse", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -413,13 +295,13 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -431,24 +313,24 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { - name: "any" - } - } - } - } + name: "any", + }, + }, + }, + }, }; -export const DataPolicyManifestListResult: coreClient.CompositeMapper = { +export const PolicyDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataPolicyManifestListResult", + className: "PolicyDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -457,314 +339,369 @@ export const DataPolicyManifestListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "DataPolicyManifest" - } - } - } + className: "PolicyDefinition", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PolicyAssignment: coreClient.CompositeMapper = { +export const PolicyDefinitionVersionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignment", + className: "PolicyDefinitionVersionListResult", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinitionVersion", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", + }, + }, +}; + +export const PolicyDefinitionVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyDefinitionVersion", + modelProperties: { + id: { + serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } + name: "String", + }, }, - identity: { - serializedName: "identity", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Composite", - className: "Identity" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } - }, - displayName: { - serializedName: "properties.displayName", - type: { - name: "String" - } - }, - policyDefinitionId: { - serializedName: "properties.policyDefinitionId", - type: { - name: "String" - } + className: "SystemData", + }, }, - scope: { - serializedName: "properties.scope", - readOnly: true, + policyType: { + serializedName: "properties.policyType", type: { - name: "String" - } + name: "String", + }, }, - notScopes: { - serializedName: "properties.notScopes", + mode: { + defaultValue: "Indexed", + serializedName: "properties.mode", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "String", + }, }, - parameters: { - serializedName: "properties.parameters", + displayName: { + serializedName: "properties.displayName", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ParameterValuesValue" } - } - } + name: "String", + }, }, description: { serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, + }, + policyRule: { + serializedName: "properties.policyRule", + type: { + name: "any", + }, }, metadata: { serializedName: "properties.metadata", type: { - name: "any" - } + name: "any", + }, }, - enforcementMode: { - defaultValue: "Default", - serializedName: "properties.enforcementMode", + parameters: { + serializedName: "properties.parameters", type: { - name: "String" - } + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterDefinitionsValue" }, + }, + }, }, - nonComplianceMessages: { - serializedName: "properties.nonComplianceMessages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NonComplianceMessage" - } - } - } - } - } - } -}; - -export const ParameterValuesValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParameterValuesValue", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "any" - } - } - } - } -}; - -export const NonComplianceMessage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NonComplianceMessage", - modelProperties: { - message: { - serializedName: "message", - required: true, + version: { + serializedName: "properties.version", type: { - name: "String" - } + name: "String", + }, }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const Identity: coreClient.CompositeMapper = { +export const PolicySetDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Identity", + className: "PolicySetDefinition", modelProperties: { - principalId: { - serializedName: "principalId", + id: { + serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - tenantId: { - serializedName: "tenantId", + name: { + serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", + readOnly: true, type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "None"] - } + name: "String", + }, }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + policyType: { + serializedName: "properties.policyType", + type: { + name: "String", + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + description: { + serializedName: "properties.description", + type: { + name: "String", + }, + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "any", + }, + }, + parameters: { + serializedName: "properties.parameters", type: { name: "Dictionary", value: { + type: { name: "Composite", className: "ParameterDefinitionsValue" }, + }, + }, + }, + policyDefinitions: { + serializedName: "properties.policyDefinitions", + type: { + name: "Sequence", + element: { type: { name: "Composite", - className: "UserAssignedIdentitiesValue" - } - } - } - } - } - } -}; - -export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + className: "PolicyDefinitionReference", + }, + }, + }, + }, + policyDefinitionGroups: { + serializedName: "properties.policyDefinitionGroups", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinitionGroup", + }, + }, + }, }, - clientId: { - serializedName: "clientId", - readOnly: true, + version: { + serializedName: "properties.version", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + versions: { + serializedName: "properties.versions", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, }; -export const SystemData: coreClient.CompositeMapper = { +export const PolicyDefinitionReference: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "PolicyDefinitionReference", modelProperties: { - createdBy: { - serializedName: "createdBy", + policyDefinitionId: { + serializedName: "policyDefinitionId", + required: true, type: { - name: "String" - } + name: "String", + }, }, - createdByType: { - serializedName: "createdByType", + definitionVersion: { + serializedName: "definitionVersion", type: { - name: "String" - } + name: "String", + }, }, - createdAt: { - serializedName: "createdAt", + latestDefinitionVersion: { + serializedName: "latestDefinitionVersion", + readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + effectiveDefinitionVersion: { + serializedName: "effectiveDefinitionVersion", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + parameters: { + serializedName: "parameters", type: { - name: "String" - } + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterValuesValue" }, + }, + }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", type: { - name: "DateTime" - } - } - } - } + name: "String", + }, + }, + groupNames: { + serializedName: "groupNames", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, }; -export const PolicyAssignmentUpdate: coreClient.CompositeMapper = { +export const ParameterValuesValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignmentUpdate", + className: "ParameterValuesValue", modelProperties: { - location: { - serializedName: "location", + value: { + serializedName: "value", type: { - name: "String" - } + name: "any", + }, }, - identity: { - serializedName: "identity", + }, + }, +}; + +export const PolicyDefinitionGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyDefinitionGroup", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { - name: "Composite", - className: "Identity" - } - } - } - } + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + category: { + serializedName: "category", + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + type: { + name: "String", + }, + }, + additionalMetadataId: { + serializedName: "additionalMetadataId", + type: { + name: "String", + }, + }, + }, + }, }; -export const PolicyAssignmentListResult: coreClient.CompositeMapper = { +export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignmentListResult", + className: "PolicySetDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -773,497 +710,560 @@ export const PolicyAssignmentListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyAssignment" - } - } - } + className: "PolicySetDefinition", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PolicyDefinition: coreClient.CompositeMapper = { +export const PolicySetDefinitionVersionListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PolicySetDefinitionVersionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicySetDefinitionVersion", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const PolicySetDefinitionVersion: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinition", + className: "PolicySetDefinitionVersion", modelProperties: { id: { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, policyType: { serializedName: "properties.policyType", type: { - name: "String" - } - }, - mode: { - defaultValue: "Indexed", - serializedName: "properties.mode", - type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "properties.description", type: { - name: "String" - } - }, - policyRule: { - serializedName: "properties.policyRule", - type: { - name: "any" - } + name: "String", + }, }, metadata: { serializedName: "properties.metadata", type: { - name: "any" - } + name: "any", + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", value: { - type: { name: "Composite", className: "ParameterDefinitionsValue" } - } - } - } - } - } -}; - -export const ParameterDefinitionsValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParameterDefinitionsValue", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String" - } + type: { name: "Composite", className: "ParameterDefinitionsValue" }, + }, + }, }, - allowedValues: { - serializedName: "allowedValues", + policyDefinitions: { + serializedName: "properties.policyDefinitions", type: { name: "Sequence", element: { type: { - name: "any" - } - } - } - }, - defaultValue: { - serializedName: "defaultValue", - type: { - name: "any" - } - }, - metadata: { - serializedName: "metadata", - type: { - name: "Composite", - className: "ParameterDefinitionsValueMetadata" - } - } - } - } -}; - -export const ParameterDefinitionsValueMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParameterDefinitionsValueMetadata", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - displayName: { - serializedName: "displayName", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - strongType: { - serializedName: "strongType", - type: { - name: "String" - } + name: "Composite", + className: "PolicyDefinitionReference", + }, + }, + }, }, - assignPermissions: { - serializedName: "assignPermissions", - type: { - name: "Boolean" - } - } - } - } -}; - -export const PolicyDefinitionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyDefinitionListResult", - modelProperties: { - value: { - serializedName: "value", + policyDefinitionGroups: { + serializedName: "properties.policyDefinitionGroups", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PolicyDefinition" - } - } - } + className: "PolicyDefinitionGroup", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", + version: { + serializedName: "properties.version", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PolicySetDefinition: coreClient.CompositeMapper = { +export const PolicyAssignment: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicySetDefinition", + className: "PolicyAssignment", modelProperties: { id: { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", - readOnly: true, + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - systemData: { - serializedName: "systemData", + identity: { + serializedName: "identity", type: { name: "Composite", - className: "SystemData" - } + className: "Identity", + }, }, - policyType: { - serializedName: "properties.policyType", + systemData: { + serializedName: "systemData", type: { - name: "String" - } + name: "Composite", + className: "SystemData", + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, - description: { - serializedName: "properties.description", + policyDefinitionId: { + serializedName: "properties.policyDefinitionId", type: { - name: "String" - } + name: "String", + }, }, - metadata: { - serializedName: "properties.metadata", + definitionVersion: { + serializedName: "properties.definitionVersion", + type: { + name: "String", + }, + }, + latestDefinitionVersion: { + serializedName: "properties.latestDefinitionVersion", + readOnly: true, + type: { + name: "String", + }, + }, + effectiveDefinitionVersion: { + serializedName: "properties.effectiveDefinitionVersion", + readOnly: true, + type: { + name: "String", + }, + }, + scope: { + serializedName: "properties.scope", + readOnly: true, type: { - name: "any" - } + name: "String", + }, + }, + notScopes: { + serializedName: "properties.notScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", value: { - type: { name: "Composite", className: "ParameterDefinitionsValue" } - } - } + type: { name: "Composite", className: "ParameterValuesValue" }, + }, + }, }, - policyDefinitions: { - serializedName: "properties.policyDefinitions", + description: { + serializedName: "properties.description", + type: { + name: "String", + }, + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "any", + }, + }, + enforcementMode: { + defaultValue: "Default", + serializedName: "properties.enforcementMode", + type: { + name: "String", + }, + }, + nonComplianceMessages: { + serializedName: "properties.nonComplianceMessages", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PolicyDefinitionReference" - } - } - } + className: "NonComplianceMessage", + }, + }, + }, }, - policyDefinitionGroups: { - serializedName: "properties.policyDefinitionGroups", + resourceSelectors: { + serializedName: "properties.resourceSelectors", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PolicyDefinitionGroup" - } - } - } - } - } - } + className: "ResourceSelector", + }, + }, + }, + }, + overrides: { + serializedName: "properties.overrides", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Override", + }, + }, + }, + }, + assignmentType: { + serializedName: "properties.assignmentType", + type: { + name: "String", + }, + }, + instanceId: { + serializedName: "properties.instanceId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; -export const PolicyDefinitionReference: coreClient.CompositeMapper = { +export const NonComplianceMessage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionReference", + className: "NonComplianceMessage", modelProperties: { - policyDefinitionId: { - serializedName: "policyDefinitionId", + message: { + serializedName: "message", required: true, type: { - name: "String" - } - }, - parameters: { - serializedName: "parameters", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ParameterValuesValue" } - } - } + name: "String", + }, }, policyDefinitionReferenceId: { serializedName: "policyDefinitionReferenceId", type: { - name: "String" - } + name: "String", + }, }, - groupNames: { - serializedName: "groupNames", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } + }, + }, }; -export const PolicyDefinitionGroup: coreClient.CompositeMapper = { +export const ResourceSelector: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionGroup", + className: "ResourceSelector", modelProperties: { name: { serializedName: "name", - required: true, type: { - name: "String" - } + name: "String", + }, }, - displayName: { - serializedName: "displayName", + selectors: { + serializedName: "selectors", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Selector", + }, + }, + }, }, - category: { - serializedName: "category", + }, + }, +}; + +export const Selector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Selector", + modelProperties: { + kind: { + serializedName: "kind", type: { - name: "String" - } + name: "String", + }, }, - description: { - serializedName: "description", + in: { + serializedName: "in", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - additionalMetadataId: { - serializedName: "additionalMetadataId", + notIn: { + serializedName: "notIn", type: { - name: "String" - } - } - } - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, }; -export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { +export const Override: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicySetDefinitionListResult", + className: "Override", modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String", + }, + }, value: { serializedName: "value", + type: { + name: "String", + }, + }, + selectors: { + serializedName: "selectors", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PolicySetDefinition" - } - } - } + className: "Selector", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const PolicyExemption: coreClient.CompositeMapper = { +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyExemption", + className: "Identity", modelProperties: { - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, - id: { - serializedName: "id", + principalId: { + serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - name: { - serializedName: "name", + tenantId: { + serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", - readOnly: true, type: { - name: "String" - } + name: "Enum", + allowedValues: ["SystemAssigned", "UserAssigned", "None"], + }, }, - policyAssignmentId: { - serializedName: "properties.policyAssignmentId", - required: true, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", type: { - name: "String" - } + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue", + }, + }, + }, }, - policyDefinitionReferenceIds: { - serializedName: "properties.policyDefinitionReferenceIds", + }, + }, +}; + +export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "String", + }, }, - exemptionCategory: { - serializedName: "properties.exemptionCategory", - required: true, + clientId: { + serializedName: "clientId", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - expiresOn: { - serializedName: "properties.expiresOn", + }, + }, +}; + +export const PolicyAssignmentUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyAssignmentUpdate", + modelProperties: { + location: { + serializedName: "location", type: { - name: "DateTime" - } + name: "String", + }, }, - displayName: { - serializedName: "properties.displayName", + identity: { + serializedName: "identity", type: { - name: "String" - } + name: "Composite", + className: "Identity", + }, }, - description: { - serializedName: "properties.description", + resourceSelectors: { + serializedName: "properties.resourceSelectors", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceSelector", + }, + }, + }, }, - metadata: { - serializedName: "properties.metadata", + overrides: { + serializedName: "properties.overrides", type: { - name: "any" - } - } - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Override", + }, + }, + }, + }, + }, + }, }; -export const PolicyExemptionListResult: coreClient.CompositeMapper = { +export const PolicyAssignmentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyExemptionListResult", + className: "PolicyAssignmentListResult", modelProperties: { value: { serializedName: "value", @@ -1272,18 +1272,17 @@ export const PolicyExemptionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyExemption" - } - } - } + className: "PolicyAssignment", + }, + }, + }, }, nextLink: { serializedName: "nextLink", - readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/policy/arm-policy/src/models/parameters.ts b/sdk/policy/arm-policy/src/models/parameters.ts index 89eaa4fbd9a6..fbc1268cf0e2 100644 --- a/sdk/policy/arm-policy/src/models/parameters.ts +++ b/sdk/policy/arm-policy/src/models/parameters.ts @@ -9,16 +9,34 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { - PolicyAssignment as PolicyAssignmentMapper, - PolicyAssignmentUpdate as PolicyAssignmentUpdateMapper, PolicyDefinition as PolicyDefinitionMapper, + PolicyDefinitionVersion as PolicyDefinitionVersionMapper, PolicySetDefinition as PolicySetDefinitionMapper, - PolicyExemption as PolicyExemptionMapper + PolicySetDefinitionVersion as PolicySetDefinitionVersionMapper, + PolicyAssignment as PolicyAssignmentMapper, + PolicyAssignmentUpdate as PolicyAssignmentUpdateMapper, } from "../models/mappers"; +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyDefinitionMapper, +}; + export const accept: OperationParameter = { parameterPath: "accept", mapper: { @@ -26,9 +44,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -37,33 +55,58 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; -export const policyMode: OperationURLParameter = { - parameterPath: "policyMode", +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - serializedName: "policyMode", + serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "Uuid", + }, + }, +}; + +export const policyDefinitionName: OperationURLParameter = { + parameterPath: "policyDefinitionName", + mapper: { + constraints: { + Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), + }, + serializedName: "policyDefinitionName", + required: true, + type: { + name: "String", + }, + }, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2020-09-01", + defaultValue: "2025-01-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", + mapper: { + serializedName: "managementGroupId", + required: true, + type: { + name: "String", + }, + }, }; export const filter: OperationQueryParameter = { @@ -71,10 +114,24 @@ export const filter: OperationQueryParameter = { mapper: { serializedName: "$filter", type: { - name: "String" - } + name: "String", + }, + }, + skipEncoding: true, +}; + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], + mapper: { + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 1, + }, + serializedName: "$top", + type: { + name: "Number", + }, }, - skipEncoding: true }; export const nextLink: OperationURLParameter = { @@ -83,108 +140,130 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; -export const scope: OperationURLParameter = { - parameterPath: "scope", +export const managementGroupName: OperationURLParameter = { + parameterPath: "managementGroupName", mapper: { - serializedName: "scope", + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "managementGroupName", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true }; -export const policyAssignmentName: OperationURLParameter = { - parameterPath: "policyAssignmentName", +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyDefinitionVersionMapper, +}; + +export const policyDefinitionVersion: OperationURLParameter = { + parameterPath: "policyDefinitionVersion", mapper: { - serializedName: "policyAssignmentName", + constraints: { + Pattern: new RegExp("^\\d+\\.\\d+\\.\\d+$"), + }, + serializedName: "policyDefinitionVersion", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const apiVersion1: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2021-06-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: PolicySetDefinitionMapper, }; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], +export const policySetDefinitionName: OperationURLParameter = { + parameterPath: "policySetDefinitionName", mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", + constraints: { + Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), + }, + serializedName: "policySetDefinitionName", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyAssignmentMapper +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String", + }, + }, }; -export const parameters1: OperationParameter = { +export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: PolicyAssignmentUpdateMapper + mapper: PolicySetDefinitionVersionMapper, }; -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", +export const scope: OperationURLParameter = { + parameterPath: "scope", mapper: { - constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 90, - MinLength: 1 - }, - serializedName: "resourceGroupName", + serializedName: "scope", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, + skipEncoding: true, }; -export const top: OperationQueryParameter = { - parameterPath: ["options", "top"], +export const policyAssignmentName: OperationURLParameter = { + parameterPath: "policyAssignmentName", mapper: { constraints: { - InclusiveMaximum: 1000, - InclusiveMinimum: 1 + Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), }, - serializedName: "$top", + serializedName: "policyAssignmentName", + required: true, type: { - name: "Number" - } - } + name: "String", + }, + }, }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyAssignmentMapper, +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyAssignmentUpdateMapper, +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - serializedName: "subscriptionId", + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -193,9 +272,9 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parentResourcePath: OperationURLParameter = { @@ -204,10 +283,10 @@ export const parentResourcePath: OperationURLParameter = { serializedName: "parentResourcePath", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceType: OperationURLParameter = { @@ -216,32 +295,24 @@ export const resourceType: OperationURLParameter = { serializedName: "resourceType", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceName: OperationURLParameter = { parameterPath: "resourceName", mapper: { + constraints: { + Pattern: new RegExp("^.+$"), + }, serializedName: "resourceName", required: true, type: { - name: "String" - } - } -}; - -export const managementGroupId: OperationURLParameter = { - parameterPath: "managementGroupId", - mapper: { - serializedName: "managementGroupId", - required: true, - type: { - name: "String" - } - } + name: "String", + }, + }, }; export const policyAssignmentId: OperationURLParameter = { @@ -250,68 +321,8 @@ export const policyAssignmentId: OperationURLParameter = { serializedName: "policyAssignmentId", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyDefinitionMapper -}; - -export const policyDefinitionName: OperationURLParameter = { - parameterPath: "policyDefinitionName", - mapper: { - serializedName: "policyDefinitionName", - required: true, - type: { - name: "String" - } - } -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: PolicySetDefinitionMapper -}; - -export const policySetDefinitionName: OperationURLParameter = { - parameterPath: "policySetDefinitionName", - mapper: { - serializedName: "policySetDefinitionName", - required: true, - type: { - name: "String" - } - } -}; - -export const policyExemptionName: OperationURLParameter = { - parameterPath: "policyExemptionName", - mapper: { - serializedName: "policyExemptionName", - required: true, - type: { - name: "String" - } - } -}; - -export const apiVersion2: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2020-07-01-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyExemptionMapper + skipEncoding: true, }; diff --git a/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts b/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts deleted file mode 100644 index 9f4abd98aba3..000000000000 --- a/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts +++ /dev/null @@ -1,190 +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 { DataPolicyManifests } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyClient } from "../policyClient"; -import { - DataPolicyManifest, - DataPolicyManifestsListNextOptionalParams, - DataPolicyManifestsListOptionalParams, - DataPolicyManifestsListResponse, - DataPolicyManifestsGetByPolicyModeOptionalParams, - DataPolicyManifestsGetByPolicyModeResponse, - DataPolicyManifestsListNextResponse -} from "../models"; - -/// -/** Class containing DataPolicyManifests operations. */ -export class DataPolicyManifestsImpl implements DataPolicyManifests { - private readonly client: PolicyClient; - - /** - * Initialize a new instance of the class DataPolicyManifests class. - * @param client Reference to the service client - */ - constructor(client: PolicyClient) { - this.client = client; - } - - /** - * This operation retrieves a list of all the data policy manifests that match the optional given - * $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the - * unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is - * provided, the returned list only includes all data policy manifests that have a namespace matching - * the provided value. - * @param options The options parameters. - */ - public list( - options?: DataPolicyManifestsListOptionalParams - ): 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?: DataPolicyManifestsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: DataPolicyManifestsListResponse; - 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?: DataPolicyManifestsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * This operation retrieves the data policy manifest with the given policy mode. - * @param policyMode The policy mode of the data policy manifest to get. - * @param options The options parameters. - */ - getByPolicyMode( - policyMode: string, - options?: DataPolicyManifestsGetByPolicyModeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyMode, options }, - getByPolicyModeOperationSpec - ); - } - - /** - * This operation retrieves a list of all the data policy manifests that match the optional given - * $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the - * unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is - * provided, the returned list only includes all data policy manifests that have a namespace matching - * the provided value. - * @param options The options parameters. - */ - private _list( - options?: DataPolicyManifestsListOptionalParams - ): 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?: DataPolicyManifestsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getByPolicyModeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataPolicyManifest - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.policyMode], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Authorization/dataPolicyManifests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataPolicyManifestListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataPolicyManifestListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policy/arm-policy/src/operations/index.ts b/sdk/policy/arm-policy/src/operations/index.ts index eff8c4c2a63a..2e5558fc99cc 100644 --- a/sdk/policy/arm-policy/src/operations/index.ts +++ b/sdk/policy/arm-policy/src/operations/index.ts @@ -6,8 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./dataPolicyManifests"; -export * from "./policyAssignments"; export * from "./policyDefinitions"; +export * from "./policyDefinitionVersions"; export * from "./policySetDefinitions"; -export * from "./policyExemptions"; +export * from "./policySetDefinitionVersions"; +export * from "./policyAssignments"; diff --git a/sdk/policy/arm-policy/src/operations/policyAssignments.ts b/sdk/policy/arm-policy/src/operations/policyAssignments.ts index 7711d4d9b20b..c057587ff657 100644 --- a/sdk/policy/arm-policy/src/operations/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operations/policyAssignments.ts @@ -47,7 +47,7 @@ import { PolicyAssignmentsListForResourceGroupNextResponse, PolicyAssignmentsListForResourceNextResponse, PolicyAssignmentsListForManagementGroupNextResponse, - PolicyAssignmentsListNextResponse + PolicyAssignmentsListNextResponse, } from "../models"; /// @@ -80,7 +80,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ public listForResourceGroup( resourceGroupName: string, - options?: PolicyAssignmentsListForResourceGroupOptionalParams + options?: PolicyAssignmentsListForResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForResourceGroupPagingAll(resourceGroupName, options); return { @@ -97,16 +97,16 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { return this.listForResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listForResourceGroupPagingPage( resourceGroupName: string, options?: PolicyAssignmentsListForResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyAssignmentsListForResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -121,7 +121,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { result = await this._listForResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -132,11 +132,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { private async *listForResourceGroupPagingAll( resourceGroupName: string, - options?: PolicyAssignmentsListForResourceGroupOptionalParams + options?: PolicyAssignmentsListForResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -180,7 +180,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath: string, resourceType: string, resourceName: string, - options?: PolicyAssignmentsListForResourceOptionalParams + options?: PolicyAssignmentsListForResourceOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForResourcePagingAll( resourceGroupName, @@ -188,7 +188,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath, resourceType, resourceName, - options + options, ); return { next() { @@ -208,9 +208,9 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType, resourceName, options, - settings + settings, ); - } + }, }; } @@ -221,7 +221,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType: string, resourceName: string, options?: PolicyAssignmentsListForResourceOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyAssignmentsListForResourceResponse; let continuationToken = settings?.continuationToken; @@ -232,7 +232,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath, resourceType, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -247,7 +247,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -262,7 +262,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath: string, resourceType: string, resourceName: string, - options?: PolicyAssignmentsListForResourceOptionalParams + options?: PolicyAssignmentsListForResourceOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForResourcePagingPage( resourceGroupName, @@ -270,7 +270,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath, resourceType, resourceName, - options + options, )) { yield* page; } @@ -290,11 +290,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ public listForManagementGroup( managementGroupId: string, - options?: PolicyAssignmentsListForManagementGroupOptionalParams + options?: PolicyAssignmentsListForManagementGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForManagementGroupPagingAll( managementGroupId, - options + options, ); return { next() { @@ -310,16 +310,16 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { return this.listForManagementGroupPagingPage( managementGroupId, options, - settings + settings, ); - } + }, }; } private async *listForManagementGroupPagingPage( managementGroupId: string, options?: PolicyAssignmentsListForManagementGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyAssignmentsListForManagementGroupResponse; let continuationToken = settings?.continuationToken; @@ -334,7 +334,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { result = await this._listForManagementGroupNext( managementGroupId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -345,11 +345,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { private async *listForManagementGroupPagingAll( managementGroupId: string, - options?: PolicyAssignmentsListForManagementGroupOptionalParams + options?: PolicyAssignmentsListForManagementGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForManagementGroupPagingPage( managementGroupId, - options + options, )) { yield* page; } @@ -370,7 +370,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { * @param options The options parameters. */ public list( - options?: PolicyAssignmentsListOptionalParams + options?: PolicyAssignmentsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -385,13 +385,13 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: PolicyAssignmentsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyAssignmentsListResponse; let continuationToken = settings?.continuationToken; @@ -412,7 +412,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { } private async *listPagingAll( - options?: PolicyAssignmentsListOptionalParams + options?: PolicyAssignmentsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -434,11 +434,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { delete( scope: string, policyAssignmentName: string, - options?: PolicyAssignmentsDeleteOptionalParams + options?: PolicyAssignmentsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, policyAssignmentName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -459,11 +459,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { scope: string, policyAssignmentName: string, parameters: PolicyAssignment, - options?: PolicyAssignmentsCreateOptionalParams + options?: PolicyAssignmentsCreateOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, policyAssignmentName, parameters, options }, - createOperationSpec + createOperationSpec, ); } @@ -480,11 +480,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { get( scope: string, policyAssignmentName: string, - options?: PolicyAssignmentsGetOptionalParams + options?: PolicyAssignmentsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, policyAssignmentName, options }, - getOperationSpec + getOperationSpec, ); } @@ -505,11 +505,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { scope: string, policyAssignmentName: string, parameters: PolicyAssignmentUpdate, - options?: PolicyAssignmentsUpdateOptionalParams + options?: PolicyAssignmentsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, policyAssignmentName, parameters, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -530,11 +530,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ private _listForResourceGroup( resourceGroupName: string, - options?: PolicyAssignmentsListForResourceGroupOptionalParams + options?: PolicyAssignmentsListForResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listForResourceGroupOperationSpec + listForResourceGroupOperationSpec, ); } @@ -576,7 +576,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath: string, resourceType: string, resourceName: string, - options?: PolicyAssignmentsListForResourceOptionalParams + options?: PolicyAssignmentsListForResourceOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -585,9 +585,9 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath, resourceType, resourceName, - options + options, }, - listForResourceOperationSpec + listForResourceOperationSpec, ); } @@ -605,11 +605,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ private _listForManagementGroup( managementGroupId: string, - options?: PolicyAssignmentsListForManagementGroupOptionalParams + options?: PolicyAssignmentsListForManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, options }, - listForManagementGroupOperationSpec + listForManagementGroupOperationSpec, ); } @@ -628,7 +628,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { * @param options The options parameters. */ private _list( - options?: PolicyAssignmentsListOptionalParams + options?: PolicyAssignmentsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -647,11 +647,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ deleteById( policyAssignmentId: string, - options?: PolicyAssignmentsDeleteByIdOptionalParams + options?: PolicyAssignmentsDeleteByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyAssignmentId, options }, - deleteByIdOperationSpec + deleteByIdOperationSpec, ); } @@ -673,11 +673,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { createById( policyAssignmentId: string, parameters: PolicyAssignment, - options?: PolicyAssignmentsCreateByIdOptionalParams + options?: PolicyAssignmentsCreateByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyAssignmentId, parameters, options }, - createByIdOperationSpec + createByIdOperationSpec, ); } @@ -695,11 +695,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ getById( policyAssignmentId: string, - options?: PolicyAssignmentsGetByIdOptionalParams + options?: PolicyAssignmentsGetByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyAssignmentId, options }, - getByIdOperationSpec + getByIdOperationSpec, ); } @@ -721,11 +721,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { updateById( policyAssignmentId: string, parameters: PolicyAssignmentUpdate, - options?: PolicyAssignmentsUpdateByIdOptionalParams + options?: PolicyAssignmentsUpdateByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyAssignmentId, parameters, options }, - updateByIdOperationSpec + updateByIdOperationSpec, ); } @@ -738,11 +738,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { private _listForResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: PolicyAssignmentsListForResourceGroupNextOptionalParams + options?: PolicyAssignmentsListForResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listForResourceGroupNextOperationSpec + listForResourceGroupNextOperationSpec, ); } @@ -765,7 +765,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType: string, resourceName: string, nextLink: string, - options?: PolicyAssignmentsListForResourceNextOptionalParams + options?: PolicyAssignmentsListForResourceNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -775,9 +775,9 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType, resourceName, nextLink, - options + options, }, - listForResourceNextOperationSpec + listForResourceNextOperationSpec, ); } @@ -790,11 +790,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { private _listForManagementGroupNext( managementGroupId: string, nextLink: string, - options?: PolicyAssignmentsListForManagementGroupNextOptionalParams + options?: PolicyAssignmentsListForManagementGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, nextLink, options }, - listForManagementGroupNextOperationSpec + listForManagementGroupNextOperationSpec, ); } @@ -805,11 +805,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ private _listNext( nextLink: string, - options?: PolicyAssignmentsListNextOptionalParams + options?: PolicyAssignmentsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -817,322 +817,334 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + path: "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.policyAssignmentName + Parameters.policyAssignmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + path: "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", httpMethod: "PUT", responses: { 201: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.policyAssignmentName + Parameters.policyAssignmentName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + path: "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.policyAssignmentName + Parameters.policyAssignmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + path: "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.policyAssignmentName + Parameters.policyAssignmentName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const listForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand, + ], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand, + ], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand, + ], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand, + ], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteByIdOperationSpec: coreClient.OperationSpec = { path: "/{policyAssignmentId}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createByIdOperationSpec: coreClient.OperationSpec = { path: "/{policyAssignmentId}", httpMethod: "PUT", responses: { 201: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const getByIdOperationSpec: coreClient.OperationSpec = { path: "/{policyAssignmentId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateByIdOperationSpec: coreClient.OperationSpec = { path: "/{policyAssignmentId}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.nextLink, Parameters.resourceGroupName, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForResourceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.nextLink, Parameters.resourceGroupName, - Parameters.subscriptionId, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, + Parameters.managementGroupId, Parameters.nextLink, - Parameters.managementGroupId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.nextLink, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts new file mode 100644 index 000000000000..535047c064ce --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts @@ -0,0 +1,902 @@ +/* + * 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 { PolicyDefinitionVersions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClient } from "../policyClient"; +import { + PolicyDefinitionVersion, + PolicyDefinitionVersionsListNextOptionalParams, + PolicyDefinitionVersionsListOptionalParams, + PolicyDefinitionVersionsListResponse, + PolicyDefinitionVersionsListBuiltInNextOptionalParams, + PolicyDefinitionVersionsListBuiltInOptionalParams, + PolicyDefinitionVersionsListBuiltInResponse, + PolicyDefinitionVersionsListByManagementGroupNextOptionalParams, + PolicyDefinitionVersionsListByManagementGroupOptionalParams, + PolicyDefinitionVersionsListByManagementGroupResponse, + PolicyDefinitionVersionsListAllBuiltinsOptionalParams, + PolicyDefinitionVersionsListAllBuiltinsResponse, + PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams, + PolicyDefinitionVersionsListAllAtManagementGroupResponse, + PolicyDefinitionVersionsListAllOptionalParams, + PolicyDefinitionVersionsListAllResponse, + PolicyDefinitionVersionsCreateOrUpdateOptionalParams, + PolicyDefinitionVersionsCreateOrUpdateResponse, + PolicyDefinitionVersionsDeleteOptionalParams, + PolicyDefinitionVersionsGetOptionalParams, + PolicyDefinitionVersionsGetResponse, + PolicyDefinitionVersionsGetBuiltInOptionalParams, + PolicyDefinitionVersionsGetBuiltInResponse, + PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse, + PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams, + PolicyDefinitionVersionsGetAtManagementGroupOptionalParams, + PolicyDefinitionVersionsGetAtManagementGroupResponse, + PolicyDefinitionVersionsListNextResponse, + PolicyDefinitionVersionsListBuiltInNextResponse, + PolicyDefinitionVersionsListByManagementGroupNextResponse, +} from "../models"; + +/// +/** Class containing PolicyDefinitionVersions operations. */ +export class PolicyDefinitionVersionsImpl implements PolicyDefinitionVersions { + private readonly client: PolicyClient; + + /** + * Initialize a new instance of the class PolicyDefinitionVersions class. + * @param client Reference to the service client + */ + constructor(client: PolicyClient) { + this.client = client; + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + public list( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(policyDefinitionName, 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(policyDefinitionName, options, settings); + }, + }; + } + + private async *listPagingPage( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicyDefinitionVersionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(policyDefinitionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + policyDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + policyDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + public listBuiltIn( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBuiltInPagingAll(policyDefinitionName, 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.listBuiltInPagingPage( + policyDefinitionName, + options, + settings, + ); + }, + }; + } + + private async *listBuiltInPagingPage( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicyDefinitionVersionsListBuiltInResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBuiltIn(policyDefinitionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBuiltInNext( + policyDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBuiltInPagingAll( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBuiltInPagingPage( + policyDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition in the given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + public listByManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByManagementGroupPagingAll( + managementGroupName, + policyDefinitionName, + 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.listByManagementGroupPagingPage( + managementGroupName, + policyDefinitionName, + options, + settings, + ); + }, + }; + } + + private async *listByManagementGroupPagingPage( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicyDefinitionVersionsListByManagementGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByManagementGroup( + managementGroupName, + policyDefinitionName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByManagementGroupNext( + managementGroupName, + policyDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByManagementGroupPagingAll( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByManagementGroupPagingPage( + managementGroupName, + policyDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation lists all the built-in policy definition versions for all built-in policy + * definitions. + * @param options The options parameters. + */ + listAllBuiltins( + options?: PolicyDefinitionVersionsListAllBuiltinsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listAllBuiltinsOperationSpec, + ); + } + + /** + * This operation lists all the policy definition versions for all policy definitions at the management + * group scope. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param options The options parameters. + */ + listAllAtManagementGroup( + managementGroupName: string, + options?: PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, options }, + listAllAtManagementGroupOperationSpec, + ); + } + + /** + * This operation lists all the policy definition versions for all policy definitions within a + * subscription. + * @param options The options parameters. + */ + listAll( + options?: PolicyDefinitionVersionsListAllOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listAllOperationSpec); + } + + /** + * This operation creates or updates a policy definition in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param parameters The policy definition properties. + * @param options The options parameters. + */ + createOrUpdate( + policyDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicyDefinitionVersion, + options?: PolicyDefinitionVersionsCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, policyDefinitionVersion, parameters, options }, + createOrUpdateOperationSpec, + ); + } + + /** + * This operation deletes the policy definition version in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + delete( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsDeleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, policyDefinitionVersion, options }, + deleteOperationSpec, + ); + } + + /** + * This operation retrieves the policy definition version in the given subscription with the given + * name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + get( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, policyDefinitionVersion, options }, + getOperationSpec, + ); + } + + /** + * This operation retrieves the built-in policy definition version with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getBuiltIn( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, policyDefinitionVersion, options }, + getBuiltInOperationSpec, + ); + } + + /** + * This operation creates or updates a policy definition version in the given management group with the + * given name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param parameters The policy definition properties. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicyDefinitionVersion, + options?: PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policyDefinitionName, + policyDefinitionVersion, + parameters, + options, + }, + createOrUpdateAtManagementGroupOperationSpec, + ); + } + + /** + * This operation deletes the policy definition in the given management group with the given name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policyDefinitionName, + policyDefinitionVersion, + options, + }, + deleteAtManagementGroupOperationSpec, + ); + } + + /** + * This operation retrieves the policy definition version in the given management group with the given + * name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policyDefinitionName, + policyDefinitionVersion, + options, + }, + getAtManagementGroupOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + private _list( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, options }, + listOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + private _listBuiltIn( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, options }, + listBuiltInOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition in the given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + private _listByManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, policyDefinitionName, options }, + listByManagementGroupOperationSpec, + ); + } + + /** + * ListNext + * @param policyDefinitionName The name of the policy definition. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + policyDefinitionName: string, + nextLink: string, + options?: PolicyDefinitionVersionsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListBuiltInNext + * @param policyDefinitionName The name of the policy definition. + * @param nextLink The nextLink from the previous successful call to the ListBuiltIn method. + * @param options The options parameters. + */ + private _listBuiltInNext( + policyDefinitionName: string, + nextLink: string, + options?: PolicyDefinitionVersionsListBuiltInNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, nextLink, options }, + listBuiltInNextOperationSpec, + ); + } + + /** + * ListByManagementGroupNext + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param nextLink The nextLink from the previous successful call to the ListByManagementGroup method. + * @param options The options parameters. + */ + private _listByManagementGroupNext( + managementGroupName: string, + policyDefinitionName: string, + nextLink: string, + options?: PolicyDefinitionVersionsListByManagementGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, policyDefinitionName, nextLink, options }, + listByManagementGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAllBuiltinsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/listPolicyDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listAllAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicyDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.managementGroupName], + headerParameters: [Parameters.accept], + serializer, +}; +const listAllOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicyDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + 201: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + 201: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [Parameters.$host, Parameters.policyDefinitionName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.nextLink, + Parameters.managementGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts index 32335b3819ff..0ea8eb091b66 100644 --- a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts @@ -38,7 +38,7 @@ import { PolicyDefinitionsGetAtManagementGroupResponse, PolicyDefinitionsListNextResponse, PolicyDefinitionsListBuiltInNextResponse, - PolicyDefinitionsListByManagementGroupNextResponse + PolicyDefinitionsListByManagementGroupNextResponse, } from "../models"; /// @@ -68,7 +68,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { * @param options The options parameters. */ public list( - options?: PolicyDefinitionsListOptionalParams + options?: PolicyDefinitionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -83,13 +83,13 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: PolicyDefinitionsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyDefinitionsListResponse; let continuationToken = settings?.continuationToken; @@ -110,7 +110,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { } private async *listPagingAll( - options?: PolicyDefinitionsListOptionalParams + options?: PolicyDefinitionsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -126,7 +126,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { * @param options The options parameters. */ public listBuiltIn( - options?: PolicyDefinitionsListBuiltInOptionalParams + options?: PolicyDefinitionsListBuiltInOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBuiltInPagingAll(options); return { @@ -141,13 +141,13 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { throw new Error("maxPageSize is not supported by this operation."); } return this.listBuiltInPagingPage(options, settings); - } + }, }; } private async *listBuiltInPagingPage( options?: PolicyDefinitionsListBuiltInOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyDefinitionsListBuiltInResponse; let continuationToken = settings?.continuationToken; @@ -168,7 +168,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { } private async *listBuiltInPagingAll( - options?: PolicyDefinitionsListBuiltInOptionalParams + options?: PolicyDefinitionsListBuiltInOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBuiltInPagingPage(options)) { yield* page; @@ -191,11 +191,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ public listByManagementGroup( managementGroupId: string, - options?: PolicyDefinitionsListByManagementGroupOptionalParams + options?: PolicyDefinitionsListByManagementGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByManagementGroupPagingAll( managementGroupId, - options + options, ); return { next() { @@ -211,16 +211,16 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { return this.listByManagementGroupPagingPage( managementGroupId, options, - settings + settings, ); - } + }, }; } private async *listByManagementGroupPagingPage( managementGroupId: string, options?: PolicyDefinitionsListByManagementGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyDefinitionsListByManagementGroupResponse; let continuationToken = settings?.continuationToken; @@ -235,7 +235,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { result = await this._listByManagementGroupNext( managementGroupId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -246,11 +246,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { private async *listByManagementGroupPagingAll( managementGroupId: string, - options?: PolicyDefinitionsListByManagementGroupOptionalParams + options?: PolicyDefinitionsListByManagementGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByManagementGroupPagingPage( managementGroupId, - options + options, )) { yield* page; } @@ -265,11 +265,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { createOrUpdate( policyDefinitionName: string, parameters: PolicyDefinition, - options?: PolicyDefinitionsCreateOrUpdateOptionalParams + options?: PolicyDefinitionsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyDefinitionName, parameters, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -280,11 +280,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ delete( policyDefinitionName: string, - options?: PolicyDefinitionsDeleteOptionalParams + options?: PolicyDefinitionsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -295,11 +295,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ get( policyDefinitionName: string, - options?: PolicyDefinitionsGetOptionalParams + options?: PolicyDefinitionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, - getOperationSpec + getOperationSpec, ); } @@ -310,65 +310,65 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ getBuiltIn( policyDefinitionName: string, - options?: PolicyDefinitionsGetBuiltInOptionalParams + options?: PolicyDefinitionsGetBuiltInOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, - getBuiltInOperationSpec + getBuiltInOperationSpec, ); } /** * This operation creates or updates a policy definition in the given management group with the given * name. - * @param policyDefinitionName The name of the policy definition to create. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. * @param options The options parameters. */ createOrUpdateAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, + policyDefinitionName: string, parameters: PolicyDefinition, - options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams + options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policyDefinitionName, managementGroupId, parameters, options }, - createOrUpdateAtManagementGroupOperationSpec + { managementGroupId, policyDefinitionName, parameters, options }, + createOrUpdateAtManagementGroupOperationSpec, ); } /** * This operation deletes the policy definition in the given management group with the given name. - * @param policyDefinitionName The name of the policy definition to delete. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to delete. * @param options The options parameters. */ deleteAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, - options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams + policyDefinitionName: string, + options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policyDefinitionName, managementGroupId, options }, - deleteAtManagementGroupOperationSpec + { managementGroupId, policyDefinitionName, options }, + deleteAtManagementGroupOperationSpec, ); } /** * This operation retrieves the policy definition in the given management group with the given name. - * @param policyDefinitionName The name of the policy definition to get. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @param options The options parameters. */ getAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, - options?: PolicyDefinitionsGetAtManagementGroupOptionalParams + policyDefinitionName: string, + options?: PolicyDefinitionsGetAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policyDefinitionName, managementGroupId, options }, - getAtManagementGroupOperationSpec + { managementGroupId, policyDefinitionName, options }, + getAtManagementGroupOperationSpec, ); } @@ -386,7 +386,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { * @param options The options parameters. */ private _list( - options?: PolicyDefinitionsListOptionalParams + options?: PolicyDefinitionsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -400,11 +400,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { * @param options The options parameters. */ private _listBuiltIn( - options?: PolicyDefinitionsListBuiltInOptionalParams + options?: PolicyDefinitionsListBuiltInOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBuiltInOperationSpec + listBuiltInOperationSpec, ); } @@ -424,11 +424,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ private _listByManagementGroup( managementGroupId: string, - options?: PolicyDefinitionsListByManagementGroupOptionalParams + options?: PolicyDefinitionsListByManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, options }, - listByManagementGroupOperationSpec + listByManagementGroupOperationSpec, ); } @@ -439,11 +439,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ private _listNext( nextLink: string, - options?: PolicyDefinitionsListNextOptionalParams + options?: PolicyDefinitionsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } @@ -454,11 +454,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ private _listBuiltInNext( nextLink: string, - options?: PolicyDefinitionsListBuiltInNextOptionalParams + options?: PolicyDefinitionsListBuiltInNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBuiltInNextOperationSpec + listBuiltInNextOperationSpec, ); } @@ -471,11 +471,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { private _listByManagementGroupNext( managementGroupId: string, nextLink: string, - options?: PolicyDefinitionsListByManagementGroupNextOptionalParams + options?: PolicyDefinitionsListByManagementGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, nextLink, options }, - listByManagementGroupNextOperationSpec + listByManagementGroupNextOperationSpec, ); } } @@ -483,250 +483,241 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "PUT", responses: { 201: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getBuiltInOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyDefinitionName], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "PUT", responses: { 201: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.policyDefinitionName, Parameters.managementGroupId, - Parameters.policyDefinitionName ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.policyDefinitionName, Parameters.managementGroupId, - Parameters.policyDefinitionName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.policyDefinitionName, Parameters.managementGroupId, - Parameters.policyDefinitionName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBuiltInOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Authorization/policyDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.nextLink, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBuiltInNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, + Parameters.managementGroupId, Parameters.nextLink, - Parameters.managementGroupId ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/policy/arm-policy/src/operations/policyExemptions.ts b/sdk/policy/arm-policy/src/operations/policyExemptions.ts deleted file mode 100644 index 917606661363..000000000000 --- a/sdk/policy/arm-policy/src/operations/policyExemptions.ts +++ /dev/null @@ -1,877 +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 { PolicyExemptions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyClient } from "../policyClient"; -import { - PolicyExemption, - PolicyExemptionsListNextOptionalParams, - PolicyExemptionsListOptionalParams, - PolicyExemptionsListResponse, - PolicyExemptionsListForResourceGroupNextOptionalParams, - PolicyExemptionsListForResourceGroupOptionalParams, - PolicyExemptionsListForResourceGroupResponse, - PolicyExemptionsListForResourceNextOptionalParams, - PolicyExemptionsListForResourceOptionalParams, - PolicyExemptionsListForResourceResponse, - PolicyExemptionsListForManagementGroupNextOptionalParams, - PolicyExemptionsListForManagementGroupOptionalParams, - PolicyExemptionsListForManagementGroupResponse, - PolicyExemptionsDeleteOptionalParams, - PolicyExemptionsCreateOrUpdateOptionalParams, - PolicyExemptionsCreateOrUpdateResponse, - PolicyExemptionsGetOptionalParams, - PolicyExemptionsGetResponse, - PolicyExemptionsListNextResponse, - PolicyExemptionsListForResourceGroupNextResponse, - PolicyExemptionsListForResourceNextResponse, - PolicyExemptionsListForManagementGroupNextResponse -} from "../models"; - -/// -/** Class containing PolicyExemptions operations. */ -export class PolicyExemptionsImpl implements PolicyExemptions { - private readonly client: PolicyClient; - - /** - * Initialize a new instance of the class PolicyExemptions class. - * @param client Reference to the service client - */ - constructor(client: PolicyClient) { - this.client = client; - } - - /** - * This operation retrieves the list of all policy exemptions associated with the given subscription - * that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered - * list includes all policy exemptions associated with the subscription, including those that apply - * directly or from management groups that contain the given subscription, as well as any applied to - * objects contained within the subscription. - * @param options The options parameters. - */ - public list( - options?: PolicyExemptionsListOptionalParams - ): 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?: PolicyExemptionsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyExemptionsListResponse; - 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?: PolicyExemptionsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * This operation retrieves the list of all policy exemptions associated with the given resource group - * in the given subscription that match the optional given $filter. Valid values for $filter are: - * 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter - * is not provided, the unfiltered list includes all policy exemptions associated with the resource - * group, including those that apply directly or apply from containing scopes, as well as any applied - * to resources contained within the resource group. - * @param resourceGroupName The name of the resource group containing the resource. - * @param options The options parameters. - */ - public listForResourceGroup( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listForResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } - }; - } - - private async *listForResourceGroupPagingPage( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyExemptionsListForResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForResourceGroupPagingAll( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForResourceGroupPagingPage( - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * This operation retrieves the list of all policy exemptions associated with the specified resource in - * the given resource group and subscription that match the optional given $filter. Valid values for - * $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. - * If $filter is not provided, the unfiltered list includes all policy exemptions associated with the - * resource, including those that apply directly or from all containing scopes, as well as any applied - * to resources contained within the resource. Three parameters plus the resource name are used to - * identify a specific resource. If the resource is not part of a parent resource (the more common - * case), the parent resource path should not be provided (or provided as ''). For example a web app - * could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', - * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent - * resource, then all parameters should be provided. For example a virtual machine DNS name could be - * specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == - * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == - * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is - * to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace - * of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - public listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForResourcePagingAll( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - 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.listForResourcePagingPage( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options, - settings - ); - } - }; - } - - private async *listForResourcePagingPage( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyExemptionsListForResourceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForResource( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForResourceNext( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForResourcePagingAll( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForResourcePagingPage( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options - )) { - yield* page; - } - } - - /** - * This operation retrieves the list of all policy exemptions applicable to the management group that - * match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the - * returned list includes all policy exemptions that are assigned to the management group or the - * management group's ancestors. - * @param managementGroupId The ID of the management group. - * @param options The options parameters. - */ - public listForManagementGroup( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForManagementGroupPagingAll( - managementGroupId, - 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.listForManagementGroupPagingPage( - managementGroupId, - options, - settings - ); - } - }; - } - - private async *listForManagementGroupPagingPage( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyExemptionsListForManagementGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForManagementGroup(managementGroupId, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForManagementGroupNext( - managementGroupId, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForManagementGroupPagingAll( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForManagementGroupPagingPage( - managementGroupId, - options - )) { - yield* page; - } - } - - /** - * This operation deletes a policy exemption, given its name and the scope it was created in. The scope - * of a policy exemption is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}'. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param options The options parameters. - */ - delete( - scope: string, - policyExemptionName: string, - options?: PolicyExemptionsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, policyExemptionName, options }, - deleteOperationSpec - ); - } - - /** - * This operation creates or updates a policy exemption with the given scope and name. Policy - * exemptions apply to all resources contained within their scope. For example, when you create a - * policy exemption at resource group scope for a policy assignment at the same or above level, the - * exemption exempts to all applicable resources in the resource group. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param parameters Parameters for the policy exemption. - * @param options The options parameters. - */ - createOrUpdate( - scope: string, - policyExemptionName: string, - parameters: PolicyExemption, - options?: PolicyExemptionsCreateOrUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, policyExemptionName, parameters, options }, - createOrUpdateOperationSpec - ); - } - - /** - * This operation retrieves a single policy exemption, given its name and the scope it was created at. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param options The options parameters. - */ - get( - scope: string, - policyExemptionName: string, - options?: PolicyExemptionsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, policyExemptionName, options }, - getOperationSpec - ); - } - - /** - * This operation retrieves the list of all policy exemptions associated with the given subscription - * that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered - * list includes all policy exemptions associated with the subscription, including those that apply - * directly or from management groups that contain the given subscription, as well as any applied to - * objects contained within the subscription. - * @param options The options parameters. - */ - private _list( - options?: PolicyExemptionsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * This operation retrieves the list of all policy exemptions associated with the given resource group - * in the given subscription that match the optional given $filter. Valid values for $filter are: - * 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter - * is not provided, the unfiltered list includes all policy exemptions associated with the resource - * group, including those that apply directly or apply from containing scopes, as well as any applied - * to resources contained within the resource group. - * @param resourceGroupName The name of the resource group containing the resource. - * @param options The options parameters. - */ - private _listForResourceGroup( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listForResourceGroupOperationSpec - ); - } - - /** - * This operation retrieves the list of all policy exemptions associated with the specified resource in - * the given resource group and subscription that match the optional given $filter. Valid values for - * $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. - * If $filter is not provided, the unfiltered list includes all policy exemptions associated with the - * resource, including those that apply directly or from all containing scopes, as well as any applied - * to resources contained within the resource. Three parameters plus the resource name are used to - * identify a specific resource. If the resource is not part of a parent resource (the more common - * case), the parent resource path should not be provided (or provided as ''). For example a web app - * could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', - * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent - * resource, then all parameters should be provided. For example a virtual machine DNS name could be - * specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == - * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == - * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is - * to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace - * of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - private _listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options - }, - listForResourceOperationSpec - ); - } - - /** - * This operation retrieves the list of all policy exemptions applicable to the management group that - * match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the - * returned list includes all policy exemptions that are assigned to the management group or the - * management group's ancestors. - * @param managementGroupId The ID of the management group. - * @param options The options parameters. - */ - private _listForManagementGroup( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, options }, - listForManagementGroupOperationSpec - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: PolicyExemptionsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } - - /** - * ListForResourceGroupNext - * @param resourceGroupName The name of the resource group containing the resource. - * @param nextLink The nextLink from the previous successful call to the ListForResourceGroup method. - * @param options The options parameters. - */ - private _listForResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: PolicyExemptionsListForResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listForResourceGroupNextOperationSpec - ); - } - - /** - * ListForResourceNext - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace - * of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param nextLink The nextLink from the previous successful call to the ListForResource method. - * @param options The options parameters. - */ - private _listForResourceNext( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - nextLink: string, - options?: PolicyExemptionsListForResourceNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - nextLink, - options - }, - listForResourceNextOperationSpec - ); - } - - /** - * ListForManagementGroupNext - * @param managementGroupId The ID of the management group. - * @param nextLink The nextLink from the previous successful call to the ListForManagementGroup method. - * @param options The options parameters. - */ - private _listForManagementGroupNext( - managementGroupId: string, - nextLink: string, - options?: PolicyExemptionsListForManagementGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, nextLink, options }, - listForManagementGroupNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.policyExemptionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemption - }, - 201: { - bodyMapper: Mappers.PolicyExemption - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.policyExemptionName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemption - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.policyExemptionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyExemptions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyExemptions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyExemptions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceProviderNamespace, - Parameters.parentResourcePath, - Parameters.resourceType, - Parameters.resourceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyExemptions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], - urlParameters: [Parameters.$host, Parameters.managementGroupId], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceProviderNamespace, - Parameters.parentResourcePath, - Parameters.resourceType, - Parameters.resourceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.managementGroupId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts new file mode 100644 index 000000000000..3f46e1c62829 --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts @@ -0,0 +1,907 @@ +/* + * 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 { PolicySetDefinitionVersions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClient } from "../policyClient"; +import { + PolicySetDefinitionVersion, + PolicySetDefinitionVersionsListNextOptionalParams, + PolicySetDefinitionVersionsListOptionalParams, + PolicySetDefinitionVersionsListResponse, + PolicySetDefinitionVersionsListBuiltInNextOptionalParams, + PolicySetDefinitionVersionsListBuiltInOptionalParams, + PolicySetDefinitionVersionsListBuiltInResponse, + PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams, + PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + PolicySetDefinitionVersionsListByManagementGroupResponse, + PolicySetDefinitionVersionsListAllBuiltinsOptionalParams, + PolicySetDefinitionVersionsListAllBuiltinsResponse, + PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsListAllAtManagementGroupResponse, + PolicySetDefinitionVersionsListAllOptionalParams, + PolicySetDefinitionVersionsListAllResponse, + PolicySetDefinitionVersionsCreateOrUpdateOptionalParams, + PolicySetDefinitionVersionsCreateOrUpdateResponse, + PolicySetDefinitionVersionsDeleteOptionalParams, + PolicySetDefinitionVersionsGetOptionalParams, + PolicySetDefinitionVersionsGetResponse, + PolicySetDefinitionVersionsGetBuiltInOptionalParams, + PolicySetDefinitionVersionsGetBuiltInResponse, + PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse, + PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsGetAtManagementGroupResponse, + PolicySetDefinitionVersionsListNextResponse, + PolicySetDefinitionVersionsListBuiltInNextResponse, + PolicySetDefinitionVersionsListByManagementGroupNextResponse, +} from "../models"; + +/// +/** Class containing PolicySetDefinitionVersions operations. */ +export class PolicySetDefinitionVersionsImpl + implements PolicySetDefinitionVersions +{ + private readonly client: PolicyClient; + + /** + * Initialize a new instance of the class PolicySetDefinitionVersions class. + * @param client Reference to the service client + */ + constructor(client: PolicyClient) { + this.client = client; + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + public list( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(policySetDefinitionName, 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(policySetDefinitionName, options, settings); + }, + }; + } + + private async *listPagingPage( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicySetDefinitionVersionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(policySetDefinitionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + policySetDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + policySetDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation retrieves a list of all the built-in policy set definition versions for the given + * built-in policy set definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + public listBuiltIn( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBuiltInPagingAll(policySetDefinitionName, 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.listBuiltInPagingPage( + policySetDefinitionName, + options, + settings, + ); + }, + }; + } + + private async *listBuiltInPagingPage( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicySetDefinitionVersionsListBuiltInResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBuiltIn(policySetDefinitionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBuiltInNext( + policySetDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBuiltInPagingAll( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBuiltInPagingPage( + policySetDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition in a given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + public listByManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByManagementGroupPagingAll( + managementGroupName, + policySetDefinitionName, + 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.listByManagementGroupPagingPage( + managementGroupName, + policySetDefinitionName, + options, + settings, + ); + }, + }; + } + + private async *listByManagementGroupPagingPage( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicySetDefinitionVersionsListByManagementGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByManagementGroup( + managementGroupName, + policySetDefinitionName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByManagementGroupNext( + managementGroupName, + policySetDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByManagementGroupPagingAll( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByManagementGroupPagingPage( + managementGroupName, + policySetDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation lists all the built-in policy set definition versions for all built-in policy set + * definitions. + * @param options The options parameters. + */ + listAllBuiltins( + options?: PolicySetDefinitionVersionsListAllBuiltinsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listAllBuiltinsOperationSpec, + ); + } + + /** + * This operation lists all the policy set definition versions for all policy set definitions at the + * management group scope. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param options The options parameters. + */ + listAllAtManagementGroup( + managementGroupName: string, + options?: PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, options }, + listAllAtManagementGroupOperationSpec, + ); + } + + /** + * This operation lists all the policy set definition versions for all policy set definitions within a + * subscription. + * @param options The options parameters. + */ + listAll( + options?: PolicySetDefinitionVersionsListAllOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listAllOperationSpec); + } + + /** + * This operation creates or updates a policy set definition version in the given subscription with the + * given name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param parameters The policy set definition properties. + * @param options The options parameters. + */ + createOrUpdate( + policySetDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicySetDefinitionVersion, + options?: PolicySetDefinitionVersionsCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, policyDefinitionVersion, parameters, options }, + createOrUpdateOperationSpec, + ); + } + + /** + * This operation deletes the policy set definition version in the given subscription with the given + * name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + delete( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsDeleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, policyDefinitionVersion, options }, + deleteOperationSpec, + ); + } + + /** + * This operation retrieves the policy set definition version in the given subscription with the given + * name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + get( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, policyDefinitionVersion, options }, + getOperationSpec, + ); + } + + /** + * This operation retrieves the built-in policy set definition version with the given name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getBuiltIn( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, policyDefinitionVersion, options }, + getBuiltInOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + private _list( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, options }, + listOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the built-in policy set definition versions for the given + * built-in policy set definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + private _listBuiltIn( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, options }, + listBuiltInOperationSpec, + ); + } + + /** + * This operation creates or updates a policy set definition version in the given management group with + * the given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param parameters The policy set definition version properties. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicySetDefinitionVersion, + options?: PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policySetDefinitionName, + policyDefinitionVersion, + parameters, + options, + }, + createOrUpdateAtManagementGroupOperationSpec, + ); + } + + /** + * This operation deletes the policy set definition version in the given management group with the + * given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policySetDefinitionName, + policyDefinitionVersion, + options, + }, + deleteAtManagementGroupOperationSpec, + ); + } + + /** + * This operation retrieves the policy set definition version in the given management group with the + * given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policySetDefinitionName, + policyDefinitionVersion, + options, + }, + getAtManagementGroupOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition in a given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + private _listByManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, policySetDefinitionName, options }, + listByManagementGroupOperationSpec, + ); + } + + /** + * ListNext + * @param policySetDefinitionName The name of the policy set definition. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + policySetDefinitionName: string, + nextLink: string, + options?: PolicySetDefinitionVersionsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListBuiltInNext + * @param policySetDefinitionName The name of the policy set definition. + * @param nextLink The nextLink from the previous successful call to the ListBuiltIn method. + * @param options The options parameters. + */ + private _listBuiltInNext( + policySetDefinitionName: string, + nextLink: string, + options?: PolicySetDefinitionVersionsListBuiltInNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, nextLink, options }, + listBuiltInNextOperationSpec, + ); + } + + /** + * ListByManagementGroupNext + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param nextLink The nextLink from the previous successful call to the ListByManagementGroup method. + * @param options The options parameters. + */ + private _listByManagementGroupNext( + managementGroupName: string, + policySetDefinitionName: string, + nextLink: string, + options?: PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, policySetDefinitionName, nextLink, options }, + listByManagementGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAllBuiltinsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/listPolicySetDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listAllAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.managementGroupName], + headerParameters: [Parameters.accept], + serializer, +}; +const listAllOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + 201: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [Parameters.$host, Parameters.policySetDefinitionName], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + 201: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupName, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.managementGroupName, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts index 0a2a26cd3d2d..de0f5adf22a9 100644 --- a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts @@ -38,7 +38,7 @@ import { PolicySetDefinitionsGetAtManagementGroupResponse, PolicySetDefinitionsListNextResponse, PolicySetDefinitionsListBuiltInNextResponse, - PolicySetDefinitionsListByManagementGroupNextResponse + PolicySetDefinitionsListByManagementGroupNextResponse, } from "../models"; /// @@ -68,7 +68,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { * @param options The options parameters. */ public list( - options?: PolicySetDefinitionsListOptionalParams + options?: PolicySetDefinitionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -83,13 +83,13 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: PolicySetDefinitionsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicySetDefinitionsListResponse; let continuationToken = settings?.continuationToken; @@ -110,7 +110,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { } private async *listPagingAll( - options?: PolicySetDefinitionsListOptionalParams + options?: PolicySetDefinitionsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -124,7 +124,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { * @param options The options parameters. */ public listBuiltIn( - options?: PolicySetDefinitionsListBuiltInOptionalParams + options?: PolicySetDefinitionsListBuiltInOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBuiltInPagingAll(options); return { @@ -139,13 +139,13 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { throw new Error("maxPageSize is not supported by this operation."); } return this.listBuiltInPagingPage(options, settings); - } + }, }; } private async *listBuiltInPagingPage( options?: PolicySetDefinitionsListBuiltInOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicySetDefinitionsListBuiltInResponse; let continuationToken = settings?.continuationToken; @@ -166,7 +166,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { } private async *listBuiltInPagingAll( - options?: PolicySetDefinitionsListBuiltInOptionalParams + options?: PolicySetDefinitionsListBuiltInOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBuiltInPagingPage(options)) { yield* page; @@ -189,11 +189,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ public listByManagementGroup( managementGroupId: string, - options?: PolicySetDefinitionsListByManagementGroupOptionalParams + options?: PolicySetDefinitionsListByManagementGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByManagementGroupPagingAll( managementGroupId, - options + options, ); return { next() { @@ -209,16 +209,16 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { return this.listByManagementGroupPagingPage( managementGroupId, options, - settings + settings, ); - } + }, }; } private async *listByManagementGroupPagingPage( managementGroupId: string, options?: PolicySetDefinitionsListByManagementGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicySetDefinitionsListByManagementGroupResponse; let continuationToken = settings?.continuationToken; @@ -233,7 +233,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { result = await this._listByManagementGroupNext( managementGroupId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -244,11 +244,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { private async *listByManagementGroupPagingAll( managementGroupId: string, - options?: PolicySetDefinitionsListByManagementGroupOptionalParams + options?: PolicySetDefinitionsListByManagementGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByManagementGroupPagingPage( managementGroupId, - options + options, )) { yield* page; } @@ -264,11 +264,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { createOrUpdate( policySetDefinitionName: string, parameters: PolicySetDefinition, - options?: PolicySetDefinitionsCreateOrUpdateOptionalParams + options?: PolicySetDefinitionsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, parameters, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -279,11 +279,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ delete( policySetDefinitionName: string, - options?: PolicySetDefinitionsDeleteOptionalParams + options?: PolicySetDefinitionsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -294,11 +294,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ get( policySetDefinitionName: string, - options?: PolicySetDefinitionsGetOptionalParams + options?: PolicySetDefinitionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, - getOperationSpec + getOperationSpec, ); } @@ -309,11 +309,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ getBuiltIn( policySetDefinitionName: string, - options?: PolicySetDefinitionsGetBuiltInOptionalParams + options?: PolicySetDefinitionsGetBuiltInOptionalParams, ): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, - getBuiltInOperationSpec + getBuiltInOperationSpec, ); } @@ -331,7 +331,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { * @param options The options parameters. */ private _list( - options?: PolicySetDefinitionsListOptionalParams + options?: PolicySetDefinitionsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -343,66 +343,66 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { * @param options The options parameters. */ private _listBuiltIn( - options?: PolicySetDefinitionsListBuiltInOptionalParams + options?: PolicySetDefinitionsListBuiltInOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBuiltInOperationSpec + listBuiltInOperationSpec, ); } /** * This operation creates or updates a policy set definition in the given management group with the * given name. - * @param policySetDefinitionName The name of the policy set definition to create. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. * @param options The options parameters. */ createOrUpdateAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, + policySetDefinitionName: string, parameters: PolicySetDefinition, - options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams + options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policySetDefinitionName, managementGroupId, parameters, options }, - createOrUpdateAtManagementGroupOperationSpec + { managementGroupId, policySetDefinitionName, parameters, options }, + createOrUpdateAtManagementGroupOperationSpec, ); } /** * This operation deletes the policy set definition in the given management group with the given name. - * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to delete. * @param options The options parameters. */ deleteAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, - options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams + policySetDefinitionName: string, + options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policySetDefinitionName, managementGroupId, options }, - deleteAtManagementGroupOperationSpec + { managementGroupId, policySetDefinitionName, options }, + deleteAtManagementGroupOperationSpec, ); } /** * This operation retrieves the policy set definition in the given management group with the given * name. - * @param policySetDefinitionName The name of the policy set definition to get. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to get. * @param options The options parameters. */ getAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, - options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams + policySetDefinitionName: string, + options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policySetDefinitionName, managementGroupId, options }, - getAtManagementGroupOperationSpec + { managementGroupId, policySetDefinitionName, options }, + getAtManagementGroupOperationSpec, ); } @@ -422,11 +422,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ private _listByManagementGroup( managementGroupId: string, - options?: PolicySetDefinitionsListByManagementGroupOptionalParams + options?: PolicySetDefinitionsListByManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, options }, - listByManagementGroupOperationSpec + listByManagementGroupOperationSpec, ); } @@ -437,11 +437,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ private _listNext( nextLink: string, - options?: PolicySetDefinitionsListNextOptionalParams + options?: PolicySetDefinitionsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } @@ -452,11 +452,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ private _listBuiltInNext( nextLink: string, - options?: PolicySetDefinitionsListBuiltInNextOptionalParams + options?: PolicySetDefinitionsListBuiltInNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBuiltInNextOperationSpec + listBuiltInNextOperationSpec, ); } @@ -469,11 +469,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { private _listByManagementGroupNext( managementGroupId: string, nextLink: string, - options?: PolicySetDefinitionsListByManagementGroupNextOptionalParams + options?: PolicySetDefinitionsListByManagementGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, nextLink, options }, - listByManagementGroupNextOperationSpec + listByManagementGroupNextOperationSpec, ); } } @@ -481,256 +481,262 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, 201: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getBuiltInOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [Parameters.$host, Parameters.policySetDefinitionName], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand, + ], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBuiltInOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Authorization/policySetDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand, + ], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, 201: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand, + ], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.nextLink, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBuiltInNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, + Parameters.managementGroupId, Parameters.nextLink, - Parameters.managementGroupId ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/dataPolicyManifests.ts b/sdk/policy/arm-policy/src/operationsInterfaces/dataPolicyManifests.ts deleted file mode 100644 index f6c486278f94..000000000000 --- a/sdk/policy/arm-policy/src/operationsInterfaces/dataPolicyManifests.ts +++ /dev/null @@ -1,40 +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 { - DataPolicyManifest, - DataPolicyManifestsListOptionalParams, - DataPolicyManifestsGetByPolicyModeOptionalParams, - DataPolicyManifestsGetByPolicyModeResponse -} from "../models"; - -/// -/** Interface representing a DataPolicyManifests. */ -export interface DataPolicyManifests { - /** - * This operation retrieves a list of all the data policy manifests that match the optional given - * $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the - * unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is - * provided, the returned list only includes all data policy manifests that have a namespace matching - * the provided value. - * @param options The options parameters. - */ - list( - options?: DataPolicyManifestsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation retrieves the data policy manifest with the given policy mode. - * @param policyMode The policy mode of the data policy manifest to get. - * @param options The options parameters. - */ - getByPolicyMode( - policyMode: string, - options?: DataPolicyManifestsGetByPolicyModeOptionalParams - ): Promise; -} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/index.ts b/sdk/policy/arm-policy/src/operationsInterfaces/index.ts index eff8c4c2a63a..2e5558fc99cc 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/index.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/index.ts @@ -6,8 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./dataPolicyManifests"; -export * from "./policyAssignments"; export * from "./policyDefinitions"; +export * from "./policyDefinitionVersions"; export * from "./policySetDefinitions"; -export * from "./policyExemptions"; +export * from "./policySetDefinitionVersions"; +export * from "./policyAssignments"; diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts index 88b1af30048a..f3faa8ecc08b 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts @@ -29,7 +29,7 @@ import { PolicyAssignmentsGetByIdOptionalParams, PolicyAssignmentsGetByIdResponse, PolicyAssignmentsUpdateByIdOptionalParams, - PolicyAssignmentsUpdateByIdResponse + PolicyAssignmentsUpdateByIdResponse, } from "../models"; /// @@ -52,7 +52,7 @@ export interface PolicyAssignments { */ listForResourceGroup( resourceGroupName: string, - options?: PolicyAssignmentsListForResourceGroupOptionalParams + options?: PolicyAssignmentsListForResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves the list of all policy assignments associated with the specified resource @@ -92,7 +92,7 @@ export interface PolicyAssignments { parentResourcePath: string, resourceType: string, resourceName: string, - options?: PolicyAssignmentsListForResourceOptionalParams + options?: PolicyAssignmentsListForResourceOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves the list of all policy assignments applicable to the management group that @@ -108,7 +108,7 @@ export interface PolicyAssignments { */ listForManagementGroup( managementGroupId: string, - options?: PolicyAssignmentsListForManagementGroupOptionalParams + options?: PolicyAssignmentsListForManagementGroupOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves the list of all policy assignments associated with the given subscription @@ -125,7 +125,7 @@ export interface PolicyAssignments { * @param options The options parameters. */ list( - options?: PolicyAssignmentsListOptionalParams + options?: PolicyAssignmentsListOptionalParams, ): PagedAsyncIterableIterator; /** * This operation deletes a policy assignment, given its name and the scope it was created in. The @@ -142,7 +142,7 @@ export interface PolicyAssignments { delete( scope: string, policyAssignmentName: string, - options?: PolicyAssignmentsDeleteOptionalParams + options?: PolicyAssignmentsDeleteOptionalParams, ): Promise; /** * This operation creates or updates a policy assignment with the given scope and name. Policy @@ -161,7 +161,7 @@ export interface PolicyAssignments { scope: string, policyAssignmentName: string, parameters: PolicyAssignment, - options?: PolicyAssignmentsCreateOptionalParams + options?: PolicyAssignmentsCreateOptionalParams, ): Promise; /** * This operation retrieves a single policy assignment, given its name and the scope it was created at. @@ -176,7 +176,7 @@ export interface PolicyAssignments { get( scope: string, policyAssignmentName: string, - options?: PolicyAssignmentsGetOptionalParams + options?: PolicyAssignmentsGetOptionalParams, ): Promise; /** * This operation updates a policy assignment with the given scope and name. Policy assignments apply @@ -195,7 +195,7 @@ export interface PolicyAssignments { scope: string, policyAssignmentName: string, parameters: PolicyAssignmentUpdate, - options?: PolicyAssignmentsUpdateOptionalParams + options?: PolicyAssignmentsUpdateOptionalParams, ): Promise; /** * This operation deletes the policy with the given ID. Policy assignment IDs have this format: @@ -211,7 +211,7 @@ export interface PolicyAssignments { */ deleteById( policyAssignmentId: string, - options?: PolicyAssignmentsDeleteByIdOptionalParams + options?: PolicyAssignmentsDeleteByIdOptionalParams, ): Promise; /** * This operation creates or updates the policy assignment with the given ID. Policy assignments made @@ -231,7 +231,7 @@ export interface PolicyAssignments { createById( policyAssignmentId: string, parameters: PolicyAssignment, - options?: PolicyAssignmentsCreateByIdOptionalParams + options?: PolicyAssignmentsCreateByIdOptionalParams, ): Promise; /** * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this @@ -247,7 +247,7 @@ export interface PolicyAssignments { */ getById( policyAssignmentId: string, - options?: PolicyAssignmentsGetByIdOptionalParams + options?: PolicyAssignmentsGetByIdOptionalParams, ): Promise; /** * This operation updates the policy assignment with the given ID. Policy assignments made on a scope @@ -267,6 +267,6 @@ export interface PolicyAssignments { updateById( policyAssignmentId: string, parameters: PolicyAssignmentUpdate, - options?: PolicyAssignmentsUpdateByIdOptionalParams + options?: PolicyAssignmentsUpdateByIdOptionalParams, ): Promise; } diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts new file mode 100644 index 000000000000..52a8bd6b7058 --- /dev/null +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts @@ -0,0 +1,193 @@ +/* + * 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 { + PolicyDefinitionVersion, + PolicyDefinitionVersionsListOptionalParams, + PolicyDefinitionVersionsListBuiltInOptionalParams, + PolicyDefinitionVersionsListByManagementGroupOptionalParams, + PolicyDefinitionVersionsListAllBuiltinsOptionalParams, + PolicyDefinitionVersionsListAllBuiltinsResponse, + PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams, + PolicyDefinitionVersionsListAllAtManagementGroupResponse, + PolicyDefinitionVersionsListAllOptionalParams, + PolicyDefinitionVersionsListAllResponse, + PolicyDefinitionVersionsCreateOrUpdateOptionalParams, + PolicyDefinitionVersionsCreateOrUpdateResponse, + PolicyDefinitionVersionsDeleteOptionalParams, + PolicyDefinitionVersionsGetOptionalParams, + PolicyDefinitionVersionsGetResponse, + PolicyDefinitionVersionsGetBuiltInOptionalParams, + PolicyDefinitionVersionsGetBuiltInResponse, + PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse, + PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams, + PolicyDefinitionVersionsGetAtManagementGroupOptionalParams, + PolicyDefinitionVersionsGetAtManagementGroupResponse, +} from "../models"; + +/// +/** Interface representing a PolicyDefinitionVersions. */ +export interface PolicyDefinitionVersions { + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + list( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + listBuiltIn( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition in the given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + listByManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation lists all the built-in policy definition versions for all built-in policy + * definitions. + * @param options The options parameters. + */ + listAllBuiltins( + options?: PolicyDefinitionVersionsListAllBuiltinsOptionalParams, + ): Promise; + /** + * This operation lists all the policy definition versions for all policy definitions at the management + * group scope. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param options The options parameters. + */ + listAllAtManagementGroup( + managementGroupName: string, + options?: PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation lists all the policy definition versions for all policy definitions within a + * subscription. + * @param options The options parameters. + */ + listAll( + options?: PolicyDefinitionVersionsListAllOptionalParams, + ): Promise; + /** + * This operation creates or updates a policy definition in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param parameters The policy definition properties. + * @param options The options parameters. + */ + createOrUpdate( + policyDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicyDefinitionVersion, + options?: PolicyDefinitionVersionsCreateOrUpdateOptionalParams, + ): Promise; + /** + * This operation deletes the policy definition version in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + delete( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsDeleteOptionalParams, + ): Promise; + /** + * This operation retrieves the policy definition version in the given subscription with the given + * name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + get( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetOptionalParams, + ): Promise; + /** + * This operation retrieves the built-in policy definition version with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getBuiltIn( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetBuiltInOptionalParams, + ): Promise; + /** + * This operation creates or updates a policy definition version in the given management group with the + * given name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param parameters The policy definition properties. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicyDefinitionVersion, + options?: PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation deletes the policy definition in the given management group with the given name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation retrieves the policy definition version in the given management group with the given + * name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetAtManagementGroupOptionalParams, + ): Promise; +} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts index 3a2ca8d77fd1..d9091718ecd8 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts @@ -23,7 +23,7 @@ import { PolicyDefinitionsCreateOrUpdateAtManagementGroupResponse, PolicyDefinitionsDeleteAtManagementGroupOptionalParams, PolicyDefinitionsGetAtManagementGroupOptionalParams, - PolicyDefinitionsGetAtManagementGroupResponse + PolicyDefinitionsGetAtManagementGroupResponse, } from "../models"; /// @@ -43,7 +43,7 @@ export interface PolicyDefinitions { * @param options The options parameters. */ list( - options?: PolicyDefinitionsListOptionalParams + options?: PolicyDefinitionsListOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves a list of all the built-in policy definitions that match the optional given @@ -54,7 +54,7 @@ export interface PolicyDefinitions { * @param options The options parameters. */ listBuiltIn( - options?: PolicyDefinitionsListBuiltInOptionalParams + options?: PolicyDefinitionsListBuiltInOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves a list of all the policy definitions in a given management group that match @@ -72,7 +72,7 @@ export interface PolicyDefinitions { */ listByManagementGroup( managementGroupId: string, - options?: PolicyDefinitionsListByManagementGroupOptionalParams + options?: PolicyDefinitionsListByManagementGroupOptionalParams, ): PagedAsyncIterableIterator; /** * This operation creates or updates a policy definition in the given subscription with the given name. @@ -83,7 +83,7 @@ export interface PolicyDefinitions { createOrUpdate( policyDefinitionName: string, parameters: PolicyDefinition, - options?: PolicyDefinitionsCreateOrUpdateOptionalParams + options?: PolicyDefinitionsCreateOrUpdateOptionalParams, ): Promise; /** * This operation deletes the policy definition in the given subscription with the given name. @@ -92,7 +92,7 @@ export interface PolicyDefinitions { */ delete( policyDefinitionName: string, - options?: PolicyDefinitionsDeleteOptionalParams + options?: PolicyDefinitionsDeleteOptionalParams, ): Promise; /** * This operation retrieves the policy definition in the given subscription with the given name. @@ -101,7 +101,7 @@ export interface PolicyDefinitions { */ get( policyDefinitionName: string, - options?: PolicyDefinitionsGetOptionalParams + options?: PolicyDefinitionsGetOptionalParams, ): Promise; /** * This operation retrieves the built-in policy definition with the given name. @@ -110,42 +110,42 @@ export interface PolicyDefinitions { */ getBuiltIn( policyDefinitionName: string, - options?: PolicyDefinitionsGetBuiltInOptionalParams + options?: PolicyDefinitionsGetBuiltInOptionalParams, ): Promise; /** * This operation creates or updates a policy definition in the given management group with the given * name. - * @param policyDefinitionName The name of the policy definition to create. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. * @param options The options parameters. */ createOrUpdateAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, + policyDefinitionName: string, parameters: PolicyDefinition, - options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams + options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise; /** * This operation deletes the policy definition in the given management group with the given name. - * @param policyDefinitionName The name of the policy definition to delete. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to delete. * @param options The options parameters. */ deleteAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, - options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams + policyDefinitionName: string, + options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams, ): Promise; /** * This operation retrieves the policy definition in the given management group with the given name. - * @param policyDefinitionName The name of the policy definition to get. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @param options The options parameters. */ getAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, - options?: PolicyDefinitionsGetAtManagementGroupOptionalParams + policyDefinitionName: string, + options?: PolicyDefinitionsGetAtManagementGroupOptionalParams, ): Promise; } diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts deleted file mode 100644 index 7fdc61601594..000000000000 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts +++ /dev/null @@ -1,151 +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 { - PolicyExemption, - PolicyExemptionsListOptionalParams, - PolicyExemptionsListForResourceGroupOptionalParams, - PolicyExemptionsListForResourceOptionalParams, - PolicyExemptionsListForManagementGroupOptionalParams, - PolicyExemptionsDeleteOptionalParams, - PolicyExemptionsCreateOrUpdateOptionalParams, - PolicyExemptionsCreateOrUpdateResponse, - PolicyExemptionsGetOptionalParams, - PolicyExemptionsGetResponse -} from "../models"; - -/// -/** Interface representing a PolicyExemptions. */ -export interface PolicyExemptions { - /** - * This operation retrieves the list of all policy exemptions associated with the given subscription - * that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered - * list includes all policy exemptions associated with the subscription, including those that apply - * directly or from management groups that contain the given subscription, as well as any applied to - * objects contained within the subscription. - * @param options The options parameters. - */ - list( - options?: PolicyExemptionsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation retrieves the list of all policy exemptions associated with the given resource group - * in the given subscription that match the optional given $filter. Valid values for $filter are: - * 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter - * is not provided, the unfiltered list includes all policy exemptions associated with the resource - * group, including those that apply directly or apply from containing scopes, as well as any applied - * to resources contained within the resource group. - * @param resourceGroupName The name of the resource group containing the resource. - * @param options The options parameters. - */ - listForResourceGroup( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation retrieves the list of all policy exemptions associated with the specified resource in - * the given resource group and subscription that match the optional given $filter. Valid values for - * $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. - * If $filter is not provided, the unfiltered list includes all policy exemptions associated with the - * resource, including those that apply directly or from all containing scopes, as well as any applied - * to resources contained within the resource. Three parameters plus the resource name are used to - * identify a specific resource. If the resource is not part of a parent resource (the more common - * case), the parent resource path should not be provided (or provided as ''). For example a web app - * could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', - * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent - * resource, then all parameters should be provided. For example a virtual machine DNS name could be - * specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == - * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == - * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is - * to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace - * of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation retrieves the list of all policy exemptions applicable to the management group that - * match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the - * returned list includes all policy exemptions that are assigned to the management group or the - * management group's ancestors. - * @param managementGroupId The ID of the management group. - * @param options The options parameters. - */ - listForManagementGroup( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation deletes a policy exemption, given its name and the scope it was created in. The scope - * of a policy exemption is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}'. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param options The options parameters. - */ - delete( - scope: string, - policyExemptionName: string, - options?: PolicyExemptionsDeleteOptionalParams - ): Promise; - /** - * This operation creates or updates a policy exemption with the given scope and name. Policy - * exemptions apply to all resources contained within their scope. For example, when you create a - * policy exemption at resource group scope for a policy assignment at the same or above level, the - * exemption exempts to all applicable resources in the resource group. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param parameters Parameters for the policy exemption. - * @param options The options parameters. - */ - createOrUpdate( - scope: string, - policyExemptionName: string, - parameters: PolicyExemption, - options?: PolicyExemptionsCreateOrUpdateOptionalParams - ): Promise; - /** - * This operation retrieves a single policy exemption, given its name and the scope it was created at. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param options The options parameters. - */ - get( - scope: string, - policyExemptionName: string, - options?: PolicyExemptionsGetOptionalParams - ): Promise; -} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts new file mode 100644 index 000000000000..7220ef6aebca --- /dev/null +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts @@ -0,0 +1,196 @@ +/* + * 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 { + PolicySetDefinitionVersion, + PolicySetDefinitionVersionsListOptionalParams, + PolicySetDefinitionVersionsListBuiltInOptionalParams, + PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + PolicySetDefinitionVersionsListAllBuiltinsOptionalParams, + PolicySetDefinitionVersionsListAllBuiltinsResponse, + PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsListAllAtManagementGroupResponse, + PolicySetDefinitionVersionsListAllOptionalParams, + PolicySetDefinitionVersionsListAllResponse, + PolicySetDefinitionVersionsCreateOrUpdateOptionalParams, + PolicySetDefinitionVersionsCreateOrUpdateResponse, + PolicySetDefinitionVersionsDeleteOptionalParams, + PolicySetDefinitionVersionsGetOptionalParams, + PolicySetDefinitionVersionsGetResponse, + PolicySetDefinitionVersionsGetBuiltInOptionalParams, + PolicySetDefinitionVersionsGetBuiltInResponse, + PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse, + PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsGetAtManagementGroupResponse, +} from "../models"; + +/// +/** Interface representing a PolicySetDefinitionVersions. */ +export interface PolicySetDefinitionVersions { + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + list( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation retrieves a list of all the built-in policy set definition versions for the given + * built-in policy set definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + listBuiltIn( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition in a given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + listByManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation lists all the built-in policy set definition versions for all built-in policy set + * definitions. + * @param options The options parameters. + */ + listAllBuiltins( + options?: PolicySetDefinitionVersionsListAllBuiltinsOptionalParams, + ): Promise; + /** + * This operation lists all the policy set definition versions for all policy set definitions at the + * management group scope. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param options The options parameters. + */ + listAllAtManagementGroup( + managementGroupName: string, + options?: PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation lists all the policy set definition versions for all policy set definitions within a + * subscription. + * @param options The options parameters. + */ + listAll( + options?: PolicySetDefinitionVersionsListAllOptionalParams, + ): Promise; + /** + * This operation creates or updates a policy set definition version in the given subscription with the + * given name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param parameters The policy set definition properties. + * @param options The options parameters. + */ + createOrUpdate( + policySetDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicySetDefinitionVersion, + options?: PolicySetDefinitionVersionsCreateOrUpdateOptionalParams, + ): Promise; + /** + * This operation deletes the policy set definition version in the given subscription with the given + * name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + delete( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsDeleteOptionalParams, + ): Promise; + /** + * This operation retrieves the policy set definition version in the given subscription with the given + * name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + get( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetOptionalParams, + ): Promise; + /** + * This operation retrieves the built-in policy set definition version with the given name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getBuiltIn( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetBuiltInOptionalParams, + ): Promise; + /** + * This operation creates or updates a policy set definition version in the given management group with + * the given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param parameters The policy set definition version properties. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicySetDefinitionVersion, + options?: PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation deletes the policy set definition version in the given management group with the + * given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation retrieves the policy set definition version in the given management group with the + * given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams, + ): Promise; +} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts index cec9ce211322..a56c84a6b8bd 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts @@ -23,7 +23,7 @@ import { PolicySetDefinitionsCreateOrUpdateAtManagementGroupResponse, PolicySetDefinitionsDeleteAtManagementGroupOptionalParams, PolicySetDefinitionsGetAtManagementGroupOptionalParams, - PolicySetDefinitionsGetAtManagementGroupResponse + PolicySetDefinitionsGetAtManagementGroupResponse, } from "../models"; /// @@ -43,7 +43,7 @@ export interface PolicySetDefinitions { * @param options The options parameters. */ list( - options?: PolicySetDefinitionsListOptionalParams + options?: PolicySetDefinitionsListOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves a list of all the built-in policy set definitions that match the optional @@ -52,7 +52,7 @@ export interface PolicySetDefinitions { * @param options The options parameters. */ listBuiltIn( - options?: PolicySetDefinitionsListBuiltInOptionalParams + options?: PolicySetDefinitionsListBuiltInOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves a list of all the policy set definitions in a given management group that @@ -70,7 +70,7 @@ export interface PolicySetDefinitions { */ listByManagementGroup( managementGroupId: string, - options?: PolicySetDefinitionsListByManagementGroupOptionalParams + options?: PolicySetDefinitionsListByManagementGroupOptionalParams, ): PagedAsyncIterableIterator; /** * This operation creates or updates a policy set definition in the given subscription with the given @@ -82,7 +82,7 @@ export interface PolicySetDefinitions { createOrUpdate( policySetDefinitionName: string, parameters: PolicySetDefinition, - options?: PolicySetDefinitionsCreateOrUpdateOptionalParams + options?: PolicySetDefinitionsCreateOrUpdateOptionalParams, ): Promise; /** * This operation deletes the policy set definition in the given subscription with the given name. @@ -91,7 +91,7 @@ export interface PolicySetDefinitions { */ delete( policySetDefinitionName: string, - options?: PolicySetDefinitionsDeleteOptionalParams + options?: PolicySetDefinitionsDeleteOptionalParams, ): Promise; /** * This operation retrieves the policy set definition in the given subscription with the given name. @@ -100,7 +100,7 @@ export interface PolicySetDefinitions { */ get( policySetDefinitionName: string, - options?: PolicySetDefinitionsGetOptionalParams + options?: PolicySetDefinitionsGetOptionalParams, ): Promise; /** * This operation retrieves the built-in policy set definition with the given name. @@ -109,43 +109,43 @@ export interface PolicySetDefinitions { */ getBuiltIn( policySetDefinitionName: string, - options?: PolicySetDefinitionsGetBuiltInOptionalParams + options?: PolicySetDefinitionsGetBuiltInOptionalParams, ): Promise; /** * This operation creates or updates a policy set definition in the given management group with the * given name. - * @param policySetDefinitionName The name of the policy set definition to create. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. * @param options The options parameters. */ createOrUpdateAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, + policySetDefinitionName: string, parameters: PolicySetDefinition, - options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams + options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise; /** * This operation deletes the policy set definition in the given management group with the given name. - * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to delete. * @param options The options parameters. */ deleteAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, - options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams + policySetDefinitionName: string, + options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams, ): Promise; /** * This operation retrieves the policy set definition in the given management group with the given * name. - * @param policySetDefinitionName The name of the policy set definition to get. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to get. * @param options The options parameters. */ getAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, - options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams + policySetDefinitionName: string, + options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams, ): Promise; } diff --git a/sdk/policy/arm-policy/src/pagingHelper.ts b/sdk/policy/arm-policy/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/policy/arm-policy/src/pagingHelper.ts +++ b/sdk/policy/arm-policy/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/policy/arm-policy/src/policyClient.ts b/sdk/policy/arm-policy/src/policyClient.ts index 9188174e25d4..2ef35d1f9e02 100644 --- a/sdk/policy/arm-policy/src/policyClient.ts +++ b/sdk/policy/arm-policy/src/policyClient.ts @@ -8,58 +8,63 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { - DataPolicyManifestsImpl, - PolicyAssignmentsImpl, PolicyDefinitionsImpl, + PolicyDefinitionVersionsImpl, PolicySetDefinitionsImpl, - PolicyExemptionsImpl + PolicySetDefinitionVersionsImpl, + PolicyAssignmentsImpl, } from "./operations"; import { - DataPolicyManifests, - PolicyAssignments, PolicyDefinitions, + PolicyDefinitionVersions, PolicySetDefinitions, - PolicyExemptions + PolicySetDefinitionVersions, + PolicyAssignments, } from "./operationsInterfaces"; import { PolicyClientOptionalParams } from "./models"; export class PolicyClient extends coreClient.ServiceClient { $host: string; subscriptionId?: string; + apiVersion: string; /** * Initializes a new instance of the PolicyClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: PolicyClientOptionalParams + options?: PolicyClientOptionalParams, ); constructor( credentials: coreAuth.TokenCredential, - options?: PolicyClientOptionalParams + options?: PolicyClientOptionalParams, ); constructor( credentials: coreAuth.TokenCredential, - subscriptionIdOrOptions?: string | PolicyClientOptionalParams, - options?: PolicyClientOptionalParams + subscriptionIdOrOptions?: PolicyClientOptionalParams | string, + options?: PolicyClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } + let subscriptionId: string | undefined; - if (!subscriptionIdOrOptions !== undefined) { - if (typeof subscriptionIdOrOptions === "string") { - subscriptionId = subscriptionIdOrOptions; - } else if (typeof subscriptionIdOrOptions === "object") { - options = subscriptionIdOrOptions; - } + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -68,10 +73,10 @@ export class PolicyClient extends coreClient.ServiceClient { } const defaults: PolicyClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-policy/5.1.1`; + const packageDetails = `azsdk-js-arm-policy/6.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -81,20 +86,21 @@ export class PolicyClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -104,7 +110,7 @@ export class PolicyClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -114,9 +120,9 @@ export class PolicyClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -124,16 +130,48 @@ export class PolicyClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.dataPolicyManifests = new DataPolicyManifestsImpl(this); - this.policyAssignments = new PolicyAssignmentsImpl(this); + this.apiVersion = options.apiVersion || "2025-01-01"; this.policyDefinitions = new PolicyDefinitionsImpl(this); + this.policyDefinitionVersions = new PolicyDefinitionVersionsImpl(this); this.policySetDefinitions = new PolicySetDefinitionsImpl(this); - this.policyExemptions = new PolicyExemptionsImpl(this); + this.policySetDefinitionVersions = new PolicySetDefinitionVersionsImpl( + this, + ); + this.policyAssignments = new PolicyAssignmentsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); } - dataPolicyManifests: DataPolicyManifests; - policyAssignments: PolicyAssignments; policyDefinitions: PolicyDefinitions; + policyDefinitionVersions: PolicyDefinitionVersions; policySetDefinitions: PolicySetDefinitions; - policyExemptions: PolicyExemptions; + policySetDefinitionVersions: PolicySetDefinitionVersions; + policyAssignments: PolicyAssignments; } diff --git a/sdk/policy/arm-policy/test/sampleTest.ts b/sdk/policy/arm-policy/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/policy/arm-policy/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/policy/arm-policy/tsconfig.json b/sdk/policy/arm-policy/tsconfig.json index bf4c4a024317..acfa80d6baf6 100644 --- a/sdk/policy/arm-policy/tsconfig.json +++ b/sdk/policy/arm-policy/tsconfig.json @@ -15,17 +15,14 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-policy": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE b/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +Copyright (c) 2024 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/resources-subscriptions/arm-resources-subscriptions/README.md b/sdk/resources-subscriptions/arm-resources-subscriptions/README.md index df3132b91694..bd9c5d64f63f 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/README.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Subscription** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json index 0c611e34e91d..267db4618701 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": "5da5b2929683c6389262afe133f3b62ade3b33aa", "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", + "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.12", "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" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ 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 83f82bb492cc..01de521da564 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/package.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/package.json @@ -8,10 +8,10 @@ "node": ">=18.0.0" }, "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.7.0", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -26,18 +26,19 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-resources-subscriptions.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -65,28 +66,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -99,13 +100,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/sample.env b/sdk/resources-subscriptions/arm-resources-subscriptions/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/sample.env +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts index 6db2ed8937c1..d1a0fe76aedc 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts @@ -528,7 +528,7 @@ export enum KnownOrigin { /** System */ System = "system", /** UserSystem */ - UserSystem = "user,system" + UserSystem = "user,system", } /** @@ -545,7 +545,7 @@ export type Origin = string; /** Known values of {@link ActionType} that the service accepts. */ export enum KnownActionType { /** Internal */ - Internal = "Internal" + Internal = "Internal", } /** @@ -562,7 +562,7 @@ export enum KnownRegionType { /** Physical */ Physical = "Physical", /** Logical */ - Logical = "Logical" + Logical = "Logical", } /** @@ -582,7 +582,7 @@ export enum KnownRegionCategory { /** Extended */ Extended = "Extended", /** Other */ - Other = "Other" + Other = "Other", } /** @@ -601,7 +601,7 @@ export enum KnownResourceNameStatus { /** Allowed */ Allowed = "Allowed", /** Reserved */ - Reserved = "Reserved" + Reserved = "Reserved", } /** 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..a6c3d0404f2a 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts @@ -21,20 +21,20 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -46,39 +46,39 @@ export const Operation: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } + className: "OperationDisplay", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, actionType: { serializedName: "actionType", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -90,32 +90,32 @@ export const OperationDisplay: coreClient.CompositeMapper = { serializedName: "provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CloudError: coreClient.CompositeMapper = { @@ -127,11 +127,11 @@ export const CloudError: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -143,22 +143,22 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -168,10 +168,10 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" - } - } - } + className: "ErrorResponse", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -181,13 +181,13 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -199,19 +199,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const LocationListResult: coreClient.CompositeMapper = { @@ -226,13 +226,13 @@ export const LocationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Location" - } - } - } - } - } - } + className: "Location", + }, + }, + }, + }, + }, + }, }; export const Location: coreClient.CompositeMapper = { @@ -244,51 +244,51 @@ export const Location: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, subscriptionId: { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { name: "Enum", - allowedValues: ["Region", "EdgeZone"] - } + allowedValues: ["Region", "EdgeZone"], + }, }, displayName: { serializedName: "displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, regionalDisplayName: { serializedName: "regionalDisplayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, metadata: { serializedName: "metadata", type: { name: "Composite", - className: "LocationMetadata" - } + className: "LocationMetadata", + }, }, availabilityZoneMappings: { serializedName: "availabilityZoneMappings", @@ -297,13 +297,13 @@ export const Location: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AvailabilityZoneMappings" - } - } - } - } - } - } + className: "AvailabilityZoneMappings", + }, + }, + }, + }, + }, + }, }; export const LocationMetadata: coreClient.CompositeMapper = { @@ -315,50 +315,50 @@ export const LocationMetadata: coreClient.CompositeMapper = { serializedName: "regionType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, regionCategory: { serializedName: "regionCategory", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, geography: { serializedName: "geography", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, geographyGroup: { serializedName: "geographyGroup", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, longitude: { serializedName: "longitude", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, latitude: { serializedName: "latitude", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, physicalLocation: { serializedName: "physicalLocation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, pairedRegion: { serializedName: "pairedRegion", @@ -367,20 +367,20 @@ export const LocationMetadata: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PairedRegion" - } - } - } + className: "PairedRegion", + }, + }, + }, }, homeLocation: { serializedName: "homeLocation", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PairedRegion: coreClient.CompositeMapper = { @@ -392,25 +392,25 @@ export const PairedRegion: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, id: { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, subscriptionId: { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const AvailabilityZoneMappings: coreClient.CompositeMapper = { @@ -422,18 +422,18 @@ export const AvailabilityZoneMappings: coreClient.CompositeMapper = { serializedName: "logicalZone", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, physicalZone: { serializedName: "physicalZone", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Subscription: coreClient.CompositeMapper = { @@ -445,50 +445,56 @@ export const Subscription: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, subscriptionId: { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, state: { serializedName: "state", readOnly: true, type: { name: "Enum", - allowedValues: ["Enabled", "Warned", "PastDue", "Disabled", "Deleted"] - } + allowedValues: [ + "Enabled", + "Warned", + "PastDue", + "Disabled", + "Deleted", + ], + }, }, subscriptionPolicies: { serializedName: "subscriptionPolicies", type: { name: "Composite", - className: "SubscriptionPolicies" - } + className: "SubscriptionPolicies", + }, }, authorizationSource: { serializedName: "authorizationSource", type: { - name: "String" - } + name: "String", + }, }, managedByTenants: { serializedName: "managedByTenants", @@ -497,20 +503,20 @@ export const Subscription: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ManagedByTenant" - } - } - } + className: "ManagedByTenant", + }, + }, + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const SubscriptionPolicies: coreClient.CompositeMapper = { @@ -522,26 +528,26 @@ export const SubscriptionPolicies: coreClient.CompositeMapper = { serializedName: "locationPlacementId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, quotaId: { serializedName: "quotaId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, spendingLimit: { serializedName: "spendingLimit", readOnly: true, type: { name: "Enum", - allowedValues: ["On", "Off", "CurrentPeriodOff"] - } - } - } - } + allowedValues: ["On", "Off", "CurrentPeriodOff"], + }, + }, + }, + }, }; export const ManagedByTenant: coreClient.CompositeMapper = { @@ -553,11 +559,11 @@ export const ManagedByTenant: coreClient.CompositeMapper = { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SubscriptionListResult: coreClient.CompositeMapper = { @@ -572,20 +578,20 @@ export const SubscriptionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Subscription" - } - } - } + className: "Subscription", + }, + }, + }, }, nextLink: { serializedName: "nextLink", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TenantListResult: coreClient.CompositeMapper = { @@ -600,20 +606,20 @@ export const TenantListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TenantIdDescription" - } - } - } + className: "TenantIdDescription", + }, + }, + }, }, nextLink: { serializedName: "nextLink", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TenantIdDescription: coreClient.CompositeMapper = { @@ -625,44 +631,44 @@ export const TenantIdDescription: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantCategory: { serializedName: "tenantCategory", readOnly: true, type: { name: "Enum", - allowedValues: ["Home", "ProjectedBy", "ManagedBy"] - } + allowedValues: ["Home", "ProjectedBy", "ManagedBy"], + }, }, country: { serializedName: "country", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, countryCode: { serializedName: "countryCode", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, domains: { serializedName: "domains", @@ -671,34 +677,34 @@ export const TenantIdDescription: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, defaultDomain: { serializedName: "defaultDomain", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantType: { serializedName: "tenantType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantBrandingLogoUrl: { serializedName: "tenantBrandingLogoUrl", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CheckZonePeersRequest: coreClient.CompositeMapper = { @@ -709,8 +715,8 @@ export const CheckZonePeersRequest: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, subscriptionIds: { serializedName: "subscriptionIds", @@ -718,13 +724,13 @@ export const CheckZonePeersRequest: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const CheckZonePeersResult: coreClient.CompositeMapper = { @@ -736,14 +742,14 @@ export const CheckZonePeersResult: coreClient.CompositeMapper = { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, availabilityZonePeers: { serializedName: "availabilityZonePeers", @@ -752,13 +758,13 @@ export const CheckZonePeersResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AvailabilityZonePeers" - } - } - } - } - } - } + className: "AvailabilityZonePeers", + }, + }, + }, + }, + }, + }, }; export const AvailabilityZonePeers: coreClient.CompositeMapper = { @@ -770,8 +776,8 @@ export const AvailabilityZonePeers: coreClient.CompositeMapper = { serializedName: "availabilityZone", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, peers: { serializedName: "peers", @@ -780,13 +786,13 @@ export const AvailabilityZonePeers: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Peers" - } - } - } - } - } - } + className: "Peers", + }, + }, + }, + }, + }, + }, }; export const Peers: coreClient.CompositeMapper = { @@ -798,18 +804,18 @@ export const Peers: coreClient.CompositeMapper = { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, availabilityZone: { serializedName: "availabilityZone", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { @@ -821,11 +827,11 @@ export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -837,22 +843,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -862,10 +868,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -875,13 +881,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ResourceName: coreClient.CompositeMapper = { @@ -893,18 +899,18 @@ export const ResourceName: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CheckResourceNameResult: coreClient.CompositeMapper = { @@ -915,23 +921,23 @@ export const CheckResourceNameResult: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, status: { serializedName: "status", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationAutoGenerated: coreClient.CompositeMapper = { @@ -942,39 +948,39 @@ export const OperationAutoGenerated: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplayAutoGenerated" - } + className: "OperationDisplayAutoGenerated", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, actionType: { serializedName: "actionType", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { @@ -985,29 +991,29 @@ export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { @@ -1022,17 +1028,17 @@ export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "OperationAutoGenerated" - } - } - } + className: "OperationAutoGenerated", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; 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..965ef83a7885 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts @@ -9,11 +9,11 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { CheckZonePeersRequest as CheckZonePeersRequestMapper, - ResourceName as ResourceNameMapper + ResourceName as ResourceNameMapper, } from "../models/mappers"; export const accept: OperationParameter = { @@ -23,9 +23,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -34,10 +34,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -47,9 +47,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -58,10 +58,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -70,9 +70,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const includeExtendedLocations: OperationQueryParameter = { @@ -80,9 +80,9 @@ export const includeExtendedLocations: OperationQueryParameter = { mapper: { serializedName: "includeExtendedLocations", type: { - name: "Boolean" - } - } + name: "Boolean", + }, + }, }; export const contentType: OperationParameter = { @@ -92,17 +92,17 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: CheckZonePeersRequestMapper + mapper: CheckZonePeersRequestMapper, }; export const resourceNameDefinition: OperationParameter = { parameterPath: ["options", "resourceNameDefinition"], - mapper: ResourceNameMapper + mapper: ResourceNameMapper, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts index 3808ae14959a..9e27d8928e4d 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models"; /// @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,29 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts index 1221f4bb1b8f..19c42462e4a5 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts @@ -26,7 +26,7 @@ import { CheckZonePeersRequest, SubscriptionsCheckZonePeersOptionalParams, SubscriptionsCheckZonePeersResponse, - SubscriptionsListNextResponse + SubscriptionsListNextResponse, } from "../models"; /// @@ -50,7 +50,7 @@ export class SubscriptionsImpl implements Subscriptions { */ public listLocations( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listLocationsPagingAll(subscriptionId, options); return { @@ -65,14 +65,14 @@ export class SubscriptionsImpl implements Subscriptions { throw new Error("maxPageSize is not supported by this operation."); } return this.listLocationsPagingPage(subscriptionId, options, settings); - } + }, }; } private async *listLocationsPagingPage( subscriptionId: string, options?: SubscriptionsListLocationsOptionalParams, - _settings?: PageSettings + _settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionsListLocationsResponse; result = await this._listLocations(subscriptionId, options); @@ -81,11 +81,11 @@ export class SubscriptionsImpl implements Subscriptions { private async *listLocationsPagingAll( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listLocationsPagingPage( subscriptionId, - options + options, )) { yield* page; } @@ -96,7 +96,7 @@ export class SubscriptionsImpl implements Subscriptions { * @param options The options parameters. */ public list( - options?: SubscriptionsListOptionalParams + options?: SubscriptionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -111,13 +111,13 @@ export class SubscriptionsImpl implements Subscriptions { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: SubscriptionsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionsListResponse; let continuationToken = settings?.continuationToken; @@ -138,7 +138,7 @@ export class SubscriptionsImpl implements Subscriptions { } private async *listPagingAll( - options?: SubscriptionsListOptionalParams + options?: SubscriptionsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -153,11 +153,11 @@ export class SubscriptionsImpl implements Subscriptions { */ private _listLocations( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): Promise { return this.client.sendOperationRequest( { subscriptionId, options }, - listLocationsOperationSpec + listLocationsOperationSpec, ); } @@ -168,11 +168,11 @@ export class SubscriptionsImpl implements Subscriptions { */ get( subscriptionId: string, - options?: SubscriptionsGetOptionalParams + options?: SubscriptionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { subscriptionId, options }, - getOperationSpec + getOperationSpec, ); } @@ -181,7 +181,7 @@ export class SubscriptionsImpl implements Subscriptions { * @param options The options parameters. */ private _list( - options?: SubscriptionsListOptionalParams + options?: SubscriptionsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -195,11 +195,11 @@ export class SubscriptionsImpl implements Subscriptions { checkZonePeers( subscriptionId: string, parameters: CheckZonePeersRequest, - options?: SubscriptionsCheckZonePeersOptionalParams + options?: SubscriptionsCheckZonePeersOptionalParams, ): Promise { return this.client.sendOperationRequest( { subscriptionId, parameters, options }, - checkZonePeersOperationSpec + checkZonePeersOperationSpec, ); } @@ -210,11 +210,11 @@ export class SubscriptionsImpl implements Subscriptions { */ private _listNext( nextLink: string, - options?: SubscriptionsListNextOptionalParams + options?: SubscriptionsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -226,80 +226,79 @@ const listLocationsOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.LocationListResult + bodyMapper: Mappers.LocationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.includeExtendedLocations], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Subscription + bodyMapper: Mappers.Subscription, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionListResult + bodyMapper: Mappers.SubscriptionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const checkZonePeersOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/checkZonePeers/", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/checkZonePeers/", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CheckZonePeersResult + bodyMapper: Mappers.CheckZonePeersResult, }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } + bodyMapper: Mappers.ErrorResponseAutoGenerated, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionListResult + bodyMapper: Mappers.SubscriptionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/tenants.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/tenants.ts index e7ccb62eed12..1ca29fe03ca3 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/tenants.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/tenants.ts @@ -18,7 +18,7 @@ import { TenantsListNextOptionalParams, TenantsListOptionalParams, TenantsListResponse, - TenantsListNextResponse + TenantsListNextResponse, } from "../models"; /// @@ -39,7 +39,7 @@ export class TenantsImpl implements Tenants { * @param options The options parameters. */ public list( - options?: TenantsListOptionalParams + options?: TenantsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class TenantsImpl implements Tenants { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: TenantsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TenantsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class TenantsImpl implements Tenants { } private async *listPagingAll( - options?: TenantsListOptionalParams + options?: TenantsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class TenantsImpl implements Tenants { * @param options The options parameters. */ private _list( - options?: TenantsListOptionalParams + options?: TenantsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class TenantsImpl implements Tenants { */ private _listNext( nextLink: string, - options?: TenantsListNextOptionalParams + options?: TenantsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,29 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TenantListResult + bodyMapper: Mappers.TenantListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TenantListResult + bodyMapper: Mappers.TenantListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts index ac34435954c0..65cdf8035ab0 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts index 4142f4ea2482..31d2bad21da2 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts @@ -16,7 +16,7 @@ import { SubscriptionsGetResponse, CheckZonePeersRequest, SubscriptionsCheckZonePeersOptionalParams, - SubscriptionsCheckZonePeersResponse + SubscriptionsCheckZonePeersResponse, } from "../models"; /// @@ -30,14 +30,14 @@ export interface Subscriptions { */ listLocations( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all subscriptions for a tenant. * @param options The options parameters. */ list( - options?: SubscriptionsListOptionalParams + options?: SubscriptionsListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets details about a specified subscription. @@ -46,7 +46,7 @@ export interface Subscriptions { */ get( subscriptionId: string, - options?: SubscriptionsGetOptionalParams + options?: SubscriptionsGetOptionalParams, ): Promise; /** * Compares a subscriptions logical zone mapping @@ -57,6 +57,6 @@ export interface Subscriptions { checkZonePeers( subscriptionId: string, parameters: CheckZonePeersRequest, - options?: SubscriptionsCheckZonePeersOptionalParams + options?: SubscriptionsCheckZonePeersOptionalParams, ): Promise; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts index 423790d0f0ac..222c152ed5f1 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts @@ -17,6 +17,6 @@ export interface Tenants { * @param options The options parameters. */ list( - options?: TenantsListOptionalParams + options?: TenantsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts index 406ae23d19bf..5952a6ef8746 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, SubscriptionsImpl, TenantsImpl } from "./operations"; @@ -21,7 +21,7 @@ import * as Mappers from "./models/mappers"; import { SubscriptionClientOptionalParams, CheckResourceNameOptionalParams, - CheckResourceNameResponse + CheckResourceNameResponse, } from "./models"; export class SubscriptionClient extends coreClient.ServiceClient { @@ -35,7 +35,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { */ constructor( credentials: coreAuth.TokenCredential, - options?: SubscriptionClientOptionalParams + options?: SubscriptionClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -47,7 +47,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { } const defaults: SubscriptionClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; const packageDetails = `azsdk-js-arm-resources-subscriptions/2.1.1`; @@ -60,20 +60,21 @@ export class SubscriptionClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,7 +84,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +94,9 @@ export class SubscriptionClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } @@ -117,7 +118,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -131,7 +132,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -142,11 +143,11 @@ export class SubscriptionClient extends coreClient.ServiceClient { * @param options The options parameters. */ checkResourceName( - options?: CheckResourceNameOptionalParams + options?: CheckResourceNameOptionalParams, ): Promise { return this.sendOperationRequest( { options }, - checkResourceNameOperationSpec + checkResourceNameOperationSpec, ); } @@ -162,16 +163,16 @@ const checkResourceNameOperationSpec: coreClient.OperationSpec = { httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CheckResourceNameResult + bodyMapper: Mappers.CheckResourceNameResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.resourceNameDefinition, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; 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..d64be981b694 --- /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..ba97259d3e40 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" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/resources/arm-resources/CHANGELOG.md b/sdk/resources/arm-resources/CHANGELOG.md index 98302bcdc2ab..d39c672a2dc9 100644 --- a/sdk/resources/arm-resources/CHANGELOG.md +++ b/sdk/resources/arm-resources/CHANGELOG.md @@ -1,15 +1,57 @@ # Release History - -## 5.2.1 (Unreleased) - + +## 6.0.0 (2024-12-10) + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation TagsOperations.beginCreateOrUpdateAtScope + - Added operation TagsOperations.beginCreateOrUpdateAtScopeAndWait + - Added operation TagsOperations.beginDeleteAtScope + - Added operation TagsOperations.beginDeleteAtScopeAndWait + - Added operation TagsOperations.beginUpdateAtScope + - Added operation TagsOperations.beginUpdateAtScopeAndWait + - Added Interface DeploymentDiagnosticsDefinition + - Added Interface DeploymentParameter + - Added Interface KeyVaultParameterReference + - Added Interface KeyVaultReference + - Added Interface ResourceGroupsDeleteHeaders + - Added Interface TagsCreateOrUpdateAtScopeHeaders + - Added Interface TagsDeleteAtScopeHeaders + - Added Interface TagsUpdateAtScopeHeaders + - Added Type Alias ExportTemplateOutputFormat + - Added Type Alias Level + - Added Type Alias ValidationLevel + - Interface DeploymentProperties has a new optional parameter validationLevel + - Interface DeploymentPropertiesExtended has a new optional parameter diagnostics + - Interface DeploymentPropertiesExtended has a new optional parameter validationLevel + - Interface ExportTemplateRequest has a new optional parameter outputFormat + - Interface ResourceGroupExportResult has a new optional parameter output + - Interface TagsCreateOrUpdateAtScopeOptionalParams has a new optional parameter resumeFrom + - Interface TagsCreateOrUpdateAtScopeOptionalParams has a new optional parameter updateIntervalInMs + - Interface TagsDeleteAtScopeOptionalParams has a new optional parameter resumeFrom + - Interface TagsDeleteAtScopeOptionalParams has a new optional parameter updateIntervalInMs + - Interface TagsUpdateAtScopeOptionalParams has a new optional parameter resumeFrom + - Interface TagsUpdateAtScopeOptionalParams has a new optional parameter updateIntervalInMs + - Interface WhatIfChange has a new optional parameter deploymentId + - Interface WhatIfChange has a new optional parameter identifiers + - Interface WhatIfChange has a new optional parameter symbolicName + - Interface WhatIfOperationResult has a new optional parameter diagnostics + - Interface WhatIfOperationResult has a new optional parameter potentialChanges + - Added Enum KnownExportTemplateOutputFormat + - Added Enum KnownLevel + - Added Enum KnownValidationLevel -### Other Changes +### Breaking Changes + - Removed operation TagsOperations.createOrUpdateAtScope + - Removed operation TagsOperations.deleteAtScope + - Removed operation TagsOperations.updateAtScope + - Class ResourceManagementClient has a new signature + - Type of parameter parameters of interface DeploymentProperties is changed from Record to { + [propertyName: string]: DeploymentParameter; + } + + ## 5.2.0 (2023-03-13) ### Features Added @@ -51,7 +93,7 @@ ## 5.0.1 (2022-04-18) -### Features Added +**features** - Bug fix @@ -63,4 +105,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/resources/arm-resources/LICENSE b/sdk/resources/arm-resources/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/resources/arm-resources/LICENSE +++ b/sdk/resources/arm-resources/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +Copyright (c) 2024 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/resources/arm-resources/README.md b/sdk/resources/arm-resources/README.md index e8707437a24b..788f225e0019 100644 --- a/sdk/resources/arm-resources/README.md +++ b/sdk/resources/arm-resources/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure ResourceManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json index e588fd1b883e..267db4618701 100644 --- a/sdk/resources/arm-resources/_meta.json +++ b/sdk/resources/arm-resources/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "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.0-rc.9.20230306.1 --generate-sample=true", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.9.20230306.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/resources/arm-resources/package.json b/sdk/resources/arm-resources/package.json index d9aa909beb48..400c9dbc449b 100644 --- a/sdk/resources/arm-resources/package.json +++ b/sdk/resources/arm-resources/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ResourceManagementClient.", - "version": "5.2.1", + "version": "6.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.7.0", - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -28,18 +28,19 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-resources.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -67,28 +68,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -101,13 +102,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources" +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/review/arm-resources.api.md b/sdk/resources/arm-resources/review/arm-resources.api.md index 4d8eb74a80a8..e685fee97ec5 100644 --- a/sdk/resources/arm-resources/review/arm-resources.api.md +++ b/sdk/resources/arm-resources/review/arm-resources.api.md @@ -96,6 +96,15 @@ export interface Deployment { }; } +// @public (undocumented) +export interface DeploymentDiagnosticsDefinition { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code: string; + readonly level: Level; + readonly message: string; + readonly target?: string; +} + // @public export interface DeploymentExportResult { template?: Record; @@ -278,16 +287,25 @@ export interface DeploymentOperationsListResult { value?: DeploymentOperation[]; } +// @public +export interface DeploymentParameter { + reference?: KeyVaultParameterReference; + value?: any; +} + // @public export interface DeploymentProperties { debugSetting?: DebugSetting; expressionEvaluationOptions?: ExpressionEvaluationOptions; mode: DeploymentMode; onErrorDeployment?: OnErrorDeployment; - parameters?: Record; + parameters?: { + [propertyName: string]: DeploymentParameter; + }; parametersLink?: ParametersLink; template?: Record; templateLink?: TemplateLink; + validationLevel?: ValidationLevel; } // @public @@ -295,6 +313,7 @@ export interface DeploymentPropertiesExtended { readonly correlationId?: string; readonly debugSetting?: DebugSetting; readonly dependencies?: Dependency[]; + readonly diagnostics?: DeploymentDiagnosticsDefinition[]; readonly duration?: string; readonly error?: ErrorResponse; readonly mode?: DeploymentMode; @@ -309,6 +328,7 @@ export interface DeploymentPropertiesExtended { readonly templateLink?: TemplateLink; readonly timestamp?: Date; readonly validatedResources?: ResourceReference[]; + validationLevel?: ValidationLevel; } // @public @@ -683,7 +703,7 @@ export interface DeploymentsValidateAtManagementGroupScopeOptionalParams extends } // @public -export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentValidateResult; +export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentExtended; // @public export interface DeploymentsValidateAtScopeOptionalParams extends coreClient.OperationOptions { @@ -692,7 +712,7 @@ export interface DeploymentsValidateAtScopeOptionalParams extends coreClient.Ope } // @public -export type DeploymentsValidateAtScopeResponse = DeploymentValidateResult; +export type DeploymentsValidateAtScopeResponse = DeploymentExtended; // @public export interface DeploymentsValidateAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { @@ -701,7 +721,7 @@ export interface DeploymentsValidateAtSubscriptionScopeOptionalParams extends co } // @public -export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentValidateResult; +export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentExtended; // @public export interface DeploymentsValidateAtTenantScopeOptionalParams extends coreClient.OperationOptions { @@ -710,7 +730,7 @@ export interface DeploymentsValidateAtTenantScopeOptionalParams extends coreClie } // @public -export type DeploymentsValidateAtTenantScopeResponse = DeploymentValidateResult; +export type DeploymentsValidateAtTenantScopeResponse = DeploymentExtended; // @public export interface DeploymentsValidateOptionalParams extends coreClient.OperationOptions { @@ -719,7 +739,7 @@ export interface DeploymentsValidateOptionalParams extends coreClient.OperationO } // @public -export type DeploymentsValidateResponse = DeploymentValidateResult; +export type DeploymentsValidateResponse = DeploymentExtended; // @public export interface DeploymentsWhatIfAtManagementGroupScopeHeaders { @@ -781,12 +801,6 @@ export interface DeploymentsWhatIfOptionalParams extends coreClient.OperationOpt // @public export type DeploymentsWhatIfResponse = WhatIfOperationResult; -// @public -export interface DeploymentValidateResult { - readonly error?: ErrorResponse; - properties?: DeploymentPropertiesExtended; -} - // @public export interface DeploymentWhatIf { location?: string; @@ -818,9 +832,13 @@ export interface ErrorResponse { readonly target?: string; } +// @public +export type ExportTemplateOutputFormat = string; + // @public export interface ExportTemplateRequest { options?: string; + outputFormat?: ExportTemplateOutputFormat; resources?: string[]; } @@ -889,6 +907,18 @@ export interface IdentityUserAssignedIdentitiesValue { readonly principalId?: string; } +// @public +export interface KeyVaultParameterReference { + keyVault: KeyVaultReference; + secretName: string; + secretVersion?: string; +} + +// @public +export interface KeyVaultReference { + id: string; +} + // @public export enum KnownAliasPathAttributes { Modifiable = "Modifiable", @@ -907,6 +937,12 @@ export enum KnownAliasPathTokenType { String = "String" } +// @public +export enum KnownExportTemplateOutputFormat { + Bicep = "Bicep", + Json = "Json" +} + // @public export enum KnownExpressionEvaluationOptionsScopeType { Inner = "Inner", @@ -919,6 +955,13 @@ export enum KnownExtendedLocationType { EdgeZone = "EdgeZone" } +// @public +export enum KnownLevel { + Error = "Error", + Info = "Info", + Warning = "Warning" +} + // @public export enum KnownProviderAuthorizationConsentState { Consented = "Consented", @@ -950,6 +993,16 @@ export enum KnownTagsPatchOperation { Replace = "Replace" } +// @public +export enum KnownValidationLevel { + Provider = "Provider", + ProviderNoRbac = "ProviderNoRbac", + Template = "Template" +} + +// @public +export type Level = string; + // @public export interface OnErrorDeployment { deploymentName?: string; @@ -1235,6 +1288,7 @@ export interface ResourceGroup { // @public export interface ResourceGroupExportResult { error?: ErrorResponse; + output?: string; template?: Record; } @@ -1294,6 +1348,11 @@ export interface ResourceGroupsCreateOrUpdateOptionalParams extends coreClient.O // @public export type ResourceGroupsCreateOrUpdateResponse = ResourceGroup; +// @public +export interface ResourceGroupsDeleteHeaders { + location?: string; +} + // @public export interface ResourceGroupsDeleteOptionalParams extends coreClient.OperationOptions { forceDeletionTypes?: string; @@ -1354,6 +1413,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ResourceManagementClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: ResourceManagementClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -1371,7 +1431,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { // (undocumented) resources: Resources; // (undocumented) - subscriptionId: string; + subscriptionId?: string; // (undocumented) tagsOperations: TagsOperations; } @@ -1621,8 +1681,15 @@ export interface Tags { }; } +// @public +export interface TagsCreateOrUpdateAtScopeHeaders { + location?: string; +} + // @public export interface TagsCreateOrUpdateAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -1642,8 +1709,15 @@ export interface TagsCreateOrUpdateValueOptionalParams extends coreClient.Operat // @public export type TagsCreateOrUpdateValueResponse = TagValue; +// @public +export interface TagsDeleteAtScopeHeaders { + location?: string; +} + // @public export interface TagsDeleteAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -1683,15 +1757,18 @@ export interface TagsListResult { // @public export interface TagsOperations { + beginCreateOrUpdateAtScope(scope: string, parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams): Promise, TagsCreateOrUpdateAtScopeResponse>>; + beginCreateOrUpdateAtScopeAndWait(scope: string, parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams): Promise; + beginDeleteAtScope(scope: string, options?: TagsDeleteAtScopeOptionalParams): Promise, void>>; + beginDeleteAtScopeAndWait(scope: string, options?: TagsDeleteAtScopeOptionalParams): Promise; + beginUpdateAtScope(scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams): Promise, TagsUpdateAtScopeResponse>>; + beginUpdateAtScopeAndWait(scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams): Promise; createOrUpdate(tagName: string, options?: TagsCreateOrUpdateOptionalParams): Promise; - createOrUpdateAtScope(scope: string, parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams): Promise; createOrUpdateValue(tagName: string, tagValue: string, options?: TagsCreateOrUpdateValueOptionalParams): Promise; delete(tagName: string, options?: TagsDeleteOptionalParams): Promise; - deleteAtScope(scope: string, options?: TagsDeleteAtScopeOptionalParams): Promise; deleteValue(tagName: string, tagValue: string, options?: TagsDeleteValueOptionalParams): Promise; getAtScope(scope: string, options?: TagsGetAtScopeOptionalParams): Promise; list(options?: TagsListOptionalParams): PagedAsyncIterableIterator; - updateAtScope(scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams): Promise; } // @public @@ -1711,8 +1788,15 @@ export interface TagsResource { readonly type?: string; } +// @public +export interface TagsUpdateAtScopeHeaders { + location?: string; +} + // @public export interface TagsUpdateAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -1747,20 +1831,28 @@ export interface TemplateLink { uri?: string; } +// @public +export type ValidationLevel = string; + // @public export interface WhatIfChange { after?: Record; before?: Record; changeType: ChangeType; delta?: WhatIfPropertyChange[]; + deploymentId?: string; + identifiers?: Record; resourceId: string; + symbolicName?: string; unsupportedReason?: string; } // @public export interface WhatIfOperationResult { changes?: WhatIfChange[]; + readonly diagnostics?: DeploymentDiagnosticsDefinition[]; error?: ErrorResponse; + potentialChanges?: WhatIfChange[]; status?: string; } diff --git a/sdk/resources/arm-resources/sample.env b/sdk/resources/arm-resources/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/resources/arm-resources/sample.env +++ b/sdk/resources/arm-resources/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/resources/arm-resources/src/lroImpl.ts b/sdk/resources/arm-resources/src/lroImpl.ts index 52f6eaacfb83..5f88efab981b 100644 --- a/sdk/resources/arm-resources/src/lroImpl.ts +++ b/sdk/resources/arm-resources/src/lroImpl.ts @@ -28,15 +28,15 @@ export function createLroSpec(inputs: { sendInitialRequest: () => sendOperationFn(args, spec), sendPollRequest: ( path: string, - options?: { abortSignal?: AbortSignalLike } + options?: { abortSignal?: AbortSignalLike }, ) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 2c57cb76c149..59acf2c10f80 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -102,7 +102,7 @@ export interface DeploymentProperties { /** The URI of the template. Use either the templateLink property or the template property, but not both. */ templateLink?: TemplateLink; /** Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. */ - parameters?: Record; + parameters?: { [propertyName: string]: DeploymentParameter }; /** The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */ parametersLink?: ParametersLink; /** The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. */ @@ -113,6 +113,8 @@ export interface DeploymentProperties { onErrorDeployment?: OnErrorDeployment; /** Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. */ expressionEvaluationOptions?: ExpressionEvaluationOptions; + /** The validation level of the deployment */ + validationLevel?: ValidationLevel; } /** Entity representing the reference to the template. */ @@ -129,6 +131,30 @@ export interface TemplateLink { queryString?: string; } +/** Deployment parameter for the template. */ +export interface DeploymentParameter { + /** Input value to the parameter . */ + value?: any; + /** Azure Key Vault parameter reference. */ + reference?: KeyVaultParameterReference; +} + +/** Azure Key Vault parameter reference. */ +export interface KeyVaultParameterReference { + /** Azure Key Vault reference. */ + keyVault: KeyVaultReference; + /** Azure Key Vault secret name. */ + secretName: string; + /** Azure Key Vault secret version. */ + secretVersion?: string; +} + +/** Azure Key Vault reference. */ +export interface KeyVaultReference { + /** Azure Key Vault resource id. */ + id: string; +} + /** Entity representing the reference to the deployment parameters. */ export interface ParametersLink { /** The URI of the parameters file. */ @@ -269,6 +295,13 @@ export interface DeploymentPropertiesExtended { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly error?: ErrorResponse; + /** + * Contains diagnostic information collected during validation process. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diagnostics?: DeploymentDiagnosticsDefinition[]; + /** The validation level of the deployment */ + validationLevel?: ValidationLevel; } /** Resource provider information. */ @@ -458,15 +491,32 @@ export interface ResourceReference { readonly id?: string; } -/** Information from validate template deployment response. */ -export interface DeploymentValidateResult { +export interface DeploymentDiagnosticsDefinition { /** - * The deployment validation error. + * Denotes the additional response level. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly error?: ErrorResponse; - /** The template deployment properties. */ - properties?: DeploymentPropertiesExtended; + readonly level: Level; + /** + * 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 additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; } /** The deployment export result. */ @@ -518,12 +568,25 @@ export interface WhatIfOperationResult { error?: ErrorResponse; /** List of resource changes predicted by What-If operation. */ changes?: WhatIfChange[]; + /** List of resource changes predicted by What-If operation. */ + potentialChanges?: WhatIfChange[]; + /** + * List of resource diagnostics detected by What-If operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diagnostics?: DeploymentDiagnosticsDefinition[]; } /** Information about a single resource change predicted by What-If operation. */ export interface WhatIfChange { /** Resource ID */ resourceId: string; + /** The resource id of the Deployment responsible for this change. */ + deploymentId?: string; + /** The symbolic name of the resource responsible for this change. */ + symbolicName?: string; + /** A subset of properties that uniquely identify a Bicep extensible resource because it lacks a resource id like an Azure resource has. */ + identifiers?: Record; /** Type of change that will be made to the resource when the deployment is executed. */ changeType: ChangeType; /** The explanation about why the resource is unsupported by What-If. */ @@ -802,12 +865,16 @@ export interface ExportTemplateRequest { resources?: string[]; /** The export template options. A CSV-formatted list containing zero or more of the following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', 'SkipAllParameterization' */ options?: string; + /** The output format for the exported resources. */ + outputFormat?: ExportTemplateOutputFormat; } /** Resource group export result. */ export interface ResourceGroupExportResult { - /** The template content. */ + /** The template content. Used if outputFormat is empty or set to 'Json'. */ template?: Record; + /** The formatted export content. Used if outputFormat is set to 'Bicep'. */ + output?: string; /** The template export error. */ error?: ErrorResponse; } @@ -1143,6 +1210,30 @@ export interface DeploymentsWhatIfHeaders { retryAfter?: string; } +/** Defines headers for ResourceGroups_delete operation. */ +export interface ResourceGroupsDeleteHeaders { + /** URL to get status of this long-running operation. */ + location?: string; +} + +/** Defines headers for Tags_createOrUpdateAtScope operation. */ +export interface TagsCreateOrUpdateAtScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; +} + +/** Defines headers for Tags_updateAtScope operation. */ +export interface TagsUpdateAtScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; +} + +/** Defines headers for Tags_deleteAtScope operation. */ +export interface TagsDeleteAtScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; +} + /** Known values of {@link ExpressionEvaluationOptionsScopeType} that the service accepts. */ export enum KnownExpressionEvaluationOptionsScopeType { /** NotSpecified */ @@ -1150,7 +1241,7 @@ export enum KnownExpressionEvaluationOptionsScopeType { /** Outer */ Outer = "Outer", /** Inner */ - Inner = "Inner" + Inner = "Inner", } /** @@ -1164,6 +1255,27 @@ export enum KnownExpressionEvaluationOptionsScopeType { */ export type ExpressionEvaluationOptionsScopeType = string; +/** Known values of {@link ValidationLevel} that the service accepts. */ +export enum KnownValidationLevel { + /** Static analysis of the template is performed. */ + Template = "Template", + /** Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Validates that the caller has RBAC write permissions on each resource. */ + Provider = "Provider", + /** Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Skips validating that the caller has RBAC write permissions on each resource. */ + ProviderNoRbac = "ProviderNoRbac", +} + +/** + * Defines values for ValidationLevel. \ + * {@link KnownValidationLevel} can be used interchangeably with ValidationLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Template**: Static analysis of the template is performed. \ + * **Provider**: Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Validates that the caller has RBAC write permissions on each resource. \ + * **ProviderNoRbac**: Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Skips validating that the caller has RBAC write permissions on each resource. + */ +export type ValidationLevel = string; + /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { /** NotSpecified */ @@ -1189,7 +1301,7 @@ export enum KnownProvisioningState { /** Succeeded */ Succeeded = "Succeeded", /** Updating */ - Updating = "Updating" + Updating = "Updating", } /** @@ -1229,7 +1341,7 @@ export enum KnownAliasPathTokenType { /** The token type is number. */ Number = "Number", /** The token type is boolean. */ - Boolean = "Boolean" + Boolean = "Boolean", } /** @@ -1253,7 +1365,7 @@ export enum KnownAliasPathAttributes { /** The token that the alias path is referring to has no attributes. */ None = "None", /** The token that the alias path is referring to is modifiable by policies with 'modify' effect. */ - Modifiable = "Modifiable" + Modifiable = "Modifiable", } /** @@ -1275,7 +1387,7 @@ export enum KnownProviderAuthorizationConsentState { /** NotRequired */ NotRequired = "NotRequired", /** Consented */ - Consented = "Consented" + Consented = "Consented", } /** @@ -1290,10 +1402,31 @@ export enum KnownProviderAuthorizationConsentState { */ export type ProviderAuthorizationConsentState = string; +/** Known values of {@link Level} that the service accepts. */ +export enum KnownLevel { + /** Warning */ + Warning = "Warning", + /** Info */ + Info = "Info", + /** Error */ + Error = "Error", +} + +/** + * Defines values for Level. \ + * {@link KnownLevel} can be used interchangeably with Level, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Warning** \ + * **Info** \ + * **Error** + */ +export type Level = string; + /** Known values of {@link ExtendedLocationType} that the service accepts. */ export enum KnownExtendedLocationType { /** EdgeZone */ - EdgeZone = "EdgeZone" + EdgeZone = "EdgeZone", } /** @@ -1305,6 +1438,24 @@ export enum KnownExtendedLocationType { */ export type ExtendedLocationType = string; +/** Known values of {@link ExportTemplateOutputFormat} that the service accepts. */ +export enum KnownExportTemplateOutputFormat { + /** Json */ + Json = "Json", + /** Bicep */ + Bicep = "Bicep", +} + +/** + * Defines values for ExportTemplateOutputFormat. \ + * {@link KnownExportTemplateOutputFormat} can be used interchangeably with ExportTemplateOutputFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Json** \ + * **Bicep** + */ +export type ExportTemplateOutputFormat = string; + /** Known values of {@link TagsPatchOperation} that the service accepts. */ export enum KnownTagsPatchOperation { /** The 'replace' option replaces the entire set of existing tags with a new set. */ @@ -1312,7 +1463,7 @@ export enum KnownTagsPatchOperation { /** The 'merge' option allows adding tags with new names and updating the values of tags with existing names. */ Merge = "Merge", /** The 'delete' option allows selectively deleting tags based on given names or name\/value pairs. */ - Delete = "Delete" + Delete = "Delete", } /** @@ -1435,7 +1586,7 @@ export interface DeploymentsValidateAtScopeOptionalParams } /** Contains response data for the validateAtScope operation. */ -export type DeploymentsValidateAtScopeResponse = DeploymentValidateResult; +export type DeploymentsValidateAtScopeResponse = DeploymentExtended; /** Optional parameters. */ export interface DeploymentsExportTemplateAtScopeOptionalParams @@ -1507,7 +1658,7 @@ export interface DeploymentsValidateAtTenantScopeOptionalParams } /** Contains response data for the validateAtTenantScope operation. */ -export type DeploymentsValidateAtTenantScopeResponse = DeploymentValidateResult; +export type DeploymentsValidateAtTenantScopeResponse = DeploymentExtended; /** Optional parameters. */ export interface DeploymentsWhatIfAtTenantScopeOptionalParams @@ -1526,7 +1677,8 @@ export interface DeploymentsExportTemplateAtTenantScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the exportTemplateAtTenantScope operation. */ -export type DeploymentsExportTemplateAtTenantScopeResponse = DeploymentExportResult; +export type DeploymentsExportTemplateAtTenantScopeResponse = + DeploymentExportResult; /** Optional parameters. */ export interface DeploymentsListAtTenantScopeOptionalParams @@ -1568,7 +1720,8 @@ export interface DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams } /** Contains response data for the createOrUpdateAtManagementGroupScope operation. */ -export type DeploymentsCreateOrUpdateAtManagementGroupScopeResponse = DeploymentExtended; +export type DeploymentsCreateOrUpdateAtManagementGroupScopeResponse = + DeploymentExtended; /** Optional parameters. */ export interface DeploymentsGetAtManagementGroupScopeOptionalParams @@ -1591,7 +1744,8 @@ export interface DeploymentsValidateAtManagementGroupScopeOptionalParams } /** Contains response data for the validateAtManagementGroupScope operation. */ -export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentValidateResult; +export type DeploymentsValidateAtManagementGroupScopeResponse = + DeploymentExtended; /** Optional parameters. */ export interface DeploymentsWhatIfAtManagementGroupScopeOptionalParams @@ -1603,14 +1757,16 @@ export interface DeploymentsWhatIfAtManagementGroupScopeOptionalParams } /** Contains response data for the whatIfAtManagementGroupScope operation. */ -export type DeploymentsWhatIfAtManagementGroupScopeResponse = WhatIfOperationResult; +export type DeploymentsWhatIfAtManagementGroupScopeResponse = + WhatIfOperationResult; /** Optional parameters. */ export interface DeploymentsExportTemplateAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the exportTemplateAtManagementGroupScope operation. */ -export type DeploymentsExportTemplateAtManagementGroupScopeResponse = DeploymentExportResult; +export type DeploymentsExportTemplateAtManagementGroupScopeResponse = + DeploymentExportResult; /** Optional parameters. */ export interface DeploymentsListAtManagementGroupScopeOptionalParams @@ -1622,7 +1778,8 @@ export interface DeploymentsListAtManagementGroupScopeOptionalParams } /** Contains response data for the listAtManagementGroupScope operation. */ -export type DeploymentsListAtManagementGroupScopeResponse = DeploymentListResult; +export type DeploymentsListAtManagementGroupScopeResponse = + DeploymentListResult; /** Optional parameters. */ export interface DeploymentsDeleteAtSubscriptionScopeOptionalParams @@ -1652,7 +1809,8 @@ export interface DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams } /** Contains response data for the createOrUpdateAtSubscriptionScope operation. */ -export type DeploymentsCreateOrUpdateAtSubscriptionScopeResponse = DeploymentExtended; +export type DeploymentsCreateOrUpdateAtSubscriptionScopeResponse = + DeploymentExtended; /** Optional parameters. */ export interface DeploymentsGetAtSubscriptionScopeOptionalParams @@ -1675,7 +1833,7 @@ export interface DeploymentsValidateAtSubscriptionScopeOptionalParams } /** Contains response data for the validateAtSubscriptionScope operation. */ -export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentValidateResult; +export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentExtended; /** Optional parameters. */ export interface DeploymentsWhatIfAtSubscriptionScopeOptionalParams @@ -1687,14 +1845,16 @@ export interface DeploymentsWhatIfAtSubscriptionScopeOptionalParams } /** Contains response data for the whatIfAtSubscriptionScope operation. */ -export type DeploymentsWhatIfAtSubscriptionScopeResponse = WhatIfOperationResult; +export type DeploymentsWhatIfAtSubscriptionScopeResponse = + WhatIfOperationResult; /** Optional parameters. */ export interface DeploymentsExportTemplateAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the exportTemplateAtSubscriptionScope operation. */ -export type DeploymentsExportTemplateAtSubscriptionScopeResponse = DeploymentExportResult; +export type DeploymentsExportTemplateAtSubscriptionScopeResponse = + DeploymentExportResult; /** Optional parameters. */ export interface DeploymentsListAtSubscriptionScopeOptionalParams @@ -1759,7 +1919,7 @@ export interface DeploymentsValidateOptionalParams } /** Contains response data for the validate operation. */ -export type DeploymentsValidateResponse = DeploymentValidateResult; +export type DeploymentsValidateResponse = DeploymentExtended; /** Optional parameters. */ export interface DeploymentsWhatIfOptionalParams @@ -1818,14 +1978,16 @@ export interface DeploymentsListAtManagementGroupScopeNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAtManagementGroupScopeNext operation. */ -export type DeploymentsListAtManagementGroupScopeNextResponse = DeploymentListResult; +export type DeploymentsListAtManagementGroupScopeNextResponse = + DeploymentListResult; /** Optional parameters. */ export interface DeploymentsListAtSubscriptionScopeNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAtSubscriptionScopeNext operation. */ -export type DeploymentsListAtSubscriptionScopeNextResponse = DeploymentListResult; +export type DeploymentsListAtSubscriptionScopeNextResponse = + DeploymentListResult; /** Optional parameters. */ export interface DeploymentsListByResourceGroupNextOptionalParams @@ -1963,7 +2125,7 @@ export interface ResourcesListOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation.

Filter comparison operators include `eq` (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, `plan/version`, and `plan/promotionCode`.

For example, to filter by a resource type, use `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`


`substringof(value, property)` can be used to filter for substrings of the following currently-supported properties: `name` and `resourceGroup`

For example, to get all resources with 'demo' anywhere in the resource name, use `$filter=substringof('demo', name)`

Multiple substring operations can also be combined using `and`/`or` operators.

Note that any truncated number of results queried via `$top` may also not be compatible when using a filter.


Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, the original tags for each resource will not be returned in the results. Any list of additional properties queried via `$expand` may also not be compatible when filtering by tag names/values.

For tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, `departureTime`, etc.)


Note that some properties can be combined when filtering resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. */ filter?: string; - /** The number of results to return. If null is passed, returns all resources. */ + /** The number of recommendations per page if a paged version of this API is being used. */ top?: number; /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ expand?: string; @@ -2185,14 +2347,24 @@ export type TagsListResponse = TagsListResult; /** Optional parameters. */ export interface TagsCreateOrUpdateAtScopeOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Contains response data for the createOrUpdateAtScope operation. */ export type TagsCreateOrUpdateAtScopeResponse = TagsResource; /** Optional parameters. */ export interface TagsUpdateAtScopeOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Contains response data for the updateAtScope operation. */ export type TagsUpdateAtScopeResponse = TagsResource; @@ -2206,7 +2378,12 @@ export type TagsGetAtScopeResponse = TagsResource; /** Optional parameters. */ export interface TagsDeleteAtScopeOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Optional parameters. */ export interface TagsListNextOptionalParams @@ -2230,7 +2407,8 @@ export interface DeploymentOperationsListAtScopeOptionalParams } /** Contains response data for the listAtScope operation. */ -export type DeploymentOperationsListAtScopeResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListAtScopeResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface DeploymentOperationsGetAtTenantScopeOptionalParams @@ -2247,14 +2425,16 @@ export interface DeploymentOperationsListAtTenantScopeOptionalParams } /** Contains response data for the listAtTenantScope operation. */ -export type DeploymentOperationsListAtTenantScopeResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListAtTenantScopeResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface DeploymentOperationsGetAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAtManagementGroupScope operation. */ -export type DeploymentOperationsGetAtManagementGroupScopeResponse = DeploymentOperation; +export type DeploymentOperationsGetAtManagementGroupScopeResponse = + DeploymentOperation; /** Optional parameters. */ export interface DeploymentOperationsListAtManagementGroupScopeOptionalParams @@ -2264,14 +2444,16 @@ export interface DeploymentOperationsListAtManagementGroupScopeOptionalParams } /** Contains response data for the listAtManagementGroupScope operation. */ -export type DeploymentOperationsListAtManagementGroupScopeResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListAtManagementGroupScopeResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface DeploymentOperationsGetAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAtSubscriptionScope operation. */ -export type DeploymentOperationsGetAtSubscriptionScopeResponse = DeploymentOperation; +export type DeploymentOperationsGetAtSubscriptionScopeResponse = + DeploymentOperation; /** Optional parameters. */ export interface DeploymentOperationsListAtSubscriptionScopeOptionalParams @@ -2281,7 +2463,8 @@ export interface DeploymentOperationsListAtSubscriptionScopeOptionalParams } /** Contains response data for the listAtSubscriptionScope operation. */ -export type DeploymentOperationsListAtSubscriptionScopeResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListAtSubscriptionScopeResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface DeploymentOperationsGetOptionalParams @@ -2305,35 +2488,40 @@ export interface DeploymentOperationsListAtScopeNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAtScopeNext operation. */ -export type DeploymentOperationsListAtScopeNextResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListAtScopeNextResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface DeploymentOperationsListAtTenantScopeNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAtTenantScopeNext operation. */ -export type DeploymentOperationsListAtTenantScopeNextResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListAtTenantScopeNextResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface DeploymentOperationsListAtManagementGroupScopeNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAtManagementGroupScopeNext operation. */ -export type DeploymentOperationsListAtManagementGroupScopeNextResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListAtManagementGroupScopeNextResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface DeploymentOperationsListAtSubscriptionScopeNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAtSubscriptionScopeNext operation. */ -export type DeploymentOperationsListAtSubscriptionScopeNextResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListAtSubscriptionScopeNextResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface DeploymentOperationsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type DeploymentOperationsListNextResponse = DeploymentOperationsListResult; +export type DeploymentOperationsListNextResponse = + DeploymentOperationsListResult; /** Optional parameters. */ export interface ResourceManagementClientOptionalParams diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index 851900fc8315..9bc9f3ecabe9 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -20,19 +20,19 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -43,18 +43,18 @@ export const Operation: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - } - } - } + className: "OperationDisplay", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -65,29 +65,29 @@ export const OperationDisplay: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CloudError: coreClient.CompositeMapper = { @@ -99,11 +99,11 @@ export const CloudError: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -115,22 +115,22 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -140,10 +140,10 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" - } - } - } + className: "ErrorResponse", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -153,13 +153,13 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -171,19 +171,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const Deployment: coreClient.CompositeMapper = { @@ -194,25 +194,25 @@ export const Deployment: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "DeploymentProperties" - } + className: "DeploymentProperties", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const DeploymentProperties: coreClient.CompositeMapper = { @@ -224,61 +224,69 @@ export const DeploymentProperties: coreClient.CompositeMapper = { serializedName: "template", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, templateLink: { serializedName: "templateLink", type: { name: "Composite", - className: "TemplateLink" - } + className: "TemplateLink", + }, }, parameters: { serializedName: "parameters", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { + type: { name: "Composite", className: "DeploymentParameter" }, + }, + }, }, parametersLink: { serializedName: "parametersLink", type: { name: "Composite", - className: "ParametersLink" - } + className: "ParametersLink", + }, }, mode: { serializedName: "mode", required: true, type: { name: "Enum", - allowedValues: ["Incremental", "Complete"] - } + allowedValues: ["Incremental", "Complete"], + }, }, debugSetting: { serializedName: "debugSetting", type: { name: "Composite", - className: "DebugSetting" - } + className: "DebugSetting", + }, }, onErrorDeployment: { serializedName: "onErrorDeployment", type: { name: "Composite", - className: "OnErrorDeployment" - } + className: "OnErrorDeployment", + }, }, expressionEvaluationOptions: { serializedName: "expressionEvaluationOptions", type: { name: "Composite", - className: "ExpressionEvaluationOptions" - } - } - } - } + className: "ExpressionEvaluationOptions", + }, + }, + validationLevel: { + serializedName: "validationLevel", + type: { + name: "String", + }, + }, + }, + }, }; export const TemplateLink: coreClient.CompositeMapper = { @@ -289,35 +297,102 @@ export const TemplateLink: coreClient.CompositeMapper = { uri: { serializedName: "uri", type: { - name: "String" - } + name: "String", + }, }, id: { serializedName: "id", type: { - name: "String" - } + name: "String", + }, }, relativePath: { serializedName: "relativePath", type: { - name: "String" - } + name: "String", + }, }, contentVersion: { serializedName: "contentVersion", type: { - name: "String" - } + name: "String", + }, }, queryString: { serializedName: "queryString", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const DeploymentParameter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentParameter", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "any", + }, + }, + reference: { + serializedName: "reference", + type: { + name: "Composite", + className: "KeyVaultParameterReference", + }, + }, + }, + }, +}; + +export const KeyVaultParameterReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyVaultParameterReference", + modelProperties: { + keyVault: { + serializedName: "keyVault", + type: { + name: "Composite", + className: "KeyVaultReference", + }, + }, + secretName: { + serializedName: "secretName", + required: true, + type: { + name: "String", + }, + }, + secretVersion: { + serializedName: "secretVersion", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const KeyVaultReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyVaultReference", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String", + }, + }, + }, + }, }; export const ParametersLink: coreClient.CompositeMapper = { @@ -329,17 +404,17 @@ export const ParametersLink: coreClient.CompositeMapper = { serializedName: "uri", required: true, type: { - name: "String" - } + name: "String", + }, }, contentVersion: { serializedName: "contentVersion", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const DebugSetting: coreClient.CompositeMapper = { @@ -350,11 +425,11 @@ export const DebugSetting: coreClient.CompositeMapper = { detailLevel: { serializedName: "detailLevel", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OnErrorDeployment: coreClient.CompositeMapper = { @@ -366,17 +441,17 @@ export const OnErrorDeployment: coreClient.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: ["LastSuccessful", "SpecificDeployment"] - } + allowedValues: ["LastSuccessful", "SpecificDeployment"], + }, }, deploymentName: { serializedName: "deploymentName", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ExpressionEvaluationOptions: coreClient.CompositeMapper = { @@ -387,11 +462,11 @@ export const ExpressionEvaluationOptions: coreClient.CompositeMapper = { scope: { serializedName: "scope", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const DeploymentExtended: coreClient.CompositeMapper = { @@ -403,45 +478,45 @@ export const DeploymentExtended: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "DeploymentPropertiesExtended" - } + className: "DeploymentPropertiesExtended", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const DeploymentPropertiesExtended: coreClient.CompositeMapper = { @@ -453,37 +528,37 @@ export const DeploymentPropertiesExtended: coreClient.CompositeMapper = { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, correlationId: { serializedName: "correlationId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, timestamp: { serializedName: "timestamp", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, duration: { serializedName: "duration", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, outputs: { serializedName: "outputs", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, providers: { serializedName: "providers", @@ -493,10 +568,10 @@ export const DeploymentPropertiesExtended: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Provider" - } - } - } + className: "Provider", + }, + }, + }, }, dependencies: { serializedName: "dependencies", @@ -506,61 +581,61 @@ export const DeploymentPropertiesExtended: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Dependency" - } - } - } + className: "Dependency", + }, + }, + }, }, templateLink: { serializedName: "templateLink", type: { name: "Composite", - className: "TemplateLink" - } + className: "TemplateLink", + }, }, parameters: { serializedName: "parameters", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, parametersLink: { serializedName: "parametersLink", type: { name: "Composite", - className: "ParametersLink" - } + className: "ParametersLink", + }, }, mode: { serializedName: "mode", readOnly: true, type: { name: "Enum", - allowedValues: ["Incremental", "Complete"] - } + allowedValues: ["Incremental", "Complete"], + }, }, debugSetting: { serializedName: "debugSetting", type: { name: "Composite", - className: "DebugSetting" - } + className: "DebugSetting", + }, }, onErrorDeployment: { serializedName: "onErrorDeployment", type: { name: "Composite", - className: "OnErrorDeploymentExtended" - } + className: "OnErrorDeploymentExtended", + }, }, templateHash: { serializedName: "templateHash", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, outputResources: { serializedName: "outputResources", @@ -570,10 +645,10 @@ export const DeploymentPropertiesExtended: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceReference" - } - } - } + className: "ResourceReference", + }, + }, + }, }, validatedResources: { serializedName: "validatedResources", @@ -583,20 +658,39 @@ export const DeploymentPropertiesExtended: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceReference" - } - } - } + className: "ResourceReference", + }, + }, + }, }, error: { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + diagnostics: { + serializedName: "diagnostics", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeploymentDiagnosticsDefinition", + }, + }, + }, + }, + validationLevel: { + serializedName: "validationLevel", + type: { + name: "String", + }, + }, + }, + }, }; export const Provider: coreClient.CompositeMapper = { @@ -608,28 +702,28 @@ export const Provider: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, namespace: { serializedName: "namespace", type: { - name: "String" - } + name: "String", + }, }, registrationState: { serializedName: "registrationState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, registrationPolicy: { serializedName: "registrationPolicy", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resourceTypes: { serializedName: "resourceTypes", @@ -639,19 +733,19 @@ export const Provider: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ProviderResourceType" - } - } - } + className: "ProviderResourceType", + }, + }, + }, }, providerAuthorizationConsentState: { serializedName: "providerAuthorizationConsentState", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ProviderResourceType: coreClient.CompositeMapper = { @@ -662,8 +756,8 @@ export const ProviderResourceType: coreClient.CompositeMapper = { resourceType: { serializedName: "resourceType", type: { - name: "String" - } + name: "String", + }, }, locations: { serializedName: "locations", @@ -671,10 +765,10 @@ export const ProviderResourceType: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, locationMappings: { serializedName: "locationMappings", @@ -683,10 +777,10 @@ export const ProviderResourceType: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ProviderExtendedLocation" - } - } - } + className: "ProviderExtendedLocation", + }, + }, + }, }, aliases: { serializedName: "aliases", @@ -695,10 +789,10 @@ export const ProviderResourceType: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Alias" - } - } - } + className: "Alias", + }, + }, + }, }, apiVersions: { serializedName: "apiVersions", @@ -706,17 +800,17 @@ export const ProviderResourceType: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, defaultApiVersion: { serializedName: "defaultApiVersion", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, zoneMappings: { serializedName: "zoneMappings", @@ -725,10 +819,10 @@ export const ProviderResourceType: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ZoneMapping" - } - } - } + className: "ZoneMapping", + }, + }, + }, }, apiProfiles: { serializedName: "apiProfiles", @@ -738,26 +832,26 @@ export const ProviderResourceType: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ApiProfile" - } - } - } + className: "ApiProfile", + }, + }, + }, }, capabilities: { serializedName: "capabilities", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const ProviderExtendedLocation: coreClient.CompositeMapper = { @@ -768,14 +862,14 @@ export const ProviderExtendedLocation: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, extendedLocations: { serializedName: "extendedLocations", @@ -783,13 +877,13 @@ export const ProviderExtendedLocation: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const Alias: coreClient.CompositeMapper = { @@ -800,8 +894,8 @@ export const Alias: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, paths: { serializedName: "paths", @@ -810,40 +904,40 @@ export const Alias: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AliasPath" - } - } - } + className: "AliasPath", + }, + }, + }, }, type: { serializedName: "type", type: { name: "Enum", - allowedValues: ["NotSpecified", "PlainText", "Mask"] - } + allowedValues: ["NotSpecified", "PlainText", "Mask"], + }, }, defaultPath: { serializedName: "defaultPath", type: { - name: "String" - } + name: "String", + }, }, defaultPattern: { serializedName: "defaultPattern", type: { name: "Composite", - className: "AliasPattern" - } + className: "AliasPattern", + }, }, defaultMetadata: { serializedName: "defaultMetadata", type: { name: "Composite", - className: "AliasPathMetadata" - } - } - } - } + className: "AliasPathMetadata", + }, + }, + }, + }, }; export const AliasPath: coreClient.CompositeMapper = { @@ -854,8 +948,8 @@ export const AliasPath: coreClient.CompositeMapper = { path: { serializedName: "path", type: { - name: "String" - } + name: "String", + }, }, apiVersions: { serializedName: "apiVersions", @@ -863,27 +957,27 @@ export const AliasPath: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, pattern: { serializedName: "pattern", type: { name: "Composite", - className: "AliasPattern" - } + className: "AliasPattern", + }, }, metadata: { serializedName: "metadata", type: { name: "Composite", - className: "AliasPathMetadata" - } - } - } - } + className: "AliasPathMetadata", + }, + }, + }, + }, }; export const AliasPattern: coreClient.CompositeMapper = { @@ -894,24 +988,24 @@ export const AliasPattern: coreClient.CompositeMapper = { phrase: { serializedName: "phrase", type: { - name: "String" - } + name: "String", + }, }, variable: { serializedName: "variable", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { name: "Enum", - allowedValues: ["NotSpecified", "Extract"] - } - } - } - } + allowedValues: ["NotSpecified", "Extract"], + }, + }, + }, + }, }; export const AliasPathMetadata: coreClient.CompositeMapper = { @@ -923,18 +1017,18 @@ export const AliasPathMetadata: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, attributes: { serializedName: "attributes", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ZoneMapping: coreClient.CompositeMapper = { @@ -945,8 +1039,8 @@ export const ZoneMapping: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, zones: { serializedName: "zones", @@ -954,13 +1048,13 @@ export const ZoneMapping: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const ApiProfile: coreClient.CompositeMapper = { @@ -972,18 +1066,18 @@ export const ApiProfile: coreClient.CompositeMapper = { serializedName: "profileVersion", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, apiVersion: { serializedName: "apiVersion", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Dependency: coreClient.CompositeMapper = { @@ -998,31 +1092,31 @@ export const Dependency: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "BasicDependency" - } - } - } + className: "BasicDependency", + }, + }, + }, }, id: { serializedName: "id", type: { - name: "String" - } + name: "String", + }, }, resourceType: { serializedName: "resourceType", type: { - name: "String" - } + name: "String", + }, }, resourceName: { serializedName: "resourceName", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const BasicDependency: coreClient.CompositeMapper = { @@ -1033,23 +1127,23 @@ export const BasicDependency: coreClient.CompositeMapper = { id: { serializedName: "id", type: { - name: "String" - } + name: "String", + }, }, resourceType: { serializedName: "resourceType", type: { - name: "String" - } + name: "String", + }, }, resourceName: { serializedName: "resourceName", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OnErrorDeploymentExtended: coreClient.CompositeMapper = { @@ -1061,24 +1155,24 @@ export const OnErrorDeploymentExtended: coreClient.CompositeMapper = { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { name: "Enum", - allowedValues: ["LastSuccessful", "SpecificDeployment"] - } + allowedValues: ["LastSuccessful", "SpecificDeployment"], + }, }, deploymentName: { serializedName: "deploymentName", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceReference: coreClient.CompositeMapper = { @@ -1090,34 +1184,64 @@ export const ResourceReference: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DeploymentValidateResult: coreClient.CompositeMapper = { +export const DeploymentDiagnosticsDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentValidateResult", + className: "DeploymentDiagnosticsDefinition", modelProperties: { - error: { - serializedName: "error", + level: { + serializedName: "level", + required: true, + readOnly: true, type: { - name: "Composite", - className: "ErrorResponse" - } + name: "String", + }, }, - properties: { - serializedName: "properties", + code: { + serializedName: "code", + required: true, + readOnly: true, type: { - name: "Composite", - className: "DeploymentPropertiesExtended" - } - } - } - } + name: "String", + }, + }, + message: { + serializedName: "message", + required: true, + readOnly: true, + type: { + name: "String", + }, + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String", + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const DeploymentExportResult: coreClient.CompositeMapper = { @@ -1129,11 +1253,11 @@ export const DeploymentExportResult: coreClient.CompositeMapper = { serializedName: "template", type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const DeploymentListResult: coreClient.CompositeMapper = { @@ -1148,20 +1272,20 @@ export const DeploymentListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "DeploymentExtended" - } - } - } + className: "DeploymentExtended", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ScopedDeployment: coreClient.CompositeMapper = { @@ -1173,25 +1297,25 @@ export const ScopedDeployment: coreClient.CompositeMapper = { serializedName: "location", required: true, type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "DeploymentProperties" - } + className: "DeploymentProperties", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const ScopedDeploymentWhatIf: coreClient.CompositeMapper = { @@ -1203,18 +1327,18 @@ export const ScopedDeploymentWhatIf: coreClient.CompositeMapper = { serializedName: "location", required: true, type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "DeploymentWhatIfProperties" - } - } - } - } + className: "DeploymentWhatIfProperties", + }, + }, + }, + }, }; export const DeploymentWhatIfSettings: coreClient.CompositeMapper = { @@ -1226,11 +1350,11 @@ export const DeploymentWhatIfSettings: coreClient.CompositeMapper = { serializedName: "resultFormat", type: { name: "Enum", - allowedValues: ["ResourceIdOnly", "FullResourcePayloads"] - } - } - } - } + allowedValues: ["ResourceIdOnly", "FullResourcePayloads"], + }, + }, + }, + }, }; export const WhatIfOperationResult: coreClient.CompositeMapper = { @@ -1241,15 +1365,15 @@ export const WhatIfOperationResult: coreClient.CompositeMapper = { status: { serializedName: "status", type: { - name: "String" - } + name: "String", + }, }, error: { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } + className: "ErrorResponse", + }, }, changes: { serializedName: "properties.changes", @@ -1258,13 +1382,38 @@ export const WhatIfOperationResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "WhatIfChange" - } - } - } - } - } - } + className: "WhatIfChange", + }, + }, + }, + }, + potentialChanges: { + serializedName: "properties.potentialChanges", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WhatIfChange", + }, + }, + }, + }, + diagnostics: { + serializedName: "properties.diagnostics", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeploymentDiagnosticsDefinition", + }, + }, + }, + }, + }, + }, }; export const WhatIfChange: coreClient.CompositeMapper = { @@ -1276,8 +1425,27 @@ export const WhatIfChange: coreClient.CompositeMapper = { serializedName: "resourceId", required: true, type: { - name: "String" - } + name: "String", + }, + }, + deploymentId: { + serializedName: "deploymentId", + type: { + name: "String", + }, + }, + symbolicName: { + serializedName: "symbolicName", + type: { + name: "String", + }, + }, + identifiers: { + serializedName: "identifiers", + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, }, changeType: { serializedName: "changeType", @@ -1291,29 +1459,29 @@ export const WhatIfChange: coreClient.CompositeMapper = { "Deploy", "NoChange", "Modify", - "Unsupported" - ] - } + "Unsupported", + ], + }, }, unsupportedReason: { serializedName: "unsupportedReason", type: { - name: "String" - } + name: "String", + }, }, before: { serializedName: "before", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, after: { serializedName: "after", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, delta: { serializedName: "delta", @@ -1322,13 +1490,13 @@ export const WhatIfChange: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "WhatIfPropertyChange" - } - } - } - } - } - } + className: "WhatIfPropertyChange", + }, + }, + }, + }, + }, + }, }; export const WhatIfPropertyChange: coreClient.CompositeMapper = { @@ -1340,30 +1508,30 @@ export const WhatIfPropertyChange: coreClient.CompositeMapper = { serializedName: "path", required: true, type: { - name: "String" - } + name: "String", + }, }, propertyChangeType: { serializedName: "propertyChangeType", required: true, type: { name: "Enum", - allowedValues: ["Create", "Delete", "Modify", "Array", "NoEffect"] - } + allowedValues: ["Create", "Delete", "Modify", "Array", "NoEffect"], + }, }, before: { serializedName: "before", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, after: { serializedName: "after", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, children: { serializedName: "children", @@ -1372,13 +1540,13 @@ export const WhatIfPropertyChange: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "WhatIfPropertyChange" - } - } - } - } - } - } + className: "WhatIfPropertyChange", + }, + }, + }, + }, + }, + }, }; export const DeploymentWhatIf: coreClient.CompositeMapper = { @@ -1389,18 +1557,18 @@ export const DeploymentWhatIf: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "DeploymentWhatIfProperties" - } - } - } - } + className: "DeploymentWhatIfProperties", + }, + }, + }, + }, }; export const ProviderPermissionListResult: coreClient.CompositeMapper = { @@ -1415,20 +1583,20 @@ export const ProviderPermissionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ProviderPermission" - } - } - } + className: "ProviderPermission", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ProviderPermission: coreClient.CompositeMapper = { @@ -1439,31 +1607,31 @@ export const ProviderPermission: coreClient.CompositeMapper = { applicationId: { serializedName: "applicationId", type: { - name: "String" - } + name: "String", + }, }, roleDefinition: { serializedName: "roleDefinition", type: { name: "Composite", - className: "RoleDefinition" - } + className: "RoleDefinition", + }, }, managedByRoleDefinition: { serializedName: "managedByRoleDefinition", type: { name: "Composite", - className: "RoleDefinition" - } + className: "RoleDefinition", + }, }, providerAuthorizationConsentState: { serializedName: "providerAuthorizationConsentState", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const RoleDefinition: coreClient.CompositeMapper = { @@ -1474,20 +1642,20 @@ export const RoleDefinition: coreClient.CompositeMapper = { id: { serializedName: "id", type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, isServiceRole: { serializedName: "isServiceRole", type: { - name: "Boolean" - } + name: "Boolean", + }, }, permissions: { serializedName: "permissions", @@ -1496,10 +1664,10 @@ export const RoleDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Permission" - } - } - } + className: "Permission", + }, + }, + }, }, scopes: { serializedName: "scopes", @@ -1507,13 +1675,13 @@ export const RoleDefinition: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const Permission: coreClient.CompositeMapper = { @@ -1527,10 +1695,10 @@ export const Permission: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, notActions: { serializedName: "notActions", @@ -1538,10 +1706,10 @@ export const Permission: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, dataActions: { serializedName: "dataActions", @@ -1549,10 +1717,10 @@ export const Permission: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, notDataActions: { serializedName: "notDataActions", @@ -1560,13 +1728,13 @@ export const Permission: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const ProviderRegistrationRequest: coreClient.CompositeMapper = { @@ -1578,11 +1746,11 @@ export const ProviderRegistrationRequest: coreClient.CompositeMapper = { serializedName: "thirdPartyProviderConsent", type: { name: "Composite", - className: "ProviderConsentDefinition" - } - } - } - } + className: "ProviderConsentDefinition", + }, + }, + }, + }, }; export const ProviderConsentDefinition: coreClient.CompositeMapper = { @@ -1593,11 +1761,11 @@ export const ProviderConsentDefinition: coreClient.CompositeMapper = { consentToAuthorization: { serializedName: "consentToAuthorization", type: { - name: "Boolean" - } - } - } - } + name: "Boolean", + }, + }, + }, + }, }; export const ProviderListResult: coreClient.CompositeMapper = { @@ -1612,20 +1780,20 @@ export const ProviderListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Provider" - } - } - } + className: "Provider", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ProviderResourceTypeListResult: coreClient.CompositeMapper = { @@ -1640,20 +1808,20 @@ export const ProviderResourceTypeListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ProviderResourceType" - } - } - } + className: "ProviderResourceType", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceListResult: coreClient.CompositeMapper = { @@ -1668,20 +1836,20 @@ export const ResourceListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "GenericResourceExpanded" - } - } - } + className: "GenericResourceExpanded", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Plan: coreClient.CompositeMapper = { @@ -1692,35 +1860,35 @@ export const Plan: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, publisher: { serializedName: "publisher", type: { - name: "String" - } + name: "String", + }, }, product: { serializedName: "product", type: { - name: "String" - } + name: "String", + }, }, promotionCode: { serializedName: "promotionCode", type: { - name: "String" - } + name: "String", + }, }, version: { serializedName: "version", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Sku: coreClient.CompositeMapper = { @@ -1731,41 +1899,41 @@ export const Sku: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, tier: { serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, size: { serializedName: "size", type: { - name: "String" - } + name: "String", + }, }, family: { serializedName: "family", type: { - name: "String" - } + name: "String", + }, }, model: { serializedName: "model", type: { - name: "String" - } + name: "String", + }, }, capacity: { serializedName: "capacity", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; export const Identity: coreClient.CompositeMapper = { @@ -1777,15 +1945,15 @@ export const Identity: coreClient.CompositeMapper = { serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", @@ -1795,9 +1963,9 @@ export const Identity: coreClient.CompositeMapper = { "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", - "None" - ] - } + "None", + ], + }, }, userAssignedIdentities: { serializedName: "userAssignedIdentities", @@ -1806,13 +1974,13 @@ export const Identity: coreClient.CompositeMapper = { value: { type: { name: "Composite", - className: "IdentityUserAssignedIdentitiesValue" - } - } - } - } - } - } + className: "IdentityUserAssignedIdentitiesValue", + }, + }, + }, + }, + }, + }, }; export const IdentityUserAssignedIdentitiesValue: coreClient.CompositeMapper = { @@ -1824,18 +1992,18 @@ export const IdentityUserAssignedIdentitiesValue: coreClient.CompositeMapper = { serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, clientId: { serializedName: "clientId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -1847,45 +2015,45 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, extendedLocation: { serializedName: "extendedLocation", type: { name: "Composite", - className: "ExtendedLocation" - } + className: "ExtendedLocation", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const ExtendedLocation: coreClient.CompositeMapper = { @@ -1896,17 +2064,17 @@ export const ExtendedLocation: coreClient.CompositeMapper = { type: { serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceGroup: coreClient.CompositeMapper = { @@ -1918,52 +2086,52 @@ export const ResourceGroup: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "ResourceGroupProperties" - } + className: "ResourceGroupProperties", + }, }, location: { serializedName: "location", required: true, type: { - name: "String" - } + name: "String", + }, }, managedBy: { serializedName: "managedBy", type: { - name: "String" - } + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const ResourceGroupProperties: coreClient.CompositeMapper = { @@ -1975,11 +2143,11 @@ export const ResourceGroupProperties: coreClient.CompositeMapper = { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceGroupPatchable: coreClient.CompositeMapper = { @@ -1990,31 +2158,31 @@ export const ResourceGroupPatchable: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "ResourceGroupProperties" - } + className: "ResourceGroupProperties", + }, }, managedBy: { serializedName: "managedBy", type: { - name: "String" - } + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const ExportTemplateRequest: coreClient.CompositeMapper = { @@ -2028,19 +2196,25 @@ export const ExportTemplateRequest: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, options: { serializedName: "options", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + outputFormat: { + serializedName: "outputFormat", + type: { + name: "String", + }, + }, + }, + }, }; export const ResourceGroupExportResult: coreClient.CompositeMapper = { @@ -2052,18 +2226,24 @@ export const ResourceGroupExportResult: coreClient.CompositeMapper = { serializedName: "template", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, + }, + output: { + serializedName: "output", + type: { + name: "String", + }, }, error: { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + }, + }, }; export const ResourceGroupListResult: coreClient.CompositeMapper = { @@ -2078,20 +2258,20 @@ export const ResourceGroupListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceGroup" - } - } - } + className: "ResourceGroup", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourcesMoveInfo: coreClient.CompositeMapper = { @@ -2105,19 +2285,19 @@ export const ResourcesMoveInfo: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, targetResourceGroup: { serializedName: "targetResourceGroup", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TagValue: coreClient.CompositeMapper = { @@ -2129,24 +2309,24 @@ export const TagValue: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tagValue: { serializedName: "tagValue", type: { - name: "String" - } + name: "String", + }, }, count: { serializedName: "count", type: { name: "Composite", - className: "TagCount" - } - } - } - } + className: "TagCount", + }, + }, + }, + }, }; export const TagCount: coreClient.CompositeMapper = { @@ -2157,17 +2337,17 @@ export const TagCount: coreClient.CompositeMapper = { type: { serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; export const TagDetails: coreClient.CompositeMapper = { @@ -2179,21 +2359,21 @@ export const TagDetails: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tagName: { serializedName: "tagName", type: { - name: "String" - } + name: "String", + }, }, count: { serializedName: "count", type: { name: "Composite", - className: "TagCount" - } + className: "TagCount", + }, }, values: { serializedName: "values", @@ -2202,13 +2382,13 @@ export const TagDetails: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TagValue" - } - } - } - } - } - } + className: "TagValue", + }, + }, + }, + }, + }, + }, }; export const TagsListResult: coreClient.CompositeMapper = { @@ -2223,20 +2403,20 @@ export const TagsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TagDetails" - } - } - } + className: "TagDetails", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const DeploymentOperation: coreClient.CompositeMapper = { @@ -2248,25 +2428,25 @@ export const DeploymentOperation: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operationId: { serializedName: "operationId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "DeploymentOperationProperties" - } - } - } - } + className: "DeploymentOperationProperties", + }, + }, + }, + }, }; export const DeploymentOperationProperties: coreClient.CompositeMapper = { @@ -2289,75 +2469,75 @@ export const DeploymentOperationProperties: coreClient.CompositeMapper = { "Action", "Read", "EvaluateDeploymentOutput", - "DeploymentCleanup" - ] - } + "DeploymentCleanup", + ], + }, }, provisioningState: { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, timestamp: { serializedName: "timestamp", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, duration: { serializedName: "duration", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, serviceRequestId: { serializedName: "serviceRequestId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, statusCode: { serializedName: "statusCode", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, statusMessage: { serializedName: "statusMessage", type: { name: "Composite", - className: "StatusMessage" - } + className: "StatusMessage", + }, }, targetResource: { serializedName: "targetResource", type: { name: "Composite", - className: "TargetResource" - } + className: "TargetResource", + }, }, request: { serializedName: "request", type: { name: "Composite", - className: "HttpMessage" - } + className: "HttpMessage", + }, }, response: { serializedName: "response", type: { name: "Composite", - className: "HttpMessage" - } - } - } - } + className: "HttpMessage", + }, + }, + }, + }, }; export const StatusMessage: coreClient.CompositeMapper = { @@ -2368,18 +2548,18 @@ export const StatusMessage: coreClient.CompositeMapper = { status: { serializedName: "status", type: { - name: "String" - } + name: "String", + }, }, error: { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + }, + }, }; export const TargetResource: coreClient.CompositeMapper = { @@ -2390,23 +2570,23 @@ export const TargetResource: coreClient.CompositeMapper = { id: { serializedName: "id", type: { - name: "String" - } + name: "String", + }, }, resourceName: { serializedName: "resourceName", type: { - name: "String" - } + name: "String", + }, }, resourceType: { serializedName: "resourceType", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const HttpMessage: coreClient.CompositeMapper = { @@ -2418,11 +2598,11 @@ export const HttpMessage: coreClient.CompositeMapper = { serializedName: "content", type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const DeploymentOperationsListResult: coreClient.CompositeMapper = { @@ -2437,20 +2617,20 @@ export const DeploymentOperationsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "DeploymentOperation" - } - } - } + className: "DeploymentOperation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TemplateHashResult: coreClient.CompositeMapper = { @@ -2461,17 +2641,17 @@ export const TemplateHashResult: coreClient.CompositeMapper = { minifiedTemplate: { serializedName: "minifiedTemplate", type: { - name: "String" - } + name: "String", + }, }, templateHash: { serializedName: "templateHash", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TagsResource: coreClient.CompositeMapper = { @@ -2483,32 +2663,32 @@ export const TagsResource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "Tags" - } - } - } - } + className: "Tags", + }, + }, + }, + }, }; export const Tags: coreClient.CompositeMapper = { @@ -2520,11 +2700,11 @@ export const Tags: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const TagsPatchResource: coreClient.CompositeMapper = { @@ -2535,18 +2715,18 @@ export const TagsPatchResource: coreClient.CompositeMapper = { operation: { serializedName: "operation", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "Tags" - } - } - } - } + className: "Tags", + }, + }, + }, + }, }; export const DeploymentExtendedFilter: coreClient.CompositeMapper = { @@ -2557,11 +2737,11 @@ export const DeploymentExtendedFilter: coreClient.CompositeMapper = { provisioningState: { serializedName: "provisioningState", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const GenericResourceFilter: coreClient.CompositeMapper = { @@ -2572,23 +2752,23 @@ export const GenericResourceFilter: coreClient.CompositeMapper = { resourceType: { serializedName: "resourceType", type: { - name: "String" - } + name: "String", + }, }, tagname: { serializedName: "tagname", type: { - name: "String" - } + name: "String", + }, }, tagvalue: { serializedName: "tagvalue", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceGroupFilter: coreClient.CompositeMapper = { @@ -2599,57 +2779,58 @@ export const ResourceGroupFilter: coreClient.CompositeMapper = { tagName: { serializedName: "tagName", type: { - name: "String" - } + name: "String", + }, }, tagValue: { serializedName: "tagValue", type: { - name: "String" - } - } - } - } -}; - -export const ResourceProviderOperationDisplayProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceProviderOperationDisplayProperties", - modelProperties: { - publisher: { - serializedName: "publisher", - type: { - name: "String" - } - }, - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } + name: "String", + }, }, - operation: { - serializedName: "operation", - type: { - name: "String" - } + }, + }, +}; + +export const ResourceProviderOperationDisplayProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ResourceProviderOperationDisplayProperties", + modelProperties: { + publisher: { + serializedName: "publisher", + type: { + name: "String", + }, + }, + provider: { + serializedName: "provider", + type: { + name: "String", + }, + }, + resource: { + serializedName: "resource", + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + type: { + name: "String", + }, + }, }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; + }, + }; export const SubResource: coreClient.CompositeMapper = { type: { @@ -2659,11 +2840,11 @@ export const SubResource: coreClient.CompositeMapper = { id: { serializedName: "id", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const DeploymentWhatIfProperties: coreClient.CompositeMapper = { @@ -2676,11 +2857,11 @@ export const DeploymentWhatIfProperties: coreClient.CompositeMapper = { serializedName: "whatIfSettings", type: { name: "Composite", - className: "DeploymentWhatIfSettings" - } - } - } - } + className: "DeploymentWhatIfSettings", + }, + }, + }, + }, }; export const GenericResource: coreClient.CompositeMapper = { @@ -2693,47 +2874,47 @@ export const GenericResource: coreClient.CompositeMapper = { serializedName: "plan", type: { name: "Composite", - className: "Plan" - } + className: "Plan", + }, }, properties: { serializedName: "properties", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, kind: { constraints: { - Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$") + Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$"), }, serializedName: "kind", type: { - name: "String" - } + name: "String", + }, }, managedBy: { serializedName: "managedBy", type: { - name: "String" - } + name: "String", + }, }, sku: { serializedName: "sku", type: { name: "Composite", - className: "Sku" - } + className: "Sku", + }, }, identity: { serializedName: "identity", type: { name: "Composite", - className: "Identity" - } - } - } - } + className: "Identity", + }, + }, + }, + }, }; export const GenericResourceExpanded: coreClient.CompositeMapper = { @@ -2746,107 +2927,170 @@ export const GenericResourceExpanded: coreClient.CompositeMapper = { serializedName: "createdTime", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, changedTime: { serializedName: "changedTime", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, provisioningState: { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } - } - } - } -}; + name: "String", + }, + }, + }, + }, +}; + +export const DeploymentsWhatIfAtTenantScopeHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DeploymentsWhatIfAtTenantScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const DeploymentsWhatIfAtManagementGroupScopeHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DeploymentsWhatIfAtManagementGroupScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const DeploymentsWhatIfAtSubscriptionScopeHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DeploymentsWhatIfAtSubscriptionScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String", + }, + }, + }, + }, + }; -export const DeploymentsWhatIfAtTenantScopeHeaders: coreClient.CompositeMapper = { +export const DeploymentsWhatIfHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentsWhatIfAtTenantScopeHeaders", + className: "DeploymentsWhatIfHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DeploymentsWhatIfAtManagementGroupScopeHeaders: coreClient.CompositeMapper = { +export const ResourceGroupsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentsWhatIfAtManagementGroupScopeHeaders", + className: "ResourceGroupsDeleteHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const DeploymentsWhatIfAtSubscriptionScopeHeaders: coreClient.CompositeMapper = { +export const TagsCreateOrUpdateAtScopeHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentsWhatIfAtSubscriptionScopeHeaders", + className: "TagsCreateOrUpdateAtScopeHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const DeploymentsWhatIfHeaders: coreClient.CompositeMapper = { +export const TagsUpdateAtScopeHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentsWhatIfHeaders", + className: "TagsUpdateAtScopeHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - retryAfter: { - serializedName: "retry-after", + }, + }, +}; + +export const TagsDeleteAtScopeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsDeleteAtScopeHeaders", + modelProperties: { + location: { + serializedName: "location", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/resources/arm-resources/src/models/parameters.ts b/sdk/resources/arm-resources/src/models/parameters.ts index 4e19dc1f6919..4831cb95af5e 100644 --- a/sdk/resources/arm-resources/src/models/parameters.ts +++ b/sdk/resources/arm-resources/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { Deployment as DeploymentMapper, @@ -23,7 +23,7 @@ import { ResourceGroupPatchable as ResourceGroupPatchableMapper, ExportTemplateRequest as ExportTemplateRequestMapper, TagsResource as TagsResourceMapper, - TagsPatchResource as TagsPatchResourceMapper + TagsPatchResource as TagsPatchResourceMapper, } from "../models/mappers"; export const accept: OperationParameter = { @@ -33,9 +33,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -44,22 +44,22 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-04-01", + defaultValue: "2024-11-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -68,10 +68,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const scope: OperationURLParameter = { @@ -80,10 +80,10 @@ export const scope: OperationURLParameter = { serializedName: "scope", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const deploymentName: OperationURLParameter = { @@ -92,14 +92,14 @@ export const deploymentName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 64, - MinLength: 1 + MinLength: 1, }, serializedName: "deploymentName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -109,14 +109,14 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: DeploymentMapper + mapper: DeploymentMapper, }; export const filter: OperationQueryParameter = { @@ -124,9 +124,9 @@ export const filter: OperationQueryParameter = { mapper: { serializedName: "$filter", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const top: OperationQueryParameter = { @@ -134,19 +134,19 @@ export const top: OperationQueryParameter = { mapper: { serializedName: "$top", type: { - name: "Number" - } - } + name: "Number", + }, + }, }; export const parameters1: OperationParameter = { parameterPath: "parameters", - mapper: ScopedDeploymentMapper + mapper: ScopedDeploymentMapper, }; export const parameters2: OperationParameter = { parameterPath: "parameters", - mapper: ScopedDeploymentWhatIfMapper + mapper: ScopedDeploymentWhatIfMapper, }; export const groupId: OperationURLParameter = { @@ -154,14 +154,14 @@ export const groupId: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "groupId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionId: OperationURLParameter = { @@ -170,14 +170,14 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: DeploymentWhatIfMapper + mapper: DeploymentWhatIfMapper, }; export const resourceGroupName: OperationURLParameter = { @@ -186,14 +186,14 @@ export const resourceGroupName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const template: OperationParameter = { @@ -203,9 +203,9 @@ export const template: OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } + value: { type: { name: "any" } }, + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -214,14 +214,14 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const properties: OperationParameter = { parameterPath: ["options", "properties"], - mapper: ProviderRegistrationRequestMapper + mapper: ProviderRegistrationRequestMapper, }; export const expand: OperationQueryParameter = { @@ -229,14 +229,14 @@ export const expand: OperationQueryParameter = { mapper: { serializedName: "$expand", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters4: OperationParameter = { parameterPath: "parameters", - mapper: ResourcesMoveInfoMapper + mapper: ResourcesMoveInfoMapper, }; export const sourceResourceGroupName: OperationURLParameter = { @@ -245,14 +245,14 @@ export const sourceResourceGroupName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "sourceResourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parentResourcePath: OperationURLParameter = { @@ -261,10 +261,10 @@ export const parentResourcePath: OperationURLParameter = { serializedName: "parentResourcePath", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceType: OperationURLParameter = { @@ -273,10 +273,10 @@ export const resourceType: OperationURLParameter = { serializedName: "resourceType", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceName: OperationURLParameter = { @@ -285,9 +285,9 @@ export const resourceName: OperationURLParameter = { serializedName: "resourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const apiVersion1: OperationQueryParameter = { @@ -296,14 +296,14 @@ export const apiVersion1: OperationQueryParameter = { serializedName: "api-version", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters5: OperationParameter = { parameterPath: "parameters", - mapper: GenericResourceMapper + mapper: GenericResourceMapper, }; export const resourceId: OperationURLParameter = { @@ -312,15 +312,15 @@ export const resourceId: OperationURLParameter = { serializedName: "resourceId", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const parameters6: OperationParameter = { parameterPath: "parameters", - mapper: ResourceGroupMapper + mapper: ResourceGroupMapper, }; export const forceDeletionTypes: OperationQueryParameter = { @@ -328,19 +328,19 @@ export const forceDeletionTypes: OperationQueryParameter = { mapper: { serializedName: "forceDeletionTypes", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters7: OperationParameter = { parameterPath: "parameters", - mapper: ResourceGroupPatchableMapper + mapper: ResourceGroupPatchableMapper, }; export const parameters8: OperationParameter = { parameterPath: "parameters", - mapper: ExportTemplateRequestMapper + mapper: ExportTemplateRequestMapper, }; export const resourceGroupName1: OperationURLParameter = { @@ -348,14 +348,14 @@ export const resourceGroupName1: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const tagName: OperationURLParameter = { @@ -364,9 +364,9 @@ export const tagName: OperationURLParameter = { serializedName: "tagName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const tagValue: OperationURLParameter = { @@ -375,19 +375,19 @@ export const tagValue: OperationURLParameter = { serializedName: "tagValue", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters9: OperationParameter = { parameterPath: "parameters", - mapper: TagsResourceMapper + mapper: TagsResourceMapper, }; export const parameters10: OperationParameter = { parameterPath: "parameters", - mapper: TagsPatchResourceMapper + mapper: TagsPatchResourceMapper, }; export const operationId: OperationURLParameter = { @@ -396,7 +396,7 @@ export const operationId: OperationURLParameter = { serializedName: "operationId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; diff --git a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts index ac58be548913..8bd436dfc7aa 100644 --- a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts +++ b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts @@ -44,7 +44,7 @@ import { DeploymentOperationsListAtTenantScopeNextResponse, DeploymentOperationsListAtManagementGroupScopeNextResponse, DeploymentOperationsListAtSubscriptionScopeNextResponse, - DeploymentOperationsListNextResponse + DeploymentOperationsListNextResponse, } from "../models"; /// @@ -69,7 +69,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { public listAtScope( scope: string, deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams + options?: DeploymentOperationsListAtScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtScopePagingAll(scope, deploymentName, options); return { @@ -87,9 +87,9 @@ export class DeploymentOperationsImpl implements DeploymentOperations { scope, deploymentName, options, - settings + settings, ); - } + }, }; } @@ -97,7 +97,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { scope: string, deploymentName: string, options?: DeploymentOperationsListAtScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentOperationsListAtScopeResponse; let continuationToken = settings?.continuationToken; @@ -113,7 +113,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { scope, deploymentName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -125,12 +125,12 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listAtScopePagingAll( scope: string, deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams + options?: DeploymentOperationsListAtScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtScopePagingPage( scope, deploymentName, - options + options, )) { yield* page; } @@ -143,7 +143,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { */ public listAtTenantScope( deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams + options?: DeploymentOperationsListAtTenantScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtTenantScopePagingAll(deploymentName, options); return { @@ -160,16 +160,16 @@ export class DeploymentOperationsImpl implements DeploymentOperations { return this.listAtTenantScopePagingPage( deploymentName, options, - settings + settings, ); - } + }, }; } private async *listAtTenantScopePagingPage( deploymentName: string, options?: DeploymentOperationsListAtTenantScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentOperationsListAtTenantScopeResponse; let continuationToken = settings?.continuationToken; @@ -184,7 +184,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { result = await this._listAtTenantScopeNext( deploymentName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -195,11 +195,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listAtTenantScopePagingAll( deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams + options?: DeploymentOperationsListAtTenantScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtTenantScopePagingPage( deploymentName, - options + options, )) { yield* page; } @@ -214,12 +214,12 @@ export class DeploymentOperationsImpl implements DeploymentOperations { public listAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtManagementGroupScopePagingAll( groupId, deploymentName, - options + options, ); return { next() { @@ -236,9 +236,9 @@ export class DeploymentOperationsImpl implements DeploymentOperations { groupId, deploymentName, options, - settings + settings, ); - } + }, }; } @@ -246,7 +246,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { groupId: string, deploymentName: string, options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentOperationsListAtManagementGroupScopeResponse; let continuationToken = settings?.continuationToken; @@ -254,7 +254,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { result = await this._listAtManagementGroupScope( groupId, deploymentName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -266,7 +266,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { groupId, deploymentName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -278,12 +278,12 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listAtManagementGroupScopePagingAll( groupId: string, deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtManagementGroupScopePagingPage( groupId, deploymentName, - options + options, )) { yield* page; } @@ -296,7 +296,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { */ public listAtSubscriptionScope( deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtSubscriptionScopePagingAll(deploymentName, options); return { @@ -313,16 +313,16 @@ export class DeploymentOperationsImpl implements DeploymentOperations { return this.listAtSubscriptionScopePagingPage( deploymentName, options, - settings + settings, ); - } + }, }; } private async *listAtSubscriptionScopePagingPage( deploymentName: string, options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentOperationsListAtSubscriptionScopeResponse; let continuationToken = settings?.continuationToken; @@ -337,7 +337,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { result = await this._listAtSubscriptionScopeNext( deploymentName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -348,11 +348,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listAtSubscriptionScopePagingAll( deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtSubscriptionScopePagingPage( deploymentName, - options + options, )) { yield* page; } @@ -367,7 +367,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { public list( resourceGroupName: string, deploymentName: string, - options?: DeploymentOperationsListOptionalParams + options?: DeploymentOperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceGroupName, deploymentName, options); return { @@ -385,9 +385,9 @@ export class DeploymentOperationsImpl implements DeploymentOperations { resourceGroupName, deploymentName, options, - settings + settings, ); - } + }, }; } @@ -395,7 +395,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { resourceGroupName: string, deploymentName: string, options?: DeploymentOperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentOperationsListResponse; let continuationToken = settings?.continuationToken; @@ -411,7 +411,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { resourceGroupName, deploymentName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -423,12 +423,12 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listPagingAll( resourceGroupName: string, deploymentName: string, - options?: DeploymentOperationsListOptionalParams + options?: DeploymentOperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, deploymentName, - options + options, )) { yield* page; } @@ -445,11 +445,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { scope: string, deploymentName: string, operationId: string, - options?: DeploymentOperationsGetAtScopeOptionalParams + options?: DeploymentOperationsGetAtScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, deploymentName, operationId, options }, - getAtScopeOperationSpec + getAtScopeOperationSpec, ); } @@ -462,11 +462,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private _listAtScope( scope: string, deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams + options?: DeploymentOperationsListAtScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, deploymentName, options }, - listAtScopeOperationSpec + listAtScopeOperationSpec, ); } @@ -479,11 +479,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { getAtTenantScope( deploymentName: string, operationId: string, - options?: DeploymentOperationsGetAtTenantScopeOptionalParams + options?: DeploymentOperationsGetAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, operationId, options }, - getAtTenantScopeOperationSpec + getAtTenantScopeOperationSpec, ); } @@ -494,11 +494,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { */ private _listAtTenantScope( deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams + options?: DeploymentOperationsListAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - listAtTenantScopeOperationSpec + listAtTenantScopeOperationSpec, ); } @@ -513,11 +513,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { groupId: string, deploymentName: string, operationId: string, - options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams + options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, deploymentName, operationId, options }, - getAtManagementGroupScopeOperationSpec + getAtManagementGroupScopeOperationSpec, ); } @@ -530,11 +530,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private _listAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, deploymentName, options }, - listAtManagementGroupScopeOperationSpec + listAtManagementGroupScopeOperationSpec, ); } @@ -547,11 +547,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { getAtSubscriptionScope( deploymentName: string, operationId: string, - options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams + options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, operationId, options }, - getAtSubscriptionScopeOperationSpec + getAtSubscriptionScopeOperationSpec, ); } @@ -562,11 +562,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { */ private _listAtSubscriptionScope( deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - listAtSubscriptionScopeOperationSpec + listAtSubscriptionScopeOperationSpec, ); } @@ -581,11 +581,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { resourceGroupName: string, deploymentName: string, operationId: string, - options?: DeploymentOperationsGetOptionalParams + options?: DeploymentOperationsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, deploymentName, operationId, options }, - getOperationSpec + getOperationSpec, ); } @@ -598,11 +598,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private _list( resourceGroupName: string, deploymentName: string, - options?: DeploymentOperationsListOptionalParams + options?: DeploymentOperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, deploymentName, options }, - listOperationSpec + listOperationSpec, ); } @@ -617,11 +617,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { scope: string, deploymentName: string, nextLink: string, - options?: DeploymentOperationsListAtScopeNextOptionalParams + options?: DeploymentOperationsListAtScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, deploymentName, nextLink, options }, - listAtScopeNextOperationSpec + listAtScopeNextOperationSpec, ); } @@ -634,11 +634,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private _listAtTenantScopeNext( deploymentName: string, nextLink: string, - options?: DeploymentOperationsListAtTenantScopeNextOptionalParams + options?: DeploymentOperationsListAtTenantScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, nextLink, options }, - listAtTenantScopeNextOperationSpec + listAtTenantScopeNextOperationSpec, ); } @@ -654,11 +654,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { groupId: string, deploymentName: string, nextLink: string, - options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams + options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, deploymentName, nextLink, options }, - listAtManagementGroupScopeNextOperationSpec + listAtManagementGroupScopeNextOperationSpec, ); } @@ -672,11 +672,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private _listAtSubscriptionScopeNext( deploymentName: string, nextLink: string, - options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams + options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, nextLink, options }, - listAtSubscriptionScopeNextOperationSpec + listAtSubscriptionScopeNextOperationSpec, ); } @@ -691,11 +691,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { resourceGroupName: string, deploymentName: string, nextLink: string, - options?: DeploymentOperationsListNextOptionalParams + options?: DeploymentOperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, deploymentName, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -703,183 +703,174 @@ export class DeploymentOperationsImpl implements DeploymentOperations { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getAtScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperation + bodyMapper: Mappers.DeploymentOperation, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, Parameters.deploymentName, - Parameters.operationId + Parameters.operationId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + path: "/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperation + bodyMapper: Mappers.DeploymentOperation, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.operationId + Parameters.operationId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Resources/deployments/{deploymentName}/operations", + path: "/providers/Microsoft.Resources/deployments/{deploymentName}/operations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperation + bodyMapper: Mappers.DeploymentOperation, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, Parameters.groupId, - Parameters.operationId + Parameters.operationId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.groupId + Parameters.groupId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperation + bodyMapper: Mappers.DeploymentOperation, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.operationId + Parameters.operationId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperation + bodyMapper: Mappers.DeploymentOperation, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -887,130 +878,129 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.deploymentName, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.operationId + Parameters.operationId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtTenantScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtManagementGroupScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.deploymentName, - Parameters.groupId + Parameters.groupId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.deploymentName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentOperationsListResult + bodyMapper: Mappers.DeploymentOperationsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts index 16f7ba8fcda2..adeb80b78b85 100644 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ b/sdk/resources/arm-resources/src/operations/deployments.ts @@ -16,7 +16,7 @@ import { ResourceManagementClient } from "../resourceManagementClient"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -114,7 +114,7 @@ import { DeploymentsListAtTenantScopeNextResponse, DeploymentsListAtManagementGroupScopeNextResponse, DeploymentsListAtSubscriptionScopeNextResponse, - DeploymentsListByResourceGroupNextResponse + DeploymentsListByResourceGroupNextResponse, } from "../models"; /// @@ -137,7 +137,7 @@ export class DeploymentsImpl implements Deployments { */ public listAtScope( scope: string, - options?: DeploymentsListAtScopeOptionalParams + options?: DeploymentsListAtScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtScopePagingAll(scope, options); return { @@ -152,14 +152,14 @@ export class DeploymentsImpl implements Deployments { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtScopePagingPage(scope, options, settings); - } + }, }; } private async *listAtScopePagingPage( scope: string, options?: DeploymentsListAtScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentsListAtScopeResponse; let continuationToken = settings?.continuationToken; @@ -181,7 +181,7 @@ export class DeploymentsImpl implements Deployments { private async *listAtScopePagingAll( scope: string, - options?: DeploymentsListAtScopeOptionalParams + options?: DeploymentsListAtScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtScopePagingPage(scope, options)) { yield* page; @@ -193,7 +193,7 @@ export class DeploymentsImpl implements Deployments { * @param options The options parameters. */ public listAtTenantScope( - options?: DeploymentsListAtTenantScopeOptionalParams + options?: DeploymentsListAtTenantScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtTenantScopePagingAll(options); return { @@ -208,13 +208,13 @@ export class DeploymentsImpl implements Deployments { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtTenantScopePagingPage(options, settings); - } + }, }; } private async *listAtTenantScopePagingPage( options?: DeploymentsListAtTenantScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentsListAtTenantScopeResponse; let continuationToken = settings?.continuationToken; @@ -235,7 +235,7 @@ export class DeploymentsImpl implements Deployments { } private async *listAtTenantScopePagingAll( - options?: DeploymentsListAtTenantScopeOptionalParams + options?: DeploymentsListAtTenantScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtTenantScopePagingPage(options)) { yield* page; @@ -249,7 +249,7 @@ export class DeploymentsImpl implements Deployments { */ public listAtManagementGroupScope( groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams + options?: DeploymentsListAtManagementGroupScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtManagementGroupScopePagingAll(groupId, options); return { @@ -266,16 +266,16 @@ export class DeploymentsImpl implements Deployments { return this.listAtManagementGroupScopePagingPage( groupId, options, - settings + settings, ); - } + }, }; } private async *listAtManagementGroupScopePagingPage( groupId: string, options?: DeploymentsListAtManagementGroupScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentsListAtManagementGroupScopeResponse; let continuationToken = settings?.continuationToken; @@ -290,7 +290,7 @@ export class DeploymentsImpl implements Deployments { result = await this._listAtManagementGroupScopeNext( groupId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -301,11 +301,11 @@ export class DeploymentsImpl implements Deployments { private async *listAtManagementGroupScopePagingAll( groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams + options?: DeploymentsListAtManagementGroupScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtManagementGroupScopePagingPage( groupId, - options + options, )) { yield* page; } @@ -316,7 +316,7 @@ export class DeploymentsImpl implements Deployments { * @param options The options parameters. */ public listAtSubscriptionScope( - options?: DeploymentsListAtSubscriptionScopeOptionalParams + options?: DeploymentsListAtSubscriptionScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtSubscriptionScopePagingAll(options); return { @@ -331,13 +331,13 @@ export class DeploymentsImpl implements Deployments { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtSubscriptionScopePagingPage(options, settings); - } + }, }; } private async *listAtSubscriptionScopePagingPage( options?: DeploymentsListAtSubscriptionScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentsListAtSubscriptionScopeResponse; let continuationToken = settings?.continuationToken; @@ -351,7 +351,7 @@ export class DeploymentsImpl implements Deployments { while (continuationToken) { result = await this._listAtSubscriptionScopeNext( continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -361,7 +361,7 @@ export class DeploymentsImpl implements Deployments { } private async *listAtSubscriptionScopePagingAll( - options?: DeploymentsListAtSubscriptionScopeOptionalParams + options?: DeploymentsListAtSubscriptionScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtSubscriptionScopePagingPage(options)) { yield* page; @@ -376,7 +376,7 @@ export class DeploymentsImpl implements Deployments { */ public listByResourceGroup( resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams + options?: DeploymentsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -393,16 +393,16 @@ export class DeploymentsImpl implements Deployments { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: DeploymentsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -417,7 +417,7 @@ export class DeploymentsImpl implements Deployments { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -428,11 +428,11 @@ export class DeploymentsImpl implements Deployments { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams + options?: DeploymentsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -453,25 +453,24 @@ export class DeploymentsImpl implements Deployments { async beginDeleteAtScope( scope: string, deploymentName: string, - options?: DeploymentsDeleteAtScopeOptionalParams + options?: DeploymentsDeleteAtScopeOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -480,8 +479,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -489,19 +488,19 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { scope, deploymentName, options }, - spec: deleteAtScopeOperationSpec + spec: deleteAtScopeOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -522,12 +521,12 @@ export class DeploymentsImpl implements Deployments { async beginDeleteAtScopeAndWait( scope: string, deploymentName: string, - options?: DeploymentsDeleteAtScopeOptionalParams + options?: DeploymentsDeleteAtScopeOptionalParams, ): Promise { const poller = await this.beginDeleteAtScope( scope, deploymentName, - options + options, ); return poller.pollUntilDone(); } @@ -541,11 +540,11 @@ export class DeploymentsImpl implements Deployments { checkExistenceAtScope( scope: string, deploymentName: string, - options?: DeploymentsCheckExistenceAtScopeOptionalParams + options?: DeploymentsCheckExistenceAtScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, deploymentName, options }, - checkExistenceAtScopeOperationSpec + checkExistenceAtScopeOperationSpec, ); } @@ -560,7 +559,7 @@ export class DeploymentsImpl implements Deployments { scope: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -569,21 +568,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -592,8 +590,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -601,22 +599,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { scope, deploymentName, parameters, options }, - spec: createOrUpdateAtScopeOperationSpec + spec: createOrUpdateAtScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsCreateOrUpdateAtScopeResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -633,13 +631,13 @@ export class DeploymentsImpl implements Deployments { scope: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtScopeOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdateAtScope( scope, deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -653,11 +651,11 @@ export class DeploymentsImpl implements Deployments { getAtScope( scope: string, deploymentName: string, - options?: DeploymentsGetAtScopeOptionalParams + options?: DeploymentsGetAtScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, deploymentName, options }, - getAtScopeOperationSpec + getAtScopeOperationSpec, ); } @@ -672,11 +670,11 @@ export class DeploymentsImpl implements Deployments { cancelAtScope( scope: string, deploymentName: string, - options?: DeploymentsCancelAtScopeOptionalParams + options?: DeploymentsCancelAtScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, deploymentName, options }, - cancelAtScopeOperationSpec + cancelAtScopeOperationSpec, ); } @@ -692,7 +690,7 @@ export class DeploymentsImpl implements Deployments { scope: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateAtScopeOptionalParams + options?: DeploymentsValidateAtScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -701,21 +699,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -724,8 +721,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -733,22 +730,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { scope, deploymentName, parameters, options }, - spec: validateAtScopeOperationSpec + spec: validateAtScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsValidateAtScopeResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -766,13 +763,13 @@ export class DeploymentsImpl implements Deployments { scope: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateAtScopeOptionalParams + options?: DeploymentsValidateAtScopeOptionalParams, ): Promise { const poller = await this.beginValidateAtScope( scope, deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -786,11 +783,11 @@ export class DeploymentsImpl implements Deployments { exportTemplateAtScope( scope: string, deploymentName: string, - options?: DeploymentsExportTemplateAtScopeOptionalParams + options?: DeploymentsExportTemplateAtScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, deploymentName, options }, - exportTemplateAtScopeOperationSpec + exportTemplateAtScopeOperationSpec, ); } @@ -801,11 +798,11 @@ export class DeploymentsImpl implements Deployments { */ private _listAtScope( scope: string, - options?: DeploymentsListAtScopeOptionalParams + options?: DeploymentsListAtScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, options }, - listAtScopeOperationSpec + listAtScopeOperationSpec, ); } @@ -822,25 +819,24 @@ export class DeploymentsImpl implements Deployments { */ async beginDeleteAtTenantScope( deploymentName: string, - options?: DeploymentsDeleteAtTenantScopeOptionalParams + options?: DeploymentsDeleteAtTenantScopeOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -849,8 +845,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -858,19 +854,19 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { deploymentName, options }, - spec: deleteAtTenantScopeOperationSpec + spec: deleteAtTenantScopeOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -889,7 +885,7 @@ export class DeploymentsImpl implements Deployments { */ async beginDeleteAtTenantScopeAndWait( deploymentName: string, - options?: DeploymentsDeleteAtTenantScopeOptionalParams + options?: DeploymentsDeleteAtTenantScopeOptionalParams, ): Promise { const poller = await this.beginDeleteAtTenantScope(deploymentName, options); return poller.pollUntilDone(); @@ -902,11 +898,11 @@ export class DeploymentsImpl implements Deployments { */ checkExistenceAtTenantScope( deploymentName: string, - options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams + options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - checkExistenceAtTenantScopeOperationSpec + checkExistenceAtTenantScopeOperationSpec, ); } @@ -919,7 +915,7 @@ export class DeploymentsImpl implements Deployments { async beginCreateOrUpdateAtTenantScope( deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -928,21 +924,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -951,8 +946,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -960,22 +955,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { deploymentName, parameters, options }, - spec: createOrUpdateAtTenantScopeOperationSpec + spec: createOrUpdateAtTenantScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsCreateOrUpdateAtTenantScopeResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -990,12 +985,12 @@ export class DeploymentsImpl implements Deployments { async beginCreateOrUpdateAtTenantScopeAndWait( deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdateAtTenantScope( deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1007,11 +1002,11 @@ export class DeploymentsImpl implements Deployments { */ getAtTenantScope( deploymentName: string, - options?: DeploymentsGetAtTenantScopeOptionalParams + options?: DeploymentsGetAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - getAtTenantScopeOperationSpec + getAtTenantScopeOperationSpec, ); } @@ -1024,11 +1019,11 @@ export class DeploymentsImpl implements Deployments { */ cancelAtTenantScope( deploymentName: string, - options?: DeploymentsCancelAtTenantScopeOptionalParams + options?: DeploymentsCancelAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - cancelAtTenantScopeOperationSpec + cancelAtTenantScopeOperationSpec, ); } @@ -1042,7 +1037,7 @@ export class DeploymentsImpl implements Deployments { async beginValidateAtTenantScope( deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsValidateAtTenantScopeOptionalParams + options?: DeploymentsValidateAtTenantScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -1051,21 +1046,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1074,8 +1068,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1083,22 +1077,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { deploymentName, parameters, options }, - spec: validateAtTenantScopeOperationSpec + spec: validateAtTenantScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsValidateAtTenantScopeResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -1114,12 +1108,12 @@ export class DeploymentsImpl implements Deployments { async beginValidateAtTenantScopeAndWait( deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsValidateAtTenantScopeOptionalParams + options?: DeploymentsValidateAtTenantScopeOptionalParams, ): Promise { const poller = await this.beginValidateAtTenantScope( deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1133,7 +1127,7 @@ export class DeploymentsImpl implements Deployments { async beginWhatIfAtTenantScope( deploymentName: string, parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtTenantScopeOptionalParams + options?: DeploymentsWhatIfAtTenantScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -1142,21 +1136,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1165,8 +1158,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1174,15 +1167,15 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { deploymentName, parameters, options }, - spec: whatIfAtTenantScopeOperationSpec + spec: whatIfAtTenantScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsWhatIfAtTenantScopeResponse, @@ -1190,7 +1183,7 @@ export class DeploymentsImpl implements Deployments { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -1205,12 +1198,12 @@ export class DeploymentsImpl implements Deployments { async beginWhatIfAtTenantScopeAndWait( deploymentName: string, parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtTenantScopeOptionalParams + options?: DeploymentsWhatIfAtTenantScopeOptionalParams, ): Promise { const poller = await this.beginWhatIfAtTenantScope( deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1222,11 +1215,11 @@ export class DeploymentsImpl implements Deployments { */ exportTemplateAtTenantScope( deploymentName: string, - options?: DeploymentsExportTemplateAtTenantScopeOptionalParams + options?: DeploymentsExportTemplateAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - exportTemplateAtTenantScopeOperationSpec + exportTemplateAtTenantScopeOperationSpec, ); } @@ -1235,11 +1228,11 @@ export class DeploymentsImpl implements Deployments { * @param options The options parameters. */ private _listAtTenantScope( - options?: DeploymentsListAtTenantScopeOptionalParams + options?: DeploymentsListAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAtTenantScopeOperationSpec + listAtTenantScopeOperationSpec, ); } @@ -1258,25 +1251,24 @@ export class DeploymentsImpl implements Deployments { async beginDeleteAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams + options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1285,8 +1277,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1294,19 +1286,19 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { groupId, deploymentName, options }, - spec: deleteAtManagementGroupScopeOperationSpec + spec: deleteAtManagementGroupScopeOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -1327,12 +1319,12 @@ export class DeploymentsImpl implements Deployments { async beginDeleteAtManagementGroupScopeAndWait( groupId: string, deploymentName: string, - options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams + options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams, ): Promise { const poller = await this.beginDeleteAtManagementGroupScope( groupId, deploymentName, - options + options, ); return poller.pollUntilDone(); } @@ -1346,11 +1338,11 @@ export class DeploymentsImpl implements Deployments { checkExistenceAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams + options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, deploymentName, options }, - checkExistenceAtManagementGroupScopeOperationSpec + checkExistenceAtManagementGroupScopeOperationSpec, ); } @@ -1365,7 +1357,7 @@ export class DeploymentsImpl implements Deployments { groupId: string, deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -1374,21 +1366,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1397,8 +1388,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1406,22 +1397,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { groupId, deploymentName, parameters, options }, - spec: createOrUpdateAtManagementGroupScopeOperationSpec + spec: createOrUpdateAtManagementGroupScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsCreateOrUpdateAtManagementGroupScopeResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -1438,13 +1429,13 @@ export class DeploymentsImpl implements Deployments { groupId: string, deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdateAtManagementGroupScope( groupId, deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1458,11 +1449,11 @@ export class DeploymentsImpl implements Deployments { getAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsGetAtManagementGroupScopeOptionalParams + options?: DeploymentsGetAtManagementGroupScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, deploymentName, options }, - getAtManagementGroupScopeOperationSpec + getAtManagementGroupScopeOperationSpec, ); } @@ -1477,11 +1468,11 @@ export class DeploymentsImpl implements Deployments { cancelAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsCancelAtManagementGroupScopeOptionalParams + options?: DeploymentsCancelAtManagementGroupScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, deploymentName, options }, - cancelAtManagementGroupScopeOperationSpec + cancelAtManagementGroupScopeOperationSpec, ); } @@ -1497,7 +1488,7 @@ export class DeploymentsImpl implements Deployments { groupId: string, deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsValidateAtManagementGroupScopeOptionalParams + options?: DeploymentsValidateAtManagementGroupScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -1506,21 +1497,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1529,8 +1519,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1538,22 +1528,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { groupId, deploymentName, parameters, options }, - spec: validateAtManagementGroupScopeOperationSpec + spec: validateAtManagementGroupScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsValidateAtManagementGroupScopeResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -1571,13 +1561,13 @@ export class DeploymentsImpl implements Deployments { groupId: string, deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsValidateAtManagementGroupScopeOptionalParams + options?: DeploymentsValidateAtManagementGroupScopeOptionalParams, ): Promise { const poller = await this.beginValidateAtManagementGroupScope( groupId, deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1594,7 +1584,7 @@ export class DeploymentsImpl implements Deployments { groupId: string, deploymentName: string, parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams + options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -1603,21 +1593,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1626,8 +1615,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1635,15 +1624,15 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { groupId, deploymentName, parameters, options }, - spec: whatIfAtManagementGroupScopeOperationSpec + spec: whatIfAtManagementGroupScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsWhatIfAtManagementGroupScopeResponse, @@ -1651,7 +1640,7 @@ export class DeploymentsImpl implements Deployments { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -1669,13 +1658,13 @@ export class DeploymentsImpl implements Deployments { groupId: string, deploymentName: string, parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams + options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams, ): Promise { const poller = await this.beginWhatIfAtManagementGroupScope( groupId, deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1689,11 +1678,11 @@ export class DeploymentsImpl implements Deployments { exportTemplateAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams + options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, deploymentName, options }, - exportTemplateAtManagementGroupScopeOperationSpec + exportTemplateAtManagementGroupScopeOperationSpec, ); } @@ -1704,11 +1693,11 @@ export class DeploymentsImpl implements Deployments { */ private _listAtManagementGroupScope( groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams + options?: DeploymentsListAtManagementGroupScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, options }, - listAtManagementGroupScopeOperationSpec + listAtManagementGroupScopeOperationSpec, ); } @@ -1725,25 +1714,24 @@ export class DeploymentsImpl implements Deployments { */ async beginDeleteAtSubscriptionScope( deploymentName: string, - options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams + options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1752,8 +1740,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1761,19 +1749,19 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { deploymentName, options }, - spec: deleteAtSubscriptionScopeOperationSpec + spec: deleteAtSubscriptionScopeOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -1792,11 +1780,11 @@ export class DeploymentsImpl implements Deployments { */ async beginDeleteAtSubscriptionScopeAndWait( deploymentName: string, - options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams + options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams, ): Promise { const poller = await this.beginDeleteAtSubscriptionScope( deploymentName, - options + options, ); return poller.pollUntilDone(); } @@ -1808,11 +1796,11 @@ export class DeploymentsImpl implements Deployments { */ checkExistenceAtSubscriptionScope( deploymentName: string, - options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams + options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - checkExistenceAtSubscriptionScopeOperationSpec + checkExistenceAtSubscriptionScopeOperationSpec, ); } @@ -1825,7 +1813,7 @@ export class DeploymentsImpl implements Deployments { async beginCreateOrUpdateAtSubscriptionScope( deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -1834,21 +1822,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1857,8 +1844,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1866,22 +1853,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { deploymentName, parameters, options }, - spec: createOrUpdateAtSubscriptionScopeOperationSpec + spec: createOrUpdateAtSubscriptionScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsCreateOrUpdateAtSubscriptionScopeResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -1896,12 +1883,12 @@ export class DeploymentsImpl implements Deployments { async beginCreateOrUpdateAtSubscriptionScopeAndWait( deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdateAtSubscriptionScope( deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1913,11 +1900,11 @@ export class DeploymentsImpl implements Deployments { */ getAtSubscriptionScope( deploymentName: string, - options?: DeploymentsGetAtSubscriptionScopeOptionalParams + options?: DeploymentsGetAtSubscriptionScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - getAtSubscriptionScopeOperationSpec + getAtSubscriptionScopeOperationSpec, ); } @@ -1930,11 +1917,11 @@ export class DeploymentsImpl implements Deployments { */ cancelAtSubscriptionScope( deploymentName: string, - options?: DeploymentsCancelAtSubscriptionScopeOptionalParams + options?: DeploymentsCancelAtSubscriptionScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - cancelAtSubscriptionScopeOperationSpec + cancelAtSubscriptionScopeOperationSpec, ); } @@ -1948,7 +1935,7 @@ export class DeploymentsImpl implements Deployments { async beginValidateAtSubscriptionScope( deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateAtSubscriptionScopeOptionalParams + options?: DeploymentsValidateAtSubscriptionScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -1957,21 +1944,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1980,8 +1966,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1989,22 +1975,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { deploymentName, parameters, options }, - spec: validateAtSubscriptionScopeOperationSpec + spec: validateAtSubscriptionScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsValidateAtSubscriptionScopeResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -2020,12 +2006,12 @@ export class DeploymentsImpl implements Deployments { async beginValidateAtSubscriptionScopeAndWait( deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateAtSubscriptionScopeOptionalParams + options?: DeploymentsValidateAtSubscriptionScopeOptionalParams, ): Promise { const poller = await this.beginValidateAtSubscriptionScope( deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -2039,7 +2025,7 @@ export class DeploymentsImpl implements Deployments { async beginWhatIfAtSubscriptionScope( deploymentName: string, parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams + options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -2048,21 +2034,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -2071,8 +2056,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -2080,15 +2065,15 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { deploymentName, parameters, options }, - spec: whatIfAtSubscriptionScopeOperationSpec + spec: whatIfAtSubscriptionScopeOperationSpec, }); const poller = await createHttpPoller< DeploymentsWhatIfAtSubscriptionScopeResponse, @@ -2096,7 +2081,7 @@ export class DeploymentsImpl implements Deployments { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -2111,12 +2096,12 @@ export class DeploymentsImpl implements Deployments { async beginWhatIfAtSubscriptionScopeAndWait( deploymentName: string, parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams + options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams, ): Promise { const poller = await this.beginWhatIfAtSubscriptionScope( deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -2128,11 +2113,11 @@ export class DeploymentsImpl implements Deployments { */ exportTemplateAtSubscriptionScope( deploymentName: string, - options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams + options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { deploymentName, options }, - exportTemplateAtSubscriptionScopeOperationSpec + exportTemplateAtSubscriptionScopeOperationSpec, ); } @@ -2141,11 +2126,11 @@ export class DeploymentsImpl implements Deployments { * @param options The options parameters. */ private _listAtSubscriptionScope( - options?: DeploymentsListAtSubscriptionScopeOptionalParams + options?: DeploymentsListAtSubscriptionScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAtSubscriptionScopeOperationSpec + listAtSubscriptionScopeOperationSpec, ); } @@ -2166,25 +2151,24 @@ export class DeploymentsImpl implements Deployments { async beginDelete( resourceGroupName: string, deploymentName: string, - options?: DeploymentsDeleteOptionalParams + options?: DeploymentsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -2193,8 +2177,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -2202,19 +2186,19 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, deploymentName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -2237,12 +2221,12 @@ export class DeploymentsImpl implements Deployments { async beginDeleteAndWait( resourceGroupName: string, deploymentName: string, - options?: DeploymentsDeleteOptionalParams + options?: DeploymentsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, deploymentName, - options + options, ); return poller.pollUntilDone(); } @@ -2257,11 +2241,11 @@ export class DeploymentsImpl implements Deployments { checkExistence( resourceGroupName: string, deploymentName: string, - options?: DeploymentsCheckExistenceOptionalParams + options?: DeploymentsCheckExistenceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, deploymentName, options }, - checkExistenceOperationSpec + checkExistenceOperationSpec, ); } @@ -2277,7 +2261,7 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams + options?: DeploymentsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -2286,21 +2270,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -2309,8 +2292,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -2318,22 +2301,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, deploymentName, parameters, options }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< DeploymentsCreateOrUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -2351,13 +2334,13 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams + options?: DeploymentsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -2371,11 +2354,11 @@ export class DeploymentsImpl implements Deployments { get( resourceGroupName: string, deploymentName: string, - options?: DeploymentsGetOptionalParams + options?: DeploymentsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, deploymentName, options }, - getOperationSpec + getOperationSpec, ); } @@ -2390,11 +2373,11 @@ export class DeploymentsImpl implements Deployments { cancel( resourceGroupName: string, deploymentName: string, - options?: DeploymentsCancelOptionalParams + options?: DeploymentsCancelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, deploymentName, options }, - cancelOperationSpec + cancelOperationSpec, ); } @@ -2411,7 +2394,7 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateOptionalParams + options?: DeploymentsValidateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -2420,21 +2403,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -2443,8 +2425,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -2452,22 +2434,22 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, deploymentName, parameters, options }, - spec: validateOperationSpec + spec: validateOperationSpec, }); const poller = await createHttpPoller< DeploymentsValidateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -2486,13 +2468,13 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateOptionalParams + options?: DeploymentsValidateOptionalParams, ): Promise { const poller = await this.beginValidate( resourceGroupName, deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -2509,7 +2491,7 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, deploymentName: string, parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfOptionalParams + options?: DeploymentsWhatIfOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -2518,21 +2500,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -2541,8 +2522,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -2550,15 +2531,15 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, deploymentName, parameters, options }, - spec: whatIfOperationSpec + spec: whatIfOperationSpec, }); const poller = await createHttpPoller< DeploymentsWhatIfResponse, @@ -2566,7 +2547,7 @@ export class DeploymentsImpl implements Deployments { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -2584,13 +2565,13 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, deploymentName: string, parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfOptionalParams + options?: DeploymentsWhatIfOptionalParams, ): Promise { const poller = await this.beginWhatIf( resourceGroupName, deploymentName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -2604,11 +2585,11 @@ export class DeploymentsImpl implements Deployments { exportTemplate( resourceGroupName: string, deploymentName: string, - options?: DeploymentsExportTemplateOptionalParams + options?: DeploymentsExportTemplateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, deploymentName, options }, - exportTemplateOperationSpec + exportTemplateOperationSpec, ); } @@ -2620,11 +2601,11 @@ export class DeploymentsImpl implements Deployments { */ private _listByResourceGroup( resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams + options?: DeploymentsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -2635,11 +2616,11 @@ export class DeploymentsImpl implements Deployments { */ calculateTemplateHash( template: Record, - options?: DeploymentsCalculateTemplateHashOptionalParams + options?: DeploymentsCalculateTemplateHashOptionalParams, ): Promise { return this.client.sendOperationRequest( { template, options }, - calculateTemplateHashOperationSpec + calculateTemplateHashOperationSpec, ); } @@ -2652,11 +2633,11 @@ export class DeploymentsImpl implements Deployments { private _listAtScopeNext( scope: string, nextLink: string, - options?: DeploymentsListAtScopeNextOptionalParams + options?: DeploymentsListAtScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, nextLink, options }, - listAtScopeNextOperationSpec + listAtScopeNextOperationSpec, ); } @@ -2667,11 +2648,11 @@ export class DeploymentsImpl implements Deployments { */ private _listAtTenantScopeNext( nextLink: string, - options?: DeploymentsListAtTenantScopeNextOptionalParams + options?: DeploymentsListAtTenantScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAtTenantScopeNextOperationSpec + listAtTenantScopeNextOperationSpec, ); } @@ -2685,11 +2666,11 @@ export class DeploymentsImpl implements Deployments { private _listAtManagementGroupScopeNext( groupId: string, nextLink: string, - options?: DeploymentsListAtManagementGroupScopeNextOptionalParams + options?: DeploymentsListAtManagementGroupScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { groupId, nextLink, options }, - listAtManagementGroupScopeNextOperationSpec + listAtManagementGroupScopeNextOperationSpec, ); } @@ -2701,11 +2682,11 @@ export class DeploymentsImpl implements Deployments { */ private _listAtSubscriptionScopeNext( nextLink: string, - options?: DeploymentsListAtSubscriptionScopeNextOptionalParams + options?: DeploymentsListAtSubscriptionScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAtSubscriptionScopeNextOperationSpec + listAtSubscriptionScopeNextOperationSpec, ); } @@ -2719,11 +2700,11 @@ export class DeploymentsImpl implements Deployments { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: DeploymentsListByResourceGroupNextOptionalParams + options?: DeploymentsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } } @@ -2739,17 +2720,17 @@ const deleteAtScopeOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const checkExistenceAtScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", @@ -2758,156 +2739,153 @@ const checkExistenceAtScopeOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 201: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 202: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 204: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getAtScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const cancelAtScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", httpMethod: "POST", responses: { 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const validateAtScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 201: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 202: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 204: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const exportTemplateAtScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentExportResult + bodyMapper: Mappers.DeploymentExportResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/deployments/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/deployments/{deploymentName}", @@ -2918,13 +2896,13 @@ const deleteAtTenantScopeOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept], - serializer + serializer, }; const checkExistenceAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/deployments/{deploymentName}", @@ -2933,56 +2911,56 @@ const checkExistenceAtTenantScopeOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 201: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 202: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 204: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept], - serializer + serializer, }; const cancelAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", @@ -2990,104 +2968,102 @@ const cancelAtTenantScopeOperationSpec: coreClient.OperationSpec = { responses: { 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept], - serializer + serializer, }; const validateAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/deployments/{deploymentName}/validate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 201: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 202: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 204: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const whatIfAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 201: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 202: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 204: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const exportTemplateAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + path: "/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentExportResult + bodyMapper: Mappers.DeploymentExportResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.deploymentName], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/deployments/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "DELETE", responses: { 200: {}, @@ -3095,215 +3071,209 @@ const deleteAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId - ], - headerParameters: [Parameters.accept], - serializer -}; -const checkExistenceAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "HEAD", - responses: { - 204: {}, - 404: {}, - default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.groupId + Parameters.groupId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const createOrUpdateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended - }, - 201: { - bodyMapper: Mappers.DeploymentExtended - }, - 202: { - bodyMapper: Mappers.DeploymentExtended +const checkExistenceAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = + { + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "HEAD", + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError, + }, }, - 204: { - bodyMapper: Mappers.DeploymentExtended + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId, + ], + headerParameters: [Parameters.accept], + serializer, + }; +const createOrUpdateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = + { + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended, + }, + 201: { + bodyMapper: Mappers.DeploymentExtended, + }, + 202: { + bodyMapper: Mappers.DeploymentExtended, + }, + 204: { + bodyMapper: Mappers.DeploymentExtended, + }, + default: { + bodyMapper: Mappers.CloudError, + }, }, - default: { - bodyMapper: Mappers.CloudError - } - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; const getAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.groupId + Parameters.groupId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const cancelAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", httpMethod: "POST", responses: { 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.groupId + Parameters.groupId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const validateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 201: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 202: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 204: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.groupId + Parameters.groupId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const whatIfAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 201: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 202: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 204: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.groupId + Parameters.groupId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const exportTemplateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExportResult +const exportTemplateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = + { + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DeploymentExportResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId - ], - headerParameters: [Parameters.accept], - serializer -}; + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId, + ], + headerParameters: [Parameters.accept], + serializer, + }; const listAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.groupId], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "DELETE", responses: { 200: {}, @@ -3311,215 +3281,209 @@ const deleteAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const checkExistenceAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "HEAD", - responses: { - 204: {}, - 404: {}, - default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const createOrUpdateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended - }, - 201: { - bodyMapper: Mappers.DeploymentExtended - }, - 202: { - bodyMapper: Mappers.DeploymentExtended +const checkExistenceAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "HEAD", + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError, + }, }, - 204: { - bodyMapper: Mappers.DeploymentExtended + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, + }; +const createOrUpdateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended, + }, + 201: { + bodyMapper: Mappers.DeploymentExtended, + }, + 202: { + bodyMapper: Mappers.DeploymentExtended, + }, + 204: { + bodyMapper: Mappers.DeploymentExtended, + }, + default: { + bodyMapper: Mappers.CloudError, + }, }, - default: { - bodyMapper: Mappers.CloudError - } - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; const getAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const cancelAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", httpMethod: "POST", responses: { 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const validateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 201: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 202: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 204: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const whatIfAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 201: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 202: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 204: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const exportTemplateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExportResult +const exportTemplateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DeploymentExportResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, + }; const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "DELETE", responses: { 200: {}, @@ -3527,60 +3491,58 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const checkExistenceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "HEAD", responses: { 204: {}, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 201: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 202: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, 204: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], @@ -3588,74 +3550,71 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const cancelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", httpMethod: "POST", responses: { 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const validateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 201: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 202: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, 204: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], @@ -3663,32 +3622,31 @@ const validateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const whatIfOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 201: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 202: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, 204: { - bodyMapper: Mappers.WhatIfOperationResult + bodyMapper: Mappers.WhatIfOperationResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], @@ -3696,154 +3654,152 @@ const whatIfOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const exportTemplateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentExportResult + bodyMapper: Mappers.DeploymentExportResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const calculateTemplateHashOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Resources/calculateTemplateHash", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.TemplateHashResult + bodyMapper: Mappers.TemplateHashResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.template, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listAtScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtTenantScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtManagementGroupScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.groupId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/operations.ts b/sdk/resources/arm-resources/src/operations/operations.ts index e218ad6bc0b6..9d870ab061e5 100644 --- a/sdk/resources/arm-resources/src/operations/operations.ts +++ b/sdk/resources/arm-resources/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models"; /// @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,29 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts b/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts index 4384a10c5ae4..6faf65f7c983 100644 --- a/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts +++ b/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts @@ -13,7 +13,7 @@ import * as Parameters from "../models/parameters"; import { ResourceManagementClient } from "../resourceManagementClient"; import { ProviderResourceTypesListOptionalParams, - ProviderResourceTypesListResponse + ProviderResourceTypesListResponse, } from "../models"; /** Class containing ProviderResourceTypes operations. */ @@ -35,11 +35,11 @@ export class ProviderResourceTypesImpl implements ProviderResourceTypes { */ list( resourceProviderNamespace: string, - options?: ProviderResourceTypesListOptionalParams + options?: ProviderResourceTypesListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, options }, - listOperationSpec + listOperationSpec, ); } } @@ -47,23 +47,22 @@ export class ProviderResourceTypesImpl implements ProviderResourceTypes { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes", + path: "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProviderResourceTypeListResult + bodyMapper: Mappers.ProviderResourceTypeListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/providers.ts b/sdk/resources/arm-resources/src/operations/providers.ts index 3d1d40950154..6f146c8404bc 100644 --- a/sdk/resources/arm-resources/src/operations/providers.ts +++ b/sdk/resources/arm-resources/src/operations/providers.ts @@ -33,7 +33,7 @@ import { ProvidersGetAtTenantScopeOptionalParams, ProvidersGetAtTenantScopeResponse, ProvidersListNextResponse, - ProvidersListAtTenantScopeNextResponse + ProvidersListAtTenantScopeNextResponse, } from "../models"; /// @@ -54,7 +54,7 @@ export class ProvidersImpl implements Providers { * @param options The options parameters. */ public list( - options?: ProvidersListOptionalParams + options?: ProvidersListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -69,13 +69,13 @@ export class ProvidersImpl implements Providers { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: ProvidersListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ProvidersListResponse; let continuationToken = settings?.continuationToken; @@ -96,7 +96,7 @@ export class ProvidersImpl implements Providers { } private async *listPagingAll( - options?: ProvidersListOptionalParams + options?: ProvidersListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -108,7 +108,7 @@ export class ProvidersImpl implements Providers { * @param options The options parameters. */ public listAtTenantScope( - options?: ProvidersListAtTenantScopeOptionalParams + options?: ProvidersListAtTenantScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtTenantScopePagingAll(options); return { @@ -123,13 +123,13 @@ export class ProvidersImpl implements Providers { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtTenantScopePagingPage(options, settings); - } + }, }; } private async *listAtTenantScopePagingPage( options?: ProvidersListAtTenantScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ProvidersListAtTenantScopeResponse; let continuationToken = settings?.continuationToken; @@ -150,7 +150,7 @@ export class ProvidersImpl implements Providers { } private async *listAtTenantScopePagingAll( - options?: ProvidersListAtTenantScopeOptionalParams + options?: ProvidersListAtTenantScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtTenantScopePagingPage(options)) { yield* page; @@ -164,16 +164,19 @@ export class ProvidersImpl implements Providers { */ unregister( resourceProviderNamespace: string, - options?: ProvidersUnregisterOptionalParams + options?: ProvidersUnregisterOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, options }, - unregisterOperationSpec + unregisterOperationSpec, ); } /** - * Registers a management group with a resource provider. + * Registers a management group with a resource provider. Use this operation to register a resource + * provider with resource types that can be deployed at the management group scope. It does not + * recursively register subscriptions within the management group. Instead, you must register + * subscriptions individually. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. * @param options The options parameters. @@ -181,11 +184,11 @@ export class ProvidersImpl implements Providers { registerAtManagementGroupScope( resourceProviderNamespace: string, groupId: string, - options?: ProvidersRegisterAtManagementGroupScopeOptionalParams + options?: ProvidersRegisterAtManagementGroupScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, groupId, options }, - registerAtManagementGroupScopeOperationSpec + registerAtManagementGroupScopeOperationSpec, ); } @@ -196,11 +199,11 @@ export class ProvidersImpl implements Providers { */ providerPermissions( resourceProviderNamespace: string, - options?: ProvidersProviderPermissionsOptionalParams + options?: ProvidersProviderPermissionsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, options }, - providerPermissionsOperationSpec + providerPermissionsOperationSpec, ); } @@ -211,11 +214,11 @@ export class ProvidersImpl implements Providers { */ register( resourceProviderNamespace: string, - options?: ProvidersRegisterOptionalParams + options?: ProvidersRegisterOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, options }, - registerOperationSpec + registerOperationSpec, ); } @@ -224,7 +227,7 @@ export class ProvidersImpl implements Providers { * @param options The options parameters. */ private _list( - options?: ProvidersListOptionalParams + options?: ProvidersListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -234,11 +237,11 @@ export class ProvidersImpl implements Providers { * @param options The options parameters. */ private _listAtTenantScope( - options?: ProvidersListAtTenantScopeOptionalParams + options?: ProvidersListAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAtTenantScopeOperationSpec + listAtTenantScopeOperationSpec, ); } @@ -249,11 +252,11 @@ export class ProvidersImpl implements Providers { */ get( resourceProviderNamespace: string, - options?: ProvidersGetOptionalParams + options?: ProvidersGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, options }, - getOperationSpec + getOperationSpec, ); } @@ -264,11 +267,11 @@ export class ProvidersImpl implements Providers { */ getAtTenantScope( resourceProviderNamespace: string, - options?: ProvidersGetAtTenantScopeOptionalParams + options?: ProvidersGetAtTenantScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, options }, - getAtTenantScopeOperationSpec + getAtTenantScopeOperationSpec, ); } @@ -279,11 +282,11 @@ export class ProvidersImpl implements Providers { */ private _listNext( nextLink: string, - options?: ProvidersListNextOptionalParams + options?: ProvidersListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } @@ -294,11 +297,11 @@ export class ProvidersImpl implements Providers { */ private _listAtTenantScopeNext( nextLink: string, - options?: ProvidersListAtTenantScopeNextOptionalParams + options?: ProvidersListAtTenantScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAtTenantScopeNextOperationSpec + listAtTenantScopeNextOperationSpec, ); } } @@ -306,188 +309,184 @@ export class ProvidersImpl implements Providers { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const unregisterOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister", + path: "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Provider + bodyMapper: Mappers.Provider, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const registerAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register", + path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register", httpMethod: "POST", responses: { 200: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.groupId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const providerPermissionsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/providerPermissions", + path: "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/providerPermissions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProviderPermissionListResult + bodyMapper: Mappers.ProviderPermissionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const registerOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", + path: "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Provider + bodyMapper: Mappers.Provider, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.properties, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/providers", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProviderListResult + bodyMapper: Mappers.ProviderListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProviderListResult + bodyMapper: Mappers.ProviderListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Provider + bodyMapper: Mappers.Provider, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtTenantScopeOperationSpec: coreClient.OperationSpec = { path: "/providers/{resourceProviderNamespace}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Provider + bodyMapper: Mappers.Provider, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [Parameters.$host, Parameters.resourceProviderNamespace], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProviderListResult + bodyMapper: Mappers.ProviderListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtTenantScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProviderListResult + bodyMapper: Mappers.ProviderListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/resourceGroups.ts b/sdk/resources/arm-resources/src/operations/resourceGroups.ts index 4550f443c26d..b987724988b0 100644 --- a/sdk/resources/arm-resources/src/operations/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operations/resourceGroups.ts @@ -16,7 +16,7 @@ import { ResourceManagementClient } from "../resourceManagementClient"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -37,7 +37,7 @@ import { ExportTemplateRequest, ResourceGroupsExportTemplateOptionalParams, ResourceGroupsExportTemplateResponse, - ResourceGroupsListNextResponse + ResourceGroupsListNextResponse, } from "../models"; /// @@ -58,7 +58,7 @@ export class ResourceGroupsImpl implements ResourceGroups { * @param options The options parameters. */ public list( - options?: ResourceGroupsListOptionalParams + options?: ResourceGroupsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -73,13 +73,13 @@ export class ResourceGroupsImpl implements ResourceGroups { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: ResourceGroupsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourceGroupsListResponse; let continuationToken = settings?.continuationToken; @@ -100,7 +100,7 @@ export class ResourceGroupsImpl implements ResourceGroups { } private async *listPagingAll( - options?: ResourceGroupsListOptionalParams + options?: ResourceGroupsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -114,11 +114,11 @@ export class ResourceGroupsImpl implements ResourceGroups { */ checkExistence( resourceGroupName: string, - options?: ResourceGroupsCheckExistenceOptionalParams + options?: ResourceGroupsCheckExistenceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - checkExistenceOperationSpec + checkExistenceOperationSpec, ); } @@ -133,11 +133,11 @@ export class ResourceGroupsImpl implements ResourceGroups { createOrUpdate( resourceGroupName: string, parameters: ResourceGroup, - options?: ResourceGroupsCreateOrUpdateOptionalParams + options?: ResourceGroupsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, parameters, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -149,25 +149,24 @@ export class ResourceGroupsImpl implements ResourceGroups { */ async beginDelete( resourceGroupName: string, - options?: ResourceGroupsDeleteOptionalParams + options?: ResourceGroupsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -176,8 +175,8 @@ export class ResourceGroupsImpl implements ResourceGroups { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -185,19 +184,19 @@ export class ResourceGroupsImpl implements ResourceGroups { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -211,7 +210,7 @@ export class ResourceGroupsImpl implements ResourceGroups { */ async beginDeleteAndWait( resourceGroupName: string, - options?: ResourceGroupsDeleteOptionalParams + options?: ResourceGroupsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete(resourceGroupName, options); return poller.pollUntilDone(); @@ -224,11 +223,11 @@ export class ResourceGroupsImpl implements ResourceGroups { */ get( resourceGroupName: string, - options?: ResourceGroupsGetOptionalParams + options?: ResourceGroupsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - getOperationSpec + getOperationSpec, ); } @@ -243,11 +242,11 @@ export class ResourceGroupsImpl implements ResourceGroups { update( resourceGroupName: string, parameters: ResourceGroupPatchable, - options?: ResourceGroupsUpdateOptionalParams + options?: ResourceGroupsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, parameters, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -260,7 +259,7 @@ export class ResourceGroupsImpl implements ResourceGroups { async beginExportTemplate( resourceGroupName: string, parameters: ExportTemplateRequest, - options?: ResourceGroupsExportTemplateOptionalParams + options?: ResourceGroupsExportTemplateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -269,21 +268,20 @@ export class ResourceGroupsImpl implements ResourceGroups { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -292,8 +290,8 @@ export class ResourceGroupsImpl implements ResourceGroups { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -301,15 +299,15 @@ export class ResourceGroupsImpl implements ResourceGroups { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, parameters, options }, - spec: exportTemplateOperationSpec + spec: exportTemplateOperationSpec, }); const poller = await createHttpPoller< ResourceGroupsExportTemplateResponse, @@ -317,7 +315,7 @@ export class ResourceGroupsImpl implements ResourceGroups { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -332,12 +330,12 @@ export class ResourceGroupsImpl implements ResourceGroups { async beginExportTemplateAndWait( resourceGroupName: string, parameters: ExportTemplateRequest, - options?: ResourceGroupsExportTemplateOptionalParams + options?: ResourceGroupsExportTemplateOptionalParams, ): Promise { const poller = await this.beginExportTemplate( resourceGroupName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -347,7 +345,7 @@ export class ResourceGroupsImpl implements ResourceGroups { * @param options The options parameters. */ private _list( - options?: ResourceGroupsListOptionalParams + options?: ResourceGroupsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -359,11 +357,11 @@ export class ResourceGroupsImpl implements ResourceGroups { */ private _listNext( nextLink: string, - options?: ResourceGroupsListNextOptionalParams + options?: ResourceGroupsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -377,42 +375,42 @@ const checkExistenceOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ResourceGroup + bodyMapper: Mappers.ResourceGroup, }, 201: { - bodyMapper: Mappers.ResourceGroup + bodyMapper: Mappers.ResourceGroup, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters6, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", @@ -423,124 +421,123 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.forceDeletionTypes], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceGroup + bodyMapper: Mappers.ResourceGroup, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ResourceGroup + bodyMapper: Mappers.ResourceGroup, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters7, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const exportTemplateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ResourceGroupExportResult + bodyMapper: Mappers.ResourceGroupExportResult, }, 201: { - bodyMapper: Mappers.ResourceGroupExportResult + bodyMapper: Mappers.ResourceGroupExportResult, }, 202: { - bodyMapper: Mappers.ResourceGroupExportResult + bodyMapper: Mappers.ResourceGroupExportResult, }, 204: { - bodyMapper: Mappers.ResourceGroupExportResult + bodyMapper: Mappers.ResourceGroupExportResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters8, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName1 + Parameters.resourceGroupName1, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourcegroups", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceGroupListResult + bodyMapper: Mappers.ResourceGroupListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceGroupListResult + bodyMapper: Mappers.ResourceGroupListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/resources.ts b/sdk/resources/arm-resources/src/operations/resources.ts index 71347bd79aaf..97bd2b8b970d 100644 --- a/sdk/resources/arm-resources/src/operations/resources.ts +++ b/sdk/resources/arm-resources/src/operations/resources.ts @@ -16,7 +16,7 @@ import { ResourceManagementClient } from "../resourceManagementClient"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -50,7 +50,7 @@ import { ResourcesGetByIdOptionalParams, ResourcesGetByIdResponse, ResourcesListByResourceGroupNextResponse, - ResourcesListNextResponse + ResourcesListNextResponse, } from "../models"; /// @@ -73,7 +73,7 @@ export class ResourcesImpl implements Resources { */ public listByResourceGroup( resourceGroupName: string, - options?: ResourcesListByResourceGroupOptionalParams + options?: ResourcesListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -90,16 +90,16 @@ export class ResourcesImpl implements Resources { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ResourcesListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourcesListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -114,7 +114,7 @@ export class ResourcesImpl implements Resources { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -125,11 +125,11 @@ export class ResourcesImpl implements Resources { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: ResourcesListByResourceGroupOptionalParams + options?: ResourcesListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -140,7 +140,7 @@ export class ResourcesImpl implements Resources { * @param options The options parameters. */ public list( - options?: ResourcesListOptionalParams + options?: ResourcesListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -155,13 +155,13 @@ export class ResourcesImpl implements Resources { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: ResourcesListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourcesListResponse; let continuationToken = settings?.continuationToken; @@ -182,7 +182,7 @@ export class ResourcesImpl implements Resources { } private async *listPagingAll( - options?: ResourcesListOptionalParams + options?: ResourcesListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -196,11 +196,11 @@ export class ResourcesImpl implements Resources { */ private _listByResourceGroup( resourceGroupName: string, - options?: ResourcesListByResourceGroupOptionalParams + options?: ResourcesListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -217,25 +217,24 @@ export class ResourcesImpl implements Resources { async beginMoveResources( sourceResourceGroupName: string, parameters: ResourcesMoveInfo, - options?: ResourcesMoveResourcesOptionalParams + options?: ResourcesMoveResourcesOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -244,8 +243,8 @@ export class ResourcesImpl implements Resources { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -253,19 +252,19 @@ export class ResourcesImpl implements Resources { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { sourceResourceGroupName, parameters, options }, - spec: moveResourcesOperationSpec + spec: moveResourcesOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -284,12 +283,12 @@ export class ResourcesImpl implements Resources { async beginMoveResourcesAndWait( sourceResourceGroupName: string, parameters: ResourcesMoveInfo, - options?: ResourcesMoveResourcesOptionalParams + options?: ResourcesMoveResourcesOptionalParams, ): Promise { const poller = await this.beginMoveResources( sourceResourceGroupName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -309,25 +308,24 @@ export class ResourcesImpl implements Resources { async beginValidateMoveResources( sourceResourceGroupName: string, parameters: ResourcesMoveInfo, - options?: ResourcesValidateMoveResourcesOptionalParams + options?: ResourcesValidateMoveResourcesOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -336,8 +334,8 @@ export class ResourcesImpl implements Resources { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -345,19 +343,19 @@ export class ResourcesImpl implements Resources { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { sourceResourceGroupName, parameters, options }, - spec: validateMoveResourcesOperationSpec + spec: validateMoveResourcesOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -378,12 +376,12 @@ export class ResourcesImpl implements Resources { async beginValidateMoveResourcesAndWait( sourceResourceGroupName: string, parameters: ResourcesMoveInfo, - options?: ResourcesValidateMoveResourcesOptionalParams + options?: ResourcesValidateMoveResourcesOptionalParams, ): Promise { const poller = await this.beginValidateMoveResources( sourceResourceGroupName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -393,7 +391,7 @@ export class ResourcesImpl implements Resources { * @param options The options parameters. */ private _list( - options?: ResourcesListOptionalParams + options?: ResourcesListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -416,7 +414,7 @@ export class ResourcesImpl implements Resources { resourceType: string, resourceName: string, apiVersion: string, - options?: ResourcesCheckExistenceOptionalParams + options?: ResourcesCheckExistenceOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -426,9 +424,9 @@ export class ResourcesImpl implements Resources { resourceType, resourceName, apiVersion, - options + options, }, - checkExistenceOperationSpec + checkExistenceOperationSpec, ); } @@ -450,25 +448,24 @@ export class ResourcesImpl implements Resources { resourceType: string, resourceName: string, apiVersion: string, - options?: ResourcesDeleteOptionalParams + options?: ResourcesDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -477,8 +474,8 @@ export class ResourcesImpl implements Resources { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -486,8 +483,8 @@ export class ResourcesImpl implements Resources { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -500,13 +497,13 @@ export class ResourcesImpl implements Resources { resourceType, resourceName, apiVersion, - options + options, }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -530,7 +527,7 @@ export class ResourcesImpl implements Resources { resourceType: string, resourceName: string, apiVersion: string, - options?: ResourcesDeleteOptionalParams + options?: ResourcesDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, @@ -539,7 +536,7 @@ export class ResourcesImpl implements Resources { resourceType, resourceName, apiVersion, - options + options, ); return poller.pollUntilDone(); } @@ -564,7 +561,7 @@ export class ResourcesImpl implements Resources { resourceName: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesCreateOrUpdateOptionalParams + options?: ResourcesCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -573,21 +570,20 @@ export class ResourcesImpl implements Resources { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -596,8 +592,8 @@ export class ResourcesImpl implements Resources { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -605,8 +601,8 @@ export class ResourcesImpl implements Resources { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -620,16 +616,16 @@ export class ResourcesImpl implements Resources { resourceName, apiVersion, parameters, - options + options, }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< ResourcesCreateOrUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -655,7 +651,7 @@ export class ResourcesImpl implements Resources { resourceName: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesCreateOrUpdateOptionalParams + options?: ResourcesCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, @@ -665,7 +661,7 @@ export class ResourcesImpl implements Resources { resourceName, apiVersion, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -690,7 +686,7 @@ export class ResourcesImpl implements Resources { resourceName: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesUpdateOptionalParams + options?: ResourcesUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -699,21 +695,20 @@ export class ResourcesImpl implements Resources { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -722,8 +717,8 @@ export class ResourcesImpl implements Resources { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -731,8 +726,8 @@ export class ResourcesImpl implements Resources { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -746,16 +741,16 @@ export class ResourcesImpl implements Resources { resourceName, apiVersion, parameters, - options + options, }, - spec: updateOperationSpec + spec: updateOperationSpec, }); const poller = await createHttpPoller< ResourcesUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -781,7 +776,7 @@ export class ResourcesImpl implements Resources { resourceName: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesUpdateOptionalParams + options?: ResourcesUpdateOptionalParams, ): Promise { const poller = await this.beginUpdate( resourceGroupName, @@ -791,7 +786,7 @@ export class ResourcesImpl implements Resources { resourceName, apiVersion, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -814,7 +809,7 @@ export class ResourcesImpl implements Resources { resourceType: string, resourceName: string, apiVersion: string, - options?: ResourcesGetOptionalParams + options?: ResourcesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -824,14 +819,16 @@ export class ResourcesImpl implements Resources { resourceType, resourceName, apiVersion, - options + options, }, - getOperationSpec + getOperationSpec, ); } /** - * Checks by ID whether a resource exists. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource + * providers. In the event that a Resource provider does not implement this API, ARM will respond with + * a 405. The alternative then is to use the GET API to check for the existence of the resource. * @param resourceId The fully qualified ID of the resource, including the resource name and resource * type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} @@ -841,11 +838,11 @@ export class ResourcesImpl implements Resources { checkExistenceById( resourceId: string, apiVersion: string, - options?: ResourcesCheckExistenceByIdOptionalParams + options?: ResourcesCheckExistenceByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, apiVersion, options }, - checkExistenceByIdOperationSpec + checkExistenceByIdOperationSpec, ); } @@ -860,25 +857,24 @@ export class ResourcesImpl implements Resources { async beginDeleteById( resourceId: string, apiVersion: string, - options?: ResourcesDeleteByIdOptionalParams + options?: ResourcesDeleteByIdOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -887,8 +883,8 @@ export class ResourcesImpl implements Resources { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -896,19 +892,19 @@ export class ResourcesImpl implements Resources { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceId, apiVersion, options }, - spec: deleteByIdOperationSpec + spec: deleteByIdOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -925,7 +921,7 @@ export class ResourcesImpl implements Resources { async beginDeleteByIdAndWait( resourceId: string, apiVersion: string, - options?: ResourcesDeleteByIdOptionalParams + options?: ResourcesDeleteByIdOptionalParams, ): Promise { const poller = await this.beginDeleteById(resourceId, apiVersion, options); return poller.pollUntilDone(); @@ -944,7 +940,7 @@ export class ResourcesImpl implements Resources { resourceId: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesCreateOrUpdateByIdOptionalParams + options?: ResourcesCreateOrUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -953,21 +949,20 @@ export class ResourcesImpl implements Resources { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -976,8 +971,8 @@ export class ResourcesImpl implements Resources { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -985,22 +980,22 @@ export class ResourcesImpl implements Resources { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceId, apiVersion, parameters, options }, - spec: createOrUpdateByIdOperationSpec + spec: createOrUpdateByIdOperationSpec, }); const poller = await createHttpPoller< ResourcesCreateOrUpdateByIdResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -1019,13 +1014,13 @@ export class ResourcesImpl implements Resources { resourceId: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesCreateOrUpdateByIdOptionalParams + options?: ResourcesCreateOrUpdateByIdOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdateById( resourceId, apiVersion, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1043,7 +1038,7 @@ export class ResourcesImpl implements Resources { resourceId: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesUpdateByIdOptionalParams + options?: ResourcesUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -1052,21 +1047,20 @@ export class ResourcesImpl implements Resources { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1075,8 +1069,8 @@ export class ResourcesImpl implements Resources { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1084,22 +1078,22 @@ export class ResourcesImpl implements Resources { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceId, apiVersion, parameters, options }, - spec: updateByIdOperationSpec + spec: updateByIdOperationSpec, }); const poller = await createHttpPoller< ResourcesUpdateByIdResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -1118,13 +1112,13 @@ export class ResourcesImpl implements Resources { resourceId: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesUpdateByIdOptionalParams + options?: ResourcesUpdateByIdOptionalParams, ): Promise { const poller = await this.beginUpdateById( resourceId, apiVersion, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -1140,11 +1134,11 @@ export class ResourcesImpl implements Resources { getById( resourceId: string, apiVersion: string, - options?: ResourcesGetByIdOptionalParams + options?: ResourcesGetByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, apiVersion, options }, - getByIdOperationSpec + getByIdOperationSpec, ); } @@ -1157,11 +1151,11 @@ export class ResourcesImpl implements Resources { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: ResourcesListByResourceGroupNextOptionalParams + options?: ResourcesListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } @@ -1172,11 +1166,11 @@ export class ResourcesImpl implements Resources { */ private _listNext( nextLink: string, - options?: ResourcesListNextOptionalParams + options?: ResourcesListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -1184,34 +1178,32 @@ export class ResourcesImpl implements Resources { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceListResult + bodyMapper: Mappers.ResourceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [ Parameters.apiVersion, Parameters.filter, Parameters.top, - Parameters.expand + Parameters.expand, ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const moveResourcesOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", + path: "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", httpMethod: "POST", responses: { 200: {}, @@ -1219,23 +1211,22 @@ const moveResourcesOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.sourceResourceGroupName + Parameters.sourceResourceGroupName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const validateMoveResourcesOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources", + path: "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources", httpMethod: "POST", responses: { 200: {}, @@ -1243,51 +1234,50 @@ const validateMoveResourcesOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.sourceResourceGroupName + Parameters.sourceResourceGroupName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resources", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceListResult + bodyMapper: Mappers.ResourceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [ Parameters.apiVersion, Parameters.filter, Parameters.top, - Parameters.expand + Parameters.expand, ], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const checkExistenceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", httpMethod: "HEAD", responses: { 204: {}, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion1], urlParameters: [ @@ -1297,14 +1287,13 @@ const checkExistenceOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", httpMethod: "DELETE", responses: { 200: {}, @@ -1312,8 +1301,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion1], urlParameters: [ @@ -1323,31 +1312,30 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 201: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 202: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 204: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion1], @@ -1358,32 +1346,31 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 201: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 202: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 204: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion1], @@ -1394,23 +1381,22 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion1], urlParameters: [ @@ -1420,10 +1406,10 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const checkExistenceByIdOperationSpec: coreClient.OperationSpec = { path: "/{resourceId}", @@ -1432,13 +1418,13 @@ const checkExistenceByIdOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.resourceId], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteByIdOperationSpec: coreClient.OperationSpec = { path: "/{resourceId}", @@ -1449,120 +1435,120 @@ const deleteByIdOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.resourceId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { path: "/{resourceId}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 201: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 202: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 204: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.resourceId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateByIdOperationSpec: coreClient.OperationSpec = { path: "/{resourceId}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 201: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 202: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, 204: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.resourceId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getByIdOperationSpec: coreClient.OperationSpec = { path: "/{resourceId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.GenericResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.resourceId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceListResult + bodyMapper: Mappers.ResourceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceListResult + bodyMapper: Mappers.ResourceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/tagsOperations.ts b/sdk/resources/arm-resources/src/operations/tagsOperations.ts index 121ce4e824ec..75b249d8872f 100644 --- a/sdk/resources/arm-resources/src/operations/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operations/tagsOperations.ts @@ -13,6 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClient } from "../resourceManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { TagDetails, TagsListNextOptionalParams, @@ -33,7 +39,7 @@ import { TagsGetAtScopeOptionalParams, TagsGetAtScopeResponse, TagsDeleteAtScopeOptionalParams, - TagsListNextResponse + TagsListNextResponse, } from "../models"; /// @@ -57,7 +63,7 @@ export class TagsOperationsImpl implements TagsOperations { * @param options The options parameters. */ public list( - options?: TagsListOptionalParams + options?: TagsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -72,13 +78,13 @@ export class TagsOperationsImpl implements TagsOperations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: TagsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TagsListResponse; let continuationToken = settings?.continuationToken; @@ -99,7 +105,7 @@ export class TagsOperationsImpl implements TagsOperations { } private async *listPagingAll( - options?: TagsListOptionalParams + options?: TagsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -117,11 +123,11 @@ export class TagsOperationsImpl implements TagsOperations { deleteValue( tagName: string, tagValue: string, - options?: TagsDeleteValueOptionalParams + options?: TagsDeleteValueOptionalParams, ): Promise { return this.client.sendOperationRequest( { tagName, tagValue, options }, - deleteValueOperationSpec + deleteValueOperationSpec, ); } @@ -135,11 +141,11 @@ export class TagsOperationsImpl implements TagsOperations { createOrUpdateValue( tagName: string, tagValue: string, - options?: TagsCreateOrUpdateValueOptionalParams + options?: TagsCreateOrUpdateValueOptionalParams, ): Promise { return this.client.sendOperationRequest( { tagName, tagValue, options }, - createOrUpdateValueOperationSpec + createOrUpdateValueOperationSpec, ); } @@ -152,11 +158,11 @@ export class TagsOperationsImpl implements TagsOperations { */ createOrUpdate( tagName: string, - options?: TagsCreateOrUpdateOptionalParams + options?: TagsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { tagName, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -170,7 +176,7 @@ export class TagsOperationsImpl implements TagsOperations { delete(tagName: string, options?: TagsDeleteOptionalParams): Promise { return this.client.sendOperationRequest( { tagName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -192,15 +198,162 @@ export class TagsOperationsImpl implements TagsOperations { * @param parameters Wrapper resource for tags API requests and responses. * @param options The options parameters. */ - createOrUpdateAtScope( + async beginCreateOrUpdateAtScope( scope: string, parameters: TagsResource, - options?: TagsCreateOrUpdateAtScopeOptionalParams + options?: TagsCreateOrUpdateAtScopeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TagsCreateOrUpdateAtScopeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { scope, parameters, options }, + spec: createOrUpdateAtScopeOperationSpec, + }); + const poller = await createHttpPoller< + TagsCreateOrUpdateAtScopeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * This operation allows adding or replacing the entire set of tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param options The options parameters. + */ + async beginCreateOrUpdateAtScopeAndWait( + scope: string, + parameters: TagsResource, + options?: TagsCreateOrUpdateAtScopeOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { scope, parameters, options }, - createOrUpdateAtScopeOperationSpec + const poller = await this.beginCreateOrUpdateAtScope( + scope, + parameters, + options, ); + return poller.pollUntilDone(); + } + + /** + * This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The + * 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows + * adding tags with new names and updating the values of tags with existing names. The 'delete' option + * allows selectively deleting tags based on given names or name/value pairs. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param options The options parameters. + */ + async beginUpdateAtScope( + scope: string, + parameters: TagsPatchResource, + options?: TagsUpdateAtScopeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TagsUpdateAtScopeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { scope, parameters, options }, + spec: updateAtScopeOperationSpec, + }); + const poller = await createHttpPoller< + TagsUpdateAtScopeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; } /** @@ -213,15 +366,13 @@ export class TagsOperationsImpl implements TagsOperations { * @param parameters Wrapper resource for tags patch API request only. * @param options The options parameters. */ - updateAtScope( + async beginUpdateAtScopeAndWait( scope: string, parameters: TagsPatchResource, - options?: TagsUpdateAtScopeOptionalParams + options?: TagsUpdateAtScopeOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { scope, parameters, options }, - updateAtScopeOperationSpec - ); + const poller = await this.beginUpdateAtScope(scope, parameters, options); + return poller.pollUntilDone(); } /** @@ -231,11 +382,11 @@ export class TagsOperationsImpl implements TagsOperations { */ getAtScope( scope: string, - options?: TagsGetAtScopeOptionalParams + options?: TagsGetAtScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, options }, - getAtScopeOperationSpec + getAtScopeOperationSpec, ); } @@ -244,14 +395,72 @@ export class TagsOperationsImpl implements TagsOperations { * @param scope The resource scope. * @param options The options parameters. */ - deleteAtScope( + async beginDeleteAtScope( + scope: string, + options?: TagsDeleteAtScopeOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { scope, options }, + spec: deleteAtScopeOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param options The options parameters. + */ + async beginDeleteAtScopeAndWait( scope: string, - options?: TagsDeleteAtScopeOptionalParams + options?: TagsDeleteAtScopeOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - deleteAtScopeOperationSpec - ); + const poller = await this.beginDeleteAtScope(scope, options); + return poller.pollUntilDone(); } /** @@ -261,11 +470,11 @@ export class TagsOperationsImpl implements TagsOperations { */ private _listNext( nextLink: string, - options?: TagsListNextOptionalParams + options?: TagsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -273,73 +482,71 @@ export class TagsOperationsImpl implements TagsOperations { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const deleteValueOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", + path: "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.tagName, - Parameters.tagValue + Parameters.tagValue, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateValueOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", + path: "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.TagValue + bodyMapper: Mappers.TagValue, }, 201: { - bodyMapper: Mappers.TagValue + bodyMapper: Mappers.TagValue, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.tagName, - Parameters.tagValue + Parameters.tagValue, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/tagNames/{tagName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.TagDetails + bodyMapper: Mappers.TagDetails, }, 201: { - bodyMapper: Mappers.TagDetails + bodyMapper: Mappers.TagDetails, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.tagName + Parameters.tagName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/tagNames/{tagName}", @@ -348,116 +555,137 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.tagName + Parameters.tagName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/tagNames", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TagsListResult + bodyMapper: Mappers.TagsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/tags/default", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.TagsResource + bodyMapper: Mappers.TagsResource, + }, + 201: { + bodyMapper: Mappers.TagsResource, + }, + 202: { + bodyMapper: Mappers.TagsResource, + }, + 204: { + bodyMapper: Mappers.TagsResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters9, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateAtScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/tags/default", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.TagsResource + bodyMapper: Mappers.TagsResource, + }, + 201: { + bodyMapper: Mappers.TagsResource, + }, + 202: { + bodyMapper: Mappers.TagsResource, + }, + 204: { + bodyMapper: Mappers.TagsResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.parameters10, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getAtScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/tags/default", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TagsResource + bodyMapper: Mappers.TagsResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteAtScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/tags/default", httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TagsListResult + bodyMapper: Mappers.TagsListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts index f55d69614dd8..4327062e0dde 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts @@ -23,7 +23,7 @@ import { DeploymentOperationsGetAtSubscriptionScopeOptionalParams, DeploymentOperationsGetAtSubscriptionScopeResponse, DeploymentOperationsGetOptionalParams, - DeploymentOperationsGetResponse + DeploymentOperationsGetResponse, } from "../models"; /// @@ -38,7 +38,7 @@ export interface DeploymentOperations { listAtScope( scope: string, deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams + options?: DeploymentOperationsListAtScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all deployments operations for a deployment. @@ -47,7 +47,7 @@ export interface DeploymentOperations { */ listAtTenantScope( deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams + options?: DeploymentOperationsListAtTenantScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all deployments operations for a deployment. @@ -58,7 +58,7 @@ export interface DeploymentOperations { listAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all deployments operations for a deployment. @@ -67,7 +67,7 @@ export interface DeploymentOperations { */ listAtSubscriptionScope( deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all deployments operations for a deployment. @@ -78,7 +78,7 @@ export interface DeploymentOperations { list( resourceGroupName: string, deploymentName: string, - options?: DeploymentOperationsListOptionalParams + options?: DeploymentOperationsListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a deployments operation. @@ -91,7 +91,7 @@ export interface DeploymentOperations { scope: string, deploymentName: string, operationId: string, - options?: DeploymentOperationsGetAtScopeOptionalParams + options?: DeploymentOperationsGetAtScopeOptionalParams, ): Promise; /** * Gets a deployments operation. @@ -102,7 +102,7 @@ export interface DeploymentOperations { getAtTenantScope( deploymentName: string, operationId: string, - options?: DeploymentOperationsGetAtTenantScopeOptionalParams + options?: DeploymentOperationsGetAtTenantScopeOptionalParams, ): Promise; /** * Gets a deployments operation. @@ -115,7 +115,7 @@ export interface DeploymentOperations { groupId: string, deploymentName: string, operationId: string, - options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams + options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams, ): Promise; /** * Gets a deployments operation. @@ -126,7 +126,7 @@ export interface DeploymentOperations { getAtSubscriptionScope( deploymentName: string, operationId: string, - options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams + options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams, ): Promise; /** * Gets a deployments operation. @@ -139,6 +139,6 @@ export interface DeploymentOperations { resourceGroupName: string, deploymentName: string, operationId: string, - options?: DeploymentOperationsGetOptionalParams + options?: DeploymentOperationsGetOptionalParams, ): Promise; } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts b/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts index 360326afc4d2..a8f929c63997 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts @@ -88,7 +88,7 @@ import { DeploymentsExportTemplateOptionalParams, DeploymentsExportTemplateResponse, DeploymentsCalculateTemplateHashOptionalParams, - DeploymentsCalculateTemplateHashResponse + DeploymentsCalculateTemplateHashResponse, } from "../models"; /// @@ -101,14 +101,14 @@ export interface Deployments { */ listAtScope( scope: string, - options?: DeploymentsListAtScopeOptionalParams + options?: DeploymentsListAtScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Get all the deployments at the tenant scope. * @param options The options parameters. */ listAtTenantScope( - options?: DeploymentsListAtTenantScopeOptionalParams + options?: DeploymentsListAtTenantScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Get all the deployments for a management group. @@ -117,14 +117,14 @@ export interface Deployments { */ listAtManagementGroupScope( groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams + options?: DeploymentsListAtManagementGroupScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Get all the deployments for a subscription. * @param options The options parameters. */ listAtSubscriptionScope( - options?: DeploymentsListAtSubscriptionScopeOptionalParams + options?: DeploymentsListAtSubscriptionScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Get all the deployments for a resource group. @@ -134,7 +134,7 @@ export interface Deployments { */ listByResourceGroup( resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams + options?: DeploymentsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -151,7 +151,7 @@ export interface Deployments { beginDeleteAtScope( scope: string, deploymentName: string, - options?: DeploymentsDeleteAtScopeOptionalParams + options?: DeploymentsDeleteAtScopeOptionalParams, ): Promise, void>>; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -168,7 +168,7 @@ export interface Deployments { beginDeleteAtScopeAndWait( scope: string, deploymentName: string, - options?: DeploymentsDeleteAtScopeOptionalParams + options?: DeploymentsDeleteAtScopeOptionalParams, ): Promise; /** * Checks whether the deployment exists. @@ -179,7 +179,7 @@ export interface Deployments { checkExistenceAtScope( scope: string, deploymentName: string, - options?: DeploymentsCheckExistenceAtScopeOptionalParams + options?: DeploymentsCheckExistenceAtScopeOptionalParams, ): Promise; /** * You can provide the template and parameters directly in the request or link to JSON files. @@ -192,7 +192,7 @@ export interface Deployments { scope: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -210,7 +210,7 @@ export interface Deployments { scope: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtScopeOptionalParams, ): Promise; /** * Gets a deployment. @@ -221,7 +221,7 @@ export interface Deployments { getAtScope( scope: string, deploymentName: string, - options?: DeploymentsGetAtScopeOptionalParams + options?: DeploymentsGetAtScopeOptionalParams, ): Promise; /** * You can cancel a deployment only if the provisioningState is Accepted or Running. After the @@ -234,7 +234,7 @@ export interface Deployments { cancelAtScope( scope: string, deploymentName: string, - options?: DeploymentsCancelAtScopeOptionalParams + options?: DeploymentsCancelAtScopeOptionalParams, ): Promise; /** * Validates whether the specified template is syntactically correct and will be accepted by Azure @@ -248,7 +248,7 @@ export interface Deployments { scope: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateAtScopeOptionalParams + options?: DeploymentsValidateAtScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -267,7 +267,7 @@ export interface Deployments { scope: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateAtScopeOptionalParams + options?: DeploymentsValidateAtScopeOptionalParams, ): Promise; /** * Exports the template used for specified deployment. @@ -278,7 +278,7 @@ export interface Deployments { exportTemplateAtScope( scope: string, deploymentName: string, - options?: DeploymentsExportTemplateAtScopeOptionalParams + options?: DeploymentsExportTemplateAtScopeOptionalParams, ): Promise; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -293,7 +293,7 @@ export interface Deployments { */ beginDeleteAtTenantScope( deploymentName: string, - options?: DeploymentsDeleteAtTenantScopeOptionalParams + options?: DeploymentsDeleteAtTenantScopeOptionalParams, ): Promise, void>>; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -308,7 +308,7 @@ export interface Deployments { */ beginDeleteAtTenantScopeAndWait( deploymentName: string, - options?: DeploymentsDeleteAtTenantScopeOptionalParams + options?: DeploymentsDeleteAtTenantScopeOptionalParams, ): Promise; /** * Checks whether the deployment exists. @@ -317,7 +317,7 @@ export interface Deployments { */ checkExistenceAtTenantScope( deploymentName: string, - options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams + options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams, ): Promise; /** * You can provide the template and parameters directly in the request or link to JSON files. @@ -328,7 +328,7 @@ export interface Deployments { beginCreateOrUpdateAtTenantScope( deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -344,7 +344,7 @@ export interface Deployments { beginCreateOrUpdateAtTenantScopeAndWait( deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, ): Promise; /** * Gets a deployment. @@ -353,7 +353,7 @@ export interface Deployments { */ getAtTenantScope( deploymentName: string, - options?: DeploymentsGetAtTenantScopeOptionalParams + options?: DeploymentsGetAtTenantScopeOptionalParams, ): Promise; /** * You can cancel a deployment only if the provisioningState is Accepted or Running. After the @@ -364,7 +364,7 @@ export interface Deployments { */ cancelAtTenantScope( deploymentName: string, - options?: DeploymentsCancelAtTenantScopeOptionalParams + options?: DeploymentsCancelAtTenantScopeOptionalParams, ): Promise; /** * Validates whether the specified template is syntactically correct and will be accepted by Azure @@ -376,7 +376,7 @@ export interface Deployments { beginValidateAtTenantScope( deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsValidateAtTenantScopeOptionalParams + options?: DeploymentsValidateAtTenantScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -393,7 +393,7 @@ export interface Deployments { beginValidateAtTenantScopeAndWait( deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsValidateAtTenantScopeOptionalParams + options?: DeploymentsValidateAtTenantScopeOptionalParams, ): Promise; /** * Returns changes that will be made by the deployment if executed at the scope of the tenant group. @@ -404,7 +404,7 @@ export interface Deployments { beginWhatIfAtTenantScope( deploymentName: string, parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtTenantScopeOptionalParams + options?: DeploymentsWhatIfAtTenantScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -420,7 +420,7 @@ export interface Deployments { beginWhatIfAtTenantScopeAndWait( deploymentName: string, parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtTenantScopeOptionalParams + options?: DeploymentsWhatIfAtTenantScopeOptionalParams, ): Promise; /** * Exports the template used for specified deployment. @@ -429,7 +429,7 @@ export interface Deployments { */ exportTemplateAtTenantScope( deploymentName: string, - options?: DeploymentsExportTemplateAtTenantScopeOptionalParams + options?: DeploymentsExportTemplateAtTenantScopeOptionalParams, ): Promise; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -446,7 +446,7 @@ export interface Deployments { beginDeleteAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams + options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams, ): Promise, void>>; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -463,7 +463,7 @@ export interface Deployments { beginDeleteAtManagementGroupScopeAndWait( groupId: string, deploymentName: string, - options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams + options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams, ): Promise; /** * Checks whether the deployment exists. @@ -474,7 +474,7 @@ export interface Deployments { checkExistenceAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams + options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, ): Promise; /** * You can provide the template and parameters directly in the request or link to JSON files. @@ -487,7 +487,7 @@ export interface Deployments { groupId: string, deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -505,7 +505,7 @@ export interface Deployments { groupId: string, deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, ): Promise; /** * Gets a deployment. @@ -516,7 +516,7 @@ export interface Deployments { getAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsGetAtManagementGroupScopeOptionalParams + options?: DeploymentsGetAtManagementGroupScopeOptionalParams, ): Promise; /** * You can cancel a deployment only if the provisioningState is Accepted or Running. After the @@ -529,7 +529,7 @@ export interface Deployments { cancelAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsCancelAtManagementGroupScopeOptionalParams + options?: DeploymentsCancelAtManagementGroupScopeOptionalParams, ): Promise; /** * Validates whether the specified template is syntactically correct and will be accepted by Azure @@ -543,7 +543,7 @@ export interface Deployments { groupId: string, deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsValidateAtManagementGroupScopeOptionalParams + options?: DeploymentsValidateAtManagementGroupScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -562,7 +562,7 @@ export interface Deployments { groupId: string, deploymentName: string, parameters: ScopedDeployment, - options?: DeploymentsValidateAtManagementGroupScopeOptionalParams + options?: DeploymentsValidateAtManagementGroupScopeOptionalParams, ): Promise; /** * Returns changes that will be made by the deployment if executed at the scope of the management @@ -576,7 +576,7 @@ export interface Deployments { groupId: string, deploymentName: string, parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams + options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -595,7 +595,7 @@ export interface Deployments { groupId: string, deploymentName: string, parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams + options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams, ): Promise; /** * Exports the template used for specified deployment. @@ -606,7 +606,7 @@ export interface Deployments { exportTemplateAtManagementGroupScope( groupId: string, deploymentName: string, - options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams + options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, ): Promise; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -621,7 +621,7 @@ export interface Deployments { */ beginDeleteAtSubscriptionScope( deploymentName: string, - options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams + options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams, ): Promise, void>>; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -636,7 +636,7 @@ export interface Deployments { */ beginDeleteAtSubscriptionScopeAndWait( deploymentName: string, - options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams + options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams, ): Promise; /** * Checks whether the deployment exists. @@ -645,7 +645,7 @@ export interface Deployments { */ checkExistenceAtSubscriptionScope( deploymentName: string, - options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams + options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, ): Promise; /** * You can provide the template and parameters directly in the request or link to JSON files. @@ -656,7 +656,7 @@ export interface Deployments { beginCreateOrUpdateAtSubscriptionScope( deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -672,7 +672,7 @@ export interface Deployments { beginCreateOrUpdateAtSubscriptionScopeAndWait( deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, ): Promise; /** * Gets a deployment. @@ -681,7 +681,7 @@ export interface Deployments { */ getAtSubscriptionScope( deploymentName: string, - options?: DeploymentsGetAtSubscriptionScopeOptionalParams + options?: DeploymentsGetAtSubscriptionScopeOptionalParams, ): Promise; /** * You can cancel a deployment only if the provisioningState is Accepted or Running. After the @@ -692,7 +692,7 @@ export interface Deployments { */ cancelAtSubscriptionScope( deploymentName: string, - options?: DeploymentsCancelAtSubscriptionScopeOptionalParams + options?: DeploymentsCancelAtSubscriptionScopeOptionalParams, ): Promise; /** * Validates whether the specified template is syntactically correct and will be accepted by Azure @@ -704,7 +704,7 @@ export interface Deployments { beginValidateAtSubscriptionScope( deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateAtSubscriptionScopeOptionalParams + options?: DeploymentsValidateAtSubscriptionScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -721,7 +721,7 @@ export interface Deployments { beginValidateAtSubscriptionScopeAndWait( deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateAtSubscriptionScopeOptionalParams + options?: DeploymentsValidateAtSubscriptionScopeOptionalParams, ): Promise; /** * Returns changes that will be made by the deployment if executed at the scope of the subscription. @@ -732,7 +732,7 @@ export interface Deployments { beginWhatIfAtSubscriptionScope( deploymentName: string, parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams + options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -748,7 +748,7 @@ export interface Deployments { beginWhatIfAtSubscriptionScopeAndWait( deploymentName: string, parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams + options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams, ): Promise; /** * Exports the template used for specified deployment. @@ -757,7 +757,7 @@ export interface Deployments { */ exportTemplateAtSubscriptionScope( deploymentName: string, - options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams + options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, ): Promise; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -776,7 +776,7 @@ export interface Deployments { beginDelete( resourceGroupName: string, deploymentName: string, - options?: DeploymentsDeleteOptionalParams + options?: DeploymentsDeleteOptionalParams, ): Promise, void>>; /** * A template deployment that is currently running cannot be deleted. Deleting a template deployment @@ -795,7 +795,7 @@ export interface Deployments { beginDeleteAndWait( resourceGroupName: string, deploymentName: string, - options?: DeploymentsDeleteOptionalParams + options?: DeploymentsDeleteOptionalParams, ): Promise; /** * Checks whether the deployment exists. @@ -807,7 +807,7 @@ export interface Deployments { checkExistence( resourceGroupName: string, deploymentName: string, - options?: DeploymentsCheckExistenceOptionalParams + options?: DeploymentsCheckExistenceOptionalParams, ): Promise; /** * You can provide the template and parameters directly in the request or link to JSON files. @@ -821,7 +821,7 @@ export interface Deployments { resourceGroupName: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams + options?: DeploymentsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -840,7 +840,7 @@ export interface Deployments { resourceGroupName: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams + options?: DeploymentsCreateOrUpdateOptionalParams, ): Promise; /** * Gets a deployment. @@ -851,7 +851,7 @@ export interface Deployments { get( resourceGroupName: string, deploymentName: string, - options?: DeploymentsGetOptionalParams + options?: DeploymentsGetOptionalParams, ): Promise; /** * You can cancel a deployment only if the provisioningState is Accepted or Running. After the @@ -864,7 +864,7 @@ export interface Deployments { cancel( resourceGroupName: string, deploymentName: string, - options?: DeploymentsCancelOptionalParams + options?: DeploymentsCancelOptionalParams, ): Promise; /** * Validates whether the specified template is syntactically correct and will be accepted by Azure @@ -879,7 +879,7 @@ export interface Deployments { resourceGroupName: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateOptionalParams + options?: DeploymentsValidateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -899,7 +899,7 @@ export interface Deployments { resourceGroupName: string, deploymentName: string, parameters: Deployment, - options?: DeploymentsValidateOptionalParams + options?: DeploymentsValidateOptionalParams, ): Promise; /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. @@ -913,7 +913,7 @@ export interface Deployments { resourceGroupName: string, deploymentName: string, parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfOptionalParams + options?: DeploymentsWhatIfOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -932,7 +932,7 @@ export interface Deployments { resourceGroupName: string, deploymentName: string, parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfOptionalParams + options?: DeploymentsWhatIfOptionalParams, ): Promise; /** * Exports the template used for specified deployment. @@ -943,7 +943,7 @@ export interface Deployments { exportTemplate( resourceGroupName: string, deploymentName: string, - options?: DeploymentsExportTemplateOptionalParams + options?: DeploymentsExportTemplateOptionalParams, ): Promise; /** * Calculate the hash of the given template. @@ -952,6 +952,6 @@ export interface Deployments { */ calculateTemplateHash( template: Record, - options?: DeploymentsCalculateTemplateHashOptionalParams + options?: DeploymentsCalculateTemplateHashOptionalParams, ): Promise; } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts index ac34435954c0..65cdf8035ab0 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providerResourceTypes.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providerResourceTypes.ts index f7010e50bd64..0e4c5c2f6dcb 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/providerResourceTypes.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providerResourceTypes.ts @@ -8,7 +8,7 @@ import { ProviderResourceTypesListOptionalParams, - ProviderResourceTypesListResponse + ProviderResourceTypesListResponse, } from "../models"; /** Interface representing a ProviderResourceTypes. */ @@ -20,6 +20,6 @@ export interface ProviderResourceTypes { */ list( resourceProviderNamespace: string, - options?: ProviderResourceTypesListOptionalParams + options?: ProviderResourceTypesListOptionalParams, ): Promise; } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts index ee8f17fce3c8..9f74bdab2307 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts @@ -21,7 +21,7 @@ import { ProvidersGetOptionalParams, ProvidersGetResponse, ProvidersGetAtTenantScopeOptionalParams, - ProvidersGetAtTenantScopeResponse + ProvidersGetAtTenantScopeResponse, } from "../models"; /// @@ -32,14 +32,14 @@ export interface Providers { * @param options The options parameters. */ list( - options?: ProvidersListOptionalParams + options?: ProvidersListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all resource providers for the tenant. * @param options The options parameters. */ listAtTenantScope( - options?: ProvidersListAtTenantScopeOptionalParams + options?: ProvidersListAtTenantScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Unregisters a subscription from a resource provider. @@ -48,10 +48,13 @@ export interface Providers { */ unregister( resourceProviderNamespace: string, - options?: ProvidersUnregisterOptionalParams + options?: ProvidersUnregisterOptionalParams, ): Promise; /** - * Registers a management group with a resource provider. + * Registers a management group with a resource provider. Use this operation to register a resource + * provider with resource types that can be deployed at the management group scope. It does not + * recursively register subscriptions within the management group. Instead, you must register + * subscriptions individually. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. * @param options The options parameters. @@ -59,7 +62,7 @@ export interface Providers { registerAtManagementGroupScope( resourceProviderNamespace: string, groupId: string, - options?: ProvidersRegisterAtManagementGroupScopeOptionalParams + options?: ProvidersRegisterAtManagementGroupScopeOptionalParams, ): Promise; /** * Get the provider permissions. @@ -68,7 +71,7 @@ export interface Providers { */ providerPermissions( resourceProviderNamespace: string, - options?: ProvidersProviderPermissionsOptionalParams + options?: ProvidersProviderPermissionsOptionalParams, ): Promise; /** * Registers a subscription with a resource provider. @@ -77,7 +80,7 @@ export interface Providers { */ register( resourceProviderNamespace: string, - options?: ProvidersRegisterOptionalParams + options?: ProvidersRegisterOptionalParams, ): Promise; /** * Gets the specified resource provider. @@ -86,7 +89,7 @@ export interface Providers { */ get( resourceProviderNamespace: string, - options?: ProvidersGetOptionalParams + options?: ProvidersGetOptionalParams, ): Promise; /** * Gets the specified resource provider at the tenant level. @@ -95,6 +98,6 @@ export interface Providers { */ getAtTenantScope( resourceProviderNamespace: string, - options?: ProvidersGetAtTenantScopeOptionalParams + options?: ProvidersGetAtTenantScopeOptionalParams, ): Promise; } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts index e7803b565192..3b58da505d02 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts @@ -23,7 +23,7 @@ import { ResourceGroupsUpdateResponse, ExportTemplateRequest, ResourceGroupsExportTemplateOptionalParams, - ResourceGroupsExportTemplateResponse + ResourceGroupsExportTemplateResponse, } from "../models"; /// @@ -34,7 +34,7 @@ export interface ResourceGroups { * @param options The options parameters. */ list( - options?: ResourceGroupsListOptionalParams + options?: ResourceGroupsListOptionalParams, ): PagedAsyncIterableIterator; /** * Checks whether a resource group exists. @@ -43,7 +43,7 @@ export interface ResourceGroups { */ checkExistence( resourceGroupName: string, - options?: ResourceGroupsCheckExistenceOptionalParams + options?: ResourceGroupsCheckExistenceOptionalParams, ): Promise; /** * Creates or updates a resource group. @@ -56,7 +56,7 @@ export interface ResourceGroups { createOrUpdate( resourceGroupName: string, parameters: ResourceGroup, - options?: ResourceGroupsCreateOrUpdateOptionalParams + options?: ResourceGroupsCreateOrUpdateOptionalParams, ): Promise; /** * When you delete a resource group, all of its resources are also deleted. Deleting a resource group @@ -66,7 +66,7 @@ export interface ResourceGroups { */ beginDelete( resourceGroupName: string, - options?: ResourceGroupsDeleteOptionalParams + options?: ResourceGroupsDeleteOptionalParams, ): Promise, void>>; /** * When you delete a resource group, all of its resources are also deleted. Deleting a resource group @@ -76,7 +76,7 @@ export interface ResourceGroups { */ beginDeleteAndWait( resourceGroupName: string, - options?: ResourceGroupsDeleteOptionalParams + options?: ResourceGroupsDeleteOptionalParams, ): Promise; /** * Gets a resource group. @@ -85,7 +85,7 @@ export interface ResourceGroups { */ get( resourceGroupName: string, - options?: ResourceGroupsGetOptionalParams + options?: ResourceGroupsGetOptionalParams, ): Promise; /** * Resource groups can be updated through a simple PATCH operation to a group address. The format of @@ -98,7 +98,7 @@ export interface ResourceGroups { update( resourceGroupName: string, parameters: ResourceGroupPatchable, - options?: ResourceGroupsUpdateOptionalParams + options?: ResourceGroupsUpdateOptionalParams, ): Promise; /** * Captures the specified resource group as a template. @@ -109,7 +109,7 @@ export interface ResourceGroups { beginExportTemplate( resourceGroupName: string, parameters: ExportTemplateRequest, - options?: ResourceGroupsExportTemplateOptionalParams + options?: ResourceGroupsExportTemplateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -125,6 +125,6 @@ export interface ResourceGroups { beginExportTemplateAndWait( resourceGroupName: string, parameters: ExportTemplateRequest, - options?: ResourceGroupsExportTemplateOptionalParams + options?: ResourceGroupsExportTemplateOptionalParams, ): Promise; } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts index 4a0e0e0452be..15fa5db00db3 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts @@ -33,7 +33,7 @@ import { ResourcesUpdateByIdOptionalParams, ResourcesUpdateByIdResponse, ResourcesGetByIdOptionalParams, - ResourcesGetByIdResponse + ResourcesGetByIdResponse, } from "../models"; /// @@ -46,14 +46,14 @@ export interface Resources { */ listByResourceGroup( resourceGroupName: string, - options?: ResourcesListByResourceGroupOptionalParams + options?: ResourcesListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Get all the resources in a subscription. * @param options The options parameters. */ list( - options?: ResourcesListOptionalParams + options?: ResourcesListOptionalParams, ): PagedAsyncIterableIterator; /** * The resources to be moved must be in the same source resource group in the source subscription being @@ -68,7 +68,7 @@ export interface Resources { beginMoveResources( sourceResourceGroupName: string, parameters: ResourcesMoveInfo, - options?: ResourcesMoveResourcesOptionalParams + options?: ResourcesMoveResourcesOptionalParams, ): Promise, void>>; /** * The resources to be moved must be in the same source resource group in the source subscription being @@ -83,7 +83,7 @@ export interface Resources { beginMoveResourcesAndWait( sourceResourceGroupName: string, parameters: ResourcesMoveInfo, - options?: ResourcesMoveResourcesOptionalParams + options?: ResourcesMoveResourcesOptionalParams, ): Promise; /** * This operation checks whether the specified resources can be moved to the target. The resources to @@ -100,7 +100,7 @@ export interface Resources { beginValidateMoveResources( sourceResourceGroupName: string, parameters: ResourcesMoveInfo, - options?: ResourcesValidateMoveResourcesOptionalParams + options?: ResourcesValidateMoveResourcesOptionalParams, ): Promise, void>>; /** * This operation checks whether the specified resources can be moved to the target. The resources to @@ -117,7 +117,7 @@ export interface Resources { beginValidateMoveResourcesAndWait( sourceResourceGroupName: string, parameters: ResourcesMoveInfo, - options?: ResourcesValidateMoveResourcesOptionalParams + options?: ResourcesValidateMoveResourcesOptionalParams, ): Promise; /** * Checks whether a resource exists. @@ -137,7 +137,7 @@ export interface Resources { resourceType: string, resourceName: string, apiVersion: string, - options?: ResourcesCheckExistenceOptionalParams + options?: ResourcesCheckExistenceOptionalParams, ): Promise; /** * Deletes a resource. @@ -157,7 +157,7 @@ export interface Resources { resourceType: string, resourceName: string, apiVersion: string, - options?: ResourcesDeleteOptionalParams + options?: ResourcesDeleteOptionalParams, ): Promise, void>>; /** * Deletes a resource. @@ -177,7 +177,7 @@ export interface Resources { resourceType: string, resourceName: string, apiVersion: string, - options?: ResourcesDeleteOptionalParams + options?: ResourcesDeleteOptionalParams, ): Promise; /** * Creates a resource. @@ -199,7 +199,7 @@ export interface Resources { resourceName: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesCreateOrUpdateOptionalParams + options?: ResourcesCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -226,7 +226,7 @@ export interface Resources { resourceName: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesCreateOrUpdateOptionalParams + options?: ResourcesCreateOrUpdateOptionalParams, ): Promise; /** * Updates a resource. @@ -248,7 +248,7 @@ export interface Resources { resourceName: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesUpdateOptionalParams + options?: ResourcesUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -275,7 +275,7 @@ export interface Resources { resourceName: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesUpdateOptionalParams + options?: ResourcesUpdateOptionalParams, ): Promise; /** * Gets a resource. @@ -295,10 +295,12 @@ export interface Resources { resourceType: string, resourceName: string, apiVersion: string, - options?: ResourcesGetOptionalParams + options?: ResourcesGetOptionalParams, ): Promise; /** - * Checks by ID whether a resource exists. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource + * providers. In the event that a Resource provider does not implement this API, ARM will respond with + * a 405. The alternative then is to use the GET API to check for the existence of the resource. * @param resourceId The fully qualified ID of the resource, including the resource name and resource * type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} @@ -308,7 +310,7 @@ export interface Resources { checkExistenceById( resourceId: string, apiVersion: string, - options?: ResourcesCheckExistenceByIdOptionalParams + options?: ResourcesCheckExistenceByIdOptionalParams, ): Promise; /** * Deletes a resource by ID. @@ -321,7 +323,7 @@ export interface Resources { beginDeleteById( resourceId: string, apiVersion: string, - options?: ResourcesDeleteByIdOptionalParams + options?: ResourcesDeleteByIdOptionalParams, ): Promise, void>>; /** * Deletes a resource by ID. @@ -334,7 +336,7 @@ export interface Resources { beginDeleteByIdAndWait( resourceId: string, apiVersion: string, - options?: ResourcesDeleteByIdOptionalParams + options?: ResourcesDeleteByIdOptionalParams, ): Promise; /** * Create a resource by ID. @@ -349,7 +351,7 @@ export interface Resources { resourceId: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesCreateOrUpdateByIdOptionalParams + options?: ResourcesCreateOrUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -369,7 +371,7 @@ export interface Resources { resourceId: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesCreateOrUpdateByIdOptionalParams + options?: ResourcesCreateOrUpdateByIdOptionalParams, ): Promise; /** * Updates a resource by ID. @@ -384,7 +386,7 @@ export interface Resources { resourceId: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesUpdateByIdOptionalParams + options?: ResourcesUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -404,7 +406,7 @@ export interface Resources { resourceId: string, apiVersion: string, parameters: GenericResource, - options?: ResourcesUpdateByIdOptionalParams + options?: ResourcesUpdateByIdOptionalParams, ): Promise; /** * Gets a resource by ID. @@ -417,6 +419,6 @@ export interface Resources { getById( resourceId: string, apiVersion: string, - options?: ResourcesGetByIdOptionalParams + options?: ResourcesGetByIdOptionalParams, ): Promise; } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts index 134193a3164f..a3f1cc1e0c37 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { TagDetails, TagsListOptionalParams, @@ -24,7 +25,7 @@ import { TagsUpdateAtScopeResponse, TagsGetAtScopeOptionalParams, TagsGetAtScopeResponse, - TagsDeleteAtScopeOptionalParams + TagsDeleteAtScopeOptionalParams, } from "../models"; /// @@ -38,7 +39,7 @@ export interface TagsOperations { * @param options The options parameters. */ list( - options?: TagsListOptionalParams + options?: TagsListOptionalParams, ): PagedAsyncIterableIterator; /** * This operation allows deleting a value from the list of predefined values for an existing predefined @@ -51,7 +52,7 @@ export interface TagsOperations { deleteValue( tagName: string, tagValue: string, - options?: TagsDeleteValueOptionalParams + options?: TagsDeleteValueOptionalParams, ): Promise; /** * This operation allows adding a value to the list of predefined values for an existing predefined tag @@ -63,7 +64,7 @@ export interface TagsOperations { createOrUpdateValue( tagName: string, tagValue: string, - options?: TagsCreateOrUpdateValueOptionalParams + options?: TagsCreateOrUpdateValueOptionalParams, ): Promise; /** * This operation allows adding a name to the list of predefined tag names for the given subscription. @@ -74,7 +75,7 @@ export interface TagsOperations { */ createOrUpdate( tagName: string, - options?: TagsCreateOrUpdateOptionalParams + options?: TagsCreateOrUpdateOptionalParams, ): Promise; /** * This operation allows deleting a name from the list of predefined tag names for the given @@ -91,10 +92,27 @@ export interface TagsOperations { * @param parameters Wrapper resource for tags API requests and responses. * @param options The options parameters. */ - createOrUpdateAtScope( + beginCreateOrUpdateAtScope( scope: string, parameters: TagsResource, - options?: TagsCreateOrUpdateAtScopeOptionalParams + options?: TagsCreateOrUpdateAtScopeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TagsCreateOrUpdateAtScopeResponse + > + >; + /** + * This operation allows adding or replacing the entire set of tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param options The options parameters. + */ + beginCreateOrUpdateAtScopeAndWait( + scope: string, + parameters: TagsResource, + options?: TagsCreateOrUpdateAtScopeOptionalParams, ): Promise; /** * This operation allows replacing, merging or selectively deleting tags on the specified resource or @@ -106,10 +124,30 @@ export interface TagsOperations { * @param parameters Wrapper resource for tags patch API request only. * @param options The options parameters. */ - updateAtScope( + beginUpdateAtScope( scope: string, parameters: TagsPatchResource, - options?: TagsUpdateAtScopeOptionalParams + options?: TagsUpdateAtScopeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TagsUpdateAtScopeResponse + > + >; + /** + * This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The + * 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows + * adding tags with new names and updating the values of tags with existing names. The 'delete' option + * allows selectively deleting tags based on given names or name/value pairs. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param options The options parameters. + */ + beginUpdateAtScopeAndWait( + scope: string, + parameters: TagsPatchResource, + options?: TagsUpdateAtScopeOptionalParams, ): Promise; /** * Gets the entire set of tags on a resource or subscription. @@ -118,15 +156,24 @@ export interface TagsOperations { */ getAtScope( scope: string, - options?: TagsGetAtScopeOptionalParams + options?: TagsGetAtScopeOptionalParams, ): Promise; /** * Deletes the entire set of tags on a resource or subscription. * @param scope The resource scope. * @param options The options parameters. */ - deleteAtScope( + beginDeleteAtScope( + scope: string, + options?: TagsDeleteAtScopeOptionalParams, + ): Promise, void>>; + /** + * Deletes the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param options The options parameters. + */ + beginDeleteAtScopeAndWait( scope: string, - options?: TagsDeleteAtScopeOptionalParams + options?: TagsDeleteAtScopeOptionalParams, ): Promise; } diff --git a/sdk/resources/arm-resources/src/pagingHelper.ts b/sdk/resources/arm-resources/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/resources/arm-resources/src/pagingHelper.ts +++ b/sdk/resources/arm-resources/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index b6e0ea258726..b31e63950f40 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { @@ -22,7 +22,7 @@ import { ResourcesImpl, ResourceGroupsImpl, TagsOperationsImpl, - DeploymentOperationsImpl + DeploymentOperationsImpl, } from "./operations"; import { Operations, @@ -32,14 +32,14 @@ import { Resources, ResourceGroups, TagsOperations, - DeploymentOperations + DeploymentOperations, } from "./operationsInterfaces"; import { ResourceManagementClientOptionalParams } from "./models"; export class ResourceManagementClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the ResourceManagementClient class. @@ -50,13 +50,27 @@ export class ResourceManagementClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ResourceManagementClientOptionalParams + options?: ResourceManagementClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: ResourceManagementClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: ResourceManagementClientOptionalParams | string, + options?: ResourceManagementClientOptionalParams, ) { 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 @@ -65,10 +79,10 @@ export class ResourceManagementClient extends coreClient.ServiceClient { } const defaults: ResourceManagementClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-resources/5.2.1`; + const packageDetails = `azsdk-js-arm-resources/6.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -78,20 +92,21 @@ export class ResourceManagementClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -101,7 +116,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -111,9 +126,9 @@ export class ResourceManagementClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -121,7 +136,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-04-01"; + this.apiVersion = options.apiVersion || "2024-11-01"; this.operations = new OperationsImpl(this); this.deployments = new DeploymentsImpl(this); this.providers = new ProvidersImpl(this); @@ -142,7 +157,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -156,7 +171,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/resources/arm-resources/test/sampleTest.ts b/sdk/resources/arm-resources/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/resources/arm-resources/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/arm-resources/tsconfig.json b/sdk/resources/arm-resources/tsconfig.json index b26efa5c66ab..b35d05ad6e9d 100644 --- a/sdk/resources/arm-resources/tsconfig.json +++ b/sdk/resources/arm-resources/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resources": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md index 54f8a2ed2859..5759de2f03aa 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure DeploymentStacks** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json index 711ebacb70e8..267db4618701 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json @@ -1,8 +1,8 @@ { - "commit": "3a9110b06d1053fb4ef5f5c56002506dcc283c95", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true", + "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.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.9", - "use": "@autorest/typescript@6.0.23" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json index 2b19fa14e783..698af97a118b 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json @@ -8,11 +8,11 @@ "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.6.0", - "@azure/core-client": "^1.7.0", "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, @@ -28,19 +28,19 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-resourcesdeploymentstacks.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.1.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", - "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", "tsx": "^4.7.1", - "typescript": "~5.6.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -68,28 +68,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -102,13 +102,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks" +} \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/sampleTest.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/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/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json index 322d36191552..36d3b14667f6 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json @@ -15,17 +15,20 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resourcesdeploymentstacks": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/templatespecs/arm-templatespecs/CHANGELOG.md b/sdk/templatespecs/arm-templatespecs/CHANGELOG.md index cabbd0a67e3b..52cde41f0235 100644 --- a/sdk/templatespecs/arm-templatespecs/CHANGELOG.md +++ b/sdk/templatespecs/arm-templatespecs/CHANGELOG.md @@ -1,15 +1,33 @@ # Release History - -## 2.1.1 (Unreleased) - + +## 3.0.0 (2024-12-10) + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation TemplateSpecs.getBuiltIn + - Added operation TemplateSpecs.listBuiltIns + - Added operation TemplateSpecVersions.getBuiltIn + - Added operation TemplateSpecVersions.listBuiltIns + - Added Interface TemplateSpecsGetBuiltInOptionalParams + - Added Interface TemplateSpecsListBuiltInsNextOptionalParams + - Added Interface TemplateSpecsListBuiltInsOptionalParams + - Added Interface TemplateSpecVersionsGetBuiltInOptionalParams + - Added Interface TemplateSpecVersionsListBuiltInsNextOptionalParams + - Added Interface TemplateSpecVersionsListBuiltInsOptionalParams + - Added Type Alias TemplateSpecsGetBuiltInResponse + - Added Type Alias TemplateSpecsListBuiltInsNextResponse + - Added Type Alias TemplateSpecsListBuiltInsResponse + - Added Type Alias TemplateSpecVersionsGetBuiltInResponse + - Added Type Alias TemplateSpecVersionsListBuiltInsNextResponse + - Added Type Alias TemplateSpecVersionsListBuiltInsResponse -### Other Changes +### Breaking Changes + - Class TemplateSpecsClient has a new signature + - Interface TemplateSpecsListByResourceGroupNextOptionalParams no longer has parameter expand + - Interface TemplateSpecsListBySubscriptionNextOptionalParams no longer has parameter expand + + ## 2.1.0 (2022-11-23) ### Features Added @@ -21,10 +39,10 @@ ## 2.0.1 (2022-04-18) -### Features Added +**features** - Bug fix ## 2.0.0 (2021-12-16) -- The package of @azure/arm-templatespecs is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +- The package of @azure/arm-templatespecs is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/templatespecs/arm-templatespecs/LICENSE b/sdk/templatespecs/arm-templatespecs/LICENSE index 5d1d36e0af80..7d5934740965 100644 --- a/sdk/templatespecs/arm-templatespecs/LICENSE +++ b/sdk/templatespecs/arm-templatespecs/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2024 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/templatespecs/arm-templatespecs/README.md b/sdk/templatespecs/arm-templatespecs/README.md index 56b1d57152d2..128e1ad4a9d5 100644 --- a/sdk/templatespecs/arm-templatespecs/README.md +++ b/sdk/templatespecs/arm-templatespecs/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure TemplateSpecs** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/templatespecs/arm-templatespecs/_meta.json b/sdk/templatespecs/arm-templatespecs/_meta.json index 4b98b8203a1f..267db4618701 100644 --- a/sdk/templatespecs/arm-templatespecs/_meta.json +++ b/sdk/templatespecs/arm-templatespecs/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "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", + "commit": "5da5b2929683c6389262afe133f3b62ade3b33aa", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/templatespecs/arm-templatespecs/package.json b/sdk/templatespecs/arm-templatespecs/package.json index d868df048f49..1f3740f12c04 100644 --- a/sdk/templatespecs/arm-templatespecs/package.json +++ b/sdk/templatespecs/arm-templatespecs/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for TemplateSpecsClient.", - "version": "2.1.1", + "version": "3.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.6.1", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -26,19 +26,20 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-templatespecs.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/templatespecs/arm-templatespecs", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -65,28 +66,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -99,12 +100,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-templatespecs?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/templatespecs/arm-templatespecs" +} \ No newline at end of file diff --git a/sdk/templatespecs/arm-templatespecs/review/arm-templatespecs.api.md b/sdk/templatespecs/arm-templatespecs/review/arm-templatespecs.api.md index 56c81b6f8c56..a45a09d0af6b 100644 --- a/sdk/templatespecs/arm-templatespecs/review/arm-templatespecs.api.md +++ b/sdk/templatespecs/arm-templatespecs/review/arm-templatespecs.api.md @@ -88,6 +88,8 @@ export interface TemplateSpecs { createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpec: TemplateSpec, options?: TemplateSpecsCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, templateSpecName: string, options?: TemplateSpecsDeleteOptionalParams): Promise; get(resourceGroupName: string, templateSpecName: string, options?: TemplateSpecsGetOptionalParams): Promise; + getBuiltIn(templateSpecName: string, options?: TemplateSpecsGetBuiltInOptionalParams): Promise; + listBuiltIns(options?: TemplateSpecsListBuiltInsOptionalParams): PagedAsyncIterableIterator; listByResourceGroup(resourceGroupName: string, options?: TemplateSpecsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: TemplateSpecsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, templateSpecName: string, options?: TemplateSpecsUpdateOptionalParams): Promise; @@ -98,10 +100,11 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: TemplateSpecsClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: TemplateSpecsClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) - subscriptionId: string; + subscriptionId?: string; // (undocumented) templateSpecs: TemplateSpecs; // (undocumented) @@ -131,6 +134,14 @@ export interface TemplateSpecsError { error?: ErrorResponse; } +// @public +export interface TemplateSpecsGetBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: TemplateSpecExpandKind; +} + +// @public +export type TemplateSpecsGetBuiltInResponse = TemplateSpec; + // @public export interface TemplateSpecsGetOptionalParams extends coreClient.OperationOptions { expand?: TemplateSpecExpandKind; @@ -140,10 +151,24 @@ export interface TemplateSpecsGetOptionalParams extends coreClient.OperationOpti export type TemplateSpecsGetResponse = TemplateSpec; // @public -export interface TemplateSpecsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface TemplateSpecsListBuiltInsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TemplateSpecsListBuiltInsNextResponse = TemplateSpecsListResult; + +// @public +export interface TemplateSpecsListBuiltInsOptionalParams extends coreClient.OperationOptions { expand?: TemplateSpecExpandKind; } +// @public +export type TemplateSpecsListBuiltInsResponse = TemplateSpecsListResult; + +// @public +export interface TemplateSpecsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + // @public export type TemplateSpecsListByResourceGroupNextResponse = TemplateSpecsListResult; @@ -157,7 +182,6 @@ export type TemplateSpecsListByResourceGroupResponse = TemplateSpecsListResult; // @public export interface TemplateSpecsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { - expand?: TemplateSpecExpandKind; } // @public @@ -217,7 +241,9 @@ export interface TemplateSpecVersions { createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: TemplateSpecVersion, options?: TemplateSpecVersionsCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: TemplateSpecVersionsDeleteOptionalParams): Promise; get(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: TemplateSpecVersionsGetOptionalParams): Promise; + getBuiltIn(templateSpecName: string, templateSpecVersion: string, options?: TemplateSpecVersionsGetBuiltInOptionalParams): Promise; list(resourceGroupName: string, templateSpecName: string, options?: TemplateSpecVersionsListOptionalParams): PagedAsyncIterableIterator; + listBuiltIns(templateSpecName: string, options?: TemplateSpecVersionsListBuiltInsOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: TemplateSpecVersionsUpdateOptionalParams): Promise; } @@ -232,6 +258,13 @@ export type TemplateSpecVersionsCreateOrUpdateResponse = TemplateSpecVersion; export interface TemplateSpecVersionsDeleteOptionalParams extends coreClient.OperationOptions { } +// @public +export interface TemplateSpecVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TemplateSpecVersionsGetBuiltInResponse = TemplateSpecVersion; + // @public export interface TemplateSpecVersionsGetOptionalParams extends coreClient.OperationOptions { } @@ -239,6 +272,20 @@ export interface TemplateSpecVersionsGetOptionalParams extends coreClient.Operat // @public export type TemplateSpecVersionsGetResponse = TemplateSpecVersion; +// @public +export interface TemplateSpecVersionsListBuiltInsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TemplateSpecVersionsListBuiltInsNextResponse = TemplateSpecVersionsListResult; + +// @public +export interface TemplateSpecVersionsListBuiltInsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TemplateSpecVersionsListBuiltInsResponse = TemplateSpecVersionsListResult; + // @public export interface TemplateSpecVersionsListNextOptionalParams extends coreClient.OperationOptions { } diff --git a/sdk/templatespecs/arm-templatespecs/sample.env b/sdk/templatespecs/arm-templatespecs/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/templatespecs/arm-templatespecs/sample.env +++ b/sdk/templatespecs/arm-templatespecs/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/templatespecs/arm-templatespecs/src/models/index.ts b/sdk/templatespecs/arm-templatespecs/src/models/index.ts index f5969135d28f..177fa2d2f020 100644 --- a/sdk/templatespecs/arm-templatespecs/src/models/index.ts +++ b/sdk/templatespecs/arm-templatespecs/src/models/index.ts @@ -204,7 +204,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -222,7 +222,7 @@ export type CreatedByType = string; /** Known values of {@link TemplateSpecExpandKind} that the service accepts. */ export enum KnownTemplateSpecExpandKind { /** Includes version information with the Template Spec. */ - Versions = "versions" + Versions = "versions", } /** @@ -286,24 +286,47 @@ export interface TemplateSpecsListByResourceGroupOptionalParams export type TemplateSpecsListByResourceGroupResponse = TemplateSpecsListResult; /** Optional parameters. */ -export interface TemplateSpecsListBySubscriptionNextOptionalParams +export interface TemplateSpecsGetBuiltInOptionalParams extends coreClient.OperationOptions { /** Allows for expansion of additional Template Spec details in the response. Optional. */ expand?: TemplateSpecExpandKind; } -/** Contains response data for the listBySubscriptionNext operation. */ -export type TemplateSpecsListBySubscriptionNextResponse = TemplateSpecsListResult; +/** Contains response data for the getBuiltIn operation. */ +export type TemplateSpecsGetBuiltInResponse = TemplateSpec; /** Optional parameters. */ -export interface TemplateSpecsListByResourceGroupNextOptionalParams +export interface TemplateSpecsListBuiltInsOptionalParams extends coreClient.OperationOptions { /** Allows for expansion of additional Template Spec details in the response. Optional. */ expand?: TemplateSpecExpandKind; } +/** Contains response data for the listBuiltIns operation. */ +export type TemplateSpecsListBuiltInsResponse = TemplateSpecsListResult; + +/** Optional parameters. */ +export interface TemplateSpecsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type TemplateSpecsListBySubscriptionNextResponse = + TemplateSpecsListResult; + +/** Optional parameters. */ +export interface TemplateSpecsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the listByResourceGroupNext operation. */ -export type TemplateSpecsListByResourceGroupNextResponse = TemplateSpecsListResult; +export type TemplateSpecsListByResourceGroupNextResponse = + TemplateSpecsListResult; + +/** Optional parameters. */ +export interface TemplateSpecsListBuiltInsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltInsNext operation. */ +export type TemplateSpecsListBuiltInsNextResponse = TemplateSpecsListResult; /** Optional parameters. */ export interface TemplateSpecVersionsCreateOrUpdateOptionalParams @@ -340,12 +363,36 @@ export interface TemplateSpecVersionsListOptionalParams /** Contains response data for the list operation. */ export type TemplateSpecVersionsListResponse = TemplateSpecVersionsListResult; +/** Optional parameters. */ +export interface TemplateSpecVersionsListBuiltInsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltIns operation. */ +export type TemplateSpecVersionsListBuiltInsResponse = + TemplateSpecVersionsListResult; + +/** Optional parameters. */ +export interface TemplateSpecVersionsGetBuiltInOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getBuiltIn operation. */ +export type TemplateSpecVersionsGetBuiltInResponse = TemplateSpecVersion; + /** Optional parameters. */ export interface TemplateSpecVersionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type TemplateSpecVersionsListNextResponse = TemplateSpecVersionsListResult; +export type TemplateSpecVersionsListNextResponse = + TemplateSpecVersionsListResult; + +/** Optional parameters. */ +export interface TemplateSpecVersionsListBuiltInsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltInsNext operation. */ +export type TemplateSpecVersionsListBuiltInsNextResponse = + TemplateSpecVersionsListResult; /** Optional parameters. */ export interface TemplateSpecsClientOptionalParams diff --git a/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts b/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts index b005c1e9585b..40955cd6bbdb 100644 --- a/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts +++ b/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts @@ -17,25 +17,25 @@ export const TemplateSpecVersionInfo: coreClient.CompositeMapper = { serializedName: "description", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, timeCreated: { serializedName: "timeCreated", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, timeModified: { serializedName: "timeModified", readOnly: true, type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const AzureResourceBase: coreClient.CompositeMapper = { @@ -47,32 +47,32 @@ export const AzureResourceBase: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } - } - } - } + className: "SystemData", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -83,41 +83,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const TemplateSpecsError: coreClient.CompositeMapper = { @@ -129,11 +129,11 @@ export const TemplateSpecsError: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -145,22 +145,22 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -170,10 +170,10 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" - } - } - } + className: "ErrorResponse", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -183,13 +183,13 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -201,19 +201,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const TemplateSpecsListResult: coreClient.CompositeMapper = { @@ -228,20 +228,20 @@ export const TemplateSpecsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TemplateSpec" - } - } - } + className: "TemplateSpec", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const LinkedTemplateArtifact: coreClient.CompositeMapper = { @@ -253,19 +253,19 @@ export const LinkedTemplateArtifact: coreClient.CompositeMapper = { serializedName: "path", required: true, type: { - name: "String" - } + name: "String", + }, }, template: { serializedName: "template", required: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const TemplateSpecVersionsListResult: coreClient.CompositeMapper = { @@ -280,20 +280,20 @@ export const TemplateSpecVersionsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TemplateSpecVersion" - } - } - } + className: "TemplateSpecVersion", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TemplateSpec: coreClient.CompositeMapper = { @@ -306,40 +306,40 @@ export const TemplateSpec: coreClient.CompositeMapper = { serializedName: "location", required: true, type: { - name: "String" - } + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, description: { constraints: { - MaxLength: 4096 + MaxLength: 4096, }, serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, displayName: { constraints: { - MaxLength: 64 + MaxLength: 64, }, serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, metadata: { serializedName: "properties.metadata", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, versions: { serializedName: "properties.versions", @@ -347,12 +347,12 @@ export const TemplateSpec: coreClient.CompositeMapper = { type: { name: "Dictionary", value: { - type: { name: "Composite", className: "TemplateSpecVersionInfo" } - } - } - } - } - } + type: { name: "Composite", className: "TemplateSpecVersionInfo" }, + }, + }, + }, + }, + }, }; export const TemplateSpecUpdateModel: coreClient.CompositeMapper = { @@ -365,11 +365,11 @@ export const TemplateSpecUpdateModel: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const TemplateSpecVersion: coreClient.CompositeMapper = { @@ -382,24 +382,24 @@ export const TemplateSpecVersion: coreClient.CompositeMapper = { serializedName: "location", required: true, type: { - name: "String" - } + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, description: { constraints: { - MaxLength: 4096 + MaxLength: 4096, }, serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, linkedTemplates: { serializedName: "properties.linkedTemplates", @@ -408,34 +408,34 @@ export const TemplateSpecVersion: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "LinkedTemplateArtifact" - } - } - } + className: "LinkedTemplateArtifact", + }, + }, + }, }, metadata: { serializedName: "properties.metadata", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, mainTemplate: { serializedName: "properties.mainTemplate", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, uiFormDefinition: { serializedName: "properties.uiFormDefinition", type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const TemplateSpecVersionUpdateModel: coreClient.CompositeMapper = { @@ -448,9 +448,9 @@ export const TemplateSpecVersionUpdateModel: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; diff --git a/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts b/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts index e73e2a813d0a..1f582549f5cc 100644 --- a/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts +++ b/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts @@ -9,13 +9,13 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { TemplateSpec as TemplateSpecMapper, TemplateSpecUpdateModel as TemplateSpecUpdateModelMapper, TemplateSpecVersion as TemplateSpecVersionMapper, - TemplateSpecVersionUpdateModel as TemplateSpecVersionUpdateModelMapper + TemplateSpecVersionUpdateModel as TemplateSpecVersionUpdateModelMapper, } from "../models/mappers"; export const contentType: OperationParameter = { @@ -25,14 +25,14 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const templateSpec: OperationParameter = { parameterPath: "templateSpec", - mapper: TemplateSpecMapper + mapper: TemplateSpecMapper, }; export const accept: OperationParameter = { @@ -42,9 +42,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -53,10 +53,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -65,9 +65,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -76,14 +76,14 @@ export const resourceGroupName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const templateSpecName: OperationURLParameter = { @@ -92,31 +92,31 @@ export const templateSpecName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "templateSpecName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-05-01", + defaultValue: "2022-02-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const templateSpec1: OperationParameter = { parameterPath: ["options", "templateSpec"], - mapper: TemplateSpecUpdateModelMapper + mapper: TemplateSpecUpdateModelMapper, }; export const expand: OperationQueryParameter = { @@ -124,9 +124,9 @@ export const expand: OperationQueryParameter = { mapper: { serializedName: "$expand", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -135,15 +135,15 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const templateSpecVersionModel: OperationParameter = { parameterPath: "templateSpecVersionModel", - mapper: TemplateSpecVersionMapper + mapper: TemplateSpecVersionMapper, }; export const templateSpecVersion: OperationURLParameter = { @@ -152,17 +152,17 @@ export const templateSpecVersion: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "templateSpecVersion", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const templateSpecVersionUpdateModel: OperationParameter = { parameterPath: ["options", "templateSpecVersionUpdateModel"], - mapper: TemplateSpecVersionUpdateModelMapper + mapper: TemplateSpecVersionUpdateModelMapper, }; diff --git a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts index b83a63c3b034..beb8adb13058 100644 --- a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts +++ b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts @@ -18,6 +18,9 @@ import { TemplateSpecVersionsListNextOptionalParams, TemplateSpecVersionsListOptionalParams, TemplateSpecVersionsListResponse, + TemplateSpecVersionsListBuiltInsNextOptionalParams, + TemplateSpecVersionsListBuiltInsOptionalParams, + TemplateSpecVersionsListBuiltInsResponse, TemplateSpecVersionsCreateOrUpdateOptionalParams, TemplateSpecVersionsCreateOrUpdateResponse, TemplateSpecVersionsUpdateOptionalParams, @@ -25,7 +28,10 @@ import { TemplateSpecVersionsGetOptionalParams, TemplateSpecVersionsGetResponse, TemplateSpecVersionsDeleteOptionalParams, - TemplateSpecVersionsListNextResponse + TemplateSpecVersionsGetBuiltInOptionalParams, + TemplateSpecVersionsGetBuiltInResponse, + TemplateSpecVersionsListNextResponse, + TemplateSpecVersionsListBuiltInsNextResponse, } from "../models"; /// @@ -50,12 +56,12 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { public list( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecVersionsListOptionalParams + options?: TemplateSpecVersionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll( resourceGroupName, templateSpecName, - options + options, ); return { next() { @@ -72,9 +78,9 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName, templateSpecName, options, - settings + settings, ); - } + }, }; } @@ -82,7 +88,7 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, options?: TemplateSpecVersionsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TemplateSpecVersionsListResponse; let continuationToken = settings?.continuationToken; @@ -98,7 +104,7 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName, templateSpecName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -110,12 +116,77 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { private async *listPagingAll( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecVersionsListOptionalParams + options?: TemplateSpecVersionsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, templateSpecName, - options + options, + )) { + yield* page; + } + } + + /** + * Lists all the Template Spec versions in the specified built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + public listBuiltIns( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBuiltInsPagingAll(templateSpecName, 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.listBuiltInsPagingPage(templateSpecName, options, settings); + }, + }; + } + + private async *listBuiltInsPagingPage( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TemplateSpecVersionsListBuiltInsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBuiltIns(templateSpecName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBuiltInsNext( + templateSpecName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBuiltInsPagingAll( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBuiltInsPagingPage( + templateSpecName, + options, )) { yield* page; } @@ -134,7 +205,7 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: TemplateSpecVersion, - options?: TemplateSpecVersionsCreateOrUpdateOptionalParams + options?: TemplateSpecVersionsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -142,9 +213,9 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { templateSpecName, templateSpecVersion, templateSpecVersionModel, - options + options, }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -159,11 +230,11 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsUpdateOptionalParams + options?: TemplateSpecVersionsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, templateSpecVersion, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -178,11 +249,11 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsGetOptionalParams + options?: TemplateSpecVersionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, templateSpecVersion, options }, - getOperationSpec + getOperationSpec, ); } @@ -198,11 +269,11 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsDeleteOptionalParams + options?: TemplateSpecVersionsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, templateSpecVersion, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -215,11 +286,43 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { private _list( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecVersionsListOptionalParams + options?: TemplateSpecVersionsListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, options }, - listOperationSpec + listOperationSpec, + ); + } + + /** + * Lists all the Template Spec versions in the specified built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + private _listBuiltIns( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { templateSpecName, options }, + listBuiltInsOperationSpec, + ); + } + + /** + * Gets a Template Spec version from a specific built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param options The options parameters. + */ + getBuiltIn( + templateSpecName: string, + templateSpecVersion: string, + options?: TemplateSpecVersionsGetBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { templateSpecName, templateSpecVersion, options }, + getBuiltInOperationSpec, ); } @@ -234,11 +337,28 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, nextLink: string, - options?: TemplateSpecVersionsListNextOptionalParams + options?: TemplateSpecVersionsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, + ); + } + + /** + * ListBuiltInsNext + * @param templateSpecName Name of the Template Spec. + * @param nextLink The nextLink from the previous successful call to the ListBuiltIns method. + * @param options The options parameters. + */ + private _listBuiltInsNext( + templateSpecName: string, + nextLink: string, + options?: TemplateSpecVersionsListBuiltInsNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { templateSpecName, nextLink, options }, + listBuiltInsNextOperationSpec, ); } } @@ -246,19 +366,18 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersion + bodyMapper: Mappers.TemplateSpecVersion, }, 201: { - bodyMapper: Mappers.TemplateSpecVersion + bodyMapper: Mappers.TemplateSpecVersion, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, requestBody: Parameters.templateSpecVersionModel, queryParameters: [Parameters.apiVersion], @@ -267,23 +386,22 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.templateSpecVersion + Parameters.templateSpecVersion, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersion + bodyMapper: Mappers.TemplateSpecVersion, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, requestBody: Parameters.templateSpecVersionUpdateModel, queryParameters: [Parameters.apiVersion], @@ -292,23 +410,22 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.templateSpecVersion + Parameters.templateSpecVersion, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersion + bodyMapper: Mappers.TemplateSpecVersion, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -316,21 +433,20 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.templateSpecVersion + Parameters.templateSpecVersion, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -338,52 +454,105 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.templateSpecVersion + Parameters.templateSpecVersion, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersionsListResult + bodyMapper: Mappers.TemplateSpecVersionsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const listBuiltInsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersionsListResult, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.templateSpecName], + headerParameters: [Parameters.accept], + serializer, +}; +const getBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersion, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.templateSpecName, + Parameters.templateSpecVersion, + ], + headerParameters: [Parameters.accept], + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersionsListResult + bodyMapper: Mappers.TemplateSpecVersionsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.nextLink + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersionsListResult, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.templateSpecName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts index e64c4815016e..aff1f7b60629 100644 --- a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts +++ b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts @@ -21,6 +21,9 @@ import { TemplateSpecsListByResourceGroupNextOptionalParams, TemplateSpecsListByResourceGroupOptionalParams, TemplateSpecsListByResourceGroupResponse, + TemplateSpecsListBuiltInsNextOptionalParams, + TemplateSpecsListBuiltInsOptionalParams, + TemplateSpecsListBuiltInsResponse, TemplateSpecsCreateOrUpdateOptionalParams, TemplateSpecsCreateOrUpdateResponse, TemplateSpecsUpdateOptionalParams, @@ -28,8 +31,11 @@ import { TemplateSpecsGetOptionalParams, TemplateSpecsGetResponse, TemplateSpecsDeleteOptionalParams, + TemplateSpecsGetBuiltInOptionalParams, + TemplateSpecsGetBuiltInResponse, TemplateSpecsListBySubscriptionNextResponse, - TemplateSpecsListByResourceGroupNextResponse + TemplateSpecsListByResourceGroupNextResponse, + TemplateSpecsListBuiltInsNextResponse, } from "../models"; /// @@ -50,7 +56,7 @@ export class TemplateSpecsImpl implements TemplateSpecs { * @param options The options parameters. */ public listBySubscription( - options?: TemplateSpecsListBySubscriptionOptionalParams + options?: TemplateSpecsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -65,13 +71,13 @@ export class TemplateSpecsImpl implements TemplateSpecs { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: TemplateSpecsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TemplateSpecsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -92,7 +98,7 @@ export class TemplateSpecsImpl implements TemplateSpecs { } private async *listBySubscriptionPagingAll( - options?: TemplateSpecsListBySubscriptionOptionalParams + options?: TemplateSpecsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -106,7 +112,7 @@ export class TemplateSpecsImpl implements TemplateSpecs { */ public listByResourceGroup( resourceGroupName: string, - options?: TemplateSpecsListByResourceGroupOptionalParams + options?: TemplateSpecsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -123,16 +129,16 @@ export class TemplateSpecsImpl implements TemplateSpecs { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: TemplateSpecsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TemplateSpecsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -147,7 +153,7 @@ export class TemplateSpecsImpl implements TemplateSpecs { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -158,16 +164,70 @@ export class TemplateSpecsImpl implements TemplateSpecs { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: TemplateSpecsListByResourceGroupOptionalParams + options?: TemplateSpecsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } } + /** + * Lists built-in Template Specs. + * @param options The options parameters. + */ + public listBuiltIns( + options?: TemplateSpecsListBuiltInsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBuiltInsPagingAll(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.listBuiltInsPagingPage(options, settings); + }, + }; + } + + private async *listBuiltInsPagingPage( + options?: TemplateSpecsListBuiltInsOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TemplateSpecsListBuiltInsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBuiltIns(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBuiltInsNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBuiltInsPagingAll( + options?: TemplateSpecsListBuiltInsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBuiltInsPagingPage(options)) { + yield* page; + } + } + /** * Creates or updates a Template Spec. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -179,11 +239,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { resourceGroupName: string, templateSpecName: string, templateSpec: TemplateSpec, - options?: TemplateSpecsCreateOrUpdateOptionalParams + options?: TemplateSpecsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, templateSpec, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -196,11 +256,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { update( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsUpdateOptionalParams + options?: TemplateSpecsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -213,11 +273,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { get( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsGetOptionalParams + options?: TemplateSpecsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, options }, - getOperationSpec + getOperationSpec, ); } @@ -230,11 +290,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { delete( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsDeleteOptionalParams + options?: TemplateSpecsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -243,11 +303,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { * @param options The options parameters. */ private _listBySubscription( - options?: TemplateSpecsListBySubscriptionOptionalParams + options?: TemplateSpecsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -258,11 +318,39 @@ export class TemplateSpecsImpl implements TemplateSpecs { */ private _listByResourceGroup( resourceGroupName: string, - options?: TemplateSpecsListByResourceGroupOptionalParams + options?: TemplateSpecsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, + ); + } + + /** + * Gets a built-in Template Spec with a given name. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + getBuiltIn( + templateSpecName: string, + options?: TemplateSpecsGetBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { templateSpecName, options }, + getBuiltInOperationSpec, + ); + } + + /** + * Lists built-in Template Specs. + * @param options The options parameters. + */ + private _listBuiltIns( + options?: TemplateSpecsListBuiltInsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBuiltInsOperationSpec, ); } @@ -273,11 +361,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { */ private _listBySubscriptionNext( nextLink: string, - options?: TemplateSpecsListBySubscriptionNextOptionalParams + options?: TemplateSpecsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } @@ -290,11 +378,26 @@ export class TemplateSpecsImpl implements TemplateSpecs { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: TemplateSpecsListByResourceGroupNextOptionalParams + options?: TemplateSpecsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, + ); + } + + /** + * ListBuiltInsNext + * @param nextLink The nextLink from the previous successful call to the ListBuiltIns method. + * @param options The options parameters. + */ + private _listBuiltInsNext( + nextLink: string, + options?: TemplateSpecsListBuiltInsNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBuiltInsNextOperationSpec, ); } } @@ -302,19 +405,18 @@ export class TemplateSpecsImpl implements TemplateSpecs { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.TemplateSpec + bodyMapper: Mappers.TemplateSpec, }, 201: { - bodyMapper: Mappers.TemplateSpec + bodyMapper: Mappers.TemplateSpec, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, requestBody: Parameters.templateSpec, queryParameters: [Parameters.apiVersion], @@ -322,23 +424,22 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.TemplateSpec + bodyMapper: Mappers.TemplateSpec, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, requestBody: Parameters.templateSpec1, queryParameters: [Parameters.apiVersion], @@ -346,131 +447,172 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpec + bodyMapper: Mappers.TemplateSpec, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecsListResult + bodyMapper: Mappers.TemplateSpecsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecsListResult + bodyMapper: Mappers.TemplateSpecsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const getBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpec, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [Parameters.$host, Parameters.templateSpecName], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/builtInTemplateSpecs/", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecsListResult, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecsListResult + bodyMapper: Mappers.TemplateSpecsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecsListResult + bodyMapper: Mappers.TemplateSpecsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const listBuiltInsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecsListResult, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, }; diff --git a/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecVersions.ts b/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecVersions.ts index 8fd4a0d9a125..6f0104c21d68 100644 --- a/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecVersions.ts +++ b/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecVersions.ts @@ -10,13 +10,16 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { TemplateSpecVersion, TemplateSpecVersionsListOptionalParams, + TemplateSpecVersionsListBuiltInsOptionalParams, TemplateSpecVersionsCreateOrUpdateOptionalParams, TemplateSpecVersionsCreateOrUpdateResponse, TemplateSpecVersionsUpdateOptionalParams, TemplateSpecVersionsUpdateResponse, TemplateSpecVersionsGetOptionalParams, TemplateSpecVersionsGetResponse, - TemplateSpecVersionsDeleteOptionalParams + TemplateSpecVersionsDeleteOptionalParams, + TemplateSpecVersionsGetBuiltInOptionalParams, + TemplateSpecVersionsGetBuiltInResponse, } from "../models"; /// @@ -31,7 +34,16 @@ export interface TemplateSpecVersions { list( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecVersionsListOptionalParams + options?: TemplateSpecVersionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists all the Template Spec versions in the specified built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + listBuiltIns( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, ): PagedAsyncIterableIterator; /** * Creates or updates a Template Spec version. @@ -46,7 +58,7 @@ export interface TemplateSpecVersions { templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: TemplateSpecVersion, - options?: TemplateSpecVersionsCreateOrUpdateOptionalParams + options?: TemplateSpecVersionsCreateOrUpdateOptionalParams, ): Promise; /** * Updates Template Spec Version tags with specified values. @@ -59,7 +71,7 @@ export interface TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsUpdateOptionalParams + options?: TemplateSpecVersionsUpdateOptionalParams, ): Promise; /** * Gets a Template Spec version from a specific Template Spec. @@ -72,7 +84,7 @@ export interface TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsGetOptionalParams + options?: TemplateSpecVersionsGetOptionalParams, ): Promise; /** * Deletes a specific version from a Template Spec. When operation completes, status code 200 returned @@ -86,6 +98,17 @@ export interface TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsDeleteOptionalParams + options?: TemplateSpecVersionsDeleteOptionalParams, ): Promise; + /** + * Gets a Template Spec version from a specific built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param options The options parameters. + */ + getBuiltIn( + templateSpecName: string, + templateSpecVersion: string, + options?: TemplateSpecVersionsGetBuiltInOptionalParams, + ): Promise; } diff --git a/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecs.ts b/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecs.ts index 0c0f41f19ff6..f09e7c56268d 100644 --- a/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecs.ts +++ b/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecs.ts @@ -11,13 +11,16 @@ import { TemplateSpec, TemplateSpecsListBySubscriptionOptionalParams, TemplateSpecsListByResourceGroupOptionalParams, + TemplateSpecsListBuiltInsOptionalParams, TemplateSpecsCreateOrUpdateOptionalParams, TemplateSpecsCreateOrUpdateResponse, TemplateSpecsUpdateOptionalParams, TemplateSpecsUpdateResponse, TemplateSpecsGetOptionalParams, TemplateSpecsGetResponse, - TemplateSpecsDeleteOptionalParams + TemplateSpecsDeleteOptionalParams, + TemplateSpecsGetBuiltInOptionalParams, + TemplateSpecsGetBuiltInResponse, } from "../models"; /// @@ -28,7 +31,7 @@ export interface TemplateSpecs { * @param options The options parameters. */ listBySubscription( - options?: TemplateSpecsListBySubscriptionOptionalParams + options?: TemplateSpecsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Lists all the Template Specs within the specified resource group. @@ -37,7 +40,14 @@ export interface TemplateSpecs { */ listByResourceGroup( resourceGroupName: string, - options?: TemplateSpecsListByResourceGroupOptionalParams + options?: TemplateSpecsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists built-in Template Specs. + * @param options The options parameters. + */ + listBuiltIns( + options?: TemplateSpecsListBuiltInsOptionalParams, ): PagedAsyncIterableIterator; /** * Creates or updates a Template Spec. @@ -50,7 +60,7 @@ export interface TemplateSpecs { resourceGroupName: string, templateSpecName: string, templateSpec: TemplateSpec, - options?: TemplateSpecsCreateOrUpdateOptionalParams + options?: TemplateSpecsCreateOrUpdateOptionalParams, ): Promise; /** * Updates Template Spec tags with specified values. @@ -61,7 +71,7 @@ export interface TemplateSpecs { update( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsUpdateOptionalParams + options?: TemplateSpecsUpdateOptionalParams, ): Promise; /** * Gets a Template Spec with a given name. @@ -72,7 +82,7 @@ export interface TemplateSpecs { get( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsGetOptionalParams + options?: TemplateSpecsGetOptionalParams, ): Promise; /** * Deletes a Template Spec by name. When operation completes, status code 200 returned without content. @@ -83,6 +93,15 @@ export interface TemplateSpecs { delete( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsDeleteOptionalParams + options?: TemplateSpecsDeleteOptionalParams, ): Promise; + /** + * Gets a built-in Template Spec with a given name. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + getBuiltIn( + templateSpecName: string, + options?: TemplateSpecsGetBuiltInOptionalParams, + ): Promise; } diff --git a/sdk/templatespecs/arm-templatespecs/src/pagingHelper.ts b/sdk/templatespecs/arm-templatespecs/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 100644 --- a/sdk/templatespecs/arm-templatespecs/src/pagingHelper.ts +++ b/sdk/templatespecs/arm-templatespecs/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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts b/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts index 00b5d1a469bd..eaaaff754954 100644 --- a/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts +++ b/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { TemplateSpecsImpl, TemplateSpecVersionsImpl } from "./operations"; @@ -20,7 +20,7 @@ import { TemplateSpecsClientOptionalParams } from "./models"; export class TemplateSpecsClient extends coreClient.ServiceClient { $host: string; - subscriptionId: string; + subscriptionId?: string; apiVersion: string; /** @@ -32,13 +32,27 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: TemplateSpecsClientOptionalParams + options?: TemplateSpecsClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: TemplateSpecsClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: TemplateSpecsClientOptionalParams | string, + options?: TemplateSpecsClientOptionalParams, ) { 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 @@ -47,10 +61,10 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { } const defaults: TemplateSpecsClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-templatespecs/2.1.1`; + const packageDetails = `azsdk-js-arm-templatespecs/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -60,20 +74,21 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,7 +98,7 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +108,9 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -103,7 +118,7 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-05-01"; + this.apiVersion = options.apiVersion || "2022-02-01"; this.templateSpecs = new TemplateSpecsImpl(this); this.templateSpecVersions = new TemplateSpecVersionsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); @@ -118,7 +133,7 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -132,7 +147,7 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/templatespecs/arm-templatespecs/test/sampleTest.ts b/sdk/templatespecs/arm-templatespecs/test/sampleTest.ts index 8ff7deb0acbe..d64be981b694 100644 --- a/sdk/templatespecs/arm-templatespecs/test/sampleTest.ts +++ b/sdk/templatespecs/arm-templatespecs/test/sampleTest.ts @@ -9,7 +9,7 @@ import { Recorder, RecorderStartOptions, - env + env, } from "@azure-tools/test-recorder"; import { assert } from "chai"; import { Context } from "mocha"; @@ -18,15 +18,11 @@ 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" + SUBSCRIPTION_ID: "azure_subscription_id", }; const recorderOptions: RecorderStartOptions = { envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], }; describe("My test", () => { diff --git a/sdk/templatespecs/arm-templatespecs/tsconfig.json b/sdk/templatespecs/arm-templatespecs/tsconfig.json index c7cde0db5ad0..c2af6704a33c 100644 --- a/sdk/templatespecs/arm-templatespecs/tsconfig.json +++ b/sdk/templatespecs/arm-templatespecs/tsconfig.json @@ -15,19 +15,19 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-templatespecs": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts", + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" ] -} +} \ No newline at end of file