From 5d68d19042ceef9cf26cd7b628c71bfccf183018 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 07:26:22 +0000 Subject: [PATCH] CodeGen from PR 17000 in Azure/azure-rest-api-specs [Go] Track2 modify readme.go.md 9 (#17000) * [Go] Track2 modify readme.go.md 9 * fix --- common/config/rush/pnpm-lock.yaml | 131 +- rush.json | 5 + sdk/signalr/arm-signalr/CHANGELOG.md | 11 + .../arm-signalr/{LICENSE.txt => LICENSE} | 4 +- sdk/signalr/arm-signalr/README.md | 143 +- sdk/signalr/arm-signalr/_meta.json | 7 + sdk/signalr/arm-signalr/api-extractor.json | 18 + sdk/signalr/arm-signalr/package.json | 94 +- .../arm-signalr/review/arm-signalr.api.md | 873 +++++++ sdk/signalr/arm-signalr/rollup.config.js | 205 +- .../src/{models/usagesMappers.ts => index.ts} | 12 +- sdk/signalr/arm-signalr/src/lroImpl.ts | 34 + sdk/signalr/arm-signalr/src/models/index.ts | 2289 +++++++---------- sdk/signalr/arm-signalr/src/models/mappers.ts | 1561 ++++++----- .../src/models/operationsMappers.ts | 21 - .../arm-signalr/src/models/parameters.ts | 129 +- .../arm-signalr/src/models/signalRMappers.ts | 44 - ...ignalRPrivateEndpointConnectionsMappers.ts | 40 - .../signalRPrivateLinkResourcesMappers.ts | 40 - ...ignalRSharedPrivateLinkResourcesMappers.ts | 40 - .../arm-signalr/src/operations/index.ts | 3 +- .../arm-signalr/src/operations/operations.ts | 167 +- .../arm-signalr/src/operations/signalR.ts | 1306 ++++++---- .../signalRPrivateEndpointConnections.ts | 512 ++-- .../operations/signalRPrivateLinkResources.ts | 225 +- .../signalRSharedPrivateLinkResources.ts | 565 ++-- .../arm-signalr/src/operations/usages.ts | 192 +- .../src/operationsInterfaces/index.ts | 14 + .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/signalR.ts | 248 ++ .../signalRPrivateEndpointConnections.ts | 94 + .../signalRPrivateLinkResources.ts | 30 + .../signalRSharedPrivateLinkResources.ts | 117 + .../src/operationsInterfaces/usages.ts | 24 + .../src/signalRManagementClient.ts | 129 +- .../src/signalRManagementClientContext.ts | 69 - sdk/signalr/arm-signalr/test/sampleTest.ts | 48 + sdk/signalr/arm-signalr/tsconfig.json | 6 +- sdk/signalr/ci.yml | 29 + 39 files changed, 5582 insertions(+), 3919 deletions(-) create mode 100644 sdk/signalr/arm-signalr/CHANGELOG.md rename sdk/signalr/arm-signalr/{LICENSE.txt => LICENSE} (96%) create mode 100644 sdk/signalr/arm-signalr/_meta.json create mode 100644 sdk/signalr/arm-signalr/api-extractor.json create mode 100644 sdk/signalr/arm-signalr/review/arm-signalr.api.md rename sdk/signalr/arm-signalr/src/{models/usagesMappers.ts => index.ts} (56%) create mode 100644 sdk/signalr/arm-signalr/src/lroImpl.ts delete mode 100644 sdk/signalr/arm-signalr/src/models/operationsMappers.ts delete mode 100644 sdk/signalr/arm-signalr/src/models/signalRMappers.ts delete mode 100644 sdk/signalr/arm-signalr/src/models/signalRPrivateEndpointConnectionsMappers.ts delete mode 100644 sdk/signalr/arm-signalr/src/models/signalRPrivateLinkResourcesMappers.ts delete mode 100644 sdk/signalr/arm-signalr/src/models/signalRSharedPrivateLinkResourcesMappers.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/index.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/operations.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/signalR.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/signalRPrivateEndpointConnections.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/signalRPrivateLinkResources.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/signalRSharedPrivateLinkResources.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/usages.ts delete mode 100644 sdk/signalr/arm-signalr/src/signalRManagementClientContext.ts create mode 100644 sdk/signalr/arm-signalr/test/sampleTest.ts create mode 100644 sdk/signalr/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..24154ea78d68 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -71,6 +71,7 @@ specifiers: '@rush-temp/arm-security': file:./projects/arm-security.tgz '@rush-temp/arm-servicebus': file:./projects/arm-servicebus.tgz '@rush-temp/arm-servicefabric': file:./projects/arm-servicefabric.tgz + '@rush-temp/arm-signalr': file:./projects/arm-signalr.tgz '@rush-temp/arm-sql': file:./projects/arm-sql.tgz '@rush-temp/arm-sqlvirtualmachine': file:./projects/arm-sqlvirtualmachine.tgz '@rush-temp/arm-storage': file:./projects/arm-storage.tgz @@ -252,6 +253,7 @@ dependencies: '@rush-temp/arm-security': file:projects/arm-security.tgz '@rush-temp/arm-servicebus': file:projects/arm-servicebus.tgz '@rush-temp/arm-servicefabric': file:projects/arm-servicefabric.tgz + '@rush-temp/arm-signalr': file:projects/arm-signalr.tgz '@rush-temp/arm-sql': file:projects/arm-sql.tgz '@rush-temp/arm-sqlvirtualmachine': file:projects/arm-sqlvirtualmachine.tgz '@rush-temp/arm-storage': file:projects/arm-storage.tgz @@ -6977,7 +6979,7 @@ packages: hasBin: true dev: false - /ts-node/10.4.0_276ff2ad8f60608417677a4691c0f835: + /ts-node/10.4.0_28670484a221c7e896c5d6b821a5cbb7: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -7003,11 +7005,11 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.2.4 + typescript: 4.4.4 yn: 3.1.1 dev: false - /ts-node/10.4.0_54d7f9b57c83a5c5120be11b085b9de6: + /ts-node/10.4.0_f9f9f28f986ed7ad377c75abc9f416f4: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -7033,7 +7035,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.4.4 + typescript: 4.2.4 yn: 3.1.1 dev: false @@ -7629,7 +7631,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7857,7 +7859,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7908,7 +7910,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7965,7 +7967,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -9274,6 +9276,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-signalr.tgz: + resolution: {integrity: sha512-Kt1ShOBK4aurIKsnAKlxt1rvCpQ+9LGpP7twTRgxvqy1S72ilPop6BSps+aLyguNZc8TMO4+feU2/osBq8zR4w==, tarball: file:projects/arm-signalr.tgz} + name: '@rush-temp/arm-signalr' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.19.2 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + dev: false + file:projects/arm-sql.tgz: resolution: {integrity: sha512-Y9z4v0i1QfZQ5oO9jP3D0fTaQmDlc4a0Ak8h1sR+pBMwngAuIA95jb1LfiK94aZ3LblRjPdMHQFNVCm8eHOUyQ==, tarball: file:projects/arm-sql.tgz} name: '@rush-temp/arm-sql' @@ -9487,7 +9510,7 @@ packages: rollup: 1.32.1 safe-buffer: 5.2.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -9982,7 +10005,7 @@ packages: dev: false file:projects/core-amqp.tgz: - resolution: {integrity: sha512-jmyXvDp5FyZIlqp1zATESQp6qO2NqjKSfY5o9ojPsKN/g9WJ45RL4jfy+cD5u8C2t9jSDTsCoL+jbiLptpkDLA==, tarball: file:projects/core-amqp.tgz} + resolution: {integrity: sha512-nAZlMW/WFVSloK1iVzoSJNx9CHjvMl4/kJrnq1s5Okn96/AQX19SYkqfdvmew1Oy3bxfDC2g3n3e1CFLrlSyEg==, tarball: file:projects/core-amqp.tgz} name: '@rush-temp/core-amqp' version: 0.0.0 dependencies: @@ -10025,7 +10048,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 url: 0.11.0 @@ -10111,7 +10134,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -10342,7 +10365,7 @@ packages: shx: 0.3.3 sinon: 9.2.4 tough-cookie: 4.0.0 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 tunnel: 0.0.6 typescript: 4.2.4 @@ -10390,7 +10413,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -10657,7 +10680,7 @@ packages: sinon: 9.2.4 snap-shot-it: 7.9.6 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 universal-user-agent: 6.0.0 @@ -10714,7 +10737,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -10760,7 +10783,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 - ts-node: 10.4.0_54d7f9b57c83a5c5120be11b085b9de6 + ts-node: 10.4.0_28670484a221c7e896c5d6b821a5cbb7 tslib: 2.3.1 typescript: 4.4.4 yaml: 1.10.2 @@ -10917,7 +10940,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -10979,7 +11002,7 @@ packages: rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11034,7 +11057,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11087,7 +11110,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11289,7 +11312,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11553,7 +11576,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11702,7 +11725,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11774,7 +11797,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11794,7 +11817,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11814,7 +11837,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11834,7 +11857,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11873,7 +11896,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11894,7 +11917,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11917,7 +11940,7 @@ packages: moment: 2.29.1 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11937,7 +11960,7 @@ packages: eslint: 7.32.0 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11957,7 +11980,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11978,7 +12001,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12000,7 +12023,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12021,7 +12044,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12041,7 +12064,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -12060,7 +12083,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -12081,7 +12104,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12104,7 +12127,7 @@ packages: node-fetch: 2.6.6 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12125,7 +12148,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12146,7 +12169,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12167,7 +12190,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12539,7 +12562,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12608,7 +12631,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 ws: 8.3.0 @@ -12671,7 +12694,7 @@ packages: rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12734,7 +12757,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12797,7 +12820,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12858,7 +12881,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12916,7 +12939,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12976,7 +12999,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -13028,7 +13051,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -13082,7 +13105,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -13135,7 +13158,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 diff --git a/rush.json b/rush.json index 66a9aa13703f..9805257fbd26 100644 --- a/rush.json +++ b/rush.json @@ -1215,6 +1215,11 @@ "packageName": "@azure/arm-containerinstance", "projectFolder": "sdk/containerinstance/arm-containerinstance", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-signalr", + "projectFolder": "sdk/signalr/arm-signalr", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/signalr/arm-signalr/CHANGELOG.md b/sdk/signalr/arm-signalr/CHANGELOG.md new file mode 100644 index 000000000000..27f0c610bb77 --- /dev/null +++ b/sdk/signalr/arm-signalr/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 5.0.0 (2022-01-05) + +The package of @azure/arm-signalr is using our next generation design principles since version 5.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/signalr/arm-signalr/LICENSE.txt b/sdk/signalr/arm-signalr/LICENSE similarity index 96% rename from sdk/signalr/arm-signalr/LICENSE.txt rename to sdk/signalr/arm-signalr/LICENSE index 2d3163745319..5d1d36e0af80 100644 --- a/sdk/signalr/arm-signalr/LICENSE.txt +++ b/sdk/signalr/arm-signalr/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/signalr/arm-signalr/README.md b/sdk/signalr/arm-signalr/README.md index e7ef96e7209a..60cad7fe0350 100644 --- a/sdk/signalr/arm-signalr/README.md +++ b/sdk/signalr/arm-signalr/README.md @@ -1,107 +1,98 @@ -## Azure SignalRManagementClient SDK for JavaScript +# Azure SignalRManagement client library for JavaScript -This package contains an isomorphic SDK for SignalRManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure SignalRManagement client. + +REST API for Azure SignalR Service + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/signalr/arm-signalr) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-signalr) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-signalr) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. -### How to Install +### Install the `@azure/arm-signalr` package + +Install the Azure SignalRManagement client library for JavaScript with `npm`: ```bash npm install @azure/arm-signalr ``` -### How to use +### Create and authenticate a `SignalRManagementClient` -#### nodejs - client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure SignalRManagement API, you will need the `endpoint` of your Azure SignalRManagement resource and a `credential`. The Azure SignalRManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure SignalRManagement resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code +You will also need to **register a new AAD application and grant access to Azure SignalRManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). -```typescript -const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +```javascript const { SignalRManagementClient } = require("@azure/arm-signalr"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth - .interactiveLogin() - .then((creds) => { - const client = new SignalRManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); - }) - .catch((err) => { - console.error(err); - }); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new SignalRManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts + +### SignalRManagementClient + +`SignalRManagementClient` is the primary interface for developers using the Azure SignalRManagement client library. Explore the methods on this client object to understand the different features of the Azure SignalRManagement service that you can access. -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html - -```html - - - - @azure/arm-signalr sample - - - - - - - - +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fsignalr%2Farm-signalr%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/signalr/arm-signalr/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/signalr/arm-signalr/_meta.json b/sdk/signalr/arm-signalr/_meta.json new file mode 100644 index 000000000000..3089e3532296 --- /dev/null +++ b/sdk/signalr/arm-signalr/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "2ab4371edba33c23e8d680ed2bf6f98705b5cadb", + "readme": "specification/signalr/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/signalr/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" +} \ No newline at end of file diff --git a/sdk/signalr/arm-signalr/api-extractor.json b/sdk/signalr/arm-signalr/api-extractor.json new file mode 100644 index 000000000000..f2479276b656 --- /dev/null +++ b/sdk/signalr/arm-signalr/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-signalr.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/signalr/arm-signalr/package.json b/sdk/signalr/arm-signalr/package.json index d6e619813daa..9067b04d629f 100644 --- a/sdk/signalr/arm-signalr/package.json +++ b/sdk/signalr/arm-signalr/package.json @@ -1,57 +1,91 @@ { "name": "@azure/arm-signalr", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "SignalRManagementClient Library with typescript type definitions for node.js and browser.", - "version": "4.0.0", + "description": "A generated SDK for SignalRManagementClient.", + "version": "5.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-signalr.js", - "module": "./esm/signalRManagementClient.js", - "types": "./esm/signalRManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-signalr.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/signalr/arm-signalr", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-signalr.js.map'\" -o ./dist/arm-signalr.min.js ./dist/arm-signalr.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "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" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/signalr/arm-signalr/review/arm-signalr.api.md b/sdk/signalr/arm-signalr/review/arm-signalr.api.md new file mode 100644 index 000000000000..f143251c7097 --- /dev/null +++ b/sdk/signalr/arm-signalr/review/arm-signalr.api.md @@ -0,0 +1,873 @@ +## API Report File for "@azure/arm-signalr" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type ACLAction = string; + +// @public +export type CreatedByType = string; + +// @public +export interface Dimension { + displayName?: string; + internalName?: string; + name?: string; + toBeExportedForShoebox?: boolean; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export type FeatureFlags = string; + +// @public +type KeyType_2 = string; +export { KeyType_2 as KeyType } + +// @public +export enum KnownACLAction { + // (undocumented) + Allow = "Allow", + // (undocumented) + Deny = "Deny" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownFeatureFlags { + // (undocumented) + EnableConnectivityLogs = "EnableConnectivityLogs", + // (undocumented) + EnableLiveTrace = "EnableLiveTrace", + // (undocumented) + EnableMessagingLogs = "EnableMessagingLogs", + // (undocumented) + ServiceMode = "ServiceMode" +} + +// @public +export enum KnownKeyType { + // (undocumented) + Primary = "Primary", + // (undocumented) + Salt = "Salt", + // (undocumented) + Secondary = "Secondary" +} + +// @public +export enum KnownManagedIdentityType { + // (undocumented) + None = "None", + // (undocumented) + SystemAssigned = "SystemAssigned", + // (undocumented) + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownPrivateLinkServiceConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Moving = "Moving", + // (undocumented) + Running = "Running", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownScaleType { + // (undocumented) + Automatic = "Automatic", + // (undocumented) + Manual = "Manual", + // (undocumented) + None = "None" +} + +// @public +export enum KnownServiceKind { + // (undocumented) + RawWebSockets = "RawWebSockets", + // (undocumented) + SignalR = "SignalR" +} + +// @public +export enum KnownSharedPrivateLinkResourceStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected", + // (undocumented) + Timeout = "Timeout" +} + +// @public +export enum KnownSignalRRequestType { + // (undocumented) + ClientConnection = "ClientConnection", + // (undocumented) + Restapi = "RESTAPI", + // (undocumented) + ServerConnection = "ServerConnection", + // (undocumented) + Trace = "Trace" +} + +// @public +export enum KnownSignalRSkuTier { + // (undocumented) + Basic = "Basic", + // (undocumented) + Free = "Free", + // (undocumented) + Premium = "Premium", + // (undocumented) + Standard = "Standard" +} + +// @public +export enum KnownUpstreamAuthType { + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + None = "None" +} + +// @public +export interface LogSpecification { + displayName?: string; + name?: string; +} + +// @public +export interface ManagedIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ManagedIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentityProperty; + }; +} + +// @public +export interface ManagedIdentitySettings { + resource?: string; +} + +// @public +export type ManagedIdentityType = string; + +// @public +export interface MetricSpecification { + aggregationType?: string; + category?: string; + dimensions?: Dimension[]; + displayDescription?: string; + displayName?: string; + fillGapWithZero?: string; + name?: string; + unit?: string; +} + +// @public +export interface NameAvailability { + message?: string; + nameAvailable?: boolean; + reason?: string; +} + +// @public +export interface NameAvailabilityParameters { + name: string; + type: string; +} + +// @public +export interface NetworkACL { + allow?: SignalRRequestType[]; + deny?: SignalRRequestType[]; +} + +// @public +export interface Operation { + display?: OperationDisplay; + isDataAction?: boolean; + name?: string; + origin?: string; + properties?: OperationProperties; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationList { + nextLink?: string; + value?: Operation[]; +} + +// @public +export interface OperationProperties { + serviceSpecification?: ServiceSpecification; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationList; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationList; + +// @public +export interface PrivateEndpoint { + id?: string; +} + +// @public +export type PrivateEndpointACL = NetworkACL & { + name: string; +}; + +// @public +export type PrivateEndpointConnection = ProxyResource & { + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + privateEndpoint?: PrivateEndpoint; + readonly groupIds?: string[]; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; +}; + +// @public +export interface PrivateEndpointConnectionList { + nextLink?: string; + value?: PrivateEndpointConnection[]; +} + +// @public +export type PrivateLinkResource = ProxyResource & { + groupId?: string; + requiredMembers?: string[]; + requiredZoneNames?: string[]; + shareablePrivateLinkResourceTypes?: ShareablePrivateLinkResourceType[]; +}; + +// @public +export interface PrivateLinkResourceList { + nextLink?: string; + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateLinkServiceConnectionStatus; +} + +// @public +export type PrivateLinkServiceConnectionStatus = string; + +// @public +export type ProvisioningState = string; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface RegenerateKeyParameters { + keyType?: KeyType_2; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourceLogCategory { + enabled?: string; + name?: string; +} + +// @public +export interface ResourceLogConfiguration { + categories?: ResourceLogCategory[]; +} + +// @public +export interface ResourceSku { + capacity?: number; + readonly family?: string; + name: string; + readonly size?: string; + tier?: SignalRSkuTier; +} + +// @public +export type ScaleType = string; + +// @public +export interface ServerlessUpstreamSettings { + templates?: UpstreamTemplate[]; +} + +// @public +export type ServiceKind = string; + +// @public +export interface ServiceSpecification { + logSpecifications?: LogSpecification[]; + metricSpecifications?: MetricSpecification[]; +} + +// @public +export interface ShareablePrivateLinkResourceProperties { + description?: string; + groupId?: string; + type?: string; +} + +// @public +export interface ShareablePrivateLinkResourceType { + name?: string; + properties?: ShareablePrivateLinkResourceProperties; +} + +// @public +export type SharedPrivateLinkResource = ProxyResource & { + readonly systemData?: SystemData; + groupId?: string; + privateLinkResourceId?: string; + readonly provisioningState?: ProvisioningState; + requestMessage?: string; + readonly status?: SharedPrivateLinkResourceStatus; +}; + +// @public +export interface SharedPrivateLinkResourceList { + nextLink?: string; + value?: SharedPrivateLinkResource[]; +} + +// @public +export type SharedPrivateLinkResourceStatus = string; + +// @public +export interface SignalR { + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: SignalRResource, options?: SignalRCreateOrUpdateOptionalParams): Promise, SignalRCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, parameters: SignalRResource, options?: SignalRCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, options?: SignalRDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: SignalRDeleteOptionalParams): Promise; + beginRegenerateKey(resourceGroupName: string, resourceName: string, parameters: RegenerateKeyParameters, options?: SignalRRegenerateKeyOptionalParams): Promise, SignalRRegenerateKeyResponse>>; + beginRegenerateKeyAndWait(resourceGroupName: string, resourceName: string, parameters: RegenerateKeyParameters, options?: SignalRRegenerateKeyOptionalParams): Promise; + beginRestart(resourceGroupName: string, resourceName: string, options?: SignalRRestartOptionalParams): Promise, void>>; + beginRestartAndWait(resourceGroupName: string, resourceName: string, options?: SignalRRestartOptionalParams): Promise; + beginUpdate(resourceGroupName: string, resourceName: string, parameters: SignalRResource, options?: SignalRUpdateOptionalParams): Promise, SignalRUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, resourceName: string, parameters: SignalRResource, options?: SignalRUpdateOptionalParams): Promise; + checkNameAvailability(location: string, parameters: NameAvailabilityParameters, options?: SignalRCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: SignalRGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: SignalRListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: SignalRListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, resourceName: string, options?: SignalRListKeysOptionalParams): Promise; + listSkus(resourceGroupName: string, resourceName: string, options?: SignalRListSkusOptionalParams): Promise; +} + +// @public +export interface SignalRCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRCheckNameAvailabilityResponse = NameAvailability; + +// @public +export interface SignalRCorsSettings { + allowedOrigins?: string[]; +} + +// @public +export interface SignalRCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SignalRCreateOrUpdateResponse = SignalRResource; + +// @public +export interface SignalRDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SignalRFeature { + flag: FeatureFlags; + properties?: { + [propertyName: string]: string; + }; + value: string; +} + +// @public +export interface SignalRGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRGetResponse = SignalRResource; + +// @public +export interface SignalRKeys { + primaryConnectionString?: string; + primaryKey?: string; + secondaryConnectionString?: string; + secondaryKey?: string; +} + +// @public +export interface SignalRListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRListByResourceGroupNextResponse = SignalRResourceList; + +// @public +export interface SignalRListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRListByResourceGroupResponse = SignalRResourceList; + +// @public +export interface SignalRListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRListBySubscriptionNextResponse = SignalRResourceList; + +// @public +export interface SignalRListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRListBySubscriptionResponse = SignalRResourceList; + +// @public +export interface SignalRListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRListKeysResponse = SignalRKeys; + +// @public +export interface SignalRListSkusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRListSkusResponse = SkuList; + +// @public (undocumented) +export class SignalRManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: SignalRManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + operations: Operations; + // (undocumented) + signalR: SignalR; + // (undocumented) + signalRPrivateEndpointConnections: SignalRPrivateEndpointConnections; + // (undocumented) + signalRPrivateLinkResources: SignalRPrivateLinkResources; + // (undocumented) + signalRSharedPrivateLinkResources: SignalRSharedPrivateLinkResources; + // (undocumented) + subscriptionId: string; + // (undocumented) + usages: Usages; +} + +// @public +export interface SignalRManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface SignalRNetworkACLs { + defaultAction?: ACLAction; + privateEndpoints?: PrivateEndpointACL[]; + publicNetwork?: NetworkACL; +} + +// @public +export interface SignalRPrivateEndpointConnections { + beginDelete(privateEndpointConnectionName: string, resourceGroupName: string, resourceName: string, options?: SignalRPrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(privateEndpointConnectionName: string, resourceGroupName: string, resourceName: string, options?: SignalRPrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(privateEndpointConnectionName: string, resourceGroupName: string, resourceName: string, options?: SignalRPrivateEndpointConnectionsGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: SignalRPrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; + update(privateEndpointConnectionName: string, resourceGroupName: string, resourceName: string, parameters: PrivateEndpointConnection, options?: SignalRPrivateEndpointConnectionsUpdateOptionalParams): Promise; +} + +// @public +export interface SignalRPrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SignalRPrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRPrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface SignalRPrivateEndpointConnectionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRPrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionList; + +// @public +export interface SignalRPrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRPrivateEndpointConnectionsListResponse = PrivateEndpointConnectionList; + +// @public +export interface SignalRPrivateEndpointConnectionsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRPrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection; + +// @public +export interface SignalRPrivateLinkResources { + list(resourceGroupName: string, resourceName: string, options?: SignalRPrivateLinkResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SignalRPrivateLinkResourcesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRPrivateLinkResourcesListNextResponse = PrivateLinkResourceList; + +// @public +export interface SignalRPrivateLinkResourcesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRPrivateLinkResourcesListResponse = PrivateLinkResourceList; + +// @public +export interface SignalRRegenerateKeyOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SignalRRegenerateKeyResponse = SignalRKeys; + +// @public +export type SignalRRequestType = string; + +// @public +export type SignalRResource = TrackedResource & { + sku?: ResourceSku; + kind?: ServiceKind; + identity?: ManagedIdentity; + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + readonly externalIP?: string; + readonly hostName?: string; + readonly publicPort?: number; + readonly serverPort?: number; + readonly version?: string; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly sharedPrivateLinkResources?: SharedPrivateLinkResource[]; + tls?: SignalRTlsSettings; + readonly hostNamePrefix?: string; + features?: SignalRFeature[]; + resourceLogConfiguration?: ResourceLogConfiguration; + cors?: SignalRCorsSettings; + upstream?: ServerlessUpstreamSettings; + networkACLs?: SignalRNetworkACLs; + publicNetworkAccess?: string; + disableLocalAuth?: boolean; + disableAadAuth?: boolean; +}; + +// @public +export interface SignalRResourceList { + nextLink?: string; + value?: SignalRResource[]; +} + +// @public +export interface SignalRRestartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SignalRSharedPrivateLinkResources { + beginCreateOrUpdate(sharedPrivateLinkResourceName: string, resourceGroupName: string, resourceName: string, parameters: SharedPrivateLinkResource, options?: SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams): Promise, SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(sharedPrivateLinkResourceName: string, resourceGroupName: string, resourceName: string, parameters: SharedPrivateLinkResource, options?: SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams): Promise; + beginDelete(sharedPrivateLinkResourceName: string, resourceGroupName: string, resourceName: string, options?: SignalRSharedPrivateLinkResourcesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(sharedPrivateLinkResourceName: string, resourceGroupName: string, resourceName: string, options?: SignalRSharedPrivateLinkResourcesDeleteOptionalParams): Promise; + get(sharedPrivateLinkResourceName: string, resourceGroupName: string, resourceName: string, options?: SignalRSharedPrivateLinkResourcesGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: SignalRSharedPrivateLinkResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse = SharedPrivateLinkResource; + +// @public +export interface SignalRSharedPrivateLinkResourcesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SignalRSharedPrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRSharedPrivateLinkResourcesGetResponse = SharedPrivateLinkResource; + +// @public +export interface SignalRSharedPrivateLinkResourcesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRSharedPrivateLinkResourcesListNextResponse = SharedPrivateLinkResourceList; + +// @public +export interface SignalRSharedPrivateLinkResourcesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRSharedPrivateLinkResourcesListResponse = SharedPrivateLinkResourceList; + +// @public +export type SignalRSkuTier = string; + +// @public +export interface SignalRTlsSettings { + clientCertEnabled?: boolean; +} + +// @public +export interface SignalRUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SignalRUpdateResponse = SignalRResource; + +// @public +export interface SignalRUsage { + currentValue?: number; + id?: string; + limit?: number; + name?: SignalRUsageName; + unit?: string; +} + +// @public +export interface SignalRUsageList { + nextLink?: string; + value?: SignalRUsage[]; +} + +// @public +export interface SignalRUsageName { + localizedValue?: string; + value?: string; +} + +// @public +export interface Sku { + readonly capacity?: SkuCapacity; + readonly resourceType?: string; + readonly sku?: ResourceSku; +} + +// @public +export interface SkuCapacity { + readonly allowedValues?: number[]; + readonly default?: number; + readonly maximum?: number; + readonly minimum?: number; + readonly scaleType?: ScaleType; +} + +// @public +export interface SkuList { + readonly nextLink?: string; + readonly value?: Sku[]; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + location?: string; + tags?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface UpstreamAuthSettings { + managedIdentity?: ManagedIdentitySettings; + type?: UpstreamAuthType; +} + +// @public +export type UpstreamAuthType = string; + +// @public +export interface UpstreamTemplate { + auth?: UpstreamAuthSettings; + categoryPattern?: string; + eventPattern?: string; + hubPattern?: string; + urlTemplate: string; +} + +// @public +export interface Usages { + list(location: string, options?: UsagesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface UsagesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type UsagesListNextResponse = SignalRUsageList; + +// @public +export interface UsagesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type UsagesListResponse = SignalRUsageList; + +// @public +export interface UserAssignedIdentityProperty { + readonly clientId?: string; + readonly principalId?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/signalr/arm-signalr/rollup.config.js b/sdk/signalr/arm-signalr/rollup.config.js index 7592cd72d347..9be1955eb7f1 100644 --- a/sdk/signalr/arm-signalr/rollup.config.js +++ b/sdk/signalr/arm-signalr/rollup.config.js @@ -1,31 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -/** - * @type {rollup.RollupFileOptions} - */ -const config = { - input: "./esm/signalRManagementClient.js", - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-signalr.js", - format: "umd", - name: "Azure.ArmSignalr", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" - }, - banner: `/* +/* * 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. - */` - }, - plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()] + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/signalr/arm-signalr/src/models/usagesMappers.ts b/sdk/signalr/arm-signalr/src/index.ts similarity index 56% rename from sdk/signalr/arm-signalr/src/models/usagesMappers.ts rename to sdk/signalr/arm-signalr/src/index.ts index fc1b2d37d776..025dc94a0449 100644 --- a/sdk/signalr/arm-signalr/src/models/usagesMappers.ts +++ b/sdk/signalr/arm-signalr/src/index.ts @@ -6,11 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export { - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - SignalRUsage, - SignalRUsageList, - SignalRUsageName -} from "../models/mappers"; +/// +export * from "./models"; +export { SignalRManagementClient } from "./signalRManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/signalr/arm-signalr/src/lroImpl.ts b/sdk/signalr/arm-signalr/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/signalr/arm-signalr/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/signalr/arm-signalr/src/models/index.ts b/sdk/signalr/arm-signalr/src/models/index.ts index 710d95537822..04158f1b9a01 100644 --- a/sdk/signalr/arm-signalr/src/models/index.ts +++ b/sdk/signalr/arm-signalr/src/models/index.ts @@ -6,1667 +6,1258 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; - -/** - * Specifications of the Dimension of metrics. - */ -export interface Dimension { - /** - * The public facing name of the dimension. - */ - name?: string; - /** - * Localized friendly display name of the dimension. - */ - displayName?: string; +/** Result of the request to list REST API operations. It contains a list of operations. */ +export interface OperationList { + /** List of operations supported by the resource provider. */ + value?: Operation[]; /** - * Name of the dimension as it appears in MDM. - */ - internalName?: string; - /** - * A Boolean flag indicating whether this dimension should be included for the shoebox export - * scenario. + * The URL the client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. */ - toBeExportedForShoebox?: boolean; + nextLink?: string; } -/** - * Specifications of the Logs for Azure Monitoring. - */ -export interface LogSpecification { - /** - * Name of the log. - */ +/** REST API operation supported by resource provider. */ +export interface Operation { + /** Name of the operation with format: {provider}/{resource}/{operation} */ name?: string; - /** - * Localized friendly display name of the log. - */ - displayName?: string; + /** If the operation is a data action. (for data plane rbac) */ + isDataAction?: boolean; + /** The object that describes the operation. */ + display?: OperationDisplay; + /** Optional. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. */ + origin?: string; + /** Extra properties for the operation. */ + properties?: OperationProperties; } -/** - * Properties of user assigned identity. - */ -export interface UserAssignedIdentityProperty { - /** - * Get the principal id for the user assigned identity - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly principalId?: string; - /** - * Get the client id for the user assigned identity - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly clientId?: string; +/** The object that describes a operation. */ +export interface OperationDisplay { + /** Friendly name of the resource provider */ + provider?: string; + /** Resource type on which the operation is performed. */ + resource?: string; + /** The localized friendly name for the operation. */ + operation?: string; + /** The localized friendly description for the operation */ + description?: string; } -/** - * A class represent managed identities used for request and response - */ -export interface ManagedIdentity { - /** - * Represent the identity type: systemAssigned, userAssigned, None. Possible values include: - * 'None', 'SystemAssigned', 'UserAssigned' - */ - type?: ManagedIdentityType; - /** - * Get or set the user assigned identities - */ - userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentityProperty }; - /** - * Get the principal id for the system assigned identity. - * Only be used in response. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly principalId?: string; - /** - * Get the tenant id for the system assigned identity. - * Only be used in response - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tenantId?: string; +/** Extra Operation properties. */ +export interface OperationProperties { + /** The service specifications. */ + serviceSpecification?: ServiceSpecification; } -/** - * Managed identity settings for upstream. - */ -export interface ManagedIdentitySettings { - /** - * The Resource indicating the App ID URI of the target resource. - * It also appears in the aud (audience) claim of the issued token. - */ - resource?: string; +/** An object that describes a specification. */ +export interface ServiceSpecification { + /** Specifications of the Metrics for Azure Monitoring. */ + metricSpecifications?: MetricSpecification[]; + /** Specifications of the Logs for Azure Monitoring. */ + logSpecifications?: LogSpecification[]; } -/** - * Specifications of the Metrics for Azure Monitoring. - */ +/** Specifications of the Metrics for Azure Monitoring. */ export interface MetricSpecification { - /** - * Name of the metric. - */ + /** Name of the metric. */ name?: string; - /** - * Localized friendly display name of the metric. - */ + /** Localized friendly display name of the metric. */ displayName?: string; - /** - * Localized friendly description of the metric. - */ + /** Localized friendly description of the metric. */ displayDescription?: string; - /** - * The unit that makes sense for the metric. - */ + /** The unit that makes sense for the metric. */ unit?: string; - /** - * Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. - */ + /** Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. */ aggregationType?: string; /** - * Optional. If set to true, then zero will be returned for time duration where no metric is - * emitted/published. - * Ex. a metric that returns the number of times a particular error code was emitted. The error - * code may not appear - * often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where - * nothing was emitted. + * Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + * Ex. a metric that returns the number of times a particular error code was emitted. The error code may not appear + * often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where nothing was emitted. */ fillGapWithZero?: string; - /** - * The name of the metric category that the metric belongs to. A metric can only belong to a - * single category. - */ + /** The name of the metric category that the metric belongs to. A metric can only belong to a single category. */ category?: string; - /** - * The dimensions of the metrics. - */ + /** The dimensions of the metrics. */ dimensions?: Dimension[]; } -/** - * Result of the request to check name availability. It contains a flag and possible reason of - * failure. - */ -export interface NameAvailability { - /** - * Indicates whether the name is available or not. - */ - nameAvailable?: boolean; - /** - * The reason of the availability. Required if name is not available. - */ - reason?: string; - /** - * The message of the operation. - */ - message?: string; +/** Specifications of the Dimension of metrics. */ +export interface Dimension { + /** The public facing name of the dimension. */ + name?: string; + /** Localized friendly display name of the dimension. */ + displayName?: string; + /** Name of the dimension as it appears in MDM. */ + internalName?: string; + /** A Boolean flag indicating whether this dimension should be included for the shoebox export scenario. */ + toBeExportedForShoebox?: boolean; } -/** - * Data POST-ed to the nameAvailability action - */ -export interface NameAvailabilityParameters { - /** - * The resource type. Can be "Microsoft.SignalRService/SignalR" or - * "Microsoft.SignalRService/webPubSub" - */ - type: string; - /** - * The resource name to validate. e.g."my-resource-name" - */ - name: string; +/** Specifications of the Logs for Azure Monitoring. */ +export interface LogSpecification { + /** Name of the log. */ + name?: string; + /** Localized friendly display name of the log. */ + displayName?: string; } -/** - * Network ACL - */ -export interface NetworkACL { - /** - * Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, - * RESTAPI. - */ - allow?: SignalRRequestType[]; - /** - * Denied request types. The value can be one or more of: ClientConnection, ServerConnection, - * RESTAPI. - */ - deny?: SignalRRequestType[]; +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; } -/** - * The object that describes a operation. - */ -export interface OperationDisplay { +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; /** - * Friendly name of the resource provider + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provider?: string; + readonly message?: string; /** - * Resource type on which the operation is performed. + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resource?: string; + readonly target?: string; /** - * The localized friendly name for the operation. + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operation?: string; + readonly details?: ErrorDetail[]; /** - * The localized friendly description for the operation + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** - * An object that describes a specification. - */ -export interface ServiceSpecification { +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * Specifications of the Metrics for Azure Monitoring. + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - metricSpecifications?: MetricSpecification[]; + readonly type?: string; /** - * Specifications of the Logs for Azure Monitoring. + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - logSpecifications?: LogSpecification[]; + readonly info?: Record; } -/** - * Extra Operation properties. - */ -export interface OperationProperties { - /** - * The service specifications. - */ - serviceSpecification?: ServiceSpecification; +/** Data POST-ed to the nameAvailability action */ +export interface NameAvailabilityParameters { + /** The resource type. Can be "Microsoft.SignalRService/SignalR" or "Microsoft.SignalRService/webPubSub" */ + type: string; + /** The resource name to validate. e.g."my-resource-name" */ + name: string; } -/** - * REST API operation supported by resource provider. - */ -export interface Operation { - /** - * Name of the operation with format: {provider}/{resource}/{operation} - */ - name?: string; - /** - * If the operation is a data action. (for data plane rbac) - */ - isDataAction?: boolean; - /** - * The object that describes the operation. - */ - display?: OperationDisplay; - /** - * Optional. The intended executor of the operation; governs the display of the operation in the - * RBAC UX and the audit logs UX. - */ - origin?: string; - /** - * Extra properties for the operation. - */ - properties?: OperationProperties; +/** Result of the request to check name availability. It contains a flag and possible reason of failure. */ +export interface NameAvailability { + /** Indicates whether the name is available or not. */ + nameAvailable?: boolean; + /** The reason of the availability. Required if name is not available. */ + reason?: string; + /** The message of the operation. */ + message?: string; } -/** - * Private endpoint - */ -export interface PrivateEndpoint { +/** Object that includes an array of the resource usages and a possible link for next set. */ +export interface SignalRUsageList { + /** List of the resource usages */ + value?: SignalRUsage[]; /** - * Full qualified Id of the private endpoint + * The URL the client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. */ + nextLink?: string; +} + +/** Object that describes a specific usage of the resources. */ +export interface SignalRUsage { + /** Fully qualified ARM resource id */ id?: string; + /** Current value for the usage quota. */ + currentValue?: number; + /** The maximum permitted value for the usage quota. If there is no limit, this value will be -1. */ + limit?: number; + /** Localizable String object containing the name and a localized value. */ + name?: SignalRUsageName; + /** Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. */ + unit?: string; } -/** - * ACL for a private endpoint - */ -export interface PrivateEndpointACL extends NetworkACL { +/** Localizable String object containing the name and a localized value. */ +export interface SignalRUsageName { + /** The identifier of the usage. */ + value?: string; + /** Localized name of the usage. */ + localizedValue?: string; +} + +/** Object that includes an array of resources and a possible link for next set. */ +export interface SignalRResourceList { + /** List of the resources */ + value?: SignalRResource[]; /** - * Name of the private endpoint connection + * The URL the client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. */ - name: string; + nextLink?: string; } -/** - * Metadata pertaining to creation and last modification of the resource. - */ -export interface SystemData { +/** The billing information of the resource. */ +export interface ResourceSku { /** - * The identity that created the resource. + * The name of the SKU. Required. + * + * Allowed values: Standard_S1, Free_F1 */ - createdBy?: string; + name: string; /** - * The type of identity that created the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' + * Optional tier of this particular SKU. 'Standard' or 'Free'. + * + * `Basic` is deprecated, use `Standard` instead. */ - createdByType?: CreatedByType; + tier?: SignalRSkuTier; /** - * The timestamp of resource creation (UTC). + * Not used. Retained for future use. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - createdAt?: Date; + readonly size?: string; /** - * The identity that last modified the resource. + * Not used. Retained for future use. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastModifiedBy?: string; + readonly family?: string; /** - * The type of identity that last modified the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' + * Optional, integer. The unit count of the resource. 1 by default. + * + * If present, following values are allowed: + * Free: 1 + * Standard: 1,2,5,10,20,50,100 */ + capacity?: number; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ lastModifiedByType?: CreatedByType; - /** - * The timestamp of resource last modification (UTC) - */ + /** The timestamp of resource last modification (UTC) */ lastModifiedAt?: Date; } -/** - * Connection state of the private endpoint connection - */ +/** Private endpoint */ +export interface PrivateEndpoint { + /** Full qualified Id of the private endpoint */ + id?: string; +} + +/** Connection state of the private endpoint connection */ export interface PrivateLinkServiceConnectionState { - /** - * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' - */ + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ status?: PrivateLinkServiceConnectionStatus; - /** - * The reason for approval/rejection of the connection. - */ + /** The reason for approval/rejection of the connection. */ description?: string; - /** - * A message indicating if changes on the service provider require any updates on the consumer. - */ + /** A message indicating if changes on the service provider require any updates on the consumer. */ actionsRequired?: string; } -/** - * The core properties of ARM resources. - */ -export interface Resource extends BaseResource { +/** The core properties of ARM resources. */ +export interface Resource { /** * Fully qualified resource Id for the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * The name of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * The type of the resource - e.g. "Microsoft.SignalRService/SignalR" - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; } -/** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags - */ -export interface ProxyResource extends Resource {} - -/** - * A private endpoint connection to an azure resource - */ -export interface PrivateEndpointConnection extends ProxyResource { - /** - * Metadata pertaining to creation and last modification of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly systemData?: SystemData; - /** - * Provisioning state of the private endpoint connection. Possible values include: 'Unknown', - * 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: ProvisioningState; - /** - * Private endpoint associated with the private endpoint connection - */ - privateEndpoint?: PrivateEndpoint; - /** - * Connection state - */ - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; -} - -/** - * Describes the properties of a resource type that has been onboarded to private link service - */ -export interface ShareablePrivateLinkResourceProperties { - /** - * The description of the resource type that has been onboarded to private link service - */ - description?: string; - /** - * The resource provider group id for the resource that has been onboarded to private link - * service - */ - groupId?: string; - /** - * The resource provider type for the resource that has been onboarded to private link service - */ - type?: string; -} - -/** - * Describes a resource type that has been onboarded to private link service - */ -export interface ShareablePrivateLinkResourceType { - /** - * The name of the resource type that has been onboarded to private link service - */ - name?: string; - /** - * Describes the properties of a resource type that has been onboarded to private link service - */ - properties?: ShareablePrivateLinkResourceProperties; -} - -/** - * Private link resource - */ -export interface PrivateLinkResource extends ProxyResource { - /** - * Group Id of the private link resource - */ - groupId?: string; - /** - * Required members of the private link resource - */ - requiredMembers?: string[]; - /** - * Required private DNS zone names - */ - requiredZoneNames?: string[]; - /** - * The list of resources that are onboarded to private link service - */ - shareablePrivateLinkResourceTypes?: ShareablePrivateLinkResourceType[]; +/** TLS settings for the resource */ +export interface SignalRTlsSettings { + /** Request client certificate during TLS handshake if enabled */ + clientCertEnabled?: boolean; } -/** - * Parameters describes the request to regenerate access keys - */ -export interface RegenerateKeyParameters { +/** Feature of a resource, which controls the runtime behavior. */ +export interface SignalRFeature { /** - * The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible - * values include: 'Primary', 'Secondary' + * FeatureFlags is the supported features of Azure SignalR service. + * - ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your application doesn't have a backend server; "Classic": for backward compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use. + * - EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category respectively. + * - EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category respectively. + * - EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will give you live traces in real time, it will be helpful when you developing your own Azure SignalR based web application or self-troubleshooting some issues. Please note that live traces are counted as outbound messages that will be charged. Values allowed: "true"/"false", to enable/disable live trace feature. */ - keyType?: KeyType; + flag: FeatureFlags; + /** Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/azure/azure-signalr/ for allowed values. */ + value: string; + /** Optional properties related to this feature. */ + properties?: { [propertyName: string]: string }; } -/** - * The billing information of the resource. - */ -export interface ResourceSku { - /** - * The name of the SKU. Required. - * - * Allowed values: Standard_S1, Free_F1 - */ - name: string; - /** - * Optional tier of this particular SKU. 'Standard' or 'Free'. - * - * `Basic` is deprecated, use `Standard` instead. Possible values include: 'Free', 'Basic', - * 'Standard', 'Premium' - */ - tier?: SignalRSkuTier; - /** - * Not used. Retained for future use. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly size?: string; - /** - * Not used. Retained for future use. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly family?: string; - /** - * Optional, integer. The unit count of the resource. 1 by default. - * - * If present, following values are allowed: - * Free: 1 - * Standard: 1,2,5,10,20,50,100 - */ - capacity?: number; +/** Resource log configuration of a Microsoft.SignalRService resource. */ +export interface ResourceLogConfiguration { + /** Gets or sets the list of category configurations. */ + categories?: ResourceLogCategory[]; } -/** - * Upstream auth settings. - */ -export interface UpstreamAuthSettings { +/** Resource log category configuration of a Microsoft.SignalRService resource. */ +export interface ResourceLogCategory { /** - * Gets or sets the type of auth. None or ManagedIdentity is supported now. Possible values - * include: 'None', 'ManagedIdentity' + * Gets or sets the resource log category's name. + * Available values: ConnectivityLogs, MessagingLogs. + * Case insensitive. */ - type?: UpstreamAuthType; + name?: string; /** - * Gets or sets the managed identity settings. It's required if the auth type is set to - * ManagedIdentity. + * Indicates whether or the resource log category is enabled. + * Available values: true, false. + * Case insensitive. */ - managedIdentity?: ManagedIdentitySettings; + enabled?: string; +} + +/** Cross-Origin Resource Sharing (CORS) settings. */ +export interface SignalRCorsSettings { + /** Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all. If omitted, allow all by default. */ + allowedOrigins?: string[]; +} + +/** The settings for the Upstream when the service is in server-less mode. */ +export interface ServerlessUpstreamSettings { + /** Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects. */ + templates?: UpstreamTemplate[]; } /** * Upstream template item settings. It defines the Upstream URL of the incoming requests. - * The template defines the pattern of the event, the hub or the category of the incoming request - * that matches current URL template. + * The template defines the pattern of the event, the hub or the category of the incoming request that matches current URL template. */ export interface UpstreamTemplate { /** * Gets or sets the matching pattern for hub names. If not set, it matches any hub. * There are 3 kind of patterns supported: - * 1. "*", it to matches any hub name - * 2. Combine multiple hubs with ",", for example "hub1,hub2", it matches "hub1" and "hub2" - * 3. The single hub name, for example, "hub1", it matches "hub1" + * 1. "*", it to matches any hub name + * 2. Combine multiple hubs with ",", for example "hub1,hub2", it matches "hub1" and "hub2" + * 3. The single hub name, for example, "hub1", it matches "hub1" */ hubPattern?: string; /** * Gets or sets the matching pattern for event names. If not set, it matches any event. * There are 3 kind of patterns supported: - * 1. "*", it to matches any event name - * 2. Combine multiple events with ",", for example "connect,disconnect", it matches event - * "connect" and "disconnect" - * 3. The single event name, for example, "connect", it matches "connect" + * 1. "*", it to matches any event name + * 2. Combine multiple events with ",", for example "connect,disconnect", it matches event "connect" and "disconnect" + * 3. The single event name, for example, "connect", it matches "connect" */ eventPattern?: string; /** * Gets or sets the matching pattern for category names. If not set, it matches any category. * There are 3 kind of patterns supported: - * 1. "*", it to matches any category name - * 2. Combine multiple categories with ",", for example "connections,messages", it matches - * category "connections" and "messages" - * 3. The single category name, for example, "connections", it matches the category "connections" + * 1. "*", it to matches any category name + * 2. Combine multiple categories with ",", for example "connections,messages", it matches category "connections" and "messages" + * 3. The single category name, for example, "connections", it matches the category "connections" */ categoryPattern?: string; /** - * Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} - * {event} inside the template, the value of the Upstream URL is dynamically calculated when the - * client request comes in. - * For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client - * request from hub `chat` connects, it will first POST to this URL: - * `http://example.com/chat/api/connect`. + * Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} {event} inside the template, the value of the Upstream URL is dynamically calculated when the client request comes in. + * For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`. */ urlTemplate: string; - /** - * Gets or sets the auth settings for an upstream. If not set, no auth is used for upstream - * messages. - */ + /** Gets or sets the auth settings for an upstream. If not set, no auth is used for upstream messages. */ auth?: UpstreamAuthSettings; } -/** - * The settings for the Upstream when the service is in server-less mode. - */ -export interface ServerlessUpstreamSettings { - /** - * Gets or sets the list of Upstream URL templates. Order matters, and the first matching - * template takes effects. - */ - templates?: UpstreamTemplate[]; +/** Upstream auth settings. */ +export interface UpstreamAuthSettings { + /** Gets or sets the type of auth. None or ManagedIdentity is supported now. */ + type?: UpstreamAuthType; + /** Gets or sets the managed identity settings. It's required if the auth type is set to ManagedIdentity. */ + managedIdentity?: ManagedIdentitySettings; } -/** - * Describes a Shared Private Link Resource - */ -export interface SharedPrivateLinkResource extends ProxyResource { +/** Managed identity settings for upstream. */ +export interface ManagedIdentitySettings { /** - * Metadata pertaining to creation and last modification of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Resource indicating the App ID URI of the target resource. + * It also appears in the aud (audience) claim of the issued token. */ - readonly systemData?: SystemData; + resource?: string; +} + +/** Network ACLs for the resource */ +export interface SignalRNetworkACLs { + /** Default action when no other rule matches */ + defaultAction?: ACLAction; + /** ACL for requests from public network */ + publicNetwork?: NetworkACL; + /** ACLs for requests from private endpoints */ + privateEndpoints?: PrivateEndpointACL[]; +} + +/** Network ACL */ +export interface NetworkACL { + /** Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. */ + allow?: SignalRRequestType[]; + /** Denied request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. */ + deny?: SignalRRequestType[]; +} + +/** A class represent managed identities used for request and response */ +export interface ManagedIdentity { + /** Represent the identity type: systemAssigned, userAssigned, None */ + type?: ManagedIdentityType; + /** Get or set the user assigned identities */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentityProperty; + }; /** - * The group id from the provider of resource the shared private link resource is for + * Get the principal id for the system assigned identity. + * Only be used in response. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - groupId: string; + readonly principalId?: string; /** - * The resource id of the resource the shared private link resource is for + * Get the tenant id for the system assigned identity. + * Only be used in response + * NOTE: This property will not be serialized. It can only be populated by the server. */ - privateLinkResourceId: string; + readonly tenantId?: string; +} + +/** Properties of user assigned identity. */ +export interface UserAssignedIdentityProperty { /** - * Provisioning state of the shared private link resource. Possible values include: 'Unknown', - * 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Get the principal id for the user assigned identity + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: ProvisioningState; + readonly principalId?: string; /** - * The request message for requesting approval of the shared private link resource + * Get the client id for the user assigned identity + * NOTE: This property will not be serialized. It can only be populated by the server. */ - requestMessage?: string; + readonly clientId?: string; +} + +/** A class represents the access keys of the resource. */ +export interface SignalRKeys { + /** The primary access key. */ + primaryKey?: string; + /** The secondary access key. */ + secondaryKey?: string; + /** Connection string constructed via the primaryKey */ + primaryConnectionString?: string; + /** Connection string constructed via the secondaryKey */ + secondaryConnectionString?: string; +} + +/** A list of private endpoint connections */ +export interface PrivateEndpointConnectionList { + /** The list of the private endpoint connections */ + value?: PrivateEndpointConnection[]; + /** Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested private endpoint connections exceed maximum page size. */ + nextLink?: string; +} + +/** Contains a list of PrivateLinkResource and a possible link to query more results */ +export interface PrivateLinkResourceList { + /** List of PrivateLinkResource */ + value?: PrivateLinkResource[]; /** - * Status of the shared private link resource. Possible values include: 'Pending', 'Approved', - * 'Rejected', 'Disconnected', 'Timeout' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL the client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. */ - readonly status?: SharedPrivateLinkResourceStatus; + nextLink?: string; } -/** - * Cross-Origin Resource Sharing (CORS) settings. - */ -export interface SignalRCorsSettings { +/** Describes a resource type that has been onboarded to private link service */ +export interface ShareablePrivateLinkResourceType { + /** The name of the resource type that has been onboarded to private link service */ + name?: string; + /** Describes the properties of a resource type that has been onboarded to private link service */ + properties?: ShareablePrivateLinkResourceProperties; +} + +/** Describes the properties of a resource type that has been onboarded to private link service */ +export interface ShareablePrivateLinkResourceProperties { + /** The description of the resource type that has been onboarded to private link service */ + description?: string; + /** The resource provider group id for the resource that has been onboarded to private link service */ + groupId?: string; + /** The resource provider type for the resource that has been onboarded to private link service */ + type?: string; +} + +/** Parameters describes the request to regenerate access keys */ +export interface RegenerateKeyParameters { + /** The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). */ + keyType?: KeyType; +} + +/** A list of shared private link resources */ +export interface SharedPrivateLinkResourceList { + /** The list of the shared private link resources */ + value?: SharedPrivateLinkResource[]; + /** Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested private endpoint connections exceed maximum page size. */ + nextLink?: string; +} + +/** The list skus operation response */ +export interface SkuList { /** - * Gets or sets the list of origins that should be allowed to make cross-origin calls (for - * example: http://example.com:12345). Use "*" to allow all. If omitted, allow all by default. + * The list of skus available for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - allowedOrigins?: string[]; + readonly value?: Sku[]; + /** + * The URL the client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; } -/** - * Feature of a SignalR resource, which controls the SignalR runtime behavior. - */ -export interface SignalRFeature { +/** Describes an available sku." */ +export interface Sku { /** - * FeatureFlags is the supported features of Azure SignalR service. - * - ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have - * your own backend server; "Serverless": your application doesn't have a backend server; - * "Classic": for backward compatibility. Support both Default and Serverless mode but not - * recommended; "PredefinedOnly": for future use. - * - EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category - * respectively. - * - EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category - * respectively. - * - EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR - * service, it will give you live traces in real time, it will be helpful when you developing - * your own Azure SignalR based web application or self-troubleshooting some issues. Please note - * that live traces are counted as outbound messages that will be charged. Values allowed: - * "true"/"false", to enable/disable live trace feature. Possible values include: 'ServiceMode', - * 'EnableConnectivityLogs', 'EnableMessagingLogs', 'EnableLiveTrace' + * The resource type that this object applies to + * NOTE: This property will not be serialized. It can only be populated by the server. */ - flag: FeatureFlags; + readonly resourceType?: string; /** - * Value of the feature flag. See Azure SignalR service document - * https://docs.microsoft.com/azure/azure-signalr/ for allowed values. + * The exact set of keys that define this sku. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value: string; + readonly sku?: ResourceSku; /** - * Optional properties related to this feature. + * Specifies the unit of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: { [propertyName: string]: string }; + readonly capacity?: SkuCapacity; } -/** - * A class represents the access keys of the resource. - */ -export interface SignalRKeys { +/** Describes scaling information of a sku. */ +export interface SkuCapacity { /** - * The primary access key. + * The lowest permitted capacity for this resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - primaryKey?: string; + readonly minimum?: number; /** - * The secondary access key. + * The highest permitted capacity for this resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - secondaryKey?: string; + readonly maximum?: number; /** - * Connection string constructed via the primaryKey + * The default capacity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - primaryConnectionString?: string; + readonly default?: number; /** - * Connection string constructed via the secondaryKey + * Allows capacity value list. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - secondaryConnectionString?: string; + readonly allowedValues?: number[]; + /** + * The scale type applicable to the sku. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scaleType?: ScaleType; } -/** - * Network ACLs for the resource - */ -export interface SignalRNetworkACLs { +/** The resource model definition for a ARM proxy resource. It will have everything other than required location and tags */ +export type ProxyResource = Resource & {}; + +/** The resource model definition for a ARM tracked top level resource. */ +export type TrackedResource = Resource & { + /** The GEO location of the resource. e.g. West US | East US | North Central US | South Central US. */ + location?: string; + /** Tags of the service which is a list of key value pairs that describe the resource. */ + tags?: { [propertyName: string]: string }; +}; + +/** ACL for a private endpoint */ +export type PrivateEndpointACL = NetworkACL & { + /** Name of the private endpoint connection */ + name: string; +}; + +/** A private endpoint connection to an azure resource */ +export type PrivateEndpointConnection = ProxyResource & { /** - * Default action when no other rule matches. Possible values include: 'Allow', 'Deny' + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - defaultAction?: ACLAction; + readonly systemData?: SystemData; /** - * ACL for requests from public network + * Provisioning state of the private endpoint connection + * NOTE: This property will not be serialized. It can only be populated by the server. */ - publicNetwork?: NetworkACL; + readonly provisioningState?: ProvisioningState; + /** Private endpoint associated with the private endpoint connection */ + privateEndpoint?: PrivateEndpoint; /** - * ACLs for requests from private endpoints + * Group IDs + * NOTE: This property will not be serialized. It can only be populated by the server. */ - privateEndpoints?: PrivateEndpointACL[]; -} + readonly groupIds?: string[]; + /** Connection state */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; +}; -/** - * TLS settings for the resource - */ -export interface SignalRTlsSettings { +/** Describes a Shared Private Link Resource */ +export type SharedPrivateLinkResource = ProxyResource & { /** - * Request client certificate during TLS handshake if enabled + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - clientCertEnabled?: boolean; -} - -/** - * The resource model definition for a ARM tracked top level resource. - */ -export interface TrackedResource extends Resource { + readonly systemData?: SystemData; + /** The group id from the provider of resource the shared private link resource is for */ + groupId?: string; + /** The resource id of the resource the shared private link resource is for */ + privateLinkResourceId?: string; /** - * The GEO location of the resource. e.g. West US | East US | North Central US | South Central - * US. + * Provisioning state of the shared private link resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location?: string; + readonly provisioningState?: ProvisioningState; + /** The request message for requesting approval of the shared private link resource */ + requestMessage?: string; /** - * Tags of the service which is a list of key value pairs that describe the resource. + * Status of the shared private link resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; -} + readonly status?: SharedPrivateLinkResourceStatus; +}; -/** - * A class represent a resource. - */ -export interface SignalRResource extends TrackedResource { +/** Private link resource */ +export type PrivateLinkResource = ProxyResource & { + /** Group Id of the private link resource */ + groupId?: string; + /** Required members of the private link resource */ + requiredMembers?: string[]; + /** Required private DNS zone names */ + requiredZoneNames?: string[]; + /** The list of resources that are onboarded to private link service */ + shareablePrivateLinkResourceTypes?: ShareablePrivateLinkResourceType[]; +}; + +/** A class represent a resource. */ +export type SignalRResource = TrackedResource & { + /** The billing information of the resource.(e.g. Free, Standard) */ + sku?: ResourceSku; + /** The kind of the service - e.g. "SignalR" for "Microsoft.SignalRService/SignalR" */ + kind?: ServiceKind; + /** The managed identity response */ + identity?: ManagedIdentity; /** - * The billing information of the resource.(e.g. Free, Standard) + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sku?: ResourceSku; + readonly systemData?: SystemData; /** - * Provisioning state of the resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', - * 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; /** * The publicly accessible IP of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly externalIP?: string; /** * FQDN of the service instance. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly hostName?: string; /** * The publicly accessible port of the resource which is designed for browser/client side usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly publicPort?: number; /** * The publicly accessible port of the resource which is designed for customer server side usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly serverPort?: number; /** * Version of the resource. Probably you need the same or higher version of client SDKs. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly version?: string; /** * Private endpoint connections to the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateEndpointConnections?: PrivateEndpointConnection[]; /** * The list of shared private link resources. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly sharedPrivateLinkResources?: SharedPrivateLinkResource[]; + /** TLS settings. */ + tls?: SignalRTlsSettings; /** - * TLS settings. + * Deprecated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tls?: SignalRTlsSettings; + readonly hostNamePrefix?: string; /** * List of the featureFlags. * - * FeatureFlags that are not included in the parameters for the update operation will not be - * modified. + * FeatureFlags that are not included in the parameters for the update operation will not be modified. * And the response will only include featureFlags that are explicitly set. * When a featureFlag is not explicitly set, its globally default value will be used - * But keep in mind, the default value doesn't mean "false". It varies in terms of different - * FeatureFlags. + * But keep in mind, the default value doesn't mean "false". It varies in terms of different FeatureFlags. */ features?: SignalRFeature[]; /** - * Cross-Origin Resource Sharing (CORS) settings. + * Resource log configuration of a Microsoft.SignalRService resource. + * If resourceLogConfiguration isn't null or empty, it will override options "EnableConnectivityLog" and "EnableMessagingLogs" in features. + * Otherwise, use options "EnableConnectivityLog" and "EnableMessagingLogs" in features. */ + resourceLogConfiguration?: ResourceLogConfiguration; + /** Cross-Origin Resource Sharing (CORS) settings. */ cors?: SignalRCorsSettings; - /** - * Upstream settings when the service is in server-less mode. - */ + /** Upstream settings when the service is in server-less mode. */ upstream?: ServerlessUpstreamSettings; - /** - * Network ACLs - */ + /** Network ACLs */ networkACLs?: SignalRNetworkACLs; /** - * The kind of the service - e.g. "SignalR" for "Microsoft.SignalRService/SignalR". Possible - * values include: 'SignalR', 'RawWebSockets' - */ - kind?: ServiceKind; - /** - * The managed identity response - */ - identity?: ManagedIdentity; - /** - * Metadata pertaining to creation and last modification of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly systemData?: SystemData; -} - -/** - * Localizable String object containing the name and a localized value. - */ -export interface SignalRUsageName { - /** - * The identifier of the usage. - */ - value?: string; - /** - * Localized name of the usage. - */ - localizedValue?: string; -} - -/** - * Object that describes a specific usage of the resources. - */ -export interface SignalRUsage { - /** - * Fully qualified ARM resource id - */ - id?: string; - /** - * Current value for the usage quota. - */ - currentValue?: number; - /** - * The maximum permitted value for the usage quota. If there is no limit, this value will be -1. - */ - limit?: number; - /** - * Localizable String object containing the name and a localized value. - */ - name?: SignalRUsageName; - /** - * Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, - * Percent, CountPerSecond, BytesPerSecond. - */ - unit?: string; -} - -/** - * The resource management error additional info. - */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * The additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly info?: any; -} - -/** - * The error detail. - */ -export interface ErrorDetail { - /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly code?: string; - /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly message?: string; - /** - * The error target. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly target?: string; - /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Enable or disable public network access. Default to "Enabled". + * When it's Enabled, network ACLs still apply. + * When it's Disabled, public network access is always disabled no matter what you set in network ACLs. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** - * Common error response for all Azure Resource Manager APIs to return error details for failed - * operations. (This also follows the OData error response format.). - * @summary Error response - */ -export interface ErrorResponse { + publicNetworkAccess?: string; /** - * The error object. + * DisableLocalAuth + * Enable or disable local auth with AccessKey + * When set as true, connection with AccessKey=xxx won't work. */ - error?: ErrorDetail; + disableLocalAuth?: boolean; + /** + * DisableLocalAuth + * Enable or disable aad auth + * When set as true, connection with AuthType=aad won't work. + */ + disableAadAuth?: boolean; +}; + +/** Known values of {@link SignalRSkuTier} that the service accepts. */ +export enum KnownSignalRSkuTier { + Free = "Free", + Basic = "Basic", + Standard = "Standard", + Premium = "Premium" } /** - * An interface representing SignalRManagementClientOptions. - */ -export interface SignalRManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; + * Defines values for SignalRSkuTier. \ + * {@link KnownSignalRSkuTier} can be used interchangeably with SignalRSkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Free** \ + * **Basic** \ + * **Standard** \ + * **Premium** + */ +export type SignalRSkuTier = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Unknown = "Unknown", + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Running = "Running", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Moving = "Moving" } /** - * @interface - * Result of the request to list REST API operations. It contains a list of operations. - * @extends Array - */ -export interface OperationList extends Array { - /** - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - */ - nextLink?: string; + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Running** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Moving** + */ +export type ProvisioningState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" } /** - * @interface - * Object that includes an array of resources and a possible link for next set. - * @extends Array + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** */ -export interface SignalRResourceList extends Array { - /** - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - */ - nextLink?: string; +export type CreatedByType = string; + +/** Known values of {@link PrivateLinkServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateLinkServiceConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", + Disconnected = "Disconnected" } /** - * @interface - * Object that includes an array of the resource usages and a possible link for next set. - * @extends Array - */ -export interface SignalRUsageList extends Array { - /** - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - */ - nextLink?: string; + * Defines values for PrivateLinkServiceConnectionStatus. \ + * {@link KnownPrivateLinkServiceConnectionStatus} can be used interchangeably with PrivateLinkServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** \ + * **Disconnected** + */ +export type PrivateLinkServiceConnectionStatus = string; + +/** Known values of {@link SharedPrivateLinkResourceStatus} that the service accepts. */ +export enum KnownSharedPrivateLinkResourceStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", + Disconnected = "Disconnected", + Timeout = "Timeout" } /** - * @interface - * A list of private endpoint connections - * @extends Array - */ -export interface PrivateEndpointConnectionList extends Array { - /** - * Request URL that can be used to query next page of private endpoint connections. Returned when - * the total number of requested private endpoint connections exceed maximum page size. - */ - nextLink?: string; + * Defines values for SharedPrivateLinkResourceStatus. \ + * {@link KnownSharedPrivateLinkResourceStatus} can be used interchangeably with SharedPrivateLinkResourceStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** \ + * **Disconnected** \ + * **Timeout** + */ +export type SharedPrivateLinkResourceStatus = string; + +/** Known values of {@link FeatureFlags} that the service accepts. */ +export enum KnownFeatureFlags { + ServiceMode = "ServiceMode", + EnableConnectivityLogs = "EnableConnectivityLogs", + EnableMessagingLogs = "EnableMessagingLogs", + EnableLiveTrace = "EnableLiveTrace" } /** - * @interface - * Contains a list of PrivateLinkResource and a possible link to query more results - * @extends Array + * Defines values for FeatureFlags. \ + * {@link KnownFeatureFlags} can be used interchangeably with FeatureFlags, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ServiceMode** \ + * **EnableConnectivityLogs** \ + * **EnableMessagingLogs** \ + * **EnableLiveTrace** */ -export interface PrivateLinkResourceList extends Array { - /** - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - */ - nextLink?: string; +export type FeatureFlags = string; + +/** Known values of {@link UpstreamAuthType} that the service accepts. */ +export enum KnownUpstreamAuthType { + None = "None", + ManagedIdentity = "ManagedIdentity" } /** - * @interface - * A list of shared private link resources - * @extends Array + * Defines values for UpstreamAuthType. \ + * {@link KnownUpstreamAuthType} can be used interchangeably with UpstreamAuthType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **ManagedIdentity** */ -export interface SharedPrivateLinkResourceList extends Array { - /** - * Request URL that can be used to query next page of private endpoint connections. Returned when - * the total number of requested private endpoint connections exceed maximum page size. - */ - nextLink?: string; +export type UpstreamAuthType = string; + +/** Known values of {@link ACLAction} that the service accepts. */ +export enum KnownACLAction { + Allow = "Allow", + Deny = "Deny" } /** - * Defines values for ACLAction. - * Possible values include: 'Allow', 'Deny' - * @readonly - * @enum {string} + * Defines values for ACLAction. \ + * {@link KnownACLAction} can be used interchangeably with ACLAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** \ + * **Deny** */ -export type ACLAction = "Allow" | "Deny"; +export type ACLAction = string; -/** - * Defines values for FeatureFlags. - * Possible values include: 'ServiceMode', 'EnableConnectivityLogs', 'EnableMessagingLogs', - * 'EnableLiveTrace' - * @readonly - * @enum {string} - */ -export type FeatureFlags = - | "ServiceMode" - | "EnableConnectivityLogs" - | "EnableMessagingLogs" - | "EnableLiveTrace"; +/** Known values of {@link SignalRRequestType} that the service accepts. */ +export enum KnownSignalRRequestType { + ClientConnection = "ClientConnection", + ServerConnection = "ServerConnection", + Restapi = "RESTAPI", + Trace = "Trace" +} /** - * Defines values for KeyType. - * Possible values include: 'Primary', 'Secondary' - * @readonly - * @enum {string} + * Defines values for SignalRRequestType. \ + * {@link KnownSignalRRequestType} can be used interchangeably with SignalRRequestType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ClientConnection** \ + * **ServerConnection** \ + * **RESTAPI** \ + * **Trace** */ -export type KeyType = "Primary" | "Secondary"; +export type SignalRRequestType = string; -/** - * Defines values for ManagedIdentityType. - * Possible values include: 'None', 'SystemAssigned', 'UserAssigned' - * @readonly - * @enum {string} - */ -export type ManagedIdentityType = "None" | "SystemAssigned" | "UserAssigned"; +/** Known values of {@link ServiceKind} that the service accepts. */ +export enum KnownServiceKind { + SignalR = "SignalR", + RawWebSockets = "RawWebSockets" +} /** - * Defines values for SignalRRequestType. - * Possible values include: 'ClientConnection', 'ServerConnection', 'RESTAPI', 'Trace' - * @readonly - * @enum {string} + * Defines values for ServiceKind. \ + * {@link KnownServiceKind} can be used interchangeably with ServiceKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SignalR** \ + * **RawWebSockets** */ -export type SignalRRequestType = "ClientConnection" | "ServerConnection" | "RESTAPI" | "Trace"; +export type ServiceKind = string; -/** - * Defines values for CreatedByType. - * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - * @readonly - * @enum {string} - */ -export type CreatedByType = "User" | "Application" | "ManagedIdentity" | "Key"; +/** Known values of {@link ManagedIdentityType} that the service accepts. */ +export enum KnownManagedIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned" +} /** - * Defines values for ProvisioningState. - * Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', - * 'Updating', 'Deleting', 'Moving' - * @readonly - * @enum {string} + * Defines values for ManagedIdentityType. \ + * {@link KnownManagedIdentityType} can be used interchangeably with ManagedIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** */ -export type ProvisioningState = - | "Unknown" - | "Succeeded" - | "Failed" - | "Canceled" - | "Running" - | "Creating" - | "Updating" - | "Deleting" - | "Moving"; +export type ManagedIdentityType = string; -/** - * Defines values for PrivateLinkServiceConnectionStatus. - * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' - * @readonly - * @enum {string} - */ -export type PrivateLinkServiceConnectionStatus = - | "Pending" - | "Approved" - | "Rejected" - | "Disconnected"; +/** Known values of {@link KeyType} that the service accepts. */ +export enum KnownKeyType { + Primary = "Primary", + Secondary = "Secondary", + Salt = "Salt" +} /** - * Defines values for SignalRSkuTier. - * Possible values include: 'Free', 'Basic', 'Standard', 'Premium' - * @readonly - * @enum {string} + * Defines values for KeyType. \ + * {@link KnownKeyType} can be used interchangeably with KeyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Primary** \ + * **Secondary** \ + * **Salt** */ -export type SignalRSkuTier = "Free" | "Basic" | "Standard" | "Premium"; +export type KeyType = string; -/** - * Defines values for UpstreamAuthType. - * Possible values include: 'None', 'ManagedIdentity' - * @readonly - * @enum {string} - */ -export type UpstreamAuthType = "None" | "ManagedIdentity"; +/** Known values of {@link ScaleType} that the service accepts. */ +export enum KnownScaleType { + None = "None", + Manual = "Manual", + Automatic = "Automatic" +} /** - * Defines values for ServiceKind. - * Possible values include: 'SignalR', 'RawWebSockets' - * @readonly - * @enum {string} + * Defines values for ScaleType. \ + * {@link KnownScaleType} can be used interchangeably with ScaleType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Manual** \ + * **Automatic** */ -export type ServiceKind = "SignalR" | "RawWebSockets"; +export type ScaleType = string; -/** - * Defines values for SharedPrivateLinkResourceStatus. - * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' - * @readonly - * @enum {string} - */ -export type SharedPrivateLinkResourceStatus = - | "Pending" - | "Approved" - | "Rejected" - | "Disconnected" - | "Timeout"; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationList; - }; -}; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationList; -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = OperationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationList; - }; -}; +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkNameAvailability operation. - */ -export type SignalRCheckNameAvailabilityResponse = NameAvailability & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: NameAvailability; - }; -}; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationList; -/** - * Contains response data for the listBySubscription operation. - */ -export type SignalRListBySubscriptionResponse = SignalRResourceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResourceList; - }; -}; +/** Optional parameters. */ +export interface SignalRCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type SignalRListByResourceGroupResponse = SignalRResourceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResourceList; - }; -}; +/** Contains response data for the checkNameAvailability operation. */ +export type SignalRCheckNameAvailabilityResponse = NameAvailability; -/** - * Contains response data for the get operation. - */ -export type SignalRGetResponse = SignalRResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResource; - }; -}; +/** Optional parameters. */ +export interface SignalRListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type SignalRCreateOrUpdateResponse = SignalRResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResource; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type SignalRListBySubscriptionResponse = SignalRResourceList; -/** - * Contains response data for the update operation. - */ -export type SignalRUpdateResponse = SignalRResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResource; - }; -}; +/** Optional parameters. */ +export interface SignalRListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listKeys operation. - */ -export type SignalRListKeysResponse = SignalRKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRKeys; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type SignalRListByResourceGroupResponse = SignalRResourceList; -/** - * Contains response data for the regenerateKey operation. - */ -export type SignalRRegenerateKeyResponse = SignalRKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRKeys; - }; -}; +/** Optional parameters. */ +export interface SignalRGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type SignalRBeginCreateOrUpdateResponse = SignalRResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResource; - }; -}; +/** Contains response data for the get operation. */ +export type SignalRGetResponse = SignalRResource; -/** - * Contains response data for the beginUpdate operation. - */ -export type SignalRBeginUpdateResponse = SignalRResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResource; - }; -}; +/** Optional parameters. */ +export interface SignalRCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginRegenerateKey operation. - */ -export type SignalRBeginRegenerateKeyResponse = SignalRKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRKeys; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type SignalRCreateOrUpdateResponse = SignalRResource; -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type SignalRListBySubscriptionNextResponse = SignalRResourceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResourceList; - }; -}; +/** Optional parameters. */ +export interface SignalRDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type SignalRListByResourceGroupNextResponse = SignalRResourceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRResourceList; - }; -}; +/** Optional parameters. */ +export interface SignalRUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the list operation. - */ -export type UsagesListResponse = SignalRUsageList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRUsageList; - }; -}; +/** Contains response data for the update operation. */ +export type SignalRUpdateResponse = SignalRResource; -/** - * Contains response data for the listNext operation. - */ -export type UsagesListNextResponse = SignalRUsageList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SignalRUsageList; - }; -}; +/** Optional parameters. */ +export interface SignalRListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type SignalRPrivateEndpointConnectionsListResponse = PrivateEndpointConnectionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnectionList; - }; -}; +/** Contains response data for the listKeys operation. */ +export type SignalRListKeysResponse = SignalRKeys; -/** - * Contains response data for the get operation. - */ -export type SignalRPrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface SignalRRegenerateKeyOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the update operation. - */ -export type SignalRPrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Contains response data for the regenerateKey operation. */ +export type SignalRRegenerateKeyResponse = SignalRKeys; -/** - * Contains response data for the listNext operation. - */ -export type SignalRPrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnectionList; - }; -}; +/** Optional parameters. */ +export interface SignalRRestartOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the list operation. - */ -export type SignalRPrivateLinkResourcesListResponse = PrivateLinkResourceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResourceList; - }; -}; +/** Optional parameters. */ +export interface SignalRListSkusOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type SignalRPrivateLinkResourcesListNextResponse = PrivateLinkResourceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResourceList; - }; -}; +/** Contains response data for the listSkus operation. */ +export type SignalRListSkusResponse = SkuList; -/** - * Contains response data for the list operation. - */ -export type SignalRSharedPrivateLinkResourcesListResponse = SharedPrivateLinkResourceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedPrivateLinkResourceList; - }; -}; +/** Optional parameters. */ +export interface SignalRListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type SignalRSharedPrivateLinkResourcesGetResponse = SharedPrivateLinkResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedPrivateLinkResource; - }; -}; +/** Contains response data for the listBySubscriptionNext operation. */ +export type SignalRListBySubscriptionNextResponse = SignalRResourceList; -/** - * Contains response data for the createOrUpdate operation. - */ -export type SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse = SharedPrivateLinkResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedPrivateLinkResource; - }; -}; +/** Optional parameters. */ +export interface SignalRListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type SignalRSharedPrivateLinkResourcesBeginCreateOrUpdateResponse = SharedPrivateLinkResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedPrivateLinkResource; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type SignalRListByResourceGroupNextResponse = SignalRResourceList; -/** - * Contains response data for the listNext operation. - */ -export type SignalRSharedPrivateLinkResourcesListNextResponse = SharedPrivateLinkResourceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedPrivateLinkResourceList; - }; -}; +/** Optional parameters. */ +export interface UsagesListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type UsagesListResponse = SignalRUsageList; + +/** Optional parameters. */ +export interface UsagesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type UsagesListNextResponse = SignalRUsageList; + +/** Optional parameters. */ +export interface SignalRPrivateEndpointConnectionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SignalRPrivateEndpointConnectionsListResponse = PrivateEndpointConnectionList; + +/** Optional parameters. */ +export interface SignalRPrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SignalRPrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface SignalRPrivateEndpointConnectionsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type SignalRPrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface SignalRPrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface SignalRPrivateEndpointConnectionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SignalRPrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionList; + +/** Optional parameters. */ +export interface SignalRPrivateLinkResourcesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SignalRPrivateLinkResourcesListResponse = PrivateLinkResourceList; + +/** Optional parameters. */ +export interface SignalRPrivateLinkResourcesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SignalRPrivateLinkResourcesListNextResponse = PrivateLinkResourceList; + +/** Optional parameters. */ +export interface SignalRSharedPrivateLinkResourcesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SignalRSharedPrivateLinkResourcesListResponse = SharedPrivateLinkResourceList; + +/** Optional parameters. */ +export interface SignalRSharedPrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SignalRSharedPrivateLinkResourcesGetResponse = SharedPrivateLinkResource; + +/** Optional parameters. */ +export interface SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse = SharedPrivateLinkResource; + +/** Optional parameters. */ +export interface SignalRSharedPrivateLinkResourcesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface SignalRSharedPrivateLinkResourcesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SignalRSharedPrivateLinkResourcesListNextResponse = SharedPrivateLinkResourceList; + +/** Optional parameters. */ +export interface SignalRManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/signalr/arm-signalr/src/models/mappers.ts b/sdk/signalr/arm-signalr/src/models/mappers.ts index 83f2e14af57d..c3f4b85c2ed2 100644 --- a/sdk/signalr/arm-signalr/src/models/mappers.ts +++ b/sdk/signalr/arm-signalr/src/models/mappers.ts @@ -6,51 +6,39 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const Dimension: msRest.CompositeMapper = { - serializedName: "Dimension", +export const OperationList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Dimension", + className: "OperationList", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - internalName: { - serializedName: "internalName", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - toBeExportedForShoebox: { - serializedName: "toBeExportedForShoebox", - type: { - name: "Boolean" - } } } } }; -export const LogSpecification: msRest.CompositeMapper = { - serializedName: "LogSpecification", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogSpecification", + className: "Operation", modelProperties: { name: { serializedName: "name", @@ -58,74 +46,61 @@ export const LogSpecification: msRest.CompositeMapper = { name: "String" } }, - displayName: { - serializedName: "displayName", + isDataAction: { + serializedName: "isDataAction", type: { - name: "String" + name: "Boolean" } - } - } - } -}; - -export const UserAssignedIdentityProperty: msRest.CompositeMapper = { - serializedName: "UserAssignedIdentityProperty", - type: { - name: "Composite", - className: "UserAssignedIdentityProperty", - modelProperties: { - principalId: { - readOnly: true, - serializedName: "principalId", + }, + display: { + serializedName: "display", type: { - name: "String" + name: "Composite", + className: "OperationDisplay" } }, - clientId: { - readOnly: true, - serializedName: "clientId", + origin: { + serializedName: "origin", type: { name: "String" } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "OperationProperties" + } } } } }; -export const ManagedIdentity: msRest.CompositeMapper = { - serializedName: "ManagedIdentity", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedIdentity", + className: "OperationDisplay", modelProperties: { - type: { - serializedName: "type", + provider: { + serializedName: "provider", type: { name: "String" } }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + resource: { + serializedName: "resource", type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedIdentityProperty" - } - } + name: "String" } }, - principalId: { - readOnly: true, - serializedName: "principalId", + operation: { + serializedName: "operation", type: { name: "String" } }, - tenantId: { - readOnly: true, - serializedName: "tenantId", + description: { + serializedName: "description", type: { name: "String" } @@ -134,24 +109,56 @@ export const ManagedIdentity: msRest.CompositeMapper = { } }; -export const ManagedIdentitySettings: msRest.CompositeMapper = { - serializedName: "ManagedIdentitySettings", +export const OperationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedIdentitySettings", + className: "OperationProperties", modelProperties: { - resource: { - serializedName: "resource", + serviceSpecification: { + serializedName: "serviceSpecification", type: { - name: "String" + name: "Composite", + className: "ServiceSpecification" + } + } + } + } +}; + +export const ServiceSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification" + } + } + } + }, + logSpecifications: { + serializedName: "logSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogSpecification" + } + } } } } } }; -export const MetricSpecification: msRest.CompositeMapper = { - serializedName: "MetricSpecification", +export const MetricSpecification: coreClient.CompositeMapper = { type: { name: "Composite", className: "MetricSpecification", @@ -214,50 +221,52 @@ export const MetricSpecification: msRest.CompositeMapper = { } }; -export const NameAvailability: msRest.CompositeMapper = { - serializedName: "NameAvailability", +export const Dimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NameAvailability", + className: "Dimension", modelProperties: { - nameAvailable: { - serializedName: "nameAvailable", + name: { + serializedName: "name", type: { - name: "Boolean" + name: "String" } }, - reason: { - serializedName: "reason", + displayName: { + serializedName: "displayName", type: { name: "String" } }, - message: { - serializedName: "message", + internalName: { + serializedName: "internalName", type: { name: "String" } + }, + toBeExportedForShoebox: { + serializedName: "toBeExportedForShoebox", + type: { + name: "Boolean" + } } } } }; -export const NameAvailabilityParameters: msRest.CompositeMapper = { - serializedName: "NameAvailabilityParameters", +export const LogSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NameAvailabilityParameters", + className: "LogSpecification", modelProperties: { - type: { - required: true, - serializedName: "type", + name: { + serializedName: "name", type: { name: "String" } }, - name: { - required: true, - serializedName: "name", + displayName: { + serializedName: "displayName", type: { name: "String" } @@ -266,98 +275,70 @@ export const NameAvailabilityParameters: msRest.CompositeMapper = { } }; -export const NetworkACL: msRest.CompositeMapper = { - serializedName: "NetworkACL", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkACL", + className: "ErrorResponse", modelProperties: { - allow: { - serializedName: "allow", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - deny: { - serializedName: "deny", + error: { + serializedName: "error", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "ErrorDetail" } } } } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "OperationDisplay", +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "ErrorDetail", modelProperties: { - provider: { - serializedName: "provider", + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } }, - resource: { - serializedName: "resource", + message: { + serializedName: "message", + readOnly: true, type: { name: "String" } }, - operation: { - serializedName: "operation", + target: { + serializedName: "target", + readOnly: true, type: { name: "String" } }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const ServiceSpecification: msRest.CompositeMapper = { - serializedName: "ServiceSpecification", - type: { - name: "Composite", - className: "ServiceSpecification", - modelProperties: { - metricSpecifications: { - serializedName: "metricSpecifications", + details: { + serializedName: "details", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "MetricSpecification" + className: "ErrorDetail" } } } }, - logSpecifications: { - serializedName: "logSpecifications", + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "LogSpecification" + className: "ErrorAdditionalInfo" } } } @@ -366,101 +347,238 @@ export const ServiceSpecification: msRest.CompositeMapper = { } }; -export const OperationProperties: msRest.CompositeMapper = { - serializedName: "OperationProperties", +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationProperties", + className: "ErrorAdditionalInfo", modelProperties: { - serviceSpecification: { - serializedName: "serviceSpecification", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Composite", - className: "ServiceSpecification" + name: "String" } - } - } - } -}; + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const NameAvailabilityParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "NameAvailabilityParameters", modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, name: { serializedName: "name", + required: true, type: { name: "String" } - }, - isDataAction: { - serializedName: "isDataAction", + } + } + } +}; + +export const NameAvailability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NameAvailability", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", type: { name: "Boolean" } }, - display: { - serializedName: "display", + reason: { + serializedName: "reason", type: { - name: "Composite", - className: "OperationDisplay" + name: "String" } }, - origin: { - serializedName: "origin", + message: { + serializedName: "message", type: { name: "String" } + } + } + } +}; + +export const SignalRUsageList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SignalRUsageList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignalRUsage" + } + } + } }, - properties: { - serializedName: "properties", + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "OperationProperties" + name: "String" } } } } }; -export const PrivateEndpoint: msRest.CompositeMapper = { - serializedName: "PrivateEndpoint", +export const SignalRUsage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpoint", + className: "SignalRUsage", modelProperties: { id: { serializedName: "id", type: { name: "String" } + }, + currentValue: { + serializedName: "currentValue", + type: { + name: "Number" + } + }, + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "SignalRUsageName" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } } } } }; -export const PrivateEndpointACL: msRest.CompositeMapper = { - serializedName: "PrivateEndpointACL", +export const SignalRUsageName: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointACL", + className: "SignalRUsageName", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const SignalRResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SignalRResourceList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignalRResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceSku", modelProperties: { - ...NetworkACL.type.modelProperties, name: { - required: true, serializedName: "name", + required: true, + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + size: { + serializedName: "size", + readOnly: true, + type: { + name: "String" + } + }, + family: { + serializedName: "family", + readOnly: true, type: { name: "String" } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } } } } }; -export const SystemData: msRest.CompositeMapper = { - serializedName: "systemData", +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", className: "SystemData", @@ -505,8 +623,22 @@ export const SystemData: msRest.CompositeMapper = { } }; -export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { - serializedName: "PrivateLinkServiceConnectionState", +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", className: "PrivateLinkServiceConnectionState", @@ -533,29 +665,28 @@ export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", className: "Resource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } @@ -564,90 +695,81 @@ export const Resource: msRest.CompositeMapper = { } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", +export const SignalRTlsSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "SignalRTlsSettings", modelProperties: { - ...Resource.type.modelProperties + clientCertEnabled: { + defaultValue: true, + serializedName: "clientCertEnabled", + type: { + name: "Boolean" + } + } } } }; -export const PrivateEndpointConnection: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnection", +export const SignalRFeature: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnection", + className: "SignalRFeature", modelProperties: { - ...ProxyResource.type.modelProperties, - systemData: { - readOnly: true, - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + flag: { + serializedName: "flag", + required: true, type: { name: "String" } }, - privateEndpoint: { - serializedName: "properties.privateEndpoint", + value: { + constraints: { + MaxLength: 128, + MinLength: 1 + }, + serializedName: "value", + required: true, type: { - name: "Composite", - className: "PrivateEndpoint" + name: "String" } }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", + properties: { + serializedName: "properties", type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ShareablePrivateLinkResourceProperties: msRest.CompositeMapper = { - serializedName: "ShareablePrivateLinkResourceProperties", +export const ResourceLogConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ShareablePrivateLinkResourceProperties", + className: "ResourceLogConfiguration", modelProperties: { - description: { - serializedName: "description", + categories: { + serializedName: "categories", type: { - name: "String" - } - }, - groupId: { - serializedName: "groupId", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceLogCategory" + } + } } } } } }; -export const ShareablePrivateLinkResourceType: msRest.CompositeMapper = { - serializedName: "ShareablePrivateLinkResourceType", +export const ResourceLogCategory: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ShareablePrivateLinkResourceType", + className: "ResourceLogCategory", modelProperties: { name: { serializedName: "name", @@ -655,43 +777,23 @@ export const ShareablePrivateLinkResourceType: msRest.CompositeMapper = { name: "String" } }, - properties: { - serializedName: "properties", + enabled: { + serializedName: "enabled", type: { - name: "Composite", - className: "ShareablePrivateLinkResourceProperties" + name: "String" } } } } }; -export const PrivateLinkResource: msRest.CompositeMapper = { - serializedName: "PrivateLinkResource", +export const SignalRCorsSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkResource", + className: "SignalRCorsSettings", modelProperties: { - ...ProxyResource.type.modelProperties, - groupId: { - serializedName: "properties.groupId", - type: { - name: "String" - } - }, - requiredMembers: { - serializedName: "properties.requiredMembers", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - requiredZoneNames: { - serializedName: "properties.requiredZoneNames", + allowedOrigins: { + serializedName: "allowedOrigins", type: { name: "Sequence", element: { @@ -700,84 +802,74 @@ export const PrivateLinkResource: msRest.CompositeMapper = { } } } - }, - shareablePrivateLinkResourceTypes: { - serializedName: "properties.shareablePrivateLinkResourceTypes", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ShareablePrivateLinkResourceType" - } - } - } } } } }; -export const RegenerateKeyParameters: msRest.CompositeMapper = { - serializedName: "RegenerateKeyParameters", +export const ServerlessUpstreamSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RegenerateKeyParameters", + className: "ServerlessUpstreamSettings", modelProperties: { - keyType: { - serializedName: "keyType", + templates: { + serializedName: "templates", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UpstreamTemplate" + } + } } } } } }; -export const ResourceSku: msRest.CompositeMapper = { - serializedName: "ResourceSku", +export const UpstreamTemplate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSku", + className: "UpstreamTemplate", modelProperties: { - name: { - required: true, - serializedName: "name", + hubPattern: { + serializedName: "hubPattern", type: { name: "String" } }, - tier: { - serializedName: "tier", + eventPattern: { + serializedName: "eventPattern", type: { name: "String" } }, - size: { - readOnly: true, - serializedName: "size", + categoryPattern: { + serializedName: "categoryPattern", type: { name: "String" } }, - family: { - readOnly: true, - serializedName: "family", + urlTemplate: { + serializedName: "urlTemplate", + required: true, type: { name: "String" } }, - capacity: { - serializedName: "capacity", + auth: { + serializedName: "auth", type: { - name: "Number" + name: "Composite", + className: "UpstreamAuthSettings" } } } } }; -export const UpstreamAuthSettings: msRest.CompositeMapper = { - serializedName: "UpstreamAuthSettings", +export const UpstreamAuthSettings: coreClient.CompositeMapper = { type: { name: "Composite", className: "UpstreamAuthSettings", @@ -799,62 +891,78 @@ export const UpstreamAuthSettings: msRest.CompositeMapper = { } }; -export const UpstreamTemplate: msRest.CompositeMapper = { - serializedName: "UpstreamTemplate", +export const ManagedIdentitySettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UpstreamTemplate", + className: "ManagedIdentitySettings", modelProperties: { - hubPattern: { - serializedName: "hubPattern", - type: { - name: "String" - } - }, - eventPattern: { - serializedName: "eventPattern", + resource: { + serializedName: "resource", type: { name: "String" } - }, - categoryPattern: { - serializedName: "categoryPattern", + } + } + } +}; + +export const SignalRNetworkACLs: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SignalRNetworkACLs", + modelProperties: { + defaultAction: { + serializedName: "defaultAction", type: { name: "String" } }, - urlTemplate: { - required: true, - serializedName: "urlTemplate", + publicNetwork: { + serializedName: "publicNetwork", type: { - name: "String" + name: "Composite", + className: "NetworkACL" } }, - auth: { - serializedName: "auth", + privateEndpoints: { + serializedName: "privateEndpoints", type: { - name: "Composite", - className: "UpstreamAuthSettings" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointACL" + } + } } } } } }; -export const ServerlessUpstreamSettings: msRest.CompositeMapper = { - serializedName: "ServerlessUpstreamSettings", +export const NetworkACL: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerlessUpstreamSettings", + className: "NetworkACL", modelProperties: { - templates: { - serializedName: "templates", + allow: { + serializedName: "allow", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "UpstreamTemplate" + name: "String" + } + } + } + }, + deny: { + serializedName: "deny", + type: { + name: "Sequence", + element: { + type: { + name: "String" } } } @@ -863,51 +971,39 @@ export const ServerlessUpstreamSettings: msRest.CompositeMapper = { } }; -export const SharedPrivateLinkResource: msRest.CompositeMapper = { - serializedName: "SharedPrivateLinkResource", +export const ManagedIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SharedPrivateLinkResource", + className: "ManagedIdentity", modelProperties: { - ...ProxyResource.type.modelProperties, - systemData: { - readOnly: true, - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, - groupId: { - required: true, - serializedName: "properties.groupId", + type: { + serializedName: "type", type: { name: "String" } }, - privateLinkResourceId: { - required: true, - serializedName: "properties.privateLinkResourceId", + userAssignedIdentities: { + serializedName: "userAssignedIdentities", type: { - name: "String" + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedIdentityProperty" + } + } } }, - provisioningState: { + principalId: { + serializedName: "principalId", readOnly: true, - serializedName: "properties.provisioningState", - type: { - name: "String" - } - }, - requestMessage: { - serializedName: "properties.requestMessage", type: { name: "String" } }, - status: { + tenantId: { + serializedName: "tenantId", readOnly: true, - serializedName: "properties.status", type: { name: "String" } @@ -916,68 +1012,30 @@ export const SharedPrivateLinkResource: msRest.CompositeMapper = { } }; -export const SignalRCorsSettings: msRest.CompositeMapper = { - serializedName: "SignalRCorsSettings", - type: { - name: "Composite", - className: "SignalRCorsSettings", - modelProperties: { - allowedOrigins: { - serializedName: "allowedOrigins", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const SignalRFeature: msRest.CompositeMapper = { - serializedName: "SignalRFeature", +export const UserAssignedIdentityProperty: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SignalRFeature", + className: "UserAssignedIdentityProperty", modelProperties: { - flag: { - required: true, - serializedName: "flag", + principalId: { + serializedName: "principalId", + readOnly: true, type: { name: "String" } }, - value: { - required: true, - serializedName: "value", - constraints: { - MaxLength: 128, - MinLength: 1 - }, + clientId: { + serializedName: "clientId", + readOnly: true, type: { name: "String" } - }, - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const SignalRKeys: msRest.CompositeMapper = { - serializedName: "SignalRKeys", +export const SignalRKeys: coreClient.CompositeMapper = { type: { name: "Composite", className: "SignalRKeys", @@ -1010,157 +1068,131 @@ export const SignalRKeys: msRest.CompositeMapper = { } }; -export const SignalRNetworkACLs: msRest.CompositeMapper = { - serializedName: "SignalRNetworkACLs", +export const PrivateEndpointConnectionList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SignalRNetworkACLs", + className: "PrivateEndpointConnectionList", modelProperties: { - defaultAction: { - serializedName: "defaultAction", - type: { - name: "String" - } - }, - publicNetwork: { - serializedName: "publicNetwork", - type: { - name: "Composite", - className: "NetworkACL" - } - }, - privateEndpoints: { - serializedName: "privateEndpoints", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrivateEndpointACL" + className: "PrivateEndpointConnection" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } }; -export const SignalRTlsSettings: msRest.CompositeMapper = { - serializedName: "SignalRTlsSettings", +export const PrivateLinkResourceList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SignalRTlsSettings", + className: "PrivateLinkResourceList", modelProperties: { - clientCertEnabled: { - serializedName: "clientCertEnabled", + value: { + serializedName: "value", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" } } } } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ShareablePrivateLinkResourceType: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "ShareablePrivateLinkResourceType", modelProperties: { - ...Resource.type.modelProperties, - location: { - serializedName: "location", + name: { + serializedName: "name", type: { name: "String" } }, - tags: { - serializedName: "tags", + properties: { + serializedName: "properties", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "ShareablePrivateLinkResourceProperties" } } } } }; -export const SignalRResource: msRest.CompositeMapper = { - serializedName: "SignalRResource", +export const ShareablePrivateLinkResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SignalRResource", + className: "ShareablePrivateLinkResourceProperties", modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "ResourceSku" - } - }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + description: { + serializedName: "description", type: { name: "String" } }, - externalIP: { - readOnly: true, - serializedName: "properties.externalIP", + groupId: { + serializedName: "groupId", type: { name: "String" } }, - hostName: { - readOnly: true, - serializedName: "properties.hostName", + type: { + serializedName: "type", type: { name: "String" } - }, - publicPort: { - readOnly: true, - serializedName: "properties.publicPort", - type: { - name: "Number" - } - }, - serverPort: { - readOnly: true, - serializedName: "properties.serverPort", - type: { - name: "Number" - } - }, - version: { - readOnly: true, - serializedName: "properties.version", + } + } + } +}; + +export const RegenerateKeyParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegenerateKeyParameters", + modelProperties: { + keyType: { + serializedName: "keyType", type: { name: "String" } - }, - privateEndpointConnections: { - readOnly: true, - serializedName: "properties.privateEndpointConnections", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } - } - }, - sharedPrivateLinkResources: { - readOnly: true, - serializedName: "properties.sharedPrivateLinkResources", + } + } + } +}; + +export const SharedPrivateLinkResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SharedPrivateLinkResourceList", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { @@ -1171,126 +1203,116 @@ export const SignalRResource: msRest.CompositeMapper = { } } }, - tls: { - serializedName: "properties.tls", + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "SignalRTlsSettings" + name: "String" } - }, - features: { - serializedName: "properties.features", + } + } + } +}; + +export const SkuList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "SignalRFeature" + className: "Sku" } } } }, - cors: { - serializedName: "properties.cors", - type: { - name: "Composite", - className: "SignalRCorsSettings" - } - }, - upstream: { - serializedName: "properties.upstream", - type: { - name: "Composite", - className: "ServerlessUpstreamSettings" - } - }, - networkACLs: { - serializedName: "properties.networkACLs", - type: { - name: "Composite", - className: "SignalRNetworkACLs" - } - }, - kind: { - serializedName: "kind", - type: { - name: "String" - } - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ManagedIdentity" - } - }, - systemData: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "systemData", type: { - name: "Composite", - className: "SystemData" + name: "String" } } } } }; -export const SignalRUsageName: msRest.CompositeMapper = { - serializedName: "SignalRUsageName", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SignalRUsageName", + className: "Sku", modelProperties: { - value: { - serializedName: "value", + resourceType: { + serializedName: "resourceType", + readOnly: true, type: { name: "String" } }, - localizedValue: { - serializedName: "localizedValue", + sku: { + serializedName: "sku", type: { - name: "String" + name: "Composite", + className: "ResourceSku" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Composite", + className: "SkuCapacity" } } } } }; -export const SignalRUsage: msRest.CompositeMapper = { - serializedName: "SignalRUsage", +export const SkuCapacity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SignalRUsage", + className: "SkuCapacity", modelProperties: { - id: { - serializedName: "id", + minimum: { + serializedName: "minimum", + readOnly: true, type: { - name: "String" + name: "Number" } }, - currentValue: { - serializedName: "currentValue", + maximum: { + serializedName: "maximum", + readOnly: true, type: { name: "Number" } }, - limit: { - serializedName: "limit", + default: { + serializedName: "default", + readOnly: true, type: { name: "Number" } }, - name: { - serializedName: "name", + allowedValues: { + serializedName: "allowedValues", + readOnly: true, type: { - name: "Composite", - className: "SignalRUsageName" + name: "Sequence", + element: { + type: { + name: "Number" + } + } } }, - unit: { - serializedName: "unit", + scaleType: { + serializedName: "scaleType", + readOnly: true, type: { name: "String" } @@ -1299,124 +1321,147 @@ export const SignalRUsage: msRest.CompositeMapper = { } }; -export const ErrorAdditionalInfo: msRest.CompositeMapper = { - serializedName: "ErrorAdditionalInfo", +export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "ProxyResource", modelProperties: { - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } + ...Resource.type.modelProperties + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String" + } }, - info: { - readOnly: true, - serializedName: "info", + tags: { + serializedName: "tags", type: { - name: "Object" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ErrorDetail: msRest.CompositeMapper = { - serializedName: "ErrorDetail", +export const PrivateEndpointACL: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetail", + className: "PrivateEndpointACL", modelProperties: { - code: { - readOnly: true, - serializedName: "code", + ...NetworkACL.type.modelProperties, + name: { + serializedName: "name", + required: true, type: { name: "String" } + } + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } }, - message: { + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, - serializedName: "message", type: { name: "String" } }, - target: { - readOnly: true, - serializedName: "target", + privateEndpoint: { + serializedName: "properties.privateEndpoint", type: { - name: "String" + name: "Composite", + className: "PrivateEndpoint" } }, - details: { + groupIds: { + serializedName: "properties.groupIds", readOnly: true, - serializedName: "details", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "ErrorDetail" + name: "String" } } } }, - additionalInfo: { - readOnly: true, - serializedName: "additionalInfo", + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } + name: "Composite", + className: "PrivateLinkServiceConnectionState" } } } } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const SharedPrivateLinkResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "SharedPrivateLinkResource", modelProperties: { - error: { - serializedName: "error", + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "ErrorDetail" + className: "SystemData" } - } - } - } -}; - -export const OperationList: msRest.CompositeMapper = { - serializedName: "OperationList", - type: { - name: "Composite", - className: "OperationList", - modelProperties: { - value: { - serializedName: "", + }, + groupId: { + serializedName: "properties.groupId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + privateLinkResourceId: { + serializedName: "properties.privateLinkResourceId", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + requestMessage: { + serializedName: "properties.requestMessage", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, type: { name: "String" } @@ -1425,70 +1470,134 @@ export const OperationList: msRest.CompositeMapper = { } }; -export const SignalRResourceList: msRest.CompositeMapper = { - serializedName: "SignalRResourceList", +export const PrivateLinkResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SignalRResourceList", + className: "PrivateLinkResource", modelProperties: { - value: { - serializedName: "", + ...ProxyResource.type.modelProperties, + groupId: { + serializedName: "properties.groupId", + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "SignalRResource" + name: "String" } } } }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const SignalRUsageList: msRest.CompositeMapper = { - serializedName: "SignalRUsageList", - type: { - name: "Composite", - className: "SignalRUsageList", - modelProperties: { - value: { - serializedName: "", + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "SignalRUsage" + name: "String" } } } }, - nextLink: { - serializedName: "nextLink", + shareablePrivateLinkResourceTypes: { + serializedName: "properties.shareablePrivateLinkResourceTypes", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ShareablePrivateLinkResourceType" + } + } } } } } }; -export const PrivateEndpointConnectionList: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnectionList", +export const SignalRResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnectionList", + className: "SignalRResource", modelProperties: { - value: { - serializedName: "", + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ResourceSku" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + externalIP: { + serializedName: "properties.externalIP", + readOnly: true, + type: { + name: "String" + } + }, + hostName: { + serializedName: "properties.hostName", + readOnly: true, + type: { + name: "String" + } + }, + publicPort: { + serializedName: "properties.publicPort", + readOnly: true, + type: { + name: "Number" + } + }, + serverPort: { + serializedName: "properties.serverPort", + readOnly: true, + type: { + name: "Number" + } + }, + version: { + serializedName: "properties.version", + readOnly: true, + type: { + name: "String" + } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, type: { name: "Sequence", element: { @@ -1499,67 +1608,93 @@ export const PrivateEndpointConnectionList: msRest.CompositeMapper = { } } }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const PrivateLinkResourceList: msRest.CompositeMapper = { - serializedName: "PrivateLinkResourceList", - type: { - name: "Composite", - className: "PrivateLinkResourceList", - modelProperties: { - value: { - serializedName: "", + sharedPrivateLinkResources: { + serializedName: "properties.sharedPrivateLinkResources", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrivateLinkResource" + className: "SharedPrivateLinkResource" } } } }, - nextLink: { - serializedName: "nextLink", + tls: { + serializedName: "properties.tls", + type: { + name: "Composite", + className: "SignalRTlsSettings" + } + }, + hostNamePrefix: { + serializedName: "properties.hostNamePrefix", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const SharedPrivateLinkResourceList: msRest.CompositeMapper = { - serializedName: "SharedPrivateLinkResourceList", - type: { - name: "Composite", - className: "SharedPrivateLinkResourceList", - modelProperties: { - value: { - serializedName: "", + }, + features: { + serializedName: "properties.features", type: { name: "Sequence", element: { type: { name: "Composite", - className: "SharedPrivateLinkResource" + className: "SignalRFeature" } } } }, - nextLink: { - serializedName: "nextLink", + resourceLogConfiguration: { + serializedName: "properties.resourceLogConfiguration", + type: { + name: "Composite", + className: "ResourceLogConfiguration" + } + }, + cors: { + serializedName: "properties.cors", + type: { + name: "Composite", + className: "SignalRCorsSettings" + } + }, + upstream: { + serializedName: "properties.upstream", + type: { + name: "Composite", + className: "ServerlessUpstreamSettings" + } + }, + networkACLs: { + serializedName: "properties.networkACLs", + type: { + name: "Composite", + className: "SignalRNetworkACLs" + } + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccess", type: { name: "String" } + }, + disableLocalAuth: { + defaultValue: false, + serializedName: "properties.disableLocalAuth", + type: { + name: "Boolean" + } + }, + disableAadAuth: { + defaultValue: false, + serializedName: "properties.disableAadAuth", + type: { + name: "Boolean" + } } } } diff --git a/sdk/signalr/arm-signalr/src/models/operationsMappers.ts b/sdk/signalr/arm-signalr/src/models/operationsMappers.ts deleted file mode 100644 index f63b68699e14..000000000000 --- a/sdk/signalr/arm-signalr/src/models/operationsMappers.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Dimension, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - LogSpecification, - MetricSpecification, - Operation, - OperationDisplay, - OperationList, - OperationProperties, - ServiceSpecification -} from "../models/mappers"; diff --git a/sdk/signalr/arm-signalr/src/models/parameters.ts b/sdk/signalr/arm-signalr/src/models/parameters.ts index b0b05cf9b7ab..6d3061530c6e 100644 --- a/sdk/signalr/arm-signalr/src/models/parameters.ts +++ b/sdk/signalr/arm-signalr/src/models/parameters.ts @@ -3,100 +3,169 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + NameAvailabilityParameters as NameAvailabilityParametersMapper, + SignalRResource as SignalRResourceMapper, + RegenerateKeyParameters as RegenerateKeyParametersMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + SharedPrivateLinkResource as SharedPrivateLinkResourceMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: "en-US", + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-10-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const location: msRest.OperationURLParameter = { - parameterPath: "location", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "location", + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: NameAvailabilityParametersMapper +}; + +export const location: OperationURLParameter = { + parameterPath: "location", mapper: { + serializedName: "location", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const privateEndpointConnectionName: msRest.OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "privateEndpointConnectionName", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { + +export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { - required: true, serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const resourceName: msRest.OperationURLParameter = { + +export const resourceName: OperationURLParameter = { parameterPath: "resourceName", mapper: { - required: true, serializedName: "resourceName", + required: true, type: { name: "String" } } }; -export const sharedPrivateLinkResourceName: msRest.OperationURLParameter = { - parameterPath: "sharedPrivateLinkResourceName", + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: SignalRResourceMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: RegenerateKeyParametersMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", mapper: { + serializedName: "privateEndpointConnectionName", required: true, - serializedName: "sharedPrivateLinkResourceName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: PrivateEndpointConnectionMapper +}; + +export const sharedPrivateLinkResourceName: OperationURLParameter = { + parameterPath: "sharedPrivateLinkResourceName", mapper: { + serializedName: "sharedPrivateLinkResourceName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: SharedPrivateLinkResourceMapper +}; diff --git a/sdk/signalr/arm-signalr/src/models/signalRMappers.ts b/sdk/signalr/arm-signalr/src/models/signalRMappers.ts deleted file mode 100644 index 7e65f46d8d64..000000000000 --- a/sdk/signalr/arm-signalr/src/models/signalRMappers.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - ManagedIdentity, - ManagedIdentitySettings, - NameAvailability, - NameAvailabilityParameters, - NetworkACL, - PrivateEndpoint, - PrivateEndpointACL, - PrivateEndpointConnection, - PrivateLinkResource, - PrivateLinkServiceConnectionState, - ProxyResource, - RegenerateKeyParameters, - Resource, - ResourceSku, - ServerlessUpstreamSettings, - ShareablePrivateLinkResourceProperties, - ShareablePrivateLinkResourceType, - SharedPrivateLinkResource, - SignalRCorsSettings, - SignalRFeature, - SignalRKeys, - SignalRNetworkACLs, - SignalRResource, - SignalRResourceList, - SignalRTlsSettings, - SystemData, - TrackedResource, - UpstreamAuthSettings, - UpstreamTemplate, - UserAssignedIdentityProperty -} from "../models/mappers"; diff --git a/sdk/signalr/arm-signalr/src/models/signalRPrivateEndpointConnectionsMappers.ts b/sdk/signalr/arm-signalr/src/models/signalRPrivateEndpointConnectionsMappers.ts deleted file mode 100644 index 1e5d3f1d968b..000000000000 --- a/sdk/signalr/arm-signalr/src/models/signalRPrivateEndpointConnectionsMappers.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - ManagedIdentity, - ManagedIdentitySettings, - NetworkACL, - PrivateEndpoint, - PrivateEndpointACL, - PrivateEndpointConnection, - PrivateEndpointConnectionList, - PrivateLinkResource, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - ResourceSku, - ServerlessUpstreamSettings, - ShareablePrivateLinkResourceProperties, - ShareablePrivateLinkResourceType, - SharedPrivateLinkResource, - SignalRCorsSettings, - SignalRFeature, - SignalRNetworkACLs, - SignalRResource, - SignalRTlsSettings, - SystemData, - TrackedResource, - UpstreamAuthSettings, - UpstreamTemplate, - UserAssignedIdentityProperty -} from "../models/mappers"; diff --git a/sdk/signalr/arm-signalr/src/models/signalRPrivateLinkResourcesMappers.ts b/sdk/signalr/arm-signalr/src/models/signalRPrivateLinkResourcesMappers.ts deleted file mode 100644 index b8d807dabdd5..000000000000 --- a/sdk/signalr/arm-signalr/src/models/signalRPrivateLinkResourcesMappers.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - ManagedIdentity, - ManagedIdentitySettings, - NetworkACL, - PrivateEndpoint, - PrivateEndpointACL, - PrivateEndpointConnection, - PrivateLinkResource, - PrivateLinkResourceList, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - ResourceSku, - ServerlessUpstreamSettings, - ShareablePrivateLinkResourceProperties, - ShareablePrivateLinkResourceType, - SharedPrivateLinkResource, - SignalRCorsSettings, - SignalRFeature, - SignalRNetworkACLs, - SignalRResource, - SignalRTlsSettings, - SystemData, - TrackedResource, - UpstreamAuthSettings, - UpstreamTemplate, - UserAssignedIdentityProperty -} from "../models/mappers"; diff --git a/sdk/signalr/arm-signalr/src/models/signalRSharedPrivateLinkResourcesMappers.ts b/sdk/signalr/arm-signalr/src/models/signalRSharedPrivateLinkResourcesMappers.ts deleted file mode 100644 index ee95de56fb01..000000000000 --- a/sdk/signalr/arm-signalr/src/models/signalRSharedPrivateLinkResourcesMappers.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - ManagedIdentity, - ManagedIdentitySettings, - NetworkACL, - PrivateEndpoint, - PrivateEndpointACL, - PrivateEndpointConnection, - PrivateLinkResource, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - ResourceSku, - ServerlessUpstreamSettings, - ShareablePrivateLinkResourceProperties, - ShareablePrivateLinkResourceType, - SharedPrivateLinkResource, - SharedPrivateLinkResourceList, - SignalRCorsSettings, - SignalRFeature, - SignalRNetworkACLs, - SignalRResource, - SignalRTlsSettings, - SystemData, - TrackedResource, - UpstreamAuthSettings, - UpstreamTemplate, - UserAssignedIdentityProperty -} from "../models/mappers"; diff --git a/sdk/signalr/arm-signalr/src/operations/index.ts b/sdk/signalr/arm-signalr/src/operations/index.ts index 198aaea7e274..1a3c5a69526b 100644 --- a/sdk/signalr/arm-signalr/src/operations/index.ts +++ b/sdk/signalr/arm-signalr/src/operations/index.ts @@ -3,8 +3,7 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/signalr/arm-signalr/src/operations/operations.ts b/sdk/signalr/arm-signalr/src/operations/operations.ts index 272f271b864b..d63ccd83fb12 100644 --- a/sdk/signalr/arm-signalr/src/operations/operations.ts +++ b/sdk/signalr/arm-signalr/src/operations/operations.ts @@ -3,107 +3,109 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SignalRManagementClientContext } from "../signalRManagementClientContext"; +import { SignalRManagementClient } from "../signalRManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: SignalRManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: SignalRManagementClient; /** - * Create a Operations. - * @param {SignalRManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: SignalRManagementClientContext) { + constructor(client: SignalRManagementClient) { this.client = client; } /** * Lists all of the available REST API operations of the Microsoft.SignalRService provider. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists all of the available REST API operations of the Microsoft.SignalRService provider. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.SignalRService/operations", httpMethod: "GET", - path: "providers/Microsoft.SignalRService/operations", - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.OperationList @@ -112,16 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationList @@ -130,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/signalr/arm-signalr/src/operations/signalR.ts b/sdk/signalr/arm-signalr/src/operations/signalR.ts index eca4f66c7fc6..60791936b72b 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalR.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalR.ts @@ -3,610 +3,737 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/signalRMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SignalR } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SignalRManagementClientContext } from "../signalRManagementClientContext"; +import { SignalRManagementClient } from "../signalRManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SignalRResource, + SignalRListBySubscriptionNextOptionalParams, + SignalRListBySubscriptionOptionalParams, + SignalRListByResourceGroupNextOptionalParams, + SignalRListByResourceGroupOptionalParams, + NameAvailabilityParameters, + SignalRCheckNameAvailabilityOptionalParams, + SignalRCheckNameAvailabilityResponse, + SignalRListBySubscriptionResponse, + SignalRListByResourceGroupResponse, + SignalRGetOptionalParams, + SignalRGetResponse, + SignalRCreateOrUpdateOptionalParams, + SignalRCreateOrUpdateResponse, + SignalRDeleteOptionalParams, + SignalRUpdateOptionalParams, + SignalRUpdateResponse, + SignalRListKeysOptionalParams, + SignalRListKeysResponse, + RegenerateKeyParameters, + SignalRRegenerateKeyOptionalParams, + SignalRRegenerateKeyResponse, + SignalRRestartOptionalParams, + SignalRListSkusOptionalParams, + SignalRListSkusResponse, + SignalRListBySubscriptionNextResponse, + SignalRListByResourceGroupNextResponse +} from "../models"; -/** Class representing a SignalR. */ -export class SignalR { - private readonly client: SignalRManagementClientContext; +/// +/** Class containing SignalR operations. */ +export class SignalRImpl implements SignalR { + private readonly client: SignalRManagementClient; /** - * Create a SignalR. - * @param {SignalRManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class SignalR class. + * @param client Reference to the service client */ - constructor(client: SignalRManagementClientContext) { + constructor(client: SignalRManagementClient) { this.client = client; } /** - * Checks that the resource name is valid and is not already in use. - * @param location the region - * @param parameters Parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * Handles requests to list all resources in a subscription. + * @param options The options parameters. */ - checkNameAvailability( - location: string, - parameters: Models.NameAvailabilityParameters, - options?: msRest.RequestOptionsBase - ): Promise; + public listBySubscription( + options?: SignalRListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: SignalRListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: SignalRListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + /** - * @param location the region - * @param parameters Parameters supplied to the operation. - * @param callback The callback + * Handles requests to list all resources in a resource group. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param options The options parameters. */ - checkNameAvailability( - location: string, - parameters: Models.NameAvailabilityParameters, - callback: msRest.ServiceCallback - ): void; + public listByResourceGroup( + resourceGroupName: string, + options?: SignalRListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: SignalRListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: SignalRListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** + * Checks that the resource name is valid and is not already in use. * @param location the region * @param parameters Parameters supplied to the operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ checkNameAvailability( location: string, - parameters: Models.NameAvailabilityParameters, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkNameAvailability( - location: string, - parameters: Models.NameAvailabilityParameters, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + parameters: NameAvailabilityParameters, + options?: SignalRCheckNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - location, - parameters, - options - }, - checkNameAvailabilityOperationSpec, - callback - ) as Promise; + { location, parameters, options }, + checkNameAvailabilityOperationSpec + ); } /** * Handles requests to list all resources in a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription( - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listBySubscription( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listBySubscription( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listBySubscription( + options?: SignalRListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback - ) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } /** * Handles requests to list all resources in a resource group. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup( - resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param callback The callback - */ - listByResourceGroup( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param options The optional parameters - * @param callback The callback + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param options The options parameters. */ - listByResourceGroup( + private _listByResourceGroup( resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroup( - resourceGroupName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: SignalRListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback - ) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Get the resource and its properties. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ get( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param callback The callback - */ - get( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; + options?: SignalRGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Create or update a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param options The optional parameters - * @param callback The callback + * @param parameters Parameters for the create or update operation + * @param options The options parameters. */ - get( + async beginCreateOrUpdate( resourceGroupName: string, resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback - ) as Promise; + parameters: SignalRResource, + options?: SignalRCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SignalRCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Create or update a resource. - * @param parameters Parameters for the create or update operation - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters for the create or update operation + * @param options The options parameters. */ - createOrUpdate( - parameters: Models.SignalRResource, + async beginCreateOrUpdateAndWait( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdate( - parameters, + parameters: SignalRResource, + options?: SignalRCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( resourceGroupName, resourceName, + parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.SignalRCreateOrUpdateResponse - >; + ); + return poller.pollUntilDone(); } /** * Operation to delete a resource. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod( + async beginDelete( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod(resourceGroupName, resourceName, options).then((lroPoller) => - lroPoller.pollUntilFinished() + options?: SignalRDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, options }, + deleteOperationSpec ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Operation to update an exiting resource. - * @param parameters Parameters for the update operation - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Operation to delete a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update( - parameters: Models.SignalRResource, + async beginDeleteAndWait( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginUpdate( - parameters, + options?: SignalRDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( resourceGroupName, resourceName, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise; + ); + return poller.pollUntilDone(); } /** - * Get the access keys of the resource. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - listKeys( - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param callback The callback - */ - listKeys( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Operation to update an exiting resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param options The optional parameters - * @param callback The callback + * @param parameters Parameters for the update operation + * @param options The options parameters. */ - listKeys( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listKeys( + async beginUpdate( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listKeysOperationSpec, - callback - ) as Promise; + parameters: SignalRResource, + options?: SignalRUpdateOptionalParams + ): Promise< + PollerLike, SignalRUpdateResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, parameters, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at - * the same time. - * @param parameters Parameter that describes the Regenerate Key Operation. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Operation to update an exiting resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters for the update operation + * @param options The options parameters. */ - regenerateKey( - parameters: Models.RegenerateKeyParameters, + async beginUpdateAndWait( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginRegenerateKey( - parameters, + parameters: SignalRResource, + options?: SignalRUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( resourceGroupName, resourceName, + parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.SignalRRegenerateKeyResponse - >; + ); + return poller.pollUntilDone(); } /** - * Operation to restart a resource. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Get the access keys of the resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - restart( + listKeys( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginRestart(resourceGroupName, resourceName, options).then((lroPoller) => - lroPoller.pollUntilFinished() + options?: SignalRListKeysOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listKeysOperationSpec ); } /** - * Create or update a resource. - * @param parameters Parameters for the create or update operation - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the + * same time. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param options The options parameters. */ - beginCreateOrUpdate( - parameters: Models.SignalRResource, + async beginRegenerateKey( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - parameters, - resourceGroupName, - resourceName, - options - }, - beginCreateOrUpdateOperationSpec, - options + parameters: RegenerateKeyParameters, + options?: SignalRRegenerateKeyOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SignalRRegenerateKeyResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, parameters, options }, + regenerateKeyOperationSpec ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Operation to delete a resource. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the + * same time. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param options The options parameters. */ - beginDeleteMethod( + async beginRegenerateKeyAndWait( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - options - }, - beginDeleteMethodOperationSpec, + parameters: RegenerateKeyParameters, + options?: SignalRRegenerateKeyOptionalParams + ): Promise { + const poller = await this.beginRegenerateKey( + resourceGroupName, + resourceName, + parameters, options ); + return poller.pollUntilDone(); } /** - * Operation to update an exiting resource. - * @param parameters Parameters for the update operation - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Operation to restart a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdate( - parameters: Models.SignalRResource, + async beginRestart( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - parameters, - resourceGroupName, - resourceName, - options - }, - beginUpdateOperationSpec, - options + options?: SignalRRestartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, options }, + restartOperationSpec ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at - * the same time. - * @param parameters Parameter that describes the Regenerate Key Operation. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * Operation to restart a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginRegenerateKey( - parameters: Models.RegenerateKeyParameters, + async beginRestartAndWait( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - parameters, - resourceGroupName, - resourceName, - options - }, - beginRegenerateKeyOperationSpec, + options?: SignalRRestartOptionalParams + ): Promise { + const poller = await this.beginRestart( + resourceGroupName, + resourceName, options ); + return poller.pollUntilDone(); } /** - * Operation to restart a resource. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * List all available skus of the resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginRestart( + listSkus( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - options - }, - beginRestartOperationSpec, - options + options?: SignalRListSkusOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listSkusOperationSpec ); } /** - * Handles requests to list all resources in a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listBySubscriptionNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listBySubscriptionNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listBySubscriptionNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: SignalRListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * Handles requests to list all resources in a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroupNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: SignalRListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability", - urlParameters: [Parameters.location, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.NameAvailabilityParameters, - required: true - } - }, + "/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.NameAvailability @@ -615,15 +742,21 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.location, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/signalR", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/signalR", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.SignalRResourceList @@ -632,16 +765,15 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SignalRResourceList @@ -650,16 +782,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SignalRResource @@ -668,41 +803,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/listKeys", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.SignalRKeys - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", +const createOrUpdateOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.SignalRResource, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.SignalRResource @@ -710,107 +824,187 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.SignalRResource }, - 202: {}, + 202: { + bodyMapper: Mappers.SignalRResource + }, + 204: { + bodyMapper: Mappers.SignalRResource + }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", +const deleteOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", +const updateOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.SignalRResource, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.SignalRResource }, - 202: {}, + 201: { + bodyMapper: Mappers.SignalRResource + }, + 202: { + bodyMapper: Mappers.SignalRResource + }, + 204: { + bodyMapper: Mappers.SignalRResource + }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginRegenerateKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const listKeysOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/regenerateKey", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateKeyParameters, - required: true + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/listKeys", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SignalRKeys + }, + default: { + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/regenerateKey", + httpMethod: "POST", responses: { + 200: { + bodyMapper: Mappers.SignalRKeys + }, + 201: { + bodyMapper: Mappers.SignalRKeys + }, 202: { bodyMapper: Mappers.SignalRKeys }, + 204: { + bodyMapper: Mappers.SignalRKeys + }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginRestartOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const restartOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/restart", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/restart", + httpMethod: "POST", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { +const listSkusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/skus", httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], + responses: { + 200: { + bodyMapper: Mappers.SkuList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SignalRResourceList @@ -819,16 +1013,18 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SignalRResourceList @@ -837,5 +1033,13 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts b/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts index e8c26ec6804a..112cf80a82ff 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts @@ -3,135 +3,136 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/signalRPrivateEndpointConnectionsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SignalRPrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SignalRManagementClientContext } from "../signalRManagementClientContext"; +import { SignalRManagementClient } from "../signalRManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + SignalRPrivateEndpointConnectionsListNextOptionalParams, + SignalRPrivateEndpointConnectionsListOptionalParams, + SignalRPrivateEndpointConnectionsListResponse, + SignalRPrivateEndpointConnectionsGetOptionalParams, + SignalRPrivateEndpointConnectionsGetResponse, + SignalRPrivateEndpointConnectionsUpdateOptionalParams, + SignalRPrivateEndpointConnectionsUpdateResponse, + SignalRPrivateEndpointConnectionsDeleteOptionalParams, + SignalRPrivateEndpointConnectionsListNextResponse +} from "../models"; -/** Class representing a SignalRPrivateEndpointConnections. */ -export class SignalRPrivateEndpointConnections { - private readonly client: SignalRManagementClientContext; +/// +/** Class containing SignalRPrivateEndpointConnections operations. */ +export class SignalRPrivateEndpointConnectionsImpl + implements SignalRPrivateEndpointConnections { + private readonly client: SignalRManagementClient; /** - * Create a SignalRPrivateEndpointConnections. - * @param {SignalRManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class SignalRPrivateEndpointConnections class. + * @param client Reference to the service client */ - constructor(client: SignalRManagementClientContext) { + constructor(client: SignalRManagementClient) { this.client = client; } /** * List private endpoint connections - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list( + public list( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param options The optional parameters - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( + options?: SignalRPrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, resourceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, resourceName, options); + } + }; + } + + private async *listPagingPage( resourceGroupName: string, resourceName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: SignalRPrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, resourceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( resourceGroupName, resourceName, + continuationToken, options - }, - listOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Get the specified private endpoint connection - * @param privateEndpointConnectionName The name of the private endpoint connection - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - get( - privateEndpointConnectionName: string, + private async *listPagingAll( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: SignalRPrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** - * @param privateEndpointConnectionName The name of the private endpoint connection - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * List private endpoint connections + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param callback The callback + * @param options The options parameters. */ - get( - privateEndpointConnectionName: string, + private _list( resourceGroupName: string, resourceName: string, - callback: msRest.ServiceCallback - ): void; + options?: SignalRPrivateEndpointConnectionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listOperationSpec + ); + } + /** + * Get the specified private endpoint connection * @param privateEndpointConnectionName The name of the private endpoint connection - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ get( privateEndpointConnectionName: string, resourceGroupName: string, resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - privateEndpointConnectionName: string, - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: SignalRPrivateEndpointConnectionsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { privateEndpointConnectionName, @@ -139,186 +140,157 @@ export class SignalRPrivateEndpointConnections { resourceName, options }, - getOperationSpec, - callback - ) as Promise; + getOperationSpec + ); } /** * Update the state of specified private endpoint connection * @param privateEndpointConnectionName The name of the private endpoint connection - * @param parameters The resource of private endpoint and its properties - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - update( - privateEndpointConnectionName: string, - parameters: Models.PrivateEndpointConnection, - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param privateEndpointConnectionName The name of the private endpoint connection * @param parameters The resource of private endpoint and its properties - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param callback The callback + * @param options The options parameters. */ update( privateEndpointConnectionName: string, - parameters: Models.PrivateEndpointConnection, resourceGroupName: string, resourceName: string, - callback: msRest.ServiceCallback - ): void; + parameters: PrivateEndpointConnection, + options?: SignalRPrivateEndpointConnectionsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + privateEndpointConnectionName, + resourceGroupName, + resourceName, + parameters, + options + }, + updateOperationSpec + ); + } + /** + * Delete the specified private endpoint connection * @param privateEndpointConnectionName The name of the private endpoint connection - * @param parameters The resource of private endpoint and its properties - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update( + async beginDelete( privateEndpointConnectionName: string, - parameters: Models.PrivateEndpointConnection, resourceGroupName: string, resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - update( - privateEndpointConnectionName: string, - parameters: Models.PrivateEndpointConnection, - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( + options?: SignalRPrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { privateEndpointConnectionName, - parameters, resourceGroupName, resourceName, options }, - updateOperationSpec, - callback - ) as Promise; + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Delete the specified private endpoint connection * @param privateEndpointConnectionName The name of the private endpoint connection - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod( + async beginDeleteAndWait( privateEndpointConnectionName: string, resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod( + options?: SignalRPrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( privateEndpointConnectionName, resourceGroupName, resourceName, options - ).then((lroPoller) => lroPoller.pollUntilFinished()); + ); + return poller.pollUntilDone(); } /** - * Delete the specified private endpoint connection - * @param privateEndpointConnectionName The name of the private endpoint connection - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - beginDeleteMethod( - privateEndpointConnectionName: string, + private _listNext( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - privateEndpointConnectionName, - resourceGroupName, - resourceName, - options - }, - beginDeleteMethodOperationSpec, - options - ); - } - - /** - * List private endpoint connections - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + nextLink: string, + options?: SignalRPrivateEndpointConnectionsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnectionList @@ -327,21 +299,20 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.privateEndpointConnectionName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection @@ -350,28 +321,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.privateEndpointConnectionName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, + Parameters.privateEndpointConnectionName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.PrivateEndpointConnection, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection @@ -380,39 +344,46 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.privateEndpointConnectionName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, + Parameters.privateEndpointConnectionName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnectionList @@ -421,5 +392,14 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/signalr/arm-signalr/src/operations/signalRPrivateLinkResources.ts b/sdk/signalr/arm-signalr/src/operations/signalRPrivateLinkResources.ts index 4a2b0e86aed5..08bfbcadd4c8 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalRPrivateLinkResources.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalRPrivateLinkResources.ts @@ -3,135 +3,142 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/signalRPrivateLinkResourcesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SignalRPrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SignalRManagementClientContext } from "../signalRManagementClientContext"; +import { SignalRManagementClient } from "../signalRManagementClient"; +import { + PrivateLinkResource, + SignalRPrivateLinkResourcesListNextOptionalParams, + SignalRPrivateLinkResourcesListOptionalParams, + SignalRPrivateLinkResourcesListResponse, + SignalRPrivateLinkResourcesListNextResponse +} from "../models"; -/** Class representing a SignalRPrivateLinkResources. */ -export class SignalRPrivateLinkResources { - private readonly client: SignalRManagementClientContext; +/// +/** Class containing SignalRPrivateLinkResources operations. */ +export class SignalRPrivateLinkResourcesImpl + implements SignalRPrivateLinkResources { + private readonly client: SignalRManagementClient; /** - * Create a SignalRPrivateLinkResources. - * @param {SignalRManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class SignalRPrivateLinkResources class. + * @param client Reference to the service client */ - constructor(client: SignalRManagementClientContext) { + constructor(client: SignalRManagementClient) { this.client = client; } /** * Get the private link resources that need to be created for a resource. - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list( + public list( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param options The optional parameters - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( + options?: SignalRPrivateLinkResourcesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, resourceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, resourceName, options); + } + }; + } + + private async *listPagingPage( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: SignalRPrivateLinkResourcesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, resourceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( resourceGroupName, resourceName, + continuationToken, options - }, - listOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + resourceName: string, + options?: SignalRPrivateLinkResourcesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } } /** * Get the private link resources that need to be created for a resource. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + private _list( + resourceGroupName: string, + resourceName: string, + options?: SignalRPrivateLinkResourcesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: SignalRPrivateLinkResourcesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateLinkResources", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateLinkResources", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateLinkResourceList @@ -140,16 +147,19 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateLinkResourceList @@ -158,5 +168,14 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts b/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts index 8f55d84f534c..cd015c1b42db 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts @@ -3,135 +3,136 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/signalRSharedPrivateLinkResourcesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SignalRSharedPrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SignalRManagementClientContext } from "../signalRManagementClientContext"; +import { SignalRManagementClient } from "../signalRManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SharedPrivateLinkResource, + SignalRSharedPrivateLinkResourcesListNextOptionalParams, + SignalRSharedPrivateLinkResourcesListOptionalParams, + SignalRSharedPrivateLinkResourcesListResponse, + SignalRSharedPrivateLinkResourcesGetOptionalParams, + SignalRSharedPrivateLinkResourcesGetResponse, + SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams, + SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse, + SignalRSharedPrivateLinkResourcesDeleteOptionalParams, + SignalRSharedPrivateLinkResourcesListNextResponse +} from "../models"; -/** Class representing a SignalRSharedPrivateLinkResources. */ -export class SignalRSharedPrivateLinkResources { - private readonly client: SignalRManagementClientContext; +/// +/** Class containing SignalRSharedPrivateLinkResources operations. */ +export class SignalRSharedPrivateLinkResourcesImpl + implements SignalRSharedPrivateLinkResources { + private readonly client: SignalRManagementClient; /** - * Create a SignalRSharedPrivateLinkResources. - * @param {SignalRManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class SignalRSharedPrivateLinkResources class. + * @param client Reference to the service client */ - constructor(client: SignalRManagementClientContext) { + constructor(client: SignalRManagementClient) { this.client = client; } /** * List shared private link resources - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list( + public list( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param options The optional parameters - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( + options?: SignalRSharedPrivateLinkResourcesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, resourceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, resourceName, options); + } + }; + } + + private async *listPagingPage( resourceGroupName: string, resourceName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: SignalRSharedPrivateLinkResourcesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, resourceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( resourceGroupName, resourceName, + continuationToken, options - }, - listOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Get the specified shared private link resource - * @param sharedPrivateLinkResourceName The name of the shared private link resource - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. - * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - get( - sharedPrivateLinkResourceName: string, + private async *listPagingAll( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: SignalRSharedPrivateLinkResourcesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** - * @param sharedPrivateLinkResourceName The name of the shared private link resource - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * List shared private link resources + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param callback The callback + * @param options The options parameters. */ - get( - sharedPrivateLinkResourceName: string, + private _list( resourceGroupName: string, resourceName: string, - callback: msRest.ServiceCallback - ): void; + options?: SignalRSharedPrivateLinkResourcesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listOperationSpec + ); + } + /** + * Get the specified shared private link resource * @param sharedPrivateLinkResourceName The name of the shared private link resource - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ get( sharedPrivateLinkResourceName: string, resourceGroupName: string, resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - sharedPrivateLinkResourceName: string, - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: SignalRSharedPrivateLinkResourcesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { sharedPrivateLinkResourceName, @@ -139,174 +140,234 @@ export class SignalRSharedPrivateLinkResources { resourceName, options }, - getOperationSpec, - callback - ) as Promise; + getOperationSpec + ); } /** * Create or update a shared private link resource * @param sharedPrivateLinkResourceName The name of the shared private link resource - * @param parameters The shared private link resource - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param parameters The shared private link resource + * @param options The options parameters. */ - createOrUpdate( + async beginCreateOrUpdate( sharedPrivateLinkResourceName: string, - parameters: Models.SharedPrivateLinkResource, resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdate( - sharedPrivateLinkResourceName, - parameters, - resourceGroupName, - resourceName, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse - >; + parameters: SharedPrivateLinkResource, + options?: SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState< + SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse + >, + SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName, + parameters, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Delete the specified shared private link resource + * Create or update a shared private link resource * @param sharedPrivateLinkResourceName The name of the shared private link resource - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param parameters The shared private link resource + * @param options The options parameters. */ - deleteMethod( + async beginCreateOrUpdateAndWait( sharedPrivateLinkResourceName: string, resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod( + parameters: SharedPrivateLinkResource, + options?: SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( sharedPrivateLinkResourceName, resourceGroupName, resourceName, + parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()); + ); + return poller.pollUntilDone(); } /** - * Create or update a shared private link resource + * Delete the specified shared private link resource * @param sharedPrivateLinkResourceName The name of the shared private link resource - * @param parameters The shared private link resource - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate( + async beginDelete( sharedPrivateLinkResourceName: string, - parameters: Models.SharedPrivateLinkResource, resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( + options?: SignalRSharedPrivateLinkResourcesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { sharedPrivateLinkResourceName, - parameters, resourceGroupName, resourceName, options }, - beginCreateOrUpdateOperationSpec, - options + deleteOperationSpec ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Delete the specified shared private link resource * @param sharedPrivateLinkResourceName The name of the shared private link resource - * @param resourceGroupName The name of the resource group that contains the resource. You can - * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. * @param resourceName The name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod( + async beginDeleteAndWait( sharedPrivateLinkResourceName: string, resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - sharedPrivateLinkResourceName, - resourceGroupName, - resourceName, - options - }, - beginDeleteMethodOperationSpec, + options?: SignalRSharedPrivateLinkResourcesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName, options ); + return poller.pollUntilDone(); } /** - * List shared private link resources - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: SignalRSharedPrivateLinkResourcesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SharedPrivateLinkResourceList @@ -315,21 +376,20 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.sharedPrivateLinkResourceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SharedPrivateLinkResource @@ -338,28 +398,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.sharedPrivateLinkResourceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, + Parameters.sharedPrivateLinkResourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.SharedPrivateLinkResource, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.SharedPrivateLinkResource @@ -367,43 +420,56 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.SharedPrivateLinkResource }, + 202: { + bodyMapper: Mappers.SharedPrivateLinkResource + }, + 204: { + bodyMapper: Mappers.SharedPrivateLinkResource + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.sharedPrivateLinkResourceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, + Parameters.sharedPrivateLinkResourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.sharedPrivateLinkResourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SharedPrivateLinkResourceList @@ -412,5 +478,14 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/signalr/arm-signalr/src/operations/usages.ts b/sdk/signalr/arm-signalr/src/operations/usages.ts index f3fddd234648..6cc94603fb5b 100644 --- a/sdk/signalr/arm-signalr/src/operations/usages.ts +++ b/sdk/signalr/arm-signalr/src/operations/usages.ts @@ -3,115 +3,121 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/usagesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Usages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SignalRManagementClientContext } from "../signalRManagementClientContext"; +import { SignalRManagementClient } from "../signalRManagementClient"; +import { + SignalRUsage, + UsagesListNextOptionalParams, + UsagesListOptionalParams, + UsagesListResponse, + UsagesListNextResponse +} from "../models"; -/** Class representing a Usages. */ -export class Usages { - private readonly client: SignalRManagementClientContext; +/// +/** Class containing Usages operations. */ +export class UsagesImpl implements Usages { + private readonly client: SignalRManagementClient; /** - * Create a Usages. - * @param {SignalRManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Usages class. + * @param client Reference to the service client */ - constructor(client: SignalRManagementClientContext) { + constructor(client: SignalRManagementClient) { this.client = client; } /** * List resource usage quotas by location. * @param location the location like "eastus" - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(location: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param location the location like "eastus" - * @param callback The callback - */ - list(location: string, callback: msRest.ServiceCallback): void; - /** - * @param location the location like "eastus" - * @param options The optional parameters - * @param callback The callback - */ - list( - location: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( + public list( location: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - location, - options + options?: UsagesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(location, options); + return { + next() { + return iter.next(); }, - listOperationSpec, - callback - ) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(location, options); + } + }; + } + + private async *listPagingPage( + location: string, + options?: UsagesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(location, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(location, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + location: string, + options?: UsagesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(location, options)) { + yield* page; + } } /** * List resource usage quotas by location. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param location the location like "eastus" + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + location: string, + options?: UsagesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param location the location like "eastus" + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + location: string, + nextLink: string, + options?: UsagesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { location, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages", - urlParameters: [Parameters.location, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SignalRUsageList @@ -120,16 +126,18 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.location, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SignalRUsageList @@ -138,5 +146,13 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.location, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/index.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..1a3c5a69526b --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/index.ts @@ -0,0 +1,14 @@ +/* + * 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 * from "./operations"; +export * from "./signalR"; +export * from "./usages"; +export * from "./signalRPrivateEndpointConnections"; +export * from "./signalRPrivateLinkResources"; +export * from "./signalRSharedPrivateLinkResources"; diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/operations.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..df52586abc39 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/signalR.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalR.ts new file mode 100644 index 000000000000..ef2f03693cf7 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalR.ts @@ -0,0 +1,248 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + SignalRResource, + SignalRListBySubscriptionOptionalParams, + SignalRListByResourceGroupOptionalParams, + NameAvailabilityParameters, + SignalRCheckNameAvailabilityOptionalParams, + SignalRCheckNameAvailabilityResponse, + SignalRGetOptionalParams, + SignalRGetResponse, + SignalRCreateOrUpdateOptionalParams, + SignalRCreateOrUpdateResponse, + SignalRDeleteOptionalParams, + SignalRUpdateOptionalParams, + SignalRUpdateResponse, + SignalRListKeysOptionalParams, + SignalRListKeysResponse, + RegenerateKeyParameters, + SignalRRegenerateKeyOptionalParams, + SignalRRegenerateKeyResponse, + SignalRRestartOptionalParams, + SignalRListSkusOptionalParams, + SignalRListSkusResponse +} from "../models"; + +/// +/** Interface representing a SignalR. */ +export interface SignalR { + /** + * Handles requests to list all resources in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: SignalRListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Handles requests to list all resources in a resource group. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: SignalRListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Checks that the resource name is valid and is not already in use. + * @param location the region + * @param parameters Parameters supplied to the operation. + * @param options The options parameters. + */ + checkNameAvailability( + location: string, + parameters: NameAvailabilityParameters, + options?: SignalRCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Get the resource and its properties. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: SignalRGetOptionalParams + ): Promise; + /** + * Create or update a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + parameters: SignalRResource, + options?: SignalRCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SignalRCreateOrUpdateResponse + > + >; + /** + * Create or update a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + parameters: SignalRResource, + options?: SignalRCreateOrUpdateOptionalParams + ): Promise; + /** + * Operation to delete a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourceName: string, + options?: SignalRDeleteOptionalParams + ): Promise, void>>; + /** + * Operation to delete a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + options?: SignalRDeleteOptionalParams + ): Promise; + /** + * Operation to update an exiting resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters Parameters for the update operation + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + resourceName: string, + parameters: SignalRResource, + options?: SignalRUpdateOptionalParams + ): Promise< + PollerLike, SignalRUpdateResponse> + >; + /** + * Operation to update an exiting resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters Parameters for the update operation + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + resourceName: string, + parameters: SignalRResource, + options?: SignalRUpdateOptionalParams + ): Promise; + /** + * Get the access keys of the resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + resourceName: string, + options?: SignalRListKeysOptionalParams + ): Promise; + /** + * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the + * same time. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param options The options parameters. + */ + beginRegenerateKey( + resourceGroupName: string, + resourceName: string, + parameters: RegenerateKeyParameters, + options?: SignalRRegenerateKeyOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SignalRRegenerateKeyResponse + > + >; + /** + * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the + * same time. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param options The options parameters. + */ + beginRegenerateKeyAndWait( + resourceGroupName: string, + resourceName: string, + parameters: RegenerateKeyParameters, + options?: SignalRRegenerateKeyOptionalParams + ): Promise; + /** + * Operation to restart a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + beginRestart( + resourceGroupName: string, + resourceName: string, + options?: SignalRRestartOptionalParams + ): Promise, void>>; + /** + * Operation to restart a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + beginRestartAndWait( + resourceGroupName: string, + resourceName: string, + options?: SignalRRestartOptionalParams + ): Promise; + /** + * List all available skus of the resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + listSkus( + resourceGroupName: string, + resourceName: string, + options?: SignalRListSkusOptionalParams + ): Promise; +} diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRPrivateEndpointConnections.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRPrivateEndpointConnections.ts new file mode 100644 index 000000000000..4abfc4301132 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRPrivateEndpointConnections.ts @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnection, + SignalRPrivateEndpointConnectionsListOptionalParams, + SignalRPrivateEndpointConnectionsGetOptionalParams, + SignalRPrivateEndpointConnectionsGetResponse, + SignalRPrivateEndpointConnectionsUpdateOptionalParams, + SignalRPrivateEndpointConnectionsUpdateResponse, + SignalRPrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a SignalRPrivateEndpointConnections. */ +export interface SignalRPrivateEndpointConnections { + /** + * List private endpoint connections + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: SignalRPrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the specified private endpoint connection + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + get( + privateEndpointConnectionName: string, + resourceGroupName: string, + resourceName: string, + options?: SignalRPrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Update the state of specified private endpoint connection + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters The resource of private endpoint and its properties + * @param options The options parameters. + */ + update( + privateEndpointConnectionName: string, + resourceGroupName: string, + resourceName: string, + parameters: PrivateEndpointConnection, + options?: SignalRPrivateEndpointConnectionsUpdateOptionalParams + ): Promise; + /** + * Delete the specified private endpoint connection + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + beginDelete( + privateEndpointConnectionName: string, + resourceGroupName: string, + resourceName: string, + options?: SignalRPrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete the specified private endpoint connection + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + privateEndpointConnectionName: string, + resourceGroupName: string, + resourceName: string, + options?: SignalRPrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRPrivateLinkResources.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRPrivateLinkResources.ts new file mode 100644 index 000000000000..fc877b502531 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRPrivateLinkResources.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PrivateLinkResource, + SignalRPrivateLinkResourcesListOptionalParams +} from "../models"; + +/// +/** Interface representing a SignalRPrivateLinkResources. */ +export interface SignalRPrivateLinkResources { + /** + * Get the private link resources that need to be created for a resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: SignalRPrivateLinkResourcesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRSharedPrivateLinkResources.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRSharedPrivateLinkResources.ts new file mode 100644 index 000000000000..9f8bef4cdd74 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRSharedPrivateLinkResources.ts @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + SharedPrivateLinkResource, + SignalRSharedPrivateLinkResourcesListOptionalParams, + SignalRSharedPrivateLinkResourcesGetOptionalParams, + SignalRSharedPrivateLinkResourcesGetResponse, + SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams, + SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse, + SignalRSharedPrivateLinkResourcesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a SignalRSharedPrivateLinkResources. */ +export interface SignalRSharedPrivateLinkResources { + /** + * List shared private link resources + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: SignalRSharedPrivateLinkResourcesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the specified shared private link resource + * @param sharedPrivateLinkResourceName The name of the shared private link resource + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + get( + sharedPrivateLinkResourceName: string, + resourceGroupName: string, + resourceName: string, + options?: SignalRSharedPrivateLinkResourcesGetOptionalParams + ): Promise; + /** + * Create or update a shared private link resource + * @param sharedPrivateLinkResourceName The name of the shared private link resource + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters The shared private link resource + * @param options The options parameters. + */ + beginCreateOrUpdate( + sharedPrivateLinkResourceName: string, + resourceGroupName: string, + resourceName: string, + parameters: SharedPrivateLinkResource, + options?: SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState< + SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse + >, + SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse + > + >; + /** + * Create or update a shared private link resource + * @param sharedPrivateLinkResourceName The name of the shared private link resource + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param parameters The shared private link resource + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + sharedPrivateLinkResourceName: string, + resourceGroupName: string, + resourceName: string, + parameters: SharedPrivateLinkResource, + options?: SignalRSharedPrivateLinkResourcesCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete the specified shared private link resource + * @param sharedPrivateLinkResourceName The name of the shared private link resource + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + beginDelete( + sharedPrivateLinkResourceName: string, + resourceGroupName: string, + resourceName: string, + options?: SignalRSharedPrivateLinkResourcesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete the specified shared private link resource + * @param sharedPrivateLinkResourceName The name of the shared private link resource + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + sharedPrivateLinkResourceName: string, + resourceGroupName: string, + resourceName: string, + options?: SignalRSharedPrivateLinkResourcesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/usages.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/usages.ts new file mode 100644 index 000000000000..975bf04dd5e3 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/usages.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SignalRUsage, UsagesListOptionalParams } from "../models"; + +/// +/** Interface representing a Usages. */ +export interface Usages { + /** + * List resource usage quotas by location. + * @param location the location like "eastus" + * @param options The options parameters. + */ + list( + location: string, + options?: UsagesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/signalr/arm-signalr/src/signalRManagementClient.ts b/sdk/signalr/arm-signalr/src/signalRManagementClient.ts index f89ba0585838..6ff0ea7b5b07 100644 --- a/sdk/signalr/arm-signalr/src/signalRManagementClient.ts +++ b/sdk/signalr/arm-signalr/src/signalRManagementClient.ts @@ -3,53 +3,104 @@ * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { SignalRManagementClientContext } from "./signalRManagementClientContext"; - -class SignalRManagementClient extends SignalRManagementClientContext { - // Operation groups - operations: operations.Operations; - signalR: operations.SignalR; - usages: operations.Usages; - signalRPrivateEndpointConnections: operations.SignalRPrivateEndpointConnections; - signalRPrivateLinkResources: operations.SignalRPrivateLinkResources; - signalRSharedPrivateLinkResources: operations.SignalRSharedPrivateLinkResources; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + SignalRImpl, + UsagesImpl, + SignalRPrivateEndpointConnectionsImpl, + SignalRPrivateLinkResourcesImpl, + SignalRSharedPrivateLinkResourcesImpl +} from "./operations"; +import { + Operations, + SignalR, + Usages, + SignalRPrivateEndpointConnections, + SignalRPrivateLinkResources, + SignalRSharedPrivateLinkResources +} from "./operationsInterfaces"; +import { SignalRManagementClientOptionalParams } from "./models"; + +export class SignalRManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the SignalRManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Gets subscription Id which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId Gets subscription Id which uniquely identify the Microsoft Azure subscription. + * The subscription ID forms part of the URI for every service call. + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: Models.SignalRManagementClientOptions + options?: SignalRManagementClientOptionalParams ) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.signalR = new operations.SignalR(this); - this.usages = new operations.Usages(this); - this.signalRPrivateEndpointConnections = new operations.SignalRPrivateEndpointConnections(this); - this.signalRPrivateLinkResources = new operations.SignalRPrivateLinkResources(this); - this.signalRSharedPrivateLinkResources = new operations.SignalRSharedPrivateLinkResources(this); - } -} + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: SignalRManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-signalr/5.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - SignalRManagementClient, - SignalRManagementClientContext, - Models as SignalRManagementModels, - Mappers as SignalRManagementMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-10-01"; + this.operations = new OperationsImpl(this); + this.signalR = new SignalRImpl(this); + this.usages = new UsagesImpl(this); + this.signalRPrivateEndpointConnections = new SignalRPrivateEndpointConnectionsImpl( + this + ); + this.signalRPrivateLinkResources = new SignalRPrivateLinkResourcesImpl( + this + ); + this.signalRSharedPrivateLinkResources = new SignalRSharedPrivateLinkResourcesImpl( + this + ); + } + + operations: Operations; + signalR: SignalR; + usages: Usages; + signalRPrivateEndpointConnections: SignalRPrivateEndpointConnections; + signalRPrivateLinkResources: SignalRPrivateLinkResources; + signalRSharedPrivateLinkResources: SignalRSharedPrivateLinkResources; +} diff --git a/sdk/signalr/arm-signalr/src/signalRManagementClientContext.ts b/sdk/signalr/arm-signalr/src/signalRManagementClientContext.ts deleted file mode 100644 index 066c749b799a..000000000000 --- a/sdk/signalr/arm-signalr/src/signalRManagementClientContext.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-signalr"; -const packageVersion = "4.0.0"; - -export class SignalRManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - apiVersion?: string; - subscriptionId: string; - - /** - * Initializes a new instance of the SignalRManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Gets subscription Id which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor( - credentials: msRest.ServiceClientCredentials, - subscriptionId: string, - options?: Models.SignalRManagementClientOptions - ) { - if (credentials == undefined) { - throw new Error("'credentials' cannot be null."); - } - if (subscriptionId == undefined) { - throw new Error("'subscriptionId' cannot be null."); - } - - if (!options) { - options = {}; - } - if (!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = "2021-04-01-preview"; - this.acceptLanguage = "en-US"; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if ( - options.longRunningOperationRetryTimeout !== null && - options.longRunningOperationRetryTimeout !== undefined - ) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/signalr/arm-signalr/test/sampleTest.ts b/sdk/signalr/arm-signalr/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/signalr/arm-signalr/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +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: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/signalr/arm-signalr/tsconfig.json b/sdk/signalr/arm-signalr/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/signalr/arm-signalr/tsconfig.json +++ b/sdk/signalr/arm-signalr/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/signalr/ci.yml b/sdk/signalr/ci.yml new file mode 100644 index 000000000000..d96f2745a463 --- /dev/null +++ b/sdk/signalr/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/signalr/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/signalr/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: signalr + Artifacts: + - name: azure-arm-signalr + safeName: azurearmsignalr + \ No newline at end of file