diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c1abeafa46e3..0d67a4324cfb 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -15300,7 +15300,7 @@ packages: dev: false file:projects/arm-notificationhubs.tgz: - resolution: {integrity: sha512-jKI293g20PoBmUCOGlCyMaqSELaMO10wwcclQyqOwdJJrophygB6lLXXFW8APhhlo8DhtAOv1/jIf9OWzodipQ==, tarball: file:projects/arm-notificationhubs.tgz} + resolution: {integrity: sha512-L/TPUrFMgUGOKK8Rp5cNS8eBrczORDjtNhi+RN5PcZyh7Xyja4HvVKsBmlwgnrAu65OMXYk5ki5cyHFjQ5DHGw==, tarball: file:projects/arm-notificationhubs.tgz} name: '@rush-temp/arm-notificationhubs' version: 0.0.0 dependencies: @@ -15312,7 +15312,9 @@ packages: '@types/node': 18.19.24 chai: 4.3.10 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.4.5 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.3.0 rimraf: 5.0.5 ts-node: 10.9.2(@types/node@18.19.24)(typescript@5.3.3) diff --git a/sdk/notificationhubs/arm-notificationhubs/CHANGELOG.md b/sdk/notificationhubs/arm-notificationhubs/CHANGELOG.md index c5c415e4a3bd..d16fc0c9fa54 100644 --- a/sdk/notificationhubs/arm-notificationhubs/CHANGELOG.md +++ b/sdk/notificationhubs/arm-notificationhubs/CHANGELOG.md @@ -1,15 +1,176 @@ # Release History + +## 3.0.0-beta.1 (2024-03-18) + +**Features** -## 2.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group PrivateEndpointConnections + - Added operation Namespaces.beginCreateOrUpdate + - Added operation Namespaces.beginCreateOrUpdateAndWait + - Added operation Namespaces.delete + - Added operation Namespaces.getPnsCredentials + - Added operation Namespaces.update + - Added operation NotificationHubs.update + - Added Interface Availability + - Added Interface BrowserCredential + - Added Interface ConnectionDetails + - Added Interface ErrorAdditionalInfo + - Added Interface ErrorDetail + - Added Interface FcmV1Credential + - Added Interface GroupConnectivityInformation + - Added Interface IpRule + - Added Interface LogSpecification + - Added Interface MetricSpecification + - Added Interface NamespaceProperties + - Added Interface NamespacesGetPnsCredentialsOptionalParams + - Added Interface NamespacesUpdateOptionalParams + - Added Interface NetworkAcls + - Added Interface NotificationHubsUpdateOptionalParams + - Added Interface OperationProperties + - Added Interface PnsCredentials + - Added Interface PolicyKeyResource + - Added Interface PrivateEndpointConnectionProperties + - Added Interface PrivateEndpointConnectionResource + - Added Interface PrivateEndpointConnectionResourceListResult + - Added Interface PrivateEndpointConnectionsDeleteHeaders + - Added Interface PrivateEndpointConnectionsDeleteOptionalParams + - Added Interface PrivateEndpointConnectionsGetGroupIdOptionalParams + - Added Interface PrivateEndpointConnectionsGetOptionalParams + - Added Interface PrivateEndpointConnectionsListGroupIdsOptionalParams + - Added Interface PrivateEndpointConnectionsListOptionalParams + - Added Interface PrivateEndpointConnectionsUpdateOptionalParams + - Added Interface PrivateLinkResource + - Added Interface PrivateLinkResourceListResult + - Added Interface PrivateLinkResourceProperties + - Added Interface PrivateLinkServiceConnection + - Added Interface ProxyResource + - Added Interface PublicInternetAuthorizationRule + - Added Interface RegistrationResult + - Added Interface RemotePrivateEndpointConnection + - Added Interface RemotePrivateLinkServiceConnectionState + - Added Interface ServiceSpecification + - Added Interface SystemData + - Added Interface TrackedResource + - Added Interface XiaomiCredential + - Added Type Alias CreatedByType + - Added Type Alias NamespacesGetPnsCredentialsResponse + - Added Type Alias NamespaceStatus + - Added Type Alias NamespacesUpdateResponse + - Added Type Alias NotificationHubsUpdateResponse + - Added Type Alias OperationProvisioningState + - Added Type Alias PolicyKeyType + - Added Type Alias PrivateEndpointConnectionProvisioningState + - Added Type Alias PrivateEndpointConnectionsDeleteResponse + - Added Type Alias PrivateEndpointConnectionsGetGroupIdResponse + - Added Type Alias PrivateEndpointConnectionsGetResponse + - Added Type Alias PrivateEndpointConnectionsListGroupIdsResponse + - Added Type Alias PrivateEndpointConnectionsListResponse + - Added Type Alias PrivateEndpointConnectionsUpdateResponse + - Added Type Alias PrivateLinkConnectionStatus + - Added Type Alias PublicNetworkAccess + - Added Type Alias ReplicationRegion + - Added Type Alias ZoneRedundancyPreference + - Interface CheckAvailabilityResult has a new optional parameter location + - Interface CheckAvailabilityResult has a new optional parameter sku + - Interface CheckAvailabilityResult has a new optional parameter tags + - Interface DebugSendResponse has a new optional parameter location + - Interface DebugSendResponse has a new optional parameter tags + - Interface ErrorResponse has a new optional parameter error + - Interface NamespacePatchParameters has a new optional parameter properties + - Interface NamespaceResource has a new optional parameter networkAcls + - Interface NamespaceResource has a new optional parameter pnsCredentials + - Interface NamespaceResource has a new optional parameter privateEndpointConnections + - Interface NamespaceResource has a new optional parameter publicNetworkAccess + - Interface NamespaceResource has a new optional parameter replicationRegion + - Interface NamespaceResource has a new optional parameter zoneRedundancy + - Interface NamespacesCreateOrUpdateOptionalParams has a new optional parameter resumeFrom + - Interface NamespacesCreateOrUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface NamespacesListAllOptionalParams has a new optional parameter skipToken + - Interface NamespacesListAllOptionalParams has a new optional parameter top + - Interface NamespacesListOptionalParams has a new optional parameter skipToken + - Interface NamespacesListOptionalParams has a new optional parameter top + - Interface NotificationHubPatchParameters has a new optional parameter browserCredential + - Interface NotificationHubPatchParameters has a new optional parameter dailyMaxActiveDevices + - Interface NotificationHubPatchParameters has a new optional parameter fcmV1Credential + - Interface NotificationHubPatchParameters has a new optional parameter name + - Interface NotificationHubPatchParameters has a new optional parameter sku + - Interface NotificationHubPatchParameters has a new optional parameter tags + - Interface NotificationHubPatchParameters has a new optional parameter xiaomiCredential + - Interface NotificationHubResource has a new optional parameter browserCredential + - Interface NotificationHubResource has a new optional parameter dailyMaxActiveDevices + - Interface NotificationHubResource has a new optional parameter fcmV1Credential + - Interface NotificationHubResource has a new optional parameter sku + - Interface NotificationHubResource has a new optional parameter xiaomiCredential + - Interface NotificationHubsListOptionalParams has a new optional parameter skipToken + - Interface NotificationHubsListOptionalParams has a new optional parameter top + - Interface Operation has a new optional parameter isDataAction + - Interface Operation has a new optional parameter properties + - Interface OperationDisplay has a new optional parameter description + - Interface PnsCredentialsResource has a new optional parameter browserCredential + - Interface PnsCredentialsResource has a new optional parameter fcmV1Credential + - Interface PnsCredentialsResource has a new optional parameter location + - Interface PnsCredentialsResource has a new optional parameter tags + - Interface PnsCredentialsResource has a new optional parameter xiaomiCredential + - Interface Resource has a new optional parameter systemData + - Interface SharedAccessAuthorizationRuleResource has a new optional parameter location + - Interface SharedAccessAuthorizationRuleResource has a new optional parameter tags + - Interface WnsCredential has a new optional parameter certificateKey + - Interface WnsCredential has a new optional parameter wnsCertificate + - Added Enum KnownAccessRights + - Added Enum KnownCreatedByType + - Added Enum KnownNamespaceStatus + - Added Enum KnownNamespaceType + - Added Enum KnownOperationProvisioningState + - Added Enum KnownPolicyKeyType + - Added Enum KnownPrivateEndpointConnectionProvisioningState + - Added Enum KnownPrivateLinkConnectionStatus + - Added Enum KnownPublicNetworkAccess + - Added Enum KnownReplicationRegion + - Added Enum KnownZoneRedundancyPreference -### Other Changes +**Breaking Changes** + - Removed operation Namespaces.beginDelete + - Removed operation Namespaces.beginDeleteAndWait + - Removed operation Namespaces.createOrUpdate + - Removed operation Namespaces.patch + - Removed operation NotificationHubs.patch + - Operation Namespaces.createOrUpdateAuthorizationRule has a new signature + - Operation Namespaces.regenerateKeys has a new signature + - Operation NotificationHubs.createOrUpdate has a new signature + - Operation NotificationHubs.createOrUpdateAuthorizationRule has a new signature + - Operation NotificationHubs.regenerateKeys has a new signature + - Interface ErrorResponse no longer has parameter code + - Interface ErrorResponse no longer has parameter message + - Interface NamespacesDeleteOptionalParams no longer has parameter resumeFrom + - Interface NamespacesDeleteOptionalParams no longer has parameter updateIntervalInMs + - Interface NotificationHubPatchParameters no longer has parameter namePropertiesName + - Interface NotificationHubsDebugSendOptionalParams no longer has parameter parameters + - Interface Resource no longer has parameter location + - Interface Resource no longer has parameter sku + - Interface Resource no longer has parameter tags + - Interface NamespaceResource has a new required parameter sku + - Parameter authTokenUrl of interface AdmCredential is now required + - Parameter clientId of interface AdmCredential is now required + - Parameter clientSecret of interface AdmCredential is now required + - Parameter endpoint of interface ApnsCredential is now required + - Parameter baiduApiKey of interface BaiduCredential is now required + - Parameter baiduEndPoint of interface BaiduCredential is now required + - Parameter baiduSecretKey of interface BaiduCredential is now required + - Parameter googleApiKey of interface GcmCredential is now required + - Parameter certificateKey of interface MpnsCredential is now required + - Parameter mpnsCertificate of interface MpnsCredential is now required + - Parameter thumbprint of interface MpnsCredential is now required + - Parameter rights of interface SharedAccessAuthorizationRuleProperties is now required + - Type of parameter results of interface DebugSendResponse is changed from Record to RegistrationResult[] + - Type of parameter provisioningState of interface NamespaceResource is changed from string to OperationProvisioningState + - Type of parameter status of interface NamespaceResource is changed from string to NamespaceStatus + - Type of parameter createdTime of interface SharedAccessAuthorizationRuleProperties is changed from string to Date + - Type of parameter modifiedTime of interface SharedAccessAuthorizationRuleProperties is changed from string to Date + - Type of parameter createdTime of interface SharedAccessAuthorizationRuleResource is changed from string to Date + - Type of parameter modifiedTime of interface SharedAccessAuthorizationRuleResource is changed from string to Date + + ## 2.1.0 (2022-12-01) **Features** @@ -38,4 +199,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/notificationhubs/arm-notificationhubs/LICENSE b/sdk/notificationhubs/arm-notificationhubs/LICENSE index 5d1d36e0af80..7d5934740965 100644 --- a/sdk/notificationhubs/arm-notificationhubs/LICENSE +++ b/sdk/notificationhubs/arm-notificationhubs/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2024 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/notificationhubs/arm-notificationhubs/README.md b/sdk/notificationhubs/arm-notificationhubs/README.md index 3578d9091d02..d334054c0ed6 100644 --- a/sdk/notificationhubs/arm-notificationhubs/README.md +++ b/sdk/notificationhubs/arm-notificationhubs/README.md @@ -2,11 +2,11 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure NotificationHubsManagement client. -Azure NotificationHub client +Microsoft Notification Hubs Resource Provider REST API. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-notificationhubs) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-notificationhubs) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-notificationhubs?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/notificationhubs/arm-notificationhubs/_meta.json b/sdk/notificationhubs/arm-notificationhubs/_meta.json index a3bef7cd8353..12ca810858ba 100644 --- a/sdk/notificationhubs/arm-notificationhubs/_meta.json +++ b/sdk/notificationhubs/arm-notificationhubs/_meta.json @@ -1,8 +1,8 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", - "readme": "specification\\notificationhubs\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.8.4 --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\\notificationhubs\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "commit": "0cca8953ec713d8cc0e940c37e865d36b43d18f8", + "readme": "specification/notificationhubs/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\notificationhubs\\resource-manager\\readme.md --use=@autorest/typescript@6.0.17 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", + "use": "@autorest/typescript@6.0.17" } \ No newline at end of file diff --git a/sdk/notificationhubs/arm-notificationhubs/assets.json b/sdk/notificationhubs/arm-notificationhubs/assets.json index 81b358752288..8d3f82afdb6e 100644 --- a/sdk/notificationhubs/arm-notificationhubs/assets.json +++ b/sdk/notificationhubs/arm-notificationhubs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/notificationhubs/arm-notificationhubs", - "Tag": "js/notificationhubs/arm-notificationhubs_383fa36b59" + "Tag": "js/notificationhubs/arm-notificationhubs_7b1692ef9d" } diff --git a/sdk/notificationhubs/arm-notificationhubs/package.json b/sdk/notificationhubs/arm-notificationhubs/package.json index 3c973b40edae..cc5c4838879c 100644 --- a/sdk/notificationhubs/arm-notificationhubs/package.json +++ b/sdk/notificationhubs/arm-notificationhubs/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for NotificationHubsManagementClient.", - "version": "2.1.1", + "version": "3.0.0-beta.1", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -29,23 +29,24 @@ "types": "./types/arm-notificationhubs.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "typescript": "~5.3.3", "uglify-js": "^3.4.9", - "rimraf": "^5.0.5", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^4.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0", - "@types/mocha": "^10.0.0" + "ts-node": "^10.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -77,7 +78,6 @@ "pack": "npm pack 2>&1", "extract-api": "api-extractor run --local", "lint": "echo skipped", - "audit": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", @@ -106,6 +106,7 @@ ] }, "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs", "//sampleConfiguration": { "productName": "", "productSlugs": [ @@ -114,4 +115,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-notificationhubs?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/notificationhubs/arm-notificationhubs/review/arm-notificationhubs.api.md b/sdk/notificationhubs/arm-notificationhubs/review/arm-notificationhubs.api.md index 2bcfa8f5d5b2..9b19610a1e3c 100644 --- a/sdk/notificationhubs/arm-notificationhubs/review/arm-notificationhubs.api.md +++ b/sdk/notificationhubs/arm-notificationhubs/review/arm-notificationhubs.api.md @@ -6,18 +6,18 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public -export type AccessRights = "Manage" | "Send" | "Listen"; +export type AccessRights = string; // @public export interface AdmCredential { - authTokenUrl?: string; - clientId?: string; - clientSecret?: string; + authTokenUrl: string; + clientId: string; + clientSecret: string; } // @public @@ -26,17 +26,30 @@ export interface ApnsCredential { appId?: string; appName?: string; certificateKey?: string; - endpoint?: string; + endpoint: string; keyId?: string; thumbprint?: string; token?: string; } +// @public +export interface Availability { + readonly blobDuration?: string; + readonly timeGrain?: string; +} + // @public export interface BaiduCredential { - baiduApiKey?: string; - baiduEndPoint?: string; - baiduSecretKey?: string; + baiduApiKey: string; + baiduEndPoint: string; + baiduSecretKey: string; +} + +// @public +export interface BrowserCredential { + subject: string; + vapidPrivateKey: string; + vapidPublicKey: string; } // @public @@ -53,32 +66,174 @@ export interface CheckAvailabilityParameters { } // @public -export interface CheckAvailabilityResult extends Resource { +export interface CheckAvailabilityResult extends ProxyResource { isAvailiable?: boolean; + location?: string; + sku?: Sku; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ConnectionDetails { + readonly groupId?: string; + readonly id?: string; + readonly linkIdentifier?: string; + readonly memberName?: string; + readonly privateIpAddress?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export interface DebugSendResponse extends ProxyResource { + readonly failure?: number; + location?: string; + readonly results?: RegistrationResult[]; + readonly success?: number; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; } // @public -export interface DebugSendResponse extends Resource { - failure?: number; - results?: Record; - success?: number; +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; } // @public export interface ErrorResponse { - code?: string; - message?: string; + error?: ErrorDetail; +} + +// @public +export interface FcmV1Credential { + clientEmail: string; + privateKey: string; + projectId: string; } // @public export interface GcmCredential { gcmEndpoint?: string; - googleApiKey?: string; + googleApiKey: string; } // @public export function getContinuationToken(page: unknown): string | undefined; +// @public +export interface GroupConnectivityInformation { + readonly customerVisibleFqdns?: string[]; + readonly groupId?: string; + readonly internalFqdn?: string; + readonly memberName?: string; + readonly privateLinkServiceArmRegion?: string; + readonly redirectMapId?: string; +} + +// @public +export interface IpRule { + ipMask: string; + rights: AccessRights[]; +} + +// @public +export enum KnownAccessRights { + Listen = "Listen", + Manage = "Manage", + Send = "Send" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownNamespaceStatus { + Created = "Created", + Creating = "Creating", + Deleting = "Deleting", + Suspended = "Suspended" +} + +// @public +export enum KnownNamespaceType { + Messaging = "Messaging", + NotificationHub = "NotificationHub" +} + +// @public +export enum KnownOperationProvisioningState { + Canceled = "Canceled", + Disabled = "Disabled", + Failed = "Failed", + InProgress = "InProgress", + Pending = "Pending", + Succeeded = "Succeeded", + Unknown = "Unknown" +} + +// @public +export enum KnownPolicyKeyType { + PrimaryKey = "PrimaryKey", + SecondaryKey = "SecondaryKey" +} + +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + Creating = "Creating", + Deleted = "Deleted", + Deleting = "Deleting", + DeletingByProxy = "DeletingByProxy", + Succeeded = "Succeeded", + Unknown = "Unknown", + Updating = "Updating", + UpdatingByProxy = "UpdatingByProxy" +} + +// @public +export enum KnownPrivateLinkConnectionStatus { + Approved = "Approved", + Disconnected = "Disconnected", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownReplicationRegion { + AustraliaEast = "AustraliaEast", + BrazilSouth = "BrazilSouth", + Default = "Default", + None = "None", + NorthEurope = "NorthEurope", + SouthAfricaNorth = "SouthAfricaNorth", + SouthEastAsia = "SouthEastAsia", + WestUs2 = "WestUs2" +} + // @public export enum KnownSkuName { Basic = "Basic", @@ -87,38 +242,48 @@ export enum KnownSkuName { } // @public -export interface MpnsCredential { - certificateKey?: string; - mpnsCertificate?: string; - thumbprint?: string; +export enum KnownZoneRedundancyPreference { + Disabled = "Disabled", + Enabled = "Enabled" } // @public -export interface NamespaceCreateOrUpdateParameters extends Resource { - createdAt?: Date; - critical?: boolean; - dataCenter?: string; - enabled?: boolean; - readonly metricId?: string; - namePropertiesName?: string; - namespaceType?: NamespaceType; - provisioningState?: string; - region?: string; - scaleUnit?: string; - serviceBusEndpoint?: string; - status?: string; - subscriptionId?: string; - updatedAt?: Date; +export interface LogSpecification { + readonly blobDuration?: string; + categoryGroups?: string[]; + readonly displayName?: string; + readonly name?: string; +} + +// @public +export interface MetricSpecification { + readonly aggregationType?: string; + readonly availabilities?: Availability[]; + readonly displayDescription?: string; + readonly displayName?: string; + readonly fillGapWithZero?: boolean; + readonly metricFilterPattern?: string; + readonly name?: string; + readonly supportedTimeGrainTypes?: string[]; + readonly unit?: string; +} + +// @public +export interface MpnsCredential { + certificateKey: string; + mpnsCertificate: string; + thumbprint: string; } // @public export interface NamespaceListResult { - nextLink?: string; - value?: NamespaceResource[]; + readonly nextLink?: string; + readonly value?: NamespaceResource[]; } // @public export interface NamespacePatchParameters { + properties?: NamespaceProperties; sku?: Sku; tags?: { [propertyName: string]: string; @@ -126,39 +291,71 @@ export interface NamespacePatchParameters { } // @public -export interface NamespaceResource extends Resource { - createdAt?: Date; - critical?: boolean; +export interface NamespaceProperties { + readonly createdAt?: Date; + readonly critical?: boolean; dataCenter?: string; - enabled?: boolean; + readonly enabled?: boolean; readonly metricId?: string; - namePropertiesName?: string; + readonly name?: string; namespaceType?: NamespaceType; - provisioningState?: string; - region?: string; + networkAcls?: NetworkAcls; + pnsCredentials?: PnsCredentials; + readonly privateEndpointConnections?: PrivateEndpointConnectionResource[]; + provisioningState?: OperationProvisioningState; + publicNetworkAccess?: PublicNetworkAccess; + readonly region?: string; + replicationRegion?: ReplicationRegion; scaleUnit?: string; - serviceBusEndpoint?: string; - status?: string; - subscriptionId?: string; - updatedAt?: Date; + readonly serviceBusEndpoint?: string; + status?: NamespaceStatus; + readonly subscriptionId?: string; + readonly updatedAt?: Date; + zoneRedundancy?: ZoneRedundancyPreference; +} + +// @public +export interface NamespaceResource extends TrackedResource { + readonly createdAt?: Date; + readonly critical?: boolean; + dataCenter?: string; + readonly enabled?: boolean; + readonly metricId?: string; + readonly namePropertiesName?: string; + namespaceType?: NamespaceType; + networkAcls?: NetworkAcls; + pnsCredentials?: PnsCredentials; + readonly privateEndpointConnections?: PrivateEndpointConnectionResource[]; + provisioningState?: OperationProvisioningState; + publicNetworkAccess?: PublicNetworkAccess; + readonly region?: string; + replicationRegion?: ReplicationRegion; + scaleUnit?: string; + readonly serviceBusEndpoint?: string; + sku: Sku; + status?: NamespaceStatus; + readonly subscriptionId?: string; + readonly updatedAt?: Date; + zoneRedundancy?: ZoneRedundancyPreference; } // @public export interface Namespaces { - beginDelete(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: NamespaceResource, options?: NamespacesCreateOrUpdateOptionalParams): Promise, NamespacesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, namespaceName: string, parameters: NamespaceResource, options?: NamespacesCreateOrUpdateOptionalParams): Promise; checkAvailability(parameters: CheckAvailabilityParameters, options?: NamespacesCheckAvailabilityOptionalParams): Promise; - createOrUpdate(resourceGroupName: string, namespaceName: string, parameters: NamespaceCreateOrUpdateParameters, options?: NamespacesCreateOrUpdateOptionalParams): Promise; - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters, options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams): Promise; + createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: SharedAccessAuthorizationRuleResource, options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams): Promise; + delete(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise; deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesDeleteAuthorizationRuleOptionalParams): Promise; get(resourceGroupName: string, namespaceName: string, options?: NamespacesGetOptionalParams): Promise; getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesGetAuthorizationRuleOptionalParams): Promise; + getPnsCredentials(resourceGroupName: string, namespaceName: string, options?: NamespacesGetPnsCredentialsOptionalParams): Promise; list(resourceGroupName: string, options?: NamespacesListOptionalParams): PagedAsyncIterableIterator; listAll(options?: NamespacesListAllOptionalParams): PagedAsyncIterableIterator; listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: NamespacesListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesListKeysOptionalParams): Promise; - patch(resourceGroupName: string, namespaceName: string, parameters: NamespacePatchParameters, options?: NamespacesPatchOptionalParams): Promise; - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: PolicykeyResource, options?: NamespacesRegenerateKeysOptionalParams): Promise; + regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: PolicyKeyResource, options?: NamespacesRegenerateKeysOptionalParams): Promise; + update(resourceGroupName: string, namespaceName: string, parameters: NamespacePatchParameters, options?: NamespacesUpdateOptionalParams): Promise; } // @public @@ -177,6 +374,8 @@ export type NamespacesCreateOrUpdateAuthorizationRuleResponse = SharedAccessAuth // @public export interface NamespacesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -188,8 +387,6 @@ export interface NamespacesDeleteAuthorizationRuleOptionalParams extends coreCli // @public export interface NamespacesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; } // @public @@ -203,6 +400,13 @@ export type NamespacesGetAuthorizationRuleResponse = SharedAccessAuthorizationRu export interface NamespacesGetOptionalParams extends coreClient.OperationOptions { } +// @public +export interface NamespacesGetPnsCredentialsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetPnsCredentialsResponse = PnsCredentialsResource; + // @public export type NamespacesGetResponse = NamespaceResource; @@ -215,6 +419,8 @@ export type NamespacesListAllNextResponse = NamespaceListResult; // @public export interface NamespacesListAllOptionalParams extends coreClient.OperationOptions { + skipToken?: string; + top?: number; } // @public @@ -250,78 +456,89 @@ export type NamespacesListNextResponse = NamespaceListResult; // @public export interface NamespacesListOptionalParams extends coreClient.OperationOptions { + skipToken?: string; + top?: number; } // @public export type NamespacesListResponse = NamespaceListResult; // @public -export interface NamespacesPatchOptionalParams extends coreClient.OperationOptions { +export interface NamespacesRegenerateKeysOptionalParams extends coreClient.OperationOptions { } // @public -export type NamespacesPatchResponse = NamespaceResource; +export type NamespacesRegenerateKeysResponse = ResourceListKeys; // @public -export interface NamespacesRegenerateKeysOptionalParams extends coreClient.OperationOptions { +export type NamespaceStatus = string; + +// @public +export interface NamespacesUpdateOptionalParams extends coreClient.OperationOptions { } // @public -export type NamespacesRegenerateKeysResponse = ResourceListKeys; +export type NamespacesUpdateResponse = NamespaceResource; // @public -export type NamespaceType = "Messaging" | "NotificationHub"; +export type NamespaceType = string; // @public -export interface NotificationHubCreateOrUpdateParameters extends Resource { - admCredential?: AdmCredential; - apnsCredential?: ApnsCredential; - authorizationRules?: SharedAccessAuthorizationRuleProperties[]; - baiduCredential?: BaiduCredential; - gcmCredential?: GcmCredential; - mpnsCredential?: MpnsCredential; - namePropertiesName?: string; - registrationTtl?: string; - wnsCredential?: WnsCredential; +export interface NetworkAcls { + ipRules?: IpRule[]; + publicNetworkRule?: PublicInternetAuthorizationRule; } // @public export interface NotificationHubListResult { - nextLink?: string; - value?: NotificationHubResource[]; + readonly nextLink?: string; + readonly value?: NotificationHubResource[]; } // @public -export interface NotificationHubPatchParameters extends Resource { +export interface NotificationHubPatchParameters { admCredential?: AdmCredential; apnsCredential?: ApnsCredential; - authorizationRules?: SharedAccessAuthorizationRuleProperties[]; + readonly authorizationRules?: SharedAccessAuthorizationRuleProperties[]; baiduCredential?: BaiduCredential; + browserCredential?: BrowserCredential; + readonly dailyMaxActiveDevices?: number; + fcmV1Credential?: FcmV1Credential; gcmCredential?: GcmCredential; mpnsCredential?: MpnsCredential; - namePropertiesName?: string; + name?: string; registrationTtl?: string; + sku?: Sku; + tags?: { + [propertyName: string]: string; + }; wnsCredential?: WnsCredential; + xiaomiCredential?: XiaomiCredential; } // @public -export interface NotificationHubResource extends Resource { +export interface NotificationHubResource extends TrackedResource { admCredential?: AdmCredential; apnsCredential?: ApnsCredential; - authorizationRules?: SharedAccessAuthorizationRuleProperties[]; + readonly authorizationRules?: SharedAccessAuthorizationRuleProperties[]; baiduCredential?: BaiduCredential; + browserCredential?: BrowserCredential; + readonly dailyMaxActiveDevices?: number; + fcmV1Credential?: FcmV1Credential; gcmCredential?: GcmCredential; mpnsCredential?: MpnsCredential; namePropertiesName?: string; registrationTtl?: string; + sku?: Sku; wnsCredential?: WnsCredential; + xiaomiCredential?: XiaomiCredential; } // @public export interface NotificationHubs { checkNotificationHubAvailability(resourceGroupName: string, namespaceName: string, parameters: CheckAvailabilityParameters, options?: NotificationHubsCheckNotificationHubAvailabilityOptionalParams): Promise; - createOrUpdate(resourceGroupName: string, namespaceName: string, notificationHubName: string, parameters: NotificationHubCreateOrUpdateParameters, options?: NotificationHubsCreateOrUpdateOptionalParams): Promise; - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, notificationHubName: string, authorizationRuleName: string, parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters, options?: NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, namespaceName: string, notificationHubName: string, parameters: NotificationHubResource, options?: NotificationHubsCreateOrUpdateOptionalParams): Promise; + createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, notificationHubName: string, authorizationRuleName: string, parameters: SharedAccessAuthorizationRuleResource, options?: NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams): Promise; debugSend(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: NotificationHubsDebugSendOptionalParams): Promise; delete(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: NotificationHubsDeleteOptionalParams): Promise; deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, notificationHubName: string, authorizationRuleName: string, options?: NotificationHubsDeleteAuthorizationRuleOptionalParams): Promise; @@ -331,8 +548,8 @@ export interface NotificationHubs { list(resourceGroupName: string, namespaceName: string, options?: NotificationHubsListOptionalParams): PagedAsyncIterableIterator; listAuthorizationRules(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: NotificationHubsListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; listKeys(resourceGroupName: string, namespaceName: string, notificationHubName: string, authorizationRuleName: string, options?: NotificationHubsListKeysOptionalParams): Promise; - patch(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: NotificationHubsPatchOptionalParams): Promise; - regenerateKeys(resourceGroupName: string, namespaceName: string, notificationHubName: string, authorizationRuleName: string, parameters: PolicykeyResource, options?: NotificationHubsRegenerateKeysOptionalParams): Promise; + regenerateKeys(resourceGroupName: string, namespaceName: string, notificationHubName: string, authorizationRuleName: string, parameters: PolicyKeyResource, options?: NotificationHubsRegenerateKeysOptionalParams): Promise; + update(resourceGroupName: string, namespaceName: string, notificationHubName: string, parameters: NotificationHubPatchParameters, options?: NotificationHubsUpdateOptionalParams): Promise; } // @public @@ -358,7 +575,6 @@ export type NotificationHubsCreateOrUpdateResponse = NotificationHubResource; // @public export interface NotificationHubsDebugSendOptionalParams extends coreClient.OperationOptions { - parameters?: Record; } // @public @@ -423,6 +639,8 @@ export type NotificationHubsListNextResponse = NotificationHubListResult; // @public export interface NotificationHubsListOptionalParams extends coreClient.OperationOptions { + skipToken?: string; + top?: number; } // @public @@ -442,6 +660,8 @@ export class NotificationHubsManagementClient extends coreClient.ServiceClient { // (undocumented) operations: Operations; // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) subscriptionId: string; } @@ -453,28 +673,30 @@ export interface NotificationHubsManagementClientOptionalParams extends coreClie } // @public -export interface NotificationHubsPatchOptionalParams extends coreClient.OperationOptions { - parameters?: NotificationHubPatchParameters; +export interface NotificationHubsRegenerateKeysOptionalParams extends coreClient.OperationOptions { } // @public -export type NotificationHubsPatchResponse = NotificationHubResource; +export type NotificationHubsRegenerateKeysResponse = ResourceListKeys; // @public -export interface NotificationHubsRegenerateKeysOptionalParams extends coreClient.OperationOptions { +export interface NotificationHubsUpdateOptionalParams extends coreClient.OperationOptions { } // @public -export type NotificationHubsRegenerateKeysResponse = ResourceListKeys; +export type NotificationHubsUpdateResponse = NotificationHubResource; // @public export interface Operation { display?: OperationDisplay; + readonly isDataAction?: boolean; readonly name?: string; + properties?: OperationProperties; } // @public export interface OperationDisplay { + readonly description?: string; readonly operation?: string; readonly provider?: string; readonly resource?: string; @@ -486,6 +708,14 @@ export interface OperationListResult { readonly value?: Operation[]; } +// @public +export interface OperationProperties { + serviceSpecification?: ServiceSpecification; +} + +// @public +export type OperationProvisioningState = string; + // @public export interface Operations { list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; @@ -506,76 +736,249 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption export type OperationsListResponse = OperationListResult; // @public -export interface PnsCredentialsResource extends Resource { +export interface PnsCredentials { admCredential?: AdmCredential; apnsCredential?: ApnsCredential; baiduCredential?: BaiduCredential; + browserCredential?: BrowserCredential; + fcmV1Credential?: FcmV1Credential; gcmCredential?: GcmCredential; mpnsCredential?: MpnsCredential; wnsCredential?: WnsCredential; + xiaomiCredential?: XiaomiCredential; } // @public -export interface PolicykeyResource { - policyKey?: string; +export interface PnsCredentialsResource extends ProxyResource { + admCredential?: AdmCredential; + apnsCredential?: ApnsCredential; + baiduCredential?: BaiduCredential; + browserCredential?: BrowserCredential; + fcmV1Credential?: FcmV1Credential; + gcmCredential?: GcmCredential; + location?: string; + mpnsCredential?: MpnsCredential; + tags?: { + [propertyName: string]: string; + }; + wnsCredential?: WnsCredential; + xiaomiCredential?: XiaomiCredential; } -// @public (undocumented) +// @public +export interface PolicyKeyResource { + policyKey: PolicyKeyType; +} + +// @public +export type PolicyKeyType = string; + +// @public +export interface PrivateEndpointConnectionProperties { + readonly groupIds?: string[]; + privateEndpoint?: RemotePrivateEndpointConnection; + privateLinkServiceConnectionState?: RemotePrivateLinkServiceConnectionState; + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export interface PrivateEndpointConnectionResource extends ProxyResource { + properties?: PrivateEndpointConnectionProperties; +} + +// @public +export interface PrivateEndpointConnectionResourceListResult { + readonly nextLink?: string; + readonly value?: PrivateEndpointConnectionResource[]; +} + +// @public +export interface PrivateEndpointConnections { + beginDelete(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, PrivateEndpointConnectionsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnectionResource, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise, PrivateEndpointConnectionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnectionResource, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + getGroupId(resourceGroupName: string, namespaceName: string, subResourceName: string, options?: PrivateEndpointConnectionsGetGroupIdOptionalParams): Promise; + list(resourceGroupName: string, namespaceName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; + listGroupIds(resourceGroupName: string, namespaceName: string, options?: PrivateEndpointConnectionsListGroupIdsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsDeleteResponse = PrivateEndpointConnectionsDeleteHeaders; + +// @public +export interface PrivateEndpointConnectionsGetGroupIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetGroupIdResponse = PrivateLinkResource; + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnectionResource; + +// @public +export interface PrivateEndpointConnectionsListGroupIdsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListGroupIdsResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionResourceListResult; + +// @public +export interface PrivateEndpointConnectionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnectionResource; + +// @public +export type PrivateLinkConnectionStatus = string; + +// @public +export interface PrivateLinkResource extends ProxyResource { + properties?: PrivateLinkResourceProperties; +} + +// @public +export interface PrivateLinkResourceListResult { + readonly nextLink?: string; + readonly value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + readonly requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkServiceConnection { + groupIds?: string[]; + name?: string; + requestMessage?: string; +} + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface PublicInternetAuthorizationRule { + rights: AccessRights[]; +} + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface RegistrationResult { + readonly applicationPlatform?: string; + readonly outcome?: string; + readonly pnsHandle?: string; + readonly registrationId?: string; +} + +// @public +export interface RemotePrivateEndpointConnection { + readonly id?: string; +} + +// @public +export interface RemotePrivateLinkServiceConnectionState { + readonly actionsRequired?: string; + readonly description?: string; + status?: PrivateLinkConnectionStatus; +} + +// @public +export type ReplicationRegion = string; + +// @public export interface Resource { readonly id?: string; - location?: string; readonly name?: string; - sku?: Sku; - tags?: { - [propertyName: string]: string; - }; + readonly systemData?: SystemData; readonly type?: string; } // @public export interface ResourceListKeys { - keyName?: string; - primaryConnectionString?: string; - primaryKey?: string; - secondaryConnectionString?: string; - secondaryKey?: string; + readonly keyName?: string; + readonly primaryConnectionString?: string; + readonly primaryKey?: string; + readonly secondaryConnectionString?: string; + readonly secondaryKey?: string; } // @public -export interface SharedAccessAuthorizationRuleCreateOrUpdateParameters { - properties: SharedAccessAuthorizationRuleProperties; +export interface ServiceSpecification { + readonly logSpecifications?: LogSpecification[]; + readonly metricSpecifications?: MetricSpecification[]; } // @public export interface SharedAccessAuthorizationRuleListResult { - nextLink?: string; - value?: SharedAccessAuthorizationRuleResource[]; + readonly nextLink?: string; + readonly value?: SharedAccessAuthorizationRuleResource[]; } // @public export interface SharedAccessAuthorizationRuleProperties { readonly claimType?: string; readonly claimValue?: string; - readonly createdTime?: string; + readonly createdTime?: Date; readonly keyName?: string; - readonly modifiedTime?: string; - readonly primaryKey?: string; + readonly modifiedTime?: Date; + primaryKey?: string; readonly revision?: number; - rights?: AccessRights[]; - readonly secondaryKey?: string; + rights: AccessRights[]; + secondaryKey?: string; } // @public -export interface SharedAccessAuthorizationRuleResource extends Resource { +export interface SharedAccessAuthorizationRuleResource extends ProxyResource { readonly claimType?: string; readonly claimValue?: string; - readonly createdTime?: string; + readonly createdTime?: Date; readonly keyName?: string; - readonly modifiedTime?: string; - readonly primaryKey?: string; + location?: string; + readonly modifiedTime?: Date; + primaryKey?: string; readonly revision?: number; rights?: AccessRights[]; - readonly secondaryKey?: string; + secondaryKey?: string; + tags?: { + [propertyName: string]: string; + }; } // @public @@ -590,18 +993,42 @@ export interface Sku { // @public export type SkuName = string; -// @public (undocumented) -export interface SubResource { - id?: string; +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; } // @public export interface WnsCredential { + certificateKey?: string; packageSid?: string; secretKey?: string; windowsLiveEndpoint?: string; + wnsCertificate?: string; +} + +// @public +export interface XiaomiCredential { + appSecret?: string; + endpoint?: string; } +// @public +export type ZoneRedundancyPreference = string; + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCheckAvailabilitySample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCheckAvailabilitySample.ts index 4fdc59e7df8f..f80a2b1de710 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCheckAvailabilitySample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCheckAvailabilitySample.ts @@ -10,28 +10,37 @@ // Licensed under the MIT License. import { CheckAvailabilityParameters, - NotificationHubsManagementClient + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. * * @summary Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCheckNameAvailability.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CheckAvailability.json */ -async function nameSpaceCheckNameAvailability() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; +async function namespacesCheckAvailability() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; const parameters: CheckAvailabilityParameters = { - name: "sdk-Namespace-2924" + name: "sdk-Namespace-2924", }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.checkAvailability(parameters); console.log(result); } -nameSpaceCheckNameAvailability().catch(console.error); +async function main() { + namespacesCheckAvailability(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCreateOrUpdateAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCreateOrUpdateAuthorizationRuleSample.ts index 7ccb8e032e38..809cc9376664 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCreateOrUpdateAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCreateOrUpdateAuthorizationRuleSample.ts @@ -9,37 +9,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - SharedAccessAuthorizationRuleCreateOrUpdateParameters, - NotificationHubsManagementClient + SharedAccessAuthorizationRuleResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates an authorization rule for a namespace * * @summary Creates an authorization rule for a namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleCreateOrUpdate.json */ -async function nameSpaceAuthorizationRuleCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesCreateOrUpdateAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "sdk-AuthRules-1788"; - const parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters = { - properties: { rights: ["Listen", "Send"] } + const parameters: SharedAccessAuthorizationRuleResource = { + rights: ["Listen", "Send"], }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.createOrUpdateAuthorizationRule( resourceGroupName, namespaceName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -nameSpaceAuthorizationRuleCreate().catch(console.error); +async function main() { + namespacesCreateOrUpdateAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCreateOrUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCreateOrUpdateSample.ts index e96dbbd6c13b..022d1f5cf9ab 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCreateOrUpdateSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesCreateOrUpdateSample.ts @@ -9,37 +9,54 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - NamespaceCreateOrUpdateParameters, - NotificationHubsManagementClient + NamespaceResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * This sample demonstrates how to Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @summary Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCreate.json + * @summary Creates / Updates a Notification Hub namespace. This operation is idempotent. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CreateOrUpdate.json */ -async function nameSpaceCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesCreateOrUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; - const parameters: NamespaceCreateOrUpdateParameters = { + const parameters: NamespaceResource = { location: "South Central US", + networkAcls: { + ipRules: [ + { ipMask: "185.48.100.00/24", rights: ["Manage", "Send", "Listen"] }, + ], + publicNetworkRule: { rights: ["Listen"] }, + }, sku: { name: "Standard", tier: "Standard" }, - tags: { tag1: "value1", tag2: "value2" } + tags: { tag1: "value1", tag2: "value2" }, + zoneRedundancy: "Enabled", }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); - const result = await client.namespaces.createOrUpdate( + const result = await client.namespaces.beginCreateOrUpdateAndWait( resourceGroupName, namespaceName, - parameters + parameters, ); console.log(result); } -nameSpaceCreate().catch(console.error); +async function main() { + namespacesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesDeleteAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesDeleteAuthorizationRuleSample.ts index 39fe7bbe2a4c..390c9e067c92 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesDeleteAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesDeleteAuthorizationRuleSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a namespace authorization rule * * @summary Deletes a namespace authorization rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleDelete.json */ -async function nameSpaceAuthorizationRuleDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesDeleteAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.deleteAuthorizationRule( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleDelete().catch(console.error); +async function main() { + namespacesDeleteAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesDeleteSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesDeleteSample.ts index 41788af22db6..485771ee8b89 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesDeleteSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesDeleteSample.ts @@ -10,27 +10,37 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * * @summary Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Delete.json */ -async function nameSpaceDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); - const result = await client.namespaces.beginDeleteAndWait( + const result = await client.namespaces.delete( resourceGroupName, - namespaceName + namespaceName, ); console.log(result); } -nameSpaceDelete().catch(console.error); +async function main() { + namespacesDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetAuthorizationRuleSample.ts index e797a3c4035c..c3e9430339be 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetAuthorizationRuleSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an authorization rule for a namespace by name. * * @summary Gets an authorization rule for a namespace by name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleGet.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleGet.json */ -async function nameSpaceAuthorizationRuleGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesGetAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.getAuthorizationRule( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleGet().catch(console.error); +async function main() { + namespacesGetAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetPnsCredentialsSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetPnsCredentialsSample.ts new file mode 100644 index 000000000000..8af1433220ab --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetPnsCredentialsSample.ts @@ -0,0 +1,46 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the PNS credentials associated with a namespace. + * + * @summary Lists the PNS credentials associated with a namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PnsCredentialsGet.json + */ +async function namespacesGetPnsCredentials() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.namespaces.getPnsCredentials( + resourceGroupName, + namespaceName, + ); + console.log(result); +} + +async function main() { + namespacesGetPnsCredentials(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetSample.ts index 34fcd43f851f..852956365db2 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesGetSample.ts @@ -10,24 +10,34 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Returns the description for the specified namespace. + * This sample demonstrates how to Returns the given namespace. * - * @summary Returns the description for the specified namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceGet.json + * @summary Returns the given namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Get.json */ -async function nameSpaceGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.get(resourceGroupName, namespaceName); console.log(result); } -nameSpaceGet().catch(console.error); +async function main() { + namespacesGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListAllSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListAllSample.ts index 87072d3cc3bf..a53770aea01d 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListAllSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListAllSample.ts @@ -10,19 +10,24 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * This sample demonstrates how to Lists all the available namespaces within the subscription. * - * @summary Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceList.json + * @summary Lists all the available namespaces within the subscription. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListBySubscription.json */ -async function nameSpaceList() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; +async function namespacesListAll() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.namespaces.listAll()) { @@ -31,4 +36,8 @@ async function nameSpaceList() { console.log(resArray); } -nameSpaceList().catch(console.error); +async function main() { + namespacesListAll(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListAuthorizationRulesSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListAuthorizationRulesSample.ts index b1c7949e3dd0..47accda124b3 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListAuthorizationRulesSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListAuthorizationRulesSample.ts @@ -10,30 +10,40 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the authorization rules for a namespace. * * @summary Gets the authorization rules for a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListAll.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleList.json */ -async function nameSpaceAuthorizationRuleListAll() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesListAuthorizationRules() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.namespaces.listAuthorizationRules( resourceGroupName, - namespaceName + namespaceName, )) { resArray.push(item); } console.log(resArray); } -nameSpaceAuthorizationRuleListAll().catch(console.error); +async function main() { + namespacesListAuthorizationRules(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListKeysSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListKeysSample.ts index 584d1fd12b95..59d6c04be29b 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListKeysSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListKeysSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the namespace + * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the namespace. * - * @summary Gets the Primary and Secondary ConnectionStrings to the namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListKey.json + * @summary Gets the Primary and Secondary ConnectionStrings to the namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleListKeys.json */ -async function nameSpaceAuthorizationRuleListKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesListKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.listKeys( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleListKey().catch(console.error); +async function main() { + namespacesListKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListSample.ts index 9b278248c444..2d6f55d5f0ad 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesListSample.ts @@ -10,20 +10,26 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the available namespaces within a resourceGroup. + * This sample demonstrates how to Lists the available namespaces within a resource group. * - * @summary Lists the available namespaces within a resourceGroup. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceListByResourceGroup.json + * @summary Lists the available namespaces within a resource group. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListByResourceGroup.json */ -async function nameSpaceListByResourceGroup() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.namespaces.list(resourceGroupName)) { @@ -32,4 +38,8 @@ async function nameSpaceListByResourceGroup() { console.log(resArray); } -nameSpaceListByResourceGroup().catch(console.error); +async function main() { + namespacesList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesPatchSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesPatchSample.ts deleted file mode 100644 index da2a6fd83e14..000000000000 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesPatchSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - NamespacePatchParameters, - NotificationHubsManagementClient -} from "@azure/arm-notificationhubs"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Patches the existing namespace - * - * @summary Patches the existing namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceUpdate.json - */ -async function nameSpaceUpdate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; - const namespaceName = "nh-sdk-ns"; - const parameters: NamespacePatchParameters = { - sku: { name: "Standard", tier: "Standard" }, - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new NotificationHubsManagementClient( - credential, - subscriptionId - ); - const result = await client.namespaces.patch( - resourceGroupName, - namespaceName, - parameters - ); - console.log(result); -} - -nameSpaceUpdate().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesRegenerateKeysSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesRegenerateKeysSample.ts index 5fa2210c7c3b..4e6c1aeb758a 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesRegenerateKeysSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesRegenerateKeysSample.ts @@ -9,35 +9,45 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - PolicykeyResource, - NotificationHubsManagementClient + PolicyKeyResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule * * @summary Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleRegenrateKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleRegenerateKey.json */ -async function nameSpaceAuthorizationRuleRegenerateKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesRegenerateKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; - const parameters: PolicykeyResource = { policyKey: "PrimaryKey" }; + const parameters: PolicyKeyResource = { policyKey: "PrimaryKey" }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.regenerateKeys( resourceGroupName, namespaceName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -nameSpaceAuthorizationRuleRegenerateKey().catch(console.error); +async function main() { + namespacesRegenerateKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesUpdateSample.ts new file mode 100644 index 000000000000..f5600482160e --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/namespacesUpdateSample.ts @@ -0,0 +1,62 @@ +/* + * 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 { + NamespacePatchParameters, + NotificationHubsManagementClient, +} from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patches the existing namespace. + * + * @summary Patches the existing namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Update.json + */ +async function namespacesUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const parameters: NamespacePatchParameters = { + properties: { + pnsCredentials: { + gcmCredential: { + gcmEndpoint: "https://fcm.googleapis.com/fcm/send", + googleApiKey: "#############################", + }, + }, + }, + sku: { name: "Free" }, + tags: { tag1: "value3" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.namespaces.update( + resourceGroupName, + namespaceName, + parameters, + ); + console.log(result); +} + +async function main() { + namespacesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCheckNotificationHubAvailabilitySample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCheckNotificationHubAvailabilitySample.ts index 5c141d2210b3..103695f912b6 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCheckNotificationHubAvailabilitySample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCheckNotificationHubAvailabilitySample.ts @@ -10,35 +10,45 @@ // Licensed under the MIT License. import { CheckAvailabilityParameters, - NotificationHubsManagementClient + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks the availability of the given notificationHub in a namespace. * * @summary Checks the availability of the given notificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCheckNameAvailability.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CheckAvailability.json */ -async function notificationHubCheckNameAvailability() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCheckNotificationHubAvailability() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "locp-newns"; const parameters: CheckAvailabilityParameters = { name: "sdktest", - location: "West Europe" + location: "West Europe", }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.checkNotificationHubAvailability( resourceGroupName, namespaceName, - parameters + parameters, ); console.log(result); } -notificationHubCheckNameAvailability().catch(console.error); +async function main() { + notificationHubsCheckNotificationHubAvailability(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts index 869f7f085a36..3e9893eb3cd3 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts @@ -9,39 +9,49 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - SharedAccessAuthorizationRuleCreateOrUpdateParameters, - NotificationHubsManagementClient + SharedAccessAuthorizationRuleResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates/Updates an authorization rule for a NotificationHub * * @summary Creates/Updates an authorization rule for a NotificationHub - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleCreateOrUpdate.json */ -async function notificationHubAuthorizationRuleCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCreateOrUpdateAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const authorizationRuleName = "DefaultListenSharedAccessSignature"; - const parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters = { - properties: { rights: ["Listen", "Send"] } + const authorizationRuleName = "MyManageSharedAccessKey"; + const parameters: SharedAccessAuthorizationRuleResource = { + rights: ["Listen", "Send"], }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.createOrUpdateAuthorizationRule( resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -notificationHubAuthorizationRuleCreate().catch(console.error); +async function main() { + notificationHubsCreateOrUpdateAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCreateOrUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCreateOrUpdateSample.ts index ced4f99a258f..3bcc8cb8cb7e 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCreateOrUpdateSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsCreateOrUpdateSample.ts @@ -9,37 +9,45 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - NotificationHubCreateOrUpdateParameters, - NotificationHubsManagementClient + NotificationHubResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates/Update a NotificationHub in a namespace. * * @summary Creates/Update a NotificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CreateOrUpdate.json */ -async function notificationHubCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCreateOrUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const parameters: NotificationHubCreateOrUpdateParameters = { - location: "eastus" - }; + const parameters: NotificationHubResource = { location: "eastus" }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.createOrUpdate( resourceGroupName, namespaceName, notificationHubName, - parameters + parameters, ); console.log(result); } -notificationHubCreate().catch(console.error); +async function main() { + notificationHubsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDebugSendSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDebugSendSample.ts index fa63e94e7707..4aab712e97b9 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDebugSendSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDebugSendSample.ts @@ -8,37 +8,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { - NotificationHubsDebugSendOptionalParams, - NotificationHubsManagementClient -} from "@azure/arm-notificationhubs"; +import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to test send a push notification + * This sample demonstrates how to Test send a push notification. * - * @summary test send a push notification - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDebugSend.json + * @summary Test send a push notification. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/DebugSend.json */ -async function debugsend() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDebugSend() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const parameters: Record = { data: { message: "Hello" } }; - const options: NotificationHubsDebugSendOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.debugSend( resourceGroupName, namespaceName, notificationHubName, - options ); console.log(result); } -debugsend().catch(console.error); +async function main() { + notificationHubsDebugSend(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDeleteAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDeleteAuthorizationRuleSample.ts index ac72f4a32263..f26c4e0c2448 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDeleteAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDeleteAuthorizationRuleSample.ts @@ -10,31 +10,41 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a notificationHub authorization rule * * @summary Deletes a notificationHub authorization rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleDelete.json */ -async function notificationHubAuthorizationRuleDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDeleteAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.deleteAuthorizationRule( resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleDelete().catch(console.error); +async function main() { + notificationHubsDeleteAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDeleteSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDeleteSample.ts index 4c70a99ad643..180c06b69169 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDeleteSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsDeleteSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a notification hub associated with a namespace. * * @summary Deletes a notification hub associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Delete.json */ -async function notificationHubDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.delete( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubDelete().catch(console.error); +async function main() { + notificationHubsDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetAuthorizationRuleSample.ts index 0a83324f0853..f1b1e7f154f2 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetAuthorizationRuleSample.ts @@ -10,31 +10,41 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an authorization rule for a NotificationHub by name. * * @summary Gets an authorization rule for a NotificationHub by name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleGet.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleGet.json */ -async function notificationHubAuthorizationRuleGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGetAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.getAuthorizationRule( resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleGet().catch(console.error); +async function main() { + notificationHubsGetAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetPnsCredentialsSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetPnsCredentialsSample.ts index 01b38dac0189..1fc721ebb46a 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetPnsCredentialsSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetPnsCredentialsSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the PNS Credentials associated with a notification hub . + * This sample demonstrates how to Lists the PNS Credentials associated with a notification hub. * - * @summary Lists the PNS Credentials associated with a notification hub . - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPnsCredentials.json + * @summary Lists the PNS Credentials associated with a notification hub. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/PnsCredentialsGet.json */ -async function notificationHubPnsCredentials() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGetPnsCredentials() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.getPnsCredentials( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubPnsCredentials().catch(console.error); +async function main() { + notificationHubsGetPnsCredentials(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetSample.ts index b9cfe2be30db..cf73171fa712 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsGetSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the notification hubs associated with a namespace. + * This sample demonstrates how to Gets the notification hub. * - * @summary Lists the notification hubs associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubGet.json + * @summary Gets the notification hub. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Get.json */ -async function notificationHubGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.get( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubGet().catch(console.error); +async function main() { + notificationHubsGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListAuthorizationRulesSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListAuthorizationRulesSample.ts index d542f81f21ec..965a31b72bce 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListAuthorizationRulesSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListAuthorizationRulesSample.ts @@ -10,32 +10,42 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the authorization rules for a NotificationHub. * * @summary Gets the authorization rules for a NotificationHub. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListAll.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleList.json */ -async function notificationHubAuthorizationRuleListAll() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsListAuthorizationRules() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.notificationHubs.listAuthorizationRules( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, )) { resArray.push(item); } console.log(resArray); } -notificationHubAuthorizationRuleListAll().catch(console.error); +async function main() { + notificationHubsListAuthorizationRules(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListKeysSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListKeysSample.ts index 91797f29c08a..9cb76d265961 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListKeysSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListKeysSample.ts @@ -10,31 +10,41 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the NotificationHub * * @summary Gets the Primary and Secondary ConnectionStrings to the NotificationHub - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleListKeys.json */ -async function notificationHubAuthorizationRuleListKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsListKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "sdk-AuthRules-5800"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.listKeys( resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleListKey().catch(console.error); +async function main() { + notificationHubsListKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListSample.ts index 43e455f72fb6..4a7e84a1c4ae 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsListSample.ts @@ -10,30 +10,40 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the notification hubs associated with a namespace. * * @summary Lists the notification hubs associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubListByNameSpace.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/List.json */ -async function notificationHubListByNameSpace() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.notificationHubs.list( resourceGroupName, - namespaceName + namespaceName, )) { resArray.push(item); } console.log(resArray); } -notificationHubListByNameSpace().catch(console.error); +async function main() { + notificationHubsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsRegenerateKeysSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsRegenerateKeysSample.ts index 557b7aa142f5..38ead21fb085 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsRegenerateKeysSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsRegenerateKeysSample.ts @@ -9,37 +9,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - PolicykeyResource, - NotificationHubsManagementClient + PolicyKeyResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule * * @summary Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleRegenerateKey.json */ -async function notificationHubAuthorizationRuleRegenrateKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsRegenerateKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; - const parameters: PolicykeyResource = { policyKey: "PrimaryKey" }; + const parameters: PolicyKeyResource = { policyKey: "PrimaryKey" }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.regenerateKeys( resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -notificationHubAuthorizationRuleRegenrateKey().catch(console.error); +async function main() { + notificationHubsRegenerateKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsPatchSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsUpdateSample.ts similarity index 52% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsPatchSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsUpdateSample.ts index 20a0cef6f0ce..b0d5ddbbe8b5 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsPatchSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsUpdateSample.ts @@ -10,36 +10,50 @@ // Licensed under the MIT License. import { NotificationHubPatchParameters, - NotificationHubsPatchOptionalParams, - NotificationHubsManagementClient + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Patch a NotificationHub in a namespace. * * @summary Patch a NotificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPatch.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Update.json */ -async function notificationHubPatch() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "sdkresourceGroup"; +async function notificationHubsUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "sdkresourceGroup"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "sdk-notificationHubs-8708"; - const parameters: NotificationHubPatchParameters = {}; - const options: NotificationHubsPatchOptionalParams = { parameters }; + const parameters: NotificationHubPatchParameters = { + gcmCredential: { + gcmEndpoint: "https://fcm.googleapis.com/fcm/send", + googleApiKey: "###################################", + }, + registrationTtl: "10675199.02:48:05.4775807", + }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); - const result = await client.notificationHubs.patch( + const result = await client.notificationHubs.update( resourceGroupName, namespaceName, notificationHubName, - options + parameters, ); console.log(result); } -notificationHubPatch().catch(console.error); +async function main() { + notificationHubsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/operationsListSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/operationsListSample.ts index 8d5a7ec9db42..ff8bfc43839c 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/operationsListSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/operationsListSample.ts @@ -10,19 +10,24 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists all of the available NotificationHubs REST API operations. + * This sample demonstrates how to Lists all available Notification Hubs operations. * - * @summary Lists all of the available NotificationHubs REST API operations. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NHOperationsList.json + * @summary Lists all available Notification Hubs operations. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NHOperationsList.json */ async function operationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.operations.list()) { @@ -31,4 +36,8 @@ async function operationsList() { console.log(resArray); } -operationsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..c7f7fc12587c --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,51 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes the Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Deletes the Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionDelete.json + */ +async function privateEndpointConnectionsDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsGetGroupIdSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsGetGroupIdSample.ts new file mode 100644 index 000000000000..3ac6ba4aa810 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsGetGroupIdSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * + * @summary Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceGet.json + */ +async function privateEndpointConnectionsGetGroupId() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const subResourceName = "namespace"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.privateEndpointConnections.getGroupId( + resourceGroupName, + namespaceName, + subResourceName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsGetGroupId(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..196a70b5080b --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,51 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Returns a Private Endpoint Connection with a given name. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Returns a Private Endpoint Connection with a given name. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionGet.json + */ +async function privateEndpointConnectionsGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsListGroupIdsSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsListGroupIdsSample.ts new file mode 100644 index 000000000000..d5e0783f240a --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsListGroupIdsSample.ts @@ -0,0 +1,51 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * + * @summary Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceList.json + */ +async function privateEndpointConnectionsListGroupIds() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.listGroupIds( + resourceGroupName, + namespaceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + privateEndpointConnectionsListGroupIds(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsListSample.ts new file mode 100644 index 000000000000..fea89497694b --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsListSample.ts @@ -0,0 +1,51 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionList.json + */ +async function privateEndpointConnectionsList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.list( + resourceGroupName, + namespaceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + privateEndpointConnectionsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsUpdateSample.ts new file mode 100644 index 000000000000..0ddb213a1c86 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples-dev/privateEndpointConnectionsUpdateSample.ts @@ -0,0 +1,61 @@ +/* + * 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 { + PrivateEndpointConnectionResource, + NotificationHubsManagementClient, +} from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Approves or rejects Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Approves or rejects Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionUpdate.json + */ +async function privateEndpointConnectionsUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const parameters: PrivateEndpointConnectionResource = { + properties: { + privateEndpoint: {}, + privateLinkServiceConnectionState: { status: "Approved" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.privateEndpointConnections.beginUpdateAndWait( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/README.md b/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/README.md deleted file mode 100644 index 020d4550eddf..000000000000 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/README.md +++ /dev/null @@ -1,104 +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** | -| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [namespacesCheckAvailabilitySample.js][namespacescheckavailabilitysample] | Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCheckNameAvailability.json | -| [namespacesCreateOrUpdateAuthorizationRuleSample.js][namespacescreateorupdateauthorizationrulesample] | Creates an authorization rule for a namespace x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleCreate.json | -| [namespacesCreateOrUpdateSample.js][namespacescreateorupdatesample] | Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCreate.json | -| [namespacesDeleteAuthorizationRuleSample.js][namespacesdeleteauthorizationrulesample] | Deletes a namespace authorization rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleDelete.json | -| [namespacesDeleteSample.js][namespacesdeletesample] | Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceDelete.json | -| [namespacesGetAuthorizationRuleSample.js][namespacesgetauthorizationrulesample] | Gets an authorization rule for a namespace by name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleGet.json | -| [namespacesGetSample.js][namespacesgetsample] | Returns the description for the specified namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceGet.json | -| [namespacesListAllSample.js][namespaceslistallsample] | Lists all the available namespaces within the subscription irrespective of the resourceGroups. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceList.json | -| [namespacesListAuthorizationRulesSample.js][namespaceslistauthorizationrulessample] | Gets the authorization rules for a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListAll.json | -| [namespacesListKeysSample.js][namespaceslistkeyssample] | Gets the Primary and Secondary ConnectionStrings to the namespace x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListKey.json | -| [namespacesListSample.js][namespaceslistsample] | Lists the available namespaces within a resourceGroup. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceListByResourceGroup.json | -| [namespacesPatchSample.js][namespacespatchsample] | Patches the existing namespace x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceUpdate.json | -| [namespacesRegenerateKeysSample.js][namespacesregeneratekeyssample] | Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleRegenrateKey.json | -| [notificationHubsCheckNotificationHubAvailabilitySample.js][notificationhubschecknotificationhubavailabilitysample] | Checks the availability of the given notificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCheckNameAvailability.json | -| [notificationHubsCreateOrUpdateAuthorizationRuleSample.js][notificationhubscreateorupdateauthorizationrulesample] | Creates/Updates an authorization rule for a NotificationHub x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleCreate.json | -| [notificationHubsCreateOrUpdateSample.js][notificationhubscreateorupdatesample] | Creates/Update a NotificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCreate.json | -| [notificationHubsDebugSendSample.js][notificationhubsdebugsendsample] | test send a push notification x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDebugSend.json | -| [notificationHubsDeleteAuthorizationRuleSample.js][notificationhubsdeleteauthorizationrulesample] | Deletes a notificationHub authorization rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleDelete.json | -| [notificationHubsDeleteSample.js][notificationhubsdeletesample] | Deletes a notification hub associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDelete.json | -| [notificationHubsGetAuthorizationRuleSample.js][notificationhubsgetauthorizationrulesample] | Gets an authorization rule for a NotificationHub by name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleGet.json | -| [notificationHubsGetPnsCredentialsSample.js][notificationhubsgetpnscredentialssample] | Lists the PNS Credentials associated with a notification hub . x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPnsCredentials.json | -| [notificationHubsGetSample.js][notificationhubsgetsample] | Lists the notification hubs associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubGet.json | -| [notificationHubsListAuthorizationRulesSample.js][notificationhubslistauthorizationrulessample] | Gets the authorization rules for a NotificationHub. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListAll.json | -| [notificationHubsListKeysSample.js][notificationhubslistkeyssample] | Gets the Primary and Secondary ConnectionStrings to the NotificationHub x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListKey.json | -| [notificationHubsListSample.js][notificationhubslistsample] | Lists the notification hubs associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubListByNameSpace.json | -| [notificationHubsPatchSample.js][notificationhubspatchsample] | Patch a NotificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPatch.json | -| [notificationHubsRegenerateKeysSample.js][notificationhubsregeneratekeyssample] | Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json | -| [operationsListSample.js][operationslistsample] | Lists all of the available NotificationHubs REST API operations. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NHOperationsList.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 namespacesCheckAvailabilitySample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node namespacesCheckAvailabilitySample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[namespacescheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCheckAvailabilitySample.js -[namespacescreateorupdateauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCreateOrUpdateAuthorizationRuleSample.js -[namespacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCreateOrUpdateSample.js -[namespacesdeleteauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesDeleteAuthorizationRuleSample.js -[namespacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesDeleteSample.js -[namespacesgetauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesGetAuthorizationRuleSample.js -[namespacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesGetSample.js -[namespaceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListAllSample.js -[namespaceslistauthorizationrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListAuthorizationRulesSample.js -[namespaceslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListKeysSample.js -[namespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListSample.js -[namespacespatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesPatchSample.js -[namespacesregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesRegenerateKeysSample.js -[notificationhubschecknotificationhubavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCheckNotificationHubAvailabilitySample.js -[notificationhubscreateorupdateauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCreateOrUpdateAuthorizationRuleSample.js -[notificationhubscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCreateOrUpdateSample.js -[notificationhubsdebugsendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDebugSendSample.js -[notificationhubsdeleteauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDeleteAuthorizationRuleSample.js -[notificationhubsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDeleteSample.js -[notificationhubsgetauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetAuthorizationRuleSample.js -[notificationhubsgetpnscredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetPnsCredentialsSample.js -[notificationhubsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetSample.js -[notificationhubslistauthorizationrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListAuthorizationRulesSample.js -[notificationhubslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListKeysSample.js -[notificationhubslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListSample.js -[notificationhubspatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsPatchSample.js -[notificationhubsregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsRegenerateKeysSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/operationsListSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-notificationhubs?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs/README.md diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCreateOrUpdateSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCreateOrUpdateSample.js deleted file mode 100644 index 81b519db7e7e..000000000000 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCreateOrUpdateSample.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 { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. - * - * @summary Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCreate.json - */ -async function nameSpaceCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; - const namespaceName = "nh-sdk-ns"; - const parameters = { - location: "South Central US", - sku: { name: "Standard", tier: "Standard" }, - tags: { tag1: "value1", tag2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new NotificationHubsManagementClient(credential, subscriptionId); - const result = await client.namespaces.createOrUpdate( - resourceGroupName, - namespaceName, - parameters - ); - console.log(result); -} - -nameSpaceCreate().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesPatchSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesPatchSample.js deleted file mode 100644 index 3d37636791f4..000000000000 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesPatchSample.js +++ /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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Patches the existing namespace - * - * @summary Patches the existing namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceUpdate.json - */ -async function nameSpaceUpdate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; - const namespaceName = "nh-sdk-ns"; - const parameters = { - sku: { name: "Standard", tier: "Standard" }, - tags: { tag1: "value1", tag2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new NotificationHubsManagementClient(credential, subscriptionId); - const result = await client.namespaces.patch(resourceGroupName, namespaceName, parameters); - console.log(result); -} - -nameSpaceUpdate().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/README.md b/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/README.md deleted file mode 100644 index 51c8b54951f9..000000000000 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/README.md +++ /dev/null @@ -1,117 +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** | -| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [namespacesCheckAvailabilitySample.ts][namespacescheckavailabilitysample] | Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCheckNameAvailability.json | -| [namespacesCreateOrUpdateAuthorizationRuleSample.ts][namespacescreateorupdateauthorizationrulesample] | Creates an authorization rule for a namespace x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleCreate.json | -| [namespacesCreateOrUpdateSample.ts][namespacescreateorupdatesample] | Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCreate.json | -| [namespacesDeleteAuthorizationRuleSample.ts][namespacesdeleteauthorizationrulesample] | Deletes a namespace authorization rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleDelete.json | -| [namespacesDeleteSample.ts][namespacesdeletesample] | Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceDelete.json | -| [namespacesGetAuthorizationRuleSample.ts][namespacesgetauthorizationrulesample] | Gets an authorization rule for a namespace by name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleGet.json | -| [namespacesGetSample.ts][namespacesgetsample] | Returns the description for the specified namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceGet.json | -| [namespacesListAllSample.ts][namespaceslistallsample] | Lists all the available namespaces within the subscription irrespective of the resourceGroups. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceList.json | -| [namespacesListAuthorizationRulesSample.ts][namespaceslistauthorizationrulessample] | Gets the authorization rules for a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListAll.json | -| [namespacesListKeysSample.ts][namespaceslistkeyssample] | Gets the Primary and Secondary ConnectionStrings to the namespace x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListKey.json | -| [namespacesListSample.ts][namespaceslistsample] | Lists the available namespaces within a resourceGroup. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceListByResourceGroup.json | -| [namespacesPatchSample.ts][namespacespatchsample] | Patches the existing namespace x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceUpdate.json | -| [namespacesRegenerateKeysSample.ts][namespacesregeneratekeyssample] | Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleRegenrateKey.json | -| [notificationHubsCheckNotificationHubAvailabilitySample.ts][notificationhubschecknotificationhubavailabilitysample] | Checks the availability of the given notificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCheckNameAvailability.json | -| [notificationHubsCreateOrUpdateAuthorizationRuleSample.ts][notificationhubscreateorupdateauthorizationrulesample] | Creates/Updates an authorization rule for a NotificationHub x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleCreate.json | -| [notificationHubsCreateOrUpdateSample.ts][notificationhubscreateorupdatesample] | Creates/Update a NotificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCreate.json | -| [notificationHubsDebugSendSample.ts][notificationhubsdebugsendsample] | test send a push notification x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDebugSend.json | -| [notificationHubsDeleteAuthorizationRuleSample.ts][notificationhubsdeleteauthorizationrulesample] | Deletes a notificationHub authorization rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleDelete.json | -| [notificationHubsDeleteSample.ts][notificationhubsdeletesample] | Deletes a notification hub associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDelete.json | -| [notificationHubsGetAuthorizationRuleSample.ts][notificationhubsgetauthorizationrulesample] | Gets an authorization rule for a NotificationHub by name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleGet.json | -| [notificationHubsGetPnsCredentialsSample.ts][notificationhubsgetpnscredentialssample] | Lists the PNS Credentials associated with a notification hub . x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPnsCredentials.json | -| [notificationHubsGetSample.ts][notificationhubsgetsample] | Lists the notification hubs associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubGet.json | -| [notificationHubsListAuthorizationRulesSample.ts][notificationhubslistauthorizationrulessample] | Gets the authorization rules for a NotificationHub. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListAll.json | -| [notificationHubsListKeysSample.ts][notificationhubslistkeyssample] | Gets the Primary and Secondary ConnectionStrings to the NotificationHub x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListKey.json | -| [notificationHubsListSample.ts][notificationhubslistsample] | Lists the notification hubs associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubListByNameSpace.json | -| [notificationHubsPatchSample.ts][notificationhubspatchsample] | Patch a NotificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPatch.json | -| [notificationHubsRegenerateKeysSample.ts][notificationhubsregeneratekeyssample] | Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json | -| [operationsListSample.ts][operationslistsample] | Lists all of the available NotificationHubs REST API operations. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NHOperationsList.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/namespacesCheckAvailabilitySample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/namespacesCheckAvailabilitySample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[namespacescheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCheckAvailabilitySample.ts -[namespacescreateorupdateauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCreateOrUpdateAuthorizationRuleSample.ts -[namespacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCreateOrUpdateSample.ts -[namespacesdeleteauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesDeleteAuthorizationRuleSample.ts -[namespacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesDeleteSample.ts -[namespacesgetauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesGetAuthorizationRuleSample.ts -[namespacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesGetSample.ts -[namespaceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListAllSample.ts -[namespaceslistauthorizationrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListAuthorizationRulesSample.ts -[namespaceslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListKeysSample.ts -[namespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListSample.ts -[namespacespatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesPatchSample.ts -[namespacesregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesRegenerateKeysSample.ts -[notificationhubschecknotificationhubavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCheckNotificationHubAvailabilitySample.ts -[notificationhubscreateorupdateauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts -[notificationhubscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCreateOrUpdateSample.ts -[notificationhubsdebugsendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDebugSendSample.ts -[notificationhubsdeleteauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDeleteAuthorizationRuleSample.ts -[notificationhubsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDeleteSample.ts -[notificationhubsgetauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetAuthorizationRuleSample.ts -[notificationhubsgetpnscredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetPnsCredentialsSample.ts -[notificationhubsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetSample.ts -[notificationhubslistauthorizationrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListAuthorizationRulesSample.ts -[notificationhubslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListKeysSample.ts -[notificationhubslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListSample.ts -[notificationhubspatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsPatchSample.ts -[notificationhubsregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsRegenerateKeysSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/operationsListSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-notificationhubs?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCreateOrUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCreateOrUpdateSample.ts deleted file mode 100644 index e96dbbd6c13b..000000000000 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - NamespaceCreateOrUpdateParameters, - NotificationHubsManagementClient -} from "@azure/arm-notificationhubs"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. - * - * @summary Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCreate.json - */ -async function nameSpaceCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; - const namespaceName = "nh-sdk-ns"; - const parameters: NamespaceCreateOrUpdateParameters = { - location: "South Central US", - sku: { name: "Standard", tier: "Standard" }, - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new NotificationHubsManagementClient( - credential, - subscriptionId - ); - const result = await client.namespaces.createOrUpdate( - resourceGroupName, - namespaceName, - parameters - ); - console.log(result); -} - -nameSpaceCreate().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesPatchSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesPatchSample.ts deleted file mode 100644 index da2a6fd83e14..000000000000 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesPatchSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - NamespacePatchParameters, - NotificationHubsManagementClient -} from "@azure/arm-notificationhubs"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Patches the existing namespace - * - * @summary Patches the existing namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceUpdate.json - */ -async function nameSpaceUpdate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; - const namespaceName = "nh-sdk-ns"; - const parameters: NamespacePatchParameters = { - sku: { name: "Standard", tier: "Standard" }, - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new NotificationHubsManagementClient( - credential, - subscriptionId - ); - const result = await client.namespaces.patch( - resourceGroupName, - namespaceName, - parameters - ); - console.log(result); -} - -nameSpaceUpdate().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/README.md b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/README.md new file mode 100644 index 000000000000..4a27f78a719f --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/README.md @@ -0,0 +1,118 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [namespacesCheckAvailabilitySample.js][namespacescheckavailabilitysample] | Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CheckAvailability.json | +| [namespacesCreateOrUpdateAuthorizationRuleSample.js][namespacescreateorupdateauthorizationrulesample] | Creates an authorization rule for a namespace x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleCreateOrUpdate.json | +| [namespacesCreateOrUpdateSample.js][namespacescreateorupdatesample] | Creates / Updates a Notification Hub namespace. This operation is idempotent. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CreateOrUpdate.json | +| [namespacesDeleteAuthorizationRuleSample.js][namespacesdeleteauthorizationrulesample] | Deletes a namespace authorization rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleDelete.json | +| [namespacesDeleteSample.js][namespacesdeletesample] | Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Delete.json | +| [namespacesGetAuthorizationRuleSample.js][namespacesgetauthorizationrulesample] | Gets an authorization rule for a namespace by name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleGet.json | +| [namespacesGetPnsCredentialsSample.js][namespacesgetpnscredentialssample] | Lists the PNS credentials associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PnsCredentialsGet.json | +| [namespacesGetSample.js][namespacesgetsample] | Returns the given namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Get.json | +| [namespacesListAllSample.js][namespaceslistallsample] | Lists all the available namespaces within the subscription. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListBySubscription.json | +| [namespacesListAuthorizationRulesSample.js][namespaceslistauthorizationrulessample] | Gets the authorization rules for a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleList.json | +| [namespacesListKeysSample.js][namespaceslistkeyssample] | Gets the Primary and Secondary ConnectionStrings to the namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleListKeys.json | +| [namespacesListSample.js][namespaceslistsample] | Lists the available namespaces within a resource group. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListByResourceGroup.json | +| [namespacesRegenerateKeysSample.js][namespacesregeneratekeyssample] | Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleRegenerateKey.json | +| [namespacesUpdateSample.js][namespacesupdatesample] | Patches the existing namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Update.json | +| [notificationHubsCheckNotificationHubAvailabilitySample.js][notificationhubschecknotificationhubavailabilitysample] | Checks the availability of the given notificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CheckAvailability.json | +| [notificationHubsCreateOrUpdateAuthorizationRuleSample.js][notificationhubscreateorupdateauthorizationrulesample] | Creates/Updates an authorization rule for a NotificationHub x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleCreateOrUpdate.json | +| [notificationHubsCreateOrUpdateSample.js][notificationhubscreateorupdatesample] | Creates/Update a NotificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CreateOrUpdate.json | +| [notificationHubsDebugSendSample.js][notificationhubsdebugsendsample] | Test send a push notification. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/DebugSend.json | +| [notificationHubsDeleteAuthorizationRuleSample.js][notificationhubsdeleteauthorizationrulesample] | Deletes a notificationHub authorization rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleDelete.json | +| [notificationHubsDeleteSample.js][notificationhubsdeletesample] | Deletes a notification hub associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Delete.json | +| [notificationHubsGetAuthorizationRuleSample.js][notificationhubsgetauthorizationrulesample] | Gets an authorization rule for a NotificationHub by name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleGet.json | +| [notificationHubsGetPnsCredentialsSample.js][notificationhubsgetpnscredentialssample] | Lists the PNS Credentials associated with a notification hub. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/PnsCredentialsGet.json | +| [notificationHubsGetSample.js][notificationhubsgetsample] | Gets the notification hub. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Get.json | +| [notificationHubsListAuthorizationRulesSample.js][notificationhubslistauthorizationrulessample] | Gets the authorization rules for a NotificationHub. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleList.json | +| [notificationHubsListKeysSample.js][notificationhubslistkeyssample] | Gets the Primary and Secondary ConnectionStrings to the NotificationHub x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleListKeys.json | +| [notificationHubsListSample.js][notificationhubslistsample] | Lists the notification hubs associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/List.json | +| [notificationHubsRegenerateKeysSample.js][notificationhubsregeneratekeyssample] | Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleRegenerateKey.json | +| [notificationHubsUpdateSample.js][notificationhubsupdatesample] | Patch a NotificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Update.json | +| [operationsListSample.js][operationslistsample] | Lists all available Notification Hubs operations. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NHOperationsList.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes the Private Endpoint Connection. This is a public API that can be called directly by Notification Hubs users. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionDelete.json | +| [privateEndpointConnectionsGetGroupIdSample.js][privateendpointconnectionsgetgroupidsample] | Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceGet.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Returns a Private Endpoint Connection with a given name. This is a public API that can be called directly by Notification Hubs users. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionGet.json | +| [privateEndpointConnectionsListGroupIdsSample.js][privateendpointconnectionslistgroupidssample] | Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceList.json | +| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. This is a public API that can be called directly by Notification Hubs users. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionList.json | +| [privateEndpointConnectionsUpdateSample.js][privateendpointconnectionsupdatesample] | Approves or rejects Private Endpoint Connection. This is a public API that can be called directly by Notification Hubs users. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionUpdate.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 namespacesCheckAvailabilitySample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env NOTIFICATIONHUBS_SUBSCRIPTION_ID="" node namespacesCheckAvailabilitySample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[namespacescheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCheckAvailabilitySample.js +[namespacescreateorupdateauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCreateOrUpdateAuthorizationRuleSample.js +[namespacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCreateOrUpdateSample.js +[namespacesdeleteauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesDeleteAuthorizationRuleSample.js +[namespacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesDeleteSample.js +[namespacesgetauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetAuthorizationRuleSample.js +[namespacesgetpnscredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetPnsCredentialsSample.js +[namespacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetSample.js +[namespaceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListAllSample.js +[namespaceslistauthorizationrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListAuthorizationRulesSample.js +[namespaceslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListKeysSample.js +[namespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListSample.js +[namespacesregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesRegenerateKeysSample.js +[namespacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesUpdateSample.js +[notificationhubschecknotificationhubavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCheckNotificationHubAvailabilitySample.js +[notificationhubscreateorupdateauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCreateOrUpdateAuthorizationRuleSample.js +[notificationhubscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCreateOrUpdateSample.js +[notificationhubsdebugsendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDebugSendSample.js +[notificationhubsdeleteauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDeleteAuthorizationRuleSample.js +[notificationhubsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDeleteSample.js +[notificationhubsgetauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetAuthorizationRuleSample.js +[notificationhubsgetpnscredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetPnsCredentialsSample.js +[notificationhubsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetSample.js +[notificationhubslistauthorizationrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListAuthorizationRulesSample.js +[notificationhubslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListKeysSample.js +[notificationhubslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListSample.js +[notificationhubsregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsRegenerateKeysSample.js +[notificationhubsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsUpdateSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/operationsListSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetgroupidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsGetGroupIdSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistgroupidssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsListGroupIdsSample.js +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsListSample.js +[privateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsUpdateSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-notificationhubs?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs/README.md diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCheckAvailabilitySample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCheckAvailabilitySample.js similarity index 75% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCheckAvailabilitySample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCheckAvailabilitySample.js index d6ab5b55ffec..5358ea9cb826 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCheckAvailabilitySample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCheckAvailabilitySample.js @@ -10,15 +10,17 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. * * @summary Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCheckNameAvailability.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CheckAvailability.json */ -async function nameSpaceCheckNameAvailability() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; +async function namespacesCheckAvailability() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; const parameters = { name: "sdk-Namespace-2924", }; @@ -28,4 +30,8 @@ async function nameSpaceCheckNameAvailability() { console.log(result); } -nameSpaceCheckNameAvailability().catch(console.error); +async function main() { + namespacesCheckAvailability(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCreateOrUpdateAuthorizationRuleSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCreateOrUpdateAuthorizationRuleSample.js similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCreateOrUpdateAuthorizationRuleSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCreateOrUpdateAuthorizationRuleSample.js index e2d5d0df18ff..8cd324030255 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesCreateOrUpdateAuthorizationRuleSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCreateOrUpdateAuthorizationRuleSample.js @@ -10,20 +10,22 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates an authorization rule for a namespace * * @summary Creates an authorization rule for a namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleCreateOrUpdate.json */ -async function nameSpaceAuthorizationRuleCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesCreateOrUpdateAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "sdk-AuthRules-1788"; const parameters = { - properties: { rights: ["Listen", "Send"] }, + rights: ["Listen", "Send"], }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); @@ -31,9 +33,13 @@ async function nameSpaceAuthorizationRuleCreate() { resourceGroupName, namespaceName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -nameSpaceAuthorizationRuleCreate().catch(console.error); +async function main() { + namespacesCreateOrUpdateAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCreateOrUpdateSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCreateOrUpdateSample.js new file mode 100644 index 000000000000..2577452f9a68 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesCreateOrUpdateSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @summary Creates / Updates a Notification Hub namespace. This operation is idempotent. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CreateOrUpdate.json + */ +async function namespacesCreateOrUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const parameters = { + location: "South Central US", + networkAcls: { + ipRules: [{ ipMask: "185.48.100.00/24", rights: ["Manage", "Send", "Listen"] }], + publicNetworkRule: { rights: ["Listen"] }, + }, + sku: { name: "Standard", tier: "Standard" }, + tags: { tag1: "value1", tag2: "value2" }, + zoneRedundancy: "Enabled", + }; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const result = await client.namespaces.beginCreateOrUpdateAndWait( + resourceGroupName, + namespaceName, + parameters, + ); + console.log(result); +} + +async function main() { + namespacesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesDeleteAuthorizationRuleSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesDeleteAuthorizationRuleSample.js similarity index 66% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesDeleteAuthorizationRuleSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesDeleteAuthorizationRuleSample.js index 9bd0fcd090a6..62b6e6ee861b 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesDeleteAuthorizationRuleSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesDeleteAuthorizationRuleSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a namespace authorization rule * * @summary Deletes a namespace authorization rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleDelete.json */ -async function nameSpaceAuthorizationRuleDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesDeleteAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); @@ -27,9 +29,13 @@ async function nameSpaceAuthorizationRuleDelete() { const result = await client.namespaces.deleteAuthorizationRule( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleDelete().catch(console.error); +async function main() { + namespacesDeleteAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesDeleteSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesDeleteSample.js similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesDeleteSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesDeleteSample.js index 7e68c1507676..751f445ebbbc 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesDeleteSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesDeleteSample.js @@ -10,21 +10,27 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * * @summary Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Delete.json */ -async function nameSpaceDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); - const result = await client.namespaces.beginDeleteAndWait(resourceGroupName, namespaceName); + const result = await client.namespaces.delete(resourceGroupName, namespaceName); console.log(result); } -nameSpaceDelete().catch(console.error); +async function main() { + namespacesDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesGetAuthorizationRuleSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetAuthorizationRuleSample.js similarity index 67% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesGetAuthorizationRuleSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetAuthorizationRuleSample.js index 58235eb0d8db..93b960ac9f21 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesGetAuthorizationRuleSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetAuthorizationRuleSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets an authorization rule for a namespace by name. * * @summary Gets an authorization rule for a namespace by name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleGet.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleGet.json */ -async function nameSpaceAuthorizationRuleGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesGetAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); @@ -27,9 +29,13 @@ async function nameSpaceAuthorizationRuleGet() { const result = await client.namespaces.getAuthorizationRule( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleGet().catch(console.error); +async function main() { + namespacesGetAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetPnsCredentialsSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetPnsCredentialsSample.js new file mode 100644 index 000000000000..906edef19a48 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetPnsCredentialsSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the PNS credentials associated with a namespace. + * + * @summary Lists the PNS credentials associated with a namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PnsCredentialsGet.json + */ +async function namespacesGetPnsCredentials() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const result = await client.namespaces.getPnsCredentials(resourceGroupName, namespaceName); + console.log(result); +} + +async function main() { + namespacesGetPnsCredentials(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesGetSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetSample.js similarity index 59% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesGetSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetSample.js index 24a6318816e1..d9d5cf42f560 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesGetSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Returns the description for the specified namespace. + * This sample demonstrates how to Returns the given namespace. * - * @summary Returns the description for the specified namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceGet.json + * @summary Returns the given namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Get.json */ -async function nameSpaceGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); @@ -27,4 +29,8 @@ async function nameSpaceGet() { console.log(result); } -nameSpaceGet().catch(console.error); +async function main() { + namespacesGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListAllSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListAllSample.js similarity index 69% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListAllSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListAllSample.js index c10b13564318..f7acd5c36571 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListAllSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListAllSample.js @@ -10,15 +10,17 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * This sample demonstrates how to Lists all the available namespaces within the subscription. * - * @summary Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceList.json + * @summary Lists all the available namespaces within the subscription. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListBySubscription.json */ -async function nameSpaceList() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; +async function namespacesListAll() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +30,8 @@ async function nameSpaceList() { console.log(resArray); } -nameSpaceList().catch(console.error); +async function main() { + namespacesListAll(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListAuthorizationRulesSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListAuthorizationRulesSample.js similarity index 66% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListAuthorizationRulesSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListAuthorizationRulesSample.js index 4aeb5ddf55e5..d0a06681af66 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListAuthorizationRulesSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListAuthorizationRulesSample.js @@ -10,27 +10,33 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the authorization rules for a namespace. * * @summary Gets the authorization rules for a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListAll.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleList.json */ -async function nameSpaceAuthorizationRuleListAll() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesListAuthorizationRules() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.namespaces.listAuthorizationRules( resourceGroupName, - namespaceName + namespaceName, )) { resArray.push(item); } console.log(resArray); } -nameSpaceAuthorizationRuleListAll().catch(console.error); +async function main() { + namespacesListAuthorizationRules(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListKeysSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListKeysSample.js similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListKeysSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListKeysSample.js index 8bc410ab830e..9b5af7ed7286 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListKeysSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListKeysSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the namespace + * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the namespace. * - * @summary Gets the Primary and Secondary ConnectionStrings to the namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListKey.json + * @summary Gets the Primary and Secondary ConnectionStrings to the namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleListKeys.json */ -async function nameSpaceAuthorizationRuleListKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesListKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); @@ -27,9 +29,13 @@ async function nameSpaceAuthorizationRuleListKey() { const result = await client.namespaces.listKeys( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleListKey().catch(console.error); +async function main() { + namespacesListKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListSample.js similarity index 61% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListSample.js index 1857ae6dc4e6..c9cc47b625f5 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesListSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the available namespaces within a resourceGroup. + * This sample demonstrates how to Lists the available namespaces within a resource group. * - * @summary Lists the available namespaces within a resourceGroup. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceListByResourceGroup.json + * @summary Lists the available namespaces within a resource group. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListByResourceGroup.json */ -async function nameSpaceListByResourceGroup() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -29,4 +31,8 @@ async function nameSpaceListByResourceGroup() { console.log(resArray); } -nameSpaceListByResourceGroup().catch(console.error); +async function main() { + namespacesList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesRegenerateKeysSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesRegenerateKeysSample.js similarity index 70% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesRegenerateKeysSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesRegenerateKeysSample.js index ad652866f98e..47abd8352582 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/namespacesRegenerateKeysSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesRegenerateKeysSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule * * @summary Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleRegenrateKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleRegenerateKey.json */ -async function nameSpaceAuthorizationRuleRegenerateKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesRegenerateKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const parameters = { policyKey: "PrimaryKey" }; @@ -29,9 +31,13 @@ async function nameSpaceAuthorizationRuleRegenerateKey() { resourceGroupName, namespaceName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -nameSpaceAuthorizationRuleRegenerateKey().catch(console.error); +async function main() { + namespacesRegenerateKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesUpdateSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesUpdateSample.js new file mode 100644 index 000000000000..1a1ae58d7457 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/namespacesUpdateSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patches the existing namespace. + * + * @summary Patches the existing namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Update.json + */ +async function namespacesUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const parameters = { + properties: { + pnsCredentials: { + gcmCredential: { + gcmEndpoint: "https://fcm.googleapis.com/fcm/send", + googleApiKey: "#############################", + }, + }, + }, + sku: { name: "Free" }, + tags: { tag1: "value3" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const result = await client.namespaces.update(resourceGroupName, namespaceName, parameters); + console.log(result); +} + +async function main() { + namespacesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCheckNotificationHubAvailabilitySample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCheckNotificationHubAvailabilitySample.js similarity index 67% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCheckNotificationHubAvailabilitySample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCheckNotificationHubAvailabilitySample.js index 467e28152db4..b7cc629be0f7 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCheckNotificationHubAvailabilitySample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCheckNotificationHubAvailabilitySample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks the availability of the given notificationHub in a namespace. * * @summary Checks the availability of the given notificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCheckNameAvailability.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CheckAvailability.json */ -async function notificationHubCheckNameAvailability() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCheckNotificationHubAvailability() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "locp-newns"; const parameters = { name: "sdktest", @@ -30,9 +32,13 @@ async function notificationHubCheckNameAvailability() { const result = await client.notificationHubs.checkNotificationHubAvailability( resourceGroupName, namespaceName, - parameters + parameters, ); console.log(result); } -notificationHubCheckNameAvailability().catch(console.error); +async function main() { + notificationHubsCheckNotificationHubAvailability(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCreateOrUpdateAuthorizationRuleSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCreateOrUpdateAuthorizationRuleSample.js similarity index 64% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCreateOrUpdateAuthorizationRuleSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCreateOrUpdateAuthorizationRuleSample.js index fd1ef0e05f84..5792daa3fe93 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCreateOrUpdateAuthorizationRuleSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCreateOrUpdateAuthorizationRuleSample.js @@ -10,21 +10,23 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates/Updates an authorization rule for a NotificationHub * * @summary Creates/Updates an authorization rule for a NotificationHub - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleCreateOrUpdate.json */ -async function notificationHubAuthorizationRuleCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCreateOrUpdateAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const authorizationRuleName = "DefaultListenSharedAccessSignature"; + const authorizationRuleName = "MyManageSharedAccessKey"; const parameters = { - properties: { rights: ["Listen", "Send"] }, + rights: ["Listen", "Send"], }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); @@ -33,9 +35,13 @@ async function notificationHubAuthorizationRuleCreate() { namespaceName, notificationHubName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -notificationHubAuthorizationRuleCreate().catch(console.error); +async function main() { + notificationHubsCreateOrUpdateAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCreateOrUpdateSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCreateOrUpdateSample.js similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCreateOrUpdateSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCreateOrUpdateSample.js index 7729bf0c932c..b2491281a81b 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsCreateOrUpdateSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsCreateOrUpdateSample.js @@ -10,30 +10,34 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates/Update a NotificationHub in a namespace. * * @summary Creates/Update a NotificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CreateOrUpdate.json */ -async function notificationHubCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCreateOrUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const parameters = { - location: "eastus", - }; + const parameters = { location: "eastus" }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); const result = await client.notificationHubs.createOrUpdate( resourceGroupName, namespaceName, notificationHubName, - parameters + parameters, ); console.log(result); } -notificationHubCreate().catch(console.error); +async function main() { + notificationHubsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDebugSendSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDebugSendSample.js similarity index 60% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDebugSendSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDebugSendSample.js index 0ce0667c86cd..991c9ec1a2f7 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDebugSendSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDebugSendSample.js @@ -10,29 +10,32 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to test send a push notification + * This sample demonstrates how to Test send a push notification. * - * @summary test send a push notification - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDebugSend.json + * @summary Test send a push notification. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/DebugSend.json */ -async function debugsend() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDebugSend() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const parameters = { data: { message: "Hello" } }; - const options = { parameters }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); const result = await client.notificationHubs.debugSend( resourceGroupName, namespaceName, notificationHubName, - options ); console.log(result); } -debugsend().catch(console.error); +async function main() { + notificationHubsDebugSend(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDeleteAuthorizationRuleSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDeleteAuthorizationRuleSample.js similarity index 67% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDeleteAuthorizationRuleSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDeleteAuthorizationRuleSample.js index f57e0b0cae77..77ab11515462 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDeleteAuthorizationRuleSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDeleteAuthorizationRuleSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a notificationHub authorization rule * * @summary Deletes a notificationHub authorization rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleDelete.json */ -async function notificationHubAuthorizationRuleDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDeleteAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; @@ -29,9 +31,13 @@ async function notificationHubAuthorizationRuleDelete() { resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleDelete().catch(console.error); +async function main() { + notificationHubsDeleteAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDeleteSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDeleteSample.js similarity index 68% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDeleteSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDeleteSample.js index b6bacfa3111c..7f0b31d2299d 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsDeleteSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a notification hub associated with a namespace. * * @summary Deletes a notification hub associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Delete.json */ -async function notificationHubDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); @@ -27,9 +29,13 @@ async function notificationHubDelete() { const result = await client.notificationHubs.delete( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubDelete().catch(console.error); +async function main() { + notificationHubsDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetAuthorizationRuleSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetAuthorizationRuleSample.js similarity index 68% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetAuthorizationRuleSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetAuthorizationRuleSample.js index 0d33af1ea648..d0890aace51b 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetAuthorizationRuleSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetAuthorizationRuleSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets an authorization rule for a NotificationHub by name. * * @summary Gets an authorization rule for a NotificationHub by name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleGet.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleGet.json */ -async function notificationHubAuthorizationRuleGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGetAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; @@ -29,9 +31,13 @@ async function notificationHubAuthorizationRuleGet() { resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleGet().catch(console.error); +async function main() { + notificationHubsGetAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetPnsCredentialsSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetPnsCredentialsSample.js similarity index 64% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetPnsCredentialsSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetPnsCredentialsSample.js index 4f2a74251b66..187d2236523d 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetPnsCredentialsSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetPnsCredentialsSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the PNS Credentials associated with a notification hub . + * This sample demonstrates how to Lists the PNS Credentials associated with a notification hub. * - * @summary Lists the PNS Credentials associated with a notification hub . - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPnsCredentials.json + * @summary Lists the PNS Credentials associated with a notification hub. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/PnsCredentialsGet.json */ -async function notificationHubPnsCredentials() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGetPnsCredentials() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); @@ -27,9 +29,13 @@ async function notificationHubPnsCredentials() { const result = await client.notificationHubs.getPnsCredentials( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubPnsCredentials().catch(console.error); +async function main() { + notificationHubsGetPnsCredentials(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetSample.js similarity index 60% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetSample.js index cb2f77efa195..989b9bb8e148 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsGetSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the notification hubs associated with a namespace. + * This sample demonstrates how to Gets the notification hub. * - * @summary Lists the notification hubs associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubGet.json + * @summary Gets the notification hub. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Get.json */ -async function notificationHubGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); @@ -27,9 +29,13 @@ async function notificationHubGet() { const result = await client.notificationHubs.get( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubGet().catch(console.error); +async function main() { + notificationHubsGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListAuthorizationRulesSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListAuthorizationRulesSample.js similarity index 67% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListAuthorizationRulesSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListAuthorizationRulesSample.js index 8782bbc913cd..34a4ab2a0515 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListAuthorizationRulesSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListAuthorizationRulesSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the authorization rules for a NotificationHub. * * @summary Gets the authorization rules for a NotificationHub. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListAll.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleList.json */ -async function notificationHubAuthorizationRuleListAll() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsListAuthorizationRules() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); @@ -28,11 +30,15 @@ async function notificationHubAuthorizationRuleListAll() { for await (let item of client.notificationHubs.listAuthorizationRules( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, )) { resArray.push(item); } console.log(resArray); } -notificationHubAuthorizationRuleListAll().catch(console.error); +async function main() { + notificationHubsListAuthorizationRules(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListKeysSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListKeysSample.js similarity index 69% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListKeysSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListKeysSample.js index a4085c7bed58..61dda40911f8 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListKeysSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListKeysSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the NotificationHub * * @summary Gets the Primary and Secondary ConnectionStrings to the NotificationHub - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleListKeys.json */ -async function notificationHubAuthorizationRuleListKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsListKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "sdk-AuthRules-5800"; @@ -29,9 +31,13 @@ async function notificationHubAuthorizationRuleListKey() { resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleListKey().catch(console.error); +async function main() { + notificationHubsListKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListSample.js similarity index 69% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListSample.js index 566d296972cb..9f20191c9d24 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsListSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the notification hubs associated with a namespace. * * @summary Lists the notification hubs associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubListByNameSpace.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/List.json */ -async function notificationHubListByNameSpace() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function notificationHubListByNameSpace() { console.log(resArray); } -notificationHubListByNameSpace().catch(console.error); +async function main() { + notificationHubsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsRegenerateKeysSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsRegenerateKeysSample.js similarity index 70% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsRegenerateKeysSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsRegenerateKeysSample.js index c67301146335..ca00f744ef43 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsRegenerateKeysSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsRegenerateKeysSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule * * @summary Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleRegenerateKey.json */ -async function notificationHubAuthorizationRuleRegenrateKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsRegenerateKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; @@ -31,9 +33,13 @@ async function notificationHubAuthorizationRuleRegenrateKey() { namespaceName, notificationHubName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -notificationHubAuthorizationRuleRegenrateKey().catch(console.error); +async function main() { + notificationHubsRegenerateKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsPatchSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsUpdateSample.js similarity index 56% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsPatchSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsUpdateSample.js index 45e39714e338..7850fe260b28 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/notificationHubsPatchSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/notificationHubsUpdateSample.js @@ -10,29 +10,40 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Patch a NotificationHub in a namespace. * * @summary Patch a NotificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPatch.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Update.json */ -async function notificationHubPatch() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "sdkresourceGroup"; +async function notificationHubsUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "sdkresourceGroup"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "sdk-notificationHubs-8708"; - const parameters = {}; - const options = { parameters }; + const parameters = { + gcmCredential: { + gcmEndpoint: "https://fcm.googleapis.com/fcm/send", + googleApiKey: "###################################", + }, + registrationTtl: "10675199.02:48:05.4775807", + }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); - const result = await client.notificationHubs.patch( + const result = await client.notificationHubs.update( resourceGroupName, namespaceName, notificationHubName, - options + parameters, ); console.log(result); } -notificationHubPatch().catch(console.error); +async function main() { + notificationHubsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/operationsListSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/operationsListSample.js similarity index 64% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/operationsListSample.js rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/operationsListSample.js index 54284a5b5111..c2016ecbf5c3 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/operationsListSample.js +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/operationsListSample.js @@ -10,15 +10,17 @@ // Licensed under the MIT License. const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists all of the available NotificationHubs REST API operations. + * This sample demonstrates how to Lists all available Notification Hubs operations. * - * @summary Lists all of the available NotificationHubs REST API operations. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NHOperationsList.json + * @summary Lists all available Notification Hubs operations. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NHOperationsList.json */ async function operationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +30,8 @@ async function operationsList() { console.log(resArray); } -operationsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/package.json b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/package.json similarity index 80% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/package.json rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/package.json index 52d997a5c997..77eaa7d94e9f 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/package.json +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/package.json @@ -1,8 +1,8 @@ { - "name": "@azure-samples/arm-notificationhubs-js", + "name": "@azure-samples/arm-notificationhubs-js-beta", "private": true, "version": "1.0.0", - "description": " client library samples for JavaScript", + "description": " client library samples for JavaScript (Beta)", "engines": { "node": ">=18.0.0" }, @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs", "dependencies": { - "@azure/arm-notificationhubs": "latest", + "@azure/arm-notificationhubs": "next", "dotenv": "latest", "@azure/identity": "^4.0.1" } diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..d9b714df1437 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsDeleteSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes the Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Deletes the Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionDelete.json + */ +async function privateEndpointConnectionsDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsGetGroupIdSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsGetGroupIdSample.js new file mode 100644 index 000000000000..ae6df2ea8093 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsGetGroupIdSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * + * @summary Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceGet.json + */ +async function privateEndpointConnectionsGetGroupId() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const subResourceName = "namespace"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.getGroupId( + resourceGroupName, + namespaceName, + subResourceName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsGetGroupId(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsGetSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..0336c72555c8 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsGetSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Returns a Private Endpoint Connection with a given name. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Returns a Private Endpoint Connection with a given name. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionGet.json + */ +async function privateEndpointConnectionsGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsListGroupIdsSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsListGroupIdsSample.js new file mode 100644 index 000000000000..64e4e0f4d585 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsListGroupIdsSample.js @@ -0,0 +1,44 @@ +/* + * 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 { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * + * @summary Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceList.json + */ +async function privateEndpointConnectionsListGroupIds() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.listGroupIds( + resourceGroupName, + namespaceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + privateEndpointConnectionsListGroupIds(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsListSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsListSample.js new file mode 100644 index 000000000000..419d733472c8 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsListSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionList.json + */ +async function privateEndpointConnectionsList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.list(resourceGroupName, namespaceName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + privateEndpointConnectionsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsUpdateSample.js b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsUpdateSample.js new file mode 100644 index 000000000000..e6ac3aeced4c --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/privateEndpointConnectionsUpdateSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Approves or rejects Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Approves or rejects Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionUpdate.json + */ +async function privateEndpointConnectionsUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const parameters = { + properties: { + privateEndpoint: {}, + privateLinkServiceConnectionState: { status: "Approved" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginUpdateAndWait( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/sample.env b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/sample.env similarity index 100% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/javascript/sample.env rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/javascript/sample.env diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/README.md b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/README.md new file mode 100644 index 000000000000..2b9bbedfc3b8 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/README.md @@ -0,0 +1,131 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [namespacesCheckAvailabilitySample.ts][namespacescheckavailabilitysample] | Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CheckAvailability.json | +| [namespacesCreateOrUpdateAuthorizationRuleSample.ts][namespacescreateorupdateauthorizationrulesample] | Creates an authorization rule for a namespace x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleCreateOrUpdate.json | +| [namespacesCreateOrUpdateSample.ts][namespacescreateorupdatesample] | Creates / Updates a Notification Hub namespace. This operation is idempotent. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CreateOrUpdate.json | +| [namespacesDeleteAuthorizationRuleSample.ts][namespacesdeleteauthorizationrulesample] | Deletes a namespace authorization rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleDelete.json | +| [namespacesDeleteSample.ts][namespacesdeletesample] | Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Delete.json | +| [namespacesGetAuthorizationRuleSample.ts][namespacesgetauthorizationrulesample] | Gets an authorization rule for a namespace by name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleGet.json | +| [namespacesGetPnsCredentialsSample.ts][namespacesgetpnscredentialssample] | Lists the PNS credentials associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PnsCredentialsGet.json | +| [namespacesGetSample.ts][namespacesgetsample] | Returns the given namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Get.json | +| [namespacesListAllSample.ts][namespaceslistallsample] | Lists all the available namespaces within the subscription. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListBySubscription.json | +| [namespacesListAuthorizationRulesSample.ts][namespaceslistauthorizationrulessample] | Gets the authorization rules for a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleList.json | +| [namespacesListKeysSample.ts][namespaceslistkeyssample] | Gets the Primary and Secondary ConnectionStrings to the namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleListKeys.json | +| [namespacesListSample.ts][namespaceslistsample] | Lists the available namespaces within a resource group. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListByResourceGroup.json | +| [namespacesRegenerateKeysSample.ts][namespacesregeneratekeyssample] | Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleRegenerateKey.json | +| [namespacesUpdateSample.ts][namespacesupdatesample] | Patches the existing namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Update.json | +| [notificationHubsCheckNotificationHubAvailabilitySample.ts][notificationhubschecknotificationhubavailabilitysample] | Checks the availability of the given notificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CheckAvailability.json | +| [notificationHubsCreateOrUpdateAuthorizationRuleSample.ts][notificationhubscreateorupdateauthorizationrulesample] | Creates/Updates an authorization rule for a NotificationHub x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleCreateOrUpdate.json | +| [notificationHubsCreateOrUpdateSample.ts][notificationhubscreateorupdatesample] | Creates/Update a NotificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CreateOrUpdate.json | +| [notificationHubsDebugSendSample.ts][notificationhubsdebugsendsample] | Test send a push notification. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/DebugSend.json | +| [notificationHubsDeleteAuthorizationRuleSample.ts][notificationhubsdeleteauthorizationrulesample] | Deletes a notificationHub authorization rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleDelete.json | +| [notificationHubsDeleteSample.ts][notificationhubsdeletesample] | Deletes a notification hub associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Delete.json | +| [notificationHubsGetAuthorizationRuleSample.ts][notificationhubsgetauthorizationrulesample] | Gets an authorization rule for a NotificationHub by name. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleGet.json | +| [notificationHubsGetPnsCredentialsSample.ts][notificationhubsgetpnscredentialssample] | Lists the PNS Credentials associated with a notification hub. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/PnsCredentialsGet.json | +| [notificationHubsGetSample.ts][notificationhubsgetsample] | Gets the notification hub. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Get.json | +| [notificationHubsListAuthorizationRulesSample.ts][notificationhubslistauthorizationrulessample] | Gets the authorization rules for a NotificationHub. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleList.json | +| [notificationHubsListKeysSample.ts][notificationhubslistkeyssample] | Gets the Primary and Secondary ConnectionStrings to the NotificationHub x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleListKeys.json | +| [notificationHubsListSample.ts][notificationhubslistsample] | Lists the notification hubs associated with a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/List.json | +| [notificationHubsRegenerateKeysSample.ts][notificationhubsregeneratekeyssample] | Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleRegenerateKey.json | +| [notificationHubsUpdateSample.ts][notificationhubsupdatesample] | Patch a NotificationHub in a namespace. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Update.json | +| [operationsListSample.ts][operationslistsample] | Lists all available Notification Hubs operations. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NHOperationsList.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes the Private Endpoint Connection. This is a public API that can be called directly by Notification Hubs users. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionDelete.json | +| [privateEndpointConnectionsGetGroupIdSample.ts][privateendpointconnectionsgetgroupidsample] | Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceGet.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Returns a Private Endpoint Connection with a given name. This is a public API that can be called directly by Notification Hubs users. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionGet.json | +| [privateEndpointConnectionsListGroupIdsSample.ts][privateendpointconnectionslistgroupidssample] | Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceList.json | +| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. This is a public API that can be called directly by Notification Hubs users. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionList.json | +| [privateEndpointConnectionsUpdateSample.ts][privateendpointconnectionsupdatesample] | Approves or rejects Private Endpoint Connection. This is a public API that can be called directly by Notification Hubs users. x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionUpdate.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/namespacesCheckAvailabilitySample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env NOTIFICATIONHUBS_SUBSCRIPTION_ID="" node dist/namespacesCheckAvailabilitySample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[namespacescheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCheckAvailabilitySample.ts +[namespacescreateorupdateauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCreateOrUpdateAuthorizationRuleSample.ts +[namespacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCreateOrUpdateSample.ts +[namespacesdeleteauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesDeleteAuthorizationRuleSample.ts +[namespacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesDeleteSample.ts +[namespacesgetauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetAuthorizationRuleSample.ts +[namespacesgetpnscredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetPnsCredentialsSample.ts +[namespacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetSample.ts +[namespaceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListAllSample.ts +[namespaceslistauthorizationrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListAuthorizationRulesSample.ts +[namespaceslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListKeysSample.ts +[namespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListSample.ts +[namespacesregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesRegenerateKeysSample.ts +[namespacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesUpdateSample.ts +[notificationhubschecknotificationhubavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCheckNotificationHubAvailabilitySample.ts +[notificationhubscreateorupdateauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts +[notificationhubscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCreateOrUpdateSample.ts +[notificationhubsdebugsendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDebugSendSample.ts +[notificationhubsdeleteauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDeleteAuthorizationRuleSample.ts +[notificationhubsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDeleteSample.ts +[notificationhubsgetauthorizationrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetAuthorizationRuleSample.ts +[notificationhubsgetpnscredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetPnsCredentialsSample.ts +[notificationhubsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetSample.ts +[notificationhubslistauthorizationrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListAuthorizationRulesSample.ts +[notificationhubslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListKeysSample.ts +[notificationhubslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListSample.ts +[notificationhubsregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsRegenerateKeysSample.ts +[notificationhubsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsUpdateSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/operationsListSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetgroupidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsGetGroupIdSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistgroupidssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsListGroupIdsSample.ts +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsListSample.ts +[privateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-notificationhubs?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/package.json b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/package.json similarity index 83% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/package.json rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/package.json index a710a35c7d7f..7e8dc89fd838 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/package.json +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/package.json @@ -1,8 +1,8 @@ { - "name": "@azure-samples/arm-notificationhubs-ts", + "name": "@azure-samples/arm-notificationhubs-ts-beta", "private": true, "version": "1.0.0", - "description": " client library samples for TypeScript", + "description": " client library samples for TypeScript (Beta)", "engines": { "node": ">=18.0.0" }, @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/notificationhubs/arm-notificationhubs", "dependencies": { - "@azure/arm-notificationhubs": "latest", + "@azure/arm-notificationhubs": "next", "dotenv": "latest", "@azure/identity": "^4.0.1" }, diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/sample.env b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/sample.env similarity index 100% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/sample.env rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/sample.env diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCheckAvailabilitySample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCheckAvailabilitySample.ts similarity index 70% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCheckAvailabilitySample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCheckAvailabilitySample.ts index 4fdc59e7df8f..f80a2b1de710 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCheckAvailabilitySample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCheckAvailabilitySample.ts @@ -10,28 +10,37 @@ // Licensed under the MIT License. import { CheckAvailabilityParameters, - NotificationHubsManagementClient + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. * * @summary Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCheckNameAvailability.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CheckAvailability.json */ -async function nameSpaceCheckNameAvailability() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; +async function namespacesCheckAvailability() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; const parameters: CheckAvailabilityParameters = { - name: "sdk-Namespace-2924" + name: "sdk-Namespace-2924", }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.checkAvailability(parameters); console.log(result); } -nameSpaceCheckNameAvailability().catch(console.error); +async function main() { + namespacesCheckAvailability(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCreateOrUpdateAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCreateOrUpdateAuthorizationRuleSample.ts similarity index 57% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCreateOrUpdateAuthorizationRuleSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCreateOrUpdateAuthorizationRuleSample.ts index 7ccb8e032e38..809cc9376664 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesCreateOrUpdateAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCreateOrUpdateAuthorizationRuleSample.ts @@ -9,37 +9,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - SharedAccessAuthorizationRuleCreateOrUpdateParameters, - NotificationHubsManagementClient + SharedAccessAuthorizationRuleResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates an authorization rule for a namespace * * @summary Creates an authorization rule for a namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleCreateOrUpdate.json */ -async function nameSpaceAuthorizationRuleCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesCreateOrUpdateAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "sdk-AuthRules-1788"; - const parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters = { - properties: { rights: ["Listen", "Send"] } + const parameters: SharedAccessAuthorizationRuleResource = { + rights: ["Listen", "Send"], }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.createOrUpdateAuthorizationRule( resourceGroupName, namespaceName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -nameSpaceAuthorizationRuleCreate().catch(console.error); +async function main() { + namespacesCreateOrUpdateAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCreateOrUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..022d1f5cf9ab --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesCreateOrUpdateSample.ts @@ -0,0 +1,62 @@ +/* + * 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 { + NamespaceResource, + NotificationHubsManagementClient, +} from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @summary Creates / Updates a Notification Hub namespace. This operation is idempotent. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/CreateOrUpdate.json + */ +async function namespacesCreateOrUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const parameters: NamespaceResource = { + location: "South Central US", + networkAcls: { + ipRules: [ + { ipMask: "185.48.100.00/24", rights: ["Manage", "Send", "Listen"] }, + ], + publicNetworkRule: { rights: ["Listen"] }, + }, + sku: { name: "Standard", tier: "Standard" }, + tags: { tag1: "value1", tag2: "value2" }, + zoneRedundancy: "Enabled", + }; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.namespaces.beginCreateOrUpdateAndWait( + resourceGroupName, + namespaceName, + parameters, + ); + console.log(result); +} + +async function main() { + namespacesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesDeleteAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesDeleteAuthorizationRuleSample.ts similarity index 63% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesDeleteAuthorizationRuleSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesDeleteAuthorizationRuleSample.ts index 39fe7bbe2a4c..390c9e067c92 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesDeleteAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesDeleteAuthorizationRuleSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a namespace authorization rule * * @summary Deletes a namespace authorization rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleDelete.json */ -async function nameSpaceAuthorizationRuleDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesDeleteAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.deleteAuthorizationRule( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleDelete().catch(console.error); +async function main() { + namespacesDeleteAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesDeleteSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesDeleteSample.ts similarity index 64% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesDeleteSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesDeleteSample.ts index 41788af22db6..485771ee8b89 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesDeleteSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesDeleteSample.ts @@ -10,27 +10,37 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * * @summary Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Delete.json */ -async function nameSpaceDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); - const result = await client.namespaces.beginDeleteAndWait( + const result = await client.namespaces.delete( resourceGroupName, - namespaceName + namespaceName, ); console.log(result); } -nameSpaceDelete().catch(console.error); +async function main() { + namespacesDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesGetAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetAuthorizationRuleSample.ts similarity index 64% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesGetAuthorizationRuleSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetAuthorizationRuleSample.ts index e797a3c4035c..c3e9430339be 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesGetAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetAuthorizationRuleSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an authorization rule for a namespace by name. * * @summary Gets an authorization rule for a namespace by name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleGet.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleGet.json */ -async function nameSpaceAuthorizationRuleGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesGetAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.getAuthorizationRule( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleGet().catch(console.error); +async function main() { + namespacesGetAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetPnsCredentialsSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetPnsCredentialsSample.ts new file mode 100644 index 000000000000..8af1433220ab --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetPnsCredentialsSample.ts @@ -0,0 +1,46 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the PNS credentials associated with a namespace. + * + * @summary Lists the PNS credentials associated with a namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PnsCredentialsGet.json + */ +async function namespacesGetPnsCredentials() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.namespaces.getPnsCredentials( + resourceGroupName, + namespaceName, + ); + console.log(result); +} + +async function main() { + namespacesGetPnsCredentials(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesGetSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetSample.ts similarity index 57% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesGetSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetSample.ts index 34fcd43f851f..852956365db2 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesGetSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesGetSample.ts @@ -10,24 +10,34 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Returns the description for the specified namespace. + * This sample demonstrates how to Returns the given namespace. * - * @summary Returns the description for the specified namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceGet.json + * @summary Returns the given namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Get.json */ -async function nameSpaceGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.get(resourceGroupName, namespaceName); console.log(result); } -nameSpaceGet().catch(console.error); +async function main() { + namespacesGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListAllSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListAllSample.ts similarity index 66% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListAllSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListAllSample.ts index 87072d3cc3bf..a53770aea01d 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListAllSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListAllSample.ts @@ -10,19 +10,24 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * This sample demonstrates how to Lists all the available namespaces within the subscription. * - * @summary Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceList.json + * @summary Lists all the available namespaces within the subscription. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListBySubscription.json */ -async function nameSpaceList() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; +async function namespacesListAll() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.namespaces.listAll()) { @@ -31,4 +36,8 @@ async function nameSpaceList() { console.log(resArray); } -nameSpaceList().catch(console.error); +async function main() { + namespacesListAll(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListAuthorizationRulesSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListAuthorizationRulesSample.ts similarity index 64% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListAuthorizationRulesSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListAuthorizationRulesSample.ts index b1c7949e3dd0..47accda124b3 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListAuthorizationRulesSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListAuthorizationRulesSample.ts @@ -10,30 +10,40 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the authorization rules for a namespace. * * @summary Gets the authorization rules for a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListAll.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleList.json */ -async function nameSpaceAuthorizationRuleListAll() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesListAuthorizationRules() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.namespaces.listAuthorizationRules( resourceGroupName, - namespaceName + namespaceName, )) { resArray.push(item); } console.log(resArray); } -nameSpaceAuthorizationRuleListAll().catch(console.error); +async function main() { + namespacesListAuthorizationRules(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListKeysSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListKeysSample.ts similarity index 62% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListKeysSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListKeysSample.ts index 584d1fd12b95..59d6c04be29b 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListKeysSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListKeysSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the namespace + * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the namespace. * - * @summary Gets the Primary and Secondary ConnectionStrings to the namespace - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListKey.json + * @summary Gets the Primary and Secondary ConnectionStrings to the namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleListKeys.json */ -async function nameSpaceAuthorizationRuleListKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesListKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.listKeys( resourceGroupName, namespaceName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -nameSpaceAuthorizationRuleListKey().catch(console.error); +async function main() { + namespacesListKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListSample.ts similarity index 59% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListSample.ts index 9b278248c444..2d6f55d5f0ad 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesListSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesListSample.ts @@ -10,20 +10,26 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the available namespaces within a resourceGroup. + * This sample demonstrates how to Lists the available namespaces within a resource group. * - * @summary Lists the available namespaces within a resourceGroup. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceListByResourceGroup.json + * @summary Lists the available namespaces within a resource group. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/ListByResourceGroup.json */ -async function nameSpaceListByResourceGroup() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.namespaces.list(resourceGroupName)) { @@ -32,4 +38,8 @@ async function nameSpaceListByResourceGroup() { console.log(resArray); } -nameSpaceListByResourceGroup().catch(console.error); +async function main() { + namespacesList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesRegenerateKeysSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesRegenerateKeysSample.ts similarity index 61% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesRegenerateKeysSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesRegenerateKeysSample.ts index 5fa2210c7c3b..4e6c1aeb758a 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/namespacesRegenerateKeysSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesRegenerateKeysSample.ts @@ -9,35 +9,45 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - PolicykeyResource, - NotificationHubsManagementClient + PolicyKeyResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule * * @summary Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleRegenrateKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/AuthorizationRuleRegenerateKey.json */ -async function nameSpaceAuthorizationRuleRegenerateKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function namespacesRegenerateKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const authorizationRuleName = "RootManageSharedAccessKey"; - const parameters: PolicykeyResource = { policyKey: "PrimaryKey" }; + const parameters: PolicyKeyResource = { policyKey: "PrimaryKey" }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.namespaces.regenerateKeys( resourceGroupName, namespaceName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -nameSpaceAuthorizationRuleRegenerateKey().catch(console.error); +async function main() { + namespacesRegenerateKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesUpdateSample.ts new file mode 100644 index 000000000000..f5600482160e --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/namespacesUpdateSample.ts @@ -0,0 +1,62 @@ +/* + * 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 { + NamespacePatchParameters, + NotificationHubsManagementClient, +} from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patches the existing namespace. + * + * @summary Patches the existing namespace. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/Update.json + */ +async function namespacesUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const parameters: NamespacePatchParameters = { + properties: { + pnsCredentials: { + gcmCredential: { + gcmEndpoint: "https://fcm.googleapis.com/fcm/send", + googleApiKey: "#############################", + }, + }, + }, + sku: { name: "Free" }, + tags: { tag1: "value3" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.namespaces.update( + resourceGroupName, + namespaceName, + parameters, + ); + console.log(result); +} + +async function main() { + namespacesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCheckNotificationHubAvailabilitySample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCheckNotificationHubAvailabilitySample.ts similarity index 62% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCheckNotificationHubAvailabilitySample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCheckNotificationHubAvailabilitySample.ts index 5c141d2210b3..103695f912b6 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCheckNotificationHubAvailabilitySample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCheckNotificationHubAvailabilitySample.ts @@ -10,35 +10,45 @@ // Licensed under the MIT License. import { CheckAvailabilityParameters, - NotificationHubsManagementClient + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks the availability of the given notificationHub in a namespace. * * @summary Checks the availability of the given notificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCheckNameAvailability.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CheckAvailability.json */ -async function notificationHubCheckNameAvailability() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCheckNotificationHubAvailability() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "locp-newns"; const parameters: CheckAvailabilityParameters = { name: "sdktest", - location: "West Europe" + location: "West Europe", }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.checkNotificationHubAvailability( resourceGroupName, namespaceName, - parameters + parameters, ); console.log(result); } -notificationHubCheckNameAvailability().catch(console.error); +async function main() { + notificationHubsCheckNotificationHubAvailability(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts similarity index 56% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts index 869f7f085a36..3e9893eb3cd3 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCreateOrUpdateAuthorizationRuleSample.ts @@ -9,39 +9,49 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - SharedAccessAuthorizationRuleCreateOrUpdateParameters, - NotificationHubsManagementClient + SharedAccessAuthorizationRuleResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates/Updates an authorization rule for a NotificationHub * * @summary Creates/Updates an authorization rule for a NotificationHub - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleCreateOrUpdate.json */ -async function notificationHubAuthorizationRuleCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCreateOrUpdateAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const authorizationRuleName = "DefaultListenSharedAccessSignature"; - const parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters = { - properties: { rights: ["Listen", "Send"] } + const authorizationRuleName = "MyManageSharedAccessKey"; + const parameters: SharedAccessAuthorizationRuleResource = { + rights: ["Listen", "Send"], }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.createOrUpdateAuthorizationRule( resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -notificationHubAuthorizationRuleCreate().catch(console.error); +async function main() { + notificationHubsCreateOrUpdateAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCreateOrUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCreateOrUpdateSample.ts similarity index 59% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCreateOrUpdateSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCreateOrUpdateSample.ts index ced4f99a258f..3bcc8cb8cb7e 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsCreateOrUpdateSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsCreateOrUpdateSample.ts @@ -9,37 +9,45 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - NotificationHubCreateOrUpdateParameters, - NotificationHubsManagementClient + NotificationHubResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates/Update a NotificationHub in a namespace. * * @summary Creates/Update a NotificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCreate.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/CreateOrUpdate.json */ -async function notificationHubCreate() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsCreateOrUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const parameters: NotificationHubCreateOrUpdateParameters = { - location: "eastus" - }; + const parameters: NotificationHubResource = { location: "eastus" }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.createOrUpdate( resourceGroupName, namespaceName, notificationHubName, - parameters + parameters, ); console.log(result); } -notificationHubCreate().catch(console.error); +async function main() { + notificationHubsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDebugSendSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDebugSendSample.ts similarity index 53% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDebugSendSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDebugSendSample.ts index fa63e94e7707..4aab712e97b9 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDebugSendSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDebugSendSample.ts @@ -8,37 +8,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { - NotificationHubsDebugSendOptionalParams, - NotificationHubsManagementClient -} from "@azure/arm-notificationhubs"; +import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to test send a push notification + * This sample demonstrates how to Test send a push notification. * - * @summary test send a push notification - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDebugSend.json + * @summary Test send a push notification. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/DebugSend.json */ -async function debugsend() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDebugSend() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; - const parameters: Record = { data: { message: "Hello" } }; - const options: NotificationHubsDebugSendOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.debugSend( resourceGroupName, namespaceName, notificationHubName, - options ); console.log(result); } -debugsend().catch(console.error); +async function main() { + notificationHubsDebugSend(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDeleteAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDeleteAuthorizationRuleSample.ts similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDeleteAuthorizationRuleSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDeleteAuthorizationRuleSample.ts index ac72f4a32263..f26c4e0c2448 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDeleteAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDeleteAuthorizationRuleSample.ts @@ -10,31 +10,41 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a notificationHub authorization rule * * @summary Deletes a notificationHub authorization rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleDelete.json */ -async function notificationHubAuthorizationRuleDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDeleteAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.deleteAuthorizationRule( resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleDelete().catch(console.error); +async function main() { + notificationHubsDeleteAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDeleteSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDeleteSample.ts similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDeleteSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDeleteSample.ts index 4c70a99ad643..180c06b69169 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsDeleteSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsDeleteSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a notification hub associated with a namespace. * * @summary Deletes a notification hub associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDelete.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Delete.json */ -async function notificationHubDelete() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.delete( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubDelete().catch(console.error); +async function main() { + notificationHubsDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetAuthorizationRuleSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetAuthorizationRuleSample.ts similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetAuthorizationRuleSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetAuthorizationRuleSample.ts index 0a83324f0853..f1b1e7f154f2 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetAuthorizationRuleSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetAuthorizationRuleSample.ts @@ -10,31 +10,41 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an authorization rule for a NotificationHub by name. * * @summary Gets an authorization rule for a NotificationHub by name. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleGet.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleGet.json */ -async function notificationHubAuthorizationRuleGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGetAuthorizationRule() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.getAuthorizationRule( resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleGet().catch(console.error); +async function main() { + notificationHubsGetAuthorizationRule(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetPnsCredentialsSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetPnsCredentialsSample.ts similarity index 61% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetPnsCredentialsSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetPnsCredentialsSample.ts index 01b38dac0189..1fc721ebb46a 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetPnsCredentialsSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetPnsCredentialsSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the PNS Credentials associated with a notification hub . + * This sample demonstrates how to Lists the PNS Credentials associated with a notification hub. * - * @summary Lists the PNS Credentials associated with a notification hub . - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPnsCredentials.json + * @summary Lists the PNS Credentials associated with a notification hub. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/PnsCredentialsGet.json */ -async function notificationHubPnsCredentials() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGetPnsCredentials() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.getPnsCredentials( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubPnsCredentials().catch(console.error); +async function main() { + notificationHubsGetPnsCredentials(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetSample.ts similarity index 57% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetSample.ts index b9cfe2be30db..cf73171fa712 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsGetSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsGetSample.ts @@ -10,29 +10,39 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the notification hubs associated with a namespace. + * This sample demonstrates how to Gets the notification hub. * - * @summary Lists the notification hubs associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubGet.json + * @summary Gets the notification hub. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Get.json */ -async function notificationHubGet() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.get( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, ); console.log(result); } -notificationHubGet().catch(console.error); +async function main() { + notificationHubsGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListAuthorizationRulesSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListAuthorizationRulesSample.ts similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListAuthorizationRulesSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListAuthorizationRulesSample.ts index d542f81f21ec..965a31b72bce 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListAuthorizationRulesSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListAuthorizationRulesSample.ts @@ -10,32 +10,42 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the authorization rules for a NotificationHub. * * @summary Gets the authorization rules for a NotificationHub. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListAll.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleList.json */ -async function notificationHubAuthorizationRuleListAll() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsListAuthorizationRules() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.notificationHubs.listAuthorizationRules( resourceGroupName, namespaceName, - notificationHubName + notificationHubName, )) { resArray.push(item); } console.log(resArray); } -notificationHubAuthorizationRuleListAll().catch(console.error); +async function main() { + notificationHubsListAuthorizationRules(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListKeysSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListKeysSample.ts similarity index 66% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListKeysSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListKeysSample.ts index 91797f29c08a..9cb76d265961 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListKeysSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListKeysSample.ts @@ -10,31 +10,41 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the Primary and Secondary ConnectionStrings to the NotificationHub * * @summary Gets the Primary and Secondary ConnectionStrings to the NotificationHub - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleListKeys.json */ -async function notificationHubAuthorizationRuleListKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsListKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "sdk-AuthRules-5800"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.listKeys( resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName + authorizationRuleName, ); console.log(result); } -notificationHubAuthorizationRuleListKey().catch(console.error); +async function main() { + notificationHubsListKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListSample.ts similarity index 65% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListSample.ts index 43e455f72fb6..4a7e84a1c4ae 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsListSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsListSample.ts @@ -10,30 +10,40 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the notification hubs associated with a namespace. * * @summary Lists the notification hubs associated with a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubListByNameSpace.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/List.json */ -async function notificationHubListByNameSpace() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.notificationHubs.list( resourceGroupName, - namespaceName + namespaceName, )) { resArray.push(item); } console.log(resArray); } -notificationHubListByNameSpace().catch(console.error); +async function main() { + notificationHubsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsRegenerateKeysSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsRegenerateKeysSample.ts similarity index 62% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsRegenerateKeysSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsRegenerateKeysSample.ts index 557b7aa142f5..38ead21fb085 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/notificationHubsRegenerateKeysSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsRegenerateKeysSample.ts @@ -9,37 +9,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - PolicykeyResource, - NotificationHubsManagementClient + PolicyKeyResource, + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule * * @summary Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/AuthorizationRuleRegenerateKey.json */ -async function notificationHubAuthorizationRuleRegenrateKey() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "5ktrial"; +async function notificationHubsRegenerateKeys() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "nh-sdk-hub"; const authorizationRuleName = "DefaultListenSharedAccessSignature"; - const parameters: PolicykeyResource = { policyKey: "PrimaryKey" }; + const parameters: PolicyKeyResource = { policyKey: "PrimaryKey" }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const result = await client.notificationHubs.regenerateKeys( resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, - parameters + parameters, ); console.log(result); } -notificationHubAuthorizationRuleRegenrateKey().catch(console.error); +async function main() { + notificationHubsRegenerateKeys(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsPatchSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsUpdateSample.ts similarity index 52% rename from sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsPatchSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsUpdateSample.ts index 20a0cef6f0ce..b0d5ddbbe8b5 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples-dev/notificationHubsPatchSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/notificationHubsUpdateSample.ts @@ -10,36 +10,50 @@ // Licensed under the MIT License. import { NotificationHubPatchParameters, - NotificationHubsPatchOptionalParams, - NotificationHubsManagementClient + NotificationHubsManagementClient, } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Patch a NotificationHub in a namespace. * * @summary Patch a NotificationHub in a namespace. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPatch.json + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NotificationHubs/Update.json */ -async function notificationHubPatch() { - const subscriptionId = "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; - const resourceGroupName = "sdkresourceGroup"; +async function notificationHubsUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "sdkresourceGroup"; const namespaceName = "nh-sdk-ns"; const notificationHubName = "sdk-notificationHubs-8708"; - const parameters: NotificationHubPatchParameters = {}; - const options: NotificationHubsPatchOptionalParams = { parameters }; + const parameters: NotificationHubPatchParameters = { + gcmCredential: { + gcmEndpoint: "https://fcm.googleapis.com/fcm/send", + googleApiKey: "###################################", + }, + registrationTtl: "10675199.02:48:05.4775807", + }; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); - const result = await client.notificationHubs.patch( + const result = await client.notificationHubs.update( resourceGroupName, namespaceName, notificationHubName, - options + parameters, ); console.log(result); } -notificationHubPatch().catch(console.error); +async function main() { + notificationHubsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/operationsListSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/operationsListSample.ts similarity index 61% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/operationsListSample.ts rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/operationsListSample.ts index 8d5a7ec9db42..ff8bfc43839c 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/src/operationsListSample.ts +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/operationsListSample.ts @@ -10,19 +10,24 @@ // Licensed under the MIT License. import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists all of the available NotificationHubs REST API operations. + * This sample demonstrates how to Lists all available Notification Hubs operations. * - * @summary Lists all of the available NotificationHubs REST API operations. - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NHOperationsList.json + * @summary Lists all available Notification Hubs operations. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/NHOperationsList.json */ async function operationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new NotificationHubsManagementClient( credential, - subscriptionId + subscriptionId, ); const resArray = new Array(); for await (let item of client.operations.list()) { @@ -31,4 +36,8 @@ async function operationsList() { console.log(resArray); } -operationsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..c7f7fc12587c --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,51 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes the Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Deletes the Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionDelete.json + */ +async function privateEndpointConnectionsDelete() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsGetGroupIdSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsGetGroupIdSample.ts new file mode 100644 index 000000000000..3ac6ba4aa810 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsGetGroupIdSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * + * @summary Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceGet.json + */ +async function privateEndpointConnectionsGetGroupId() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const subResourceName = "namespace"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.privateEndpointConnections.getGroupId( + resourceGroupName, + namespaceName, + subResourceName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsGetGroupId(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..196a70b5080b --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,51 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Returns a Private Endpoint Connection with a given name. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Returns a Private Endpoint Connection with a given name. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionGet.json + */ +async function privateEndpointConnectionsGet() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsListGroupIdsSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsListGroupIdsSample.ts new file mode 100644 index 000000000000..d5e0783f240a --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsListGroupIdsSample.ts @@ -0,0 +1,51 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * + * @summary Even though this namespace requires subscription id, resource group and namespace name, it returns a constant payload (for a given namespacE) every time it's called. +That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the request. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateLinkResourceList.json + */ +async function privateEndpointConnectionsListGroupIds() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.listGroupIds( + resourceGroupName, + namespaceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + privateEndpointConnectionsListGroupIds(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsListSample.ts new file mode 100644 index 000000000000..fea89497694b --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsListSample.ts @@ -0,0 +1,51 @@ +/* + * 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 { NotificationHubsManagementClient } from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionList.json + */ +async function privateEndpointConnectionsList() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.list( + resourceGroupName, + namespaceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + privateEndpointConnectionsList(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts new file mode 100644 index 000000000000..0ddb213a1c86 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts @@ -0,0 +1,61 @@ +/* + * 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 { + PrivateEndpointConnectionResource, + NotificationHubsManagementClient, +} from "@azure/arm-notificationhubs"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Approves or rejects Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * + * @summary Approves or rejects Private Endpoint Connection. +This is a public API that can be called directly by Notification Hubs users. + * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/Namespaces/PrivateEndpointConnectionUpdate.json + */ +async function privateEndpointConnectionsUpdate() { + const subscriptionId = + process.env["NOTIFICATIONHUBS_SUBSCRIPTION_ID"] || + "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40"; + const resourceGroupName = + process.env["NOTIFICATIONHUBS_RESOURCE_GROUP"] || "5ktrial"; + const namespaceName = "nh-sdk-ns"; + const privateEndpointConnectionName = + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const parameters: PrivateEndpointConnectionResource = { + properties: { + privateEndpoint: {}, + privateLinkServiceConnectionState: { status: "Approved" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new NotificationHubsManagementClient( + credential, + subscriptionId, + ); + const result = await client.privateEndpointConnections.beginUpdateAndWait( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/tsconfig.json b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/tsconfig.json similarity index 92% rename from sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/tsconfig.json rename to sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/tsconfig.json index 416c2dd82e00..e26ce2a6d8f7 100644 --- a/sdk/notificationhubs/arm-notificationhubs/samples/v2/typescript/tsconfig.json +++ b/sdk/notificationhubs/arm-notificationhubs/samples/v3-beta/typescript/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2018", + "target": "ES2020", "module": "commonjs", "moduleResolution": "node", "resolveJsonModule": true, diff --git a/sdk/notificationhubs/arm-notificationhubs/src/lroImpl.ts b/sdk/notificationhubs/arm-notificationhubs/src/lroImpl.ts index 518d5f053b4e..b27f5ac7209b 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/lroImpl.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/lroImpl.ts @@ -6,29 +6,37 @@ * 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"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; } diff --git a/sdk/notificationhubs/arm-notificationhubs/src/models/index.ts b/sdk/notificationhubs/arm-notificationhubs/src/models/index.ts index d8e8dc92602c..d35fa2d1ed21 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/models/index.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/models/index.ts @@ -8,772 +8,1763 @@ import * as coreClient from "@azure/core-client"; -/** Result of the request to list NotificationHubs operations. It contains a list of operations and a URL link to get the next set of results. */ -export interface OperationListResult { +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ +export interface CheckAvailabilityParameters { /** - * List of NotificationHubs operations supported by the Microsoft.NotificationHubs resource provider. + * Gets resource Id * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Operation[]; + readonly id?: string; + /** Gets or sets resource name */ + name: string; /** - * URL to get the next set of operation list results if there are any. + * Gets resource type * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly type?: string; + /** Gets or sets resource location */ + location?: string; + /** Gets or sets resource tags */ + tags?: { [propertyName: string]: string }; + /** Not used and deprecated since API version 2023-01-01-preview */ + isAvailiable?: boolean; + /** The Sku description for a namespace */ + sku?: Sku; } -/** A NotificationHubs REST API operation */ -export interface Operation { +/** The Sku description for a namespace */ +export interface Sku { + /** Namespace SKU name. */ + name: SkuName; + /** Gets or sets the tier of particular sku */ + tier?: string; + /** Gets or sets the Sku size */ + size?: string; + /** Gets or sets the Sku Family */ + family?: string; + /** Gets or sets the capacity of the resource */ + capacity?: number; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * Operation name: {provider}/{resource}/{operation} + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; - /** The object that represents the operation. */ - display?: OperationDisplay; -} - -/** The object that represents the operation. */ -export interface OperationDisplay { + readonly id?: string; /** - * Service provider: Microsoft.NotificationHubs + * The name of the resource * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provider?: string; + readonly name?: string; /** - * Resource on which the operation is performed: Invoice, etc. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resource?: string; + readonly type?: string; /** - * Operation type: Read, write, delete, etc. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } -/** Error response indicates NotificationHubs service is not able to process the incoming request. The reason is provided in the error message. */ +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface ErrorResponse { - /** Error code. */ - code?: string; - /** Error message indicating why the operation failed. */ - message?: string; + /** The error object. */ + error?: ErrorDetail; } -/** Parameters supplied to the Check Name Availability for Namespace and NotificationHubs. */ -export interface CheckAvailabilityParameters { +/** The error detail. */ +export interface ErrorDetail { /** - * Resource Id + * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; - /** Resource name */ - name: string; + readonly code?: string; /** - * Resource type + * The error message. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; - /** Resource location */ - location?: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** The sku of the created namespace */ - sku?: Sku; - /** True if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. */ - isAvailiable?: boolean; -} - -/** The Sku description for a namespace */ -export interface Sku { - /** Name of the notification hub sku */ - name: SkuName; - /** The tier of particular sku */ - tier?: string; - /** The Sku size */ - size?: string; - /** The Sku Family */ - family?: string; - /** The capacity of the resource */ - capacity?: number; -} - -export interface Resource { + readonly message?: string; /** - * Resource Id + * The error target. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly target?: string; /** - * Resource name + * The error details. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly details?: ErrorDetail[]; /** - * Resource type + * The error additional info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; - /** Resource location */ - location?: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** The sku of the created namespace */ - sku?: Sku; -} - -/** Parameters supplied to the Patch Namespace operation. */ -export interface NamespacePatchParameters { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** The sku of the created namespace */ - sku?: Sku; + readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. */ -export interface SharedAccessAuthorizationRuleCreateOrUpdateParameters { - /** Properties of the Namespace AuthorizationRules. */ - properties: SharedAccessAuthorizationRuleProperties; +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; } /** SharedAccessAuthorizationRule properties. */ export interface SharedAccessAuthorizationRuleProperties { - /** The rights associated with the rule. */ - rights?: AccessRights[]; + /** Gets or sets the rights associated with the rule. */ + rights: AccessRights[]; /** - * A base64-encoded 256-bit primary key for signing and validating the SAS token. - * NOTE: This property will not be serialized. It can only be populated by the server. + * Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. */ - readonly primaryKey?: string; + primaryKey?: string; /** - * A base64-encoded 256-bit primary key for signing and validating the SAS token. - * NOTE: This property will not be serialized. It can only be populated by the server. + * Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. */ - readonly secondaryKey?: string; + secondaryKey?: string; /** - * A string that describes the authorization rule. + * Gets a string that describes the authorization rule. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly keyName?: string; /** - * A string that describes the claim type + * Gets the last modified time for this rule * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly claimType?: string; + readonly modifiedTime?: Date; /** - * A string that describes the claim value + * Gets the created time for this rule * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly claimValue?: string; + readonly createdTime?: Date; /** - * The last modified time for this rule + * Gets a string that describes the claim type * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly modifiedTime?: string; + readonly claimType?: string; /** - * The created time for this rule + * Gets a string that describes the claim value * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdTime?: string; + readonly claimValue?: string; /** - * The revision number for the rule + * Gets the revision number for the rule * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly revision?: number; } -/** The response of the List Namespace operation. */ -export interface NamespaceListResult { - /** Result of the List Namespace operation. */ - value?: NamespaceResource[]; - /** Link to the next set of results. Not empty if Value contains incomplete list of Namespaces */ - nextLink?: string; -} - -/** The response of the List Namespace operation. */ -export interface SharedAccessAuthorizationRuleListResult { - /** Result of the List AuthorizationRules operation. */ - value?: SharedAccessAuthorizationRuleResource[]; - /** Link to the next set of results. Not empty if Value contains incomplete list of AuthorizationRules */ - nextLink?: string; -} - -/** Namespace/NotificationHub Connection String */ -export interface ResourceListKeys { - /** PrimaryConnectionString of the AuthorizationRule. */ - primaryConnectionString?: string; - /** SecondaryConnectionString of the created AuthorizationRule */ - secondaryConnectionString?: string; - /** PrimaryKey of the created AuthorizationRule. */ - primaryKey?: string; - /** SecondaryKey of the created AuthorizationRule */ - secondaryKey?: string; - /** KeyName of the created AuthorizationRule */ - keyName?: string; -} - -/** Namespace/NotificationHub Regenerate Keys */ -export interface PolicykeyResource { - /** Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. */ - policyKey?: string; -} - /** Description of a NotificationHub ApnsCredential. */ export interface ApnsCredential { - /** The APNS certificate. Specify if using Certificate Authentication Mode. */ + /** Gets or sets the APNS certificate. */ apnsCertificate?: string; - /** The APNS certificate password if it exists. */ + /** Gets or sets the certificate key. */ certificateKey?: string; - /** The APNS endpoint of this credential. If using Certificate Authentication Mode and Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify 'https://api.push.apple.com:443/3/device'. */ - endpoint?: string; - /** The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. */ + /** Gets or sets the endpoint of this credential. */ + endpoint: string; + /** Gets or sets the APNS certificate Thumbprint */ thumbprint?: string; - /** A 10-character key identifier (kid) key, obtained from your developer account. Specify if using Token Authentication Mode. */ + /** + * Gets or sets a 10-character key identifier (kid) key, obtained from + * your developer account + */ keyId?: string; - /** The name of the application or BundleId. Specify if using Token Authentication Mode. */ + /** Gets or sets the name of the application */ appName?: string; - /** The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from your developer account. Specify if using Token Authentication Mode. */ + /** + * Gets or sets the issuer (iss) registered claim key, whose value is + * your 10-character Team ID, obtained from your developer account + */ appId?: string; - /** Provider Authentication Token, obtained through your developer account. Specify if using Token Authentication Mode. */ + /** + * Gets or sets provider Authentication Token, obtained through your + * developer account + */ token?: string; } /** Description of a NotificationHub WnsCredential. */ export interface WnsCredential { - /** The package ID for this credential. */ + /** Gets or sets the package ID for this credential. */ packageSid?: string; - /** The secret key. */ + /** Gets or sets the secret key. */ secretKey?: string; - /** The Windows Live endpoint. */ + /** Gets or sets the Windows Live endpoint. */ windowsLiveEndpoint?: string; + /** Ges or sets the WNS Certificate Key. */ + certificateKey?: string; + /** Gets or sets the WNS Certificate. */ + wnsCertificate?: string; } /** Description of a NotificationHub GcmCredential. */ export interface GcmCredential { - /** The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send' */ + /** Gets or sets the GCM endpoint. */ gcmEndpoint?: string; - /** The Google API key. */ - googleApiKey?: string; + /** Gets or sets the Google API key. */ + googleApiKey: string; } /** Description of a NotificationHub MpnsCredential. */ export interface MpnsCredential { - /** The MPNS certificate. */ - mpnsCertificate?: string; - /** The certificate key for this credential. */ - certificateKey?: string; - /** The MPNS certificate Thumbprint */ - thumbprint?: string; + /** Gets or sets the MPNS certificate. */ + mpnsCertificate: string; + /** Gets or sets the certificate key for this credential. */ + certificateKey: string; + /** Gets or sets the MPNS certificate Thumbprint */ + thumbprint: string; } /** Description of a NotificationHub AdmCredential. */ export interface AdmCredential { - /** The client identifier. */ - clientId?: string; - /** The credential secret access key. */ - clientSecret?: string; - /** The URL of the authorization token. */ - authTokenUrl?: string; + /** Gets or sets the client identifier. */ + clientId: string; + /** Gets or sets the credential secret access key. */ + clientSecret: string; + /** Gets or sets the URL of the authorization token. */ + authTokenUrl: string; } /** Description of a NotificationHub BaiduCredential. */ export interface BaiduCredential { - /** Baidu Api Key. */ - baiduApiKey?: string; - /** Baidu Endpoint. */ - baiduEndPoint?: string; - /** Baidu Secret Key */ - baiduSecretKey?: string; + /** Gets or sets baidu Api Key. */ + baiduApiKey: string; + /** Gets or sets baidu Endpoint. */ + baiduEndPoint: string; + /** Gets or sets baidu Secret Key */ + baiduSecretKey: string; } -/** The response of the List NotificationHub operation. */ -export interface NotificationHubListResult { - /** Result of the List NotificationHub operation. */ - value?: NotificationHubResource[]; - /** Link to the next set of results. Not empty if Value contains incomplete list of NotificationHub */ - nextLink?: string; +/** Description of a NotificationHub BrowserCredential. */ +export interface BrowserCredential { + /** Gets or sets web push subject. */ + subject: string; + /** Gets or sets VAPID private key. */ + vapidPrivateKey: string; + /** Gets or sets VAPID public key. */ + vapidPublicKey: string; } -export interface SubResource { - /** Resource Id */ - id?: string; +/** Description of a NotificationHub XiaomiCredential. */ +export interface XiaomiCredential { + /** Gets or sets app secret. */ + appSecret?: string; + /** Gets or sets xiaomi service endpoint. */ + endpoint?: string; } -/** Description of a CheckAvailability resource. */ -export interface CheckAvailabilityResult extends Resource { - /** True if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. */ - isAvailiable?: boolean; +/** Description of a NotificationHub FcmV1Credential. */ +export interface FcmV1Credential { + /** Gets or sets client email. */ + clientEmail: string; + /** Gets or sets private key. */ + privateKey: string; + /** Gets or sets project id. */ + projectId: string; } -/** Parameters supplied to the CreateOrUpdate Namespace operation. */ -export interface NamespaceCreateOrUpdateParameters extends Resource { - /** The name of the namespace. */ - namePropertiesName?: string; - /** Provisioning state of the Namespace. */ - provisioningState?: string; - /** Specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North Central US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe */ - region?: string; +/** Patch parameter for NamespaceResource. */ +export interface NotificationHubPatchParameters { + /** The Sku description for a namespace */ + sku?: Sku; + /** Dictionary of */ + tags?: { [propertyName: string]: string }; + /** Gets or sets the NotificationHub name. */ + name?: string; + /** Gets or sets the RegistrationTtl of the created NotificationHub */ + registrationTtl?: string; /** - * Identifier for Azure Insights metrics + * Gets or sets the AuthorizationRules of the created NotificationHub * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly metricId?: string; - /** Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting */ - status?: string; - /** The time the namespace was created. */ - createdAt?: Date; - /** The time the namespace was updated. */ - updatedAt?: Date; - /** Endpoint you can use to perform NotificationHub operations. */ - serviceBusEndpoint?: string; - /** The Id of the Azure subscription associated with the namespace. */ - subscriptionId?: string; - /** ScaleUnit where the namespace gets created */ - scaleUnit?: string; - /** Whether or not the namespace is currently enabled. */ - enabled?: boolean; - /** Whether or not the namespace is set as Critical. */ - critical?: boolean; - /** Data center for the namespace */ - dataCenter?: string; - /** The namespace type. */ - namespaceType?: NamespaceType; + readonly authorizationRules?: SharedAccessAuthorizationRuleProperties[]; + /** Description of a NotificationHub ApnsCredential. */ + apnsCredential?: ApnsCredential; + /** Description of a NotificationHub WnsCredential. */ + wnsCredential?: WnsCredential; + /** Description of a NotificationHub GcmCredential. */ + gcmCredential?: GcmCredential; + /** Description of a NotificationHub MpnsCredential. */ + mpnsCredential?: MpnsCredential; + /** Description of a NotificationHub AdmCredential. */ + admCredential?: AdmCredential; + /** Description of a NotificationHub BaiduCredential. */ + baiduCredential?: BaiduCredential; + /** Description of a NotificationHub BrowserCredential. */ + browserCredential?: BrowserCredential; + /** Description of a NotificationHub XiaomiCredential. */ + xiaomiCredential?: XiaomiCredential; + /** Description of a NotificationHub FcmV1Credential. */ + fcmV1Credential?: FcmV1Credential; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly dailyMaxActiveDevices?: number; } -/** Description of a Namespace resource. */ -export interface NamespaceResource extends Resource { - /** The name of the namespace. */ - namePropertiesName?: string; - /** Provisioning state of the Namespace. */ - provisioningState?: string; - /** Specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North Central US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe */ - region?: string; +/** The response of the List NotificationHub operation. */ +export interface NotificationHubListResult { /** - * Identifier for Azure Insights metrics + * Gets or sets result of the List AuthorizationRules operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly metricId?: string; - /** Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting */ - status?: string; - /** The time the namespace was created. */ - createdAt?: Date; - /** The time the namespace was updated. */ - updatedAt?: Date; - /** Endpoint you can use to perform NotificationHub operations. */ - serviceBusEndpoint?: string; - /** The Id of the Azure subscription associated with the namespace. */ - subscriptionId?: string; - /** ScaleUnit where the namespace gets created */ - scaleUnit?: string; - /** Whether or not the namespace is currently enabled. */ - enabled?: boolean; - /** Whether or not the namespace is set as Critical. */ - critical?: boolean; - /** Data center for the namespace */ - dataCenter?: string; - /** The namespace type. */ - namespaceType?: NamespaceType; + readonly value?: NotificationHubResource[]; + /** + * Gets or sets link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; } -/** Description of a Namespace AuthorizationRules. */ -export interface SharedAccessAuthorizationRuleResource extends Resource { - /** The rights associated with the rule. */ - rights?: AccessRights[]; +/** Notification result for a single registration. */ +export interface RegistrationResult { /** - * A base64-encoded 256-bit primary key for signing and validating the SAS token. + * PNS type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly primaryKey?: string; + readonly applicationPlatform?: string; /** - * A base64-encoded 256-bit primary key for signing and validating the SAS token. + * PNS handle. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly secondaryKey?: string; + readonly pnsHandle?: string; /** - * A string that describes the authorization rule. + * Registration id. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly keyName?: string; + readonly registrationId?: string; /** - * A string that describes the claim type + * Notification outcome. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly claimType?: string; + readonly outcome?: string; +} + +/** The response of the List Namespace operation. */ +export interface SharedAccessAuthorizationRuleListResult { /** - * A string that describes the claim value + * Gets or sets result of the List AuthorizationRules operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly claimValue?: string; + readonly value?: SharedAccessAuthorizationRuleResource[]; + /** + * Gets or sets link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ +export interface ResourceListKeys { /** - * The last modified time for this rule + * Gets or sets primaryConnectionString of the AuthorizationRule. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly modifiedTime?: string; + readonly primaryConnectionString?: string; /** - * The created time for this rule + * Gets or sets secondaryConnectionString of the created + * AuthorizationRule * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdTime?: string; + readonly secondaryConnectionString?: string; /** - * The revision number for the rule + * Gets or sets primaryKey of the created AuthorizationRule. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly revision?: number; + readonly primaryKey?: string; + /** + * Gets or sets secondaryKey of the created AuthorizationRule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly secondaryKey?: string; + /** + * Gets or sets keyName of the created AuthorizationRule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly keyName?: string; } -/** Parameters supplied to the CreateOrUpdate NotificationHub operation. */ -export interface NotificationHubCreateOrUpdateParameters extends Resource { - /** The NotificationHub name. */ - namePropertiesName?: string; - /** The RegistrationTtl of the created NotificationHub */ - registrationTtl?: string; - /** The AuthorizationRules of the created NotificationHub */ - authorizationRules?: SharedAccessAuthorizationRuleProperties[]; - /** The ApnsCredential of the created NotificationHub */ - apnsCredential?: ApnsCredential; - /** The WnsCredential of the created NotificationHub */ - wnsCredential?: WnsCredential; - /** The GcmCredential of the created NotificationHub */ - gcmCredential?: GcmCredential; - /** The MpnsCredential of the created NotificationHub */ - mpnsCredential?: MpnsCredential; - /** The AdmCredential of the created NotificationHub */ - admCredential?: AdmCredential; - /** The BaiduCredential of the created NotificationHub */ - baiduCredential?: BaiduCredential; +/** Namespace / NotificationHub Regenerate Keys request. */ +export interface PolicyKeyResource { + /** Type of Shared Access Policy Key (primary or secondary). */ + policyKey: PolicyKeyType; } -/** Description of a NotificationHub Resource. */ -export interface NotificationHubResource extends Resource { - /** The NotificationHub name. */ - namePropertiesName?: string; - /** The RegistrationTtl of the created NotificationHub */ - registrationTtl?: string; - /** The AuthorizationRules of the created NotificationHub */ - authorizationRules?: SharedAccessAuthorizationRuleProperties[]; - /** The ApnsCredential of the created NotificationHub */ +/** Collection of Notification Hub or Notification Hub Namespace PNS credentials. */ +export interface PnsCredentials { + /** Description of a NotificationHub AdmCredential. */ + admCredential?: AdmCredential; + /** Description of a NotificationHub ApnsCredential. */ apnsCredential?: ApnsCredential; - /** The WnsCredential of the created NotificationHub */ - wnsCredential?: WnsCredential; - /** The GcmCredential of the created NotificationHub */ + /** Description of a NotificationHub BaiduCredential. */ + baiduCredential?: BaiduCredential; + /** Description of a NotificationHub BrowserCredential. */ + browserCredential?: BrowserCredential; + /** Description of a NotificationHub GcmCredential. */ gcmCredential?: GcmCredential; - /** The MpnsCredential of the created NotificationHub */ + /** Description of a NotificationHub MpnsCredential. */ mpnsCredential?: MpnsCredential; - /** The AdmCredential of the created NotificationHub */ - admCredential?: AdmCredential; - /** The BaiduCredential of the created NotificationHub */ - baiduCredential?: BaiduCredential; + /** Description of a NotificationHub WnsCredential. */ + wnsCredential?: WnsCredential; + /** Description of a NotificationHub XiaomiCredential. */ + xiaomiCredential?: XiaomiCredential; + /** Description of a NotificationHub FcmV1Credential. */ + fcmV1Credential?: FcmV1Credential; } -/** Parameters supplied to the patch NotificationHub operation. */ -export interface NotificationHubPatchParameters extends Resource { - /** The NotificationHub name. */ - namePropertiesName?: string; - /** The RegistrationTtl of the created NotificationHub */ - registrationTtl?: string; - /** The AuthorizationRules of the created NotificationHub */ - authorizationRules?: SharedAccessAuthorizationRuleProperties[]; - /** The ApnsCredential of the created NotificationHub */ - apnsCredential?: ApnsCredential; - /** The WnsCredential of the created NotificationHub */ - wnsCredential?: WnsCredential; - /** The GcmCredential of the created NotificationHub */ - gcmCredential?: GcmCredential; - /** The MpnsCredential of the created NotificationHub */ - mpnsCredential?: MpnsCredential; - /** The AdmCredential of the created NotificationHub */ - admCredential?: AdmCredential; - /** The BaiduCredential of the created NotificationHub */ - baiduCredential?: BaiduCredential; +/** Represents namespace properties. */ +export interface NamespaceProperties { + /** + * Name of the Notification Hubs namespace. This is immutable property, set automatically + * by the service when the namespace is created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** Defines values for OperationProvisioningState. */ + provisioningState?: OperationProvisioningState; + /** Namespace status. */ + status?: NamespaceStatus; + /** + * Gets or sets whether or not the namespace is currently enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enabled?: boolean; + /** + * Gets or sets whether or not the namespace is set as Critical. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly critical?: boolean; + /** + * Namespace subscription id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * Region. The value is always set to the same value as Namespace.Location, so we are deprecating + * this property. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly region?: string; + /** + * Azure Insights Metrics id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metricId?: string; + /** + * Time when the namespace was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdAt?: Date; + /** + * Time when the namespace was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly updatedAt?: Date; + /** Defines values for NamespaceType. */ + namespaceType?: NamespaceType; + /** Allowed replication region */ + replicationRegion?: ReplicationRegion; + /** Namespace SKU name. */ + zoneRedundancy?: ZoneRedundancyPreference; + /** A collection of network authorization rules. */ + networkAcls?: NetworkAcls; + /** Collection of Notification Hub or Notification Hub Namespace PNS credentials. */ + pnsCredentials?: PnsCredentials; + /** + * Gets or sets endpoint you can use to perform NotificationHub + * operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serviceBusEndpoint?: string; + /** + * Private Endpoint Connections for namespace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnectionResource[]; + /** Gets or sets scaleUnit where the namespace gets created */ + scaleUnit?: string; + /** Deprecated. */ + dataCenter?: string; + /** Type of public network access. */ + publicNetworkAccess?: PublicNetworkAccess; } -/** Description of a NotificationHub Resource. */ -export interface DebugSendResponse extends Resource { - /** successful send */ - success?: number; - /** send failure */ - failure?: number; - /** actual failure description */ - results?: Record; -} - -/** Description of a NotificationHub PNS Credentials. */ -export interface PnsCredentialsResource extends Resource { - /** The ApnsCredential of the created NotificationHub */ - apnsCredential?: ApnsCredential; - /** The WnsCredential of the created NotificationHub */ - wnsCredential?: WnsCredential; - /** The GcmCredential of the created NotificationHub */ - gcmCredential?: GcmCredential; - /** The MpnsCredential of the created NotificationHub */ - mpnsCredential?: MpnsCredential; - /** The AdmCredential of the created NotificationHub */ - admCredential?: AdmCredential; - /** The BaiduCredential of the created NotificationHub */ - baiduCredential?: BaiduCredential; +/** A collection of network authorization rules. */ +export interface NetworkAcls { + /** List of IP rules. */ + ipRules?: IpRule[]; + /** A default (public Internet) network authorization rule, which contains rights if no other network rule matches. */ + publicNetworkRule?: PublicInternetAuthorizationRule; } -/** Known values of {@link SkuName} that the service accepts. */ -export enum KnownSkuName { - /** Free */ - Free = "Free", - /** Basic */ - Basic = "Basic", - /** Standard */ - Standard = "Standard" +/** A network authorization rule that filters traffic based on IP address. */ +export interface IpRule { + /** IP mask. */ + ipMask: string; + /** List of access rights. */ + rights: AccessRights[]; } -/** - * Defines values for SkuName. \ - * {@link KnownSkuName} can be used interchangeably with SkuName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Free** \ - * **Basic** \ - * **Standard** +/** A default (public Internet) network authorization rule, which contains rights if no other network rule matches. */ +export interface PublicInternetAuthorizationRule { + /** List of access rights. */ + rights: AccessRights[]; +} + +/** Private Endpoint Connection properties. */ +export interface PrivateEndpointConnectionProperties { + /** State of Private Endpoint Connection. */ + provisioningState?: PrivateEndpointConnectionProvisioningState; + /** Represents a Private Endpoint that is connected to Notification Hubs namespace using Private Endpoint Connection. */ + privateEndpoint?: RemotePrivateEndpointConnection; + /** + * List of group ids. For Notification Hubs, it always contains a single "namespace" element. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupIds?: string[]; + /** State of the Private Link Service connection. */ + privateLinkServiceConnectionState?: RemotePrivateLinkServiceConnectionState; +} + +/** Represents a Private Endpoint that is connected to Notification Hubs namespace using Private Endpoint Connection. */ +export interface RemotePrivateEndpointConnection { + /** + * ARM resource ID of the Private Endpoint. This may belong to different subscription and resource group than a Notification Hubs namespace. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + +/** State of the Private Link Service connection. */ +export interface RemotePrivateLinkServiceConnectionState { + /** State of Private Link Connection. */ + status?: PrivateLinkConnectionStatus; + /** + * Human-friendly description. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * Human-friendly description of required actions. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionsRequired?: string; +} + +/** Patch parameter for NamespaceResource. */ +export interface NamespacePatchParameters { + /** The Sku description for a namespace */ + sku?: Sku; + /** Represents namespace properties. */ + properties?: NamespaceProperties; + /** Dictionary of */ + tags?: { [propertyName: string]: string }; +} + +/** The response of the List Namespace operation. */ +export interface NamespaceListResult { + /** + * Gets or sets result of the List AuthorizationRules operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: NamespaceResource[]; + /** + * Gets or sets link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** + * Result of the request to list NotificationHubs operations. It contains + * a list of operations and a URL link to get the next set of results. + */ +export interface OperationListResult { + /** + * Gets list of NotificationHubs operations supported by the + * Microsoft.NotificationHubs resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * Gets URL to get the next set of operation list results if there are + * any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A NotificationHubs REST API operation */ +export interface Operation { + /** + * Gets operation name: {provider}/{resource}/{operation} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; + /** Optional operation properties. */ + properties?: OperationProperties; + /** + * Gets or sets IsDataAction property. It is used to differentiate management and data plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; +} + +/** The object that represents the operation. */ +export interface OperationDisplay { + /** + * Gets service provider: Microsoft.NotificationHubs + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * Gets resource on which the operation is performed: Invoice, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * Gets operation type: Read, write, delete, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * Human-friendly operation description. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Optional operation properties. */ +export interface OperationProperties { + /** Optional service specification used in Operations API. */ + serviceSpecification?: ServiceSpecification; +} + +/** Optional service specification used in Operations API. */ +export interface ServiceSpecification { + /** + * Log specifications. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly logSpecifications?: LogSpecification[]; + /** + * Metric specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metricSpecifications?: MetricSpecification[]; +} + +/** A single log category specification. */ +export interface LogSpecification { + /** + * Name of the log category. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Display name of the log category. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * Duration of data written to a single blob. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly blobDuration?: string; + /** Category group for the log specification. */ + categoryGroups?: string[]; +} + +/** A metric specification. */ +export interface MetricSpecification { + /** + * Metric name / id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * User-visible metric name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * Description of the metric. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayDescription?: string; + /** + * Metric unit. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly unit?: string; + /** + * Type of the aggregation (Average, Minimum, Maximum, Total or Count). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly aggregationType?: string; + /** + * List of availabilities. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly availabilities?: Availability[]; + /** + * List of supported time grain types. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportedTimeGrainTypes?: string[]; + /** + * The matching regex pattern to be applied to the field pointed by the "metricsFilterPathSelector" flag in the ARM manifest. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metricFilterPattern?: string; + /** + * Optional property. If set to true, then zero will be returned for time duration where no metric is emitted / published. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly fillGapWithZero?: boolean; +} + +/** Represents metric availability (part of RP operation descriptions). */ +export interface Availability { + /** + * Time grain of the availability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly timeGrain?: string; + /** + * Duration of the availability blob. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly blobDuration?: string; +} + +/** The response of the List Private Endpoint Connections operation. */ +export interface PrivateEndpointConnectionResourceListResult { + /** + * Gets or sets result of the List AuthorizationRules operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PrivateEndpointConnectionResource[]; + /** + * Gets or sets link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Represents properties of Private Link Resource. */ +export interface PrivateLinkResourceProperties { + /** + * A Group Id for Private Link. For Notification Hubs, it is always set to "namespace". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * Required members. For Notification Hubs, it's always a collection with a single "namespace" item. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** + * Required DNS zone names. For Notification Hubs, it contains two CNames for Service Bus and Notification Hubs zones. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredZoneNames?: string[]; +} + +/** The response of the List Private Link Resources operation. */ +export interface PrivateLinkResourceListResult { + /** + * Gets or sets result of the List AuthorizationRules operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PrivateLinkResource[]; + /** + * Gets or sets link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** + * Part of Private Endpoint description that stores information about a connection between Private Endpoint and Notification Hubs namespace. + * This is internal class, not visible to customers, and we use it only to discover the link identifier. + */ +export interface ConnectionDetails { + /** + * A unique ID of the connection. This is not the ARM id, but rather an internal identifier set by the Networking RP. Notification Hubs code + * does not analyze it. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * IP address of the Private Endpoint. This is not used by Notification Hubs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateIpAddress?: string; + /** + * Link identifier. This is a string representation of an integer that is also encoded in every IPv6 frame received by Front Door, + * and we use it to create implicit authorization rule that allows connection from the associated Private Endpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly linkIdentifier?: string; + /** + * Group name. Always "namespace" for Notification Hubs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * Member name. Always "namespace" for Notification Hubs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memberName?: string; +} + +/** + * Represents a connectivity information to Notification Hubs namespace. This is part of PrivateLinkService proxy that tell + * the Networking RP how to connect to the Notification Hubs namespace. + */ +export interface GroupConnectivityInformation { + /** + * Group id. Always set to "namespace". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * Member name. Always set to "namespace". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memberName?: string; + /** + * List of customer-visible domain names that point to a Notification Hubs namespace. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerVisibleFqdns?: string[]; + /** + * One of the domain name from the customer-visible names; this is used internally by Private Link service to make connection to Notification Hubs + * namespace. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly internalFqdn?: string; + /** + * Not used by Notification Hubs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly redirectMapId?: string; + /** + * ARM region for Private Link Service. We use the region that contains the connected Notification Hubs namespace. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateLinkServiceArmRegion?: string; +} + +/** A customer-visible sub-resource of Private Endpoint, which describe the connection between Private Endpoint and Notification Hubs namespace. */ +export interface PrivateLinkServiceConnection { + /** Name of the Private Link Service connection. */ + name?: string; + /** List of group ids. Always contains a single element - "namespace" - for Notification Hub Namespace. */ + groupIds?: string[]; + /** Request message provided by the user that created the connection. This is usually used when the connection requires manual approval. */ + requestMessage?: string; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** Description of a CheckAvailability resource. */ +export interface CheckAvailabilityResult extends ProxyResource { + /** + * Gets or sets true if the name is available and can be used to + * create new Namespace/NotificationHub. Otherwise false. + */ + isAvailiable?: boolean; + /** Deprecated - only for compatibility. */ + location?: string; + /** Deprecated - only for compatibility. */ + tags?: { [propertyName: string]: string }; + /** The Sku description for a namespace */ + sku?: Sku; +} + +/** Description of a NotificationHub Resource. */ +export interface DebugSendResponse extends ProxyResource { + /** Deprecated - only for compatibility. */ + location?: string; + /** Deprecated - only for compatibility. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets successful send + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly success?: number; + /** + * Gets or sets send failure + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failure?: number; + /** + * Gets or sets actual failure description + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly results?: RegistrationResult[]; +} + +/** Response for POST requests that return single SharedAccessAuthorizationRule. */ +export interface SharedAccessAuthorizationRuleResource extends ProxyResource { + /** Deprecated - only for compatibility. */ + location?: string; + /** Deprecated - only for compatibility. */ + tags?: { [propertyName: string]: string }; + /** Gets or sets the rights associated with the rule. */ + rights?: AccessRights[]; + /** + * Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + */ + primaryKey?: string; + /** + * Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + */ + secondaryKey?: string; + /** + * Gets a string that describes the authorization rule. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly keyName?: string; + /** + * Gets the last modified time for this rule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly modifiedTime?: Date; + /** + * Gets the created time for this rule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdTime?: Date; + /** + * Gets a string that describes the claim type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly claimType?: string; + /** + * Gets a string that describes the claim value + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly claimValue?: string; + /** + * Gets the revision number for the rule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly revision?: number; +} + +/** + * Description of a NotificationHub PNS Credentials. This is a response of the POST requests that return namespace or hubs + * PNS credentials. + */ +export interface PnsCredentialsResource extends ProxyResource { + /** Deprecated - only for compatibility. */ + location?: string; + /** Deprecated - only for compatibility. */ + tags?: { [propertyName: string]: string }; + /** Description of a NotificationHub AdmCredential. */ + admCredential?: AdmCredential; + /** Description of a NotificationHub ApnsCredential. */ + apnsCredential?: ApnsCredential; + /** Description of a NotificationHub BaiduCredential. */ + baiduCredential?: BaiduCredential; + /** Description of a NotificationHub BrowserCredential. */ + browserCredential?: BrowserCredential; + /** Description of a NotificationHub GcmCredential. */ + gcmCredential?: GcmCredential; + /** Description of a NotificationHub MpnsCredential. */ + mpnsCredential?: MpnsCredential; + /** Description of a NotificationHub WnsCredential. */ + wnsCredential?: WnsCredential; + /** Description of a NotificationHub XiaomiCredential. */ + xiaomiCredential?: XiaomiCredential; + /** Description of a NotificationHub FcmV1Credential. */ + fcmV1Credential?: FcmV1Credential; +} + +/** Represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. */ +export interface PrivateEndpointConnectionResource extends ProxyResource { + /** Private Endpoint Connection properties. */ + properties?: PrivateEndpointConnectionProperties; +} + +/** A Private Link Arm Resource. */ +export interface PrivateLinkResource extends ProxyResource { + /** Represents properties of Private Link Resource. */ + properties?: PrivateLinkResourceProperties; +} + +/** Notification Hub Resource. */ +export interface NotificationHubResource extends TrackedResource { + /** The Sku description for a namespace */ + sku?: Sku; + /** Gets or sets the NotificationHub name. */ + namePropertiesName?: string; + /** Gets or sets the RegistrationTtl of the created NotificationHub */ + registrationTtl?: string; + /** + * Gets or sets the AuthorizationRules of the created NotificationHub + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly authorizationRules?: SharedAccessAuthorizationRuleProperties[]; + /** Description of a NotificationHub ApnsCredential. */ + apnsCredential?: ApnsCredential; + /** Description of a NotificationHub WnsCredential. */ + wnsCredential?: WnsCredential; + /** Description of a NotificationHub GcmCredential. */ + gcmCredential?: GcmCredential; + /** Description of a NotificationHub MpnsCredential. */ + mpnsCredential?: MpnsCredential; + /** Description of a NotificationHub AdmCredential. */ + admCredential?: AdmCredential; + /** Description of a NotificationHub BaiduCredential. */ + baiduCredential?: BaiduCredential; + /** Description of a NotificationHub BrowserCredential. */ + browserCredential?: BrowserCredential; + /** Description of a NotificationHub XiaomiCredential. */ + xiaomiCredential?: XiaomiCredential; + /** Description of a NotificationHub FcmV1Credential. */ + fcmV1Credential?: FcmV1Credential; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly dailyMaxActiveDevices?: number; +} + +/** Notification Hubs Namespace Resource. */ +export interface NamespaceResource extends TrackedResource { + /** The Sku description for a namespace */ + sku: Sku; + /** + * Name of the Notification Hubs namespace. This is immutable property, set automatically + * by the service when the namespace is created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly namePropertiesName?: string; + /** Defines values for OperationProvisioningState. */ + provisioningState?: OperationProvisioningState; + /** Namespace status. */ + status?: NamespaceStatus; + /** + * Gets or sets whether or not the namespace is currently enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enabled?: boolean; + /** + * Gets or sets whether or not the namespace is set as Critical. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly critical?: boolean; + /** + * Namespace subscription id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * Region. The value is always set to the same value as Namespace.Location, so we are deprecating + * this property. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly region?: string; + /** + * Azure Insights Metrics id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metricId?: string; + /** + * Time when the namespace was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdAt?: Date; + /** + * Time when the namespace was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly updatedAt?: Date; + /** Defines values for NamespaceType. */ + namespaceType?: NamespaceType; + /** Allowed replication region */ + replicationRegion?: ReplicationRegion; + /** Namespace SKU name. */ + zoneRedundancy?: ZoneRedundancyPreference; + /** A collection of network authorization rules. */ + networkAcls?: NetworkAcls; + /** Collection of Notification Hub or Notification Hub Namespace PNS credentials. */ + pnsCredentials?: PnsCredentials; + /** + * Gets or sets endpoint you can use to perform NotificationHub + * operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serviceBusEndpoint?: string; + /** + * Private Endpoint Connections for namespace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnectionResource[]; + /** Gets or sets scaleUnit where the namespace gets created */ + scaleUnit?: string; + /** Deprecated. */ + dataCenter?: string; + /** Type of public network access. */ + publicNetworkAccess?: PublicNetworkAccess; +} + +/** Defines headers for PrivateEndpointConnections_delete operation. */ +export interface PrivateEndpointConnectionsDeleteHeaders { + location?: string; +} + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + /** Free */ + Free = "Free", + /** Basic */ + Basic = "Basic", + /** Standard */ + Standard = "Standard", +} + +/** + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Free** \ + * **Basic** \ + * **Standard** + */ +export type SkuName = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link AccessRights} that the service accepts. */ +export enum KnownAccessRights { + /** Manage */ + Manage = "Manage", + /** Send */ + Send = "Send", + /** Listen */ + Listen = "Listen", +} + +/** + * Defines values for AccessRights. \ + * {@link KnownAccessRights} can be used interchangeably with AccessRights, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Manage** \ + * **Send** \ + * **Listen** + */ +export type AccessRights = string; + +/** Known values of {@link PolicyKeyType} that the service accepts. */ +export enum KnownPolicyKeyType { + /** PrimaryKey */ + PrimaryKey = "PrimaryKey", + /** SecondaryKey */ + SecondaryKey = "SecondaryKey", +} + +/** + * Defines values for PolicyKeyType. \ + * {@link KnownPolicyKeyType} can be used interchangeably with PolicyKeyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PrimaryKey** \ + * **SecondaryKey** */ -export type SkuName = string; -/** Defines values for NamespaceType. */ -export type NamespaceType = "Messaging" | "NotificationHub"; -/** Defines values for AccessRights. */ -export type AccessRights = "Manage" | "Send" | "Listen"; +export type PolicyKeyType = string; + +/** Known values of {@link OperationProvisioningState} that the service accepts. */ +export enum KnownOperationProvisioningState { + /** Unknown */ + Unknown = "Unknown", + /** InProgress */ + InProgress = "InProgress", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Pending */ + Pending = "Pending", + /** Disabled */ + Disabled = "Disabled", +} -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} +/** + * Defines values for OperationProvisioningState. \ + * {@link KnownOperationProvisioningState} can be used interchangeably with OperationProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **InProgress** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Pending** \ + * **Disabled** + */ +export type OperationProvisioningState = string; + +/** Known values of {@link NamespaceStatus} that the service accepts. */ +export enum KnownNamespaceStatus { + /** Created */ + Created = "Created", + /** Creating */ + Creating = "Creating", + /** Suspended */ + Suspended = "Suspended", + /** Deleting */ + Deleting = "Deleting", +} -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +/** + * Defines values for NamespaceStatus. \ + * {@link KnownNamespaceStatus} can be used interchangeably with NamespaceStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Created** \ + * **Creating** \ + * **Suspended** \ + * **Deleting** + */ +export type NamespaceStatus = string; + +/** Known values of {@link NamespaceType} that the service accepts. */ +export enum KnownNamespaceType { + /** Messaging */ + Messaging = "Messaging", + /** NotificationHub */ + NotificationHub = "NotificationHub", +} + +/** + * Defines values for NamespaceType. \ + * {@link KnownNamespaceType} can be used interchangeably with NamespaceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Messaging** \ + * **NotificationHub** + */ +export type NamespaceType = string; + +/** Known values of {@link ReplicationRegion} that the service accepts. */ +export enum KnownReplicationRegion { + /** Default */ + Default = "Default", + /** WestUs2 */ + WestUs2 = "WestUs2", + /** NorthEurope */ + NorthEurope = "NorthEurope", + /** AustraliaEast */ + AustraliaEast = "AustraliaEast", + /** BrazilSouth */ + BrazilSouth = "BrazilSouth", + /** SouthEastAsia */ + SouthEastAsia = "SouthEastAsia", + /** SouthAfricaNorth */ + SouthAfricaNorth = "SouthAfricaNorth", + /** None */ + None = "None", +} + +/** + * Defines values for ReplicationRegion. \ + * {@link KnownReplicationRegion} can be used interchangeably with ReplicationRegion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default** \ + * **WestUs2** \ + * **NorthEurope** \ + * **AustraliaEast** \ + * **BrazilSouth** \ + * **SouthEastAsia** \ + * **SouthAfricaNorth** \ + * **None** + */ +export type ReplicationRegion = string; + +/** Known values of {@link ZoneRedundancyPreference} that the service accepts. */ +export enum KnownZoneRedundancyPreference { + /** Disabled */ + Disabled = "Disabled", + /** Enabled */ + Enabled = "Enabled", +} + +/** + * Defines values for ZoneRedundancyPreference. \ + * {@link KnownZoneRedundancyPreference} can be used interchangeably with ZoneRedundancyPreference, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** + */ +export type ZoneRedundancyPreference = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + /** Unknown */ + Unknown = "Unknown", + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** UpdatingByProxy */ + UpdatingByProxy = "UpdatingByProxy", + /** Deleting */ + Deleting = "Deleting", + /** DeletingByProxy */ + DeletingByProxy = "DeletingByProxy", + /** Deleted */ + Deleted = "Deleted", +} + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Succeeded** \ + * **Creating** \ + * **Updating** \ + * **UpdatingByProxy** \ + * **Deleting** \ + * **DeletingByProxy** \ + * **Deleted** + */ +export type PrivateEndpointConnectionProvisioningState = string; + +/** Known values of {@link PrivateLinkConnectionStatus} that the service accepts. */ +export enum KnownPrivateLinkConnectionStatus { + /** Disconnected */ + Disconnected = "Disconnected", + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected", +} + +/** + * Defines values for PrivateLinkConnectionStatus. \ + * {@link KnownPrivateLinkConnectionStatus} can be used interchangeably with PrivateLinkConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disconnected** \ + * **Pending** \ + * **Approved** \ + * **Rejected** + */ +export type PrivateLinkConnectionStatus = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type PublicNetworkAccess = string; /** Optional parameters. */ -export interface OperationsListNextOptionalParams +export interface NotificationHubsCheckNotificationHubAvailabilityOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; +/** Contains response data for the checkNotificationHubAvailability operation. */ +export type NotificationHubsCheckNotificationHubAvailabilityResponse = + CheckAvailabilityResult; /** Optional parameters. */ -export interface NamespacesCheckAvailabilityOptionalParams +export interface NotificationHubsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the checkAvailability operation. */ -export type NamespacesCheckAvailabilityResponse = CheckAvailabilityResult; +/** Contains response data for the get operation. */ +export type NotificationHubsGetResponse = NotificationHubResource; /** Optional parameters. */ -export interface NamespacesCreateOrUpdateOptionalParams +export interface NotificationHubsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdate operation. */ -export type NamespacesCreateOrUpdateResponse = NamespaceResource; +export type NotificationHubsCreateOrUpdateResponse = NotificationHubResource; /** Optional parameters. */ -export interface NamespacesPatchOptionalParams +export interface NotificationHubsUpdateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the patch operation. */ -export type NamespacesPatchResponse = NamespaceResource; +/** Contains response data for the update operation. */ +export type NotificationHubsUpdateResponse = NotificationHubResource; /** Optional parameters. */ -export interface NamespacesDeleteOptionalParams +export interface NotificationHubsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface NotificationHubsListOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; + /** Continuation token. */ + skipToken?: string; + /** Page size. */ + top?: number; } +/** Contains response data for the list operation. */ +export type NotificationHubsListResponse = NotificationHubListResult; + /** Optional parameters. */ -export interface NamespacesGetOptionalParams +export interface NotificationHubsDebugSendOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type NamespacesGetResponse = NamespaceResource; +/** Contains response data for the debugSend operation. */ +export type NotificationHubsDebugSendResponse = DebugSendResponse; /** Optional parameters. */ -export interface NamespacesCreateOrUpdateAuthorizationRuleOptionalParams +export interface NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAuthorizationRule operation. */ -export type NamespacesCreateOrUpdateAuthorizationRuleResponse = SharedAccessAuthorizationRuleResource; +export type NotificationHubsCreateOrUpdateAuthorizationRuleResponse = + SharedAccessAuthorizationRuleResource; /** Optional parameters. */ -export interface NamespacesDeleteAuthorizationRuleOptionalParams +export interface NotificationHubsDeleteAuthorizationRuleOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface NamespacesGetAuthorizationRuleOptionalParams +export interface NotificationHubsGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAuthorizationRule operation. */ -export type NamespacesGetAuthorizationRuleResponse = SharedAccessAuthorizationRuleResource; - -/** Optional parameters. */ -export interface NamespacesListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type NamespacesListResponse = NamespaceListResult; - -/** Optional parameters. */ -export interface NamespacesListAllOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAll operation. */ -export type NamespacesListAllResponse = NamespaceListResult; +export type NotificationHubsGetAuthorizationRuleResponse = + SharedAccessAuthorizationRuleResource; /** Optional parameters. */ -export interface NamespacesListAuthorizationRulesOptionalParams +export interface NotificationHubsListAuthorizationRulesOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAuthorizationRules operation. */ -export type NamespacesListAuthorizationRulesResponse = SharedAccessAuthorizationRuleListResult; +export type NotificationHubsListAuthorizationRulesResponse = + SharedAccessAuthorizationRuleListResult; /** Optional parameters. */ -export interface NamespacesListKeysOptionalParams +export interface NotificationHubsListKeysOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listKeys operation. */ -export type NamespacesListKeysResponse = ResourceListKeys; +export type NotificationHubsListKeysResponse = ResourceListKeys; /** Optional parameters. */ -export interface NamespacesRegenerateKeysOptionalParams +export interface NotificationHubsRegenerateKeysOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the regenerateKeys operation. */ -export type NamespacesRegenerateKeysResponse = ResourceListKeys; +export type NotificationHubsRegenerateKeysResponse = ResourceListKeys; /** Optional parameters. */ -export interface NamespacesListNextOptionalParams +export interface NotificationHubsGetPnsCredentialsOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type NamespacesListNextResponse = NamespaceListResult; +/** Contains response data for the getPnsCredentials operation. */ +export type NotificationHubsGetPnsCredentialsResponse = PnsCredentialsResource; /** Optional parameters. */ -export interface NamespacesListAllNextOptionalParams +export interface NotificationHubsListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listAllNext operation. */ -export type NamespacesListAllNextResponse = NamespaceListResult; +/** Contains response data for the listNext operation. */ +export type NotificationHubsListNextResponse = NotificationHubListResult; /** Optional parameters. */ -export interface NamespacesListAuthorizationRulesNextOptionalParams +export interface NotificationHubsListAuthorizationRulesNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAuthorizationRulesNext operation. */ -export type NamespacesListAuthorizationRulesNextResponse = SharedAccessAuthorizationRuleListResult; +export type NotificationHubsListAuthorizationRulesNextResponse = + SharedAccessAuthorizationRuleListResult; /** Optional parameters. */ -export interface NotificationHubsCheckNotificationHubAvailabilityOptionalParams +export interface NamespacesCheckAvailabilityOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the checkNotificationHubAvailability operation. */ -export type NotificationHubsCheckNotificationHubAvailabilityResponse = CheckAvailabilityResult; +/** Contains response data for the checkAvailability operation. */ +export type NamespacesCheckAvailabilityResponse = CheckAvailabilityResult; /** Optional parameters. */ -export interface NotificationHubsCreateOrUpdateOptionalParams +export interface NamespacesGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the createOrUpdate operation. */ -export type NotificationHubsCreateOrUpdateResponse = NotificationHubResource; +/** Contains response data for the get operation. */ +export type NamespacesGetResponse = NamespaceResource; /** Optional parameters. */ -export interface NotificationHubsPatchOptionalParams +export interface NamespacesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Parameters supplied to patch a NotificationHub Resource. */ - parameters?: NotificationHubPatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** Contains response data for the patch operation. */ -export type NotificationHubsPatchResponse = NotificationHubResource; +/** Contains response data for the createOrUpdate operation. */ +export type NamespacesCreateOrUpdateResponse = NamespaceResource; /** Optional parameters. */ -export interface NotificationHubsDeleteOptionalParams +export interface NamespacesUpdateOptionalParams extends coreClient.OperationOptions {} +/** Contains response data for the update operation. */ +export type NamespacesUpdateResponse = NamespaceResource; + /** Optional parameters. */ -export interface NotificationHubsGetOptionalParams +export interface NamespacesDeleteOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type NotificationHubsGetResponse = NotificationHubResource; +/** Optional parameters. */ +export interface NamespacesListAllOptionalParams + extends coreClient.OperationOptions { + /** Skip token for subsequent requests. */ + skipToken?: string; + /** Maximum number of results to return. */ + top?: number; +} + +/** Contains response data for the listAll operation. */ +export type NamespacesListAllResponse = NamespaceListResult; /** Optional parameters. */ -export interface NotificationHubsDebugSendOptionalParams +export interface NamespacesListOptionalParams extends coreClient.OperationOptions { - /** Debug send parameters */ - parameters?: Record; + /** Skip token for subsequent requests. */ + skipToken?: string; + /** Maximum number of results to return. */ + top?: number; } -/** Contains response data for the debugSend operation. */ -export type NotificationHubsDebugSendResponse = DebugSendResponse; +/** Contains response data for the list operation. */ +export type NamespacesListResponse = NamespaceListResult; /** Optional parameters. */ -export interface NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams +export interface NamespacesCreateOrUpdateAuthorizationRuleOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAuthorizationRule operation. */ -export type NotificationHubsCreateOrUpdateAuthorizationRuleResponse = SharedAccessAuthorizationRuleResource; +export type NamespacesCreateOrUpdateAuthorizationRuleResponse = + SharedAccessAuthorizationRuleResource; /** Optional parameters. */ -export interface NotificationHubsDeleteAuthorizationRuleOptionalParams +export interface NamespacesDeleteAuthorizationRuleOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface NotificationHubsGetAuthorizationRuleOptionalParams +export interface NamespacesGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAuthorizationRule operation. */ -export type NotificationHubsGetAuthorizationRuleResponse = SharedAccessAuthorizationRuleResource; - -/** Optional parameters. */ -export interface NotificationHubsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type NotificationHubsListResponse = NotificationHubListResult; +export type NamespacesGetAuthorizationRuleResponse = + SharedAccessAuthorizationRuleResource; /** Optional parameters. */ -export interface NotificationHubsListAuthorizationRulesOptionalParams +export interface NamespacesListAuthorizationRulesOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAuthorizationRules operation. */ -export type NotificationHubsListAuthorizationRulesResponse = SharedAccessAuthorizationRuleListResult; +export type NamespacesListAuthorizationRulesResponse = + SharedAccessAuthorizationRuleListResult; /** Optional parameters. */ -export interface NotificationHubsListKeysOptionalParams +export interface NamespacesListKeysOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listKeys operation. */ -export type NotificationHubsListKeysResponse = ResourceListKeys; +export type NamespacesListKeysResponse = ResourceListKeys; /** Optional parameters. */ -export interface NotificationHubsRegenerateKeysOptionalParams +export interface NamespacesRegenerateKeysOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the regenerateKeys operation. */ -export type NotificationHubsRegenerateKeysResponse = ResourceListKeys; +export type NamespacesRegenerateKeysResponse = ResourceListKeys; /** Optional parameters. */ -export interface NotificationHubsGetPnsCredentialsOptionalParams +export interface NamespacesGetPnsCredentialsOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getPnsCredentials operation. */ -export type NotificationHubsGetPnsCredentialsResponse = PnsCredentialsResource; +export type NamespacesGetPnsCredentialsResponse = PnsCredentialsResource; /** Optional parameters. */ -export interface NotificationHubsListNextOptionalParams +export interface NamespacesListAllNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllNext operation. */ +export type NamespacesListAllNextResponse = NamespaceListResult; + +/** Optional parameters. */ +export interface NamespacesListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type NotificationHubsListNextResponse = NotificationHubListResult; +export type NamespacesListNextResponse = NamespaceListResult; /** Optional parameters. */ -export interface NotificationHubsListAuthorizationRulesNextOptionalParams +export interface NamespacesListAuthorizationRulesNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAuthorizationRulesNext operation. */ -export type NotificationHubsListAuthorizationRulesNextResponse = SharedAccessAuthorizationRuleListResult; +export type NamespacesListAuthorizationRulesNextResponse = + SharedAccessAuthorizationRuleListResult; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type PrivateEndpointConnectionsUpdateResponse = + PrivateEndpointConnectionResource; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type PrivateEndpointConnectionsDeleteResponse = + PrivateEndpointConnectionsDeleteHeaders; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = + PrivateEndpointConnectionResource; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateEndpointConnectionsListResponse = + PrivateEndpointConnectionResourceListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetGroupIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getGroupId operation. */ +export type PrivateEndpointConnectionsGetGroupIdResponse = PrivateLinkResource; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListGroupIdsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listGroupIds operation. */ +export type PrivateEndpointConnectionsListGroupIdsResponse = + PrivateLinkResourceListResult; /** Optional parameters. */ export interface NotificationHubsManagementClientOptionalParams diff --git a/sdk/notificationhubs/arm-notificationhubs/src/models/mappers.ts b/sdk/notificationhubs/arm-notificationhubs/src/models/mappers.ts index e7d7182bc3f1..3b293ac6d11c 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/models/mappers.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/models/mappers.ts @@ -8,109 +8,6 @@ import * as coreClient from "@azure/core-client"; -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - } - } - } -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - readOnly: true, - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - } - } - } -}; - export const CheckAvailabilityParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -120,51 +17,54 @@ export const CheckAvailabilityParameters: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { + constraints: { + MinLength: 1, + }, serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, + }, + isAvailiable: { + serializedName: "isAvailiable", + type: { + name: "Boolean", + }, }, sku: { serializedName: "sku", type: { name: "Composite", - className: "Sku" - } + className: "Sku", + }, }, - isAvailiable: { - serializedName: "isAvailiable", - type: { - name: "Boolean" - } - } - } - } + }, + }, }; export const Sku: coreClient.CompositeMapper = { @@ -176,35 +76,35 @@ export const Sku: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, tier: { serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, size: { serializedName: "size", type: { - name: "String" - } + name: "String", + }, }, family: { serializedName: "family", type: { - name: "String" - } + name: "String", + }, }, capacity: { serializedName: "capacity", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -216,270 +116,250 @@ 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" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - sku: { - serializedName: "sku", + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "Sku" - } - } - } - } + className: "SystemData", + }, + }, + }, + }, }; -export const NamespacePatchParameters: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NamespacePatchParameters", + className: "SystemData", modelProperties: { - tags: { - serializedName: "tags", + createdBy: { + serializedName: "createdBy", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - sku: { - serializedName: "sku", + createdByType: { + serializedName: "createdByType", type: { - name: "Composite", - className: "Sku" - } - } - } - } + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, }; -export const SharedAccessAuthorizationRuleCreateOrUpdateParameters: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SharedAccessAuthorizationRuleCreateOrUpdateParameters", + className: "ErrorResponse", modelProperties: { - properties: { - serializedName: "properties", + error: { + serializedName: "error", type: { name: "Composite", - className: "SharedAccessAuthorizationRuleProperties" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; -export const SharedAccessAuthorizationRuleProperties: coreClient.CompositeMapper = { +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SharedAccessAuthorizationRuleProperties", + className: "ErrorDetail", modelProperties: { - rights: { - serializedName: "rights", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["Manage", "Send", "Listen"] - } - } - } - }, - primaryKey: { - serializedName: "primaryKey", - readOnly: true, - type: { - name: "String" - } - }, - secondaryKey: { - serializedName: "secondaryKey", - readOnly: true, - type: { - name: "String" - } - }, - keyName: { - serializedName: "keyName", - readOnly: true, - type: { - name: "String" - } - }, - claimType: { - serializedName: "claimType", - readOnly: true, - type: { - name: "String" - } - }, - claimValue: { - serializedName: "claimValue", + code: { + serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - modifiedTime: { - serializedName: "modifiedTime", + message: { + serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - createdTime: { - serializedName: "createdTime", + target: { + serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - revision: { - serializedName: "revision", + details: { + serializedName: "details", readOnly: true, - type: { - name: "Number" - } - } - } - } -}; - -export const NamespaceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NamespaceListResult", - modelProperties: { - value: { - serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "NamespaceResource" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const SharedAccessAuthorizationRuleListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedAccessAuthorizationRuleListResult", - modelProperties: { - value: { - serializedName: "value", + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "SharedAccessAuthorizationRuleResource" - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const ResourceListKeys: coreClient.CompositeMapper = { +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceListKeys", + className: "ErrorAdditionalInfo", modelProperties: { - primaryConnectionString: { - serializedName: "primaryConnectionString", - type: { - name: "String" - } - }, - secondaryConnectionString: { - serializedName: "secondaryConnectionString", - type: { - name: "String" - } - }, - primaryKey: { - serializedName: "primaryKey", + type: { + serializedName: "type", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - secondaryKey: { - serializedName: "secondaryKey", + info: { + serializedName: "info", + readOnly: true, type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "any" } }, + }, }, - keyName: { - serializedName: "keyName", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const PolicykeyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicykeyResource", - modelProperties: { - policyKey: { - serializedName: "policyKey", - type: { - name: "String" - } - } - } - } -}; +export const SharedAccessAuthorizationRuleProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SharedAccessAuthorizationRuleProperties", + modelProperties: { + rights: { + serializedName: "rights", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + primaryKey: { + serializedName: "primaryKey", + type: { + name: "String", + }, + }, + secondaryKey: { + serializedName: "secondaryKey", + type: { + name: "String", + }, + }, + keyName: { + serializedName: "keyName", + readOnly: true, + type: { + name: "String", + }, + }, + modifiedTime: { + serializedName: "modifiedTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + createdTime: { + serializedName: "createdTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + claimType: { + serializedName: "claimType", + readOnly: true, + type: { + name: "String", + }, + }, + claimValue: { + serializedName: "claimValue", + readOnly: true, + type: { + name: "String", + }, + }, + revision: { + serializedName: "revision", + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, + }; export const ApnsCredential: coreClient.CompositeMapper = { type: { @@ -489,53 +369,57 @@ export const ApnsCredential: coreClient.CompositeMapper = { apnsCertificate: { serializedName: "properties.apnsCertificate", type: { - name: "String" - } + name: "String", + }, }, certificateKey: { serializedName: "properties.certificateKey", type: { - name: "String" - } + name: "String", + }, }, endpoint: { + constraints: { + MinLength: 1, + }, serializedName: "properties.endpoint", + required: true, type: { - name: "String" - } + name: "String", + }, }, thumbprint: { serializedName: "properties.thumbprint", type: { - name: "String" - } + name: "String", + }, }, keyId: { serializedName: "properties.keyId", type: { - name: "String" - } + name: "String", + }, }, appName: { serializedName: "properties.appName", type: { - name: "String" - } + name: "String", + }, }, appId: { serializedName: "properties.appId", type: { - name: "String" - } + name: "String", + }, }, token: { serializedName: "properties.token", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const WnsCredential: coreClient.CompositeMapper = { @@ -546,23 +430,35 @@ export const WnsCredential: coreClient.CompositeMapper = { packageSid: { serializedName: "properties.packageSid", type: { - name: "String" - } + name: "String", + }, }, secretKey: { serializedName: "properties.secretKey", type: { - name: "String" - } + name: "String", + }, }, windowsLiveEndpoint: { serializedName: "properties.windowsLiveEndpoint", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + certificateKey: { + serializedName: "properties.certificateKey", + type: { + name: "String", + }, + }, + wnsCertificate: { + serializedName: "properties.wnsCertificate", + type: { + name: "String", + }, + }, + }, + }, }; export const GcmCredential: coreClient.CompositeMapper = { @@ -573,17 +469,21 @@ export const GcmCredential: coreClient.CompositeMapper = { gcmEndpoint: { serializedName: "properties.gcmEndpoint", type: { - name: "String" - } + name: "String", + }, }, googleApiKey: { + constraints: { + MinLength: 1, + }, serializedName: "properties.googleApiKey", + required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const MpnsCredential: coreClient.CompositeMapper = { @@ -592,25 +492,37 @@ export const MpnsCredential: coreClient.CompositeMapper = { className: "MpnsCredential", modelProperties: { mpnsCertificate: { + constraints: { + MinLength: 1, + }, serializedName: "properties.mpnsCertificate", + required: true, type: { - name: "String" - } + name: "String", + }, }, certificateKey: { + constraints: { + MinLength: 1, + }, serializedName: "properties.certificateKey", + required: true, type: { - name: "String" - } + name: "String", + }, }, thumbprint: { + constraints: { + MinLength: 1, + }, serializedName: "properties.thumbprint", + required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const AdmCredential: coreClient.CompositeMapper = { @@ -619,25 +531,37 @@ export const AdmCredential: coreClient.CompositeMapper = { className: "AdmCredential", modelProperties: { clientId: { + constraints: { + MinLength: 1, + }, serializedName: "properties.clientId", + required: true, type: { - name: "String" - } + name: "String", + }, }, clientSecret: { + constraints: { + MinLength: 1, + }, serializedName: "properties.clientSecret", + required: true, type: { - name: "String" - } + name: "String", + }, }, authTokenUrl: { + constraints: { + MinLength: 1, + }, serializedName: "properties.authTokenUrl", + required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const BaiduCredential: coreClient.CompositeMapper = { @@ -646,429 +570,1718 @@ export const BaiduCredential: coreClient.CompositeMapper = { className: "BaiduCredential", modelProperties: { baiduApiKey: { + constraints: { + MinLength: 1, + }, serializedName: "properties.baiduApiKey", + required: true, type: { - name: "String" - } + name: "String", + }, }, baiduEndPoint: { + constraints: { + MinLength: 1, + }, serializedName: "properties.baiduEndPoint", + required: true, type: { - name: "String" - } + name: "String", + }, }, baiduSecretKey: { + constraints: { + MinLength: 1, + }, serializedName: "properties.baiduSecretKey", + required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const NotificationHubListResult: coreClient.CompositeMapper = { +export const BrowserCredential: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NotificationHubListResult", + className: "BrowserCredential", modelProperties: { - value: { - serializedName: "value", + subject: { + constraints: { + MinLength: 1, + }, + serializedName: "properties.subject", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NotificationHubResource" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + vapidPrivateKey: { + constraints: { + MinLength: 1, + }, + serializedName: "properties.vapidPrivateKey", + required: true, + type: { + name: "String", + }, + }, + vapidPublicKey: { + constraints: { + MinLength: 1, + }, + serializedName: "properties.vapidPublicKey", + required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const SubResource: coreClient.CompositeMapper = { +export const XiaomiCredential: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SubResource", + className: "XiaomiCredential", modelProperties: { - id: { - serializedName: "id", + appSecret: { + serializedName: "properties.appSecret", + type: { + name: "String", + }, + }, + endpoint: { + serializedName: "properties.endpoint", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const CheckAvailabilityResult: coreClient.CompositeMapper = { +export const FcmV1Credential: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckAvailabilityResult", + className: "FcmV1Credential", modelProperties: { - ...Resource.type.modelProperties, - isAvailiable: { - serializedName: "isAvailiable", + clientEmail: { + constraints: { + MinLength: 1, + }, + serializedName: "properties.clientEmail", + required: true, type: { - name: "Boolean" - } - } - } - } + name: "String", + }, + }, + privateKey: { + constraints: { + MinLength: 1, + }, + serializedName: "properties.privateKey", + required: true, + type: { + name: "String", + }, + }, + projectId: { + constraints: { + MinLength: 1, + }, + serializedName: "properties.projectId", + required: true, + type: { + name: "String", + }, + }, + }, + }, }; -export const NamespaceCreateOrUpdateParameters: coreClient.CompositeMapper = { +export const NotificationHubPatchParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NamespaceCreateOrUpdateParameters", + className: "NotificationHubPatchParameters", modelProperties: { - ...Resource.type.modelProperties, - namePropertiesName: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + name: { serializedName: "properties.name", type: { - name: "String" - } + name: "String", + }, }, - provisioningState: { - serializedName: "properties.provisioningState", + registrationTtl: { + serializedName: "properties.registrationTtl", type: { - name: "String" - } + name: "String", + }, }, - region: { - serializedName: "properties.region", + authorizationRules: { + serializedName: "properties.authorizationRules", + readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SharedAccessAuthorizationRuleProperties", + }, + }, + }, }, - metricId: { - serializedName: "properties.metricId", + apnsCredential: { + serializedName: "properties.apnsCredential", + type: { + name: "Composite", + className: "ApnsCredential", + }, + }, + wnsCredential: { + serializedName: "properties.wnsCredential", + type: { + name: "Composite", + className: "WnsCredential", + }, + }, + gcmCredential: { + serializedName: "properties.gcmCredential", + type: { + name: "Composite", + className: "GcmCredential", + }, + }, + mpnsCredential: { + serializedName: "properties.mpnsCredential", + type: { + name: "Composite", + className: "MpnsCredential", + }, + }, + admCredential: { + serializedName: "properties.admCredential", + type: { + name: "Composite", + className: "AdmCredential", + }, + }, + baiduCredential: { + serializedName: "properties.baiduCredential", + type: { + name: "Composite", + className: "BaiduCredential", + }, + }, + browserCredential: { + serializedName: "properties.browserCredential", + type: { + name: "Composite", + className: "BrowserCredential", + }, + }, + xiaomiCredential: { + serializedName: "properties.xiaomiCredential", + type: { + name: "Composite", + className: "XiaomiCredential", + }, + }, + fcmV1Credential: { + serializedName: "properties.fcmV1Credential", + type: { + name: "Composite", + className: "FcmV1Credential", + }, + }, + dailyMaxActiveDevices: { + serializedName: "properties.dailyMaxActiveDevices", readOnly: true, type: { - name: "String" - } + name: "Number", + }, }, - status: { - serializedName: "properties.status", + }, + }, +}; + +export const NotificationHubListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NotificationHubListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NotificationHubResource", + }, + }, + }, }, - createdAt: { - serializedName: "properties.createdAt", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - updatedAt: { - serializedName: "properties.updatedAt", + }, + }, +}; + +export const RegistrationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegistrationResult", + modelProperties: { + applicationPlatform: { + serializedName: "applicationPlatform", + readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - serviceBusEndpoint: { - serializedName: "properties.serviceBusEndpoint", + pnsHandle: { + serializedName: "pnsHandle", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - subscriptionId: { - serializedName: "properties.subscriptionId", + registrationId: { + serializedName: "registrationId", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - scaleUnit: { - serializedName: "properties.scaleUnit", + outcome: { + serializedName: "outcome", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - enabled: { - serializedName: "properties.enabled", + }, + }, +}; + +export const SharedAccessAuthorizationRuleListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SharedAccessAuthorizationRuleListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SharedAccessAuthorizationRuleResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const ResourceListKeys: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceListKeys", + modelProperties: { + primaryConnectionString: { + serializedName: "primaryConnectionString", + readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, }, - critical: { - serializedName: "properties.critical", + secondaryConnectionString: { + serializedName: "secondaryConnectionString", + readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, }, - dataCenter: { - serializedName: "properties.dataCenter", + primaryKey: { + serializedName: "primaryKey", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - namespaceType: { - serializedName: "properties.namespaceType", + secondaryKey: { + serializedName: "secondaryKey", + readOnly: true, + type: { + name: "String", + }, + }, + keyName: { + serializedName: "keyName", + readOnly: true, type: { - name: "Enum", - allowedValues: ["Messaging", "NotificationHub"] - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const NamespaceResource: coreClient.CompositeMapper = { +export const PolicyKeyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NamespaceResource", + className: "PolicyKeyResource", modelProperties: { - ...Resource.type.modelProperties, - namePropertiesName: { - serializedName: "properties.name", + policyKey: { + serializedName: "policyKey", + required: true, type: { - name: "String" - } + name: "String", + }, }, - provisioningState: { - serializedName: "properties.provisioningState", + }, + }, +}; + +export const PnsCredentials: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PnsCredentials", + modelProperties: { + admCredential: { + serializedName: "admCredential", type: { - name: "String" - } + name: "Composite", + className: "AdmCredential", + }, }, - region: { - serializedName: "properties.region", + apnsCredential: { + serializedName: "apnsCredential", type: { - name: "String" - } + name: "Composite", + className: "ApnsCredential", + }, }, - metricId: { - serializedName: "properties.metricId", + baiduCredential: { + serializedName: "baiduCredential", + type: { + name: "Composite", + className: "BaiduCredential", + }, + }, + browserCredential: { + serializedName: "browserCredential", + type: { + name: "Composite", + className: "BrowserCredential", + }, + }, + gcmCredential: { + serializedName: "gcmCredential", + type: { + name: "Composite", + className: "GcmCredential", + }, + }, + mpnsCredential: { + serializedName: "mpnsCredential", + type: { + name: "Composite", + className: "MpnsCredential", + }, + }, + wnsCredential: { + serializedName: "wnsCredential", + type: { + name: "Composite", + className: "WnsCredential", + }, + }, + xiaomiCredential: { + serializedName: "xiaomiCredential", + type: { + name: "Composite", + className: "XiaomiCredential", + }, + }, + fcmV1Credential: { + serializedName: "fcmV1Credential", + type: { + name: "Composite", + className: "FcmV1Credential", + }, + }, + }, + }, +}; + +export const NamespaceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NamespaceProperties", + modelProperties: { + name: { + serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, + }, + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String", + }, }, status: { - serializedName: "properties.status", + serializedName: "status", + type: { + name: "String", + }, + }, + enabled: { + serializedName: "enabled", + readOnly: true, + type: { + name: "Boolean", + }, + }, + critical: { + serializedName: "critical", + readOnly: true, + type: { + name: "Boolean", + }, + }, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String", + }, + }, + region: { + serializedName: "region", + readOnly: true, + type: { + name: "String", + }, + }, + metricId: { + serializedName: "metricId", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, createdAt: { - serializedName: "properties.createdAt", + serializedName: "createdAt", + readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, updatedAt: { - serializedName: "properties.updatedAt", + serializedName: "updatedAt", + readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, - serviceBusEndpoint: { - serializedName: "properties.serviceBusEndpoint", + namespaceType: { + serializedName: "namespaceType", type: { - name: "String" - } + name: "String", + }, }, - subscriptionId: { - serializedName: "properties.subscriptionId", + replicationRegion: { + serializedName: "replicationRegion", type: { - name: "String" - } + name: "String", + }, }, - scaleUnit: { - serializedName: "properties.scaleUnit", + zoneRedundancy: { + defaultValue: "Disabled", + serializedName: "zoneRedundancy", type: { - name: "String" - } + name: "String", + }, }, - enabled: { - serializedName: "properties.enabled", + networkAcls: { + serializedName: "networkAcls", type: { - name: "Boolean" - } + name: "Composite", + className: "NetworkAcls", + }, }, - critical: { - serializedName: "properties.critical", + pnsCredentials: { + serializedName: "pnsCredentials", + type: { + name: "Composite", + className: "PnsCredentials", + }, + }, + serviceBusEndpoint: { + serializedName: "serviceBusEndpoint", + readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnectionResource", + }, + }, + }, + }, + scaleUnit: { + serializedName: "scaleUnit", + type: { + name: "String", + }, }, dataCenter: { - serializedName: "properties.dataCenter", + serializedName: "dataCenter", + type: { + name: "String", + }, + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "publicNetworkAccess", type: { - name: "String" - } + name: "String", + }, + }, + }, + }, +}; + +export const NetworkAcls: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkAcls", + modelProperties: { + ipRules: { + serializedName: "ipRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpRule", + }, + }, + }, + }, + publicNetworkRule: { + serializedName: "publicNetworkRule", + type: { + name: "Composite", + className: "PublicInternetAuthorizationRule", + }, + }, + }, + }, +}; + +export const IpRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IpRule", + modelProperties: { + ipMask: { + constraints: { + MinLength: 1, + }, + serializedName: "ipMask", + required: true, + type: { + name: "String", + }, + }, + rights: { + serializedName: "rights", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const PublicInternetAuthorizationRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PublicInternetAuthorizationRule", + modelProperties: { + rights: { + serializedName: "rights", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String", + }, + }, + privateEndpoint: { + serializedName: "privateEndpoint", + type: { + name: "Composite", + className: "RemotePrivateEndpointConnection", + }, + }, + groupIds: { + serializedName: "groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + privateLinkServiceConnectionState: { + serializedName: "privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "RemotePrivateLinkServiceConnectionState", + }, + }, + }, + }, +}; + +export const RemotePrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemotePrivateEndpointConnection", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RemotePrivateLinkServiceConnectionState: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RemotePrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + actionsRequired: { + serializedName: "actionsRequired", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const NamespacePatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NamespacePatchParameters", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "NamespaceProperties", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const NamespaceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NamespaceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NamespaceResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "OperationProperties", + }, + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String", + }, + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationProperties", + modelProperties: { + serviceSpecification: { + serializedName: "serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification", + }, + }, + }, + }, +}; + +export const ServiceSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + logSpecifications: { + serializedName: "logSpecifications", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogSpecification", + }, + }, + }, + }, + metricSpecifications: { + serializedName: "metricSpecifications", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification", + }, + }, + }, + }, + }, + }, +}; + +export const LogSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogSpecification", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + blobDuration: { + serializedName: "blobDuration", + readOnly: true, + type: { + name: "String", + }, + }, + categoryGroups: { + serializedName: "categoryGroups", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const MetricSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricSpecification", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + displayDescription: { + serializedName: "displayDescription", + readOnly: true, + type: { + name: "String", + }, + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String", + }, + }, + aggregationType: { + serializedName: "aggregationType", + readOnly: true, + type: { + name: "String", + }, + }, + availabilities: { + serializedName: "availabilities", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Availability", + }, + }, + }, + }, + supportedTimeGrainTypes: { + serializedName: "supportedTimeGrainTypes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + metricFilterPattern: { + serializedName: "metricFilterPattern", + readOnly: true, + type: { + name: "String", + }, + }, + fillGapWithZero: { + serializedName: "fillGapWithZero", + readOnly: true, + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const Availability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Availability", + modelProperties: { + timeGrain: { + serializedName: "timeGrain", + readOnly: true, + type: { + name: "String", + }, + }, + blobDuration: { + serializedName: "blobDuration", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnectionResourceListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PrivateEndpointConnectionResourceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnectionResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceProperties", + modelProperties: { + groupId: { + serializedName: "groupId", + readOnly: true, + type: { + name: "String", + }, + }, + requiredMembers: { + serializedName: "requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + requiredZoneNames: { + serializedName: "requiredZoneNames", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ConnectionDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionDetails", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + privateIpAddress: { + serializedName: "privateIpAddress", + readOnly: true, + type: { + name: "String", + }, + }, + linkIdentifier: { + serializedName: "linkIdentifier", + readOnly: true, + type: { + name: "String", + }, + }, + groupId: { + serializedName: "groupId", + readOnly: true, + type: { + name: "String", + }, + }, + memberName: { + serializedName: "memberName", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const GroupConnectivityInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GroupConnectivityInformation", + modelProperties: { + groupId: { + serializedName: "groupId", + readOnly: true, + type: { + name: "String", + }, + }, + memberName: { + serializedName: "memberName", + readOnly: true, + type: { + name: "String", + }, + }, + customerVisibleFqdns: { + serializedName: "customerVisibleFqdns", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + internalFqdn: { + serializedName: "internalFqdn", + readOnly: true, + type: { + name: "String", + }, + }, + redirectMapId: { + serializedName: "redirectMapId", + readOnly: true, + type: { + name: "String", + }, + }, + privateLinkServiceArmRegion: { + serializedName: "privateLinkServiceArmRegion", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateLinkServiceConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnection", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + groupIds: { + serializedName: "groupIds", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + requestMessage: { + serializedName: "requestMessage", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - namespaceType: { - serializedName: "properties.namespaceType", + location: { + serializedName: "location", + required: true, type: { - name: "Enum", - allowedValues: ["Messaging", "NotificationHub"] - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const SharedAccessAuthorizationRuleResource: coreClient.CompositeMapper = { +export const CheckAvailabilityResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SharedAccessAuthorizationRuleResource", + className: "CheckAvailabilityResult", modelProperties: { - ...Resource.type.modelProperties, - rights: { - serializedName: "properties.rights", + ...ProxyResource.type.modelProperties, + isAvailiable: { + serializedName: "isAvailiable", type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["Manage", "Send", "Listen"] - } - } - } + name: "Boolean", + }, }, - primaryKey: { - serializedName: "properties.primaryKey", - readOnly: true, + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - secondaryKey: { - serializedName: "properties.secondaryKey", - readOnly: true, + tags: { + serializedName: "tags", type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - keyName: { - serializedName: "properties.keyName", - readOnly: true, + sku: { + serializedName: "sku", type: { - name: "String" - } + name: "Composite", + className: "Sku", + }, }, - claimType: { - serializedName: "properties.claimType", - readOnly: true, + }, + }, +}; + +export const DebugSendResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DebugSendResponse", + modelProperties: { + ...ProxyResource.type.modelProperties, + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - claimValue: { - serializedName: "properties.claimValue", - readOnly: true, + tags: { + serializedName: "tags", type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - modifiedTime: { - serializedName: "properties.modifiedTime", + success: { + serializedName: "properties.success", readOnly: true, type: { - name: "String" - } + name: "Number", + }, }, - createdTime: { - serializedName: "properties.createdTime", + failure: { + serializedName: "properties.failure", readOnly: true, type: { - name: "String" - } + name: "Number", + }, }, - revision: { - serializedName: "properties.revision", + results: { + serializedName: "properties.results", readOnly: true, type: { - name: "Number" - } - } - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RegistrationResult", + }, + }, + }, + }, + }, + }, }; -export const NotificationHubCreateOrUpdateParameters: coreClient.CompositeMapper = { +export const SharedAccessAuthorizationRuleResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SharedAccessAuthorizationRuleResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + rights: { + serializedName: "properties.rights", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + primaryKey: { + serializedName: "properties.primaryKey", + type: { + name: "String", + }, + }, + secondaryKey: { + serializedName: "properties.secondaryKey", + type: { + name: "String", + }, + }, + keyName: { + serializedName: "properties.keyName", + readOnly: true, + type: { + name: "String", + }, + }, + modifiedTime: { + serializedName: "properties.modifiedTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + createdTime: { + serializedName: "properties.createdTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + claimType: { + serializedName: "properties.claimType", + readOnly: true, + type: { + name: "String", + }, + }, + claimValue: { + serializedName: "properties.claimValue", + readOnly: true, + type: { + name: "String", + }, + }, + revision: { + serializedName: "properties.revision", + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const PnsCredentialsResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NotificationHubCreateOrUpdateParameters", + className: "PnsCredentialsResource", modelProperties: { - ...Resource.type.modelProperties, - namePropertiesName: { - serializedName: "properties.name", + ...ProxyResource.type.modelProperties, + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - registrationTtl: { - serializedName: "properties.registrationTtl", + tags: { + serializedName: "tags", type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - authorizationRules: { - serializedName: "properties.authorizationRules", + admCredential: { + serializedName: "properties.admCredential", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedAccessAuthorizationRuleProperties" - } - } - } + name: "Composite", + className: "AdmCredential", + }, }, apnsCredential: { serializedName: "properties.apnsCredential", type: { name: "Composite", - className: "ApnsCredential" - } + className: "ApnsCredential", + }, }, - wnsCredential: { - serializedName: "properties.wnsCredential", + baiduCredential: { + serializedName: "properties.baiduCredential", type: { name: "Composite", - className: "WnsCredential" - } + className: "BaiduCredential", + }, + }, + browserCredential: { + serializedName: "properties.browserCredential", + type: { + name: "Composite", + className: "BrowserCredential", + }, }, gcmCredential: { serializedName: "properties.gcmCredential", type: { name: "Composite", - className: "GcmCredential" - } + className: "GcmCredential", + }, }, mpnsCredential: { serializedName: "properties.mpnsCredential", type: { name: "Composite", - className: "MpnsCredential" - } + className: "MpnsCredential", + }, }, - admCredential: { - serializedName: "properties.admCredential", + wnsCredential: { + serializedName: "properties.wnsCredential", type: { name: "Composite", - className: "AdmCredential" - } + className: "WnsCredential", + }, }, - baiduCredential: { - serializedName: "properties.baiduCredential", + xiaomiCredential: { + serializedName: "properties.xiaomiCredential", + type: { + name: "Composite", + className: "XiaomiCredential", + }, + }, + fcmV1Credential: { + serializedName: "properties.fcmV1Credential", + type: { + name: "Composite", + className: "FcmV1Credential", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnectionResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties", + }, + }, + }, + }, +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", type: { name: "Composite", - className: "BaiduCredential" - } - } - } - } + className: "PrivateLinkResourceProperties", + }, + }, + }, + }, }; export const NotificationHubResource: coreClient.CompositeMapper = { @@ -1076,230 +2289,282 @@ export const NotificationHubResource: coreClient.CompositeMapper = { name: "Composite", className: "NotificationHubResource", modelProperties: { - ...Resource.type.modelProperties, + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, namePropertiesName: { serializedName: "properties.name", type: { - name: "String" - } + name: "String", + }, }, registrationTtl: { serializedName: "properties.registrationTtl", type: { - name: "String" - } + name: "String", + }, }, authorizationRules: { serializedName: "properties.authorizationRules", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "SharedAccessAuthorizationRuleProperties" - } - } - } + className: "SharedAccessAuthorizationRuleProperties", + }, + }, + }, }, apnsCredential: { serializedName: "properties.apnsCredential", type: { name: "Composite", - className: "ApnsCredential" - } + className: "ApnsCredential", + }, }, wnsCredential: { serializedName: "properties.wnsCredential", type: { name: "Composite", - className: "WnsCredential" - } + className: "WnsCredential", + }, }, gcmCredential: { serializedName: "properties.gcmCredential", type: { name: "Composite", - className: "GcmCredential" - } + className: "GcmCredential", + }, }, mpnsCredential: { serializedName: "properties.mpnsCredential", type: { name: "Composite", - className: "MpnsCredential" - } + className: "MpnsCredential", + }, }, admCredential: { serializedName: "properties.admCredential", type: { name: "Composite", - className: "AdmCredential" - } + className: "AdmCredential", + }, }, baiduCredential: { serializedName: "properties.baiduCredential", type: { name: "Composite", - className: "BaiduCredential" - } - } - } - } + className: "BaiduCredential", + }, + }, + browserCredential: { + serializedName: "properties.browserCredential", + type: { + name: "Composite", + className: "BrowserCredential", + }, + }, + xiaomiCredential: { + serializedName: "properties.xiaomiCredential", + type: { + name: "Composite", + className: "XiaomiCredential", + }, + }, + fcmV1Credential: { + serializedName: "properties.fcmV1Credential", + type: { + name: "Composite", + className: "FcmV1Credential", + }, + }, + dailyMaxActiveDevices: { + serializedName: "properties.dailyMaxActiveDevices", + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, }; -export const NotificationHubPatchParameters: coreClient.CompositeMapper = { +export const NamespaceResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NotificationHubPatchParameters", + className: "NamespaceResource", modelProperties: { - ...Resource.type.modelProperties, + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, namePropertiesName: { serializedName: "properties.name", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - registrationTtl: { - serializedName: "properties.registrationTtl", + provisioningState: { + serializedName: "properties.provisioningState", type: { - name: "String" - } + name: "String", + }, }, - authorizationRules: { - serializedName: "properties.authorizationRules", + status: { + serializedName: "properties.status", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedAccessAuthorizationRuleProperties" - } - } - } + name: "String", + }, }, - apnsCredential: { - serializedName: "properties.apnsCredential", + enabled: { + serializedName: "properties.enabled", + readOnly: true, type: { - name: "Composite", - className: "ApnsCredential" - } + name: "Boolean", + }, }, - wnsCredential: { - serializedName: "properties.wnsCredential", + critical: { + serializedName: "properties.critical", + readOnly: true, type: { - name: "Composite", - className: "WnsCredential" - } + name: "Boolean", + }, }, - gcmCredential: { - serializedName: "properties.gcmCredential", + subscriptionId: { + serializedName: "properties.subscriptionId", + readOnly: true, type: { - name: "Composite", - className: "GcmCredential" - } + name: "String", + }, }, - mpnsCredential: { - serializedName: "properties.mpnsCredential", + region: { + serializedName: "properties.region", + readOnly: true, type: { - name: "Composite", - className: "MpnsCredential" - } + name: "String", + }, }, - admCredential: { - serializedName: "properties.admCredential", + metricId: { + serializedName: "properties.metricId", + readOnly: true, type: { - name: "Composite", - className: "AdmCredential" - } + name: "String", + }, }, - baiduCredential: { - serializedName: "properties.baiduCredential", + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, type: { - name: "Composite", - className: "BaiduCredential" - } - } - } - } -}; - -export const DebugSendResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DebugSendResponse", - modelProperties: { - ...Resource.type.modelProperties, - success: { - serializedName: "properties.success", + name: "DateTime", + }, + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, type: { - name: "Number" - } + name: "DateTime", + }, }, - failure: { - serializedName: "properties.failure", + namespaceType: { + serializedName: "properties.namespaceType", type: { - name: "Number" - } + name: "String", + }, }, - results: { - serializedName: "properties.results", + replicationRegion: { + serializedName: "properties.replicationRegion", type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - -export const PnsCredentialsResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PnsCredentialsResource", - modelProperties: { - ...Resource.type.modelProperties, - apnsCredential: { - serializedName: "properties.apnsCredential", + name: "String", + }, + }, + zoneRedundancy: { + defaultValue: "Disabled", + serializedName: "properties.zoneRedundancy", type: { - name: "Composite", - className: "ApnsCredential" - } + name: "String", + }, }, - wnsCredential: { - serializedName: "properties.wnsCredential", + networkAcls: { + serializedName: "properties.networkAcls", type: { name: "Composite", - className: "WnsCredential" - } + className: "NetworkAcls", + }, }, - gcmCredential: { - serializedName: "properties.gcmCredential", + pnsCredentials: { + serializedName: "properties.pnsCredentials", type: { name: "Composite", - className: "GcmCredential" - } + className: "PnsCredentials", + }, }, - mpnsCredential: { - serializedName: "properties.mpnsCredential", + serviceBusEndpoint: { + serializedName: "properties.serviceBusEndpoint", + readOnly: true, type: { - name: "Composite", - className: "MpnsCredential" - } + name: "String", + }, }, - admCredential: { - serializedName: "properties.admCredential", + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, type: { - name: "Composite", - className: "AdmCredential" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnectionResource", + }, + }, + }, }, - baiduCredential: { - serializedName: "properties.baiduCredential", + scaleUnit: { + serializedName: "properties.scaleUnit", type: { - name: "Composite", - className: "BaiduCredential" - } - } - } - } + name: "String", + }, + }, + dataCenter: { + serializedName: "properties.dataCenter", + type: { + name: "String", + }, + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccess", + type: { + name: "String", + }, + }, + }, + }, }; + +export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PrivateEndpointConnectionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; diff --git a/sdk/notificationhubs/arm-notificationhubs/src/models/parameters.ts b/sdk/notificationhubs/arm-notificationhubs/src/models/parameters.ts index 060b7bcfcd59..aaea0d37128d 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/models/parameters.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/models/parameters.ts @@ -9,18 +9,36 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { CheckAvailabilityParameters as CheckAvailabilityParametersMapper, - NamespaceCreateOrUpdateParameters as NamespaceCreateOrUpdateParametersMapper, + NotificationHubResource as NotificationHubResourceMapper, + NotificationHubPatchParameters as NotificationHubPatchParametersMapper, + SharedAccessAuthorizationRuleResource as SharedAccessAuthorizationRuleResourceMapper, + PolicyKeyResource as PolicyKeyResourceMapper, + NamespaceResource as NamespaceResourceMapper, NamespacePatchParameters as NamespacePatchParametersMapper, - SharedAccessAuthorizationRuleCreateOrUpdateParameters as SharedAccessAuthorizationRuleCreateOrUpdateParametersMapper, - PolicykeyResource as PolicykeyResourceMapper, - NotificationHubCreateOrUpdateParameters as NotificationHubCreateOrUpdateParametersMapper, - NotificationHubPatchParameters as NotificationHubPatchParametersMapper + PrivateEndpointConnectionResource as PrivateEndpointConnectionResourceMapper, } from "../models/mappers"; +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: CheckAvailabilityParametersMapper, +}; + export const accept: OperationParameter = { parameterPath: "accept", mapper: { @@ -28,9 +46,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -39,145 +57,192 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - defaultValue: "2017-04-01", - isConstant: true, - serializedName: "api-version", + serializedName: "subscriptionId", + required: true, type: { - name: "String" - } - } + name: "Uuid", + }, + }, }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - serializedName: "nextLink", + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true }; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], +export const namespaceName: OperationURLParameter = { + parameterPath: "namespaceName", mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-]*$"), + MaxLength: 50, + MinLength: 1, + }, + serializedName: "namespaceName", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: CheckAvailabilityParametersMapper +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2023-10-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", + }, + }, }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const notificationHubName: OperationURLParameter = { + parameterPath: "notificationHubName", mapper: { - serializedName: "subscriptionId", + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-./_]*$"), + MaxLength: 265, + MinLength: 1, + }, + serializedName: "notificationHubName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters1: OperationParameter = { parameterPath: "parameters", - mapper: NamespaceCreateOrUpdateParametersMapper + mapper: NotificationHubResourceMapper, }; -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - serializedName: "resourceGroupName", - required: true, - type: { - name: "String" - } - } +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: NotificationHubPatchParametersMapper, }; -export const namespaceName: OperationURLParameter = { - parameterPath: "namespaceName", +export const skipToken: OperationQueryParameter = { + parameterPath: ["options", "skipToken"], mapper: { - serializedName: "namespaceName", - required: true, + serializedName: "$skipToken", type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: NamespacePatchParametersMapper +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], + mapper: { + defaultValue: 100, + serializedName: "$top", + type: { + name: "Number", + }, + }, }; export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: SharedAccessAuthorizationRuleCreateOrUpdateParametersMapper + mapper: SharedAccessAuthorizationRuleResourceMapper, }; export const authorizationRuleName: OperationURLParameter = { parameterPath: "authorizationRuleName", mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9!()*-._]+$"), + MaxLength: 256, + MinLength: 1, + }, serializedName: "authorizationRuleName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters4: OperationParameter = { parameterPath: "parameters", - mapper: PolicykeyResourceMapper + mapper: PolicyKeyResourceMapper, }; -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: NotificationHubCreateOrUpdateParametersMapper -}; - -export const notificationHubName: OperationURLParameter = { - parameterPath: "notificationHubName", +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - serializedName: "notificationHubName", + serializedName: "nextLink", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, + skipEncoding: true, +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: NamespaceResourceMapper, }; export const parameters6: OperationParameter = { - parameterPath: ["options", "parameters"], - mapper: NotificationHubPatchParametersMapper + parameterPath: "parameters", + mapper: NamespacePatchParametersMapper, }; export const parameters7: OperationParameter = { - parameterPath: ["options", "parameters"], + parameterPath: "parameters", + mapper: PrivateEndpointConnectionResourceMapper, +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-]*\\.[a-fA-F0-9\\-]+$"), + MaxLength: 87, + MinLength: 1, + }, + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const subResourceName: OperationURLParameter = { + parameterPath: "subResourceName", mapper: { - serializedName: "parameters", + constraints: { + Pattern: new RegExp("^namespace$"), + }, + serializedName: "subResourceName", + required: true, type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } + name: "String", + }, + }, }; diff --git a/sdk/notificationhubs/arm-notificationhubs/src/notificationHubsManagementClient.ts b/sdk/notificationhubs/arm-notificationhubs/src/notificationHubsManagementClient.ts index dac66844e8da..cb76e156c806 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/notificationHubsManagementClient.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/notificationHubsManagementClient.ts @@ -11,37 +11,38 @@ 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, + NotificationHubsImpl, NamespacesImpl, - NotificationHubsImpl + OperationsImpl, + PrivateEndpointConnectionsImpl, } from "./operations"; import { - Operations, + NotificationHubs, Namespaces, - NotificationHubs + Operations, + PrivateEndpointConnections, } from "./operationsInterfaces"; import { NotificationHubsManagementClientOptionalParams } from "./models"; export class NotificationHubsManagementClient extends coreClient.ServiceClient { $host: string; - apiVersion: string; subscriptionId: string; + apiVersion: string; /** * Initializes a new instance of the NotificationHubsManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId Gets subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: NotificationHubsManagementClientOptionalParams + options?: NotificationHubsManagementClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -56,10 +57,10 @@ export class NotificationHubsManagementClient extends coreClient.ServiceClient { } const defaults: NotificationHubsManagementClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-notificationhubs/2.1.1`; + const packageDetails = `azsdk-js-arm-notificationhubs/3.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -69,20 +70,21 @@ export class NotificationHubsManagementClient 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 ( @@ -92,7 +94,7 @@ export class NotificationHubsManagementClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -102,9 +104,9 @@ export class NotificationHubsManagementClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -112,10 +114,11 @@ export class NotificationHubsManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2017-04-01"; - this.operations = new OperationsImpl(this); - this.namespaces = new NamespacesImpl(this); + this.apiVersion = options.apiVersion || "2023-10-01-preview"; this.notificationHubs = new NotificationHubsImpl(this); + this.namespaces = new NamespacesImpl(this); + this.operations = new OperationsImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -128,7 +131,7 @@ export class NotificationHubsManagementClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -142,12 +145,13 @@ export class NotificationHubsManagementClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } - operations: Operations; - namespaces: Namespaces; notificationHubs: NotificationHubs; + namespaces: Namespaces; + operations: Operations; + privateEndpointConnections: PrivateEndpointConnections; } diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operations/index.ts b/sdk/notificationhubs/arm-notificationhubs/src/operations/index.ts index c93887c25e39..cb17c9777d9d 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/operations/index.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/operations/index.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations"; -export * from "./namespaces"; export * from "./notificationHubs"; +export * from "./namespaces"; +export * from "./operations"; +export * from "./privateEndpointConnections"; diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operations/namespaces.ts b/sdk/notificationhubs/arm-notificationhubs/src/operations/namespaces.ts index 12e206a7da6b..9f2c3911cd2f 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/operations/namespaces.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/operations/namespaces.ts @@ -13,16 +13,20 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { NotificationHubsManagementClient } from "../notificationHubsManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { NamespaceResource, - NamespacesListNextOptionalParams, - NamespacesListOptionalParams, - NamespacesListResponse, NamespacesListAllNextOptionalParams, NamespacesListAllOptionalParams, NamespacesListAllResponse, + NamespacesListNextOptionalParams, + NamespacesListOptionalParams, + NamespacesListResponse, SharedAccessAuthorizationRuleResource, NamespacesListAuthorizationRulesNextOptionalParams, NamespacesListAuthorizationRulesOptionalParams, @@ -30,16 +34,14 @@ import { CheckAvailabilityParameters, NamespacesCheckAvailabilityOptionalParams, NamespacesCheckAvailabilityResponse, - NamespaceCreateOrUpdateParameters, + NamespacesGetOptionalParams, + NamespacesGetResponse, NamespacesCreateOrUpdateOptionalParams, NamespacesCreateOrUpdateResponse, NamespacePatchParameters, - NamespacesPatchOptionalParams, - NamespacesPatchResponse, + NamespacesUpdateOptionalParams, + NamespacesUpdateResponse, NamespacesDeleteOptionalParams, - NamespacesGetOptionalParams, - NamespacesGetResponse, - SharedAccessAuthorizationRuleCreateOrUpdateParameters, NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, NamespacesCreateOrUpdateAuthorizationRuleResponse, NamespacesDeleteAuthorizationRuleOptionalParams, @@ -47,12 +49,14 @@ import { NamespacesGetAuthorizationRuleResponse, NamespacesListKeysOptionalParams, NamespacesListKeysResponse, - PolicykeyResource, + PolicyKeyResource, NamespacesRegenerateKeysOptionalParams, NamespacesRegenerateKeysResponse, - NamespacesListNextResponse, + NamespacesGetPnsCredentialsOptionalParams, + NamespacesGetPnsCredentialsResponse, NamespacesListAllNextResponse, - NamespacesListAuthorizationRulesNextResponse + NamespacesListNextResponse, + NamespacesListAuthorizationRulesNextResponse, } from "../models"; /// @@ -69,16 +73,13 @@ export class NamespacesImpl implements Namespaces { } /** - * Lists the available namespaces within a resourceGroup. - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the - * method lists all the namespaces within subscription + * Lists all the available namespaces within the subscription. * @param options The options parameters. */ - public list( - resourceGroupName: string, - options?: NamespacesListOptionalParams + public listAll( + options?: NamespacesListAllOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, options); + const iter = this.listAllPagingAll(options); return { next() { return iter.next(); @@ -90,31 +91,26 @@ export class NamespacesImpl implements Namespaces { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(resourceGroupName, options, settings); - } + return this.listAllPagingPage(options, settings); + }, }; } - private async *listPagingPage( - resourceGroupName: string, - options?: NamespacesListOptionalParams, - settings?: PageSettings + private async *listAllPagingPage( + options?: NamespacesListAllOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: NamespacesListResponse; + let result: NamespacesListAllResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._list(resourceGroupName, options); + result = await this._listAll(options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listNext( - resourceGroupName, - continuationToken, - options - ); + result = await this._listAllNext(continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -122,23 +118,24 @@ export class NamespacesImpl implements Namespaces { } } - private async *listPagingAll( - resourceGroupName: string, - options?: NamespacesListOptionalParams + private async *listAllPagingAll( + options?: NamespacesListAllOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, options)) { + for await (const page of this.listAllPagingPage(options)) { yield* page; } } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * Lists the available namespaces within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ - public listAll( - options?: NamespacesListAllOptionalParams + public list( + resourceGroupName: string, + options?: NamespacesListOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listAllPagingAll(options); + const iter = this.listPagingAll(resourceGroupName, options); return { next() { return iter.next(); @@ -150,26 +147,31 @@ export class NamespacesImpl implements Namespaces { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listAllPagingPage(options, settings); - } + return this.listPagingPage(resourceGroupName, options, settings); + }, }; } - private async *listAllPagingPage( - options?: NamespacesListAllOptionalParams, - settings?: PageSettings + private async *listPagingPage( + resourceGroupName: string, + options?: NamespacesListOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: NamespacesListAllResponse; + let result: NamespacesListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listAll(options); + result = await this._list(resourceGroupName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listAllNext(continuationToken, options); + result = await this._listNext( + resourceGroupName, + continuationToken, + options, + ); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -177,29 +179,30 @@ export class NamespacesImpl implements Namespaces { } } - private async *listAllPagingAll( - options?: NamespacesListAllOptionalParams + private async *listPagingAll( + resourceGroupName: string, + options?: NamespacesListOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listAllPagingPage(options)) { + for await (const page of this.listPagingPage(resourceGroupName, options)) { yield* page; } } /** * Gets the authorization rules for a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ public listAuthorizationRules( resourceGroupName: string, namespaceName: string, - options?: NamespacesListAuthorizationRulesOptionalParams + options?: NamespacesListAuthorizationRulesOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAuthorizationRulesPagingAll( resourceGroupName, namespaceName, - options + options, ); return { next() { @@ -216,9 +219,9 @@ export class NamespacesImpl implements Namespaces { resourceGroupName, namespaceName, options, - settings + settings, ); - } + }, }; } @@ -226,7 +229,7 @@ export class NamespacesImpl implements Namespaces { resourceGroupName: string, namespaceName: string, options?: NamespacesListAuthorizationRulesOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: NamespacesListAuthorizationRulesResponse; let continuationToken = settings?.continuationToken; @@ -234,7 +237,7 @@ export class NamespacesImpl implements Namespaces { result = await this._listAuthorizationRules( resourceGroupName, namespaceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -246,7 +249,7 @@ export class NamespacesImpl implements Namespaces { resourceGroupName, namespaceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -258,12 +261,12 @@ export class NamespacesImpl implements Namespaces { private async *listAuthorizationRulesPagingAll( resourceGroupName: string, namespaceName: string, - options?: NamespacesListAuthorizationRulesOptionalParams + options?: NamespacesListAuthorizationRulesOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAuthorizationRulesPagingPage( resourceGroupName, namespaceName, - options + options, )) { yield* page; } @@ -272,87 +275,70 @@ export class NamespacesImpl implements Namespaces { /** * Checks the availability of the given service namespace across all Azure subscriptions. This is * useful because the domain name is created based on the service namespace name. - * @param parameters The namespace name. + * @param parameters Request content. * @param options The options parameters. */ checkAvailability( parameters: CheckAvailabilityParameters, - options?: NamespacesCheckAvailabilityOptionalParams + options?: NamespacesCheckAvailabilityOptionalParams, ): Promise { return this.client.sendOperationRequest( { parameters, options }, - checkAvailabilityOperationSpec - ); - } - - /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. - * This operation is idempotent. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - namespaceName: string, - parameters: NamespaceCreateOrUpdateParameters, - options?: NamespacesCreateOrUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, namespaceName, parameters, options }, - createOrUpdateOperationSpec + checkAvailabilityOperationSpec, ); } /** - * Patches the existing namespace - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * Returns the given namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ - patch( + get( resourceGroupName: string, namespaceName: string, - parameters: NamespacePatchParameters, - options?: NamespacesPatchOptionalParams - ): Promise { + options?: NamespacesGetOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, namespaceName, parameters, options }, - patchOperationSpec + { resourceGroupName, namespaceName, options }, + getOperationSpec, ); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the - * namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param parameters Request content. * @param options The options parameters. */ - async beginDelete( + async beginCreateOrUpdate( resourceGroupName: string, namespaceName: string, - options?: NamespacesDeleteOptionalParams - ): Promise, void>> { + parameters: NamespaceResource, + options?: NamespacesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + NamespacesCreateOrUpdateResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + 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); @@ -361,8 +347,8 @@ export class NamespacesImpl implements Namespaces { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -370,75 +356,126 @@ export class NamespacesImpl implements Namespaces { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, namespaceName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, namespaceName, parameters, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + NamespacesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the - * namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param parameters Request content. * @param options The options parameters. */ - async beginDeleteAndWait( + async beginCreateOrUpdateAndWait( resourceGroupName: string, namespaceName: string, - options?: NamespacesDeleteOptionalParams - ): Promise { - const poller = await this.beginDelete( + parameters: NamespaceResource, + options?: NamespacesCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( resourceGroupName, namespaceName, - options + parameters, + options, ); return poller.pollUntilDone(); } /** - * Returns the description for the specified namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Patches the existing namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param parameters Request content. * @param options The options parameters. */ - get( + update( resourceGroupName: string, namespaceName: string, - options?: NamespacesGetOptionalParams - ): Promise { + parameters: NamespacePatchParameters, + options?: NamespacesUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, parameters, options }, + updateOperationSpec, + ); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the + * namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams, + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, options }, - getOperationSpec + deleteOperationSpec, + ); + } + + /** + * Lists all the available namespaces within the subscription. + * @param options The options parameters. + */ + private _listAll( + options?: NamespacesListAllOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listAllOperationSpec); + } + + /** + * Lists the available namespaces within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + options?: NamespacesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listOperationSpec, ); } /** * Creates an authorization rule for a namespace - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name + * @param parameters Request content. * @param options The options parameters. */ createOrUpdateAuthorizationRule( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters, - options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + parameters: SharedAccessAuthorizationRuleResource, + options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -446,128 +483,100 @@ export class NamespacesImpl implements Namespaces { namespaceName, authorizationRuleName, parameters, - options + options, }, - createOrUpdateAuthorizationRuleOperationSpec + createOrUpdateAuthorizationRuleOperationSpec, ); } /** * Deletes a namespace authorization rule - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ deleteAuthorizationRule( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - options?: NamespacesDeleteAuthorizationRuleOptionalParams + options?: NamespacesDeleteAuthorizationRuleOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, authorizationRuleName, options }, - deleteAuthorizationRuleOperationSpec + deleteAuthorizationRuleOperationSpec, ); } /** * Gets an authorization rule for a namespace by name. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name - * @param authorizationRuleName Authorization rule name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ getAuthorizationRule( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - options?: NamespacesGetAuthorizationRuleOptionalParams + options?: NamespacesGetAuthorizationRuleOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, authorizationRuleName, options }, - getAuthorizationRuleOperationSpec + getAuthorizationRuleOperationSpec, ); } - /** - * Lists the available namespaces within a resourceGroup. - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the - * method lists all the namespaces within subscription - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - options?: NamespacesListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listOperationSpec - ); - } - - /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * @param options The options parameters. - */ - private _listAll( - options?: NamespacesListAllOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listAllOperationSpec); - } - /** * Gets the authorization rules for a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ private _listAuthorizationRules( resourceGroupName: string, namespaceName: string, - options?: NamespacesListAuthorizationRulesOptionalParams + options?: NamespacesListAuthorizationRulesOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, options }, - listAuthorizationRulesOperationSpec + listAuthorizationRulesOperationSpec, ); } /** - * Gets the Primary and Secondary ConnectionStrings to the namespace - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified - * authorizationRule. + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ listKeys( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - options?: NamespacesListKeysOptionalParams + options?: NamespacesListKeysOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, authorizationRuleName, options }, - listKeysOperationSpec + listKeysOperationSpec, ); } /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified - * authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name + * @param parameters Request content. * @param options The options parameters. */ regenerateKeys( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - parameters: PolicykeyResource, - options?: NamespacesRegenerateKeysOptionalParams + parameters: PolicyKeyResource, + options?: NamespacesRegenerateKeysOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -575,27 +584,26 @@ export class NamespacesImpl implements Namespaces { namespaceName, authorizationRuleName, parameters, - options + options, }, - regenerateKeysOperationSpec + regenerateKeysOperationSpec, ); } /** - * ListNext - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the - * method lists all the namespaces within subscription - * @param nextLink The nextLink from the previous successful call to the List method. + * Lists the PNS credentials associated with a namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ - private _listNext( + getPnsCredentials( resourceGroupName: string, - nextLink: string, - options?: NamespacesListNextOptionalParams - ): Promise { + namespaceName: string, + options?: NamespacesGetPnsCredentialsOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listNextOperationSpec + { resourceGroupName, namespaceName, options }, + getPnsCredentialsOperationSpec, ); } @@ -606,18 +614,35 @@ export class NamespacesImpl implements Namespaces { */ private _listAllNext( nextLink: string, - options?: NamespacesListAllNextOptionalParams + options?: NamespacesListAllNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAllNextOperationSpec + listAllNextOperationSpec, + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + nextLink: string, + options?: NamespacesListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listNextOperationSpec, ); } /** * ListAuthorizationRulesNext - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method. * @param options The options parameters. */ @@ -625,11 +650,11 @@ export class NamespacesImpl implements Namespaces { resourceGroupName: string, namespaceName: string, nextLink: string, - options?: NamespacesListAuthorizationRulesNextOptionalParams + options?: NamespacesListAuthorizationRulesNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, nextLink, options }, - listAuthorizationRulesNextOperationSpec + listAuthorizationRulesNextOperationSpec, ); } } @@ -637,107 +662,176 @@ export class NamespacesImpl implements Namespaces { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const checkAvailabilityOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CheckAvailabilityResult - } + bodyMapper: Mappers.CheckAvailabilityResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NamespaceResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + ], + headerParameters: [Parameters.accept], + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.NamespaceResource + bodyMapper: Mappers.NamespaceResource, }, 201: { - bodyMapper: Mappers.NamespaceResource - } + bodyMapper: Mappers.NamespaceResource, + }, + 202: { + bodyMapper: Mappers.NamespaceResource, + }, + 204: { + bodyMapper: Mappers.NamespaceResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters1, + requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName + Parameters.namespaceName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; -const patchOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.NamespaceResource - } + bodyMapper: Mappers.NamespaceResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters2, + requestBody: Parameters.parameters6, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName + Parameters.namespaceName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", httpMethod: "DELETE", - responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName + Parameters.namespaceName, ], - serializer + headerParameters: [Parameters.accept], + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", +const listAllOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.NamespaceResource - } + bodyMapper: Mappers.NamespaceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.skipToken, + Parameters.top, + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NamespaceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.skipToken, + Parameters.top, + ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.SharedAccessAuthorizationRuleResource - } + bodyMapper: Mappers.SharedAccessAuthorizationRuleResource, + }, + 201: { + bodyMapper: Mappers.SharedAccessAuthorizationRuleResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], @@ -746,35 +840,43 @@ const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName + Parameters.authorizationRuleName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteAuthorizationRuleOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", httpMethod: "DELETE", - responses: { 200: {}, 204: {} }, + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName + Parameters.authorizationRuleName, ], - serializer + headerParameters: [Parameters.accept], + serializer, }; const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SharedAccessAuthorizationRuleResource - } + bodyMapper: Mappers.SharedAccessAuthorizationRuleResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -782,155 +884,156 @@ const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName + Parameters.authorizationRuleName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces", +const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.NamespaceListResult - } + bodyMapper: Mappers.SharedAccessAuthorizationRuleListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, + Parameters.namespaceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listAllOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.NamespaceListResult - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules", - httpMethod: "GET", +const listKeysOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.SharedAccessAuthorizationRuleListResult - } + bodyMapper: Mappers.ResourceListKeys, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName + Parameters.namespaceName, + Parameters.authorizationRuleName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listKeysOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys", +const regenerateKeysOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ResourceListKeys - } + bodyMapper: Mappers.ResourceListKeys, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName + Parameters.authorizationRuleName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, }; -const regenerateKeysOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", +const getPnsCredentialsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/pnsCredentials", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ResourceListKeys - } + bodyMapper: Mappers.PnsCredentialsResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; -const listNextOperationSpec: coreClient.OperationSpec = { +const listAllNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.NamespaceListResult - } + bodyMapper: Mappers.NamespaceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.nextLink, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listAllNextOperationSpec: coreClient.OperationSpec = { +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.NamespaceListResult - } + bodyMapper: Mappers.NamespaceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SharedAccessAuthorizationRuleListResult - } + bodyMapper: Mappers.SharedAccessAuthorizationRuleListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.nextLink, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName + Parameters.namespaceName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operations/notificationHubs.ts b/sdk/notificationhubs/arm-notificationhubs/src/operations/notificationHubs.ts index b9af2043473e..91eab820bb80 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/operations/notificationHubs.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/operations/notificationHubs.ts @@ -25,17 +25,16 @@ import { CheckAvailabilityParameters, NotificationHubsCheckNotificationHubAvailabilityOptionalParams, NotificationHubsCheckNotificationHubAvailabilityResponse, - NotificationHubCreateOrUpdateParameters, + NotificationHubsGetOptionalParams, + NotificationHubsGetResponse, NotificationHubsCreateOrUpdateOptionalParams, NotificationHubsCreateOrUpdateResponse, - NotificationHubsPatchOptionalParams, - NotificationHubsPatchResponse, + NotificationHubPatchParameters, + NotificationHubsUpdateOptionalParams, + NotificationHubsUpdateResponse, NotificationHubsDeleteOptionalParams, - NotificationHubsGetOptionalParams, - NotificationHubsGetResponse, NotificationHubsDebugSendOptionalParams, NotificationHubsDebugSendResponse, - SharedAccessAuthorizationRuleCreateOrUpdateParameters, NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams, NotificationHubsCreateOrUpdateAuthorizationRuleResponse, NotificationHubsDeleteAuthorizationRuleOptionalParams, @@ -43,13 +42,13 @@ import { NotificationHubsGetAuthorizationRuleResponse, NotificationHubsListKeysOptionalParams, NotificationHubsListKeysResponse, - PolicykeyResource, + PolicyKeyResource, NotificationHubsRegenerateKeysOptionalParams, NotificationHubsRegenerateKeysResponse, NotificationHubsGetPnsCredentialsOptionalParams, NotificationHubsGetPnsCredentialsResponse, NotificationHubsListNextResponse, - NotificationHubsListAuthorizationRulesNextResponse + NotificationHubsListAuthorizationRulesNextResponse, } from "../models"; /// @@ -67,14 +66,14 @@ export class NotificationHubsImpl implements NotificationHubs { /** * Lists the notification hubs associated with a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ public list( resourceGroupName: string, namespaceName: string, - options?: NotificationHubsListOptionalParams + options?: NotificationHubsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceGroupName, namespaceName, options); return { @@ -92,9 +91,9 @@ export class NotificationHubsImpl implements NotificationHubs { resourceGroupName, namespaceName, options, - settings + settings, ); - } + }, }; } @@ -102,7 +101,7 @@ export class NotificationHubsImpl implements NotificationHubs { resourceGroupName: string, namespaceName: string, options?: NotificationHubsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: NotificationHubsListResponse; let continuationToken = settings?.continuationToken; @@ -118,7 +117,7 @@ export class NotificationHubsImpl implements NotificationHubs { resourceGroupName, namespaceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -130,12 +129,12 @@ export class NotificationHubsImpl implements NotificationHubs { private async *listPagingAll( resourceGroupName: string, namespaceName: string, - options?: NotificationHubsListOptionalParams + options?: NotificationHubsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, namespaceName, - options + options, )) { yield* page; } @@ -143,22 +142,22 @@ export class NotificationHubsImpl implements NotificationHubs { /** * Gets the authorization rules for a NotificationHub. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ public listAuthorizationRules( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsListAuthorizationRulesOptionalParams + options?: NotificationHubsListAuthorizationRulesOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAuthorizationRulesPagingAll( resourceGroupName, namespaceName, notificationHubName, - options + options, ); return { next() { @@ -176,9 +175,9 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName, notificationHubName, options, - settings + settings, ); - } + }, }; } @@ -187,7 +186,7 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName: string, notificationHubName: string, options?: NotificationHubsListAuthorizationRulesOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: NotificationHubsListAuthorizationRulesResponse; let continuationToken = settings?.continuationToken; @@ -196,7 +195,7 @@ export class NotificationHubsImpl implements NotificationHubs { resourceGroupName, namespaceName, notificationHubName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -209,7 +208,7 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName, notificationHubName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -222,13 +221,13 @@ export class NotificationHubsImpl implements NotificationHubs { resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsListAuthorizationRulesOptionalParams + options?: NotificationHubsListAuthorizationRulesOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAuthorizationRulesPagingPage( resourceGroupName, namespaceName, notificationHubName, - options + options, )) { yield* page; } @@ -236,37 +235,56 @@ export class NotificationHubsImpl implements NotificationHubs { /** * Checks the availability of the given notificationHub in a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param parameters Request content. * @param options The options parameters. */ checkNotificationHubAvailability( resourceGroupName: string, namespaceName: string, parameters: CheckAvailabilityParameters, - options?: NotificationHubsCheckNotificationHubAvailabilityOptionalParams + options?: NotificationHubsCheckNotificationHubAvailabilityOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, parameters, options }, - checkNotificationHubAvailabilityOperationSpec + checkNotificationHubAvailabilityOperationSpec, + ); + } + + /** + * Gets the notification hub. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + notificationHubName: string, + options?: NotificationHubsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, notificationHubName, options }, + getOperationSpec, ); } /** * Creates/Update a NotificationHub in a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param parameters Request content. * @param options The options parameters. */ createOrUpdate( resourceGroupName: string, namespaceName: string, notificationHubName: string, - parameters: NotificationHubCreateOrUpdateParameters, - options?: NotificationHubsCreateOrUpdateOptionalParams + parameters: NotificationHubResource, + options?: NotificationHubsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -274,95 +292,101 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName, notificationHubName, parameters, - options + options, }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } /** * Patch a NotificationHub in a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param parameters Request content. * @param options The options parameters. */ - patch( + update( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsPatchOptionalParams - ): Promise { + parameters: NotificationHubPatchParameters, + options?: NotificationHubsUpdateOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, namespaceName, notificationHubName, options }, - patchOperationSpec + { + resourceGroupName, + namespaceName, + notificationHubName, + parameters, + options, + }, + updateOperationSpec, ); } /** * Deletes a notification hub associated with a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ delete( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsDeleteOptionalParams + options?: NotificationHubsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, notificationHubName, options }, - deleteOperationSpec + deleteOperationSpec, ); } /** * Lists the notification hubs associated with a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ - get( + private _list( resourceGroupName: string, namespaceName: string, - notificationHubName: string, - options?: NotificationHubsGetOptionalParams - ): Promise { + options?: NotificationHubsListOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, namespaceName, notificationHubName, options }, - getOperationSpec + { resourceGroupName, namespaceName, options }, + listOperationSpec, ); } /** - * test send a push notification - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Test send a push notification. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ debugSend( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsDebugSendOptionalParams + options?: NotificationHubsDebugSendOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, notificationHubName, options }, - debugSendOperationSpec + debugSendOperationSpec, ); } /** * Creates/Updates an authorization rule for a NotificationHub - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name + * @param parameters Request content. * @param options The options parameters. */ createOrUpdateAuthorizationRule( @@ -370,8 +394,8 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters, - options?: NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams + parameters: SharedAccessAuthorizationRuleResource, + options?: NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -380,18 +404,18 @@ export class NotificationHubsImpl implements NotificationHubs { notificationHubName, authorizationRuleName, parameters, - options + options, }, - createOrUpdateAuthorizationRuleOperationSpec + createOrUpdateAuthorizationRuleOperationSpec, ); } /** * Deletes a notificationHub authorization rule - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ deleteAuthorizationRule( @@ -399,7 +423,7 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - options?: NotificationHubsDeleteAuthorizationRuleOptionalParams + options?: NotificationHubsDeleteAuthorizationRuleOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -407,18 +431,18 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName, notificationHubName, authorizationRuleName, - options + options, }, - deleteAuthorizationRuleOperationSpec + deleteAuthorizationRuleOperationSpec, ); } /** * Gets an authorization rule for a NotificationHub by name. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ getAuthorizationRule( @@ -426,7 +450,7 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - options?: NotificationHubsGetAuthorizationRuleOptionalParams + options?: NotificationHubsGetAuthorizationRuleOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -434,55 +458,37 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName, notificationHubName, authorizationRuleName, - options + options, }, - getAuthorizationRuleOperationSpec - ); - } - - /** - * Lists the notification hubs associated with a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - namespaceName: string, - options?: NotificationHubsListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, namespaceName, options }, - listOperationSpec + getAuthorizationRuleOperationSpec, ); } /** * Gets the authorization rules for a NotificationHub. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ private _listAuthorizationRules( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsListAuthorizationRulesOptionalParams + options?: NotificationHubsListAuthorizationRulesOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, notificationHubName, options }, - listAuthorizationRulesOperationSpec + listAuthorizationRulesOperationSpec, ); } /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified - * authorizationRule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ listKeys( @@ -490,7 +496,7 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - options?: NotificationHubsListKeysOptionalParams + options?: NotificationHubsListKeysOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -498,20 +504,19 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName, notificationHubName, authorizationRuleName, - options + options, }, - listKeysOperationSpec + listKeysOperationSpec, ); } /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified - * authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name + * @param parameters Request content. * @param options The options parameters. */ regenerateKeys( @@ -519,8 +524,8 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - parameters: PolicykeyResource, - options?: NotificationHubsRegenerateKeysOptionalParams + parameters: PolicyKeyResource, + options?: NotificationHubsRegenerateKeysOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -529,35 +534,35 @@ export class NotificationHubsImpl implements NotificationHubs { notificationHubName, authorizationRuleName, parameters, - options + options, }, - regenerateKeysOperationSpec + regenerateKeysOperationSpec, ); } /** - * Lists the PNS Credentials associated with a notification hub . - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the PNS Credentials associated with a notification hub. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ getPnsCredentials( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsGetPnsCredentialsOptionalParams + options?: NotificationHubsGetPnsCredentialsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, notificationHubName, options }, - getPnsCredentialsOperationSpec + getPnsCredentialsOperationSpec, ); } /** * ListNext - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ @@ -565,19 +570,19 @@ export class NotificationHubsImpl implements NotificationHubs { resourceGroupName: string, namespaceName: string, nextLink: string, - options?: NotificationHubsListNextOptionalParams + options?: NotificationHubsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } /** * ListAuthorizationRulesNext - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method. * @param options The options parameters. */ @@ -586,7 +591,7 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName: string, notificationHubName: string, nextLink: string, - options?: NotificationHubsListAuthorizationRulesNextOptionalParams + options?: NotificationHubsListAuthorizationRulesNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -594,148 +599,193 @@ export class NotificationHubsImpl implements NotificationHubs { namespaceName, notificationHubName, nextLink, - options + options, }, - listAuthorizationRulesNextOperationSpec + listAuthorizationRulesNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const checkNotificationHubAvailabilityOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability", - httpMethod: "POST", +const checkNotificationHubAvailabilityOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckAvailabilityResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, + }; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CheckAvailabilityResult - } + bodyMapper: Mappers.NotificationHubResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName + Parameters.namespaceName, + Parameters.notificationHubName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.NotificationHubResource + bodyMapper: Mappers.NotificationHubResource, }, 201: { - bodyMapper: Mappers.NotificationHubResource - } + bodyMapper: Mappers.NotificationHubResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.notificationHubName + Parameters.notificationHubName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; -const patchOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.NotificationHubResource - } + bodyMapper: Mappers.NotificationHubResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters6, + requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.notificationHubName + Parameters.notificationHubName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", httpMethod: "DELETE", - responses: { 200: {} }, + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.notificationHubName + Parameters.notificationHubName, ], - serializer + headerParameters: [Parameters.accept], + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.NotificationHubResource - } + bodyMapper: Mappers.NotificationHubListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.skipToken, + Parameters.top, + ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.notificationHubName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const debugSendOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend", httpMethod: "POST", responses: { - 201: { - bodyMapper: Mappers.DebugSendResponse - } + 200: { + bodyMapper: Mappers.DebugSendResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters7, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.notificationHubName + Parameters.notificationHubName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.SharedAccessAuthorizationRuleResource - } + bodyMapper: Mappers.SharedAccessAuthorizationRuleResource, + }, + 201: { + bodyMapper: Mappers.SharedAccessAuthorizationRuleResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], @@ -744,37 +794,22 @@ const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, + Parameters.notificationHubName, Parameters.authorizationRuleName, - Parameters.notificationHubName ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteAuthorizationRuleOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}", httpMethod: "DELETE", - responses: { 200: {}, 204: {} }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.notificationHubName - ], - serializer -}; -const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", - httpMethod: "GET", responses: { - 200: { - bodyMapper: Mappers.SharedAccessAuthorizationRuleResource - } + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -782,39 +817,45 @@ const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, + Parameters.notificationHubName, Parameters.authorizationRuleName, - Parameters.notificationHubName ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs", +const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.NotificationHubListResult - } + bodyMapper: Mappers.SharedAccessAuthorizationRuleResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName + Parameters.namespaceName, + Parameters.notificationHubName, + Parameters.authorizationRuleName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SharedAccessAuthorizationRuleListResult - } + bodyMapper: Mappers.SharedAccessAuthorizationRuleListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -822,19 +863,21 @@ const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.notificationHubName + Parameters.notificationHubName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listKeysOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/listKeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ResourceListKeys - } + bodyMapper: Mappers.ResourceListKeys, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -842,20 +885,22 @@ const listKeysOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, + Parameters.notificationHubName, Parameters.authorizationRuleName, - Parameters.notificationHubName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const regenerateKeysOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ResourceListKeys - } + bodyMapper: Mappers.ResourceListKeys, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], @@ -864,21 +909,23 @@ const regenerateKeysOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, + Parameters.notificationHubName, Parameters.authorizationRuleName, - Parameters.notificationHubName ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const getPnsCredentialsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.PnsCredentialsResource - } + bodyMapper: Mappers.PnsCredentialsResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -886,47 +933,51 @@ const getPnsCredentialsOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.notificationHubName + Parameters.notificationHubName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.NotificationHubListResult - } + bodyMapper: Mappers.NotificationHubListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.nextLink, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName + Parameters.namespaceName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SharedAccessAuthorizationRuleListResult - } + bodyMapper: Mappers.SharedAccessAuthorizationRuleListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.nextLink, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.notificationHubName + Parameters.notificationHubName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operations/operations.ts b/sdk/notificationhubs/arm-notificationhubs/src/operations/operations.ts index 9e0392e17d4d..bfe8e5fa85db 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/operations/operations.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models"; /// @@ -35,11 +35,11 @@ export class OperationsImpl implements Operations { } /** - * Lists all of the available NotificationHubs REST API operations. + * Lists all available Notification Hubs 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; @@ -89,11 +89,11 @@ export class OperationsImpl implements Operations { } /** - * Lists all of the available NotificationHubs REST API operations. + * Lists all available Notification Hubs 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,30 +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, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operations/privateEndpointConnections.ts b/sdk/notificationhubs/arm-notificationhubs/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..d13682cb8c74 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/src/operations/privateEndpointConnections.ts @@ -0,0 +1,629 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NotificationHubsManagementClient } from "../notificationHubsManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + PrivateEndpointConnectionResource, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsListResponse, + PrivateLinkResource, + PrivateEndpointConnectionsListGroupIdsOptionalParams, + PrivateEndpointConnectionsListGroupIdsResponse, + PrivateEndpointConnectionsUpdateOptionalParams, + PrivateEndpointConnectionsUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsDeleteResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsGetGroupIdOptionalParams, + PrivateEndpointConnectionsGetGroupIdResponse, +} from "../models"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections +{ + private readonly client: NotificationHubsManagementClient; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: NotificationHubsManagementClient) { + this.client = client; + } + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, namespaceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + namespaceName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + _settings?: PageSettings, + ): AsyncIterableIterator { + let result: PrivateEndpointConnectionsListResponse; + result = await this._list(resourceGroupName, namespaceName, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + namespaceName, + options, + )) { + yield* page; + } + } + + /** + * Even though this namespace requires subscription id, resource group and namespace name, it returns a + * constant payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that + * received the request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param options The options parameters. + */ + public listGroupIds( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListGroupIdsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listGroupIdsPagingAll( + resourceGroupName, + namespaceName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listGroupIdsPagingPage( + resourceGroupName, + namespaceName, + options, + settings, + ); + }, + }; + } + + private async *listGroupIdsPagingPage( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListGroupIdsOptionalParams, + _settings?: PageSettings, + ): AsyncIterableIterator { + let result: PrivateEndpointConnectionsListGroupIdsResponse; + result = await this._listGroupIds( + resourceGroupName, + namespaceName, + options, + ); + yield result.value || []; + } + + private async *listGroupIdsPagingAll( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListGroupIdsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listGroupIdsPagingPage( + resourceGroupName, + namespaceName, + options, + )) { + yield* page; + } + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param parameters Description of the Private Endpoint Connection resource. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnectionResource, + options?: PrivateEndpointConnectionsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param parameters Description of the Private Endpoint Connection resource. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnectionResource, + options?: PrivateEndpointConnectionsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + options, + }, + getOperationSpec, + ); + } + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listOperationSpec, + ); + } + + /** + * Even though this namespace requires subscription id, resource group and namespace name, it returns a + * constant payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that + * received the request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is + * "namespace" + * @param options The options parameters. + */ + getGroupId( + resourceGroupName: string, + namespaceName: string, + subResourceName: string, + options?: PrivateEndpointConnectionsGetGroupIdOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, subResourceName, options }, + getGroupIdOperationSpec, + ); + } + + /** + * Even though this namespace requires subscription id, resource group and namespace name, it returns a + * constant payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that + * received the request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param options The options parameters. + */ + private _listGroupIds( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListGroupIdsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listGroupIdsOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionResource, + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnectionResource, + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnectionResource, + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnectionResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.PrivateEndpointConnectionsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.PrivateEndpointConnectionsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.PrivateEndpointConnectionsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.PrivateEndpointConnectionsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getGroupIdOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateLinkResources/{subResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.subResourceName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listGroupIdsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/index.ts b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/index.ts index c93887c25e39..cb17c9777d9d 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/index.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/index.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations"; -export * from "./namespaces"; export * from "./notificationHubs"; +export * from "./namespaces"; +export * from "./operations"; +export * from "./privateEndpointConnections"; diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/namespaces.ts b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/namespaces.ts index 9926e4166f52..40c4fcbf3308 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/namespaces.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/namespaces.ts @@ -7,26 +7,24 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { NamespaceResource, - NamespacesListOptionalParams, NamespacesListAllOptionalParams, + NamespacesListOptionalParams, SharedAccessAuthorizationRuleResource, NamespacesListAuthorizationRulesOptionalParams, CheckAvailabilityParameters, NamespacesCheckAvailabilityOptionalParams, NamespacesCheckAvailabilityResponse, - NamespaceCreateOrUpdateParameters, + NamespacesGetOptionalParams, + NamespacesGetResponse, NamespacesCreateOrUpdateOptionalParams, NamespacesCreateOrUpdateResponse, NamespacePatchParameters, - NamespacesPatchOptionalParams, - NamespacesPatchResponse, + NamespacesUpdateOptionalParams, + NamespacesUpdateResponse, NamespacesDeleteOptionalParams, - NamespacesGetOptionalParams, - NamespacesGetResponse, - SharedAccessAuthorizationRuleCreateOrUpdateParameters, NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, NamespacesCreateOrUpdateAuthorizationRuleResponse, NamespacesDeleteAuthorizationRuleOptionalParams, @@ -34,183 +32,198 @@ import { NamespacesGetAuthorizationRuleResponse, NamespacesListKeysOptionalParams, NamespacesListKeysResponse, - PolicykeyResource, + PolicyKeyResource, NamespacesRegenerateKeysOptionalParams, - NamespacesRegenerateKeysResponse + NamespacesRegenerateKeysResponse, + NamespacesGetPnsCredentialsOptionalParams, + NamespacesGetPnsCredentialsResponse, } from "../models"; /// /** Interface representing a Namespaces. */ export interface Namespaces { /** - * Lists the available namespaces within a resourceGroup. - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the - * method lists all the namespaces within subscription + * Lists all the available namespaces within the subscription. * @param options The options parameters. */ - list( - resourceGroupName: string, - options?: NamespacesListOptionalParams + listAll( + options?: NamespacesListAllOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * Lists the available namespaces within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ - listAll( - options?: NamespacesListAllOptionalParams + list( + resourceGroupName: string, + options?: NamespacesListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the authorization rules for a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ listAuthorizationRules( resourceGroupName: string, namespaceName: string, - options?: NamespacesListAuthorizationRulesOptionalParams + options?: NamespacesListAuthorizationRulesOptionalParams, ): PagedAsyncIterableIterator; /** * Checks the availability of the given service namespace across all Azure subscriptions. This is * useful because the domain name is created based on the service namespace name. - * @param parameters The namespace name. + * @param parameters Request content. * @param options The options parameters. */ checkAvailability( parameters: CheckAvailabilityParameters, - options?: NamespacesCheckAvailabilityOptionalParams + options?: NamespacesCheckAvailabilityOptionalParams, ): Promise; /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. - * This operation is idempotent. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * Returns the given namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ - createOrUpdate( + get( resourceGroupName: string, namespaceName: string, - parameters: NamespaceCreateOrUpdateParameters, - options?: NamespacesCreateOrUpdateOptionalParams - ): Promise; + options?: NamespacesGetOptionalParams, + ): Promise; /** - * Patches the existing namespace - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param parameters Request content. * @param options The options parameters. */ - patch( + beginCreateOrUpdate( resourceGroupName: string, namespaceName: string, - parameters: NamespacePatchParameters, - options?: NamespacesPatchOptionalParams - ): Promise; + parameters: NamespaceResource, + options?: NamespacesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + NamespacesCreateOrUpdateResponse + > + >; /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the - * namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param parameters Request content. * @param options The options parameters. */ - beginDelete( + beginCreateOrUpdateAndWait( resourceGroupName: string, namespaceName: string, - options?: NamespacesDeleteOptionalParams - ): Promise, void>>; + parameters: NamespaceResource, + options?: NamespacesCreateOrUpdateOptionalParams, + ): Promise; /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the - * namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Patches the existing namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param parameters Request content. * @param options The options parameters. */ - beginDeleteAndWait( + update( resourceGroupName: string, namespaceName: string, - options?: NamespacesDeleteOptionalParams - ): Promise; + parameters: NamespacePatchParameters, + options?: NamespacesUpdateOptionalParams, + ): Promise; /** - * Returns the description for the specified namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the + * namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ - get( + delete( resourceGroupName: string, namespaceName: string, - options?: NamespacesGetOptionalParams - ): Promise; + options?: NamespacesDeleteOptionalParams, + ): Promise; /** * Creates an authorization rule for a namespace - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name + * @param parameters Request content. * @param options The options parameters. */ createOrUpdateAuthorizationRule( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters, - options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + parameters: SharedAccessAuthorizationRuleResource, + options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, ): Promise; /** * Deletes a namespace authorization rule - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ deleteAuthorizationRule( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - options?: NamespacesDeleteAuthorizationRuleOptionalParams + options?: NamespacesDeleteAuthorizationRuleOptionalParams, ): Promise; /** * Gets an authorization rule for a namespace by name. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name - * @param authorizationRuleName Authorization rule name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ getAuthorizationRule( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - options?: NamespacesGetAuthorizationRuleOptionalParams + options?: NamespacesGetAuthorizationRuleOptionalParams, ): Promise; /** - * Gets the Primary and Secondary ConnectionStrings to the namespace - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified - * authorizationRule. + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ listKeys( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - options?: NamespacesListKeysOptionalParams + options?: NamespacesListKeysOptionalParams, ): Promise; /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified - * authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param authorizationRuleName Authorization Rule Name + * @param parameters Request content. * @param options The options parameters. */ regenerateKeys( resourceGroupName: string, namespaceName: string, authorizationRuleName: string, - parameters: PolicykeyResource, - options?: NamespacesRegenerateKeysOptionalParams + parameters: PolicyKeyResource, + options?: NamespacesRegenerateKeysOptionalParams, ): Promise; + /** + * Lists the PNS credentials associated with a namespace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param options The options parameters. + */ + getPnsCredentials( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesGetPnsCredentialsOptionalParams, + ): Promise; } diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/notificationHubs.ts b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/notificationHubs.ts index 3864c4303140..2bfb7fca6bff 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/notificationHubs.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/notificationHubs.ts @@ -15,17 +15,16 @@ import { CheckAvailabilityParameters, NotificationHubsCheckNotificationHubAvailabilityOptionalParams, NotificationHubsCheckNotificationHubAvailabilityResponse, - NotificationHubCreateOrUpdateParameters, + NotificationHubsGetOptionalParams, + NotificationHubsGetResponse, NotificationHubsCreateOrUpdateOptionalParams, NotificationHubsCreateOrUpdateResponse, - NotificationHubsPatchOptionalParams, - NotificationHubsPatchResponse, + NotificationHubPatchParameters, + NotificationHubsUpdateOptionalParams, + NotificationHubsUpdateResponse, NotificationHubsDeleteOptionalParams, - NotificationHubsGetOptionalParams, - NotificationHubsGetResponse, NotificationHubsDebugSendOptionalParams, NotificationHubsDebugSendResponse, - SharedAccessAuthorizationRuleCreateOrUpdateParameters, NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams, NotificationHubsCreateOrUpdateAuthorizationRuleResponse, NotificationHubsDeleteAuthorizationRuleOptionalParams, @@ -33,11 +32,11 @@ import { NotificationHubsGetAuthorizationRuleResponse, NotificationHubsListKeysOptionalParams, NotificationHubsListKeysResponse, - PolicykeyResource, + PolicyKeyResource, NotificationHubsRegenerateKeysOptionalParams, NotificationHubsRegenerateKeysResponse, NotificationHubsGetPnsCredentialsOptionalParams, - NotificationHubsGetPnsCredentialsResponse + NotificationHubsGetPnsCredentialsResponse, } from "../models"; /// @@ -45,115 +44,117 @@ import { export interface NotificationHubs { /** * Lists the notification hubs associated with a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name * @param options The options parameters. */ list( resourceGroupName: string, namespaceName: string, - options?: NotificationHubsListOptionalParams + options?: NotificationHubsListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the authorization rules for a NotificationHub. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ listAuthorizationRules( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsListAuthorizationRulesOptionalParams + options?: NotificationHubsListAuthorizationRulesOptionalParams, ): PagedAsyncIterableIterator; /** * Checks the availability of the given notificationHub in a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param parameters Request content. * @param options The options parameters. */ checkNotificationHubAvailability( resourceGroupName: string, namespaceName: string, parameters: CheckAvailabilityParameters, - options?: NotificationHubsCheckNotificationHubAvailabilityOptionalParams + options?: NotificationHubsCheckNotificationHubAvailabilityOptionalParams, ): Promise; + /** + * Gets the notification hub. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + notificationHubName: string, + options?: NotificationHubsGetOptionalParams, + ): Promise; /** * Creates/Update a NotificationHub in a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param parameters Request content. * @param options The options parameters. */ createOrUpdate( resourceGroupName: string, namespaceName: string, notificationHubName: string, - parameters: NotificationHubCreateOrUpdateParameters, - options?: NotificationHubsCreateOrUpdateOptionalParams + parameters: NotificationHubResource, + options?: NotificationHubsCreateOrUpdateOptionalParams, ): Promise; /** * Patch a NotificationHub in a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param parameters Request content. * @param options The options parameters. */ - patch( + update( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsPatchOptionalParams - ): Promise; + parameters: NotificationHubPatchParameters, + options?: NotificationHubsUpdateOptionalParams, + ): Promise; /** * Deletes a notification hub associated with a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ delete( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsDeleteOptionalParams + options?: NotificationHubsDeleteOptionalParams, ): Promise; /** - * Lists the notification hubs associated with a namespace. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - namespaceName: string, - notificationHubName: string, - options?: NotificationHubsGetOptionalParams - ): Promise; - /** - * test send a push notification - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Test send a push notification. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ debugSend( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsDebugSendOptionalParams + options?: NotificationHubsDebugSendOptionalParams, ): Promise; /** * Creates/Updates an authorization rule for a NotificationHub - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name + * @param parameters Request content. * @param options The options parameters. */ createOrUpdateAuthorizationRule( @@ -161,15 +162,15 @@ export interface NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - parameters: SharedAccessAuthorizationRuleCreateOrUpdateParameters, - options?: NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams + parameters: SharedAccessAuthorizationRuleResource, + options?: NotificationHubsCreateOrUpdateAuthorizationRuleOptionalParams, ): Promise; /** * Deletes a notificationHub authorization rule - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ deleteAuthorizationRule( @@ -177,14 +178,14 @@ export interface NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - options?: NotificationHubsDeleteAuthorizationRuleOptionalParams + options?: NotificationHubsDeleteAuthorizationRuleOptionalParams, ): Promise; /** * Gets an authorization rule for a NotificationHub by name. - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ getAuthorizationRule( @@ -192,15 +193,14 @@ export interface NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - options?: NotificationHubsGetAuthorizationRuleOptionalParams + options?: NotificationHubsGetAuthorizationRuleOptionalParams, ): Promise; /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified - * authorizationRule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name * @param options The options parameters. */ listKeys( @@ -208,16 +208,15 @@ export interface NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - options?: NotificationHubsListKeysOptionalParams + options?: NotificationHubsListKeysOptionalParams, ): Promise; /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified - * authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name + * @param authorizationRuleName Authorization Rule Name + * @param parameters Request content. * @param options The options parameters. */ regenerateKeys( @@ -225,20 +224,20 @@ export interface NotificationHubs { namespaceName: string, notificationHubName: string, authorizationRuleName: string, - parameters: PolicykeyResource, - options?: NotificationHubsRegenerateKeysOptionalParams + parameters: PolicyKeyResource, + options?: NotificationHubsRegenerateKeysOptionalParams, ): Promise; /** - * Lists the PNS Credentials associated with a notification hub . - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the PNS Credentials associated with a notification hub. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param notificationHubName Notification Hub name * @param options The options parameters. */ getPnsCredentials( resourceGroupName: string, namespaceName: string, notificationHubName: string, - options?: NotificationHubsGetPnsCredentialsOptionalParams + options?: NotificationHubsGetPnsCredentialsOptionalParams, ): Promise; } diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/operations.ts b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/operations.ts index fd9cb1c618ca..05f96558ebbd 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/operations.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/operations.ts @@ -13,10 +13,10 @@ import { Operation, OperationsListOptionalParams } from "../models"; /** Interface representing a Operations. */ export interface Operations { /** - * Lists all of the available NotificationHubs REST API operations. + * Lists all available Notification Hubs operations. * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..393d2dfdc992 --- /dev/null +++ b/sdk/notificationhubs/arm-notificationhubs/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,156 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnectionResource, + PrivateEndpointConnectionsListOptionalParams, + PrivateLinkResource, + PrivateEndpointConnectionsListGroupIdsOptionalParams, + PrivateEndpointConnectionsUpdateOptionalParams, + PrivateEndpointConnectionsUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsDeleteResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsGetGroupIdOptionalParams, + PrivateEndpointConnectionsGetGroupIdResponse, +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Even though this namespace requires subscription id, resource group and namespace name, it returns a + * constant payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that + * received the request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param options The options parameters. + */ + listGroupIds( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListGroupIdsOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param parameters Description of the Private Endpoint Connection resource. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnectionResource, + options?: PrivateEndpointConnectionsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionsUpdateResponse + > + >; + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param parameters Description of the Private Endpoint Connection resource. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnectionResource, + options?: PrivateEndpointConnectionsUpdateOptionalParams, + ): Promise; + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionsDeleteResponse + > + >; + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ): Promise; + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param privateEndpointConnectionName Private Endpoint Connection Name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ): Promise; + /** + * Even though this namespace requires subscription id, resource group and namespace name, it returns a + * constant payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that + * received the request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is + * "namespace" + * @param options The options parameters. + */ + getGroupId( + resourceGroupName: string, + namespaceName: string, + subResourceName: string, + options?: PrivateEndpointConnectionsGetGroupIdOptionalParams, + ): Promise; +} diff --git a/sdk/notificationhubs/arm-notificationhubs/src/pagingHelper.ts b/sdk/notificationhubs/arm-notificationhubs/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 100644 --- a/sdk/notificationhubs/arm-notificationhubs/src/pagingHelper.ts +++ b/sdk/notificationhubs/arm-notificationhubs/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { @@ -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/notificationhubs/arm-notificationhubs/test/notificationhubs_examples.ts b/sdk/notificationhubs/arm-notificationhubs/test/notificationhubs_examples.ts index 74d180b542c4..d51fc649e30f 100644 --- a/sdk/notificationhubs/arm-notificationhubs/test/notificationhubs_examples.ts +++ b/sdk/notificationhubs/arm-notificationhubs/test/notificationhubs_examples.ts @@ -60,7 +60,20 @@ describe("NotificationHubs test", () => { }); it("namespaces create test", async function () { - const res = await client.namespaces.createOrUpdate(resourceGroup, nameSpaceName, { location: location }); + const res = await client.namespaces.beginCreateOrUpdateAndWait(resourceGroup, + nameSpaceName, + { + networkAcls: { + ipRules: [ + { ipMask: "185.48.100.00/24", rights: ["Manage", "Send", "Listen"] }, + ], + publicNetworkRule: { rights: ["Listen"] }, + }, + zoneRedundancy: "Enabled", + sku: { name: "Standard", tier: "Standard" }, + tags: { tag1: "value1", tag2: "value2" }, + location: location + }, testPollingOptions); assert.equal(res.name, nameSpaceName); }); @@ -71,6 +84,7 @@ describe("NotificationHubs test", () => { it("notificationHubs create test", async function () { const res = await client.notificationHubs.createOrUpdate(resourceGroup, nameSpaceName, notificationhubsName, { location: location }); + await delay(100000); assert.equal(res.name, notificationhubsName); }); @@ -97,6 +111,6 @@ describe("NotificationHubs test", () => { }); it("namespaces delete test", async function () { - const res = await client.namespaces.beginDeleteAndWait(resourceGroup, nameSpaceName, testPollingOptions); + const res = await client.namespaces.delete(resourceGroup, nameSpaceName); }); });