diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 1a2803bf0af9..3901b1381b64 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2540,7 +2540,7 @@ packages: version: 0.0.0 '@rush-temp/ai-inference@file:projects/ai-inference.tgz': - resolution: {integrity: sha512-jy3iCFAJq8qZFdMN0GEK8XNPi3lTfEIQEOM4jNCqE850gODahI+XXRqHMbrGUJd2tjmZMm0cKc6CQbjVxFsi/Q==, tarball: file:projects/ai-inference.tgz} + resolution: {integrity: sha512-3F/JVas1qHmWihXHHGxX6EUigHTNsftXBjspS6BMU6/lu/xDNMxKAY30DJMK90KyhH5UxZ+ZRwWlWbhKWW+2ow==, tarball: file:projects/ai-inference.tgz} version: 0.0.0 '@rush-temp/ai-language-conversations@file:projects/ai-language-conversations.tgz': @@ -2560,7 +2560,7 @@ packages: version: 0.0.0 '@rush-temp/ai-projects@file:projects/ai-projects.tgz': - resolution: {integrity: sha512-olWaOR+lScYd4KfOBFDagJ6zLA728vt+08hSgNDsM182EdAAAYN2c5dqJ7BsN/1rv7I6rb6lywdCSQ5gK9pABQ==, tarball: file:projects/ai-projects.tgz} + resolution: {integrity: sha512-rbzbhwz+05oHf7CC83pshBtWypNW2LVlSpfOOwkX3BmqB4MiHah+CmjehPDEKqpnn0vgU4GzdM0BeD4HoI9J1w==, tarball: file:projects/ai-projects.tgz} version: 0.0.0 '@rush-temp/ai-text-analytics@file:projects/ai-text-analytics.tgz': @@ -3576,7 +3576,7 @@ packages: version: 0.0.0 '@rush-temp/arm-voiceservices@file:projects/arm-voiceservices.tgz': - resolution: {integrity: sha512-HYbIk2qpXaFf7OhgFMcfPsLUDmrpV5gOOFg1uqF01U8xtCADikWFfWPwVY37Wen/R4FLwYilGtYwxjI/+nhQUA==, tarball: file:projects/arm-voiceservices.tgz} + resolution: {integrity: sha512-08yr+jARZ5xTNTupV+dPTknSUEccNWM8xaHdCo0qGis5/TgWFtG699CwHtAGHhL7SCQbzgMJP23XA0vTDBn2gA==, tarball: file:projects/arm-voiceservices.tgz} version: 0.0.0 '@rush-temp/arm-webpubsub@file:projects/arm-webpubsub.tgz': @@ -3884,7 +3884,7 @@ packages: version: 0.0.0 '@rush-temp/mixed-reality-remote-rendering@file:projects/mixed-reality-remote-rendering.tgz': - resolution: {integrity: sha512-4Wx6KxuTYKmgYWfmzLs2BW2MkwATk98Fdx88WL7/sa632gevVbfOCT5WWUUsqW2OtLN36jpr8Vi6UfKrxEON0g==, tarball: file:projects/mixed-reality-remote-rendering.tgz} + resolution: {integrity: sha512-TN6cq8PIrYAy/tJ4mQIkcRn1Wkr5lBxnDY8UeSvQP9D61ZN0iESKb4j+wnXPJp2RNKa9tBpg8NcOt5Jc7qhwaQ==, tarball: file:projects/mixed-reality-remote-rendering.tgz} version: 0.0.0 '@rush-temp/mock-hub@file:projects/mock-hub.tgz': @@ -3900,11 +3900,11 @@ packages: version: 0.0.0 '@rush-temp/monitor-opentelemetry@file:projects/monitor-opentelemetry.tgz': - resolution: {integrity: sha512-1K08pDS3mRgyqyPHPU/PS/Kwhn10bdtrh9sU9itLgfy+cj+Rn/KkMG0Y0ZIAqhPRYc1/LUdXBVR1LZ/l3gx0Iw==, tarball: file:projects/monitor-opentelemetry.tgz} + resolution: {integrity: sha512-HH9DSuPu9Flo0w2YXzGUnayl/lDLcTwcGEhht0VdjPe7ZwhakhOH8/VoxrZKQTdgseCZMpYDmWgB2BaKkUr/Mg==, tarball: file:projects/monitor-opentelemetry.tgz} version: 0.0.0 '@rush-temp/monitor-query@file:projects/monitor-query.tgz': - resolution: {integrity: sha512-FfDHQlhugBYGKJAG+Qvo0eA9RxpyaY0LHrPOjcmIyF8gy3hxeJf0+Z9/XSfi3jDrCdv+l1K3as1cbuiY48Or4Q==, tarball: file:projects/monitor-query.tgz} + resolution: {integrity: sha512-bQ0lyAnF/GBcL7pwA66f/U6sjezndhPmHkMCjdmz1MD93PYpaQvasNEGspFvjrnt8Xwcg0CmdnzeWbHE6obY1w==, tarball: file:projects/monitor-query.tgz} version: 0.0.0 '@rush-temp/notification-hubs@file:projects/notification-hubs.tgz': @@ -3912,7 +3912,7 @@ packages: version: 0.0.0 '@rush-temp/openai@file:projects/openai.tgz': - resolution: {integrity: sha512-QnN8rZhPnF3/GYsh3cLlyCb6JgnWdpPVrjGoau5jvxZQWcBIWb108P7yNZwXptJcPti/jGYJPFQuwRWW7CxgvA==, tarball: file:projects/openai.tgz} + resolution: {integrity: sha512-EB6z+wWho8coz2hCDFUcYTJ+Jw5CfJ20yzKpIZeNk4OxpglGY7XTSiWxsuCHa++eVGTTXRHMwG/gdOtAv9mZkw==, tarball: file:projects/openai.tgz} version: 0.0.0 '@rush-temp/opentelemetry-instrumentation-azure-sdk@file:projects/opentelemetry-instrumentation-azure-sdk.tgz': @@ -3980,7 +3980,7 @@ packages: version: 0.0.0 '@rush-temp/perf-monitor-opentelemetry@file:projects/perf-monitor-opentelemetry.tgz': - resolution: {integrity: sha512-dwzpNIZPU6i3RcqjhLVipjyiz3ZZMtjs7dOuCSH4TtaOyj5vgqVvQC61FbEsnQrI5coVWW0NEOmbNYbzkih1Yw==, tarball: file:projects/perf-monitor-opentelemetry.tgz} + resolution: {integrity: sha512-B6GNjGVtP+BWESkV/d2t2Kg4FhgyWAibL4khmjnhduwd14Cjtqf/Aoz7B71usfgEXEUE9KvkL3VUg2IVm+MLSw==, tarball: file:projects/perf-monitor-opentelemetry.tgz} version: 0.0.0 '@rush-temp/perf-monitor-query@file:projects/perf-monitor-query.tgz': @@ -4056,7 +4056,7 @@ packages: version: 0.0.0 '@rush-temp/service-bus@file:projects/service-bus.tgz': - resolution: {integrity: sha512-ICttr5Vkcza3Jpy5WP+rciaUvO8NRkplh7TEOk7RWExZR9GFF0hXTNbH11Id8/OSZ17v/vuWtwt+9GFLBeDsZw==, tarball: file:projects/service-bus.tgz} + resolution: {integrity: sha512-CEMwNWHdlbtYASoZFKNN3dzVF8Uno0LED5f7xmGV7kjawCq6iJuwxz4UhBDpDDdYYdG+cAIIcMZfUEj+cdcQsA==, tarball: file:projects/service-bus.tgz} version: 0.0.0 '@rush-temp/storage-blob-changefeed@file:projects/storage-blob-changefeed.tgz': @@ -18997,12 +18997,12 @@ snapshots: dependencies: '@azure/core-lro': 2.7.2 '@types/node': 18.19.76 - '@vitest/browser': 3.0.6(@types/node@18.19.76)(playwright@1.50.1)(typescript@5.7.3)(vite@6.1.1(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.6) + '@vitest/browser': 3.0.6(@types/node@18.19.76)(playwright@1.50.1)(typescript@5.6.3)(vite@6.1.1(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.6) '@vitest/coverage-istanbul': 3.0.6(vitest@3.0.6) dotenv: 16.4.7 playwright: 1.50.1 tslib: 2.8.1 - typescript: 5.7.3 + typescript: 5.6.3 vitest: 3.0.6(@types/debug@4.1.12)(@types/node@18.19.76)(@vitest/browser@3.0.6)(msw@2.7.2(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -27933,7 +27933,7 @@ snapshots: resolve-import: 1.4.6 rimraf: 5.0.10 sync-content: 1.0.2 - typescript: 5.7.3 + typescript: 5.8.2 walk-up-path: 3.0.1 tslib@2.8.1: {} diff --git a/sdk/voiceservices/arm-voiceservices/CHANGELOG.md b/sdk/voiceservices/arm-voiceservices/CHANGELOG.md index d42226ffca8f..12e13b5b16b4 100644 --- a/sdk/voiceservices/arm-voiceservices/CHANGELOG.md +++ b/sdk/voiceservices/arm-voiceservices/CHANGELOG.md @@ -1,15 +1,40 @@ # Release History - -## 1.0.1 (Unreleased) - + +## 2.0.0 (2025-03-04) + ### Features Added -### Breaking Changes + - Added Interface ApiBridgeProperties + - Added Interface CustomSipHeader + - Added Interface CustomSipHeadersProperties + - Added Interface DnsDelegationProperties + - Added Interface DnsDelegationsProperties + - Added Interface ManagedServiceIdentity + - Added Interface Sku + - Added Interface UserAssignedIdentity + - Added Type Alias ApiBridgeActivationState + - Added Type Alias ManagedServiceIdentityType + - Added Type Alias SkuTier + - Interface CommunicationsGateway has a new optional parameter allocatedMediaAddressPrefixes + - Interface CommunicationsGateway has a new optional parameter allocatedSignalingAddressPrefixes + - Interface CommunicationsGateway has a new optional parameter customSipHeaders + - Interface CommunicationsGateway has a new optional parameter dnsDelegations + - Interface CommunicationsGateway has a new optional parameter identity + - Interface CommunicationsGateway has a new optional parameter integratedMcpEnabled + - Interface CommunicationsGateway has a new optional parameter sku + - Interface CommunicationsGatewaysDeleteHeaders has a new optional parameter location + - Interface CommunicationsGatewayUpdate has a new optional parameter identity + - Interface CommunicationsGatewayUpdate has a new optional parameter sku + - Interface TestLinesDeleteHeaders has a new optional parameter location + - Added Enum KnownApiBridgeActivationState + - Added Enum KnownManagedServiceIdentityType + - Enum KnownCommunicationsPlatform has a new value TeamsDirectRouting -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Type of parameter apiBridge of interface CommunicationsGateway is changed from Record to ApiBridgeProperties + + ## 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/azsdk/js/mgmt/quickstart). diff --git a/sdk/voiceservices/arm-voiceservices/LICENSE b/sdk/voiceservices/arm-voiceservices/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/voiceservices/arm-voiceservices/LICENSE +++ b/sdk/voiceservices/arm-voiceservices/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/voiceservices/arm-voiceservices/README.md b/sdk/voiceservices/arm-voiceservices/README.md index 1d8eb9d6b8d5..1f1ada23d1a8 100644 --- a/sdk/voiceservices/arm-voiceservices/README.md +++ b/sdk/voiceservices/arm-voiceservices/README.md @@ -2,6 +2,8 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure MicrosoftVoiceServices client. + + [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/voiceservices/arm-voiceservices) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-voiceservices) | [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-voiceservices) | @@ -42,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure MicrosoftVoiceServices** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -62,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new MicrosoftVoiceServices(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -106,7 +105,7 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fvoiceservices%2Farm-voiceservices%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/voiceservices/arm-voiceservices/_meta.json b/sdk/voiceservices/arm-voiceservices/_meta.json index f73e2145c36c..d73fc6cdb158 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": "1e3132c2f308fd63ab800ce351d34851ada174fe", + "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.12", "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.21", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/voiceservices/arm-voiceservices/api-extractor.json b/sdk/voiceservices/arm-voiceservices/api-extractor.json index bfe186fa6dbb..d52afcc4253c 100644 --- a/sdk/voiceservices/arm-voiceservices/api-extractor.json +++ b/sdk/voiceservices/arm-voiceservices/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-voiceservices.d.ts" + "publicTrimmedFilePath": "./types/arm-voiceservices.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -28,4 +28,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 9a1f39b1f521..fb8559e072aa 100644 --- a/sdk/voiceservices/arm-voiceservices/package.json +++ b/sdk/voiceservices/arm-voiceservices/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for MicrosoftVoiceServices.", - "version": "1.0.1", + "version": "2.0.0", "engines": { "node": ">=18.0.0" }, @@ -11,9 +11,9 @@ "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", "@azure/core-client": "^1.9.2", - "@azure/core-lro": "^2.7.2", + "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.18.2", + "@azure/core-rest-pipeline": "^1.19.0", "tslib": "^2.8.1" }, "keywords": [ @@ -21,29 +21,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.5.0", + "@azure/identity": "^4.7.0", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", - "@vitest/browser": "^3.0.3", - "@vitest/coverage-istanbul": "^3.0.3", + "@vitest/browser": "^3.0.6", + "@vitest/coverage-istanbul": "^3.0.6", "dotenv": "^16.0.0", - "playwright": "^1.49.1", - "typescript": "~5.7.2", - "vitest": "^3.0.3" + "playwright": "^1.50.1", + "typescript": "~5.6.2", + "vitest": "^3.0.6" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -91,14 +93,6 @@ }, "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://learn.microsoft.com/javascript/api/@azure/arm-voiceservices?view=azure-node-preview" - }, "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -139,4 +133,4 @@ } } } -} +} \ 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..0661930cc8f0 100644 --- a/sdk/voiceservices/arm-voiceservices/review/arm-voiceservices.api.md +++ b/sdk/voiceservices/arm-voiceservices/review/arm-voiceservices.api.md @@ -13,6 +13,16 @@ import { SimplePollerLike } from '@azure/core-lro'; // @public export type ActionType = string; +// @public +export type ApiBridgeActivationState = string; + +// @public +export interface ApiBridgeProperties { + allowedAddressPrefixes?: string[]; + configureApiBridge?: ApiBridgeActivationState; + readonly endpointFqdns?: string[]; +} + // @public export type AutoGeneratedDomainNameLabelScope = string; @@ -34,17 +44,24 @@ export interface CheckNameAvailabilityResponse { // @public export interface CommunicationsGateway extends TrackedResource { - apiBridge?: Record; + readonly allocatedMediaAddressPrefixes?: string[]; + readonly allocatedSignalingAddressPrefixes?: string[]; + apiBridge?: ApiBridgeProperties; readonly autoGeneratedDomainNameLabel?: string; autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; codecs?: TeamsCodecs[]; connectivity?: Connectivity; + customSipHeaders?: CustomSipHeadersProperties; + dnsDelegations?: DnsDelegationsProperties; e911Type?: E911Type; emergencyDialStrings?: string[]; + identity?: ManagedServiceIdentity; + integratedMcpEnabled?: boolean; onPremMcpEnabled?: boolean; platforms?: CommunicationsPlatform[]; readonly provisioningState?: ProvisioningState; serviceLocations?: ServiceRegionProperties[]; + sku?: Sku; readonly status?: Status; teamsVoicemailPilotNumber?: string; } @@ -83,6 +100,7 @@ export type CommunicationsGatewaysCreateOrUpdateResponse = CommunicationsGateway // @public export interface CommunicationsGatewaysDeleteHeaders { + location?: string; retryAfter?: number; } @@ -136,6 +154,8 @@ export type CommunicationsGatewaysUpdateResponse = CommunicationsGateway; // @public export interface CommunicationsGatewayUpdate { + identity?: ManagedServiceIdentity; + sku?: Sku; tags?: { [propertyName: string]: string; }; @@ -150,6 +170,27 @@ export type Connectivity = string; // @public export type CreatedByType = string; +// @public +export interface CustomSipHeader { + name?: string; +} + +// @public +export interface CustomSipHeadersProperties { + headers?: CustomSipHeader[]; +} + +// @public +export interface DnsDelegationProperties { + domain?: string; + readonly nameServers?: string[]; +} + +// @public +export interface DnsDelegationsProperties { + delegations?: DnsDelegationProperties[]; +} + // @public export type E911Type = string; @@ -181,6 +222,12 @@ export enum KnownActionType { Internal = "Internal" } +// @public +export enum KnownApiBridgeActivationState { + Disabled = "disabled", + Enabled = "enabled" +} + // @public export enum KnownAutoGeneratedDomainNameLabelScope { NoReuse = "NoReuse", @@ -198,6 +245,7 @@ export enum KnownCheckNameAvailabilityReason { // @public export enum KnownCommunicationsPlatform { OperatorConnect = "OperatorConnect", + TeamsDirectRouting = "TeamsDirectRouting", TeamsPhoneMobile = "TeamsPhoneMobile" } @@ -220,6 +268,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 +312,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) @@ -364,6 +433,18 @@ export interface ServiceRegionProperties { primaryRegionProperties: PrimaryRegionProperties; } +// @public +export interface Sku { + capacity?: number; + family?: string; + name: string; + size?: string; + tier?: SkuTier; +} + +// @public +export type SkuTier = "Free" | "Basic" | "Standard" | "Premium"; + // @public export type Status = string; @@ -423,6 +504,7 @@ export type TestLinesCreateOrUpdateResponse = TestLine; // @public export interface TestLinesDeleteHeaders { + location?: string; retryAfter?: number; } @@ -475,6 +557,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/sample.env b/sdk/voiceservices/arm-voiceservices/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/voiceservices/arm-voiceservices/sample.env +++ b/sdk/voiceservices/arm-voiceservices/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file 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 e75cf7847d22..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysCreateOrUpdateSample.ts +++ /dev/null @@ -1,65 +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 type { CommunicationsGateway } from "@azure/arm-voiceservices"; -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 a0d9e3e4f92f..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysDeleteSample.ts +++ /dev/null @@ -1,36 +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 { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 989def08233d..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysGetSample.ts +++ /dev/null @@ -1,36 +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 { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 44ba58282f68..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +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 { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.communicationsGateways.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 38fe924ea39c..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +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 { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.communicationsGateways.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 05e1a9c3050d..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/communicationsGatewaysUpdateSample.ts +++ /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. - */ -import type { CommunicationsGatewayUpdate } from "@azure/arm-voiceservices"; -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 fe50241ba68d..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/nameAvailabilityCheckLocalSample.ts +++ /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. - */ -import type { CheckNameAvailabilityRequest } from "@azure/arm-voiceservices"; -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 06aaa6f14d10..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,34 +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 { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 5d479cdc3792..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesCreateOrUpdateSample.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. - */ -import type { TestLine } from "@azure/arm-voiceservices"; -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 daef70fc9631..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesDeleteSample.ts +++ /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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 f62a41fed62e..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesGetSample.ts +++ /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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 1c2f9083954b..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesListByCommunicationsGatewaySample.ts +++ /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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.testLines.listByCommunicationsGateway( - resourceGroupName, - communicationsGatewayName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 34b1e96a060c..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples-dev/testLinesUpdateSample.ts +++ /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. - */ -import type { TestLineUpdate } from "@azure/arm-voiceservices"; -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 23d865614296..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 dev-tool run vendored 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://learn.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 16519bdfc56d..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": ">=18.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": "^4.2.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 a10b021e9a54..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 dev-tool run vendored 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://learn.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 9290bd7fc9a2..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": ">=18.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": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.7.2", - "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 327b6f3c17db..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysCreateOrUpdateSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - CommunicationsGateway, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 5be7db2b0b8e..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysDeleteSample.ts +++ /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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 4fe6b106c1cd..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysGetSample.ts +++ /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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 2cf3bd5fca65..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListByResourceGroupSample.ts +++ /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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 accd549c8c39..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysListBySubscriptionSample.ts +++ /dev/null @@ -1,35 +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 { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 2f2ed8116047..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/communicationsGatewaysUpdateSample.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. - */ -import { - CommunicationsGatewayUpdate, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 c9017d60c45d..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/nameAvailabilityCheckLocalSample.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. - */ -import { - CheckNameAvailabilityRequest, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 7f983a10ca51..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,35 +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 { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 117ff17dd11f..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesCreateOrUpdateSample.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. - */ -import { TestLine, MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 b7c8163d94be..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesDeleteSample.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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 5bce2dc2b0b9..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesGetSample.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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 f5cbcbebc623..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesListByCommunicationsGatewaySample.ts +++ /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. - */ -import { MicrosoftVoiceServices } from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 2858d1cd18ee..000000000000 --- a/sdk/voiceservices/arm-voiceservices/samples/v1/typescript/src/testLinesUpdateSample.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. - */ -import { - TestLineUpdate, - MicrosoftVoiceServices -} from "@azure/arm-voiceservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 984eed535aa8..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/lroImpl.ts b/sdk/voiceservices/arm-voiceservices/src/lroImpl.ts index a1dab276a1b7..5f88efab981b 100644 --- a/sdk/voiceservices/arm-voiceservices/src/lroImpl.ts +++ b/sdk/voiceservices/arm-voiceservices/src/lroImpl.ts @@ -5,6 +5,10 @@ * 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 { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; @@ -24,15 +28,15 @@ export function createLroSpec(inputs: { sendInitialRequest: () => sendOperationFn(args, spec), sendPollRequest: ( path: string, - options?: { abortSignal?: AbortSignalLike } + options?: { abortSignal?: AbortSignalLike }, ) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/voiceservices/arm-voiceservices/src/microsoftVoiceServices.ts b/sdk/voiceservices/arm-voiceservices/src/microsoftVoiceServices.ts index b8862a960347..7ff3fdc0796b 100644 --- a/sdk/voiceservices/arm-voiceservices/src/microsoftVoiceServices.ts +++ b/sdk/voiceservices/arm-voiceservices/src/microsoftVoiceServices.ts @@ -11,20 +11,20 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, CommunicationsGatewaysImpl, NameAvailabilityImpl, - TestLinesImpl + TestLinesImpl, } from "./operations/index.js"; import { Operations, CommunicationsGateways, NameAvailability, - TestLines + TestLines, } from "./operationsInterfaces/index.js"; import { MicrosoftVoiceServicesOptionalParams } from "./models/index.js"; @@ -42,7 +42,7 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: MicrosoftVoiceServicesOptionalParams + options?: MicrosoftVoiceServicesOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -57,10 +57,10 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { } const defaults: MicrosoftVoiceServicesOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-voiceservices/1.0.1`; + const packageDetails = `azsdk-js-arm-voiceservices/2.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -70,20 +70,21 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -93,7 +94,7 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -103,9 +104,9 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -113,7 +114,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-09-01"; this.operations = new OperationsImpl(this); this.communicationsGateways = new CommunicationsGatewaysImpl(this); this.nameAvailability = new NameAvailabilityImpl(this); @@ -130,7 +131,7 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -144,7 +145,7 @@ export class MicrosoftVoiceServices extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/voiceservices/arm-voiceservices/src/models/index.ts b/sdk/voiceservices/arm-voiceservices/src/models/index.ts index e30278475f26..794cede8bd37 100644 --- a/sdk/voiceservices/arm-voiceservices/src/models/index.ts +++ b/sdk/voiceservices/arm-voiceservices/src/models/index.ts @@ -143,12 +143,100 @@ export interface PrimaryRegionProperties { operatorAddresses: string[]; /** IP address to use to contact the ESRP from this region */ esrpAddresses?: string[]; - /** The allowed source IP address or CIDR ranges for signaling */ + /** The allowed source IP addresses or CIDR ranges for signaling */ allowedSignalingSourceAddressPrefixes?: string[]; - /** The allowed source IP address or CIDR ranges for media */ + /** The allowed source IP addresses or CIDR ranges for media */ allowedMediaSourceAddressPrefixes?: string[]; } +/** Configuration of the API Bridge. */ +export interface ApiBridgeProperties { + /** The activation state of the API Bridge for this Communications Gateway */ + configureApiBridge?: ApiBridgeActivationState; + /** + * FQDNs for sending requests to the API Bridge endpoint + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endpointFqdns?: string[]; + /** The allowed source IP addresses or CIDR ranges for accessing the API Bridge */ + allowedAddressPrefixes?: string[]; +} + +/** Details of DNS Domains delegated to the Communications Gateway. */ +export interface DnsDelegationsProperties { + /** DNS Domains to delegate for the creation of DNS Zones by the Azure Communications Gateway */ + delegations?: DnsDelegationProperties[]; +} + +/** Details of a DNS Domain delegated to the Communications Gateway. */ +export interface DnsDelegationProperties { + /** Domain name to delegate */ + domain?: string; + /** + * The Azure-hosted DNS Name Servers for the delegated DNS Zones + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nameServers?: string[]; +} + +/** Properties of Custom SIP Headers. */ +export interface CustomSipHeadersProperties { + /** The Custom SIP Headers to apply to the calls which traverse the Communications Gateway */ + headers?: CustomSipHeader[]; +} + +/** Details of a Custom SIP Header. */ +export interface CustomSipHeader { + /** The name of the Custom SIP Header */ + name?: 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; +} + +/** The resource model definition representing SKU */ +export interface Sku { + /** The name of the SKU. Ex - P3. It is typically a letter+number code */ + name: string; + /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ + tier?: SkuTier; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ + family?: string; + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ + capacity?: number; +} + /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** @@ -209,6 +297,10 @@ 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; + /** The SKU (Stock Keeping Unit) assigned to this resource. */ + sku?: Sku; /** Resource tags. */ tags?: { [propertyName: string]: string }; } @@ -237,6 +329,10 @@ export interface TrackedResource extends Resource { /** A CommunicationsGateway resource */ export interface CommunicationsGateway extends TrackedResource { + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; + /** The SKU (Stock Keeping Unit) assigned to this resource. */ + sku?: Sku; /** * Resource provisioning state. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -258,7 +354,7 @@ export interface CommunicationsGateway extends TrackedResource { /** What platforms to support */ platforms?: CommunicationsPlatform[]; /** Details of API bridge functionality, if required */ - apiBridge?: Record; + apiBridge?: ApiBridgeProperties; /** The scope at which the auto-generated domain name can be re-used */ autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; /** @@ -270,8 +366,24 @@ 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[]; + /** Details of DNS Domains to delegate to the Communications Gateway. */ + dnsDelegations?: DnsDelegationsProperties; + /** Custom SIP Header to add to any subscriber with a custom_header value, if required. */ + customSipHeaders?: CustomSipHeadersProperties; + /** + * A list of IP allocated prefixes which may be used to receive signaling data from this Communications Gateway. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly allocatedSignalingAddressPrefixes?: string[]; + /** + * A list of allocated IP prefixes which may be used to receive media data from this Communications Gateway. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly allocatedMediaAddressPrefixes?: string[]; } /** A TestLine resource */ @@ -297,6 +409,8 @@ export interface CommunicationsGatewaysCreateOrUpdateHeaders { export interface CommunicationsGatewaysDeleteHeaders { /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ retryAfter?: number; + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; } /** Defines headers for TestLines_createOrUpdate operation. */ @@ -309,6 +423,8 @@ export interface TestLinesCreateOrUpdateHeaders { export interface TestLinesDeleteHeaders { /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ retryAfter?: number; + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; } /** Known values of {@link Origin} that the service accepts. */ @@ -318,7 +434,7 @@ export enum KnownOrigin { /** System */ System = "system", /** UserSystem */ - UserSystem = "user,system" + UserSystem = "user,system", } /** @@ -335,7 +451,7 @@ export type Origin = string; /** Known values of {@link ActionType} that the service accepts. */ export enum KnownActionType { /** Internal */ - Internal = "Internal" + Internal = "Internal", } /** @@ -349,12 +465,12 @@ export type ActionType = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { - /** Succeeded */ + /** Resource has been created. */ Succeeded = "Succeeded", - /** Failed */ + /** Resource creation failed. */ Failed = "Failed", - /** Canceled */ - Canceled = "Canceled" + /** Resource creation was canceled. */ + Canceled = "Canceled", } /** @@ -362,9 +478,9 @@ export enum KnownProvisioningState { * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Succeeded** \ - * **Failed** \ - * **Canceled** + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. */ export type ProvisioningState = string; @@ -373,7 +489,7 @@ export enum KnownStatus { /** The resource has been created or updated, but the CommunicationsGateway service has not yet been updated to reflect the changes. */ ChangePending = "ChangePending", /** The CommunicationsGateway service is up and running with the parameters specified in the resource. */ - Complete = "Complete" + Complete = "Complete", } /** @@ -389,7 +505,7 @@ export type Status = string; /** Known values of {@link Connectivity} that the service accepts. */ export enum KnownConnectivity { /** This deployment connects to the operator network using a Public IP address, e.g. when using MAPS */ - PublicAddress = "PublicAddress" + PublicAddress = "PublicAddress", } /** @@ -403,18 +519,18 @@ export type Connectivity = string; /** Known values of {@link TeamsCodecs} that the service accepts. */ export enum KnownTeamsCodecs { - /** Pcma */ + /** Pulse code modulation(PCM) U-law narrowband audio codec(G.711u) */ Pcma = "PCMA", - /** Pcmu */ + /** Pulse code modulation(PCM) U-law narrowband audio codec(G.711u) */ Pcmu = "PCMU", - /** G722 */ + /** G.722 wideband audio codec */ G722 = "G722", - /** G7222 */ + /** G.722.2 wideband audio codec */ G7222 = "G722_2", - /** Silk8 */ + /** SILK\/8000 narrowband audio codec */ Silk8 = "SILK_8", - /** Silk16 */ - Silk16 = "SILK_16" + /** SILK\/16000 wideband audio codec */ + Silk16 = "SILK_16", } /** @@ -422,12 +538,12 @@ export enum KnownTeamsCodecs { * {@link KnownTeamsCodecs} can be used interchangeably with TeamsCodecs, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **PCMA** \ - * **PCMU** \ - * **G722** \ - * **G722_2** \ - * **SILK_8** \ - * **SILK_16** + * **PCMA**: Pulse code modulation(PCM) U-law narrowband audio codec(G.711u) \ + * **PCMU**: Pulse code modulation(PCM) U-law narrowband audio codec(G.711u) \ + * **G722**: G.722 wideband audio codec \ + * **G722_2**: G.722.2 wideband audio codec \ + * **SILK_8**: SILK\/8000 narrowband audio codec \ + * **SILK_16**: SILK\/16000 wideband audio codec */ export type TeamsCodecs = string; @@ -436,7 +552,7 @@ export enum KnownE911Type { /** Emergency calls are not handled different from other calls */ Standard = "Standard", /** Emergency calls are routed directly to the ESRP */ - DirectToEsrp = "DirectToEsrp" + DirectToEsrp = "DirectToEsrp", } /** @@ -451,10 +567,12 @@ export type E911Type = string; /** Known values of {@link CommunicationsPlatform} that the service accepts. */ export enum KnownCommunicationsPlatform { - /** OperatorConnect */ + /** Operator Connect */ OperatorConnect = "OperatorConnect", - /** TeamsPhoneMobile */ - TeamsPhoneMobile = "TeamsPhoneMobile" + /** Teams Phone Mobile */ + TeamsPhoneMobile = "TeamsPhoneMobile", + /** Teams Direct Routing */ + TeamsDirectRouting = "TeamsDirectRouting", } /** @@ -462,21 +580,40 @@ export enum KnownCommunicationsPlatform { * {@link KnownCommunicationsPlatform} can be used interchangeably with CommunicationsPlatform, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **OperatorConnect** \ - * **TeamsPhoneMobile** + * **OperatorConnect**: Operator Connect \ + * **TeamsPhoneMobile**: Teams Phone Mobile \ + * **TeamsDirectRouting**: Teams Direct Routing */ export type CommunicationsPlatform = string; +/** Known values of {@link ApiBridgeActivationState} that the service accepts. */ +export enum KnownApiBridgeActivationState { + /** API Bridge is enabled */ + Enabled = "enabled", + /** API Bridge is disabled */ + Disabled = "disabled", +} + +/** + * Defines values for ApiBridgeActivationState. \ + * {@link KnownApiBridgeActivationState} can be used interchangeably with ApiBridgeActivationState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **enabled**: API Bridge is enabled \ + * **disabled**: API Bridge is disabled + */ +export type ApiBridgeActivationState = string; + /** Known values of {@link AutoGeneratedDomainNameLabelScope} that the service accepts. */ export enum KnownAutoGeneratedDomainNameLabelScope { - /** TenantReuse */ + /** Generated domain name label depends on resource name and tenant ID. */ TenantReuse = "TenantReuse", - /** SubscriptionReuse */ + /** Generated domain name label depends on resource name, tenant ID and subscription ID. */ SubscriptionReuse = "SubscriptionReuse", - /** ResourceGroupReuse */ + /** Generated domain name label depends on resource name, tenant ID, subscription ID and resource group name. */ ResourceGroupReuse = "ResourceGroupReuse", - /** NoReuse */ - NoReuse = "NoReuse" + /** Generated domain name label is always unique. */ + NoReuse = "NoReuse", } /** @@ -484,13 +621,37 @@ export enum KnownAutoGeneratedDomainNameLabelScope { * {@link KnownAutoGeneratedDomainNameLabelScope} can be used interchangeably with AutoGeneratedDomainNameLabelScope, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **TenantReuse** \ - * **SubscriptionReuse** \ - * **ResourceGroupReuse** \ - * **NoReuse** + * **TenantReuse**: Generated domain name label depends on resource name and tenant ID. \ + * **SubscriptionReuse**: Generated domain name label depends on resource name, tenant ID and subscription ID. \ + * **ResourceGroupReuse**: Generated domain name label depends on resource name, tenant ID, subscription ID and resource group name. \ + * **NoReuse**: Generated domain name label is always unique. */ 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 */ @@ -500,7 +661,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -520,7 +681,7 @@ export enum KnownCheckNameAvailabilityReason { /** Invalid */ Invalid = "Invalid", /** AlreadyExists */ - AlreadyExists = "AlreadyExists" + AlreadyExists = "AlreadyExists", } /** @@ -535,10 +696,10 @@ export type CheckNameAvailabilityReason = string; /** Known values of {@link TestLinePurpose} that the service accepts. */ export enum KnownTestLinePurpose { - /** Manual */ + /** The test line is used for manual testing */ Manual = "Manual", - /** Automated */ - Automated = "Automated" + /** The test line is used for automated testing */ + Automated = "Automated", } /** @@ -546,10 +707,12 @@ export enum KnownTestLinePurpose { * {@link KnownTestLinePurpose} can be used interchangeably with TestLinePurpose, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Manual** \ - * **Automated** + * **Manual**: The test line is used for manual testing \ + * **Automated**: The test line is used for automated testing */ export type TestLinePurpose = string; +/** Defines values for SkuTier. */ +export type SkuTier = "Free" | "Basic" | "Standard" | "Premium"; /** Optional parameters. */ export interface OperationsListOptionalParams @@ -570,14 +733,16 @@ export interface CommunicationsGatewaysListBySubscriptionOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBySubscription operation. */ -export type CommunicationsGatewaysListBySubscriptionResponse = CommunicationsGatewayListResult; +export type CommunicationsGatewaysListBySubscriptionResponse = + CommunicationsGatewayListResult; /** Optional parameters. */ export interface CommunicationsGatewaysListByResourceGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroup operation. */ -export type CommunicationsGatewaysListByResourceGroupResponse = CommunicationsGatewayListResult; +export type CommunicationsGatewaysListByResourceGroupResponse = + CommunicationsGatewayListResult; /** Optional parameters. */ export interface CommunicationsGatewaysGetOptionalParams @@ -596,7 +761,15 @@ export interface CommunicationsGatewaysCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type CommunicationsGatewaysCreateOrUpdateResponse = CommunicationsGateway; +export type CommunicationsGatewaysCreateOrUpdateResponse = + CommunicationsGateway; + +/** Optional parameters. */ +export interface CommunicationsGatewaysUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type CommunicationsGatewaysUpdateResponse = CommunicationsGateway; /** Optional parameters. */ export interface CommunicationsGatewaysDeleteOptionalParams @@ -607,26 +780,21 @@ export interface CommunicationsGatewaysDeleteOptionalParams resumeFrom?: string; } -/** Optional parameters. */ -export interface CommunicationsGatewaysUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type CommunicationsGatewaysUpdateResponse = CommunicationsGateway; - /** Optional parameters. */ export interface CommunicationsGatewaysListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ -export type CommunicationsGatewaysListBySubscriptionNextResponse = CommunicationsGatewayListResult; +export type CommunicationsGatewaysListBySubscriptionNextResponse = + CommunicationsGatewayListResult; /** Optional parameters. */ export interface CommunicationsGatewaysListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ -export type CommunicationsGatewaysListByResourceGroupNextResponse = CommunicationsGatewayListResult; +export type CommunicationsGatewaysListByResourceGroupNextResponse = + CommunicationsGatewayListResult; /** Optional parameters. */ export interface NameAvailabilityCheckLocalOptionalParams @@ -661,6 +829,13 @@ export interface TestLinesCreateOrUpdateOptionalParams /** Contains response data for the createOrUpdate operation. */ export type TestLinesCreateOrUpdateResponse = TestLine; +/** Optional parameters. */ +export interface TestLinesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type TestLinesUpdateResponse = TestLine; + /** Optional parameters. */ export interface TestLinesDeleteOptionalParams extends coreClient.OperationOptions { @@ -670,19 +845,13 @@ export interface TestLinesDeleteOptionalParams resumeFrom?: string; } -/** Optional parameters. */ -export interface TestLinesUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type TestLinesUpdateResponse = TestLine; - /** Optional parameters. */ export interface TestLinesListByCommunicationsGatewayNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByCommunicationsGatewayNext operation. */ -export type TestLinesListByCommunicationsGatewayNextResponse = TestLineListResult; +export type TestLinesListByCommunicationsGatewayNextResponse = + TestLineListResult; /** Optional parameters. */ export interface MicrosoftVoiceServicesOptionalParams diff --git a/sdk/voiceservices/arm-voiceservices/src/models/mappers.ts b/sdk/voiceservices/arm-voiceservices/src/models/mappers.ts index 1bf6bb3474a5..20157f700419 100644 --- a/sdk/voiceservices/arm-voiceservices/src/models/mappers.ts +++ b/sdk/voiceservices/arm-voiceservices/src/models/mappers.ts @@ -21,20 +21,20 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -46,39 +46,39 @@ export const Operation: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } + className: "OperationDisplay", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, actionType: { serializedName: "actionType", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -90,32 +90,32 @@ export const OperationDisplay: coreClient.CompositeMapper = { serializedName: "provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -127,11 +127,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -143,22 +143,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -168,10 +168,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -181,13 +181,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -199,19 +199,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const CommunicationsGatewayListResult: coreClient.CompositeMapper = { @@ -227,19 +227,19 @@ export const CommunicationsGatewayListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CommunicationsGateway" - } - } - } + className: "CommunicationsGateway", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ServiceRegionProperties: coreClient.CompositeMapper = { @@ -251,18 +251,18 @@ export const ServiceRegionProperties: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, primaryRegionProperties: { serializedName: "primaryRegionProperties", type: { name: "Composite", - className: "PrimaryRegionProperties" - } - } - } - } + className: "PrimaryRegionProperties", + }, + }, + }, + }, }; export const PrimaryRegionProperties: coreClient.CompositeMapper = { @@ -277,10 +277,10 @@ export const PrimaryRegionProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, esrpAddresses: { serializedName: "esrpAddresses", @@ -288,10 +288,10 @@ export const PrimaryRegionProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, allowedSignalingSourceAddressPrefixes: { defaultValue: [], @@ -300,10 +300,10 @@ export const PrimaryRegionProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, allowedMediaSourceAddressPrefixes: { defaultValue: [], @@ -312,13 +312,238 @@ export const PrimaryRegionProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const ApiBridgeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiBridgeProperties", + modelProperties: { + configureApiBridge: { + serializedName: "configureApiBridge", + type: { + name: "String", + }, + }, + endpointFqdns: { + serializedName: "endpointFqdns", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + allowedAddressPrefixes: { + serializedName: "allowedAddressPrefixes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const DnsDelegationsProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DnsDelegationsProperties", + modelProperties: { + delegations: { + serializedName: "delegations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DnsDelegationProperties", + }, + }, + }, + }, + }, + }, +}; + +export const DnsDelegationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DnsDelegationProperties", + modelProperties: { + domain: { + serializedName: "domain", + type: { + name: "String", + }, + }, + nameServers: { + serializedName: "nameServers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const CustomSipHeadersProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomSipHeadersProperties", + modelProperties: { + headers: { + serializedName: "headers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomSipHeader", + }, + }, + }, + }, + }, + }, +}; + +export const CustomSipHeader: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomSipHeader", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + }, + }, +}; + +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 Sku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + tier: { + serializedName: "tier", + type: { + name: "Enum", + allowedValues: ["Free", "Basic", "Standard", "Premium"], + }, + }, + size: { + serializedName: "size", + type: { + name: "String", + }, + }, + family: { + serializedName: "family", + type: { + name: "String", + }, + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -330,32 +555,32 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } - } - } - } + className: "SystemData", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -366,41 +591,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const CheckNameAvailabilityRequest: coreClient.CompositeMapper = { @@ -411,17 +636,17 @@ export const CheckNameAvailabilityRequest: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CheckNameAvailabilityResponse: coreClient.CompositeMapper = { @@ -432,23 +657,23 @@ export const CheckNameAvailabilityResponse: coreClient.CompositeMapper = { nameAvailable: { serializedName: "nameAvailable", type: { - name: "Boolean" - } + name: "Boolean", + }, }, reason: { serializedName: "reason", type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CommunicationsGatewayUpdate: coreClient.CompositeMapper = { @@ -456,15 +681,29 @@ export const CommunicationsGatewayUpdate: coreClient.CompositeMapper = { name: "Composite", className: "CommunicationsGatewayUpdate", modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity", + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const TestLineListResult: coreClient.CompositeMapper = { @@ -480,19 +719,19 @@ export const TestLineListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TestLine" - } - } - } + className: "TestLine", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TestLineUpdate: coreClient.CompositeMapper = { @@ -504,11 +743,11 @@ export const TestLineUpdate: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const TrackedResource: coreClient.CompositeMapper = { @@ -521,18 +760,18 @@ export const TrackedResource: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, location: { serializedName: "location", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CommunicationsGateway: coreClient.CompositeMapper = { @@ -541,19 +780,33 @@ export const CommunicationsGateway: coreClient.CompositeMapper = { className: "CommunicationsGateway", modelProperties: { ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity", + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, status: { serializedName: "properties.status", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, serviceLocations: { serializedName: "properties.serviceLocations", @@ -562,16 +815,16 @@ export const CommunicationsGateway: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ServiceRegionProperties" - } - } - } + className: "ServiceRegionProperties", + }, + }, + }, }, connectivity: { serializedName: "properties.connectivity", type: { - name: "String" - } + name: "String", + }, }, codecs: { serializedName: "properties.codecs", @@ -579,63 +832,70 @@ export const CommunicationsGateway: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, e911Type: { serializedName: "properties.e911Type", type: { - name: "String" - } + name: "String", + }, }, platforms: { constraints: { - MinItems: 1 + MinItems: 1, }, serializedName: "properties.platforms", type: { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, apiBridge: { serializedName: "properties.apiBridge", type: { - name: "Dictionary", - value: { type: { name: "any" } } - } + name: "Composite", + className: "ApiBridgeProperties", + }, }, autoGeneratedDomainNameLabelScope: { serializedName: "properties.autoGeneratedDomainNameLabelScope", type: { - name: "String" - } + name: "String", + }, }, autoGeneratedDomainNameLabel: { serializedName: "properties.autoGeneratedDomainNameLabel", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, teamsVoicemailPilotNumber: { serializedName: "properties.teamsVoicemailPilotNumber", type: { - name: "String" - } + name: "String", + }, }, onPremMcpEnabled: { defaultValue: false, serializedName: "properties.onPremMcpEnabled", type: { - name: "Boolean" - } + name: "Boolean", + }, + }, + integratedMcpEnabled: { + defaultValue: false, + serializedName: "properties.integratedMcpEnabled", + type: { + name: "Boolean", + }, }, emergencyDialStrings: { defaultValue: ["911", "933"], @@ -644,13 +904,51 @@ export const CommunicationsGateway: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + dnsDelegations: { + serializedName: "properties.dnsDelegations", + type: { + name: "Composite", + className: "DnsDelegationsProperties", + }, + }, + customSipHeaders: { + serializedName: "properties.customSipHeaders", + type: { + name: "Composite", + className: "CustomSipHeadersProperties", + }, + }, + allocatedSignalingAddressPrefixes: { + serializedName: "properties.allocatedSignalingAddressPrefixes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + allocatedMediaAddressPrefixes: { + serializedName: "properties.allocatedMediaAddressPrefixes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, }; export const TestLine: coreClient.CompositeMapper = { @@ -663,39 +961,40 @@ export const TestLine: coreClient.CompositeMapper = { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, phoneNumber: { serializedName: "properties.phoneNumber", type: { - name: "String" - } + name: "String", + }, }, purpose: { serializedName: "properties.purpose", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const CommunicationsGatewaysCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunicationsGatewaysCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number" - } - } - } - } -}; +export const CommunicationsGatewaysCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CommunicationsGatewaysCreateOrUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; export const CommunicationsGatewaysDeleteHeaders: coreClient.CompositeMapper = { type: { @@ -705,11 +1004,17 @@ export const CommunicationsGatewaysDeleteHeaders: coreClient.CompositeMapper = { retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, }; export const TestLinesCreateOrUpdateHeaders: coreClient.CompositeMapper = { @@ -720,11 +1025,11 @@ export const TestLinesCreateOrUpdateHeaders: coreClient.CompositeMapper = { retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; export const TestLinesDeleteHeaders: coreClient.CompositeMapper = { @@ -735,9 +1040,15 @@ export const TestLinesDeleteHeaders: coreClient.CompositeMapper = { retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/voiceservices/arm-voiceservices/src/models/parameters.ts b/sdk/voiceservices/arm-voiceservices/src/models/parameters.ts index 0a6bb6a3e3c9..c18af6b75497 100644 --- a/sdk/voiceservices/arm-voiceservices/src/models/parameters.ts +++ b/sdk/voiceservices/arm-voiceservices/src/models/parameters.ts @@ -9,14 +9,14 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { CommunicationsGateway as CommunicationsGatewayMapper, CommunicationsGatewayUpdate as CommunicationsGatewayUpdateMapper, CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper, TestLine as TestLineMapper, - TestLineUpdate as TestLineUpdateMapper + TestLineUpdate as TestLineUpdateMapper, } from "../models/mappers.js"; export const accept: OperationParameter = { @@ -26,9 +26,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -37,22 +37,22 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-01-31", + defaultValue: "2023-09-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -61,24 +61,24 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { constraints: { - MinLength: 1 + MinLength: 1, }, serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -86,28 +86,28 @@ export const resourceGroupName: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const communicationsGatewayName: OperationURLParameter = { parameterPath: "communicationsGatewayName", mapper: { constraints: { - Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$") + Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$"), }, serializedName: "communicationsGatewayName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -117,24 +117,24 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resource: OperationParameter = { parameterPath: "resource", - mapper: CommunicationsGatewayMapper + mapper: CommunicationsGatewayMapper, }; export const properties: OperationParameter = { parameterPath: "properties", - mapper: CommunicationsGatewayUpdateMapper + mapper: CommunicationsGatewayUpdateMapper, }; export const body: OperationParameter = { parameterPath: "body", - mapper: CheckNameAvailabilityRequestMapper + mapper: CheckNameAvailabilityRequestMapper, }; export const location: OperationURLParameter = { @@ -143,31 +143,31 @@ export const location: OperationURLParameter = { serializedName: "location", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const testLineName: OperationURLParameter = { parameterPath: "testLineName", mapper: { constraints: { - Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$") + Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$"), }, serializedName: "testLineName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resource1: OperationParameter = { parameterPath: "resource", - mapper: TestLineMapper + mapper: TestLineMapper, }; export const properties1: OperationParameter = { parameterPath: "properties", - mapper: TestLineUpdateMapper + mapper: TestLineUpdateMapper, }; diff --git a/sdk/voiceservices/arm-voiceservices/src/operations/communicationsGateways.ts b/sdk/voiceservices/arm-voiceservices/src/operations/communicationsGateways.ts index 516482337198..3f37bccb9b2b 100644 --- a/sdk/voiceservices/arm-voiceservices/src/operations/communicationsGateways.ts +++ b/sdk/voiceservices/arm-voiceservices/src/operations/communicationsGateways.ts @@ -16,7 +16,7 @@ import { MicrosoftVoiceServices } from "../microsoftVoiceServices.js"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { @@ -31,12 +31,12 @@ import { CommunicationsGatewaysGetResponse, CommunicationsGatewaysCreateOrUpdateOptionalParams, CommunicationsGatewaysCreateOrUpdateResponse, - CommunicationsGatewaysDeleteOptionalParams, CommunicationsGatewayUpdate, CommunicationsGatewaysUpdateOptionalParams, CommunicationsGatewaysUpdateResponse, + CommunicationsGatewaysDeleteOptionalParams, CommunicationsGatewaysListBySubscriptionNextResponse, - CommunicationsGatewaysListByResourceGroupNextResponse + CommunicationsGatewaysListByResourceGroupNextResponse, } from "../models/index.js"; /// @@ -57,7 +57,7 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { * @param options The options parameters. */ public listBySubscription( - options?: CommunicationsGatewaysListBySubscriptionOptionalParams + options?: CommunicationsGatewaysListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -72,13 +72,13 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: CommunicationsGatewaysListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CommunicationsGatewaysListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -99,7 +99,7 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { } private async *listBySubscriptionPagingAll( - options?: CommunicationsGatewaysListBySubscriptionOptionalParams + options?: CommunicationsGatewaysListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -113,7 +113,7 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { */ public listByResourceGroup( resourceGroupName: string, - options?: CommunicationsGatewaysListByResourceGroupOptionalParams + options?: CommunicationsGatewaysListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -130,16 +130,16 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: CommunicationsGatewaysListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CommunicationsGatewaysListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -154,7 +154,7 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -165,11 +165,11 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: CommunicationsGatewaysListByResourceGroupOptionalParams + options?: CommunicationsGatewaysListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -180,11 +180,11 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { * @param options The options parameters. */ private _listBySubscription( - options?: CommunicationsGatewaysListBySubscriptionOptionalParams + options?: CommunicationsGatewaysListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -195,11 +195,11 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { */ private _listByResourceGroup( resourceGroupName: string, - options?: CommunicationsGatewaysListByResourceGroupOptionalParams + options?: CommunicationsGatewaysListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -212,11 +212,11 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { get( resourceGroupName: string, communicationsGatewayName: string, - options?: CommunicationsGatewaysGetOptionalParams + options?: CommunicationsGatewaysGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, communicationsGatewayName, options }, - getOperationSpec + getOperationSpec, ); } @@ -231,7 +231,7 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { resourceGroupName: string, communicationsGatewayName: string, resource: CommunicationsGateway, - options?: CommunicationsGatewaysCreateOrUpdateOptionalParams + options?: CommunicationsGatewaysCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -240,21 +240,20 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -263,8 +262,8 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -272,15 +271,15 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, communicationsGatewayName, resource, options }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< CommunicationsGatewaysCreateOrUpdateResponse, @@ -288,7 +287,7 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -305,17 +304,36 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { resourceGroupName: string, communicationsGatewayName: string, resource: CommunicationsGateway, - options?: CommunicationsGatewaysCreateOrUpdateOptionalParams + options?: CommunicationsGatewaysCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, communicationsGatewayName, resource, - options + options, ); return poller.pollUntilDone(); } + /** + * Update a CommunicationsGateway + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationsGatewayName Unique identifier for this deployment + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + communicationsGatewayName: string, + properties: CommunicationsGatewayUpdate, + options?: CommunicationsGatewaysUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communicationsGatewayName, properties, options }, + updateOperationSpec, + ); + } + /** * Delete a CommunicationsGateway * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -325,25 +343,24 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { async beginDelete( resourceGroupName: string, communicationsGatewayName: string, - options?: CommunicationsGatewaysDeleteOptionalParams + options?: CommunicationsGatewaysDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -352,8 +369,8 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -361,20 +378,20 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, communicationsGatewayName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -389,35 +406,16 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { async beginDeleteAndWait( resourceGroupName: string, communicationsGatewayName: string, - options?: CommunicationsGatewaysDeleteOptionalParams + options?: CommunicationsGatewaysDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, communicationsGatewayName, - options + options, ); return poller.pollUntilDone(); } - /** - * Update a CommunicationsGateway - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationsGatewayName Unique identifier for this deployment - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - communicationsGatewayName: string, - properties: CommunicationsGatewayUpdate, - options?: CommunicationsGatewaysUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, communicationsGatewayName, properties, options }, - updateOperationSpec - ); - } - /** * ListBySubscriptionNext * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. @@ -425,11 +423,11 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { */ private _listBySubscriptionNext( nextLink: string, - options?: CommunicationsGatewaysListBySubscriptionNextOptionalParams + options?: CommunicationsGatewaysListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } @@ -442,11 +440,11 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: CommunicationsGatewaysListByResourceGroupNextOptionalParams + options?: CommunicationsGatewaysListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } } @@ -454,85 +452,81 @@ export class CommunicationsGatewaysImpl implements CommunicationsGateways { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.VoiceServices/communicationsGateways", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.VoiceServices/communicationsGateways", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommunicationsGatewayListResult + bodyMapper: Mappers.CommunicationsGatewayListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommunicationsGatewayListResult + bodyMapper: Mappers.CommunicationsGatewayListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommunicationsGateway + bodyMapper: Mappers.CommunicationsGateway, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.communicationsGatewayName + Parameters.communicationsGatewayName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.CommunicationsGateway + bodyMapper: Mappers.CommunicationsGateway, }, 201: { - bodyMapper: Mappers.CommunicationsGateway + bodyMapper: Mappers.CommunicationsGateway, }, 202: { - bodyMapper: Mappers.CommunicationsGateway + bodyMapper: Mappers.CommunicationsGateway, }, 204: { - bodyMapper: Mappers.CommunicationsGateway + bodyMapper: Mappers.CommunicationsGateway, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.resource, queryParameters: [Parameters.apiVersion], @@ -540,95 +534,93 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.communicationsGatewayName + Parameters.communicationsGatewayName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}", - httpMethod: "DELETE", +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}", + httpMethod: "PATCH", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.CommunicationsGateway, + }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.properties, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.communicationsGatewayName + Parameters.communicationsGatewayName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}", - httpMethod: "PATCH", +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.CommunicationsGateway - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.properties, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.communicationsGatewayName + Parameters.communicationsGatewayName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommunicationsGatewayListResult + bodyMapper: Mappers.CommunicationsGatewayListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommunicationsGatewayListResult + bodyMapper: Mappers.CommunicationsGatewayListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/voiceservices/arm-voiceservices/src/operations/nameAvailability.ts b/sdk/voiceservices/arm-voiceservices/src/operations/nameAvailability.ts index 56a3e51b2f76..5098b6951f5b 100644 --- a/sdk/voiceservices/arm-voiceservices/src/operations/nameAvailability.ts +++ b/sdk/voiceservices/arm-voiceservices/src/operations/nameAvailability.ts @@ -14,7 +14,7 @@ import { MicrosoftVoiceServices } from "../microsoftVoiceServices.js"; import { CheckNameAvailabilityRequest, NameAvailabilityCheckLocalOptionalParams, - NameAvailabilityCheckLocalResponse + NameAvailabilityCheckLocalResponse, } from "../models/index.js"; /** Class containing NameAvailability operations. */ @@ -38,11 +38,11 @@ export class NameAvailabilityImpl implements NameAvailability { checkLocal( location: string, body: CheckNameAvailabilityRequest, - options?: NameAvailabilityCheckLocalOptionalParams + options?: NameAvailabilityCheckLocalOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, body, options }, - checkLocalOperationSpec + checkLocalOperationSpec, ); } } @@ -50,25 +50,24 @@ export class NameAvailabilityImpl implements NameAvailability { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const checkLocalOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.VoiceServices/locations/{location}/checkNameAvailability", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.VoiceServices/locations/{location}/checkNameAvailability", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CheckNameAvailabilityResponse + bodyMapper: Mappers.CheckNameAvailabilityResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.body, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; diff --git a/sdk/voiceservices/arm-voiceservices/src/operations/operations.ts b/sdk/voiceservices/arm-voiceservices/src/operations/operations.ts index 17f3cad4e47f..82e9d1d29d41 100644 --- a/sdk/voiceservices/arm-voiceservices/src/operations/operations.ts +++ b/sdk/voiceservices/arm-voiceservices/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models/index.js"; /// @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,29 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/voiceservices/arm-voiceservices/src/operations/testLines.ts b/sdk/voiceservices/arm-voiceservices/src/operations/testLines.ts index 69995819fa03..60b23bde0afb 100644 --- a/sdk/voiceservices/arm-voiceservices/src/operations/testLines.ts +++ b/sdk/voiceservices/arm-voiceservices/src/operations/testLines.ts @@ -16,7 +16,7 @@ import { MicrosoftVoiceServices } from "../microsoftVoiceServices.js"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { @@ -28,11 +28,11 @@ import { TestLinesGetResponse, TestLinesCreateOrUpdateOptionalParams, TestLinesCreateOrUpdateResponse, - TestLinesDeleteOptionalParams, TestLineUpdate, TestLinesUpdateOptionalParams, TestLinesUpdateResponse, - TestLinesListByCommunicationsGatewayNextResponse + TestLinesDeleteOptionalParams, + TestLinesListByCommunicationsGatewayNextResponse, } from "../models/index.js"; /// @@ -57,12 +57,12 @@ export class TestLinesImpl implements TestLines { public listByCommunicationsGateway( resourceGroupName: string, communicationsGatewayName: string, - options?: TestLinesListByCommunicationsGatewayOptionalParams + options?: TestLinesListByCommunicationsGatewayOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByCommunicationsGatewayPagingAll( resourceGroupName, communicationsGatewayName, - options + options, ); return { next() { @@ -79,9 +79,9 @@ export class TestLinesImpl implements TestLines { resourceGroupName, communicationsGatewayName, options, - settings + settings, ); - } + }, }; } @@ -89,7 +89,7 @@ export class TestLinesImpl implements TestLines { resourceGroupName: string, communicationsGatewayName: string, options?: TestLinesListByCommunicationsGatewayOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TestLinesListByCommunicationsGatewayResponse; let continuationToken = settings?.continuationToken; @@ -97,7 +97,7 @@ export class TestLinesImpl implements TestLines { result = await this._listByCommunicationsGateway( resourceGroupName, communicationsGatewayName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -109,7 +109,7 @@ export class TestLinesImpl implements TestLines { resourceGroupName, communicationsGatewayName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -121,12 +121,12 @@ export class TestLinesImpl implements TestLines { private async *listByCommunicationsGatewayPagingAll( resourceGroupName: string, communicationsGatewayName: string, - options?: TestLinesListByCommunicationsGatewayOptionalParams + options?: TestLinesListByCommunicationsGatewayOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByCommunicationsGatewayPagingPage( resourceGroupName, communicationsGatewayName, - options + options, )) { yield* page; } @@ -141,11 +141,11 @@ export class TestLinesImpl implements TestLines { private _listByCommunicationsGateway( resourceGroupName: string, communicationsGatewayName: string, - options?: TestLinesListByCommunicationsGatewayOptionalParams + options?: TestLinesListByCommunicationsGatewayOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, communicationsGatewayName, options }, - listByCommunicationsGatewayOperationSpec + listByCommunicationsGatewayOperationSpec, ); } @@ -160,11 +160,11 @@ export class TestLinesImpl implements TestLines { resourceGroupName: string, communicationsGatewayName: string, testLineName: string, - options?: TestLinesGetOptionalParams + options?: TestLinesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, communicationsGatewayName, testLineName, options }, - getOperationSpec + getOperationSpec, ); } @@ -181,7 +181,7 @@ export class TestLinesImpl implements TestLines { communicationsGatewayName: string, testLineName: string, resource: TestLine, - options?: TestLinesCreateOrUpdateOptionalParams + options?: TestLinesCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -190,21 +190,20 @@ export class TestLinesImpl implements TestLines { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -213,8 +212,8 @@ export class TestLinesImpl implements TestLines { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -222,8 +221,8 @@ export class TestLinesImpl implements TestLines { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -234,9 +233,9 @@ export class TestLinesImpl implements TestLines { communicationsGatewayName, testLineName, resource, - options + options, }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< TestLinesCreateOrUpdateResponse, @@ -244,7 +243,7 @@ export class TestLinesImpl implements TestLines { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -263,18 +262,45 @@ export class TestLinesImpl implements TestLines { communicationsGatewayName: string, testLineName: string, resource: TestLine, - options?: TestLinesCreateOrUpdateOptionalParams + options?: TestLinesCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, communicationsGatewayName, testLineName, resource, - options + options, ); return poller.pollUntilDone(); } + /** + * Update a TestLine + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationsGatewayName Unique identifier for this deployment + * @param testLineName Unique identifier for this test line + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + communicationsGatewayName: string, + testLineName: string, + properties: TestLineUpdate, + options?: TestLinesUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + communicationsGatewayName, + testLineName, + properties, + options, + }, + updateOperationSpec, + ); + } + /** * Delete a TestLine * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -286,25 +312,24 @@ export class TestLinesImpl implements TestLines { resourceGroupName: string, communicationsGatewayName: string, testLineName: string, - options?: TestLinesDeleteOptionalParams + options?: TestLinesDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -313,8 +338,8 @@ export class TestLinesImpl implements TestLines { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -322,8 +347,8 @@ export class TestLinesImpl implements TestLines { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -333,14 +358,14 @@ export class TestLinesImpl implements TestLines { resourceGroupName, communicationsGatewayName, testLineName, - options + options, }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -357,44 +382,17 @@ export class TestLinesImpl implements TestLines { resourceGroupName: string, communicationsGatewayName: string, testLineName: string, - options?: TestLinesDeleteOptionalParams + options?: TestLinesDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, communicationsGatewayName, testLineName, - options + options, ); return poller.pollUntilDone(); } - /** - * Update a TestLine - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationsGatewayName Unique identifier for this deployment - * @param testLineName Unique identifier for this test line - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - communicationsGatewayName: string, - testLineName: string, - properties: TestLineUpdate, - options?: TestLinesUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - communicationsGatewayName, - testLineName, - properties, - options - }, - updateOperationSpec - ); - } - /** * ListByCommunicationsGatewayNext * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -407,11 +405,11 @@ export class TestLinesImpl implements TestLines { resourceGroupName: string, communicationsGatewayName: string, nextLink: string, - options?: TestLinesListByCommunicationsGatewayNextOptionalParams + options?: TestLinesListByCommunicationsGatewayNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, communicationsGatewayName, nextLink, options }, - listByCommunicationsGatewayNextOperationSpec + listByCommunicationsGatewayNextOperationSpec, ); } } @@ -419,38 +417,36 @@ export class TestLinesImpl implements TestLines { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listByCommunicationsGatewayOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TestLineListResult + bodyMapper: Mappers.TestLineListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.communicationsGatewayName + Parameters.communicationsGatewayName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TestLine + bodyMapper: Mappers.TestLine, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -458,31 +454,30 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationsGatewayName, - Parameters.testLineName + Parameters.testLineName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.TestLine + bodyMapper: Mappers.TestLine, }, 201: { - bodyMapper: Mappers.TestLine + bodyMapper: Mappers.TestLine, }, 202: { - bodyMapper: Mappers.TestLine + bodyMapper: Mappers.TestLine, }, 204: { - bodyMapper: Mappers.TestLine + bodyMapper: Mappers.TestLine, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.resource1, queryParameters: [Parameters.apiVersion], @@ -491,79 +486,77 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationsGatewayName, - Parameters.testLineName + Parameters.testLineName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}", - httpMethod: "DELETE", +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}", + httpMethod: "PATCH", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.TestLine, + }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.properties1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationsGatewayName, - Parameters.testLineName + Parameters.testLineName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}", - httpMethod: "PATCH", +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.TestLine - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.properties1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationsGatewayName, - Parameters.testLineName + Parameters.testLineName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; const listByCommunicationsGatewayNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TestLineListResult + bodyMapper: Mappers.TestLineListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.communicationsGatewayName + Parameters.communicationsGatewayName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/communicationsGateways.ts b/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/communicationsGateways.ts index 816f40e3e211..27bf46584996 100644 --- a/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/communicationsGateways.ts +++ b/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/communicationsGateways.ts @@ -16,10 +16,10 @@ import { CommunicationsGatewaysGetResponse, CommunicationsGatewaysCreateOrUpdateOptionalParams, CommunicationsGatewaysCreateOrUpdateResponse, - CommunicationsGatewaysDeleteOptionalParams, CommunicationsGatewayUpdate, CommunicationsGatewaysUpdateOptionalParams, - CommunicationsGatewaysUpdateResponse + CommunicationsGatewaysUpdateResponse, + CommunicationsGatewaysDeleteOptionalParams, } from "../models/index.js"; /// @@ -30,7 +30,7 @@ export interface CommunicationsGateways { * @param options The options parameters. */ listBySubscription( - options?: CommunicationsGatewaysListBySubscriptionOptionalParams + options?: CommunicationsGatewaysListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * List CommunicationsGateway resources by resource group @@ -39,7 +39,7 @@ export interface CommunicationsGateways { */ listByResourceGroup( resourceGroupName: string, - options?: CommunicationsGatewaysListByResourceGroupOptionalParams + options?: CommunicationsGatewaysListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Get a CommunicationsGateway @@ -50,7 +50,7 @@ export interface CommunicationsGateways { get( resourceGroupName: string, communicationsGatewayName: string, - options?: CommunicationsGatewaysGetOptionalParams + options?: CommunicationsGatewaysGetOptionalParams, ): Promise; /** * Create a CommunicationsGateway @@ -63,7 +63,7 @@ export interface CommunicationsGateways { resourceGroupName: string, communicationsGatewayName: string, resource: CommunicationsGateway, - options?: CommunicationsGatewaysCreateOrUpdateOptionalParams + options?: CommunicationsGatewaysCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -81,41 +81,41 @@ export interface CommunicationsGateways { resourceGroupName: string, communicationsGatewayName: string, resource: CommunicationsGateway, - options?: CommunicationsGatewaysCreateOrUpdateOptionalParams + options?: CommunicationsGatewaysCreateOrUpdateOptionalParams, ): Promise; /** - * Delete a CommunicationsGateway + * Update a CommunicationsGateway * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationsGatewayName Unique identifier for this deployment + * @param properties The resource properties to be updated. * @param options The options parameters. */ - beginDelete( + update( resourceGroupName: string, communicationsGatewayName: string, - options?: CommunicationsGatewaysDeleteOptionalParams - ): Promise, void>>; + properties: CommunicationsGatewayUpdate, + options?: CommunicationsGatewaysUpdateOptionalParams, + ): Promise; /** * Delete a CommunicationsGateway * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationsGatewayName Unique identifier for this deployment * @param options The options parameters. */ - beginDeleteAndWait( + beginDelete( resourceGroupName: string, communicationsGatewayName: string, - options?: CommunicationsGatewaysDeleteOptionalParams - ): Promise; + options?: CommunicationsGatewaysDeleteOptionalParams, + ): Promise, void>>; /** - * Update a CommunicationsGateway + * Delete a CommunicationsGateway * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationsGatewayName Unique identifier for this deployment - * @param properties The resource properties to be updated. * @param options The options parameters. */ - update( + beginDeleteAndWait( resourceGroupName: string, communicationsGatewayName: string, - properties: CommunicationsGatewayUpdate, - options?: CommunicationsGatewaysUpdateOptionalParams - ): Promise; + options?: CommunicationsGatewaysDeleteOptionalParams, + ): Promise; } diff --git a/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/nameAvailability.ts b/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/nameAvailability.ts index de7f017b6622..133edb697ce8 100644 --- a/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/nameAvailability.ts +++ b/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/nameAvailability.ts @@ -9,7 +9,7 @@ import { CheckNameAvailabilityRequest, NameAvailabilityCheckLocalOptionalParams, - NameAvailabilityCheckLocalResponse + NameAvailabilityCheckLocalResponse, } from "../models/index.js"; /** Interface representing a NameAvailability. */ @@ -23,6 +23,6 @@ export interface NameAvailability { checkLocal( location: string, body: CheckNameAvailabilityRequest, - options?: NameAvailabilityCheckLocalOptionalParams + options?: NameAvailabilityCheckLocalOptionalParams, ): Promise; } diff --git a/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/operations.ts b/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/operations.ts index 3142994d382b..2c280c7eb723 100644 --- a/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/operations.ts +++ b/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/testLines.ts b/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/testLines.ts index 7989928a8355..87cd05317580 100644 --- a/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/testLines.ts +++ b/sdk/voiceservices/arm-voiceservices/src/operationsInterfaces/testLines.ts @@ -15,10 +15,10 @@ import { TestLinesGetResponse, TestLinesCreateOrUpdateOptionalParams, TestLinesCreateOrUpdateResponse, - TestLinesDeleteOptionalParams, TestLineUpdate, TestLinesUpdateOptionalParams, - TestLinesUpdateResponse + TestLinesUpdateResponse, + TestLinesDeleteOptionalParams, } from "../models/index.js"; /// @@ -33,7 +33,7 @@ export interface TestLines { listByCommunicationsGateway( resourceGroupName: string, communicationsGatewayName: string, - options?: TestLinesListByCommunicationsGatewayOptionalParams + options?: TestLinesListByCommunicationsGatewayOptionalParams, ): PagedAsyncIterableIterator; /** * Get a TestLine @@ -46,7 +46,7 @@ export interface TestLines { resourceGroupName: string, communicationsGatewayName: string, testLineName: string, - options?: TestLinesGetOptionalParams + options?: TestLinesGetOptionalParams, ): Promise; /** * Create a TestLine @@ -61,7 +61,7 @@ export interface TestLines { communicationsGatewayName: string, testLineName: string, resource: TestLine, - options?: TestLinesCreateOrUpdateOptionalParams + options?: TestLinesCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -81,21 +81,23 @@ export interface TestLines { communicationsGatewayName: string, testLineName: string, resource: TestLine, - options?: TestLinesCreateOrUpdateOptionalParams + options?: TestLinesCreateOrUpdateOptionalParams, ): Promise; /** - * Delete a TestLine + * Update a TestLine * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationsGatewayName Unique identifier for this deployment * @param testLineName Unique identifier for this test line + * @param properties The resource properties to be updated. * @param options The options parameters. */ - beginDelete( + update( resourceGroupName: string, communicationsGatewayName: string, testLineName: string, - options?: TestLinesDeleteOptionalParams - ): Promise, void>>; + properties: TestLineUpdate, + options?: TestLinesUpdateOptionalParams, + ): Promise; /** * Delete a TestLine * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -103,25 +105,23 @@ export interface TestLines { * @param testLineName Unique identifier for this test line * @param options The options parameters. */ - beginDeleteAndWait( + beginDelete( resourceGroupName: string, communicationsGatewayName: string, testLineName: string, - options?: TestLinesDeleteOptionalParams - ): Promise; + options?: TestLinesDeleteOptionalParams, + ): Promise, void>>; /** - * Update a TestLine + * Delete a TestLine * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationsGatewayName Unique identifier for this deployment * @param testLineName Unique identifier for this test line - * @param properties The resource properties to be updated. * @param options The options parameters. */ - update( + beginDeleteAndWait( resourceGroupName: string, communicationsGatewayName: string, testLineName: string, - properties: TestLineUpdate, - options?: TestLinesUpdateOptionalParams - ): Promise; + options?: TestLinesDeleteOptionalParams, + ): Promise; } diff --git a/sdk/voiceservices/arm-voiceservices/src/pagingHelper.ts b/sdk/voiceservices/arm-voiceservices/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/voiceservices/arm-voiceservices/src/pagingHelper.ts +++ b/sdk/voiceservices/arm-voiceservices/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/voiceservices/arm-voiceservices/test/sampleTest.ts b/sdk/voiceservices/arm-voiceservices/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/voiceservices/arm-voiceservices/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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, +} from "@azure-tools/test-recorder"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/voiceservices/arm-voiceservices/test/snippets.spec.ts b/sdk/voiceservices/arm-voiceservices/test/snippets.spec.ts index 8ba87b0e27f3..6cedee866e5d 100644 --- a/sdk/voiceservices/arm-voiceservices/test/snippets.spec.ts +++ b/sdk/voiceservices/arm-voiceservices/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new MicrosoftVoiceServices(new DefaultAzureCredential(), subscriptionId); + const client = new MicrosoftVoiceServices( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { 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 67e6388386e0..000000000000 --- a/sdk/voiceservices/arm-voiceservices/test/voiceservices_operations_test.spec.ts +++ /dev/null @@ -1,118 +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 type { RecorderStartOptions } from "@azure-tools/test-recorder"; -import { env, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { MicrosoftVoiceServices } from "../src/microsoftVoiceServices.js"; -import { describe, it, assert, beforeEach, afterEach } from "vitest"; - -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, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -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 (ctx) => { - recorder = new Recorder(ctx); - 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 () => { - await recorder.stop(); - }); - - it("communicationsGateways create test", async () => { - 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 () => { - const res = await client.communicationsGateways.get(resourceGroup, communicationsGatewayName); - assert.equal(res.name, communicationsGatewayName); - }); - - it("communicationsGateways list test", async () => { - const resArray = new Array(); - for await (const item of client.communicationsGateways.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("communicationsGateways delete test", async () => { - const resArray = new Array(); - for await (const 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 19ceb382b521..b35d05ad6e9d 100644 --- a/sdk/voiceservices/arm-voiceservices/tsconfig.json +++ b/sdk/voiceservices/arm-voiceservices/tsconfig.json @@ -1,13 +1,27 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file