From 1ef62af6af14bad1e3d52aafaa1681d7b8528d3c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 16 Oct 2023 02:20:13 +0000 Subject: [PATCH] CodeGen from PR 26203 in Azure/azure-rest-api-specs Merge 9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0 into b594fd4145904c9bbd018f4a2ddea75c7134aee7 --- common/config/rush/pnpm-lock.yaml | 105 ++++++++++++++-- .../arm-voiceservices/CHANGELOG.md | 25 ++-- .../arm-voiceservices/_meta.json | 10 +- .../arm-voiceservices/assets.json | 6 - .../arm-voiceservices/package.json | 34 ++--- .../review/arm-voiceservices.api.md | 30 +++++ ...municationsGatewaysCreateOrUpdateSample.ts | 74 ----------- .../communicationsGatewaysDeleteSample.ts | 43 ------- .../communicationsGatewaysGetSample.ts | 43 ------- ...ationsGatewaysListByResourceGroupSample.ts | 44 ------- ...cationsGatewaysListBySubscriptionSample.ts | 40 ------ .../communicationsGatewaysUpdateSample.ts | 48 -------- .../nameAvailabilityCheckLocalSample.ts | 45 ------- .../samples-dev/operationsListSample.ts | 40 ------ .../testLinesCreateOrUpdateSample.ts | 51 -------- .../samples-dev/testLinesDeleteSample.ts | 45 ------- .../samples-dev/testLinesGetSample.ts | 45 ------- ...tLinesListByCommunicationsGatewaySample.ts | 46 ------- .../samples-dev/testLinesUpdateSample.ts | 50 -------- .../samples/v1/javascript/README.md | 74 ----------- ...municationsGatewaysCreateOrUpdateSample.js | 67 ---------- .../communicationsGatewaysDeleteSample.js | 39 ------ .../communicationsGatewaysGetSample.js | 39 ------ ...ationsGatewaysListByResourceGroupSample.js | 38 ------ ...cationsGatewaysListBySubscriptionSample.js | 37 ------ .../communicationsGatewaysUpdateSample.js | 41 ------- .../nameAvailabilityCheckLocalSample.js | 39 ------ .../v1/javascript/operationsListSample.js | 37 ------ .../samples/v1/javascript/package.json | 32 ----- .../samples/v1/javascript/sample.env | 4 - .../testLinesCreateOrUpdateSample.js | 47 ------- .../v1/javascript/testLinesDeleteSample.js | 41 ------- .../v1/javascript/testLinesGetSample.js | 41 ------- ...tLinesListByCommunicationsGatewaySample.js | 42 ------- .../v1/javascript/testLinesUpdateSample.js | 43 ------- .../samples/v1/typescript/README.md | 87 ------------- .../samples/v1/typescript/package.json | 41 ------- .../samples/v1/typescript/sample.env | 4 - ...municationsGatewaysCreateOrUpdateSample.ts | 74 ----------- .../src/communicationsGatewaysDeleteSample.ts | 43 ------- .../src/communicationsGatewaysGetSample.ts | 43 ------- ...ationsGatewaysListByResourceGroupSample.ts | 44 ------- ...cationsGatewaysListBySubscriptionSample.ts | 40 ------ .../src/communicationsGatewaysUpdateSample.ts | 48 -------- .../src/nameAvailabilityCheckLocalSample.ts | 45 ------- .../v1/typescript/src/operationsListSample.ts | 40 ------ .../src/testLinesCreateOrUpdateSample.ts | 51 -------- .../typescript/src/testLinesDeleteSample.ts | 45 ------- .../v1/typescript/src/testLinesGetSample.ts | 45 ------- ...tLinesListByCommunicationsGatewaySample.ts | 46 ------- .../typescript/src/testLinesUpdateSample.ts | 50 -------- .../samples/v1/typescript/tsconfig.json | 17 --- .../src/microsoftVoiceServices.ts | 4 +- .../arm-voiceservices/src/models/index.ts | 62 ++++++++++ .../arm-voiceservices/src/models/mappers.ts | 83 +++++++++++++ .../src/models/parameters.ts | 2 +- .../arm-voiceservices/test/sampleTest.ts | 43 +++++++ .../voiceservices_operations_test.spec.ts | 116 ------------------ .../arm-voiceservices/tsconfig.json | 10 +- 59 files changed, 348 insertions(+), 2220 deletions(-) delete mode 100644 sdk/voiceservices/arm-voiceservices/assets.json delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysCreateOrUpdateSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysDeleteSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysGetSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListByResourceGroupSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListBySubscriptionSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysUpdateSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/nameAvailabilityCheckLocalSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/operationsListSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/testLinesCreateOrUpdateSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/testLinesDeleteSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/testLinesGetSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/testLinesListByCommunicationsGatewaySample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples-dev/testLinesUpdateSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/README.md delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysCreateOrUpdateSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysDeleteSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysGetSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListByResourceGroupSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListBySubscriptionSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysUpdateSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/nameAvailabilityCheckLocalSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/operationsListSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/package.json delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/sample.env delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesCreateOrUpdateSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesDeleteSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesGetSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesListByCommunicationsGatewaySample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesUpdateSample.js delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/README.md delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/package.json delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/sample.env delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysCreateOrUpdateSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysDeleteSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysGetSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListByResourceGroupSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListBySubscriptionSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysUpdateSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/nameAvailabilityCheckLocalSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/operationsListSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesCreateOrUpdateSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesDeleteSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesGetSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesListByCommunicationsGatewaySample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesUpdateSample.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/samples/v1/typescript/tsconfig.json create mode 100644 sdk/voiceservices/arm-voiceservices/test/sampleTest.ts delete mode 100644 sdk/voiceservices/arm-voiceservices/test/voiceservices_operations_test.spec.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 270ac1d12aa9..b1b7e1d374fa 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1828,6 +1828,16 @@ packages: lodash: 4.17.21 dev: false + /@microsoft/api-extractor-model@7.28.2(@types/node@14.18.63): + resolution: {integrity: sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==} + dependencies: + '@microsoft/tsdoc': 0.14.2 + '@microsoft/tsdoc-config': 0.16.2 + '@rushstack/node-core-library': 3.61.0(@types/node@14.18.63) + transitivePeerDependencies: + - '@types/node' + dev: false + /@microsoft/api-extractor-model@7.28.2(@types/node@16.18.55): resolution: {integrity: sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==} dependencies: @@ -1838,6 +1848,26 @@ packages: - '@types/node' dev: false + /@microsoft/api-extractor@7.38.0(@types/node@14.18.63): + resolution: {integrity: sha512-e1LhZYnfw+JEebuY2bzhw0imDCl1nwjSThTrQqBXl40hrVo6xm3j/1EpUr89QyzgjqmAwek2ZkIVZbrhaR+cqg==} + hasBin: true + dependencies: + '@microsoft/api-extractor-model': 7.28.2(@types/node@14.18.63) + '@microsoft/tsdoc': 0.14.2 + '@microsoft/tsdoc-config': 0.16.2 + '@rushstack/node-core-library': 3.61.0(@types/node@14.18.63) + '@rushstack/rig-package': 0.5.1 + '@rushstack/ts-command-line': 4.16.1 + colors: 1.2.5 + lodash: 4.17.21 + resolve: 1.22.6 + semver: 7.5.4 + source-map: 0.6.1 + typescript: 5.0.4 + transitivePeerDependencies: + - '@types/node' + dev: false + /@microsoft/api-extractor@7.38.0(@types/node@16.18.55): resolution: {integrity: sha512-e1LhZYnfw+JEebuY2bzhw0imDCl1nwjSThTrQqBXl40hrVo6xm3j/1EpUr89QyzgjqmAwek2ZkIVZbrhaR+cqg==} hasBin: true @@ -2486,6 +2516,24 @@ packages: rollup: 3.29.4 dev: false + /@rushstack/node-core-library@3.61.0(@types/node@14.18.63): + resolution: {integrity: sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + dependencies: + '@types/node': 14.18.63 + colors: 1.2.5 + fs-extra: 7.0.1 + import-lazy: 4.0.0 + jju: 1.4.0 + resolve: 1.22.6 + semver: 7.5.4 + z-schema: 5.0.5 + dev: false + /@rushstack/node-core-library@3.61.0(@types/node@16.18.55): resolution: {integrity: sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==} peerDependencies: @@ -4270,7 +4318,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20231011 + typescript: 5.3.0-dev.20231015 dev: false /eastasianwidth@0.2.0: @@ -8841,6 +8889,37 @@ packages: code-block-writer: 12.0.0 dev: false + /ts-node@10.9.1(@types/node@14.18.63)(typescript@5.0.4): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 14.18.63 + acorn: 8.10.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.0.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: false + /ts-node@10.9.1(@types/node@16.18.55)(typescript@5.0.4): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -9014,8 +9093,8 @@ packages: hasBin: true dev: false - /typescript@5.3.0-dev.20231011: - resolution: {integrity: sha512-qpyUI7J37X3Xj7/bPWSNPUvmJ8yDGVnkQ8665xD4+LVWKUX7vwO7n2E1CUuQzeQIF4y369iPaz1d396rTW5LfA==} + /typescript@5.3.0-dev.20231015: + resolution: {integrity: sha512-JAygGSVZ9qp1MlY8UH49GiUIM+R7P7QUu23/IymTR1fgnWypMnR354jHIJSr8bD2uDQfVsEV/SezM9PZshwEyQ==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -16489,32 +16568,34 @@ packages: dev: false file:projects/arm-voiceservices.tgz: - resolution: {integrity: sha512-t0pCBtPSdx2hIk4g3roFnuIjLCbncGecLf2UZBjAQYEg2JKSPKjKTkrSTZJvRidoibY2qhEf67xFIHSUTLmAyg==, tarball: file:projects/arm-voiceservices.tgz} + resolution: {integrity: sha512-R8SdAbSjb7l+5i7z7MI0LBvlVVl95MnPwUBE1zRWk6GZFyL5q8oPRnsjSDti3jCxT9iklWEMISPrcCRAiUmXWQ==, tarball: file:projects/arm-voiceservices.tgz} name: '@rush-temp/arm-voiceservices' version: 0.0.0 dependencies: - '@microsoft/api-extractor': 7.38.0(@types/node@16.18.55) + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.38.0(@types/node@14.18.63) '@rollup/plugin-commonjs': 24.1.0(rollup@2.79.1) '@rollup/plugin-json': 6.0.0(rollup@2.79.1) '@rollup/plugin-multi-entry': 6.0.0(rollup@2.79.1) '@rollup/plugin-node-resolve': 13.3.0(rollup@2.79.1) '@types/chai': 4.3.6 - '@types/node': 16.18.55 + '@types/node': 14.18.63 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 mkdirp: 2.1.6 - mocha: 10.2.0 - rimraf: 3.0.2 + mocha: 7.2.0 + rimraf: 5.0.5 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3(@types/node@16.18.55)(rollup@2.79.1) - ts-node: 10.9.1(@types/node@16.18.55)(typescript@5.0.4) + rollup-plugin-sourcemaps: 0.6.3(@types/node@14.18.63)(rollup@2.79.1) + ts-node: 10.9.1(@types/node@14.18.63)(typescript@5.0.4) tslib: 2.6.2 typescript: 5.0.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' + - supports-color dev: false file:projects/arm-webpubsub.tgz: @@ -17290,7 +17371,7 @@ packages: dev: false file:projects/communication-sms.tgz: - resolution: {integrity: sha512-Zy9WPrxVxDAuq5iLYpiy+HF8IQkHW5qHW8lvszMJ0eKWAWOgTgtr60bcu7A83DWz2vWBXRsGUWKaNqS3yUqOmA==, tarball: file:projects/communication-sms.tgz} + resolution: {integrity: sha512-HPqBjVlUjJug38F2I1GghNK4OH69dfIymbHuB2zKRL+PPuX3EaSSDLRPoJm9FLQke6nSh15tekNMhtT0Mzbr1g==, tarball: file:projects/communication-sms.tgz} name: '@rush-temp/communication-sms' version: 0.0.0 dependencies: @@ -18785,7 +18866,7 @@ packages: '@azure/msal-browser': 3.2.0 '@azure/msal-common': 13.3.0 '@azure/msal-node': 2.2.0 - '@microsoft/api-extractor': 7.38.0(@types/node@16.18.58) + '@microsoft/api-extractor': 7.38.0(@types/node@16.18.55) '@types/chai': 4.3.6 '@types/jsonwebtoken': 9.0.3 '@types/jws': 3.2.6 diff --git a/sdk/voiceservices/arm-voiceservices/CHANGELOG.md b/sdk/voiceservices/arm-voiceservices/CHANGELOG.md index d42226ffca8f..21c6c1aa58ae 100644 --- a/sdk/voiceservices/arm-voiceservices/CHANGELOG.md +++ b/sdk/voiceservices/arm-voiceservices/CHANGELOG.md @@ -1,15 +1,18 @@ # Release History + +## 1.1.0 (2023-10-16) + +**Features** -## 1.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface ManagedServiceIdentity + - Added Interface UserAssignedIdentity + - Added Type Alias ManagedServiceIdentityType + - Interface CommunicationsGateway has a new optional parameter identity + - Interface CommunicationsGateway has a new optional parameter integratedMcpEnabled + - Interface CommunicationsGatewayUpdate has a new optional parameter identity + - Added Enum KnownManagedServiceIdentityType + + ## 1.0.0 (2023-04-04) -The package of @azure/arm-voiceservices is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-voiceservices is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/voiceservices/arm-voiceservices/_meta.json b/sdk/voiceservices/arm-voiceservices/_meta.json index f73e2145c36c..1c62bf76f8d3 100644 --- a/sdk/voiceservices/arm-voiceservices/_meta.json +++ b/sdk/voiceservices/arm-voiceservices/_meta.json @@ -1,8 +1,8 @@ { - "commit": "c417434958b676b441ce184474210a8210a074b6", - "readme": "specification\\voiceservices\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\voiceservices\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.10 --generate-sample=true", + "commit": "83d6f532049cd713df6f8391d917f04f9b53cd73", + "readme": "specification/voiceservices/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/voiceservices/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.10" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/voiceservices/arm-voiceservices/assets.json b/sdk/voiceservices/arm-voiceservices/assets.json deleted file mode 100644 index 60c88ad7bbcd..000000000000 --- a/sdk/voiceservices/arm-voiceservices/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/voiceservices/arm-voiceservices", - "Tag": "js/voiceservices/arm-voiceservices_be92f7b682" -} diff --git a/sdk/voiceservices/arm-voiceservices/package.json b/sdk/voiceservices/arm-voiceservices/package.json index 0ce52d9ada1a..276565a8e974 100644 --- a/sdk/voiceservices/arm-voiceservices/package.json +++ b/sdk/voiceservices/arm-voiceservices/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for MicrosoftVoiceServices.", - "version": "1.0.1", + "version": "1.1.0", "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -38,18 +38,18 @@ "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", - "@azure/identity": "^3.3.0", + "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", - "mocha": "^10.0.0", + "mocha": "^7.1.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@types/node": "^16.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0" + "@types/node": "^14.0.0", + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -84,7 +84,7 @@ "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -112,13 +112,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/voiceservices/arm-voiceservices", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-voiceservices?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/voiceservices/arm-voiceservices" +} \ No newline at end of file diff --git a/sdk/voiceservices/arm-voiceservices/review/arm-voiceservices.api.md b/sdk/voiceservices/arm-voiceservices/review/arm-voiceservices.api.md index 361da4c69a3c..5891e5a6e3ff 100644 --- a/sdk/voiceservices/arm-voiceservices/review/arm-voiceservices.api.md +++ b/sdk/voiceservices/arm-voiceservices/review/arm-voiceservices.api.md @@ -41,6 +41,8 @@ export interface CommunicationsGateway extends TrackedResource { connectivity?: Connectivity; e911Type?: E911Type; emergencyDialStrings?: string[]; + identity?: ManagedServiceIdentity; + integratedMcpEnabled?: boolean; onPremMcpEnabled?: boolean; platforms?: CommunicationsPlatform[]; readonly provisioningState?: ProvisioningState; @@ -136,6 +138,7 @@ export type CommunicationsGatewaysUpdateResponse = CommunicationsGateway; // @public export interface CommunicationsGatewayUpdate { + identity?: ManagedServiceIdentity; tags?: { [propertyName: string]: string; }; @@ -220,6 +223,14 @@ export enum KnownE911Type { Standard = "Standard" } +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + // @public export enum KnownOrigin { System = "system", @@ -256,6 +267,19 @@ export enum KnownTestLinePurpose { Manual = "Manual" } +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + // @public (undocumented) export class MicrosoftVoiceServices extends coreClient.ServiceClient { // (undocumented) @@ -475,6 +499,12 @@ export interface TrackedResource extends Resource { }; } +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysCreateOrUpdateSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysCreateOrUpdateSample.ts deleted file mode 100644 index da4f636c10f2..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysCreateOrUpdateSample.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CommunicationsGateway, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a CommunicationsGateway - * - * @summary Create a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_CreateOrUpdate.json - */ -async function createCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const resource: CommunicationsGateway = { - autoGeneratedDomainNameLabelScope: "NoReuse", - codecs: ["PCMA"], - connectivity: "PublicAddress", - e911Type: "Standard", - location: "useast", - platforms: ["OperatorConnect"], - serviceLocations: [ - { - name: "useast", - primaryRegionProperties: { - allowedMediaSourceAddressPrefixes: ["10.1.2.0/24"], - allowedSignalingSourceAddressPrefixes: ["10.1.1.0/24"], - operatorAddresses: ["198.51.100.1"] - } - }, - { - name: "useast2", - primaryRegionProperties: { - allowedMediaSourceAddressPrefixes: ["10.2.2.0/24"], - allowedSignalingSourceAddressPrefixes: ["10.2.1.0/24"], - operatorAddresses: ["198.51.100.2"] - } - } - ], - teamsVoicemailPilotNumber: "1234567890" - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.beginCreateOrUpdateAndWait( - resourceGroupName, - communicationsGatewayName, - resource - ); - console.log(result); -} - -async function main() { - createCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysDeleteSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysDeleteSample.ts deleted file mode 100644 index 8624d9e756e8..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a CommunicationsGateway - * - * @summary Delete a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Delete.json - */ -async function deleteCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.beginDeleteAndWait( - resourceGroupName, - communicationsGatewayName - ); - console.log(result); -} - -async function main() { - deleteCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysGetSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysGetSample.ts deleted file mode 100644 index b114c601a9b7..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a CommunicationsGateway - * - * @summary Get a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Get.json - */ -async function getCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.get( - resourceGroupName, - communicationsGatewayName - ); - console.log(result); -} - -async function main() { - getCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListByResourceGroupSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListByResourceGroupSample.ts deleted file mode 100644 index 2fcd29eedacc..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List CommunicationsGateway resources by resource group - * - * @summary List CommunicationsGateway resources by resource group - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListByResourceGroup.json - */ -async function listCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.communicationsGateways.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListBySubscriptionSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListBySubscriptionSample.ts deleted file mode 100644 index 76c248ebd4c6..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List CommunicationsGateway resources by subscription ID - * - * @summary List CommunicationsGateway resources by subscription ID - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListBySubscription.json - */ -async function listCommunicationsGatewayResourceSub() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.communicationsGateways.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listCommunicationsGatewayResourceSub(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysUpdateSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysUpdateSample.ts deleted file mode 100644 index ebeb1e01da81..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CommunicationsGatewayUpdate, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a CommunicationsGateway - * - * @summary Update a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Update.json - */ -async function updateCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const properties: CommunicationsGatewayUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.update( - resourceGroupName, - communicationsGatewayName, - properties - ); - console.log(result); -} - -async function main() { - updateCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/nameAvailabilityCheckLocalSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/nameAvailabilityCheckLocalSample.ts deleted file mode 100644 index e720cfd76de8..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/nameAvailabilityCheckLocalSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CheckNameAvailabilityRequest, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Check whether the resource name is available in the given region. - * - * @summary Check whether the resource name is available in the given region. - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/NameAvailability_CheckLocal.json - */ -async function checkLocalNameAvailability() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const location = "useast"; - const body: CheckNameAvailabilityRequest = { - name: "myname", - type: "Microsoft.VoiceServices/CommunicationsGateways" - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.nameAvailability.checkLocal(location, body); - console.log(result); -} - -async function main() { - checkLocalNameAvailability(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/operationsListSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/operationsListSample.ts deleted file mode 100644 index 55c8bc7fdbdc..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesCreateOrUpdateSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesCreateOrUpdateSample.ts deleted file mode 100644 index a9f3253939ba..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesCreateOrUpdateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TestLine, MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a TestLine - * - * @summary Create a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_CreateOrUpdate.json - */ -async function createTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const resource: TestLine = { - location: "useast", - phoneNumber: "+1-555-1234", - purpose: "Automated" - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.beginCreateOrUpdateAndWait( - resourceGroupName, - communicationsGatewayName, - testLineName, - resource - ); - console.log(result); -} - -async function main() { - createTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesDeleteSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesDeleteSample.ts deleted file mode 100644 index a4105d718fd9..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a TestLine - * - * @summary Delete a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Delete.json - */ -async function deleteTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.beginDeleteAndWait( - resourceGroupName, - communicationsGatewayName, - testLineName - ); - console.log(result); -} - -async function main() { - deleteTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesGetSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesGetSample.ts deleted file mode 100644 index 6fde8bcde412..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a TestLine - * - * @summary Get a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Get.json - */ -async function getTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.get( - resourceGroupName, - communicationsGatewayName, - testLineName - ); - console.log(result); -} - -async function main() { - getTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesListByCommunicationsGatewaySample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesListByCommunicationsGatewaySample.ts deleted file mode 100644 index 75fffd11c190..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesListByCommunicationsGatewaySample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List TestLine resources by CommunicationsGateway - * - * @summary List TestLine resources by CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_ListByCommunicationsGateway.json - */ -async function listTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.testLines.listByCommunicationsGateway( - resourceGroupName, - communicationsGatewayName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesUpdateSample.ts b/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesUpdateSample.ts deleted file mode 100644 index 0867189eaabb..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TestLineUpdate, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a TestLine - * - * @summary Update a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Update.json - */ -async function updateTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const properties: TestLineUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.update( - resourceGroupName, - communicationsGatewayName, - testLineName, - properties - ); - console.log(result); -} - -async function main() { - updateTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/README.md b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/README.md deleted file mode 100644 index 3be453af8979..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [communicationsGatewaysCreateOrUpdateSample.js][communicationsgatewayscreateorupdatesample] | Create a CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_CreateOrUpdate.json | -| [communicationsGatewaysDeleteSample.js][communicationsgatewaysdeletesample] | Delete a CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Delete.json | -| [communicationsGatewaysGetSample.js][communicationsgatewaysgetsample] | Get a CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Get.json | -| [communicationsGatewaysListByResourceGroupSample.js][communicationsgatewayslistbyresourcegroupsample] | List CommunicationsGateway resources by resource group x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListByResourceGroup.json | -| [communicationsGatewaysListBySubscriptionSample.js][communicationsgatewayslistbysubscriptionsample] | List CommunicationsGateway resources by subscription ID x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListBySubscription.json | -| [communicationsGatewaysUpdateSample.js][communicationsgatewaysupdatesample] | Update a CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Update.json | -| [nameAvailabilityCheckLocalSample.js][nameavailabilitychecklocalsample] | Check whether the resource name is available in the given region. x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/NameAvailability_CheckLocal.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/Operations_List.json | -| [testLinesCreateOrUpdateSample.js][testlinescreateorupdatesample] | Create a TestLine x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_CreateOrUpdate.json | -| [testLinesDeleteSample.js][testlinesdeletesample] | Delete a TestLine x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Delete.json | -| [testLinesGetSample.js][testlinesgetsample] | Get a TestLine x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Get.json | -| [testLinesListByCommunicationsGatewaySample.js][testlineslistbycommunicationsgatewaysample] | List TestLine resources by CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_ListByCommunicationsGateway.json | -| [testLinesUpdateSample.js][testlinesupdatesample] | Update a TestLine x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Update.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node communicationsGatewaysCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env VOICESERVICES_SUBSCRIPTION_ID="" VOICESERVICES_RESOURCE_GROUP="" node communicationsGatewaysCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[communicationsgatewayscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysCreateOrUpdateSample.js -[communicationsgatewaysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysDeleteSample.js -[communicationsgatewaysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysGetSample.js -[communicationsgatewayslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListByResourceGroupSample.js -[communicationsgatewayslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListBySubscriptionSample.js -[communicationsgatewaysupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysUpdateSample.js -[nameavailabilitychecklocalsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/nameAvailabilityCheckLocalSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/operationsListSample.js -[testlinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesCreateOrUpdateSample.js -[testlinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesDeleteSample.js -[testlinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesGetSample.js -[testlineslistbycommunicationsgatewaysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesListByCommunicationsGatewaySample.js -[testlinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-voiceservices?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/voiceservices/arm-voiceservices/README.md diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysCreateOrUpdateSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysCreateOrUpdateSample.js deleted file mode 100644 index ace1609414cc..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysCreateOrUpdateSample.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a CommunicationsGateway - * - * @summary Create a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_CreateOrUpdate.json - */ -async function createCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const resource = { - autoGeneratedDomainNameLabelScope: "NoReuse", - codecs: ["PCMA"], - connectivity: "PublicAddress", - e911Type: "Standard", - location: "useast", - platforms: ["OperatorConnect"], - serviceLocations: [ - { - name: "useast", - primaryRegionProperties: { - allowedMediaSourceAddressPrefixes: ["10.1.2.0/24"], - allowedSignalingSourceAddressPrefixes: ["10.1.1.0/24"], - operatorAddresses: ["198.51.100.1"], - }, - }, - { - name: "useast2", - primaryRegionProperties: { - allowedMediaSourceAddressPrefixes: ["10.2.2.0/24"], - allowedSignalingSourceAddressPrefixes: ["10.2.1.0/24"], - operatorAddresses: ["198.51.100.2"], - }, - }, - ], - teamsVoicemailPilotNumber: "1234567890", - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.beginCreateOrUpdateAndWait( - resourceGroupName, - communicationsGatewayName, - resource - ); - console.log(result); -} - -async function main() { - createCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysDeleteSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysDeleteSample.js deleted file mode 100644 index 919913bf8f9b..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysDeleteSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a CommunicationsGateway - * - * @summary Delete a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Delete.json - */ -async function deleteCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.beginDeleteAndWait( - resourceGroupName, - communicationsGatewayName - ); - console.log(result); -} - -async function main() { - deleteCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysGetSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysGetSample.js deleted file mode 100644 index 98c017320c56..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysGetSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a CommunicationsGateway - * - * @summary Get a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Get.json - */ -async function getCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.get( - resourceGroupName, - communicationsGatewayName - ); - console.log(result); -} - -async function main() { - getCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListByResourceGroupSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListByResourceGroupSample.js deleted file mode 100644 index fd0890a15a71..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List CommunicationsGateway resources by resource group - * - * @summary List CommunicationsGateway resources by resource group - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListByResourceGroup.json - */ -async function listCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.communicationsGateways.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListBySubscriptionSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListBySubscriptionSample.js deleted file mode 100644 index 79a793650fb2..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List CommunicationsGateway resources by subscription ID - * - * @summary List CommunicationsGateway resources by subscription ID - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListBySubscription.json - */ -async function listCommunicationsGatewayResourceSub() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.communicationsGateways.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listCommunicationsGatewayResourceSub(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysUpdateSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysUpdateSample.js deleted file mode 100644 index 2b714e561d37..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/communicationsGatewaysUpdateSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a CommunicationsGateway - * - * @summary Update a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Update.json - */ -async function updateCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.update( - resourceGroupName, - communicationsGatewayName, - properties - ); - console.log(result); -} - -async function main() { - updateCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/nameAvailabilityCheckLocalSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/nameAvailabilityCheckLocalSample.js deleted file mode 100644 index 5296404c86ad..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/nameAvailabilityCheckLocalSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Check whether the resource name is available in the given region. - * - * @summary Check whether the resource name is available in the given region. - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/NameAvailability_CheckLocal.json - */ -async function checkLocalNameAvailability() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const location = "useast"; - const body = { - name: "myname", - type: "Microsoft.VoiceServices/CommunicationsGateways", - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.nameAvailability.checkLocal(location, body); - console.log(result); -} - -async function main() { - checkLocalNameAvailability(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/operationsListSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index ee9573456fb7..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/package.json b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/package.json deleted file mode 100644 index bd0e68cb39ac..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-voiceservices-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=16.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/voiceservices/arm-voiceservices" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/voiceservices/arm-voiceservices", - "dependencies": { - "@azure/arm-voiceservices": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/sample.env b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesCreateOrUpdateSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesCreateOrUpdateSample.js deleted file mode 100644 index f9bf7aee911c..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesCreateOrUpdateSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a TestLine - * - * @summary Create a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_CreateOrUpdate.json - */ -async function createTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const resource = { - location: "useast", - phoneNumber: "+1-555-1234", - purpose: "Automated", - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.beginCreateOrUpdateAndWait( - resourceGroupName, - communicationsGatewayName, - testLineName, - resource - ); - console.log(result); -} - -async function main() { - createTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesDeleteSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesDeleteSample.js deleted file mode 100644 index b72303c5bfda..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a TestLine - * - * @summary Delete a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Delete.json - */ -async function deleteTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.beginDeleteAndWait( - resourceGroupName, - communicationsGatewayName, - testLineName - ); - console.log(result); -} - -async function main() { - deleteTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesGetSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesGetSample.js deleted file mode 100644 index cb93295ab665..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesGetSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a TestLine - * - * @summary Get a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Get.json - */ -async function getTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.get( - resourceGroupName, - communicationsGatewayName, - testLineName - ); - console.log(result); -} - -async function main() { - getTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesListByCommunicationsGatewaySample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesListByCommunicationsGatewaySample.js deleted file mode 100644 index ea6f65d519f2..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesListByCommunicationsGatewaySample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List TestLine resources by CommunicationsGateway - * - * @summary List TestLine resources by CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_ListByCommunicationsGateway.json - */ -async function listTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.testLines.listByCommunicationsGateway( - resourceGroupName, - communicationsGatewayName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesUpdateSample.js b/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesUpdateSample.js deleted file mode 100644 index e1ea48cd7cbf..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/javascript/testLinesUpdateSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a TestLine - * - * @summary Update a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Update.json - */ -async function updateTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.update( - resourceGroupName, - communicationsGatewayName, - testLineName, - properties - ); - console.log(result); -} - -async function main() { - updateTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/README.md b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/README.md deleted file mode 100644 index 45d789e65da1..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [communicationsGatewaysCreateOrUpdateSample.ts][communicationsgatewayscreateorupdatesample] | Create a CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_CreateOrUpdate.json | -| [communicationsGatewaysDeleteSample.ts][communicationsgatewaysdeletesample] | Delete a CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Delete.json | -| [communicationsGatewaysGetSample.ts][communicationsgatewaysgetsample] | Get a CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Get.json | -| [communicationsGatewaysListByResourceGroupSample.ts][communicationsgatewayslistbyresourcegroupsample] | List CommunicationsGateway resources by resource group x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListByResourceGroup.json | -| [communicationsGatewaysListBySubscriptionSample.ts][communicationsgatewayslistbysubscriptionsample] | List CommunicationsGateway resources by subscription ID x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListBySubscription.json | -| [communicationsGatewaysUpdateSample.ts][communicationsgatewaysupdatesample] | Update a CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Update.json | -| [nameAvailabilityCheckLocalSample.ts][nameavailabilitychecklocalsample] | Check whether the resource name is available in the given region. x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/NameAvailability_CheckLocal.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/Operations_List.json | -| [testLinesCreateOrUpdateSample.ts][testlinescreateorupdatesample] | Create a TestLine x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_CreateOrUpdate.json | -| [testLinesDeleteSample.ts][testlinesdeletesample] | Delete a TestLine x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Delete.json | -| [testLinesGetSample.ts][testlinesgetsample] | Get a TestLine x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Get.json | -| [testLinesListByCommunicationsGatewaySample.ts][testlineslistbycommunicationsgatewaysample] | List TestLine resources by CommunicationsGateway x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_ListByCommunicationsGateway.json | -| [testLinesUpdateSample.ts][testlinesupdatesample] | Update a TestLine x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Update.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/communicationsGatewaysCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env VOICESERVICES_SUBSCRIPTION_ID="" VOICESERVICES_RESOURCE_GROUP="" node dist/communicationsGatewaysCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[communicationsgatewayscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysCreateOrUpdateSample.ts -[communicationsgatewaysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysDeleteSample.ts -[communicationsgatewaysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysGetSample.ts -[communicationsgatewayslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListByResourceGroupSample.ts -[communicationsgatewayslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListBySubscriptionSample.ts -[communicationsgatewaysupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysUpdateSample.ts -[nameavailabilitychecklocalsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/nameAvailabilityCheckLocalSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/operationsListSample.ts -[testlinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesCreateOrUpdateSample.ts -[testlinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesDeleteSample.ts -[testlinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesGetSample.ts -[testlineslistbycommunicationsgatewaysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesListByCommunicationsGatewaySample.ts -[testlinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-voiceservices?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/voiceservices/arm-voiceservices/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/package.json b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/package.json deleted file mode 100644 index e77670daa4e0..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-voiceservices-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=16.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/voiceservices/arm-voiceservices" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/voiceservices/arm-voiceservices", - "dependencies": { - "@azure/arm-voiceservices": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^16.0.0", - "typescript": "~5.0.0", - "rimraf": "latest" - } -} diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/sample.env b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysCreateOrUpdateSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysCreateOrUpdateSample.ts deleted file mode 100644 index da4f636c10f2..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysCreateOrUpdateSample.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CommunicationsGateway, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a CommunicationsGateway - * - * @summary Create a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_CreateOrUpdate.json - */ -async function createCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const resource: CommunicationsGateway = { - autoGeneratedDomainNameLabelScope: "NoReuse", - codecs: ["PCMA"], - connectivity: "PublicAddress", - e911Type: "Standard", - location: "useast", - platforms: ["OperatorConnect"], - serviceLocations: [ - { - name: "useast", - primaryRegionProperties: { - allowedMediaSourceAddressPrefixes: ["10.1.2.0/24"], - allowedSignalingSourceAddressPrefixes: ["10.1.1.0/24"], - operatorAddresses: ["198.51.100.1"] - } - }, - { - name: "useast2", - primaryRegionProperties: { - allowedMediaSourceAddressPrefixes: ["10.2.2.0/24"], - allowedSignalingSourceAddressPrefixes: ["10.2.1.0/24"], - operatorAddresses: ["198.51.100.2"] - } - } - ], - teamsVoicemailPilotNumber: "1234567890" - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.beginCreateOrUpdateAndWait( - resourceGroupName, - communicationsGatewayName, - resource - ); - console.log(result); -} - -async function main() { - createCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysDeleteSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysDeleteSample.ts deleted file mode 100644 index 8624d9e756e8..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a CommunicationsGateway - * - * @summary Delete a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Delete.json - */ -async function deleteCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.beginDeleteAndWait( - resourceGroupName, - communicationsGatewayName - ); - console.log(result); -} - -async function main() { - deleteCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysGetSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysGetSample.ts deleted file mode 100644 index b114c601a9b7..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a CommunicationsGateway - * - * @summary Get a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Get.json - */ -async function getCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.get( - resourceGroupName, - communicationsGatewayName - ); - console.log(result); -} - -async function main() { - getCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListByResourceGroupSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListByResourceGroupSample.ts deleted file mode 100644 index 2fcd29eedacc..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List CommunicationsGateway resources by resource group - * - * @summary List CommunicationsGateway resources by resource group - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListByResourceGroup.json - */ -async function listCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.communicationsGateways.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListBySubscriptionSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListBySubscriptionSample.ts deleted file mode 100644 index 76c248ebd4c6..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List CommunicationsGateway resources by subscription ID - * - * @summary List CommunicationsGateway resources by subscription ID - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListBySubscription.json - */ -async function listCommunicationsGatewayResourceSub() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.communicationsGateways.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listCommunicationsGatewayResourceSub(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysUpdateSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysUpdateSample.ts deleted file mode 100644 index ebeb1e01da81..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CommunicationsGatewayUpdate, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a CommunicationsGateway - * - * @summary Update a CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Update.json - */ -async function updateCommunicationsGatewayResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const properties: CommunicationsGatewayUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.communicationsGateways.update( - resourceGroupName, - communicationsGatewayName, - properties - ); - console.log(result); -} - -async function main() { - updateCommunicationsGatewayResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/nameAvailabilityCheckLocalSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/nameAvailabilityCheckLocalSample.ts deleted file mode 100644 index e720cfd76de8..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/nameAvailabilityCheckLocalSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CheckNameAvailabilityRequest, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Check whether the resource name is available in the given region. - * - * @summary Check whether the resource name is available in the given region. - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/NameAvailability_CheckLocal.json - */ -async function checkLocalNameAvailability() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const location = "useast"; - const body: CheckNameAvailabilityRequest = { - name: "myname", - type: "Microsoft.VoiceServices/CommunicationsGateways" - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.nameAvailability.checkLocal(location, body); - console.log(result); -} - -async function main() { - checkLocalNameAvailability(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/operationsListSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index 55c8bc7fdbdc..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesCreateOrUpdateSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesCreateOrUpdateSample.ts deleted file mode 100644 index a9f3253939ba..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesCreateOrUpdateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TestLine, MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a TestLine - * - * @summary Create a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_CreateOrUpdate.json - */ -async function createTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const resource: TestLine = { - location: "useast", - phoneNumber: "+1-555-1234", - purpose: "Automated" - }; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.beginCreateOrUpdateAndWait( - resourceGroupName, - communicationsGatewayName, - testLineName, - resource - ); - console.log(result); -} - -async function main() { - createTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesDeleteSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesDeleteSample.ts deleted file mode 100644 index a4105d718fd9..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a TestLine - * - * @summary Delete a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Delete.json - */ -async function deleteTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.beginDeleteAndWait( - resourceGroupName, - communicationsGatewayName, - testLineName - ); - console.log(result); -} - -async function main() { - deleteTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesGetSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesGetSample.ts deleted file mode 100644 index 6fde8bcde412..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a TestLine - * - * @summary Get a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Get.json - */ -async function getTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.get( - resourceGroupName, - communicationsGatewayName, - testLineName - ); - console.log(result); -} - -async function main() { - getTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesListByCommunicationsGatewaySample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesListByCommunicationsGatewaySample.ts deleted file mode 100644 index 75fffd11c190..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesListByCommunicationsGatewaySample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List TestLine resources by CommunicationsGateway - * - * @summary List TestLine resources by CommunicationsGateway - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_ListByCommunicationsGateway.json - */ -async function listTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.testLines.listByCommunicationsGateway( - resourceGroupName, - communicationsGatewayName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesUpdateSample.ts b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesUpdateSample.ts deleted file mode 100644 index 0867189eaabb..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TestLineUpdate, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a TestLine - * - * @summary Update a TestLine - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Update.json - */ -async function updateTestLineResource() { - const subscriptionId = - process.env["VOICESERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["VOICESERVICES_RESOURCE_GROUP"] || "testrg"; - const communicationsGatewayName = "myname"; - const testLineName = "myline"; - const properties: TestLineUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new MicrosoftVoiceServices(credential, subscriptionId); - const result = await client.testLines.update( - resourceGroupName, - communicationsGatewayName, - testLineName, - properties - ); - console.log(result); -} - -async function main() { - updateTestLineResource(); -} - -main().catch(console.error); diff --git a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/tsconfig.json b/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/voiceservices/arm-voiceservices/src/microsoftVoiceServices.ts b/sdk/voiceservices/arm-voiceservices/src/microsoftVoiceServices.ts index c46ca8effeb7..969c62396187 100644 --- a/sdk/voiceservices/arm-voiceservices/src/microsoftVoiceServices.ts +++ b/sdk/voiceservices/arm-voiceservices/src/microsoftVoiceServices.ts @@ -60,7 +60,7 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-voiceservices/1.0.1`; + const packageDetails = `azsdk-js-arm-voiceservices/1.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -113,7 +113,7 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-01-31"; + this.apiVersion = options.apiVersion || "2023-04-03"; this.operations = new OperationsImpl(this); this.communicationsGateways = new CommunicationsGatewaysImpl(this); this.nameAvailability = new NameAvailabilityImpl(this); diff --git a/sdk/voiceservices/arm-voiceservices/src/models/index.ts b/sdk/voiceservices/arm-voiceservices/src/models/index.ts index e30278475f26..eacff8991d01 100644 --- a/sdk/voiceservices/arm-voiceservices/src/models/index.ts +++ b/sdk/voiceservices/arm-voiceservices/src/models/index.ts @@ -149,6 +149,38 @@ export interface PrimaryRegionProperties { allowedMediaSourceAddressPrefixes?: string[]; } +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** @@ -209,6 +241,8 @@ export interface CheckNameAvailabilityResponse { /** The type used for update operations of the CommunicationsGateway. */ export interface CommunicationsGatewayUpdate { + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; /** Resource tags. */ tags?: { [propertyName: string]: string }; } @@ -237,6 +271,8 @@ export interface TrackedResource extends Resource { /** A CommunicationsGateway resource */ export interface CommunicationsGateway extends TrackedResource { + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; /** * Resource provisioning state. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -270,6 +306,8 @@ export interface CommunicationsGateway extends TrackedResource { teamsVoicemailPilotNumber?: string; /** Whether an on-premises Mobile Control Point is in use. */ onPremMcpEnabled?: boolean; + /** Whether an integrated Mobile Control Point is in use. */ + integratedMcpEnabled?: boolean; /** A list of dial strings used for emergency calling. */ emergencyDialStrings?: string[]; } @@ -491,6 +529,30 @@ export enum KnownAutoGeneratedDomainNameLabelScope { */ export type AutoGeneratedDomainNameLabelScope = string; +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned, UserAssigned** + */ +export type ManagedServiceIdentityType = string; + /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { /** User */ diff --git a/sdk/voiceservices/arm-voiceservices/src/models/mappers.ts b/sdk/voiceservices/arm-voiceservices/src/models/mappers.ts index 1bf6bb3474a5..cfd7238cb44a 100644 --- a/sdk/voiceservices/arm-voiceservices/src/models/mappers.ts +++ b/sdk/voiceservices/arm-voiceservices/src/models/mappers.ts @@ -321,6 +321,68 @@ export const PrimaryRegionProperties: coreClient.CompositeMapper = { } }; +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -456,6 +518,13 @@ export const CommunicationsGatewayUpdate: coreClient.CompositeMapper = { name: "Composite", className: "CommunicationsGatewayUpdate", modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, tags: { serializedName: "tags", type: { @@ -541,6 +610,13 @@ export const CommunicationsGateway: coreClient.CompositeMapper = { className: "CommunicationsGateway", modelProperties: { ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -637,6 +713,13 @@ export const CommunicationsGateway: coreClient.CompositeMapper = { name: "Boolean" } }, + integratedMcpEnabled: { + defaultValue: false, + serializedName: "properties.integratedMcpEnabled", + type: { + name: "Boolean" + } + }, emergencyDialStrings: { defaultValue: ["911", "933"], serializedName: "properties.emergencyDialStrings", diff --git a/sdk/voiceservices/arm-voiceservices/src/models/parameters.ts b/sdk/voiceservices/arm-voiceservices/src/models/parameters.ts index de5c42640319..b2a8be284e9b 100644 --- a/sdk/voiceservices/arm-voiceservices/src/models/parameters.ts +++ b/sdk/voiceservices/arm-voiceservices/src/models/parameters.ts @@ -46,7 +46,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-01-31", + defaultValue: "2023-04-03", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/voiceservices/arm-voiceservices/test/sampleTest.ts b/sdk/voiceservices/arm-voiceservices/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/voiceservices/arm-voiceservices/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/voiceservices/arm-voiceservices/test/voiceservices_operations_test.spec.ts b/sdk/voiceservices/arm-voiceservices/test/voiceservices_operations_test.spec.ts deleted file mode 100644 index 47afa727d4fb..000000000000 --- a/sdk/voiceservices/arm-voiceservices/test/voiceservices_operations_test.spec.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { MicrosoftVoiceServices } from "../src/microsoftVoiceServices"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("voiceservices test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: MicrosoftVoiceServices; - let location: string; - let resourceGroup: string; - let communicationsGatewayName: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new MicrosoftVoiceServices(credential, subscriptionId, recorder.configureClientOptions({})); - location = "westcentralus"; - resourceGroup = "czwjstest"; - communicationsGatewayName = "mycgtest6";// if you got this error message"Existing entry found in CosmosDB for new resource mycgtest - reject the request" when creating, use a new name to create - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("communicationsGateways create test", async function () { - const res = await client.communicationsGateways.beginCreateOrUpdateAndWait( - resourceGroup, - communicationsGatewayName, - { - autoGeneratedDomainNameLabelScope: "NoReuse", - codecs: ["PCMA"], - connectivity: "PublicAddress", - e911Type: "Standard", - location, - platforms: ["OperatorConnect"], - serviceLocations: [ - { - name: location, - primaryRegionProperties: { - allowedMediaSourceAddressPrefixes: ["10.1.2.0/24"], - allowedSignalingSourceAddressPrefixes: ["10.1.1.0/24"], - operatorAddresses: ["198.51.100.1"] - } - }, - { - name: "eastus2", - primaryRegionProperties: { - allowedMediaSourceAddressPrefixes: ["10.2.2.0/24"], - allowedSignalingSourceAddressPrefixes: ["10.2.1.0/24"], - operatorAddresses: ["198.51.100.2"] - } - } - ], - teamsVoicemailPilotNumber: "1234567890" - }, - testPollingOptions); - assert.equal(res.name, communicationsGatewayName); - }); - - it("communicationsGateways get test", async function () { - const res = await client.communicationsGateways.get(resourceGroup, communicationsGatewayName); - assert.equal(res.name, communicationsGatewayName); - }); - - it("communicationsGateways list test", async function () { - const resArray = new Array(); - for await (let item of client.communicationsGateways.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("communicationsGateways delete test", async function () { - const resArray = new Array(); - const res = await client.communicationsGateways.beginDeleteAndWait(resourceGroup, communicationsGatewayName, testPollingOptions) - for await (let item of client.communicationsGateways.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); -}) diff --git a/sdk/voiceservices/arm-voiceservices/tsconfig.json b/sdk/voiceservices/arm-voiceservices/tsconfig.json index cb0098b6cb04..3e6ae96443f3 100644 --- a/sdk/voiceservices/arm-voiceservices/tsconfig.json +++ b/sdk/voiceservices/arm-voiceservices/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-voiceservices": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"