diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b0a63574994a..61c22fece184 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10800,7 +10800,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: @@ -10811,6 +10811,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 @@ -10818,11 +10820,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 @@ -12186,7 +12187,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: @@ -12197,6 +12198,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 @@ -12204,11 +12207,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 @@ -12701,7 +12703,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: @@ -12712,6 +12714,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 @@ -12719,11 +12723,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 @@ -12782,7 +12785,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: @@ -12793,6 +12796,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 @@ -12800,11 +12805,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 @@ -12944,7 +12948,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: @@ -12955,6 +12959,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 @@ -12962,11 +12968,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 @@ -13719,7 +13724,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: @@ -13738,7 +13743,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' @@ -14313,7 +14318,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: @@ -14324,6 +14329,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 @@ -14331,16 +14338,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-dCbJQwCvIzZ2VzqzLnHSQDu9a6SGCkhBMzljvRr15+2M+AgkoPFanApID8PgsDHiHmB9zVcams8T90xRPvM94g==, 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: @@ -14351,6 +14357,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 @@ -14358,11 +14366,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 @@ -15111,7 +15118,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: @@ -15122,6 +15129,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 @@ -15129,11 +15138,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-subscriptions/arm-resources-subscriptions/CHANGELOG.md b/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md index 86fdb5ecc2bb..5c6ec149c6bd 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md @@ -1,15 +1,19 @@ # Release History - -## 2.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 2.1.0 (2022-11-04) + +**Features** + + - Added operation Subscriptions.checkZonePeers + - Added Interface AvailabilityZonePeers + - Added Interface CheckZonePeersRequest + - Added Interface CheckZonePeersResult + - Added Interface ErrorDetail + - Added Interface ErrorResponseAutoGenerated + - Added Interface Peers + - Added Interface SubscriptionsCheckZonePeersOptionalParams + - Added Type Alias SubscriptionsCheckZonePeersResponse + ## 2.0.1 (2022-04-18) **features** diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json index c6765ba542bb..7ca1256252a8 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "readme": "specification\\resources\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "8208990a173dc459a043cb95da32eaad1808eb29", + "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.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.0", + "use": "@autorest/typescript@6.0.0-rc.2" } \ 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 4a53205ff05e..04ad82e14d98 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/package.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SubscriptionClient.", - "version": "2.0.2", + "version": "2.1.0", "engines": { "node": ">=14.0.0" }, @@ -34,13 +34,17 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.6.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources-subscriptions/arm-resources-subscriptions", "repository": { @@ -91,9 +95,8 @@ "unit-test:node": "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": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -104,13 +107,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resources-subscriptions?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md b/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md index 0afb6b6639c5..ed34fd6576ed 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md @@ -8,6 +8,12 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; +// @public +export interface AvailabilityZonePeers { + readonly availabilityZone?: string; + peers?: Peers[]; +} + // @public export interface CheckResourceNameOptionalParams extends coreClient.OperationOptions { resourceNameDefinition?: ResourceName; @@ -23,6 +29,19 @@ export interface CheckResourceNameResult { type?: string; } +// @public +export interface CheckZonePeersRequest { + location?: string; + subscriptionIds?: string[]; +} + +// @public +export interface CheckZonePeersResult { + availabilityZonePeers?: AvailabilityZonePeers[]; + location?: string; + readonly subscriptionId?: string; +} + // @public export interface CloudError { error?: ErrorResponse; @@ -34,6 +53,15 @@ export interface ErrorAdditionalInfo { readonly type?: string; } +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + // @public export interface ErrorResponse { readonly additionalInfo?: ErrorAdditionalInfo[]; @@ -43,29 +71,27 @@ export interface ErrorResponse { readonly target?: string; } +// @public +export interface ErrorResponseAutoGenerated { + error?: ErrorDetail; +} + // @public export enum KnownRegionCategory { - // (undocumented) Extended = "Extended", - // (undocumented) Other = "Other", - // (undocumented) Recommended = "Recommended" } // @public export enum KnownRegionType { - // (undocumented) Logical = "Logical", - // (undocumented) Physical = "Physical" } // @public export enum KnownResourceNameStatus { - // (undocumented) Allowed = "Allowed", - // (undocumented) Reserved = "Reserved" } @@ -133,6 +159,12 @@ export interface PairedRegion { readonly subscriptionId?: string; } +// @public +export interface Peers { + readonly availabilityZone?: string; + readonly subscriptionId?: string; +} + // @public export type RegionCategory = string; @@ -202,11 +234,19 @@ export interface SubscriptionPolicies { // @public export interface Subscriptions { + checkZonePeers(subscriptionId: string, parameters: CheckZonePeersRequest, options?: SubscriptionsCheckZonePeersOptionalParams): Promise; get(subscriptionId: string, options?: SubscriptionsGetOptionalParams): Promise; list(options?: SubscriptionsListOptionalParams): PagedAsyncIterableIterator; listLocations(subscriptionId: string, options?: SubscriptionsListLocationsOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface SubscriptionsCheckZonePeersOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubscriptionsCheckZonePeersResponse = CheckZonePeersResult; + // @public export interface SubscriptionsGetOptionalParams extends coreClient.OperationOptions { } 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 c80a2f35682e..7e8f483f8400 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts @@ -294,6 +294,87 @@ export interface TenantIdDescription { readonly tenantBrandingLogoUrl?: string; } +/** Check zone peers request parameters. */ +export interface CheckZonePeersRequest { + /** The Microsoft location. */ + location?: string; + /** The peer Microsoft Azure subscription ID. */ + subscriptionIds?: string[]; +} + +/** Result of the Check zone peers operation. */ +export interface CheckZonePeersResult { + /** + * The subscription ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** the location of the subscription. */ + location?: string; + /** The Availability Zones shared by the subscriptions. */ + availabilityZonePeers?: AvailabilityZonePeers[]; +} + +/** List of availability zones shared by the subscriptions. */ +export interface AvailabilityZonePeers { + /** + * The availabilityZone. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly availabilityZone?: string; + /** Details of shared availability zone. */ + peers?: Peers[]; +} + +/** Information about shared availability zone. */ +export interface Peers { + /** + * The subscription ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * The availabilityZone. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly availabilityZone?: 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 ErrorResponseAutoGenerated { + /** 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[]; +} + /** Name and Type of the Resource */ export interface ResourceName { /** Name of the resource */ @@ -342,7 +423,9 @@ export interface OperationListResult { /** Known values of {@link RegionType} that the service accepts. */ export enum KnownRegionType { + /** Physical */ Physical = "Physical", + /** Logical */ Logical = "Logical" } @@ -358,8 +441,11 @@ export type RegionType = string; /** Known values of {@link RegionCategory} that the service accepts. */ export enum KnownRegionCategory { + /** Recommended */ Recommended = "Recommended", + /** Extended */ Extended = "Extended", + /** Other */ Other = "Other" } @@ -376,7 +462,9 @@ export type RegionCategory = string; /** Known values of {@link ResourceNameStatus} that the service accepts. */ export enum KnownResourceNameStatus { + /** Allowed */ Allowed = "Allowed", + /** Reserved */ Reserved = "Reserved" } @@ -427,6 +515,13 @@ export interface SubscriptionsListOptionalParams /** Contains response data for the list operation. */ export type SubscriptionsListResponse = SubscriptionListResult; +/** Optional parameters. */ +export interface SubscriptionsCheckZonePeersOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkZonePeers operation. */ +export type SubscriptionsCheckZonePeersResponse = CheckZonePeersResult; + /** Optional parameters. */ export interface SubscriptionsListNextOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts index 3bc2da2a3652..f4eb5f5464c8 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts @@ -549,6 +549,189 @@ export const TenantIdDescription: coreClient.CompositeMapper = { } }; +export const CheckZonePeersRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckZonePeersRequest", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + subscriptionIds: { + serializedName: "subscriptionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CheckZonePeersResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckZonePeersResult", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + availabilityZonePeers: { + serializedName: "availabilityZonePeers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AvailabilityZonePeers" + } + } + } + } + } + } +}; + +export const AvailabilityZonePeers: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailabilityZonePeers", + modelProperties: { + availabilityZone: { + serializedName: "availabilityZone", + readOnly: true, + type: { + name: "String" + } + }, + peers: { + serializedName: "peers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Peers" + } + } + } + } + } + } +}; + +export const Peers: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Peers", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String" + } + }, + availabilityZone: { + serializedName: "availabilityZone", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated", + 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 ResourceName: coreClient.CompositeMapper = { type: { name: "Composite", 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 6ae1bccccf87..a9dc67106cd5 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts @@ -11,7 +11,10 @@ import { OperationURLParameter, OperationQueryParameter } from "@azure/core-client"; -import { ResourceName as ResourceNameMapper } from "../models/mappers"; +import { + CheckZonePeersRequest as CheckZonePeersRequestMapper, + ResourceName as ResourceNameMapper +} from "../models/mappers"; export const accept: OperationParameter = { parameterPath: "accept", @@ -70,18 +73,6 @@ export const includeExtendedLocations: 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: { @@ -94,6 +85,23 @@ export const contentType: OperationParameter = { } }; +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: CheckZonePeersRequestMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + export const resourceNameDefinition: OperationParameter = { parameterPath: ["options", "resourceNameDefinition"], mapper: ResourceNameMapper diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts index 14029e326139..a367389c6f1e 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts @@ -22,6 +22,9 @@ import { SubscriptionsGetOptionalParams, SubscriptionsGetResponse, SubscriptionsListResponse, + CheckZonePeersRequest, + SubscriptionsCheckZonePeersOptionalParams, + SubscriptionsCheckZonePeersResponse, SubscriptionsListNextResponse } from "../models"; @@ -165,6 +168,23 @@ export class SubscriptionsImpl implements Subscriptions { return this.client.sendOperationRequest({ options }, listOperationSpec); } + /** + * Compares a subscriptions logical zone mapping + * @param subscriptionId The ID of the target subscription. + * @param parameters Parameters for checking zone peers. + * @param options The options parameters. + */ + checkZonePeers( + subscriptionId: string, + parameters: CheckZonePeersRequest, + options?: SubscriptionsCheckZonePeersOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { subscriptionId, parameters, options }, + checkZonePeersOperationSpec + ); + } + /** * ListNext * @param nextLink The nextLink from the previous successful call to the List method. @@ -231,6 +251,25 @@ const listOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const checkZonePeersOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/checkZonePeers/", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckZonePeersResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", 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 23e6c628c7a7..4142f4ea2482 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts @@ -13,7 +13,10 @@ import { Subscription, SubscriptionsListOptionalParams, SubscriptionsGetOptionalParams, - SubscriptionsGetResponse + SubscriptionsGetResponse, + CheckZonePeersRequest, + SubscriptionsCheckZonePeersOptionalParams, + SubscriptionsCheckZonePeersResponse } from "../models"; /// @@ -45,4 +48,15 @@ export interface Subscriptions { subscriptionId: string, options?: SubscriptionsGetOptionalParams ): Promise; + /** + * Compares a subscriptions logical zone mapping + * @param subscriptionId The ID of the target subscription. + * @param parameters Parameters for checking zone peers. + * @param options The options parameters. + */ + checkZonePeers( + subscriptionId: string, + parameters: CheckZonePeersRequest, + options?: SubscriptionsCheckZonePeersOptionalParams + ): Promise; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts index 00285ba19fe0..94c962ad8a0e 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts @@ -8,6 +8,11 @@ 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 { SubscriptionsImpl, TenantsImpl } from "./operations"; import { Subscriptions, Tenants } from "./operationsInterfaces"; @@ -45,7 +50,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resources-subscriptions/2.0.2`; + const packageDetails = `azsdk-js-arm-resources-subscriptions/2.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -65,27 +70,34 @@ export class SubscriptionClient extends coreClient.ServiceClient { }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: `${optionsWithDefaults.credentialScopes}`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Assigning values to Constant parameters @@ -93,6 +105,35 @@ export class SubscriptionClient extends coreClient.ServiceClient { this.apiVersion = options.apiVersion || "2021-01-01"; this.subscriptions = new SubscriptionsImpl(this); this.tenants = new TenantsImpl(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); } /** diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +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() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json index a3108459456b..615e06592f2b 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json @@ -15,31 +15,18 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resources-subscriptions": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"