diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index dfae4c7482c8..781ef27f5664 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3891,7 +3891,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20221114 + typescript: 5.0.0-dev.20221115 dev: false /downlevel-dts/0.8.0: @@ -8839,8 +8839,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20221114: - resolution: {integrity: sha512-lMcxw0oxEhQR0HIZyxhmCiwFqXfPQGtakbc+792/hmPP/pyICuaUUIKyY/7Cl6QPGTplHcGjDPEVbVE46gPVrA==} + /typescript/5.0.0-dev.20221115: + resolution: {integrity: sha512-h2MaHsq3nKjUZF9t/UCwOmitFUC9cFE1bNKHHHvQcoRUoVfriTvvg82RedkT6ixtrqC7RRhYcEJd7S23YioNkw==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -10777,7 +10777,7 @@ packages: dev: false file:projects/arm-changes.tgz: - resolution: {integrity: sha512-tMBkQffEQ58pppZ7ZfL8AiXFxmqTyV7ZtSro8lifz8cQ3l+MAh+KD0fvh5w2VsFK7yL0jk6aSlaiYTiL9Or/iQ==, tarball: file:projects/arm-changes.tgz} + resolution: {integrity: sha512-WearIa1NUNgnVMUfRw8J0HMey/9E9zrW7HaBB1lTgTaK92xnCtxw5zs1Yv5s06frev1yW1qQmfdTMaL9hyv3eQ==, tarball: file:projects/arm-changes.tgz} name: '@rush-temp/arm-changes' version: 0.0.0 dependencies: @@ -10788,6 +10788,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -10795,11 +10797,10 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -12190,7 +12191,7 @@ packages: dev: false file:projects/arm-features.tgz: - resolution: {integrity: sha512-nDgtCrt8VOiTdy/8jSPSEt62aYm5f1yWXHp42eb5PIO+SLMN66ZK3GJXLPaGf94n2ea3uxQHAhzyO4RdPANTZg==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-/kDnHb9Lzx3LesZKCodkkKDm1fHNKuhZW8X2wDL2eTCQjY9KNGIqq59Phn8JYhg1eyrmUV14uCJwyWRcBH+slw==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' version: 0.0.0 dependencies: @@ -12201,6 +12202,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -12208,11 +12211,10 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -12732,7 +12734,7 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-Vdb/Dd+9IFLd8/yto66fCWhX5yjLE+N/v5pxRCYm6PaaUfLPJLXLxHgnqRlEAl++bMBr5CF0qRZPPBo3X/TNLQ==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-ELeF+L0wBmhaqX5ETAhRWiSFVf6uW1NNGCVtGnmJvE6nyFmZxdVwlu5APwzo/IbppUb58AeBX9zjgrLjSsH0Vw==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: @@ -12744,6 +12746,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -12751,11 +12755,10 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -12814,7 +12817,7 @@ packages: dev: false file:projects/arm-locks.tgz: - resolution: {integrity: sha512-9YrBoZujXCT/I6LIevAKmjz0ScHnrEp9zZQxbR1nqp8OM03FoNLNPA1onTVGMUyr7DoGm0J49tIHKFyBjO2s0Q==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-mk6aZPGmnk0NAhPHhJYPlWpQ6tLESh+HRwXziId1uxW3D1m1ezLgTZvAJsqEMx5NutUzn9JiP4DBp6HKshnQiw==, tarball: file:projects/arm-locks.tgz} name: '@rush-temp/arm-locks' version: 0.0.0 dependencies: @@ -12825,6 +12828,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -12832,11 +12837,10 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -12976,7 +12980,7 @@ packages: dev: false file:projects/arm-managedapplications.tgz: - resolution: {integrity: sha512-gAssfJLMnjJ2iYnyct5NmVbVAnp36BqtCvYCLg7BdX9qF074vNL+6HYTjs1xNixM/7HzKsE9cDcdAfkdE34yJw==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-v0bmii5jXDEI1w+ThwblINQhRfQRy+jl3r6I7Zlhm+t9wdQ+Cb4a6FZ9JPNhwRQXPJuZla+NUDZN3WQlB9+G+A==, tarball: file:projects/arm-managedapplications.tgz} name: '@rush-temp/arm-managedapplications' version: 0.0.0 dependencies: @@ -12987,6 +12991,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -12994,11 +13000,10 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -13751,7 +13756,7 @@ packages: dev: false file:projects/arm-policy.tgz: - resolution: {integrity: sha512-0aoayurvwlgHWjOdi5jCc0ry3pIhnzq0mF0MClzKu+qY15y+DBjRYr/RASDfKTK9y3wf5olV0G6Cloa9Q/I1tw==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-UvYKzAdWyVY8XwVGLQ4eHSWe+oG5Z5clg6p7Eckuyy18hATwksZ1ZpNtiPu7k/2Rakjgpqd9/SBJVyX+xiFk3w==, tarball: file:projects/arm-policy.tgz} name: '@rush-temp/arm-policy' version: 0.0.0 dependencies: @@ -13770,7 +13775,7 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' @@ -14345,7 +14350,7 @@ packages: dev: false file:projects/arm-resources-subscriptions.tgz: - resolution: {integrity: sha512-+qD1E3+H1Jz101JiCrgxMve+Co2mv0FcqRc2CXL7i87iV+P8ChGRqr6v+PbOeLetSUddMyvTxQDwa7M8Lf9u/A==, tarball: file:projects/arm-resources-subscriptions.tgz} + resolution: {integrity: sha512-e7C/11MSLiVAj8XhD4yZht0U9XYrTsYyGXXuJCQSWiWvQ0GriQAQ9KBvogj46VCyfEDF0GY2PbDQL9M+ai3ioQ==, tarball: file:projects/arm-resources-subscriptions.tgz} name: '@rush-temp/arm-resources-subscriptions' version: 0.0.0 dependencies: @@ -14356,6 +14361,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -14363,16 +14370,15 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-yfRrlJ8rdEfD5Lv7DEpuf/mk41z8JL6zjl4huSgddGNRHVCj0qK7OQsfRqpiySY240MvR9b1Ox97J34jKrErBg==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-W8UMeEnApEX1OT1/81x+O+V3W7n2scpy1GLxcrbujylDPbcGKTa/hx0d60DA1990AwXWh1ijOB39ztHsPTolMw==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: @@ -14391,11 +14397,12 @@ packages: mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.8.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: + - '@types/node' - supports-color dev: false @@ -15146,7 +15153,7 @@ packages: dev: false file:projects/arm-templatespecs.tgz: - resolution: {integrity: sha512-+aDQN0Sk7EH8V/qLd3c3sC4ncJDY105P8Db7+e1lTcZ2E4w0PFEnHcD9AL2RYqTswenYrCh3vkD3Er1Whxnu1Q==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-v28lOYIq07HTsVDMGJ+bLOO0GGvaWYJhSA+abWaUX2Ay0NswV9EGJ0pH6+LXUuOAGuJjB3ZNd6rwpppkxDmhGw==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' version: 0.0.0 dependencies: @@ -15157,6 +15164,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -15164,11 +15173,10 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false diff --git a/sdk/resources/arm-resources/CHANGELOG.md b/sdk/resources/arm-resources/CHANGELOG.md index 3151a1f12a31..c568c790d5f0 100644 --- a/sdk/resources/arm-resources/CHANGELOG.md +++ b/sdk/resources/arm-resources/CHANGELOG.md @@ -1,15 +1,32 @@ # Release History + +## 6.0.0 (2022-11-15) + +**Features** -## 5.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - 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 TagsCreateOrUpdateAtScopeHeaders + - Added Interface TagsDeleteAtScopeHeaders + - Added Interface TagsUpdateAtScopeHeaders + - 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 + +**Breaking Changes** + + - Removed operation TagsOperations.createOrUpdateAtScope + - Removed operation TagsOperations.deleteAtScope + - Removed operation TagsOperations.updateAtScope + + ## 5.1.0 (2022-11-10) **Features** diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json index 4b98b8203a1f..3dd1e4fc8e3d 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.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": "c9ae1de5e5104c4c86a8bbed7dc804f6359d1ea5", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.2", "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.5.1", + "use": "@autorest/typescript@6.0.0-rc.2" } \ No newline at end of file diff --git a/sdk/resources/arm-resources/package.json b/sdk/resources/arm-resources/package.json index 61ada859ca30..720e8060bb36 100644 --- a/sdk/resources/arm-resources/package.json +++ b/sdk/resources/arm-resources/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ResourceManagementClient.", - "version": "5.1.1", + "version": "6.0.0", "engines": { "node": ">=14.0.0" }, @@ -11,7 +11,7 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.5.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -36,7 +36,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.8.0", + "typescript": "~4.6.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -46,7 +46,6 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", @@ -110,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview" - } -} + "autoPublish": true +} \ 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 20b5d6b5e66e..9450fac49745 100644 --- a/sdk/resources/arm-resources/review/arm-resources.api.md +++ b/sdk/resources/arm-resources/review/arm-resources.api.md @@ -880,9 +880,6 @@ export interface GenericResourceFilter { tagvalue?: string; } -// @public -export function getContinuationToken(page: unknown): string | undefined; - // @public export interface HttpMessage { content?: Record; @@ -1646,8 +1643,15 @@ export interface Tags { }; } +// @public +export interface TagsCreateOrUpdateAtScopeHeaders { + location?: string; +} + // @public export interface TagsCreateOrUpdateAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -1667,8 +1671,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 @@ -1708,15 +1719,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 @@ -1736,8 +1750,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 diff --git a/sdk/resources/arm-resources/src/index.ts b/sdk/resources/arm-resources/src/index.ts index bc3b6b9ec381..3af4903c75a2 100644 --- a/sdk/resources/arm-resources/src/index.ts +++ b/sdk/resources/arm-resources/src/index.ts @@ -7,7 +7,6 @@ */ /// -export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { ResourceManagementClient } from "./resourceManagementClient"; export * from "./operationsInterfaces"; diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 8dc03bc08f1f..4c1dc6c500c6 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -1143,6 +1143,24 @@ export interface DeploymentsWhatIfHeaders { retryAfter?: 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 */ @@ -1994,7 +2012,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; @@ -2120,7 +2138,7 @@ export interface ResourcesListNextOptionalParams 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; @@ -2235,14 +2253,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; @@ -2256,7 +2284,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 diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index 851900fc8315..1eb78402615d 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -2850,3 +2850,48 @@ export const DeploymentsWhatIfHeaders: coreClient.CompositeMapper = { } } }; + +export const TagsCreateOrUpdateAtScopeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsCreateOrUpdateAtScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TagsUpdateAtScopeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsUpdateAtScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TagsDeleteAtScopeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsDeleteAtScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/resources/arm-resources/src/models/parameters.ts b/sdk/resources/arm-resources/src/models/parameters.ts index 4e19dc1f6919..63988e051e3a 100644 --- a/sdk/resources/arm-resources/src/models/parameters.ts +++ b/sdk/resources/arm-resources/src/models/parameters.ts @@ -53,7 +53,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-04-01", + defaultValue: "2022-09-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts index d4ec260b2c0c..705dbf7ffd1c 100644 --- a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts +++ b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts @@ -6,8 +6,7 @@ * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; import { DeploymentOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,29 +16,29 @@ import { DeploymentOperation, DeploymentOperationsListAtScopeNextOptionalParams, DeploymentOperationsListAtScopeOptionalParams, - DeploymentOperationsListAtScopeResponse, DeploymentOperationsListAtTenantScopeNextOptionalParams, DeploymentOperationsListAtTenantScopeOptionalParams, - DeploymentOperationsListAtTenantScopeResponse, DeploymentOperationsListAtManagementGroupScopeNextOptionalParams, DeploymentOperationsListAtManagementGroupScopeOptionalParams, - DeploymentOperationsListAtManagementGroupScopeResponse, DeploymentOperationsListAtSubscriptionScopeNextOptionalParams, DeploymentOperationsListAtSubscriptionScopeOptionalParams, - DeploymentOperationsListAtSubscriptionScopeResponse, DeploymentOperationsListNextOptionalParams, DeploymentOperationsListOptionalParams, - DeploymentOperationsListResponse, DeploymentOperationsGetAtScopeOptionalParams, DeploymentOperationsGetAtScopeResponse, + DeploymentOperationsListAtScopeResponse, DeploymentOperationsGetAtTenantScopeOptionalParams, DeploymentOperationsGetAtTenantScopeResponse, + DeploymentOperationsListAtTenantScopeResponse, DeploymentOperationsGetAtManagementGroupScopeOptionalParams, DeploymentOperationsGetAtManagementGroupScopeResponse, + DeploymentOperationsListAtManagementGroupScopeResponse, DeploymentOperationsGetAtSubscriptionScopeOptionalParams, DeploymentOperationsGetAtSubscriptionScopeResponse, + DeploymentOperationsListAtSubscriptionScopeResponse, DeploymentOperationsGetOptionalParams, DeploymentOperationsGetResponse, + DeploymentOperationsListResponse, DeploymentOperationsListAtScopeNextResponse, DeploymentOperationsListAtTenantScopeNextResponse, DeploymentOperationsListAtManagementGroupScopeNextResponse, @@ -79,16 +78,8 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtScopePagingPage( - scope, - deploymentName, - options, - settings - ); + byPage: () => { + return this.listAtScopePagingPage(scope, deploymentName, options); } }; } @@ -96,18 +87,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listAtScopePagingPage( scope: string, deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams, - settings?: PageSettings + options?: DeploymentOperationsListAtScopeOptionalParams ): AsyncIterableIterator { - let result: DeploymentOperationsListAtScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtScope(scope, deploymentName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtScope(scope, deploymentName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtScopeNext( scope, @@ -116,9 +100,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -153,33 +135,19 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtTenantScopePagingPage( - deploymentName, - options, - settings - ); + byPage: () => { + return this.listAtTenantScopePagingPage(deploymentName, options); } }; } private async *listAtTenantScopePagingPage( deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams, - settings?: PageSettings + options?: DeploymentOperationsListAtTenantScopeOptionalParams ): AsyncIterableIterator { - let result: DeploymentOperationsListAtTenantScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtTenantScope(deploymentName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtTenantScope(deploymentName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtTenantScopeNext( deploymentName, @@ -187,9 +155,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -228,15 +194,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } + byPage: () => { return this.listAtManagementGroupScopePagingPage( groupId, deploymentName, - options, - settings + options ); } }; @@ -245,22 +207,15 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listAtManagementGroupScopePagingPage( groupId: string, deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, - settings?: PageSettings + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams ): AsyncIterableIterator { - let result: DeploymentOperationsListAtManagementGroupScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtManagementGroupScope( - groupId, - deploymentName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtManagementGroupScope( + groupId, + deploymentName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtManagementGroupScopeNext( groupId, @@ -269,9 +224,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -306,33 +259,19 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtSubscriptionScopePagingPage( - deploymentName, - options, - settings - ); + byPage: () => { + return this.listAtSubscriptionScopePagingPage(deploymentName, options); } }; } private async *listAtSubscriptionScopePagingPage( deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, - settings?: PageSettings + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams ): AsyncIterableIterator { - let result: DeploymentOperationsListAtSubscriptionScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtSubscriptionScope(deploymentName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtSubscriptionScope(deploymentName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtSubscriptionScopeNext( deploymentName, @@ -340,9 +279,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -377,16 +314,8 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - deploymentName, - options, - settings - ); + byPage: () => { + return this.listPagingPage(resourceGroupName, deploymentName, options); } }; } @@ -394,18 +323,11 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listPagingPage( resourceGroupName: string, deploymentName: string, - options?: DeploymentOperationsListOptionalParams, - settings?: PageSettings + options?: DeploymentOperationsListOptionalParams ): AsyncIterableIterator { - let result: DeploymentOperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, deploymentName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(resourceGroupName, deploymentName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -414,9 +336,7 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts index c565dfa88fc5..97634950b406 100644 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ b/sdk/resources/arm-resources/src/operations/deployments.ts @@ -6,8 +6,7 @@ * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Deployments } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -19,19 +18,14 @@ import { DeploymentExtended, DeploymentsListAtScopeNextOptionalParams, DeploymentsListAtScopeOptionalParams, - DeploymentsListAtScopeResponse, DeploymentsListAtTenantScopeNextOptionalParams, DeploymentsListAtTenantScopeOptionalParams, - DeploymentsListAtTenantScopeResponse, DeploymentsListAtManagementGroupScopeNextOptionalParams, DeploymentsListAtManagementGroupScopeOptionalParams, - DeploymentsListAtManagementGroupScopeResponse, DeploymentsListAtSubscriptionScopeNextOptionalParams, DeploymentsListAtSubscriptionScopeOptionalParams, - DeploymentsListAtSubscriptionScopeResponse, DeploymentsListByResourceGroupNextOptionalParams, DeploymentsListByResourceGroupOptionalParams, - DeploymentsListByResourceGroupResponse, DeploymentsDeleteAtScopeOptionalParams, DeploymentsCheckExistenceAtScopeOptionalParams, DeploymentsCheckExistenceAtScopeResponse, @@ -45,6 +39,7 @@ import { DeploymentsValidateAtScopeResponse, DeploymentsExportTemplateAtScopeOptionalParams, DeploymentsExportTemplateAtScopeResponse, + DeploymentsListAtScopeResponse, DeploymentsDeleteAtTenantScopeOptionalParams, DeploymentsCheckExistenceAtTenantScopeOptionalParams, DeploymentsCheckExistenceAtTenantScopeResponse, @@ -61,6 +56,7 @@ import { DeploymentsWhatIfAtTenantScopeResponse, DeploymentsExportTemplateAtTenantScopeOptionalParams, DeploymentsExportTemplateAtTenantScopeResponse, + DeploymentsListAtTenantScopeResponse, DeploymentsDeleteAtManagementGroupScopeOptionalParams, DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, DeploymentsCheckExistenceAtManagementGroupScopeResponse, @@ -75,6 +71,7 @@ import { DeploymentsWhatIfAtManagementGroupScopeResponse, DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, DeploymentsExportTemplateAtManagementGroupScopeResponse, + DeploymentsListAtManagementGroupScopeResponse, DeploymentsDeleteAtSubscriptionScopeOptionalParams, DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, DeploymentsCheckExistenceAtSubscriptionScopeResponse, @@ -90,6 +87,7 @@ import { DeploymentsWhatIfAtSubscriptionScopeResponse, DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, DeploymentsExportTemplateAtSubscriptionScopeResponse, + DeploymentsListAtSubscriptionScopeResponse, DeploymentsDeleteOptionalParams, DeploymentsCheckExistenceOptionalParams, DeploymentsCheckExistenceResponse, @@ -104,6 +102,7 @@ import { DeploymentsWhatIfResponse, DeploymentsExportTemplateOptionalParams, DeploymentsExportTemplateResponse, + DeploymentsListByResourceGroupResponse, DeploymentsCalculateTemplateHashOptionalParams, DeploymentsCalculateTemplateHashResponse, DeploymentsListAtScopeNextResponse, @@ -143,35 +142,23 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtScopePagingPage(scope, options, settings); + byPage: () => { + return this.listAtScopePagingPage(scope, options); } }; } private async *listAtScopePagingPage( scope: string, - options?: DeploymentsListAtScopeOptionalParams, - settings?: PageSettings + options?: DeploymentsListAtScopeOptionalParams ): AsyncIterableIterator { - let result: DeploymentsListAtScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtScope(scope, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtScopeNext(scope, continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -199,34 +186,22 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtTenantScopePagingPage(options, settings); + byPage: () => { + return this.listAtTenantScopePagingPage(options); } }; } private async *listAtTenantScopePagingPage( - options?: DeploymentsListAtTenantScopeOptionalParams, - settings?: PageSettings + options?: DeploymentsListAtTenantScopeOptionalParams ): AsyncIterableIterator { - let result: DeploymentsListAtTenantScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtTenantScope(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtTenantScope(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtTenantScopeNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -255,33 +230,19 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtManagementGroupScopePagingPage( - groupId, - options, - settings - ); + byPage: () => { + return this.listAtManagementGroupScopePagingPage(groupId, options); } }; } private async *listAtManagementGroupScopePagingPage( groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams, - settings?: PageSettings + options?: DeploymentsListAtManagementGroupScopeOptionalParams ): AsyncIterableIterator { - let result: DeploymentsListAtManagementGroupScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtManagementGroupScope(groupId, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtManagementGroupScope(groupId, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtManagementGroupScopeNext( groupId, @@ -289,9 +250,7 @@ export class DeploymentsImpl implements Deployments { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -322,37 +281,25 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtSubscriptionScopePagingPage(options, settings); + byPage: () => { + return this.listAtSubscriptionScopePagingPage(options); } }; } private async *listAtSubscriptionScopePagingPage( - options?: DeploymentsListAtSubscriptionScopeOptionalParams, - settings?: PageSettings + options?: DeploymentsListAtSubscriptionScopeOptionalParams ): AsyncIterableIterator { - let result: DeploymentsListAtSubscriptionScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtSubscriptionScope(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtSubscriptionScope(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtSubscriptionScopeNext( continuationToken, options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -382,33 +329,19 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams, - settings?: PageSettings + options?: DeploymentsListByResourceGroupOptionalParams ): AsyncIterableIterator { - let result: DeploymentsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -416,9 +349,7 @@ export class DeploymentsImpl implements Deployments { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/resources/arm-resources/src/operations/operations.ts b/sdk/resources/arm-resources/src/operations/operations.ts index 0db1686b12d3..498f072ab75b 100644 --- a/sdk/resources/arm-resources/src/operations/operations.ts +++ b/sdk/resources/arm-resources/src/operations/operations.ts @@ -6,8 +6,7 @@ * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -49,34 +48,22 @@ export class OperationsImpl implements Operations { [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); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings + options?: OperationsListOptionalParams ): 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; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/resources/arm-resources/src/operations/providers.ts b/sdk/resources/arm-resources/src/operations/providers.ts index 1a34953ca117..2caa18b47c99 100644 --- a/sdk/resources/arm-resources/src/operations/providers.ts +++ b/sdk/resources/arm-resources/src/operations/providers.ts @@ -6,8 +6,7 @@ * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Providers } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,10 +16,8 @@ import { Provider, ProvidersListNextOptionalParams, ProvidersListOptionalParams, - ProvidersListResponse, ProvidersListAtTenantScopeNextOptionalParams, ProvidersListAtTenantScopeOptionalParams, - ProvidersListAtTenantScopeResponse, ProvidersUnregisterOptionalParams, ProvidersUnregisterResponse, ProvidersRegisterAtManagementGroupScopeOptionalParams, @@ -28,6 +25,8 @@ import { ProvidersProviderPermissionsResponse, ProvidersRegisterOptionalParams, ProvidersRegisterResponse, + ProvidersListResponse, + ProvidersListAtTenantScopeResponse, ProvidersGetOptionalParams, ProvidersGetResponse, ProvidersGetAtTenantScopeOptionalParams, @@ -64,34 +63,22 @@ export class ProvidersImpl implements Providers { [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); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: ProvidersListOptionalParams, - settings?: PageSettings + options?: ProvidersListOptionalParams ): AsyncIterableIterator { - let result: ProvidersListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -118,34 +105,22 @@ export class ProvidersImpl implements Providers { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtTenantScopePagingPage(options, settings); + byPage: () => { + return this.listAtTenantScopePagingPage(options); } }; } private async *listAtTenantScopePagingPage( - options?: ProvidersListAtTenantScopeOptionalParams, - settings?: PageSettings + options?: ProvidersListAtTenantScopeOptionalParams ): AsyncIterableIterator { - let result: ProvidersListAtTenantScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtTenantScope(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listAtTenantScope(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listAtTenantScopeNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -173,7 +148,10 @@ export class ProvidersImpl implements Providers { } /** - * 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. diff --git a/sdk/resources/arm-resources/src/operations/resourceGroups.ts b/sdk/resources/arm-resources/src/operations/resourceGroups.ts index c03e1d93a4ea..8a07b3adfc70 100644 --- a/sdk/resources/arm-resources/src/operations/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operations/resourceGroups.ts @@ -6,8 +6,7 @@ * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; import { ResourceGroups } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -19,7 +18,6 @@ import { ResourceGroup, ResourceGroupsListNextOptionalParams, ResourceGroupsListOptionalParams, - ResourceGroupsListResponse, ResourceGroupsCheckExistenceOptionalParams, ResourceGroupsCheckExistenceResponse, ResourceGroupsCreateOrUpdateOptionalParams, @@ -33,6 +31,7 @@ import { ExportTemplateRequest, ResourceGroupsExportTemplateOptionalParams, ResourceGroupsExportTemplateResponse, + ResourceGroupsListResponse, ResourceGroupsListNextResponse } from "../models"; @@ -64,34 +63,22 @@ export class ResourceGroupsImpl implements ResourceGroups { [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); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: ResourceGroupsListOptionalParams, - settings?: PageSettings + options?: ResourceGroupsListOptionalParams ): AsyncIterableIterator { - let result: ResourceGroupsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/resources/arm-resources/src/operations/resources.ts b/sdk/resources/arm-resources/src/operations/resources.ts index 71d53c0776a9..307d2c2a1078 100644 --- a/sdk/resources/arm-resources/src/operations/resources.ts +++ b/sdk/resources/arm-resources/src/operations/resources.ts @@ -6,8 +6,7 @@ * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Resources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -19,13 +18,13 @@ import { GenericResourceExpanded, ResourcesListByResourceGroupNextOptionalParams, ResourcesListByResourceGroupOptionalParams, - ResourcesListByResourceGroupResponse, ResourcesListNextOptionalParams, ResourcesListOptionalParams, - ResourcesListResponse, + ResourcesListByResourceGroupResponse, ResourcesMoveInfo, ResourcesMoveResourcesOptionalParams, ResourcesValidateMoveResourcesOptionalParams, + ResourcesListResponse, ResourcesCheckExistenceOptionalParams, ResourcesCheckExistenceResponse, ResourcesDeleteOptionalParams, @@ -79,33 +78,19 @@ export class ResourcesImpl implements Resources { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ResourcesListByResourceGroupOptionalParams, - settings?: PageSettings + options?: ResourcesListByResourceGroupOptionalParams ): AsyncIterableIterator { - let result: ResourcesListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -113,9 +98,7 @@ export class ResourcesImpl implements Resources { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -146,34 +129,22 @@ export class ResourcesImpl implements Resources { [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); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: ResourcesListOptionalParams, - settings?: PageSettings + options?: ResourcesListOptionalParams ): AsyncIterableIterator { - let result: ResourcesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -821,7 +792,9 @@ export class ResourcesImpl implements Resources { } /** - * 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} diff --git a/sdk/resources/arm-resources/src/operations/tagsOperations.ts b/sdk/resources/arm-resources/src/operations/tagsOperations.ts index 8f29e32e7e37..e742460aa932 100644 --- a/sdk/resources/arm-resources/src/operations/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operations/tagsOperations.ts @@ -6,24 +6,25 @@ * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; import { TagsOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClient } from "../resourceManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; import { TagDetails, TagsListNextOptionalParams, TagsListOptionalParams, - TagsListResponse, TagsDeleteValueOptionalParams, TagsCreateOrUpdateValueOptionalParams, TagsCreateOrUpdateValueResponse, TagsCreateOrUpdateOptionalParams, TagsCreateOrUpdateResponse, TagsDeleteOptionalParams, + TagsListResponse, TagsResource, TagsCreateOrUpdateAtScopeOptionalParams, TagsCreateOrUpdateAtScopeResponse, @@ -67,34 +68,22 @@ export class TagsOperationsImpl implements TagsOperations { [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); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: TagsListOptionalParams, - settings?: PageSettings + options?: TagsListOptionalParams ): AsyncIterableIterator { - let result: TagsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -192,15 +181,86 @@ 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 - ): Promise { - return this.client.sendOperationRequest( + ): Promise< + PollerLike< + PollOperationState, + TagsCreateOrUpdateAtScopeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, { scope, parameters, options }, createOrUpdateAtScopeOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: 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 { + const poller = await this.beginCreateOrUpdateAtScope( + scope, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -213,15 +273,85 @@ export class TagsOperationsImpl implements TagsOperations { * @param parameters Wrapper resource for tags patch API request only. * @param options The options parameters. */ - updateAtScope( + async beginUpdateAtScope( scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise< + PollerLike< + PollOperationState, + TagsUpdateAtScopeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, { scope, parameters, options }, updateAtScopeOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * 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 beginUpdateAtScopeAndWait( + scope: string, + parameters: TagsPatchResource, + options?: TagsUpdateAtScopeOptionalParams + ): Promise { + const poller = await this.beginUpdateAtScope(scope, parameters, options); + return poller.pollUntilDone(); } /** @@ -244,14 +374,73 @@ export class TagsOperationsImpl implements TagsOperations { * @param scope The resource scope. * @param options The options parameters. */ - deleteAtScope( + async beginDeleteAtScope( scope: string, options?: TagsDeleteAtScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, { scope, options }, deleteAtScopeOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: 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 + ): Promise { + const poller = await this.beginDeleteAtScope(scope, options); + return poller.pollUntilDone(); } /** @@ -383,6 +572,15 @@ const createOrUpdateAtScopeOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.TagsResource }, + 201: { + bodyMapper: Mappers.TagsResource + }, + 202: { + bodyMapper: Mappers.TagsResource + }, + 204: { + bodyMapper: Mappers.TagsResource + }, default: { bodyMapper: Mappers.CloudError } @@ -401,6 +599,15 @@ const updateAtScopeOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.TagsResource }, + 201: { + bodyMapper: Mappers.TagsResource + }, + 202: { + bodyMapper: Mappers.TagsResource + }, + 204: { + bodyMapper: Mappers.TagsResource + }, default: { bodyMapper: Mappers.CloudError } @@ -433,6 +640,9 @@ const deleteAtScopeOperationSpec: coreClient.OperationSpec = { httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts index ee8f17fce3c8..3b6c01bb2895 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts @@ -51,7 +51,10 @@ export interface Providers { 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. diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts index 2e38346e4954..e4fba5652205 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts @@ -298,7 +298,9 @@ export interface Resources { 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} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts index 134193a3164f..0aee7a2df030 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 { PollerLike, PollOperationState } from "@azure/core-lro"; import { TagDetails, TagsListOptionalParams, @@ -91,7 +92,24 @@ 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 + ): Promise< + PollerLike< + PollOperationState, + 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 @@ -106,7 +124,27 @@ 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 + ): Promise< + PollerLike< + PollOperationState, + 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 @@ -125,7 +163,16 @@ export interface TagsOperations { * @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 ): Promise; diff --git a/sdk/resources/arm-resources/src/pagingHelper.ts b/sdk/resources/arm-resources/src/pagingHelper.ts deleted file mode 100644 index d85fc13bce1e..000000000000 --- a/sdk/resources/arm-resources/src/pagingHelper.ts +++ /dev/null @@ -1,39 +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. - */ - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given a result page from a pageable operation, 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(). - */ -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/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index 72943526c8b8..d46e7535de69 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -68,19 +68,22 @@ export class ResourceManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resources/5.1.1`; + const packageDetails = `azsdk-js-arm-resources/6.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - endpoint: + baseUri: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); @@ -106,9 +109,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + scopes: `${optionsWithDefaults.credentialScopes}`, challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge @@ -121,7 +122,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 || "2022-09-01"; this.operations = new OperationsImpl(this); this.deployments = new DeploymentsImpl(this); this.providers = new ProvidersImpl(this); diff --git a/sdk/resources/arm-resources/test/sampleTest.ts b/sdk/resources/arm-resources/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /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..3e6ae96443f3 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" + "./test/**/*.ts" ], "exclude": [ "node_modules"