From 82774e3d7150cb61eef583cc608dd38c32565757 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 14 Dec 2022 01:05:41 +0000 Subject: [PATCH] CodeGen from PR 20725 in Azure/azure-rest-api-specs Merge 013c8d6a0974579a9d8b61c65f84308ae2233a94 into a1ac491c7a753e63710b5cf38d8c10211a5ae4e6 --- common/config/rush/pnpm-lock.yaml | 65 ++--- sdk/servicebus/arm-servicebus/CHANGELOG.md | 42 ++- sdk/servicebus/arm-servicebus/README.md | 2 +- sdk/servicebus/arm-servicebus/_meta.json | 12 +- sdk/servicebus/arm-servicebus/package.json | 32 +-- .../review/arm-servicebus.api.md | 251 +++++++++--------- sdk/servicebus/arm-servicebus/src/index.ts | 1 + .../arm-servicebus/src/models/index.ts | 152 +++++++---- .../arm-servicebus/src/models/mappers.ts | 19 ++ .../arm-servicebus/src/models/parameters.ts | 2 +- .../src/operations/disasterRecoveryConfigs.ts | 77 ++++-- .../src/operations/migrationConfigs.ts | 35 ++- .../src/operations/namespaces.ts | 141 ++++++---- .../src/operations/operations.ts | 30 ++- .../operations/privateEndpointConnections.ts | 38 ++- .../arm-servicebus/src/operations/queues.ts | 81 ++++-- .../arm-servicebus/src/operations/rules.ts | 43 +-- .../src/operations/subscriptions.ts | 41 ++- .../arm-servicebus/src/operations/topics.ts | 81 ++++-- .../arm-servicebus/src/pagingHelper.ts | 39 +++ .../src/serviceBusManagementClient.ts | 82 ++++-- .../arm-servicebus/test/sampleTest.ts | 144 ++-------- sdk/servicebus/arm-servicebus/tsconfig.json | 10 +- 23 files changed, 841 insertions(+), 579 deletions(-) create mode 100644 sdk/servicebus/arm-servicebus/src/pagingHelper.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 25cffb9d5c25..f5f0f215e7a9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2197,7 +2197,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/chai-as-promised/7.1.5: @@ -2219,7 +2219,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/cookie/0.4.1: @@ -2229,7 +2229,7 @@ packages: /@types/cors/2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/debug/4.1.7: @@ -2256,7 +2256,7 @@ packages: /@types/express-serve-static-core/4.17.31: resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} dependencies: - '@types/node': 12.20.55 + '@types/node': 18.11.15 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 dev: false @@ -2273,20 +2273,20 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/inquirer/8.2.5: @@ -2298,7 +2298,7 @@ packages: /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/json-schema/7.0.11: @@ -2312,13 +2312,13 @@ packages: /@types/jsonwebtoken/8.5.9: resolution: {integrity: sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/jws/3.2.4: resolution: {integrity: sha512-aqtH4dPw1wUjFZaeMD1ak/pf8iXlu/odFe+trJrvw0g1sTh93i+SCykg0Ek8C6B7rVK3oBORbfZAsKO7P10etg==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/md5/2.3.2: @@ -2354,13 +2354,13 @@ packages: /@types/mock-fs/4.13.1: resolution: {integrity: sha512-m6nFAJ3lBSnqbvDZioawRvpLXSaPyn52Srf7OfzjubYbYX8MTUdIgDxQl0wEapm4m/pNYSd9TXocpQ0TvZFlYA==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/mock-require/2.0.1: resolution: {integrity: sha512-O7U5DVGboY/Crueb5/huUCIRjKtRVRaLmRDbZJBlDQgJn966z3aiFDN+6AtYviu2ExwMkl34LjT/IiC0OPtKuQ==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/ms/0.7.31: @@ -2378,7 +2378,7 @@ packages: /@types/node-fetch/2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 form-data: 3.0.1 dev: false @@ -2433,7 +2433,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/semaphore/1.1.1: @@ -2444,7 +2444,7 @@ packages: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: '@types/mime': 3.0.1 - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/sinon/10.0.13: @@ -2466,13 +2466,13 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/through/0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/tough-cookie/4.0.2: @@ -2486,13 +2486,13 @@ packages: /@types/tunnel/0.0.1: resolution: {integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/underscore/1.11.4: @@ -2510,19 +2510,19 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/xml2js/0.4.11: resolution: {integrity: sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==} dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false /@types/yargs-parser/21.0.0: @@ -2539,7 +2539,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 14.18.34 + '@types/node': 18.11.15 dev: false optional: true @@ -3618,7 +3618,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -3839,7 +3839,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 4.6.4 + typescript: 4.9.4 dev: false /ecdsa-sig-formatter/1.0.11: @@ -3890,7 +3890,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.13 - '@types/node': 14.18.34 + '@types/node': 18.11.15 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -4902,7 +4902,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -14405,7 +14405,7 @@ packages: dev: false file:projects/arm-servicebus.tgz: - resolution: {integrity: sha512-4yVFLEuDg5QgS6EYMk+PXJzrJZlKdm6OEkE3BVWOe+AtTADu+gP7OqJYEiKcJMp+qwxp0Go5IzlH6GMs7NWTyw==, tarball: file:projects/arm-servicebus.tgz} + resolution: {integrity: sha512-2ax8h+OFGYTcmFAgtJ/bbkeY2NVwljsH6JFFsiIwIXd6/0I81bnj8QQA3EfssrLqIi2xzwxmko/kpIBGe50bQA==, tarball: file:projects/arm-servicebus.tgz} name: '@rush-temp/arm-servicebus' version: 0.0.0 dependencies: @@ -14416,18 +14416,19 @@ 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.4 + '@types/node': 14.18.34 + chai: 4.3.7 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 + rollup-plugin-sourcemaps: 0.6.3_7459fe0d37cbbca90688e529585c250d tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - '@types/node' - - encoding - supports-color dev: false diff --git a/sdk/servicebus/arm-servicebus/CHANGELOG.md b/sdk/servicebus/arm-servicebus/CHANGELOG.md index 2ded2c86e810..abfd5596b075 100644 --- a/sdk/servicebus/arm-servicebus/CHANGELOG.md +++ b/sdk/servicebus/arm-servicebus/CHANGELOG.md @@ -1,15 +1,41 @@ # Release History + +## 7.0.0-beta.1 (2022-12-14) + +**Features** -## 6.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added Interface ArmDisasterRecovery + - Added Interface MigrationConfigProperties + - Added Interface NetworkRuleSet + - Added Interface PrivateEndpointConnection + - Added Interface ResourceNamespacePatch + - Added Interface Rule + - Added Interface SBAuthorizationRule + - Added Interface SBNamespace + - Added Interface SBNamespaceUpdateParameters + - Added Interface SBQueue + - Added Interface SBSubscription + - Added Interface SBTopic + - Added Interface SqlRuleAction + - Added Interface TrackedResource + - Added Type Alias PublicNetworkAccess + - Added Type Alias TlsVersion + - Added Enum KnownPublicNetworkAccess + - Added Enum KnownTlsVersion + - Added function getContinuationToken -### Other Changes +**Breaking Changes** + - Interface QueuesListByNamespaceNextOptionalParams no longer has parameter skip + - Interface QueuesListByNamespaceNextOptionalParams no longer has parameter top + - Interface RulesListBySubscriptionsNextOptionalParams no longer has parameter skip + - Interface RulesListBySubscriptionsNextOptionalParams no longer has parameter top + - Interface SubscriptionsListByTopicNextOptionalParams no longer has parameter skip + - Interface SubscriptionsListByTopicNextOptionalParams no longer has parameter top + - Interface TopicsListByNamespaceNextOptionalParams no longer has parameter skip + - Interface TopicsListByNamespaceNextOptionalParams no longer has parameter top + + ## 6.0.0 (2022-05-01) **Features** diff --git a/sdk/servicebus/arm-servicebus/README.md b/sdk/servicebus/arm-servicebus/README.md index fcce8cee936c..efc6576fdb6c 100644 --- a/sdk/servicebus/arm-servicebus/README.md +++ b/sdk/servicebus/arm-servicebus/README.md @@ -6,7 +6,7 @@ Azure Service Bus client for managing Namespace [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicebus/arm-servicebus) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-servicebus) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-servicebus) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-servicebus?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/servicebus/arm-servicebus/_meta.json b/sdk/servicebus/arm-servicebus/_meta.json index f240026fc0ba..42b2de523a52 100644 --- a/sdk/servicebus/arm-servicebus/_meta.json +++ b/sdk/servicebus/arm-servicebus/_meta.json @@ -1,8 +1,8 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", - "readme": "specification\\servicebus\\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\\servicebus\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "c42827e53fac0e95bc4f89f105c18ed637ae1429", + "readme": "specification/servicebus/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/servicebus/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.3", + "use": "@autorest/typescript@6.0.0-rc.4" +} \ No newline at end of file diff --git a/sdk/servicebus/arm-servicebus/package.json b/sdk/servicebus/arm-servicebus/package.json index 61fddaf5edba..1cf8de40dc35 100644 --- a/sdk/servicebus/arm-servicebus/package.json +++ b/sdk/servicebus/arm-servicebus/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ServiceBusManagementClient.", - "version": "6.0.1", + "version": "7.0.0-beta.1", "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.5.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -36,13 +36,18 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.8.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", + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicebus/arm-servicebus", "repository": { @@ -93,9 +98,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": { @@ -106,13 +110,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-servicebus?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md b/sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md index f2966d909123..bba904ff949c 100644 --- a/sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md +++ b/sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md @@ -32,14 +32,14 @@ export interface Action { } // @public -export type ArmDisasterRecovery = ProxyResource & { - readonly systemData?: SystemData; - readonly provisioningState?: ProvisioningStateDR; - readonly pendingReplicationOperationsCount?: number; - partnerNamespace?: string; +export interface ArmDisasterRecovery extends ProxyResource { alternateName?: string; + partnerNamespace?: string; + readonly pendingReplicationOperationsCount?: number; + readonly provisioningState?: ProvisioningStateDR; readonly role?: RoleDisasterRecovery; -}; + readonly systemData?: SystemData; +} // @public export interface ArmDisasterRecoveryListResult { @@ -218,6 +218,9 @@ export interface FailoverProperties { // @public export type FilterType = "SqlFilter" | "CorrelationFilter"; +// @public +export function getContinuationToken(page: unknown): string | undefined; + // @public export interface Identity { readonly principalId?: string; @@ -243,72 +246,66 @@ export interface KeyVaultProperties { // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownDefaultAction { - // (undocumented) Allow = "Allow", - // (undocumented) Deny = "Deny" } // @public export enum KnownEndPointProvisioningState { - // (undocumented) Canceled = "Canceled", - // (undocumented) Creating = "Creating", - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } // @public export enum KnownMigrationConfigurationName { - // (undocumented) Default = "$default" } // @public export enum KnownNetworkRuleIPAction { - // (undocumented) Allow = "Allow" } // @public export enum KnownPrivateLinkConnectionStatus { - // (undocumented) Approved = "Approved", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Pending = "Pending", - // (undocumented) Rejected = "Rejected" } +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled", + SecuredByPerimeter = "SecuredByPerimeter" +} + // @public export enum KnownPublicNetworkAccessFlag { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } +// @public +export enum KnownTlsVersion { + One0 = "1.0", + One1 = "1.1", + One2 = "1.2" +} + // @public export type ManagedServiceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; @@ -328,14 +325,14 @@ export interface MigrationConfigListResult { } // @public -export type MigrationConfigProperties = ProxyResource & { - readonly systemData?: SystemData; - readonly provisioningState?: string; +export interface MigrationConfigProperties extends ProxyResource { + readonly migrationState?: string; readonly pendingReplicationOperationsCount?: number; - targetNamespace?: string; postMigrationName?: string; - readonly migrationState?: string; -}; + readonly provisioningState?: string; + readonly systemData?: SystemData; + targetNamespace?: string; +} // @public export interface MigrationConfigs { @@ -557,14 +554,14 @@ export type NamespacesUpdateResponse = SBNamespace; export type NetworkRuleIPAction = string; // @public -export type NetworkRuleSet = ProxyResource & { - readonly systemData?: SystemData; - trustedServiceAccessEnabled?: boolean; +export interface NetworkRuleSet extends ProxyResource { defaultAction?: DefaultAction; - virtualNetworkRules?: NWRuleSetVirtualNetworkRules[]; ipRules?: NWRuleSetIpRules[]; publicNetworkAccess?: PublicNetworkAccessFlag; -}; + readonly systemData?: SystemData; + trustedServiceAccessEnabled?: boolean; + virtualNetworkRules?: NWRuleSetVirtualNetworkRules[]; +} // @public export interface NetworkRuleSetListResult { @@ -632,12 +629,12 @@ export interface PrivateEndpoint { } // @public -export type PrivateEndpointConnection = ProxyResource & { - readonly systemData?: SystemData; +export interface PrivateEndpointConnection extends ProxyResource { privateEndpoint?: PrivateEndpoint; privateLinkServiceConnectionState?: ConnectionState; provisioningState?: EndPointProvisioningState; -}; + readonly systemData?: SystemData; +} // @public export interface PrivateEndpointConnectionListResult { @@ -731,6 +728,9 @@ export interface ProxyResource { readonly type?: string; } +// @public +export type PublicNetworkAccess = string; + // @public export type PublicNetworkAccessFlag = string; @@ -800,8 +800,6 @@ export type QueuesListAuthorizationRulesResponse = SBAuthorizationRuleListResult // @public export interface QueuesListByNamespaceNextOptionalParams extends coreClient.OperationOptions { - skip?: number; - top?: number; } // @public @@ -844,24 +842,24 @@ export interface Resource { } // @public -export type ResourceNamespacePatch = Resource & { +export interface ResourceNamespacePatch extends Resource { location?: string; tags?: { [propertyName: string]: string; }; -}; +} // @public export type RoleDisasterRecovery = "Primary" | "PrimaryNotReplicating" | "Secondary"; // @public -export type Rule = ProxyResource & { - readonly systemData?: SystemData; +export interface Rule extends ProxyResource { action?: Action; + correlationFilter?: CorrelationFilter; filterType?: FilterType; sqlFilter?: SqlFilter; - correlationFilter?: CorrelationFilter; -}; + readonly systemData?: SystemData; +} // @public export interface RuleListResult { @@ -897,8 +895,6 @@ export type RulesGetResponse = Rule; // @public export interface RulesListBySubscriptionsNextOptionalParams extends coreClient.OperationOptions { - skip?: number; - top?: number; } // @public @@ -914,10 +910,10 @@ export interface RulesListBySubscriptionsOptionalParams extends coreClient.Opera export type RulesListBySubscriptionsResponse = RuleListResult; // @public -export type SBAuthorizationRule = ProxyResource & { - readonly systemData?: SystemData; +export interface SBAuthorizationRule extends ProxyResource { rights?: AccessRights[]; -}; + readonly systemData?: SystemData; +} // @public export interface SBAuthorizationRuleListResult { @@ -933,22 +929,25 @@ export interface SBClientAffineProperties { } // @public -export type SBNamespace = TrackedResource & { - sku?: SBSku; +export interface SBNamespace extends TrackedResource { + alternateName?: string; + readonly createdAt?: Date; + disableLocalAuth?: boolean; + encryption?: Encryption; identity?: Identity; - readonly systemData?: SystemData; + readonly metricId?: string; + minimumTlsVersion?: TlsVersion; + premiumMessagingPartitions?: number; + privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + readonly serviceBusEndpoint?: string; + sku?: SBSku; readonly status?: string; - readonly createdAt?: Date; + readonly systemData?: SystemData; readonly updatedAt?: Date; - readonly serviceBusEndpoint?: string; - readonly metricId?: string; zoneRedundant?: boolean; - encryption?: Encryption; - privateEndpointConnections?: PrivateEndpointConnection[]; - disableLocalAuth?: boolean; - alternateName?: string; -}; +} // @public export interface SBNamespaceListResult { @@ -957,47 +956,47 @@ export interface SBNamespaceListResult { } // @public -export type SBNamespaceUpdateParameters = ResourceNamespacePatch & { - sku?: SBSku; +export interface SBNamespaceUpdateParameters extends ResourceNamespacePatch { + alternateName?: string; + readonly createdAt?: Date; + disableLocalAuth?: boolean; + encryption?: Encryption; identity?: Identity; + readonly metricId?: string; + privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: string; + readonly serviceBusEndpoint?: string; + sku?: SBSku; readonly status?: string; - readonly createdAt?: Date; readonly updatedAt?: Date; - readonly serviceBusEndpoint?: string; - readonly metricId?: string; - encryption?: Encryption; - privateEndpointConnections?: PrivateEndpointConnection[]; - disableLocalAuth?: boolean; - alternateName?: string; -}; +} // @public -export type SBQueue = ProxyResource & { - readonly systemData?: SystemData; +export interface SBQueue extends ProxyResource { + readonly accessedAt?: Date; + autoDeleteOnIdle?: string; readonly countDetails?: MessageCountDetails; readonly createdAt?: Date; - readonly updatedAt?: Date; - readonly accessedAt?: Date; - readonly sizeInBytes?: number; - readonly messageCount?: number; - lockDuration?: string; - maxSizeInMegabytes?: number; - maxMessageSizeInKilobytes?: number; - requiresDuplicateDetection?: boolean; - requiresSession?: boolean; - defaultMessageTimeToLive?: string; deadLetteringOnMessageExpiration?: boolean; + defaultMessageTimeToLive?: string; duplicateDetectionHistoryTimeWindow?: string; - maxDeliveryCount?: number; - status?: EntityStatus; enableBatchedOperations?: boolean; - autoDeleteOnIdle?: string; - enablePartitioning?: boolean; enableExpress?: boolean; - forwardTo?: string; + enablePartitioning?: boolean; forwardDeadLetteredMessagesTo?: string; -}; + forwardTo?: string; + lockDuration?: string; + maxDeliveryCount?: number; + maxMessageSizeInKilobytes?: number; + maxSizeInMegabytes?: number; + readonly messageCount?: number; + requiresDuplicateDetection?: boolean; + requiresSession?: boolean; + readonly sizeInBytes?: number; + status?: EntityStatus; + readonly systemData?: SystemData; + readonly updatedAt?: Date; +} // @public export interface SBQueueListResult { @@ -1013,28 +1012,28 @@ export interface SBSku { } // @public -export type SBSubscription = ProxyResource & { - readonly systemData?: SystemData; - readonly messageCount?: number; - readonly createdAt?: Date; +export interface SBSubscription extends ProxyResource { readonly accessedAt?: Date; - readonly updatedAt?: Date; + autoDeleteOnIdle?: string; + clientAffineProperties?: SBClientAffineProperties; readonly countDetails?: MessageCountDetails; - lockDuration?: string; - requiresSession?: boolean; - defaultMessageTimeToLive?: string; + readonly createdAt?: Date; deadLetteringOnFilterEvaluationExceptions?: boolean; deadLetteringOnMessageExpiration?: boolean; + defaultMessageTimeToLive?: string; duplicateDetectionHistoryTimeWindow?: string; - maxDeliveryCount?: number; - status?: EntityStatus; enableBatchedOperations?: boolean; - autoDeleteOnIdle?: string; - forwardTo?: string; forwardDeadLetteredMessagesTo?: string; + forwardTo?: string; isClientAffine?: boolean; - clientAffineProperties?: SBClientAffineProperties; -}; + lockDuration?: string; + maxDeliveryCount?: number; + readonly messageCount?: number; + requiresSession?: boolean; + status?: EntityStatus; + readonly systemData?: SystemData; + readonly updatedAt?: Date; +} // @public export interface SBSubscriptionListResult { @@ -1043,26 +1042,26 @@ export interface SBSubscriptionListResult { } // @public -export type SBTopic = ProxyResource & { - readonly systemData?: SystemData; - readonly sizeInBytes?: number; - readonly createdAt?: Date; - readonly updatedAt?: Date; +export interface SBTopic extends ProxyResource { readonly accessedAt?: Date; - readonly subscriptionCount?: number; + autoDeleteOnIdle?: string; readonly countDetails?: MessageCountDetails; + readonly createdAt?: Date; defaultMessageTimeToLive?: string; - maxSizeInMegabytes?: number; - maxMessageSizeInKilobytes?: number; - requiresDuplicateDetection?: boolean; duplicateDetectionHistoryTimeWindow?: string; enableBatchedOperations?: boolean; + enableExpress?: boolean; + enablePartitioning?: boolean; + maxMessageSizeInKilobytes?: number; + maxSizeInMegabytes?: number; + requiresDuplicateDetection?: boolean; + readonly sizeInBytes?: number; status?: EntityStatus; + readonly subscriptionCount?: number; supportOrdering?: boolean; - autoDeleteOnIdle?: string; - enablePartitioning?: boolean; - enableExpress?: boolean; -}; + readonly systemData?: SystemData; + readonly updatedAt?: Date; +} // @public export interface SBTopicListResult { @@ -1122,7 +1121,8 @@ export interface SqlFilter { } // @public -export type SqlRuleAction = Action & {}; +export interface SqlRuleAction extends Action { +} // @public export interface Subnet { @@ -1157,8 +1157,6 @@ export type SubscriptionsGetResponse = SBSubscription; // @public export interface SubscriptionsListByTopicNextOptionalParams extends coreClient.OperationOptions { - skip?: number; - top?: number; } // @public @@ -1183,6 +1181,9 @@ export interface SystemData { lastModifiedByType?: CreatedByType; } +// @public +export type TlsVersion = string; + // @public export interface Topics { createOrUpdate(resourceGroupName: string, namespaceName: string, topicName: string, parameters: SBTopic, options?: TopicsCreateOrUpdateOptionalParams): Promise; @@ -1249,8 +1250,6 @@ export type TopicsListAuthorizationRulesResponse = SBAuthorizationRuleListResult // @public export interface TopicsListByNamespaceNextOptionalParams extends coreClient.OperationOptions { - skip?: number; - top?: number; } // @public @@ -1280,12 +1279,12 @@ export interface TopicsRegenerateKeysOptionalParams extends coreClient.Operation export type TopicsRegenerateKeysResponse = AccessKeys; // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { location: string; tags?: { [propertyName: string]: string; }; -}; +} // @public export type UnavailableReason = "None" | "InvalidName" | "SubscriptionIsDisabled" | "NameInUse" | "NameInLockdown" | "TooManyNamespaceInCurrentSubscription"; diff --git a/sdk/servicebus/arm-servicebus/src/index.ts b/sdk/servicebus/arm-servicebus/src/index.ts index 6da295a4d2a7..75edeb2734eb 100644 --- a/sdk/servicebus/arm-servicebus/src/index.ts +++ b/sdk/servicebus/arm-servicebus/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { ServiceBusManagementClient } from "./serviceBusManagementClient"; export * from "./operationsInterfaces"; diff --git a/sdk/servicebus/arm-servicebus/src/models/index.ts b/sdk/servicebus/arm-servicebus/src/models/index.ts index acf9549edc51..e15d030d0435 100644 --- a/sdk/servicebus/arm-servicebus/src/models/index.ts +++ b/sdk/servicebus/arm-servicebus/src/models/index.ts @@ -22,7 +22,7 @@ export interface SBSku { name: SkuName; /** The billing tier of this particular SKU. */ tier?: SkuTier; - /** The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. */ + /** Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of your properties.premiumMessagingPartitions setting. For example, If properties.premiumMessagingPartitions is 1 then possible capacity values are 1, 2, 4, 8, and 16. If properties.premiumMessagingPartitions is 4 then possible capacity values are 4, 8, 16, 32 and 64 */ capacity?: number; } @@ -540,7 +540,7 @@ export interface CheckNameAvailabilityResult { } /** Properties of the PrivateEndpointConnection. */ -export type PrivateEndpointConnection = ProxyResource & { +export interface PrivateEndpointConnection extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -552,10 +552,10 @@ export type PrivateEndpointConnection = ProxyResource & { privateLinkServiceConnectionState?: ConnectionState; /** Provisioning state of the Private Endpoint Connection. */ provisioningState?: EndPointProvisioningState; -}; +} /** Single item in List or Get Alias(Disaster Recovery configuration) operation */ -export type ArmDisasterRecovery = ProxyResource & { +export interface ArmDisasterRecovery extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -580,10 +580,10 @@ export type ArmDisasterRecovery = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly role?: RoleDisasterRecovery; -}; +} /** Single item in List or Get Migration Config operation */ -export type MigrationConfigProperties = ProxyResource & { +export interface MigrationConfigProperties extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -608,10 +608,10 @@ export type MigrationConfigProperties = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly migrationState?: string; -}; +} /** Description of NetworkRuleSet resource. */ -export type NetworkRuleSet = ProxyResource & { +export interface NetworkRuleSet extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -627,10 +627,10 @@ export type NetworkRuleSet = ProxyResource & { ipRules?: NWRuleSetIpRules[]; /** This determines if traffic is allowed over public network. By default it is enabled. */ publicNetworkAccess?: PublicNetworkAccessFlag; -}; +} /** Description of a namespace authorization rule. */ -export type SBAuthorizationRule = ProxyResource & { +export interface SBAuthorizationRule extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -638,10 +638,10 @@ export type SBAuthorizationRule = ProxyResource & { readonly systemData?: SystemData; /** The rights associated with the rule. */ rights?: AccessRights[]; -}; +} /** Description of queue Resource. */ -export type SBQueue = ProxyResource & { +export interface SBQueue extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -709,10 +709,10 @@ export type SBQueue = ProxyResource & { forwardTo?: string; /** Queue/Topic name to forward the Dead Letter message */ forwardDeadLetteredMessagesTo?: string; -}; +} /** Description of topic resource. */ -export type SBTopic = ProxyResource & { +export interface SBTopic extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -770,10 +770,10 @@ export type SBTopic = ProxyResource & { enablePartitioning?: boolean; /** Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. */ enableExpress?: boolean; -}; +} /** Description of Rule Resource. */ -export type Rule = ProxyResource & { +export interface Rule extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -787,10 +787,10 @@ export type Rule = ProxyResource & { sqlFilter?: SqlFilter; /** Properties of correlationFilter */ correlationFilter?: CorrelationFilter; -}; +} /** Description of subscription resource. */ -export type SBSubscription = ProxyResource & { +export interface SBSubscription extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -849,29 +849,29 @@ export type SBSubscription = ProxyResource & { isClientAffine?: boolean; /** Properties specific to client affine subscriptions. */ clientAffineProperties?: SBClientAffineProperties; -}; +} /** The Resource definition. */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** The Geo-location where the resource lives */ location: string; /** Resource tags */ tags?: { [propertyName: string]: string }; -}; +} /** The Resource definition. */ -export type ResourceNamespacePatch = Resource & { +export interface ResourceNamespacePatch extends Resource { /** Resource location */ location?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; -}; +} /** Represents set of actions written in SQL language-based syntax that is performed against a ServiceBus.Messaging.BrokeredMessage */ -export type SqlRuleAction = Action & {}; +export interface SqlRuleAction extends Action {} /** Description of a namespace resource. */ -export type SBNamespace = TrackedResource & { +export interface SBNamespace extends TrackedResource { /** Properties of SKU */ sku?: SBSku; /** Properties of BYOK Identity description */ @@ -881,6 +881,8 @@ export type SBNamespace = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; + /** The minimum TLS version for the cluster to support, e.g. '1.2' */ + minimumTlsVersion?: TlsVersion; /** * Provisioning state of the namespace. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -921,10 +923,14 @@ export type SBNamespace = TrackedResource & { disableLocalAuth?: boolean; /** Alternate name for namespace */ alternateName?: string; -}; + /** This determines if traffic is allowed over public network. By default it is enabled. */ + publicNetworkAccess?: PublicNetworkAccess; + /** The number of partitions of a Service Bus namespace. This property is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4 */ + premiumMessagingPartitions?: number; +} /** Description of a namespace resource. */ -export type SBNamespaceUpdateParameters = ResourceNamespacePatch & { +export interface SBNamespaceUpdateParameters extends ResourceNamespacePatch { /** Properties of SKU */ sku?: SBSku; /** Properties of BYOK Identity description */ @@ -967,13 +973,17 @@ export type SBNamespaceUpdateParameters = ResourceNamespacePatch & { disableLocalAuth?: boolean; /** Alternate name for namespace */ alternateName?: string; -}; +} /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -989,11 +999,36 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link TlsVersion} that the service accepts. */ +export enum KnownTlsVersion { + /** One0 */ + One0 = "1.0", + /** One1 */ + One1 = "1.1", + /** One2 */ + One2 = "1.2" +} + +/** + * Defines values for TlsVersion. \ + * {@link KnownTlsVersion} can be used interchangeably with TlsVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **1.0** \ + * **1.1** \ + * **1.2** + */ +export type TlsVersion = string; + /** Known values of {@link PrivateLinkConnectionStatus} that the service accepts. */ export enum KnownPrivateLinkConnectionStatus { + /** Pending */ Pending = "Pending", + /** Approved */ Approved = "Approved", + /** Rejected */ Rejected = "Rejected", + /** Disconnected */ Disconnected = "Disconnected" } @@ -1011,11 +1046,17 @@ export type PrivateLinkConnectionStatus = string; /** Known values of {@link EndPointProvisioningState} that the service accepts. */ export enum KnownEndPointProvisioningState { + /** Creating */ Creating = "Creating", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ Canceled = "Canceled", + /** Failed */ Failed = "Failed" } @@ -1033,8 +1074,30 @@ export enum KnownEndPointProvisioningState { */ export type EndPointProvisioningState = string; +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", + /** SecuredByPerimeter */ + SecuredByPerimeter = "SecuredByPerimeter" +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** \ + * **SecuredByPerimeter** + */ +export type PublicNetworkAccess = string; + /** Known values of {@link MigrationConfigurationName} that the service accepts. */ export enum KnownMigrationConfigurationName { + /** Default */ Default = "$default" } @@ -1049,7 +1112,9 @@ export type MigrationConfigurationName = string; /** Known values of {@link DefaultAction} that the service accepts. */ export enum KnownDefaultAction { + /** Allow */ Allow = "Allow", + /** Deny */ Deny = "Deny" } @@ -1065,6 +1130,7 @@ export type DefaultAction = string; /** Known values of {@link NetworkRuleIPAction} that the service accepts. */ export enum KnownNetworkRuleIPAction { + /** Allow */ Allow = "Allow" } @@ -1079,7 +1145,9 @@ export type NetworkRuleIPAction = string; /** Known values of {@link PublicNetworkAccessFlag} that the service accepts. */ export enum KnownPublicNetworkAccessFlag { + /** Enabled */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -1537,12 +1605,7 @@ export type QueuesListAuthorizationRulesNextResponse = SBAuthorizationRuleListRe /** Optional parameters. */ export interface QueuesListByNamespaceNextOptionalParams - extends coreClient.OperationOptions { - /** Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. */ - skip?: number; - /** May be used to limit the number of results to the most recent N usageDetails. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByNamespaceNext operation. */ export type QueuesListByNamespaceNextResponse = SBQueueListResult; @@ -1624,12 +1687,7 @@ export type TopicsListAuthorizationRulesNextResponse = SBAuthorizationRuleListRe /** Optional parameters. */ export interface TopicsListByNamespaceNextOptionalParams - extends coreClient.OperationOptions { - /** Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. */ - skip?: number; - /** May be used to limit the number of results to the most recent N usageDetails. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByNamespaceNext operation. */ export type TopicsListByNamespaceNextResponse = SBTopicListResult; @@ -1665,12 +1723,7 @@ export type RulesGetResponse = Rule; /** Optional parameters. */ export interface RulesListBySubscriptionsNextOptionalParams - extends coreClient.OperationOptions { - /** Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. */ - skip?: number; - /** May be used to limit the number of results to the most recent N usageDetails. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionsNext operation. */ export type RulesListBySubscriptionsNextResponse = RuleListResult; @@ -1707,12 +1760,7 @@ export type SubscriptionsGetResponse = SBSubscription; /** Optional parameters. */ export interface SubscriptionsListByTopicNextOptionalParams - extends coreClient.OperationOptions { - /** Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. */ - skip?: number; - /** May be used to limit the number of results to the most recent N usageDetails. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByTopicNext operation. */ export type SubscriptionsListByTopicNextResponse = SBSubscriptionListResult; diff --git a/sdk/servicebus/arm-servicebus/src/models/mappers.ts b/sdk/servicebus/arm-servicebus/src/models/mappers.ts index ea8928ac5ab7..3375452121ad 100644 --- a/sdk/servicebus/arm-servicebus/src/models/mappers.ts +++ b/sdk/servicebus/arm-servicebus/src/models/mappers.ts @@ -2108,6 +2108,12 @@ export const SBNamespace: coreClient.CompositeMapper = { className: "SystemData" } }, + minimumTlsVersion: { + serializedName: "properties.minimumTlsVersion", + type: { + name: "String" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -2186,6 +2192,19 @@ export const SBNamespace: coreClient.CompositeMapper = { type: { name: "String" } + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } + }, + premiumMessagingPartitions: { + serializedName: "properties.premiumMessagingPartitions", + type: { + name: "Number" + } } } } diff --git a/sdk/servicebus/arm-servicebus/src/models/parameters.ts b/sdk/servicebus/arm-servicebus/src/models/parameters.ts index 67b35a71e23f..998fef1e6450 100644 --- a/sdk/servicebus/arm-servicebus/src/models/parameters.ts +++ b/sdk/servicebus/arm-servicebus/src/models/parameters.ts @@ -55,7 +55,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-11-01", + defaultValue: "2022-10-01-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/servicebus/arm-servicebus/src/operations/disasterRecoveryConfigs.ts b/sdk/servicebus/arm-servicebus/src/operations/disasterRecoveryConfigs.ts index 2aa9fbd99acf..c4e25d865080 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/disasterRecoveryConfigs.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/disasterRecoveryConfigs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DisasterRecoveryConfigs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,10 +17,11 @@ import { ArmDisasterRecovery, DisasterRecoveryConfigsListNextOptionalParams, DisasterRecoveryConfigsListOptionalParams, + DisasterRecoveryConfigsListResponse, SBAuthorizationRule, DisasterRecoveryConfigsListAuthorizationRulesNextOptionalParams, DisasterRecoveryConfigsListAuthorizationRulesOptionalParams, - DisasterRecoveryConfigsListResponse, + DisasterRecoveryConfigsListAuthorizationRulesResponse, DisasterRecoveryConfigsCreateOrUpdateOptionalParams, DisasterRecoveryConfigsCreateOrUpdateResponse, DisasterRecoveryConfigsDeleteOptionalParams, @@ -27,7 +29,6 @@ import { DisasterRecoveryConfigsGetResponse, DisasterRecoveryConfigsBreakPairingOptionalParams, DisasterRecoveryConfigsFailOverOptionalParams, - DisasterRecoveryConfigsListAuthorizationRulesResponse, DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams, DisasterRecoveryConfigsGetAuthorizationRuleResponse, DisasterRecoveryConfigsListKeysOptionalParams, @@ -71,8 +72,16 @@ export class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, namespaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + namespaceName, + options, + settings + ); } }; } @@ -80,11 +89,18 @@ export class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { private async *listPagingPage( resourceGroupName: string, namespaceName: string, - options?: DisasterRecoveryConfigsListOptionalParams + options?: DisasterRecoveryConfigsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, namespaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DisasterRecoveryConfigsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, namespaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -93,7 +109,9 @@ export class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -137,12 +155,16 @@ export class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listAuthorizationRulesPagingPage( resourceGroupName, namespaceName, alias, - options + options, + settings ); } }; @@ -152,16 +174,23 @@ export class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { resourceGroupName: string, namespaceName: string, alias: string, - options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAuthorizationRules( - resourceGroupName, - namespaceName, - alias, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DisasterRecoveryConfigsListAuthorizationRulesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + alias, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAuthorizationRulesNext( resourceGroupName, @@ -171,7 +200,9 @@ export class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -684,7 +715,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -706,7 +736,6 @@ const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/servicebus/arm-servicebus/src/operations/migrationConfigs.ts b/sdk/servicebus/arm-servicebus/src/operations/migrationConfigs.ts index 6ccc0c9d900a..5ec83f38a4b2 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/migrationConfigs.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/migrationConfigs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { MigrationConfigs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -62,8 +63,16 @@ export class MigrationConfigsImpl implements MigrationConfigs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, namespaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + namespaceName, + options, + settings + ); } }; } @@ -71,11 +80,18 @@ export class MigrationConfigsImpl implements MigrationConfigs { private async *listPagingPage( resourceGroupName: string, namespaceName: string, - options?: MigrationConfigsListOptionalParams + options?: MigrationConfigsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, namespaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: MigrationConfigsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, namespaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -84,7 +100,9 @@ export class MigrationConfigsImpl implements MigrationConfigs { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -470,7 +488,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/servicebus/arm-servicebus/src/operations/namespaces.ts b/sdk/servicebus/arm-servicebus/src/operations/namespaces.ts index d519f7d37200..597feaed8e6b 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/namespaces.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/namespaces.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Namespaces } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,16 +19,18 @@ import { SBNamespace, NamespacesListNextOptionalParams, NamespacesListOptionalParams, + NamespacesListResponse, NamespacesListByResourceGroupNextOptionalParams, NamespacesListByResourceGroupOptionalParams, + NamespacesListByResourceGroupResponse, NetworkRuleSet, NamespacesListNetworkRuleSetsNextOptionalParams, NamespacesListNetworkRuleSetsOptionalParams, + NamespacesListNetworkRuleSetsResponse, SBAuthorizationRule, NamespacesListAuthorizationRulesNextOptionalParams, NamespacesListAuthorizationRulesOptionalParams, - NamespacesListResponse, - NamespacesListByResourceGroupResponse, + NamespacesListAuthorizationRulesResponse, NamespacesCreateOrUpdateOptionalParams, NamespacesCreateOrUpdateResponse, NamespacesDeleteOptionalParams, @@ -40,8 +43,6 @@ import { NamespacesCreateOrUpdateNetworkRuleSetResponse, NamespacesGetNetworkRuleSetOptionalParams, NamespacesGetNetworkRuleSetResponse, - NamespacesListNetworkRuleSetsResponse, - NamespacesListAuthorizationRulesResponse, NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, NamespacesCreateOrUpdateAuthorizationRuleResponse, NamespacesDeleteAuthorizationRuleOptionalParams, @@ -89,22 +90,34 @@ export class NamespacesImpl implements Namespaces { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: NamespacesListOptionalParams + options?: NamespacesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: NamespacesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -133,19 +146,33 @@ export class NamespacesImpl implements Namespaces { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: NamespacesListByResourceGroupOptionalParams + options?: NamespacesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: NamespacesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -153,7 +180,9 @@ export class NamespacesImpl implements Namespaces { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -192,11 +221,15 @@ export class NamespacesImpl implements Namespaces { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listNetworkRuleSetsPagingPage( resourceGroupName, namespaceName, - options + options, + settings ); } }; @@ -205,15 +238,22 @@ export class NamespacesImpl implements Namespaces { private async *listNetworkRuleSetsPagingPage( resourceGroupName: string, namespaceName: string, - options?: NamespacesListNetworkRuleSetsOptionalParams + options?: NamespacesListNetworkRuleSetsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listNetworkRuleSets( - resourceGroupName, - namespaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: NamespacesListNetworkRuleSetsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listNetworkRuleSets( + resourceGroupName, + namespaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNetworkRuleSetsNext( resourceGroupName, @@ -222,7 +262,9 @@ export class NamespacesImpl implements Namespaces { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -263,11 +305,15 @@ export class NamespacesImpl implements Namespaces { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listAuthorizationRulesPagingPage( resourceGroupName, namespaceName, - options + options, + settings ); } }; @@ -276,15 +322,22 @@ export class NamespacesImpl implements Namespaces { private async *listAuthorizationRulesPagingPage( resourceGroupName: string, namespaceName: string, - options?: NamespacesListAuthorizationRulesOptionalParams + options?: NamespacesListAuthorizationRulesOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAuthorizationRules( - resourceGroupName, - namespaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: NamespacesListAuthorizationRulesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAuthorizationRulesNext( resourceGroupName, @@ -293,7 +346,9 @@ export class NamespacesImpl implements Namespaces { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -1202,7 +1257,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1222,7 +1276,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1243,7 +1296,6 @@ const listNetworkRuleSetsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1265,7 +1317,6 @@ const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/servicebus/arm-servicebus/src/operations/operations.ts b/sdk/servicebus/arm-servicebus/src/operations/operations.ts index 57d6c90bc8d4..f683966ef04d 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/operations.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/operations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -48,22 +49,34 @@ export class OperationsImpl implements Operations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/servicebus/arm-servicebus/src/operations/privateEndpointConnections.ts b/sdk/servicebus/arm-servicebus/src/operations/privateEndpointConnections.ts index 8cc902cf6b38..0db3f1374abc 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/privateEndpointConnections.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/privateEndpointConnections.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { PrivateEndpointConnections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -60,8 +61,16 @@ export class PrivateEndpointConnectionsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, namespaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + namespaceName, + options, + settings + ); } }; } @@ -69,11 +78,18 @@ export class PrivateEndpointConnectionsImpl private async *listPagingPage( resourceGroupName: string, namespaceName: string, - options?: PrivateEndpointConnectionsListOptionalParams + options?: PrivateEndpointConnectionsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, namespaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: PrivateEndpointConnectionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, namespaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -82,7 +98,9 @@ export class PrivateEndpointConnectionsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -316,6 +334,9 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { 201: { bodyMapper: Mappers.PrivateEndpointConnection }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, default: { bodyMapper: Mappers.ErrorResponse } @@ -391,7 +412,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/servicebus/arm-servicebus/src/operations/queues.ts b/sdk/servicebus/arm-servicebus/src/operations/queues.ts index 53a8c8ae1778..f5cfae718050 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/queues.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/queues.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Queues } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,10 +17,11 @@ import { SBAuthorizationRule, QueuesListAuthorizationRulesNextOptionalParams, QueuesListAuthorizationRulesOptionalParams, + QueuesListAuthorizationRulesResponse, SBQueue, QueuesListByNamespaceNextOptionalParams, QueuesListByNamespaceOptionalParams, - QueuesListAuthorizationRulesResponse, + QueuesListByNamespaceResponse, QueuesCreateOrUpdateAuthorizationRuleOptionalParams, QueuesCreateOrUpdateAuthorizationRuleResponse, QueuesDeleteAuthorizationRuleOptionalParams, @@ -30,7 +32,6 @@ import { RegenerateAccessKeyParameters, QueuesRegenerateKeysOptionalParams, QueuesRegenerateKeysResponse, - QueuesListByNamespaceResponse, QueuesCreateOrUpdateOptionalParams, QueuesCreateOrUpdateResponse, QueuesDeleteOptionalParams, @@ -79,12 +80,16 @@ export class QueuesImpl implements Queues { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listAuthorizationRulesPagingPage( resourceGroupName, namespaceName, queueName, - options + options, + settings ); } }; @@ -94,16 +99,23 @@ export class QueuesImpl implements Queues { resourceGroupName: string, namespaceName: string, queueName: string, - options?: QueuesListAuthorizationRulesOptionalParams + options?: QueuesListAuthorizationRulesOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAuthorizationRules( - resourceGroupName, - namespaceName, - queueName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: QueuesListAuthorizationRulesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + queueName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAuthorizationRulesNext( resourceGroupName, @@ -113,7 +125,9 @@ export class QueuesImpl implements Queues { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -156,11 +170,15 @@ export class QueuesImpl implements Queues { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByNamespacePagingPage( resourceGroupName, namespaceName, - options + options, + settings ); } }; @@ -169,15 +187,22 @@ export class QueuesImpl implements Queues { private async *listByNamespacePagingPage( resourceGroupName: string, namespaceName: string, - options?: QueuesListByNamespaceOptionalParams + options?: QueuesListByNamespaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByNamespace( - resourceGroupName, - namespaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: QueuesListByNamespaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByNamespace( + resourceGroupName, + namespaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByNamespaceNext( resourceGroupName, @@ -186,7 +211,9 @@ export class QueuesImpl implements Queues { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -732,7 +759,6 @@ const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -755,7 +781,6 @@ const listByNamespaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.skip, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/servicebus/arm-servicebus/src/operations/rules.ts b/sdk/servicebus/arm-servicebus/src/operations/rules.ts index 06fb5e42627e..476c858e6210 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/rules.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/rules.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Rules } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -67,13 +68,17 @@ export class RulesImpl implements Rules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listBySubscriptionsPagingPage( resourceGroupName, namespaceName, topicName, subscriptionName, - options + options, + settings ); } }; @@ -84,17 +89,24 @@ export class RulesImpl implements Rules { namespaceName: string, topicName: string, subscriptionName: string, - options?: RulesListBySubscriptionsOptionalParams + options?: RulesListBySubscriptionsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscriptions( - resourceGroupName, - namespaceName, - topicName, - subscriptionName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: RulesListBySubscriptionsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscriptions( + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionsNext( resourceGroupName, @@ -105,7 +117,9 @@ export class RulesImpl implements Rules { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -391,7 +405,6 @@ const listBySubscriptionsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.skip, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/servicebus/arm-servicebus/src/operations/subscriptions.ts b/sdk/servicebus/arm-servicebus/src/operations/subscriptions.ts index 52fc1bab3ac5..00680e1477d3 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/subscriptions.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/subscriptions.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Subscriptions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -64,12 +65,16 @@ export class SubscriptionsImpl implements Subscriptions { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByTopicPagingPage( resourceGroupName, namespaceName, topicName, - options + options, + settings ); } }; @@ -79,16 +84,23 @@ export class SubscriptionsImpl implements Subscriptions { resourceGroupName: string, namespaceName: string, topicName: string, - options?: SubscriptionsListByTopicOptionalParams + options?: SubscriptionsListByTopicOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByTopic( - resourceGroupName, - namespaceName, - topicName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SubscriptionsListByTopicResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByTopic( + resourceGroupName, + namespaceName, + topicName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByTopicNext( resourceGroupName, @@ -98,7 +110,9 @@ export class SubscriptionsImpl implements Subscriptions { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -352,7 +366,6 @@ const listByTopicNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.skip, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/servicebus/arm-servicebus/src/operations/topics.ts b/sdk/servicebus/arm-servicebus/src/operations/topics.ts index 0334ca96872f..cc119c84e635 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/topics.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/topics.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Topics } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,10 +17,11 @@ import { SBAuthorizationRule, TopicsListAuthorizationRulesNextOptionalParams, TopicsListAuthorizationRulesOptionalParams, + TopicsListAuthorizationRulesResponse, SBTopic, TopicsListByNamespaceNextOptionalParams, TopicsListByNamespaceOptionalParams, - TopicsListAuthorizationRulesResponse, + TopicsListByNamespaceResponse, TopicsCreateOrUpdateAuthorizationRuleOptionalParams, TopicsCreateOrUpdateAuthorizationRuleResponse, TopicsGetAuthorizationRuleOptionalParams, @@ -30,7 +32,6 @@ import { RegenerateAccessKeyParameters, TopicsRegenerateKeysOptionalParams, TopicsRegenerateKeysResponse, - TopicsListByNamespaceResponse, TopicsCreateOrUpdateOptionalParams, TopicsCreateOrUpdateResponse, TopicsDeleteOptionalParams, @@ -79,12 +80,16 @@ export class TopicsImpl implements Topics { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listAuthorizationRulesPagingPage( resourceGroupName, namespaceName, topicName, - options + options, + settings ); } }; @@ -94,16 +99,23 @@ export class TopicsImpl implements Topics { resourceGroupName: string, namespaceName: string, topicName: string, - options?: TopicsListAuthorizationRulesOptionalParams + options?: TopicsListAuthorizationRulesOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAuthorizationRules( - resourceGroupName, - namespaceName, - topicName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: TopicsListAuthorizationRulesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + topicName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAuthorizationRulesNext( resourceGroupName, @@ -113,7 +125,9 @@ export class TopicsImpl implements Topics { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -156,11 +170,15 @@ export class TopicsImpl implements Topics { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByNamespacePagingPage( resourceGroupName, namespaceName, - options + options, + settings ); } }; @@ -169,15 +187,22 @@ export class TopicsImpl implements Topics { private async *listByNamespacePagingPage( resourceGroupName: string, namespaceName: string, - options?: TopicsListByNamespaceOptionalParams + options?: TopicsListByNamespaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByNamespace( - resourceGroupName, - namespaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: TopicsListByNamespaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByNamespace( + resourceGroupName, + namespaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByNamespaceNext( resourceGroupName, @@ -186,7 +211,9 @@ export class TopicsImpl implements Topics { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -732,7 +759,6 @@ const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -755,7 +781,6 @@ const listByNamespaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.skip, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/servicebus/arm-servicebus/src/pagingHelper.ts b/sdk/servicebus/arm-servicebus/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/servicebus/arm-servicebus/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/servicebus/arm-servicebus/src/serviceBusManagementClient.ts b/sdk/servicebus/arm-servicebus/src/serviceBusManagementClient.ts index ccc1de365f09..7f496f38ab50 100644 --- a/sdk/servicebus/arm-servicebus/src/serviceBusManagementClient.ts +++ b/sdk/servicebus/arm-servicebus/src/serviceBusManagementClient.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 { NamespacesImpl, @@ -68,54 +73,60 @@ export class ServiceBusManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-servicebus/6.0.1`; + const packageDetails = `azsdk-js-arm-servicebus/7.0.0-beta.1`; 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 }, - baseUri: + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const 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 ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-11-01"; + this.apiVersion = options.apiVersion || "2022-10-01-preview"; this.namespaces = new NamespacesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); @@ -126,6 +137,35 @@ export class ServiceBusManagementClient extends coreClient.ServiceClient { this.topics = new TopicsImpl(this); this.rules = new RulesImpl(this); this.subscriptions = new SubscriptionsImpl(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); } namespaces: Namespaces; diff --git a/sdk/servicebus/arm-servicebus/test/sampleTest.ts b/sdk/servicebus/arm-servicebus/test/sampleTest.ts index 6daec06d4385..25aeb3ebcc36 100644 --- a/sdk/servicebus/arm-servicebus/test/sampleTest.ts +++ b/sdk/servicebus/arm-servicebus/test/sampleTest.ts @@ -7,143 +7,37 @@ */ import { - env, - record, - RecorderEnvironmentSetup, Recorder, - delay, - isPlaybackMode + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; -import { ClientSecretCredential } from "@azure/identity"; -import { ServiceBusManagementClient } from "../src/serviceBusManagementClient"; - -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: [] +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" }; -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; -describe("ServiceBus test", () => { +describe("My test", () => { let recorder: Recorder; - let subscriptionId: string; - let client: ServiceBusManagementClient; - let location: string; - let resourceGroup: string; - let namespacesName: string; - let authorizationRuleName: string; - let queueName: string; - let topicName: string; - beforeEach(async function () { - recorder = record(this, recorderEnvSetup); - subscriptionId = env.SUBSCRIPTION_ID; - // This is an example of how the environment variables are used - const credential = new ClientSecretCredential( - env.AZURE_TENANT_ID, - env.AZURE_CLIENT_ID, - env.AZURE_CLIENT_SECRET - ); - client = new ServiceBusManagementClient(credential, subscriptionId); - location = "eastus"; - resourceGroup = "myjstest"; - namespacesName = "mynamespacexxx"; - authorizationRuleName = "myAuthoriztionRule"; - queueName = "myQueue"; - topicName = "mytopic"; + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); - afterEach(async function () { + afterEach(async function() { await recorder.stop(); }); - it("namespaces create test", async function () { - const res = await client.namespaces.beginCreateOrUpdateAndWait(resourceGroup, namespacesName, { - sku: { - name: "Standard", - tier: "Standard", - }, - location: location, - tags: { - tag1: "value1", - tag2: "value2", - } - }, testPollingOptions) - assert.equal(res.name, namespacesName); - }); - - it("queues create test", async function () { - const res = await client.queues.createOrUpdate(resourceGroup, namespacesName, queueName, { enablePartitioning: true }); - assert.equal(res.name, queueName); - }); - - it("queues get test", async function () { - const res = await client.queues.get(resourceGroup, namespacesName, queueName); - assert.equal(res.name, queueName); - }); - - it("queues list test", async function () { - const resArray = new Array(); - for await (let item of client.queues.listByNamespace(resourceGroup, namespacesName)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("topics create test", async function () { - const res = await client.topics.createOrUpdate(resourceGroup, namespacesName, topicName, { - enableExpress: true - }) - assert.equal(res.name, topicName); - }); - - it("topics get test", async function () { - const res = await client.topics.get(resourceGroup, namespacesName, topicName); - assert.equal(res.name, topicName); - }); - - it("topics list test", async function () { - const resArray = new Array(); - for await (let item of client.topics.listByNamespace(resourceGroup, namespacesName)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("queues delete test", async function () { - const res = await client.queues.delete(resourceGroup, namespacesName, queueName); - const resArray = new Array(); - for await (let item of client.queues.listByNamespace(resourceGroup, namespacesName)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("topics delete test", async function () { - const res = await client.topics.delete(resourceGroup, namespacesName, topicName); - const resArray = new Array(); - for await (let item of client.topics.listByNamespace(resourceGroup, namespacesName)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("namespaces delete test", async function () { - const res = await client.namespaces.beginDeleteAndWait(resourceGroup, namespacesName, testPollingOptions); + it("sample test", async function() { + console.log("Hi, I'm a test!"); }); }); diff --git a/sdk/servicebus/arm-servicebus/tsconfig.json b/sdk/servicebus/arm-servicebus/tsconfig.json index 035ce6434f28..3e6ae96443f3 100644 --- a/sdk/servicebus/arm-servicebus/tsconfig.json +++ b/sdk/servicebus/arm-servicebus/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-servicebus": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"