From 33874f50ffeebdab19a6d090d9939131cb2bfecc Mon Sep 17 00:00:00 2001 From: colawwj <70128817+colawwj@users.noreply.github.com> Date: Fri, 1 Apr 2022 16:12:47 +0800 Subject: [PATCH] signalr-release-track2 (#21104) * signalr-release-track2 * update --- common/config/rush/pnpm-lock.yaml | 33 +- sdk/signalr/arm-signalr/CHANGELOG.md | 36 ++ sdk/signalr/arm-signalr/README.md | 11 + sdk/signalr/arm-signalr/_meta.json | 7 +- sdk/signalr/arm-signalr/api-extractor.json | 25 +- sdk/signalr/arm-signalr/package.json | 41 +- .../arm-signalr/review/arm-signalr.api.md | 140 ++++++ sdk/signalr/arm-signalr/rollup.config.js | 78 +-- .../samples-dev/operationsListSample.ts | 31 ++ .../signalRCheckNameAvailabilitySample.ts | 39 ++ .../signalRCreateOrUpdateSample.ts | 80 +++ ...RCustomCertificatesCreateOrUpdateSample.ts | 41 ++ .../signalRCustomCertificatesDeleteSample.ts | 35 ++ .../signalRCustomCertificatesGetSample.ts | 35 ++ .../signalRCustomCertificatesListSample.ts | 36 ++ ...ignalRCustomDomainsCreateOrUpdateSample.ts | 43 ++ .../signalRCustomDomainsDeleteSample.ts | 35 ++ .../signalRCustomDomainsGetSample.ts | 35 ++ .../signalRCustomDomainsListSample.ts | 36 ++ .../samples-dev/signalRDeleteSample.ts | 33 ++ .../samples-dev/signalRGetSample.ts | 30 ++ .../signalRListByResourceGroupSample.ts | 34 ++ .../signalRListBySubscriptionSample.ts | 31 ++ .../samples-dev/signalRListKeysSample.ts | 30 ++ .../samples-dev/signalRListSkusSample.ts | 30 ++ ...RPrivateEndpointConnectionsDeleteSample.ts | 36 ++ ...nalRPrivateEndpointConnectionsGetSample.ts | 36 ++ ...alRPrivateEndpointConnectionsListSample.ts | 36 ++ ...RPrivateEndpointConnectionsUpdateSample.ts | 50 ++ .../signalRPrivateLinkResourcesListSample.ts | 36 ++ .../samples-dev/signalRRegenerateKeySample.ts | 38 ++ .../samples-dev/signalRRestartSample.ts | 33 ++ ...rivateLinkResourcesCreateOrUpdateSample.ts | 45 ++ ...RSharedPrivateLinkResourcesDeleteSample.ts | 35 ++ ...nalRSharedPrivateLinkResourcesGetSample.ts | 35 ++ ...alRSharedPrivateLinkResourcesListSample.ts | 36 ++ .../samples-dev/signalRUpdateSample.ts | 80 +++ .../samples-dev/usagesListSample.ts | 32 ++ .../samples/v5/javascript/README.md | 108 +++- .../v5/javascript/operationsListSample.js | 31 ++ .../signalRCheckNameAvailabilitySample.js | 33 ++ .../javascript/signalRCreateOrUpdateSample.js | 80 +++ ...RCustomCertificatesCreateOrUpdateSample.js | 41 ++ .../signalRCustomCertificatesDeleteSample.js | 35 ++ .../signalRCustomCertificatesGetSample.js | 35 ++ .../signalRCustomCertificatesListSample.js | 33 ++ ...ignalRCustomDomainsCreateOrUpdateSample.js | 42 ++ .../signalRCustomDomainsDeleteSample.js | 35 ++ .../signalRCustomDomainsGetSample.js | 31 ++ .../signalRCustomDomainsListSample.js | 33 ++ .../v5/javascript/signalRDeleteSample.js | 30 ++ .../samples/v5/javascript/signalRGetSample.js | 30 ++ .../signalRListByResourceGroupSample.js | 32 ++ .../signalRListBySubscriptionSample.js | 31 ++ .../v5/javascript/signalRListKeysSample.js | 30 ++ .../v5/javascript/signalRListSkusSample.js | 30 ++ ...RPrivateEndpointConnectionsDeleteSample.js | 35 ++ ...nalRPrivateEndpointConnectionsGetSample.js | 35 ++ ...alRPrivateEndpointConnectionsListSample.js | 36 ++ ...RPrivateEndpointConnectionsUpdateSample.js | 45 ++ .../signalRPrivateLinkResourcesListSample.js | 33 ++ .../javascript/signalRRegenerateKeySample.js | 35 ++ .../v5/javascript/signalRRestartSample.js | 30 ++ ...rivateLinkResourcesCreateOrUpdateSample.js | 42 ++ ...RSharedPrivateLinkResourcesDeleteSample.js | 35 ++ ...nalRSharedPrivateLinkResourcesGetSample.js | 35 ++ ...alRSharedPrivateLinkResourcesListSample.js | 36 ++ .../v5/javascript/signalRUpdateSample.js | 80 +++ .../samples/v5/javascript/usagesListSample.js | 32 ++ .../samples/v5/typescript/README.md | 108 +++- .../v5/typescript/src/operationsListSample.ts | 31 ++ .../src/signalRCheckNameAvailabilitySample.ts | 39 ++ .../src/signalRCreateOrUpdateSample.ts | 80 +++ ...RCustomCertificatesCreateOrUpdateSample.ts | 41 ++ .../signalRCustomCertificatesDeleteSample.ts | 35 ++ .../src/signalRCustomCertificatesGetSample.ts | 35 ++ .../signalRCustomCertificatesListSample.ts | 36 ++ ...ignalRCustomDomainsCreateOrUpdateSample.ts | 43 ++ .../src/signalRCustomDomainsDeleteSample.ts | 35 ++ .../src/signalRCustomDomainsGetSample.ts | 35 ++ .../src/signalRCustomDomainsListSample.ts | 36 ++ .../v5/typescript/src/signalRDeleteSample.ts | 33 ++ .../v5/typescript/src/signalRGetSample.ts | 30 ++ .../src/signalRListByResourceGroupSample.ts | 34 ++ .../src/signalRListBySubscriptionSample.ts | 31 ++ .../typescript/src/signalRListKeysSample.ts | 30 ++ .../typescript/src/signalRListSkusSample.ts | 30 ++ ...RPrivateEndpointConnectionsDeleteSample.ts | 36 ++ ...nalRPrivateEndpointConnectionsGetSample.ts | 36 ++ ...alRPrivateEndpointConnectionsListSample.ts | 36 ++ ...RPrivateEndpointConnectionsUpdateSample.ts | 50 ++ .../signalRPrivateLinkResourcesListSample.ts | 36 ++ .../src/signalRRegenerateKeySample.ts | 38 ++ .../v5/typescript/src/signalRRestartSample.ts | 33 ++ ...rivateLinkResourcesCreateOrUpdateSample.ts | 45 ++ ...RSharedPrivateLinkResourcesDeleteSample.ts | 35 ++ ...nalRSharedPrivateLinkResourcesGetSample.ts | 35 ++ ...alRSharedPrivateLinkResourcesListSample.ts | 36 ++ .../v5/typescript/src/signalRUpdateSample.ts | 80 +++ .../v5/typescript/src/usagesListSample.ts | 32 ++ sdk/signalr/arm-signalr/src/models/index.ts | 195 ++++++- sdk/signalr/arm-signalr/src/models/mappers.ts | 207 ++++++++ .../arm-signalr/src/models/parameters.ts | 40 +- .../arm-signalr/src/operations/index.ts | 2 + .../arm-signalr/src/operations/signalR.ts | 20 +- .../operations/signalRCustomCertificates.ts | 406 +++++++++++++++ .../src/operations/signalRCustomDomains.ts | 476 ++++++++++++++++++ .../signalRPrivateEndpointConnections.ts | 6 +- .../signalRSharedPrivateLinkResources.ts | 10 +- .../src/operationsInterfaces/index.ts | 2 + .../signalRCustomCertificates.ts | 101 ++++ .../signalRCustomDomains.ts | 115 +++++ .../src/signalRManagementClient.ts | 15 +- sdk/signalr/arm-signalr/test/sampleTest.ts | 7 +- sdk/signalr/arm-signalr/tsconfig.json | 23 +- sdk/signalr/ci.mgmt.yml | 9 +- 116 files changed, 5461 insertions(+), 205 deletions(-) create mode 100644 sdk/signalr/arm-signalr/samples-dev/operationsListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCheckNameAvailabilitySample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCreateOrUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesCreateOrUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsCreateOrUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRListByResourceGroupSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRListBySubscriptionSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRListKeysSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRListSkusSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRPrivateLinkResourcesListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRRegenerateKeySample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRRestartSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/signalRUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples-dev/usagesListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/operationsListSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCheckNameAvailabilitySample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCreateOrUpdateSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesCreateOrUpdateSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesDeleteSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesGetSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesListSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsCreateOrUpdateSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsDeleteSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsGetSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsListSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRDeleteSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRGetSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRListByResourceGroupSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRListBySubscriptionSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRListKeysSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRListSkusSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsDeleteSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsGetSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsListSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsUpdateSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateLinkResourcesListSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRRegenerateKeySample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRRestartSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesDeleteSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesGetSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesListSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/signalRUpdateSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/javascript/usagesListSample.js create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/operationsListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCheckNameAvailabilitySample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCreateOrUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesCreateOrUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsCreateOrUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListByResourceGroupSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListBySubscriptionSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListKeysSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListSkusSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateLinkResourcesListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRegenerateKeySample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRestartSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesDeleteSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesGetSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesListSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRUpdateSample.ts create mode 100644 sdk/signalr/arm-signalr/samples/v5/typescript/src/usagesListSample.ts create mode 100644 sdk/signalr/arm-signalr/src/operations/signalRCustomCertificates.ts create mode 100644 sdk/signalr/arm-signalr/src/operations/signalRCustomDomains.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/signalRCustomCertificates.ts create mode 100644 sdk/signalr/arm-signalr/src/operationsInterfaces/signalRCustomDomains.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 710bc269861a..b2686ca0943a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -642,21 +642,6 @@ packages: - supports-color dev: false - /@azure/arm-storage/17.1.0: - resolution: {integrity: sha512-MZtO0DRQp05GwY3vgeyLYkPgVSo2IddyeAEHX2JzyJQGc0CfAMswJo3C1NHcRNiBeNCc6AnLtySUpk0saVLAxg==} - engines: {node: '>=12.0.0'} - dependencies: - '@azure/abort-controller': 1.0.4 - '@azure/core-auth': 1.3.2 - '@azure/core-client': 1.5.0 - '@azure/core-lro': 2.2.4 - '@azure/core-paging': 1.2.1 - '@azure/core-rest-pipeline': 1.7.0 - tslib: 2.3.1 - transitivePeerDependencies: - - supports-color - dev: false - /@azure/communication-common/1.1.0: resolution: {integrity: sha512-vqTtzDtb4NG3LWoWoqlOOJApZRRIIImNUKlGyTa6c1YC+v5A7UEOL9TX8NRDxvFVUF2wDHsSnkhLBVBgkcAhIQ==} engines: {node: '>=12.0.0'} @@ -9407,7 +9392,6 @@ packages: version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 - '@azure/arm-storage': 17.1.0 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.5 '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 @@ -10502,7 +10486,6 @@ packages: version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 - '@azure/arm-storage': 17.1.0 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.5 '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 @@ -11565,7 +11548,6 @@ packages: version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 - '@azure/arm-storage': 17.1.0 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.5 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 @@ -12785,27 +12767,28 @@ packages: dev: false file:projects/arm-signalr.tgz: - resolution: {integrity: sha512-/lQuydBuVbd72Bb69zdj9L7NQJtenFgik7dhgphDvl0HqeYS1CsOeiKVuECnzB3mFHVhLPnrgHjYcd/T5OuPtw==, tarball: file:projects/arm-signalr.tgz} + resolution: {integrity: sha512-hMOnRTilrU0GnG79+EKJTLZSS0XVTkhcERWJb6/NjS2irqFP577cnvnnMQNkxtyhNFqA3mMr6EdduUAKBNMbqg==, tarball: file:projects/arm-signalr.tgz} name: '@rush-temp/arm-signalr' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.5 - '@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 + '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 + '@rollup/plugin-json': 4.1.0_rollup@2.70.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 + '@rollup/plugin-node-resolve': 13.1.3_rollup@2.70.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 + rollup: 2.70.1 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.3 transitivePeerDependencies: + - '@types/node' - debug - encoding - supports-color diff --git a/sdk/signalr/arm-signalr/CHANGELOG.md b/sdk/signalr/arm-signalr/CHANGELOG.md index 14a51e55aa0f..3973232995f3 100644 --- a/sdk/signalr/arm-signalr/CHANGELOG.md +++ b/sdk/signalr/arm-signalr/CHANGELOG.md @@ -1,5 +1,41 @@ # Release History +## 5.1.0 (2022-03-30) + +**Features** + + - Added operation group SignalRCustomCertificates + - Added operation group SignalRCustomDomains + - Added Interface CustomCertificateList + - Added Interface CustomDomainList + - Added Interface LiveTraceCategory + - Added Interface LiveTraceConfiguration + - Added Interface ResourceReference + - Added Interface SignalRCustomCertificatesCreateOrUpdateOptionalParams + - Added Interface SignalRCustomCertificatesDeleteOptionalParams + - Added Interface SignalRCustomCertificatesGetOptionalParams + - Added Interface SignalRCustomCertificatesListNextOptionalParams + - Added Interface SignalRCustomCertificatesListOptionalParams + - Added Interface SignalRCustomDomainsCreateOrUpdateOptionalParams + - Added Interface SignalRCustomDomainsDeleteOptionalParams + - Added Interface SignalRCustomDomainsGetOptionalParams + - Added Interface SignalRCustomDomainsListNextOptionalParams + - Added Interface SignalRCustomDomainsListOptionalParams + - Added Type Alias CustomCertificate + - Added Type Alias CustomDomain + - Added Type Alias SignalRCustomCertificatesCreateOrUpdateResponse + - Added Type Alias SignalRCustomCertificatesGetResponse + - Added Type Alias SignalRCustomCertificatesListNextResponse + - Added Type Alias SignalRCustomCertificatesListResponse + - Added Type Alias SignalRCustomDomainsCreateOrUpdateResponse + - Added Type Alias SignalRCustomDomainsGetResponse + - Added Type Alias SignalRCustomDomainsListNextResponse + - Added Type Alias SignalRCustomDomainsListResponse + - Class SignalRManagementClient has a new parameter signalRCustomCertificates + - Class SignalRManagementClient has a new parameter signalRCustomDomains + - Type Alias SignalRResource has a new parameter liveTraceConfiguration + + ## 5.0.0 (2022-01-21) The package of @azure/arm-signalr is using our next generation design principles since version 5.0.0, which contains breaking changes. diff --git a/sdk/signalr/arm-signalr/README.md b/sdk/signalr/arm-signalr/README.md index 60cad7fe0350..8ca036a31727 100644 --- a/sdk/signalr/arm-signalr/README.md +++ b/sdk/signalr/arm-signalr/README.md @@ -16,6 +16,8 @@ REST API for Azure SignalR Service - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + ### Prerequisites - An [Azure subscription][azure_sub]. @@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { SignalRManagementClient } = require("@azure/arm-signalr"); const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new SignalRManagementClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new SignalRManagementClient(credential, subscriptionId); ``` diff --git a/sdk/signalr/arm-signalr/_meta.json b/sdk/signalr/arm-signalr/_meta.json index 5a3939dd750f..eecc06409fb6 100644 --- a/sdk/signalr/arm-signalr/_meta.json +++ b/sdk/signalr/arm-signalr/_meta.json @@ -1,7 +1,8 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "commit": "3c1da29166fe1306071c939ac1344b092bafd0ce", "readme": "specification/signalr/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/signalr/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\signalr\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.2.1", + "use": "@autorest/typescript@6.0.0-alpha.18.20220329.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 index f2479276b656..21d7954e6ba9 100644 --- a/sdk/signalr/arm-signalr/api-extractor.json +++ b/sdk/signalr/arm-signalr/api-extractor.json @@ -1,18 +1,31 @@ { "$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" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-signalr.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/signalr/arm-signalr/package.json b/sdk/signalr/arm-signalr/package.json index ad3405426957..f83c2e52ce57 100644 --- a/sdk/signalr/arm-signalr/package.json +++ b/sdk/signalr/arm-signalr/package.json @@ -3,8 +3,10 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SignalRManagementClient.", - "version": "5.0.0", - "engines": { "node": ">=12.0.0" }, + "version": "5.1.0", + "engines": { + "node": ">=12.0.0" + }, "dependencies": { "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", @@ -14,20 +16,26 @@ "@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/index.js", "module": "./dist-esm/src/index.js", "types": "./types/arm-signalr.d.ts", "devDependencies": { "@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", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^1.0.4", - "rollup": "^1.16.3", - "rollup-plugin-sourcemaps": "^0.4.2", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", @@ -41,7 +49,9 @@ "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", @@ -90,14 +100,19 @@ "sideEffects": false, "//metadata": { "constantPaths": [ - { "path": "src/SignalRManagementClient.ts", "prefix": "packageDetails" } + { + "path": "src/signalRManagementClient.ts", + "prefix": "packageDetails" + } ] }, "autoPublish": true, "//sampleConfiguration": { "productName": "", - "productSlugs": ["azure"], + "productSlugs": [ + "azure" + ], "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-signalr?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/signalr/arm-signalr/review/arm-signalr.api.md b/sdk/signalr/arm-signalr/review/arm-signalr.api.md index f143251c7097..2ddc9bac6cdd 100644 --- a/sdk/signalr/arm-signalr/review/arm-signalr.api.md +++ b/sdk/signalr/arm-signalr/review/arm-signalr.api.md @@ -16,6 +16,35 @@ export type ACLAction = string; // @public export type CreatedByType = string; +// @public +export type CustomCertificate = ProxyResource & { + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + keyVaultBaseUri: string; + keyVaultSecretName: string; + keyVaultSecretVersion?: string; +}; + +// @public +export interface CustomCertificateList { + nextLink?: string; + value?: CustomCertificate[]; +} + +// @public +export type CustomDomain = ProxyResource & { + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + domainName: string; + customCertificate: ResourceReference; +}; + +// @public +export interface CustomDomainList { + nextLink?: string; + value?: CustomDomain[]; +} + // @public export interface Dimension { displayName?: string; @@ -201,6 +230,18 @@ export enum KnownUpstreamAuthType { None = "None" } +// @public +export interface LiveTraceCategory { + enabled?: string; + name?: string; +} + +// @public +export interface LiveTraceConfiguration { + categories?: LiveTraceCategory[]; + enabled?: string; +} + // @public export interface LogSpecification { displayName?: string; @@ -381,6 +422,11 @@ export interface ResourceLogConfiguration { categories?: ResourceLogCategory[]; } +// @public +export interface ResourceReference { + id?: string; +} + // @public export interface ResourceSku { capacity?: number; @@ -480,6 +526,95 @@ export interface SignalRCreateOrUpdateOptionalParams extends coreClient.Operatio // @public export type SignalRCreateOrUpdateResponse = SignalRResource; +// @public +export interface SignalRCustomCertificates { + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, certificateName: string, parameters: CustomCertificate, options?: SignalRCustomCertificatesCreateOrUpdateOptionalParams): Promise, SignalRCustomCertificatesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, certificateName: string, parameters: CustomCertificate, options?: SignalRCustomCertificatesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, certificateName: string, options?: SignalRCustomCertificatesDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, certificateName: string, options?: SignalRCustomCertificatesGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: SignalRCustomCertificatesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SignalRCustomCertificatesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SignalRCustomCertificatesCreateOrUpdateResponse = CustomCertificate; + +// @public +export interface SignalRCustomCertificatesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface SignalRCustomCertificatesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRCustomCertificatesGetResponse = CustomCertificate; + +// @public +export interface SignalRCustomCertificatesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRCustomCertificatesListNextResponse = CustomCertificateList; + +// @public +export interface SignalRCustomCertificatesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRCustomCertificatesListResponse = CustomCertificateList; + +// @public +export interface SignalRCustomDomains { + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, name: string, parameters: CustomDomain, options?: SignalRCustomDomainsCreateOrUpdateOptionalParams): Promise, SignalRCustomDomainsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, name: string, parameters: CustomDomain, options?: SignalRCustomDomainsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, name: string, options?: SignalRCustomDomainsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, name: string, options?: SignalRCustomDomainsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, name: string, options?: SignalRCustomDomainsGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: SignalRCustomDomainsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SignalRCustomDomainsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SignalRCustomDomainsCreateOrUpdateResponse = CustomDomain; + +// @public +export interface SignalRCustomDomainsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SignalRCustomDomainsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRCustomDomainsGetResponse = CustomDomain; + +// @public +export interface SignalRCustomDomainsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRCustomDomainsListNextResponse = CustomDomainList; + +// @public +export interface SignalRCustomDomainsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SignalRCustomDomainsListResponse = CustomDomainList; + // @public export interface SignalRDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -564,6 +699,10 @@ export class SignalRManagementClient extends coreClient.ServiceClient { // (undocumented) signalR: SignalR; // (undocumented) + signalRCustomCertificates: SignalRCustomCertificates; + // (undocumented) + signalRCustomDomains: SignalRCustomDomains; + // (undocumented) signalRPrivateEndpointConnections: SignalRPrivateEndpointConnections; // (undocumented) signalRPrivateLinkResources: SignalRPrivateLinkResources; @@ -680,6 +819,7 @@ export type SignalRResource = TrackedResource & { tls?: SignalRTlsSettings; readonly hostNamePrefix?: string; features?: SignalRFeature[]; + liveTraceConfiguration?: LiveTraceConfiguration; resourceLogConfiguration?: ResourceLogConfiguration; cors?: SignalRCorsSettings; upstream?: ServerlessUpstreamSettings; diff --git a/sdk/signalr/arm-signalr/rollup.config.js b/sdk/signalr/arm-signalr/rollup.config.js index 9be1955eb7f1..3f89d7309da5 100644 --- a/sdk/signalr/arm-signalr/rollup.config.js +++ b/sdk/signalr/arm-signalr/rollup.config.js @@ -14,62 +14,14 @@ 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 + * A function that can determine whether a rollup warning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEvalWarnings(warning) { +function ignoreNiseSinonEval(warning) { return ( warning.code === "EVAL" && warning.id && @@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) { ); } -function ignoreChaiCircularDependencyWarnings(warning) { +function ignoreChaiCircularDependency(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ - ignoreChaiCircularDependencyWarnings, - ignoreNiseSinonEvalWarnings -]; +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; /** * Construct a warning handler for the shared rollup configuration @@ -122,22 +71,7 @@ function makeBrowserTestConfig() { 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() - } - }), + cjs(), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -173,7 +107,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve(), cjs()] + plugins: [sourcemaps(), nodeResolve()] }; const config = [baseConfig]; diff --git a/sdk/signalr/arm-signalr/samples-dev/operationsListSample.ts b/sdk/signalr/arm-signalr/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..e56024da6166 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Operations_List.json + */ +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCheckNameAvailabilitySample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..71233ed48e94 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCheckNameAvailabilitySample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + NameAvailabilityParameters, + SignalRManagementClient +} from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Checks that the resource name is valid and is not already in use. + * + * @summary Checks that the resource name is valid and is not already in use. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CheckNameAvailability.json + */ +async function signalRCheckNameAvailability() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const parameters: NameAvailabilityParameters = { + name: "mySignalRService", + type: "Microsoft.SignalRService/SignalR" + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.checkNameAvailability( + location, + parameters + ); + console.log(result); +} + +signalRCheckNameAvailability().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCreateOrUpdateSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ef4462c658e6 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCreateOrUpdateSample.ts @@ -0,0 +1,80 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRResource, SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a resource. + * + * @summary Create or update a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CreateOrUpdate.json + */ +async function signalRCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: SignalRResource = { + cors: { allowedOrigins: ["https://foo.com", "https://bar.com"] }, + disableAadAuth: false, + disableLocalAuth: false, + features: [ + { flag: "ServiceMode", properties: {}, value: "Serverless" }, + { flag: "EnableConnectivityLogs", properties: {}, value: "True" }, + { flag: "EnableMessagingLogs", properties: {}, value: "False" }, + { flag: "EnableLiveTrace", properties: {}, value: "False" } + ], + identity: { type: "SystemAssigned" }, + kind: "SignalR", + liveTraceConfiguration: { + categories: [{ name: "ConnectivityLogs", enabled: "true" }], + enabled: "false" + }, + location: "eastus", + networkACLs: { + defaultAction: "Deny", + privateEndpoints: [ + { + name: "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", + allow: ["ServerConnection"] + } + ], + publicNetwork: { allow: ["ClientConnection"] } + }, + publicNetworkAccess: "Enabled", + sku: { name: "Standard_S1", capacity: 1, tier: "Standard" }, + tags: { key1: "value1" }, + tls: { clientCertEnabled: false }, + upstream: { + templates: [ + { + auth: { + type: "ManagedIdentity", + managedIdentity: { resource: "api://example" } + }, + categoryPattern: "*", + eventPattern: "connect,disconnect", + hubPattern: "*", + urlTemplate: "https://example.com/chat/api/connect" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesCreateOrUpdateSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e951592469ee --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesCreateOrUpdateSample.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CustomCertificate, SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a custom certificate. + * + * @summary Create or update a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_CreateOrUpdate.json + */ +async function signalRCustomCertificatesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const parameters: CustomCertificate = { + keyVaultBaseUri: "https://myvault.keyvault.azure.net/", + keyVaultSecretName: "mycert", + keyVaultSecretVersion: "bb6a44b2743f47f68dad0d6cc9756432" + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + certificateName, + parameters + ); + console.log(result); +} + +signalRCustomCertificatesCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesDeleteSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesDeleteSample.ts new file mode 100644 index 000000000000..f4e4de873ad9 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a custom certificate. + * + * @summary Delete a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Delete.json + */ +async function signalRCustomCertificatesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.delete( + resourceGroupName, + resourceName, + certificateName + ); + console.log(result); +} + +signalRCustomCertificatesDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesGetSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesGetSample.ts new file mode 100644 index 000000000000..0177d9b6f8c0 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a custom certificate. + * + * @summary Get a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Get.json + */ +async function signalRCustomCertificatesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.get( + resourceGroupName, + resourceName, + certificateName + ); + console.log(result); +} + +signalRCustomCertificatesGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesListSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesListSample.ts new file mode 100644 index 000000000000..19c883786034 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCustomCertificatesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all custom certificates. + * + * @summary List all custom certificates. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_List.json + */ +async function signalRCustomCertificatesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRCustomCertificates.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRCustomCertificatesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsCreateOrUpdateSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e1003909b1a3 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsCreateOrUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CustomDomain, SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a custom domain. + * + * @summary Create or update a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_CreateOrUpdate.json + */ +async function signalRCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "myDomain"; + const parameters: CustomDomain = { + customCertificate: { + id: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert" + }, + domainName: "example.com" + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + name, + parameters + ); + console.log(result); +} + +signalRCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsDeleteSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsDeleteSample.ts new file mode 100644 index 000000000000..85d3d95d8f91 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a custom domain. + * + * @summary Delete a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Delete.json + */ +async function signalRCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "example"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.beginDeleteAndWait( + resourceGroupName, + resourceName, + name + ); + console.log(result); +} + +signalRCustomDomainsDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsGetSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsGetSample.ts new file mode 100644 index 000000000000..b95d24abe39b --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a custom domain. + * + * @summary Get a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Get.json + */ +async function signalRCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "example"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.get( + resourceGroupName, + resourceName, + name + ); + console.log(result); +} + +signalRCustomDomainsGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsListSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsListSample.ts new file mode 100644 index 000000000000..12b60ffed2f5 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRCustomDomainsListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all custom domains. + * + * @summary List all custom domains. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_List.json + */ +async function signalRCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRCustomDomains.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRCustomDomainsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRDeleteSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRDeleteSample.ts new file mode 100644 index 000000000000..bf4d376b3624 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a resource. + * + * @summary Operation to delete a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Delete.json + */ +async function signalRDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginDeleteAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRGetSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRGetSample.ts new file mode 100644 index 000000000000..51586cc8890b --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRGetSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the resource and its properties. + * + * @summary Get the resource and its properties. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Get.json + */ +async function signalRGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.get(resourceGroupName, resourceName); + console.log(result); +} + +signalRGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRListByResourceGroupSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRListByResourceGroupSample.ts new file mode 100644 index 000000000000..a7a826c93b4a --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRListByResourceGroupSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a resource group. + * + * @summary Handles requests to list all resources in a resource group. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListByResourceGroup.json + */ +async function signalRListByResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalR.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRListByResourceGroup().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRListBySubscriptionSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRListBySubscriptionSample.ts new file mode 100644 index 000000000000..bc7437dfb643 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a subscription. + * + * @summary Handles requests to list all resources in a subscription. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListBySubscription.json + */ +async function signalRListBySubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalR.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +signalRListBySubscription().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRListKeysSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRListKeysSample.ts new file mode 100644 index 000000000000..e672f4d42629 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRListKeysSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the access keys of the resource. + * + * @summary Get the access keys of the resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListKeys.json + */ +async function signalRListKeys() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.listKeys(resourceGroupName, resourceName); + console.log(result); +} + +signalRListKeys().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRListSkusSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRListSkusSample.ts new file mode 100644 index 000000000000..39f1a7fc67e0 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRListSkusSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all available skus of the resource. + * + * @summary List all available skus of the resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListSkus.json + */ +async function signalRListSkus() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.listSkus(resourceGroupName, resourceName); + console.log(result); +} + +signalRListSkus().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsDeleteSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..52e7e2e80d19 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified private endpoint connection + * + * @summary Delete the specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Delete.json + */ +async function signalRPrivateEndpointConnectionsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = + "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.beginDeleteAndWait( + privateEndpointConnectionName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsGetSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..645f513b43ad --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified private endpoint connection + * + * @summary Get the specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Get.json + */ +async function signalRPrivateEndpointConnectionsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = + "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.get( + privateEndpointConnectionName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsListSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsListSample.ts new file mode 100644 index 000000000000..5eca989d5434 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List private endpoint connections + * + * @summary List private endpoint connections + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_List.json + */ +async function signalRPrivateEndpointConnectionsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRPrivateEndpointConnections.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRPrivateEndpointConnectionsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsUpdateSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsUpdateSample.ts new file mode 100644 index 000000000000..175c1d427469 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateEndpointConnectionsUpdateSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PrivateEndpointConnection, + SignalRManagementClient +} from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the state of specified private endpoint connection + * + * @summary Update the state of specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Update.json + */ +async function signalRPrivateEndpointConnectionsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = + "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: PrivateEndpointConnection = { + privateEndpoint: { + id: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint" + }, + privateLinkServiceConnectionState: { + actionsRequired: "None", + status: "Approved" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.update( + privateEndpointConnectionName, + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRPrivateLinkResourcesListSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateLinkResourcesListSample.ts new file mode 100644 index 000000000000..9abbc4e5245c --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRPrivateLinkResourcesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the private link resources that need to be created for a resource. + * + * @summary Get the private link resources that need to be created for a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateLinkResources_List.json + */ +async function signalRPrivateLinkResourcesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRPrivateLinkResources.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRPrivateLinkResourcesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRRegenerateKeySample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRRegenerateKeySample.ts new file mode 100644 index 000000000000..f09271f39823 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRRegenerateKeySample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RegenerateKeyParameters, + SignalRManagementClient +} from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @summary Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_RegenerateKey.json + */ +async function signalRRegenerateKey() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: RegenerateKeyParameters = { keyType: "Primary" }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginRegenerateKeyAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRRegenerateKey().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRRestartSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRRestartSample.ts new file mode 100644 index 000000000000..2ed4aae8b9b7 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRRestartSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to restart a resource. + * + * @summary Operation to restart a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Restart.json + */ +async function signalRRestart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginRestartAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRRestart().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..8d58965f77de --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SharedPrivateLinkResource, + SignalRManagementClient +} from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a shared private link resource + * + * @summary Create or update a shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json + */ +async function signalRSharedPrivateLinkResourcesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: SharedPrivateLinkResource = { + groupId: "sites", + privateLinkResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp", + requestMessage: "Please approve" + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.beginCreateOrUpdateAndWait( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesDeleteSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesDeleteSample.ts new file mode 100644 index 000000000000..5c15e9e7245e --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified shared private link resource + * + * @summary Delete the specified shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Delete.json + */ +async function signalRSharedPrivateLinkResourcesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.beginDeleteAndWait( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesGetSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesGetSample.ts new file mode 100644 index 000000000000..0e162df89185 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified shared private link resource + * + * @summary Get the specified shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Get.json + */ +async function signalRSharedPrivateLinkResourcesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.get( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesListSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesListSample.ts new file mode 100644 index 000000000000..5999447faab7 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRSharedPrivateLinkResourcesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List shared private link resources + * + * @summary List shared private link resources + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_List.json + */ +async function signalRSharedPrivateLinkResourcesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRSharedPrivateLinkResources.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRSharedPrivateLinkResourcesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/signalRUpdateSample.ts b/sdk/signalr/arm-signalr/samples-dev/signalRUpdateSample.ts new file mode 100644 index 000000000000..aff002f3dc7c --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/signalRUpdateSample.ts @@ -0,0 +1,80 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRResource, SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting resource. + * + * @summary Operation to update an exiting resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Update.json + */ +async function signalRUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: SignalRResource = { + cors: { allowedOrigins: ["https://foo.com", "https://bar.com"] }, + disableAadAuth: false, + disableLocalAuth: false, + features: [ + { flag: "ServiceMode", properties: {}, value: "Serverless" }, + { flag: "EnableConnectivityLogs", properties: {}, value: "True" }, + { flag: "EnableMessagingLogs", properties: {}, value: "False" }, + { flag: "EnableLiveTrace", properties: {}, value: "False" } + ], + identity: { type: "SystemAssigned" }, + kind: "SignalR", + liveTraceConfiguration: { + categories: [{ name: "ConnectivityLogs", enabled: "true" }], + enabled: "false" + }, + location: "eastus", + networkACLs: { + defaultAction: "Deny", + privateEndpoints: [ + { + name: "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", + allow: ["ServerConnection"] + } + ], + publicNetwork: { allow: ["ClientConnection"] } + }, + publicNetworkAccess: "Enabled", + sku: { name: "Standard_S1", capacity: 1, tier: "Standard" }, + tags: { key1: "value1" }, + tls: { clientCertEnabled: false }, + upstream: { + templates: [ + { + auth: { + type: "ManagedIdentity", + managedIdentity: { resource: "api://example" } + }, + categoryPattern: "*", + eventPattern: "connect,disconnect", + hubPattern: "*", + urlTemplate: "https://example.com/chat/api/connect" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples-dev/usagesListSample.ts b/sdk/signalr/arm-signalr/samples-dev/usagesListSample.ts new file mode 100644 index 000000000000..5d9682790bc9 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples-dev/usagesListSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List resource usage quotas by location. + * + * @summary List resource usage quotas by location. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Usages_List.json + */ +async function usagesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usages.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usagesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/README.md b/sdk/signalr/arm-signalr/samples/v5/javascript/README.md index 6f39037109cc..b79180c4f1b9 100644 --- a/sdk/signalr/arm-signalr/samples/v5/javascript/README.md +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/README.md @@ -2,30 +2,60 @@ These sample programs show how to use the JavaScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsList.js][operationslist] | Lists all of the available REST API operations of the Microsoft.SignalRService provider. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/Operations_List.json | -| [signalRCheckNameAvailability.js][signalrchecknameavailability] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CheckNameAvailability.json | -| [signalRCreateOrUpdate.js][signalrcreateorupdate] | Create or update a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CreateOrUpdate.json | -| [signalRDelete.js][signalrdelete] | Operation to delete a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Delete.json | -| [signalRGet.js][signalrget] | Get the resource and its properties. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Get.json | -| [signalRListByResourceGroup.js][signalrlistbyresourcegroup] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListByResourceGroup.json | -| [signalRListBySubscription.js][signalrlistbysubscription] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListBySubscription.json | -| [signalRListKeys.js][signalrlistkeys] | Get the access keys of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListKeys.json | -| [signalRListSkus.js][signalrlistskus] | List all available skus of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListSkus.json | -| [signalRPrivateEndpointConnectionsDelete.js][signalrprivateendpointconnectionsdelete] | Delete the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Delete.json | -| [signalRPrivateEndpointConnectionsGet.js][signalrprivateendpointconnectionsget] | Get the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Get.json | -| [signalRPrivateEndpointConnectionsList.js][signalrprivateendpointconnectionslist] | List private endpoint connections x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_List.json | -| [signalRPrivateEndpointConnectionsUpdate.js][signalrprivateendpointconnectionsupdate] | Update the state of specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Update.json | -| [signalRPrivateLinkResourcesList.js][signalrprivatelinkresourceslist] | Get the private link resources that need to be created for a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateLinkResources_List.json | -| [signalRRegenerateKey.js][signalrregeneratekey] | Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_RegenerateKey.json | -| [signalRRestart.js][signalrrestart] | Operation to restart a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Restart.json | -| [signalRSharedPrivateLinkResourcesCreateOrUpdate.js][signalrsharedprivatelinkresourcescreateorupdate] | Create or update a shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json | -| [signalRSharedPrivateLinkResourcesDelete.js][signalrsharedprivatelinkresourcesdelete] | Delete the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Delete.json | -| [signalRSharedPrivateLinkResourcesGet.js][signalrsharedprivatelinkresourcesget] | Get the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Get.json | -| [signalRSharedPrivateLinkResourcesList.js][signalrsharedprivatelinkresourceslist] | List shared private link resources x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_List.json | -| [signalRUpdate.js][signalrupdate] | Operation to update an exiting resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Update.json | -| [usagesList.js][usageslist] | List resource usage quotas by location. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/Usages_List.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [operationsList.js][operationslist] | Lists all of the available REST API operations of the Microsoft.SignalRService provider. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/Operations_List.json | +| [operationsListSample.js][operationslistsample] | Lists all of the available REST API operations of the Microsoft.SignalRService provider. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Operations_List.json | +| [signalRCheckNameAvailability.js][signalrchecknameavailability] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CheckNameAvailability.json | +| [signalRCheckNameAvailabilitySample.js][signalrchecknameavailabilitysample] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CheckNameAvailability.json | +| [signalRCreateOrUpdate.js][signalrcreateorupdate] | Create or update a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CreateOrUpdate.json | +| [signalRCreateOrUpdateSample.js][signalrcreateorupdatesample] | Create or update a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CreateOrUpdate.json | +| [signalRCustomCertificatesCreateOrUpdateSample.js][signalrcustomcertificatescreateorupdatesample] | Create or update a custom certificate. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_CreateOrUpdate.json | +| [signalRCustomCertificatesDeleteSample.js][signalrcustomcertificatesdeletesample] | Delete a custom certificate. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Delete.json | +| [signalRCustomCertificatesGetSample.js][signalrcustomcertificatesgetsample] | Get a custom certificate. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Get.json | +| [signalRCustomCertificatesListSample.js][signalrcustomcertificateslistsample] | List all custom certificates. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_List.json | +| [signalRCustomDomainsCreateOrUpdateSample.js][signalrcustomdomainscreateorupdatesample] | Create or update a custom domain. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_CreateOrUpdate.json | +| [signalRCustomDomainsDeleteSample.js][signalrcustomdomainsdeletesample] | Delete a custom domain. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Delete.json | +| [signalRCustomDomainsGetSample.js][signalrcustomdomainsgetsample] | Get a custom domain. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Get.json | +| [signalRCustomDomainsListSample.js][signalrcustomdomainslistsample] | List all custom domains. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_List.json | +| [signalRDelete.js][signalrdelete] | Operation to delete a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Delete.json | +| [signalRDeleteSample.js][signalrdeletesample] | Operation to delete a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Delete.json | +| [signalRGet.js][signalrget] | Get the resource and its properties. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Get.json | +| [signalRGetSample.js][signalrgetsample] | Get the resource and its properties. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Get.json | +| [signalRListByResourceGroup.js][signalrlistbyresourcegroup] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListByResourceGroup.json | +| [signalRListByResourceGroupSample.js][signalrlistbyresourcegroupsample] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListByResourceGroup.json | +| [signalRListBySubscription.js][signalrlistbysubscription] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListBySubscription.json | +| [signalRListBySubscriptionSample.js][signalrlistbysubscriptionsample] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListBySubscription.json | +| [signalRListKeys.js][signalrlistkeys] | Get the access keys of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListKeys.json | +| [signalRListKeysSample.js][signalrlistkeyssample] | Get the access keys of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListKeys.json | +| [signalRListSkus.js][signalrlistskus] | List all available skus of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListSkus.json | +| [signalRListSkusSample.js][signalrlistskussample] | List all available skus of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListSkus.json | +| [signalRPrivateEndpointConnectionsDelete.js][signalrprivateendpointconnectionsdelete] | Delete the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Delete.json | +| [signalRPrivateEndpointConnectionsDeleteSample.js][signalrprivateendpointconnectionsdeletesample] | Delete the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Delete.json | +| [signalRPrivateEndpointConnectionsGet.js][signalrprivateendpointconnectionsget] | Get the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Get.json | +| [signalRPrivateEndpointConnectionsGetSample.js][signalrprivateendpointconnectionsgetsample] | Get the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Get.json | +| [signalRPrivateEndpointConnectionsList.js][signalrprivateendpointconnectionslist] | List private endpoint connections x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_List.json | +| [signalRPrivateEndpointConnectionsListSample.js][signalrprivateendpointconnectionslistsample] | List private endpoint connections x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_List.json | +| [signalRPrivateEndpointConnectionsUpdate.js][signalrprivateendpointconnectionsupdate] | Update the state of specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Update.json | +| [signalRPrivateEndpointConnectionsUpdateSample.js][signalrprivateendpointconnectionsupdatesample] | Update the state of specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Update.json | +| [signalRPrivateLinkResourcesList.js][signalrprivatelinkresourceslist] | Get the private link resources that need to be created for a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateLinkResources_List.json | +| [signalRPrivateLinkResourcesListSample.js][signalrprivatelinkresourceslistsample] | Get the private link resources that need to be created for a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateLinkResources_List.json | +| [signalRRegenerateKey.js][signalrregeneratekey] | Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_RegenerateKey.json | +| [signalRRegenerateKeySample.js][signalrregeneratekeysample] | Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_RegenerateKey.json | +| [signalRRestart.js][signalrrestart] | Operation to restart a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Restart.json | +| [signalRRestartSample.js][signalrrestartsample] | Operation to restart a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Restart.json | +| [signalRSharedPrivateLinkResourcesCreateOrUpdate.js][signalrsharedprivatelinkresourcescreateorupdate] | Create or update a shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json | +| [signalRSharedPrivateLinkResourcesCreateOrUpdateSample.js][signalrsharedprivatelinkresourcescreateorupdatesample] | Create or update a shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json | +| [signalRSharedPrivateLinkResourcesDelete.js][signalrsharedprivatelinkresourcesdelete] | Delete the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Delete.json | +| [signalRSharedPrivateLinkResourcesDeleteSample.js][signalrsharedprivatelinkresourcesdeletesample] | Delete the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Delete.json | +| [signalRSharedPrivateLinkResourcesGet.js][signalrsharedprivatelinkresourcesget] | Get the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Get.json | +| [signalRSharedPrivateLinkResourcesGetSample.js][signalrsharedprivatelinkresourcesgetsample] | Get the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Get.json | +| [signalRSharedPrivateLinkResourcesList.js][signalrsharedprivatelinkresourceslist] | List shared private link resources x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_List.json | +| [signalRSharedPrivateLinkResourcesListSample.js][signalrsharedprivatelinkresourceslistsample] | List shared private link resources x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_List.json | +| [signalRUpdate.js][signalrupdate] | Operation to update an exiting resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Update.json | +| [signalRUpdateSample.js][signalrupdatesample] | Operation to update an exiting resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Update.json | +| [usagesList.js][usageslist] | List resource usage quotas by location. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/Usages_List.json | +| [usagesListSample.js][usageslistsample] | List resource usage quotas by location. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Usages_List.json | ## Prerequisites @@ -66,27 +96,57 @@ npx cross-env node operationsList.js Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. [operationslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/operationsList.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/operationsListSample.js [signalrchecknameavailability]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCheckNameAvailability.js +[signalrchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCheckNameAvailabilitySample.js [signalrcreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCreateOrUpdate.js +[signalrcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCreateOrUpdateSample.js +[signalrcustomcertificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesCreateOrUpdateSample.js +[signalrcustomcertificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesDeleteSample.js +[signalrcustomcertificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesGetSample.js +[signalrcustomcertificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesListSample.js +[signalrcustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsCreateOrUpdateSample.js +[signalrcustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsDeleteSample.js +[signalrcustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsGetSample.js +[signalrcustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsListSample.js [signalrdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRDelete.js +[signalrdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRDeleteSample.js [signalrget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRGet.js +[signalrgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRGetSample.js [signalrlistbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListByResourceGroup.js +[signalrlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListByResourceGroupSample.js [signalrlistbysubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListBySubscription.js +[signalrlistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListBySubscriptionSample.js [signalrlistkeys]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListKeys.js +[signalrlistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListKeysSample.js [signalrlistskus]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListSkus.js +[signalrlistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListSkusSample.js [signalrprivateendpointconnectionsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsDelete.js +[signalrprivateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsDeleteSample.js [signalrprivateendpointconnectionsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsGet.js +[signalrprivateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsGetSample.js [signalrprivateendpointconnectionslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsList.js +[signalrprivateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsListSample.js [signalrprivateendpointconnectionsupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsUpdate.js +[signalrprivateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsUpdateSample.js [signalrprivatelinkresourceslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateLinkResourcesList.js +[signalrprivatelinkresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateLinkResourcesListSample.js [signalrregeneratekey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRegenerateKey.js +[signalrregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRegenerateKeySample.js [signalrrestart]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRestart.js +[signalrrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRestartSample.js [signalrsharedprivatelinkresourcescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesCreateOrUpdate.js +[signalrsharedprivatelinkresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.js [signalrsharedprivatelinkresourcesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesDelete.js +[signalrsharedprivatelinkresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesDeleteSample.js [signalrsharedprivatelinkresourcesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesGet.js +[signalrsharedprivatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesGetSample.js [signalrsharedprivatelinkresourceslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesList.js +[signalrsharedprivatelinkresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesListSample.js [signalrupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRUpdate.js +[signalrupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/signalRUpdateSample.js [usageslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/usagesList.js +[usageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/javascript/usagesListSample.js [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-signalr?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/signalr/arm-signalr/README.md diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/operationsListSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/operationsListSample.js new file mode 100644 index 000000000000..c09b92b3d65a --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/operationsListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Operations_List.json + */ +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCheckNameAvailabilitySample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCheckNameAvailabilitySample.js new file mode 100644 index 000000000000..cd93e41d7c8b --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCheckNameAvailabilitySample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Checks that the resource name is valid and is not already in use. + * + * @summary Checks that the resource name is valid and is not already in use. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CheckNameAvailability.json + */ +async function signalRCheckNameAvailability() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const parameters = { + name: "mySignalRService", + type: "Microsoft.SignalRService/SignalR", + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.checkNameAvailability(location, parameters); + console.log(result); +} + +signalRCheckNameAvailability().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCreateOrUpdateSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCreateOrUpdateSample.js new file mode 100644 index 000000000000..797addf484f9 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCreateOrUpdateSample.js @@ -0,0 +1,80 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a resource. + * + * @summary Create or update a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CreateOrUpdate.json + */ +async function signalRCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters = { + cors: { allowedOrigins: ["https://foo.com", "https://bar.com"] }, + disableAadAuth: false, + disableLocalAuth: false, + features: [ + { flag: "ServiceMode", properties: {}, value: "Serverless" }, + { flag: "EnableConnectivityLogs", properties: {}, value: "True" }, + { flag: "EnableMessagingLogs", properties: {}, value: "False" }, + { flag: "EnableLiveTrace", properties: {}, value: "False" }, + ], + identity: { type: "SystemAssigned" }, + kind: "SignalR", + liveTraceConfiguration: { + categories: [{ name: "ConnectivityLogs", enabled: "true" }], + enabled: "false", + }, + location: "eastus", + networkACLs: { + defaultAction: "Deny", + privateEndpoints: [ + { + name: "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", + allow: ["ServerConnection"], + }, + ], + publicNetwork: { allow: ["ClientConnection"] }, + }, + publicNetworkAccess: "Enabled", + sku: { name: "Standard_S1", capacity: 1, tier: "Standard" }, + tags: { key1: "value1" }, + tls: { clientCertEnabled: false }, + upstream: { + templates: [ + { + auth: { + type: "ManagedIdentity", + managedIdentity: { resource: "api://example" }, + }, + categoryPattern: "*", + eventPattern: "connect,disconnect", + hubPattern: "*", + urlTemplate: "https://example.com/chat/api/connect", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesCreateOrUpdateSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesCreateOrUpdateSample.js new file mode 100644 index 000000000000..30ae3a707ba7 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesCreateOrUpdateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a custom certificate. + * + * @summary Create or update a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_CreateOrUpdate.json + */ +async function signalRCustomCertificatesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const parameters = { + keyVaultBaseUri: "https://myvault.keyvault.azure.net/", + keyVaultSecretName: "mycert", + keyVaultSecretVersion: "bb6a44b2743f47f68dad0d6cc9756432", + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + certificateName, + parameters + ); + console.log(result); +} + +signalRCustomCertificatesCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesDeleteSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesDeleteSample.js new file mode 100644 index 000000000000..ec4f8f5d0209 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a custom certificate. + * + * @summary Delete a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Delete.json + */ +async function signalRCustomCertificatesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.delete( + resourceGroupName, + resourceName, + certificateName + ); + console.log(result); +} + +signalRCustomCertificatesDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesGetSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesGetSample.js new file mode 100644 index 000000000000..dd5e37e3f5ea --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a custom certificate. + * + * @summary Get a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Get.json + */ +async function signalRCustomCertificatesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.get( + resourceGroupName, + resourceName, + certificateName + ); + console.log(result); +} + +signalRCustomCertificatesGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesListSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesListSample.js new file mode 100644 index 000000000000..70b643837138 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomCertificatesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all custom certificates. + * + * @summary List all custom certificates. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_List.json + */ +async function signalRCustomCertificatesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRCustomCertificates.list(resourceGroupName, resourceName)) { + resArray.push(item); + } + console.log(resArray); +} + +signalRCustomCertificatesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsCreateOrUpdateSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsCreateOrUpdateSample.js new file mode 100644 index 000000000000..e95c3cdac05d --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsCreateOrUpdateSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a custom domain. + * + * @summary Create or update a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_CreateOrUpdate.json + */ +async function signalRCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "myDomain"; + const parameters = { + customCertificate: { + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert", + }, + domainName: "example.com", + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + name, + parameters + ); + console.log(result); +} + +signalRCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsDeleteSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsDeleteSample.js new file mode 100644 index 000000000000..ab555dedb4c7 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a custom domain. + * + * @summary Delete a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Delete.json + */ +async function signalRCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "example"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.beginDeleteAndWait( + resourceGroupName, + resourceName, + name + ); + console.log(result); +} + +signalRCustomDomainsDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsGetSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsGetSample.js new file mode 100644 index 000000000000..90790d23cccb --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a custom domain. + * + * @summary Get a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Get.json + */ +async function signalRCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "example"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.get(resourceGroupName, resourceName, name); + console.log(result); +} + +signalRCustomDomainsGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsListSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsListSample.js new file mode 100644 index 000000000000..e83f7861aa2f --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRCustomDomainsListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all custom domains. + * + * @summary List all custom domains. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_List.json + */ +async function signalRCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRCustomDomains.list(resourceGroupName, resourceName)) { + resArray.push(item); + } + console.log(resArray); +} + +signalRCustomDomainsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRDeleteSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRDeleteSample.js new file mode 100644 index 000000000000..6f9b593ebe4a --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRDeleteSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a resource. + * + * @summary Operation to delete a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Delete.json + */ +async function signalRDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginDeleteAndWait(resourceGroupName, resourceName); + console.log(result); +} + +signalRDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRGetSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRGetSample.js new file mode 100644 index 000000000000..05c5cb1bc505 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRGetSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the resource and its properties. + * + * @summary Get the resource and its properties. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Get.json + */ +async function signalRGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.get(resourceGroupName, resourceName); + console.log(result); +} + +signalRGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListByResourceGroupSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListByResourceGroupSample.js new file mode 100644 index 000000000000..d18acdbba16b --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a resource group. + * + * @summary Handles requests to list all resources in a resource group. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListByResourceGroup.json + */ +async function signalRListByResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalR.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +signalRListByResourceGroup().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListBySubscriptionSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListBySubscriptionSample.js new file mode 100644 index 000000000000..f1d71a15ed2f --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListBySubscriptionSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a subscription. + * + * @summary Handles requests to list all resources in a subscription. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListBySubscription.json + */ +async function signalRListBySubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalR.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +signalRListBySubscription().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListKeysSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListKeysSample.js new file mode 100644 index 000000000000..350148bc4e01 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListKeysSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the access keys of the resource. + * + * @summary Get the access keys of the resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListKeys.json + */ +async function signalRListKeys() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.listKeys(resourceGroupName, resourceName); + console.log(result); +} + +signalRListKeys().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListSkusSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListSkusSample.js new file mode 100644 index 000000000000..e3d8647964bd --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRListSkusSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all available skus of the resource. + * + * @summary List all available skus of the resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListSkus.json + */ +async function signalRListSkus() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.listSkus(resourceGroupName, resourceName); + console.log(result); +} + +signalRListSkus().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsDeleteSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..ac619a4ec47c --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the specified private endpoint connection + * + * @summary Delete the specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Delete.json + */ +async function signalRPrivateEndpointConnectionsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.beginDeleteAndWait( + privateEndpointConnectionName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsGetSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..ec6372cb08b8 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the specified private endpoint connection + * + * @summary Get the specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Get.json + */ +async function signalRPrivateEndpointConnectionsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.get( + privateEndpointConnectionName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsListSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsListSample.js new file mode 100644 index 000000000000..623d36a3299f --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsListSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List private endpoint connections + * + * @summary List private endpoint connections + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_List.json + */ +async function signalRPrivateEndpointConnectionsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRPrivateEndpointConnections.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRPrivateEndpointConnectionsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsUpdateSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsUpdateSample.js new file mode 100644 index 000000000000..6851888805da --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateEndpointConnectionsUpdateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the state of specified private endpoint connection + * + * @summary Update the state of specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Update.json + */ +async function signalRPrivateEndpointConnectionsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters = { + privateEndpoint: { + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint", + }, + privateLinkServiceConnectionState: { + actionsRequired: "None", + status: "Approved", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.update( + privateEndpointConnectionName, + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateLinkResourcesListSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateLinkResourcesListSample.js new file mode 100644 index 000000000000..a258d29da10c --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRPrivateLinkResourcesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the private link resources that need to be created for a resource. + * + * @summary Get the private link resources that need to be created for a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateLinkResources_List.json + */ +async function signalRPrivateLinkResourcesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRPrivateLinkResources.list(resourceGroupName, resourceName)) { + resArray.push(item); + } + console.log(resArray); +} + +signalRPrivateLinkResourcesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRegenerateKeySample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRegenerateKeySample.js new file mode 100644 index 000000000000..a534ef414a89 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRegenerateKeySample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @summary Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_RegenerateKey.json + */ +async function signalRRegenerateKey() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters = { keyType: "Primary" }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginRegenerateKeyAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRRegenerateKey().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRestartSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRestartSample.js new file mode 100644 index 000000000000..a6eb5e022a45 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRRestartSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to restart a resource. + * + * @summary Operation to restart a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Restart.json + */ +async function signalRRestart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginRestartAndWait(resourceGroupName, resourceName); + console.log(result); +} + +signalRRestart().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.js new file mode 100644 index 000000000000..0f732f3e7e11 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a shared private link resource + * + * @summary Create or update a shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json + */ +async function signalRSharedPrivateLinkResourcesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters = { + groupId: "sites", + privateLinkResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp", + requestMessage: "Please approve", + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.beginCreateOrUpdateAndWait( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesDeleteSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesDeleteSample.js new file mode 100644 index 000000000000..318c4e0bcbb6 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the specified shared private link resource + * + * @summary Delete the specified shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Delete.json + */ +async function signalRSharedPrivateLinkResourcesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.beginDeleteAndWait( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesGetSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesGetSample.js new file mode 100644 index 000000000000..38a59d70a413 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the specified shared private link resource + * + * @summary Get the specified shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Get.json + */ +async function signalRSharedPrivateLinkResourcesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.get( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesListSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesListSample.js new file mode 100644 index 000000000000..cd380394c8f3 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRSharedPrivateLinkResourcesListSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List shared private link resources + * + * @summary List shared private link resources + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_List.json + */ +async function signalRSharedPrivateLinkResourcesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRSharedPrivateLinkResources.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRSharedPrivateLinkResourcesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/signalRUpdateSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRUpdateSample.js new file mode 100644 index 000000000000..1c874a430f6c --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/signalRUpdateSample.js @@ -0,0 +1,80 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting resource. + * + * @summary Operation to update an exiting resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Update.json + */ +async function signalRUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters = { + cors: { allowedOrigins: ["https://foo.com", "https://bar.com"] }, + disableAadAuth: false, + disableLocalAuth: false, + features: [ + { flag: "ServiceMode", properties: {}, value: "Serverless" }, + { flag: "EnableConnectivityLogs", properties: {}, value: "True" }, + { flag: "EnableMessagingLogs", properties: {}, value: "False" }, + { flag: "EnableLiveTrace", properties: {}, value: "False" }, + ], + identity: { type: "SystemAssigned" }, + kind: "SignalR", + liveTraceConfiguration: { + categories: [{ name: "ConnectivityLogs", enabled: "true" }], + enabled: "false", + }, + location: "eastus", + networkACLs: { + defaultAction: "Deny", + privateEndpoints: [ + { + name: "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", + allow: ["ServerConnection"], + }, + ], + publicNetwork: { allow: ["ClientConnection"] }, + }, + publicNetworkAccess: "Enabled", + sku: { name: "Standard_S1", capacity: 1, tier: "Standard" }, + tags: { key1: "value1" }, + tls: { clientCertEnabled: false }, + upstream: { + templates: [ + { + auth: { + type: "ManagedIdentity", + managedIdentity: { resource: "api://example" }, + }, + categoryPattern: "*", + eventPattern: "connect,disconnect", + hubPattern: "*", + urlTemplate: "https://example.com/chat/api/connect", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/javascript/usagesListSample.js b/sdk/signalr/arm-signalr/samples/v5/javascript/usagesListSample.js new file mode 100644 index 000000000000..44e797ca171e --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/javascript/usagesListSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SignalRManagementClient } = require("@azure/arm-signalr"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List resource usage quotas by location. + * + * @summary List resource usage quotas by location. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Usages_List.json + */ +async function usagesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usages.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usagesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/README.md b/sdk/signalr/arm-signalr/samples/v5/typescript/README.md index 5360837114b5..a2e81901d711 100644 --- a/sdk/signalr/arm-signalr/samples/v5/typescript/README.md +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/README.md @@ -2,30 +2,60 @@ These sample programs show how to use the TypeScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsList.ts][operationslist] | Lists all of the available REST API operations of the Microsoft.SignalRService provider. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/Operations_List.json | -| [signalRCheckNameAvailability.ts][signalrchecknameavailability] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CheckNameAvailability.json | -| [signalRCreateOrUpdate.ts][signalrcreateorupdate] | Create or update a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CreateOrUpdate.json | -| [signalRDelete.ts][signalrdelete] | Operation to delete a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Delete.json | -| [signalRGet.ts][signalrget] | Get the resource and its properties. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Get.json | -| [signalRListByResourceGroup.ts][signalrlistbyresourcegroup] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListByResourceGroup.json | -| [signalRListBySubscription.ts][signalrlistbysubscription] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListBySubscription.json | -| [signalRListKeys.ts][signalrlistkeys] | Get the access keys of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListKeys.json | -| [signalRListSkus.ts][signalrlistskus] | List all available skus of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListSkus.json | -| [signalRPrivateEndpointConnectionsDelete.ts][signalrprivateendpointconnectionsdelete] | Delete the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Delete.json | -| [signalRPrivateEndpointConnectionsGet.ts][signalrprivateendpointconnectionsget] | Get the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Get.json | -| [signalRPrivateEndpointConnectionsList.ts][signalrprivateendpointconnectionslist] | List private endpoint connections x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_List.json | -| [signalRPrivateEndpointConnectionsUpdate.ts][signalrprivateendpointconnectionsupdate] | Update the state of specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Update.json | -| [signalRPrivateLinkResourcesList.ts][signalrprivatelinkresourceslist] | Get the private link resources that need to be created for a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateLinkResources_List.json | -| [signalRRegenerateKey.ts][signalrregeneratekey] | Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_RegenerateKey.json | -| [signalRRestart.ts][signalrrestart] | Operation to restart a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Restart.json | -| [signalRSharedPrivateLinkResourcesCreateOrUpdate.ts][signalrsharedprivatelinkresourcescreateorupdate] | Create or update a shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json | -| [signalRSharedPrivateLinkResourcesDelete.ts][signalrsharedprivatelinkresourcesdelete] | Delete the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Delete.json | -| [signalRSharedPrivateLinkResourcesGet.ts][signalrsharedprivatelinkresourcesget] | Get the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Get.json | -| [signalRSharedPrivateLinkResourcesList.ts][signalrsharedprivatelinkresourceslist] | List shared private link resources x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_List.json | -| [signalRUpdate.ts][signalrupdate] | Operation to update an exiting resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Update.json | -| [usagesList.ts][usageslist] | List resource usage quotas by location. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/Usages_List.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [operationsList.ts][operationslist] | Lists all of the available REST API operations of the Microsoft.SignalRService provider. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/Operations_List.json | +| [operationsListSample.ts][operationslistsample] | Lists all of the available REST API operations of the Microsoft.SignalRService provider. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Operations_List.json | +| [signalRCheckNameAvailability.ts][signalrchecknameavailability] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CheckNameAvailability.json | +| [signalRCheckNameAvailabilitySample.ts][signalrchecknameavailabilitysample] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CheckNameAvailability.json | +| [signalRCreateOrUpdate.ts][signalrcreateorupdate] | Create or update a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CreateOrUpdate.json | +| [signalRCreateOrUpdateSample.ts][signalrcreateorupdatesample] | Create or update a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CreateOrUpdate.json | +| [signalRCustomCertificatesCreateOrUpdateSample.ts][signalrcustomcertificatescreateorupdatesample] | Create or update a custom certificate. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_CreateOrUpdate.json | +| [signalRCustomCertificatesDeleteSample.ts][signalrcustomcertificatesdeletesample] | Delete a custom certificate. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Delete.json | +| [signalRCustomCertificatesGetSample.ts][signalrcustomcertificatesgetsample] | Get a custom certificate. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Get.json | +| [signalRCustomCertificatesListSample.ts][signalrcustomcertificateslistsample] | List all custom certificates. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_List.json | +| [signalRCustomDomainsCreateOrUpdateSample.ts][signalrcustomdomainscreateorupdatesample] | Create or update a custom domain. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_CreateOrUpdate.json | +| [signalRCustomDomainsDeleteSample.ts][signalrcustomdomainsdeletesample] | Delete a custom domain. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Delete.json | +| [signalRCustomDomainsGetSample.ts][signalrcustomdomainsgetsample] | Get a custom domain. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Get.json | +| [signalRCustomDomainsListSample.ts][signalrcustomdomainslistsample] | List all custom domains. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_List.json | +| [signalRDelete.ts][signalrdelete] | Operation to delete a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Delete.json | +| [signalRDeleteSample.ts][signalrdeletesample] | Operation to delete a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Delete.json | +| [signalRGet.ts][signalrget] | Get the resource and its properties. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Get.json | +| [signalRGetSample.ts][signalrgetsample] | Get the resource and its properties. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Get.json | +| [signalRListByResourceGroup.ts][signalrlistbyresourcegroup] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListByResourceGroup.json | +| [signalRListByResourceGroupSample.ts][signalrlistbyresourcegroupsample] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListByResourceGroup.json | +| [signalRListBySubscription.ts][signalrlistbysubscription] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListBySubscription.json | +| [signalRListBySubscriptionSample.ts][signalrlistbysubscriptionsample] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListBySubscription.json | +| [signalRListKeys.ts][signalrlistkeys] | Get the access keys of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListKeys.json | +| [signalRListKeysSample.ts][signalrlistkeyssample] | Get the access keys of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListKeys.json | +| [signalRListSkus.ts][signalrlistskus] | List all available skus of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListSkus.json | +| [signalRListSkusSample.ts][signalrlistskussample] | List all available skus of the resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListSkus.json | +| [signalRPrivateEndpointConnectionsDelete.ts][signalrprivateendpointconnectionsdelete] | Delete the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Delete.json | +| [signalRPrivateEndpointConnectionsDeleteSample.ts][signalrprivateendpointconnectionsdeletesample] | Delete the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Delete.json | +| [signalRPrivateEndpointConnectionsGet.ts][signalrprivateendpointconnectionsget] | Get the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Get.json | +| [signalRPrivateEndpointConnectionsGetSample.ts][signalrprivateendpointconnectionsgetsample] | Get the specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Get.json | +| [signalRPrivateEndpointConnectionsList.ts][signalrprivateendpointconnectionslist] | List private endpoint connections x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_List.json | +| [signalRPrivateEndpointConnectionsListSample.ts][signalrprivateendpointconnectionslistsample] | List private endpoint connections x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_List.json | +| [signalRPrivateEndpointConnectionsUpdate.ts][signalrprivateendpointconnectionsupdate] | Update the state of specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Update.json | +| [signalRPrivateEndpointConnectionsUpdateSample.ts][signalrprivateendpointconnectionsupdatesample] | Update the state of specified private endpoint connection x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Update.json | +| [signalRPrivateLinkResourcesList.ts][signalrprivatelinkresourceslist] | Get the private link resources that need to be created for a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateLinkResources_List.json | +| [signalRPrivateLinkResourcesListSample.ts][signalrprivatelinkresourceslistsample] | Get the private link resources that need to be created for a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateLinkResources_List.json | +| [signalRRegenerateKey.ts][signalrregeneratekey] | Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_RegenerateKey.json | +| [signalRRegenerateKeySample.ts][signalrregeneratekeysample] | Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_RegenerateKey.json | +| [signalRRestart.ts][signalrrestart] | Operation to restart a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Restart.json | +| [signalRRestartSample.ts][signalrrestartsample] | Operation to restart a resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Restart.json | +| [signalRSharedPrivateLinkResourcesCreateOrUpdate.ts][signalrsharedprivatelinkresourcescreateorupdate] | Create or update a shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json | +| [signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts][signalrsharedprivatelinkresourcescreateorupdatesample] | Create or update a shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json | +| [signalRSharedPrivateLinkResourcesDelete.ts][signalrsharedprivatelinkresourcesdelete] | Delete the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Delete.json | +| [signalRSharedPrivateLinkResourcesDeleteSample.ts][signalrsharedprivatelinkresourcesdeletesample] | Delete the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Delete.json | +| [signalRSharedPrivateLinkResourcesGet.ts][signalrsharedprivatelinkresourcesget] | Get the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Get.json | +| [signalRSharedPrivateLinkResourcesGetSample.ts][signalrsharedprivatelinkresourcesgetsample] | Get the specified shared private link resource x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Get.json | +| [signalRSharedPrivateLinkResourcesList.ts][signalrsharedprivatelinkresourceslist] | List shared private link resources x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_List.json | +| [signalRSharedPrivateLinkResourcesListSample.ts][signalrsharedprivatelinkresourceslistsample] | List shared private link resources x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_List.json | +| [signalRUpdate.ts][signalrupdate] | Operation to update an exiting resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Update.json | +| [signalRUpdateSample.ts][signalrupdatesample] | Operation to update an exiting resource. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Update.json | +| [usagesList.ts][usageslist] | List resource usage quotas by location. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/Usages_List.json | +| [usagesListSample.ts][usageslistsample] | List resource usage quotas by location. x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Usages_List.json | ## Prerequisites @@ -78,27 +108,57 @@ npx cross-env node dist/operationsList.js Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. [operationslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/operationsList.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/operationsListSample.ts [signalrchecknameavailability]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCheckNameAvailability.ts +[signalrchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCheckNameAvailabilitySample.ts [signalrcreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCreateOrUpdate.ts +[signalrcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCreateOrUpdateSample.ts +[signalrcustomcertificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesCreateOrUpdateSample.ts +[signalrcustomcertificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesDeleteSample.ts +[signalrcustomcertificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesGetSample.ts +[signalrcustomcertificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesListSample.ts +[signalrcustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsCreateOrUpdateSample.ts +[signalrcustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsDeleteSample.ts +[signalrcustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsGetSample.ts +[signalrcustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsListSample.ts [signalrdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRDelete.ts +[signalrdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRDeleteSample.ts [signalrget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRGet.ts +[signalrgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRGetSample.ts [signalrlistbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListByResourceGroup.ts +[signalrlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListByResourceGroupSample.ts [signalrlistbysubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListBySubscription.ts +[signalrlistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListBySubscriptionSample.ts [signalrlistkeys]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListKeys.ts +[signalrlistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListKeysSample.ts [signalrlistskus]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListSkus.ts +[signalrlistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListSkusSample.ts [signalrprivateendpointconnectionsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsDelete.ts +[signalrprivateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsDeleteSample.ts [signalrprivateendpointconnectionsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsGet.ts +[signalrprivateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsGetSample.ts [signalrprivateendpointconnectionslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsList.ts +[signalrprivateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsListSample.ts [signalrprivateendpointconnectionsupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsUpdate.ts +[signalrprivateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsUpdateSample.ts [signalrprivatelinkresourceslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateLinkResourcesList.ts +[signalrprivatelinkresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateLinkResourcesListSample.ts [signalrregeneratekey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRegenerateKey.ts +[signalrregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRegenerateKeySample.ts [signalrrestart]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRestart.ts +[signalrrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRestartSample.ts [signalrsharedprivatelinkresourcescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesCreateOrUpdate.ts +[signalrsharedprivatelinkresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts [signalrsharedprivatelinkresourcesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesDelete.ts +[signalrsharedprivatelinkresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesDeleteSample.ts [signalrsharedprivatelinkresourcesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesGet.ts +[signalrsharedprivatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesGetSample.ts [signalrsharedprivatelinkresourceslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesList.ts +[signalrsharedprivatelinkresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesListSample.ts [signalrupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRUpdate.ts +[signalrupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRUpdateSample.ts [usageslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/usagesList.ts +[usageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/signalr/arm-signalr/samples/v5/typescript/src/usagesListSample.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-signalr?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/signalr/arm-signalr/README.md diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/operationsListSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..e56024da6166 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Operations_List.json + */ +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCheckNameAvailabilitySample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..71233ed48e94 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCheckNameAvailabilitySample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + NameAvailabilityParameters, + SignalRManagementClient +} from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Checks that the resource name is valid and is not already in use. + * + * @summary Checks that the resource name is valid and is not already in use. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CheckNameAvailability.json + */ +async function signalRCheckNameAvailability() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const parameters: NameAvailabilityParameters = { + name: "mySignalRService", + type: "Microsoft.SignalRService/SignalR" + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.checkNameAvailability( + location, + parameters + ); + console.log(result); +} + +signalRCheckNameAvailability().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCreateOrUpdateSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ef4462c658e6 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCreateOrUpdateSample.ts @@ -0,0 +1,80 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRResource, SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a resource. + * + * @summary Create or update a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_CreateOrUpdate.json + */ +async function signalRCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: SignalRResource = { + cors: { allowedOrigins: ["https://foo.com", "https://bar.com"] }, + disableAadAuth: false, + disableLocalAuth: false, + features: [ + { flag: "ServiceMode", properties: {}, value: "Serverless" }, + { flag: "EnableConnectivityLogs", properties: {}, value: "True" }, + { flag: "EnableMessagingLogs", properties: {}, value: "False" }, + { flag: "EnableLiveTrace", properties: {}, value: "False" } + ], + identity: { type: "SystemAssigned" }, + kind: "SignalR", + liveTraceConfiguration: { + categories: [{ name: "ConnectivityLogs", enabled: "true" }], + enabled: "false" + }, + location: "eastus", + networkACLs: { + defaultAction: "Deny", + privateEndpoints: [ + { + name: "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", + allow: ["ServerConnection"] + } + ], + publicNetwork: { allow: ["ClientConnection"] } + }, + publicNetworkAccess: "Enabled", + sku: { name: "Standard_S1", capacity: 1, tier: "Standard" }, + tags: { key1: "value1" }, + tls: { clientCertEnabled: false }, + upstream: { + templates: [ + { + auth: { + type: "ManagedIdentity", + managedIdentity: { resource: "api://example" } + }, + categoryPattern: "*", + eventPattern: "connect,disconnect", + hubPattern: "*", + urlTemplate: "https://example.com/chat/api/connect" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesCreateOrUpdateSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e951592469ee --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesCreateOrUpdateSample.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CustomCertificate, SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a custom certificate. + * + * @summary Create or update a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_CreateOrUpdate.json + */ +async function signalRCustomCertificatesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const parameters: CustomCertificate = { + keyVaultBaseUri: "https://myvault.keyvault.azure.net/", + keyVaultSecretName: "mycert", + keyVaultSecretVersion: "bb6a44b2743f47f68dad0d6cc9756432" + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + certificateName, + parameters + ); + console.log(result); +} + +signalRCustomCertificatesCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesDeleteSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesDeleteSample.ts new file mode 100644 index 000000000000..f4e4de873ad9 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a custom certificate. + * + * @summary Delete a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Delete.json + */ +async function signalRCustomCertificatesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.delete( + resourceGroupName, + resourceName, + certificateName + ); + console.log(result); +} + +signalRCustomCertificatesDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesGetSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesGetSample.ts new file mode 100644 index 000000000000..0177d9b6f8c0 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a custom certificate. + * + * @summary Get a custom certificate. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_Get.json + */ +async function signalRCustomCertificatesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const certificateName = "myCert"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomCertificates.get( + resourceGroupName, + resourceName, + certificateName + ); + console.log(result); +} + +signalRCustomCertificatesGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesListSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesListSample.ts new file mode 100644 index 000000000000..19c883786034 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomCertificatesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all custom certificates. + * + * @summary List all custom certificates. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomCertificates_List.json + */ +async function signalRCustomCertificatesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRCustomCertificates.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRCustomCertificatesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsCreateOrUpdateSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e1003909b1a3 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsCreateOrUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CustomDomain, SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a custom domain. + * + * @summary Create or update a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_CreateOrUpdate.json + */ +async function signalRCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "myDomain"; + const parameters: CustomDomain = { + customCertificate: { + id: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert" + }, + domainName: "example.com" + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + name, + parameters + ); + console.log(result); +} + +signalRCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsDeleteSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsDeleteSample.ts new file mode 100644 index 000000000000..85d3d95d8f91 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a custom domain. + * + * @summary Delete a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Delete.json + */ +async function signalRCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "example"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.beginDeleteAndWait( + resourceGroupName, + resourceName, + name + ); + console.log(result); +} + +signalRCustomDomainsDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsGetSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsGetSample.ts new file mode 100644 index 000000000000..b95d24abe39b --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a custom domain. + * + * @summary Get a custom domain. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_Get.json + */ +async function signalRCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const name = "example"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRCustomDomains.get( + resourceGroupName, + resourceName, + name + ); + console.log(result); +} + +signalRCustomDomainsGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsListSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsListSample.ts new file mode 100644 index 000000000000..12b60ffed2f5 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRCustomDomainsListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all custom domains. + * + * @summary List all custom domains. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRCustomDomains_List.json + */ +async function signalRCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRCustomDomains.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRCustomDomainsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRDeleteSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRDeleteSample.ts new file mode 100644 index 000000000000..bf4d376b3624 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a resource. + * + * @summary Operation to delete a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Delete.json + */ +async function signalRDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginDeleteAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRGetSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRGetSample.ts new file mode 100644 index 000000000000..51586cc8890b --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRGetSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the resource and its properties. + * + * @summary Get the resource and its properties. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Get.json + */ +async function signalRGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.get(resourceGroupName, resourceName); + console.log(result); +} + +signalRGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListByResourceGroupSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListByResourceGroupSample.ts new file mode 100644 index 000000000000..a7a826c93b4a --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListByResourceGroupSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a resource group. + * + * @summary Handles requests to list all resources in a resource group. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListByResourceGroup.json + */ +async function signalRListByResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalR.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRListByResourceGroup().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListBySubscriptionSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListBySubscriptionSample.ts new file mode 100644 index 000000000000..bc7437dfb643 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a subscription. + * + * @summary Handles requests to list all resources in a subscription. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListBySubscription.json + */ +async function signalRListBySubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalR.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +signalRListBySubscription().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListKeysSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListKeysSample.ts new file mode 100644 index 000000000000..e672f4d42629 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListKeysSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the access keys of the resource. + * + * @summary Get the access keys of the resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListKeys.json + */ +async function signalRListKeys() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.listKeys(resourceGroupName, resourceName); + console.log(result); +} + +signalRListKeys().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListSkusSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListSkusSample.ts new file mode 100644 index 000000000000..39f1a7fc67e0 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRListSkusSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all available skus of the resource. + * + * @summary List all available skus of the resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_ListSkus.json + */ +async function signalRListSkus() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.listSkus(resourceGroupName, resourceName); + console.log(result); +} + +signalRListSkus().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsDeleteSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..52e7e2e80d19 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified private endpoint connection + * + * @summary Delete the specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Delete.json + */ +async function signalRPrivateEndpointConnectionsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = + "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.beginDeleteAndWait( + privateEndpointConnectionName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsGetSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..645f513b43ad --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified private endpoint connection + * + * @summary Get the specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Get.json + */ +async function signalRPrivateEndpointConnectionsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = + "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.get( + privateEndpointConnectionName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsListSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsListSample.ts new file mode 100644 index 000000000000..5eca989d5434 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List private endpoint connections + * + * @summary List private endpoint connections + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_List.json + */ +async function signalRPrivateEndpointConnectionsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRPrivateEndpointConnections.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRPrivateEndpointConnectionsList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsUpdateSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsUpdateSample.ts new file mode 100644 index 000000000000..175c1d427469 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateEndpointConnectionsUpdateSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PrivateEndpointConnection, + SignalRManagementClient +} from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the state of specified private endpoint connection + * + * @summary Update the state of specified private endpoint connection + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateEndpointConnections_Update.json + */ +async function signalRPrivateEndpointConnectionsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const privateEndpointConnectionName = + "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: PrivateEndpointConnection = { + privateEndpoint: { + id: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint" + }, + privateLinkServiceConnectionState: { + actionsRequired: "None", + status: "Approved" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRPrivateEndpointConnections.update( + privateEndpointConnectionName, + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRPrivateEndpointConnectionsUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateLinkResourcesListSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateLinkResourcesListSample.ts new file mode 100644 index 000000000000..9abbc4e5245c --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRPrivateLinkResourcesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the private link resources that need to be created for a resource. + * + * @summary Get the private link resources that need to be created for a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRPrivateLinkResources_List.json + */ +async function signalRPrivateLinkResourcesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRPrivateLinkResources.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRPrivateLinkResourcesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRegenerateKeySample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRegenerateKeySample.ts new file mode 100644 index 000000000000..f09271f39823 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRegenerateKeySample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RegenerateKeyParameters, + SignalRManagementClient +} from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @summary Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_RegenerateKey.json + */ +async function signalRRegenerateKey() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: RegenerateKeyParameters = { keyType: "Primary" }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginRegenerateKeyAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRRegenerateKey().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRestartSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRestartSample.ts new file mode 100644 index 000000000000..2ed4aae8b9b7 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRRestartSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to restart a resource. + * + * @summary Operation to restart a resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Restart.json + */ +async function signalRRestart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginRestartAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRRestart().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..8d58965f77de --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SharedPrivateLinkResource, + SignalRManagementClient +} from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a shared private link resource + * + * @summary Create or update a shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json + */ +async function signalRSharedPrivateLinkResourcesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: SharedPrivateLinkResource = { + groupId: "sites", + privateLinkResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp", + requestMessage: "Please approve" + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.beginCreateOrUpdateAndWait( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesCreateOrUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesDeleteSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesDeleteSample.ts new file mode 100644 index 000000000000..5c15e9e7245e --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified shared private link resource + * + * @summary Delete the specified shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Delete.json + */ +async function signalRSharedPrivateLinkResourcesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.beginDeleteAndWait( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesDelete().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesGetSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesGetSample.ts new file mode 100644 index 000000000000..0e162df89185 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified shared private link resource + * + * @summary Get the specified shared private link resource + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_Get.json + */ +async function signalRSharedPrivateLinkResourcesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const sharedPrivateLinkResourceName = "upstream"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalRSharedPrivateLinkResources.get( + sharedPrivateLinkResourceName, + resourceGroupName, + resourceName + ); + console.log(result); +} + +signalRSharedPrivateLinkResourcesGet().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesListSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesListSample.ts new file mode 100644 index 000000000000..5999447faab7 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRSharedPrivateLinkResourcesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List shared private link resources + * + * @summary List shared private link resources + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalRSharedPrivateLinkResources_List.json + */ +async function signalRSharedPrivateLinkResourcesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.signalRSharedPrivateLinkResources.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +signalRSharedPrivateLinkResourcesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRUpdateSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRUpdateSample.ts new file mode 100644 index 000000000000..aff002f3dc7c --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/signalRUpdateSample.ts @@ -0,0 +1,80 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRResource, SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting resource. + * + * @summary Operation to update an exiting resource. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/SignalR_Update.json + */ +async function signalRUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const resourceName = "mySignalRService"; + const parameters: SignalRResource = { + cors: { allowedOrigins: ["https://foo.com", "https://bar.com"] }, + disableAadAuth: false, + disableLocalAuth: false, + features: [ + { flag: "ServiceMode", properties: {}, value: "Serverless" }, + { flag: "EnableConnectivityLogs", properties: {}, value: "True" }, + { flag: "EnableMessagingLogs", properties: {}, value: "False" }, + { flag: "EnableLiveTrace", properties: {}, value: "False" } + ], + identity: { type: "SystemAssigned" }, + kind: "SignalR", + liveTraceConfiguration: { + categories: [{ name: "ConnectivityLogs", enabled: "true" }], + enabled: "false" + }, + location: "eastus", + networkACLs: { + defaultAction: "Deny", + privateEndpoints: [ + { + name: "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", + allow: ["ServerConnection"] + } + ], + publicNetwork: { allow: ["ClientConnection"] } + }, + publicNetworkAccess: "Enabled", + sku: { name: "Standard_S1", capacity: 1, tier: "Standard" }, + tags: { key1: "value1" }, + tls: { clientCertEnabled: false }, + upstream: { + templates: [ + { + auth: { + type: "ManagedIdentity", + managedIdentity: { resource: "api://example" } + }, + categoryPattern: "*", + eventPattern: "connect,disconnect", + hubPattern: "*", + urlTemplate: "https://example.com/chat/api/connect" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const result = await client.signalR.beginUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +signalRUpdate().catch(console.error); diff --git a/sdk/signalr/arm-signalr/samples/v5/typescript/src/usagesListSample.ts b/sdk/signalr/arm-signalr/samples/v5/typescript/src/usagesListSample.ts new file mode 100644 index 000000000000..5d9682790bc9 --- /dev/null +++ b/sdk/signalr/arm-signalr/samples/v5/typescript/src/usagesListSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SignalRManagementClient } from "@azure/arm-signalr"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List resource usage quotas by location. + * + * @summary List resource usage quotas by location. + * x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2022-02-01/examples/Usages_List.json + */ +async function usagesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new SignalRManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usages.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usagesList().catch(console.error); diff --git a/sdk/signalr/arm-signalr/src/models/index.ts b/sdk/signalr/arm-signalr/src/models/index.ts index b19d38479535..ddac0b10076b 100644 --- a/sdk/signalr/arm-signalr/src/models/index.ts +++ b/sdk/signalr/arm-signalr/src/models/index.ts @@ -321,6 +321,36 @@ export interface SignalRFeature { properties?: { [propertyName: string]: string }; } +/** Live trace configuration of a Microsoft.SignalRService resource. */ +export interface LiveTraceConfiguration { + /** + * Indicates whether or not enable live trace. + * When it's set to true, live trace client can connect to the service. + * Otherwise, live trace client can't connect to the service, so that you are unable to receive any log, no matter what you configure in "categories". + * Available values: true, false. + * Case insensitive. + */ + enabled?: string; + /** Gets or sets the list of category configurations. */ + categories?: LiveTraceCategory[]; +} + +/** Live trace category configuration of a Microsoft.SignalRService resource. */ +export interface LiveTraceCategory { + /** + * Gets or sets the live trace category's name. + * Available values: ConnectivityLogs, MessagingLogs. + * Case insensitive. + */ + name?: string; + /** + * Indicates whether or the live trace category is enabled. + * Available values: true, false. + * Case insensitive. + */ + enabled?: string; +} + /** Resource log configuration of a Microsoft.SignalRService resource. */ export interface ResourceLogConfiguration { /** Gets or sets the list of category configurations. */ @@ -363,25 +393,25 @@ 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; /** @@ -464,6 +494,34 @@ export interface UserAssignedIdentityProperty { readonly clientId?: string; } +/** Custom certificates list. */ +export interface CustomCertificateList { + /** List of custom certificates of this resource. */ + value?: CustomCertificate[]; + /** + * 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; +} + +/** Custom domains list */ +export interface CustomDomainList { + /** List of custom domains that bind to this resource. */ + value?: CustomDomain[]; + /** + * 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; +} + +/** Reference to a resource. */ +export interface ResourceReference { + /** Resource ID. */ + id?: string; +} + /** A class represents the access keys of the resource. */ export interface SignalRKeys { /** The primary access key. */ @@ -655,6 +713,44 @@ export type SharedPrivateLinkResource = ProxyResource & { readonly status?: SharedPrivateLinkResourceStatus; }; +/** A custom certificate. */ +export type CustomCertificate = 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 resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Base uri of the KeyVault that stores certificate. */ + keyVaultBaseUri: string; + /** Certificate secret name. */ + keyVaultSecretName: string; + /** Certificate secret version. */ + keyVaultSecretVersion?: string; +}; + +/** A custom domain */ +export type CustomDomain = 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 resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The custom domain name. */ + domainName: string; + /** Reference to a resource. */ + customCertificate: ResourceReference; +}; + /** Private link resource */ export type PrivateLinkResource = ProxyResource & { /** Group Id of the private link resource */ @@ -736,6 +832,8 @@ export type SignalRResource = TrackedResource & { * But keep in mind, the default value doesn't mean "false". It varies in terms of different FeatureFlags. */ features?: SignalRFeature[]; + /** Live trace configuration of a Microsoft.SignalRService resource. */ + liveTraceConfiguration?: LiveTraceConfiguration; /** Resource log configuration of a Microsoft.SignalRService resource. */ resourceLogConfiguration?: ResourceLogConfiguration; /** Cross-Origin Resource Sharing (CORS) settings. */ @@ -1154,6 +1252,85 @@ export interface UsagesListNextOptionalParams /** Contains response data for the listNext operation. */ export type UsagesListNextResponse = SignalRUsageList; +/** Optional parameters. */ +export interface SignalRCustomCertificatesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SignalRCustomCertificatesListResponse = CustomCertificateList; + +/** Optional parameters. */ +export interface SignalRCustomCertificatesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SignalRCustomCertificatesGetResponse = CustomCertificate; + +/** Optional parameters. */ +export interface SignalRCustomCertificatesCreateOrUpdateOptionalParams + 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 SignalRCustomCertificatesCreateOrUpdateResponse = CustomCertificate; + +/** Optional parameters. */ +export interface SignalRCustomCertificatesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface SignalRCustomCertificatesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SignalRCustomCertificatesListNextResponse = CustomCertificateList; + +/** Optional parameters. */ +export interface SignalRCustomDomainsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SignalRCustomDomainsListResponse = CustomDomainList; + +/** Optional parameters. */ +export interface SignalRCustomDomainsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SignalRCustomDomainsGetResponse = CustomDomain; + +/** Optional parameters. */ +export interface SignalRCustomDomainsCreateOrUpdateOptionalParams + 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 SignalRCustomDomainsCreateOrUpdateResponse = CustomDomain; + +/** Optional parameters. */ +export interface SignalRCustomDomainsDeleteOptionalParams + 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 SignalRCustomDomainsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SignalRCustomDomainsListNextResponse = CustomDomainList; + /** Optional parameters. */ export interface SignalRPrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/signalr/arm-signalr/src/models/mappers.ts b/sdk/signalr/arm-signalr/src/models/mappers.ts index c3f4b85c2ed2..da39a1dd3ef7 100644 --- a/sdk/signalr/arm-signalr/src/models/mappers.ts +++ b/sdk/signalr/arm-signalr/src/models/mappers.ts @@ -745,6 +745,55 @@ export const SignalRFeature: coreClient.CompositeMapper = { } }; +export const LiveTraceConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LiveTraceConfiguration", + modelProperties: { + enabled: { + defaultValue: "false", + serializedName: "enabled", + type: { + name: "String" + } + }, + categories: { + serializedName: "categories", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LiveTraceCategory" + } + } + } + } + } + } +}; + +export const LiveTraceCategory: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LiveTraceCategory", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + enabled: { + serializedName: "enabled", + type: { + name: "String" + } + } + } + } +}; + export const ResourceLogConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1035,6 +1084,75 @@ export const UserAssignedIdentityProperty: coreClient.CompositeMapper = { } }; +export const CustomCertificateList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomCertificateList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomCertificate" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CustomDomainList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomDomainList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomDomain" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceReference", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + export const SignalRKeys: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1470,6 +1588,88 @@ export const SharedPrivateLinkResource: coreClient.CompositeMapper = { } }; +export const CustomCertificate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomCertificate", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + keyVaultBaseUri: { + serializedName: "properties.keyVaultBaseUri", + required: true, + type: { + name: "String" + } + }, + keyVaultSecretName: { + serializedName: "properties.keyVaultSecretName", + required: true, + type: { + name: "String" + } + }, + keyVaultSecretVersion: { + serializedName: "properties.keyVaultSecretVersion", + type: { + name: "String" + } + } + } + } +}; + +export const CustomDomain: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomDomain", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + domainName: { + serializedName: "properties.domainName", + required: true, + type: { + name: "String" + } + }, + customCertificate: { + serializedName: "properties.customCertificate", + type: { + name: "Composite", + className: "ResourceReference" + } + } + } + } +}; + export const PrivateLinkResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1647,6 +1847,13 @@ export const SignalRResource: coreClient.CompositeMapper = { } } }, + liveTraceConfiguration: { + serializedName: "properties.liveTraceConfiguration", + type: { + name: "Composite", + className: "LiveTraceConfiguration" + } + }, resourceLogConfiguration: { serializedName: "properties.resourceLogConfiguration", type: { diff --git a/sdk/signalr/arm-signalr/src/models/parameters.ts b/sdk/signalr/arm-signalr/src/models/parameters.ts index 6d3061530c6e..b47908b84d44 100644 --- a/sdk/signalr/arm-signalr/src/models/parameters.ts +++ b/sdk/signalr/arm-signalr/src/models/parameters.ts @@ -15,6 +15,8 @@ import { NameAvailabilityParameters as NameAvailabilityParametersMapper, SignalRResource as SignalRResourceMapper, RegenerateKeyParameters as RegenerateKeyParametersMapper, + CustomCertificate as CustomCertificateMapper, + CustomDomain as CustomDomainMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, SharedPrivateLinkResource as SharedPrivateLinkResourceMapper } from "../models/mappers"; @@ -46,7 +48,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-10-01", + defaultValue: "2022-02-01", isConstant: true, serializedName: "api-version", type: { @@ -138,6 +140,38 @@ export const parameters2: OperationParameter = { mapper: RegenerateKeyParametersMapper }; +export const certificateName: OperationURLParameter = { + parameterPath: "certificateName", + mapper: { + serializedName: "certificateName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: CustomCertificateMapper +}; + +export const name: OperationURLParameter = { + parameterPath: "name", + mapper: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: CustomDomainMapper +}; + export const privateEndpointConnectionName: OperationURLParameter = { parameterPath: "privateEndpointConnectionName", mapper: { @@ -149,7 +183,7 @@ export const privateEndpointConnectionName: OperationURLParameter = { } }; -export const parameters3: OperationParameter = { +export const parameters5: OperationParameter = { parameterPath: "parameters", mapper: PrivateEndpointConnectionMapper }; @@ -165,7 +199,7 @@ export const sharedPrivateLinkResourceName: OperationURLParameter = { } }; -export const parameters4: OperationParameter = { +export const parameters6: OperationParameter = { parameterPath: "parameters", mapper: SharedPrivateLinkResourceMapper }; diff --git a/sdk/signalr/arm-signalr/src/operations/index.ts b/sdk/signalr/arm-signalr/src/operations/index.ts index 1a3c5a69526b..486ffc3ee06b 100644 --- a/sdk/signalr/arm-signalr/src/operations/index.ts +++ b/sdk/signalr/arm-signalr/src/operations/index.ts @@ -9,6 +9,8 @@ export * from "./operations"; export * from "./signalR"; export * from "./usages"; +export * from "./signalRCustomCertificates"; +export * from "./signalRCustomDomains"; export * from "./signalRPrivateEndpointConnections"; export * from "./signalRPrivateLinkResources"; export * from "./signalRSharedPrivateLinkResources"; diff --git a/sdk/signalr/arm-signalr/src/operations/signalR.ts b/sdk/signalr/arm-signalr/src/operations/signalR.ts index 60791936b72b..1bc8be0677ad 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalR.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalR.ts @@ -280,10 +280,12 @@ export class SignalRImpl implements SignalR { { resourceGroupName, resourceName, parameters, options }, createOrUpdateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** @@ -365,10 +367,12 @@ export class SignalRImpl implements SignalR { { resourceGroupName, resourceName, options }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** @@ -451,10 +455,12 @@ export class SignalRImpl implements SignalR { { resourceGroupName, resourceName, parameters, options }, updateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** @@ -562,11 +568,13 @@ export class SignalRImpl implements SignalR { { resourceGroupName, resourceName, parameters, options }, regenerateKeyOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); + await poller.poll(); + return poller; } /** @@ -649,11 +657,13 @@ export class SignalRImpl implements SignalR { { resourceGroupName, resourceName, options }, restartOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); + await poller.poll(); + return poller; } /** diff --git a/sdk/signalr/arm-signalr/src/operations/signalRCustomCertificates.ts b/sdk/signalr/arm-signalr/src/operations/signalRCustomCertificates.ts new file mode 100644 index 000000000000..f52c8e1fa149 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operations/signalRCustomCertificates.ts @@ -0,0 +1,406 @@ +/* + * 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 { SignalRCustomCertificates } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SignalRManagementClient } from "../signalRManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CustomCertificate, + SignalRCustomCertificatesListNextOptionalParams, + SignalRCustomCertificatesListOptionalParams, + SignalRCustomCertificatesListResponse, + SignalRCustomCertificatesGetOptionalParams, + SignalRCustomCertificatesGetResponse, + SignalRCustomCertificatesCreateOrUpdateOptionalParams, + SignalRCustomCertificatesCreateOrUpdateResponse, + SignalRCustomCertificatesDeleteOptionalParams, + SignalRCustomCertificatesListNextResponse +} from "../models"; + +/// +/** Class containing SignalRCustomCertificates operations. */ +export class SignalRCustomCertificatesImpl + implements SignalRCustomCertificates { + private readonly client: SignalRManagementClient; + + /** + * Initialize a new instance of the class SignalRCustomCertificates class. + * @param client Reference to the service client + */ + constructor(client: SignalRManagementClient) { + this.client = client; + } + + /** + * List all custom certificates. + * @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. + */ + public list( + resourceGroupName: string, + resourceName: string, + options?: SignalRCustomCertificatesListOptionalParams + ): 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?: SignalRCustomCertificatesListOptionalParams + ): 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 + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + resourceName: string, + options?: SignalRCustomCertificatesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + + /** + * List all custom certificates. + * @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. + */ + private _list( + resourceGroupName: string, + resourceName: string, + options?: SignalRCustomCertificatesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listOperationSpec + ); + } + + /** + * Get a custom certificate. + * @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 certificateName Custom certificate name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + certificateName: string, + options?: SignalRCustomCertificatesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, certificateName, options }, + getOperationSpec + ); + } + + /** + * Create or update a custom certificate. + * @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 certificateName Custom certificate name + * @param parameters A custom certificate. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + certificateName: string, + parameters: CustomCertificate, + options?: SignalRCustomCertificatesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SignalRCustomCertificatesCreateOrUpdateResponse + > + > { + 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, certificateName, parameters, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a custom certificate. + * @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 certificateName Custom certificate name + * @param parameters A custom certificate. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + certificateName: string, + parameters: CustomCertificate, + options?: SignalRCustomCertificatesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + resourceName, + certificateName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete a custom certificate. + * @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 certificateName Custom certificate name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + certificateName: string, + options?: SignalRCustomCertificatesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, certificateName, options }, + deleteOperationSpec + ); + } + + /** + * 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. + */ + private _listNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: SignalRCustomCertificatesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/customCertificates", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomCertificateList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/customCertificates/{certificateName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomCertificate + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.certificateName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/customCertificates/{certificateName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CustomCertificate + }, + 201: { + bodyMapper: Mappers.CustomCertificate + }, + 202: { + bodyMapper: Mappers.CustomCertificate + }, + 204: { + bodyMapper: Mappers.CustomCertificate + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.certificateName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/customCertificates/{certificateName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.certificateName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomCertificateList + }, + default: { + 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/signalRCustomDomains.ts b/sdk/signalr/arm-signalr/src/operations/signalRCustomDomains.ts new file mode 100644 index 000000000000..2d51ebc39d04 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operations/signalRCustomDomains.ts @@ -0,0 +1,476 @@ +/* + * 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 { SignalRCustomDomains } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SignalRManagementClient } from "../signalRManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CustomDomain, + SignalRCustomDomainsListNextOptionalParams, + SignalRCustomDomainsListOptionalParams, + SignalRCustomDomainsListResponse, + SignalRCustomDomainsGetOptionalParams, + SignalRCustomDomainsGetResponse, + SignalRCustomDomainsCreateOrUpdateOptionalParams, + SignalRCustomDomainsCreateOrUpdateResponse, + SignalRCustomDomainsDeleteOptionalParams, + SignalRCustomDomainsListNextResponse +} from "../models"; + +/// +/** Class containing SignalRCustomDomains operations. */ +export class SignalRCustomDomainsImpl implements SignalRCustomDomains { + private readonly client: SignalRManagementClient; + + /** + * Initialize a new instance of the class SignalRCustomDomains class. + * @param client Reference to the service client + */ + constructor(client: SignalRManagementClient) { + this.client = client; + } + + /** + * List all custom domains. + * @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. + */ + public list( + resourceGroupName: string, + resourceName: string, + options?: SignalRCustomDomainsListOptionalParams + ): 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?: SignalRCustomDomainsListOptionalParams + ): 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 + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + resourceName: string, + options?: SignalRCustomDomainsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + + /** + * List all custom domains. + * @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. + */ + private _list( + resourceGroupName: string, + resourceName: string, + options?: SignalRCustomDomainsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listOperationSpec + ); + } + + /** + * Get a custom domain. + * @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 name Custom domain name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + name: string, + options?: SignalRCustomDomainsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, name, options }, + getOperationSpec + ); + } + + /** + * Create or update a custom domain. + * @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 name Custom domain name. + * @param parameters A custom domain + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + name: string, + parameters: CustomDomain, + options?: SignalRCustomDomainsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SignalRCustomDomainsCreateOrUpdateResponse + > + > { + 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, name, parameters, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a custom domain. + * @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 name Custom domain name. + * @param parameters A custom domain + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + name: string, + parameters: CustomDomain, + options?: SignalRCustomDomainsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + resourceName, + name, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete a custom domain. + * @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 name Custom domain name. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + resourceName: string, + name: string, + options?: SignalRCustomDomainsDeleteOptionalParams + ): 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, name, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Delete a custom domain. + * @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 name Custom domain name. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + name: string, + options?: SignalRCustomDomainsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + resourceName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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. + */ + private _listNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: SignalRCustomDomainsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/customDomains", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomDomainList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/customDomains/{name}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomDomain + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.name + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/customDomains/{name}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CustomDomain + }, + 201: { + bodyMapper: Mappers.CustomDomain + }, + 202: { + bodyMapper: Mappers.CustomDomain + }, + 204: { + bodyMapper: Mappers.CustomDomain + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.name + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/customDomains/{name}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.name + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomDomainList + }, + default: { + 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/signalRPrivateEndpointConnections.ts b/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts index 112cf80a82ff..fcf6a63e457d 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts @@ -235,10 +235,12 @@ export class SignalRPrivateEndpointConnectionsImpl }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** @@ -344,7 +346,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters3, + requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts b/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts index cd015c1b42db..86a5afbc76d8 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts @@ -217,10 +217,12 @@ export class SignalRSharedPrivateLinkResourcesImpl }, createOrUpdateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** @@ -312,10 +314,12 @@ export class SignalRSharedPrivateLinkResourcesImpl }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** @@ -430,7 +434,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters4, + requestBody: Parameters.parameters6, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/index.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/index.ts index 1a3c5a69526b..486ffc3ee06b 100644 --- a/sdk/signalr/arm-signalr/src/operationsInterfaces/index.ts +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/index.ts @@ -9,6 +9,8 @@ export * from "./operations"; export * from "./signalR"; export * from "./usages"; +export * from "./signalRCustomCertificates"; +export * from "./signalRCustomDomains"; export * from "./signalRPrivateEndpointConnections"; export * from "./signalRPrivateLinkResources"; export * from "./signalRSharedPrivateLinkResources"; diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRCustomCertificates.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRCustomCertificates.ts new file mode 100644 index 000000000000..2d60410db2c5 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRCustomCertificates.ts @@ -0,0 +1,101 @@ +/* + * 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 { + CustomCertificate, + SignalRCustomCertificatesListOptionalParams, + SignalRCustomCertificatesGetOptionalParams, + SignalRCustomCertificatesGetResponse, + SignalRCustomCertificatesCreateOrUpdateOptionalParams, + SignalRCustomCertificatesCreateOrUpdateResponse, + SignalRCustomCertificatesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a SignalRCustomCertificates. */ +export interface SignalRCustomCertificates { + /** + * List all custom certificates. + * @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?: SignalRCustomCertificatesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a custom certificate. + * @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 certificateName Custom certificate name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + certificateName: string, + options?: SignalRCustomCertificatesGetOptionalParams + ): Promise; + /** + * Create or update a custom certificate. + * @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 certificateName Custom certificate name + * @param parameters A custom certificate. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + certificateName: string, + parameters: CustomCertificate, + options?: SignalRCustomCertificatesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SignalRCustomCertificatesCreateOrUpdateResponse + > + >; + /** + * Create or update a custom certificate. + * @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 certificateName Custom certificate name + * @param parameters A custom certificate. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + certificateName: string, + parameters: CustomCertificate, + options?: SignalRCustomCertificatesCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete a custom certificate. + * @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 certificateName Custom certificate name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + certificateName: string, + options?: SignalRCustomCertificatesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRCustomDomains.ts b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRCustomDomains.ts new file mode 100644 index 000000000000..874082d2c280 --- /dev/null +++ b/sdk/signalr/arm-signalr/src/operationsInterfaces/signalRCustomDomains.ts @@ -0,0 +1,115 @@ +/* + * 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 { + CustomDomain, + SignalRCustomDomainsListOptionalParams, + SignalRCustomDomainsGetOptionalParams, + SignalRCustomDomainsGetResponse, + SignalRCustomDomainsCreateOrUpdateOptionalParams, + SignalRCustomDomainsCreateOrUpdateResponse, + SignalRCustomDomainsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a SignalRCustomDomains. */ +export interface SignalRCustomDomains { + /** + * List all custom domains. + * @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?: SignalRCustomDomainsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a custom domain. + * @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 name Custom domain name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + name: string, + options?: SignalRCustomDomainsGetOptionalParams + ): Promise; + /** + * Create or update a custom domain. + * @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 name Custom domain name. + * @param parameters A custom domain + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + name: string, + parameters: CustomDomain, + options?: SignalRCustomDomainsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SignalRCustomDomainsCreateOrUpdateResponse + > + >; + /** + * Create or update a custom domain. + * @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 name Custom domain name. + * @param parameters A custom domain + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + name: string, + parameters: CustomDomain, + options?: SignalRCustomDomainsCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete a custom domain. + * @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 name Custom domain name. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourceName: string, + name: string, + options?: SignalRCustomDomainsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a custom domain. + * @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 name Custom domain name. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + name: string, + options?: SignalRCustomDomainsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/signalr/arm-signalr/src/signalRManagementClient.ts b/sdk/signalr/arm-signalr/src/signalRManagementClient.ts index 6ff0ea7b5b07..2ab9f7a56c76 100644 --- a/sdk/signalr/arm-signalr/src/signalRManagementClient.ts +++ b/sdk/signalr/arm-signalr/src/signalRManagementClient.ts @@ -12,6 +12,8 @@ import { OperationsImpl, SignalRImpl, UsagesImpl, + SignalRCustomCertificatesImpl, + SignalRCustomDomainsImpl, SignalRPrivateEndpointConnectionsImpl, SignalRPrivateLinkResourcesImpl, SignalRSharedPrivateLinkResourcesImpl @@ -20,6 +22,8 @@ import { Operations, SignalR, Usages, + SignalRCustomCertificates, + SignalRCustomDomains, SignalRPrivateEndpointConnections, SignalRPrivateLinkResources, SignalRSharedPrivateLinkResources @@ -59,7 +63,7 @@ export class SignalRManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-signalr/5.0.0`; + const packageDetails = `azsdk-js-arm-signalr/5.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -74,7 +78,8 @@ export class SignalRManagementClient extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix }, - baseUri: options.endpoint || "https://management.azure.com" + baseUri: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); // Parameter assignments @@ -82,10 +87,12 @@ export class SignalRManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-10-01"; + this.apiVersion = options.apiVersion || "2022-02-01"; this.operations = new OperationsImpl(this); this.signalR = new SignalRImpl(this); this.usages = new UsagesImpl(this); + this.signalRCustomCertificates = new SignalRCustomCertificatesImpl(this); + this.signalRCustomDomains = new SignalRCustomDomainsImpl(this); this.signalRPrivateEndpointConnections = new SignalRPrivateEndpointConnectionsImpl( this ); @@ -100,6 +107,8 @@ export class SignalRManagementClient extends coreClient.ServiceClient { operations: Operations; signalR: SignalR; usages: Usages; + signalRCustomCertificates: SignalRCustomCertificates; + signalRCustomDomains: SignalRCustomDomains; signalRPrivateEndpointConnections: SignalRPrivateEndpointConnections; signalRPrivateLinkResources: SignalRPrivateLinkResources; signalRSharedPrivateLinkResources: SignalRSharedPrivateLinkResources; diff --git a/sdk/signalr/arm-signalr/test/sampleTest.ts b/sdk/signalr/arm-signalr/test/sampleTest.ts index 7ed89b043e1b..e0877dd55c3c 100644 --- a/sdk/signalr/arm-signalr/test/sampleTest.ts +++ b/sdk/signalr/arm-signalr/test/sampleTest.ts @@ -31,18 +31,19 @@ const recorderEnvSetup: RecorderEnvironmentSetup = { queryParametersToSkip: [] }; + describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { + beforeEach(async function () { recorder = record(this, recorderEnvSetup); }); - afterEach(async function() { + afterEach(async function () { await recorder.stop(); }); - it("sample test", async function() { + 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 aa271c28f3b6..b5227bc29af1 100644 --- a/sdk/signalr/arm-signalr/tsconfig.json +++ b/sdk/signalr/arm-signalr/tsconfig.json @@ -9,12 +9,25 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true, - "paths": { "@azure/arm-signalr": ["./src/index"] } + "paths": { + "@azure/arm-signalr": [ + "./src/index" + ] + } }, - "include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/signalr/ci.mgmt.yml b/sdk/signalr/ci.mgmt.yml index e2cc4fe56eca..b1dde40ba7c5 100644 --- a/sdk/signalr/ci.mgmt.yml +++ b/sdk/signalr/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -9,7 +9,7 @@ trigger: paths: include: - sdk/signalr/ci.mgmt.yml - - sdk/signalr/arm-signalr/ + - sdk/signalr/arm-signalr pr: branches: include: @@ -22,12 +22,11 @@ pr: paths: include: - sdk/signalr/ci.mgmt.yml - - sdk/signalr/arm-signalr/ - + - sdk/signalr/arm-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 + safeName: azurearmsignalr